Deprecation warnings (2.7 -> 3 )

R

rusi

In trying to get from 2.x to 3 Terry suggested I use 2.7 with
deprecation warnings


Heres the (first) set

DeprecationWarning: Overriding __eq__ blocks inheritance of __hash__
in 3.x
DeprecationWarning: callable() not supported in 3.x; use isinstance(x,
collections.Callable)

Is there one place/site I can go to for understanding all these and
trying to clear them?
 
T

Terry Reedy

In trying to get from 2.x to 3 Terry suggested I use 2.7 with
deprecation warnings


Heres the (first) set

DeprecationWarning: Overriding __eq__ blocks inheritance of __hash__
in 3.x
DeprecationWarning: callable() not supported in 3.x; use isinstance(x,
collections.Callable)

Is there one place/site I can go to for understanding all these and
trying to clear them?

Not that I know of, but it would be a good idea. You could suggest on
the tracker the addition of HOW TO Clear Deprecation Warnings, 2.7.
There would need to be a new one for each release, based on grepping the
codebase.
 
N

nn

In trying to get from 2.x to 3 Terry suggested I use 2.7 with
deprecation warnings

Heres the (first) set

DeprecationWarning: Overriding __eq__ blocks inheritance of __hash__
in 3.x
DeprecationWarning: callable() not supported in 3.x; use isinstance(x,
collections.Callable)

Is there one place/site I can go to for understanding all these and
trying to clear them?

I don't know any place that explains those. But the second is a pretty
straightforward: replace "callable(x)" by "isinstance(x,
collections.Callable)"

The first one is more tricky. You have to find the class with a __eq__
method in it and copy and paste the __hash__ method from its
superclass into itself.
 
N

nn

I don't know any place that explains those. But the second is a pretty
straightforward: replace "callable(x)" by "isinstance(x,
collections.Callable)"

The first one is more tricky. You have to find the class with a __eq__
method in it and copy and paste the __hash__ method from its
superclass into itself.

And BTW callable was deprecated in 3.0 and then added back in for 3.2.
So if you decide to not support 3.0 and 3.1 you would be fine just
leaving it as is.
 
R

rusi

I don't know any place that explains those. But the second is a pretty
straightforward: replace "callable(x)" by "isinstance(x,
collections.Callable)"
Of course. I was asking for more generic instructions/suggestions on
porting like what you've given below

[Say I get 25 more such warnings... And then moving to 3.2 I get
errors...]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top