Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sets module deprecated warning

Tags:

python

When I run my python script I get the following warning

DeprecationWarning: the sets module is deprecated 

How do I fix this?

like image 703
Dave Avatar asked Jan 11 '10 08:01

Dave


People also ask

How do I stop deprecation warning in Python?

If you wish to squelch deprecation warnings, you can start Python with -Wi::Deprecation. This sets all deprecation warnings to ignored. There is also an Astropy-specific AstropyDeprecationWarning which can be used to disable deprecation warnings from Astropy only.

What is a deprecated module?

Deprecated Modules is a module that will warn game masters whenever they use a module that they shouldn't be using anymore. This includes modules that have been integrated into core Foundry, modules that have been entirely replaced by other modules, and modules that have broken and are no longer being maintained.

What is deprecation warning in Python?

To warn about deprecation, you need to set Python's builtin DeprecationWarning as category. To let the warning refer to the caller, so you know exactly where you use deprecated code, you have to set stacklevel=2 .


1 Answers

Stop using the sets module, or switch to an older version of python where it's not deprecated.

According to pep-004, sets is deprecated as of v2.6, replaced by the built-in set and frozenset types.

like image 68
James Polley Avatar answered Oct 02 '22 11:10

James Polley