Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Deprecation warnings (2.7 -> 3 )

Reply
Thread Tools

Deprecation warnings (2.7 -> 3 )

 
 
rusi
Guest
Posts: n/a
 
      12-10-2010
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?
 
Reply With Quote
 
 
 
 
Terry Reedy
Guest
Posts: n/a
 
      12-10-2010
On 12/9/2010 10:15 PM, rusi wrote:
> 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.

--
Terry Jan Reedy

 
Reply With Quote
 
 
 
 
nn
Guest
Posts: n/a
 
      12-10-2010
On Dec 9, 10:15*pm, rusi <rustompm...@gmail.com> wrote:
> 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.
 
Reply With Quote
 
nn
Guest
Posts: n/a
 
      12-10-2010
On Dec 10, 11:17*am, nn <prueba...@latinmail.com> wrote:
> On Dec 9, 10:15*pm, rusi <rustompm...@gmail.com> wrote:
>
> > 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.


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.
 
Reply With Quote
 
Tim Golden
Guest
Posts: n/a
 
      12-10-2010
On 10/12/2010 16:17, nn wrote:
> On Dec 9, 10:15 pm, rusi<rustompm...@gmail.com> wrote:
>> 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 quite an answer, but:

http://docs.python.org/dev/py3k/whatsnew/3.0.html

TJG
 
Reply With Quote
 
rusi
Guest
Posts: n/a
 
      12-10-2010
On Dec 10, 9:17*pm, nn <prueba...@latinmail.com> wrote:
> On Dec 9, 10:15*pm, rusi <rustompm...@gmail.com> wrote:
>
> > 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)"

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...]
>
> 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.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Python 2.6 Deprecation Warnings with __new__ — Can someone explain why? rh0dium Python 7 10-26-2009 05:55 PM
Suppress deprecation warnings jothi.padmanabhan@gmail.com Java 9 04-20-2009 08:58 PM
MCSBNGP+++ Public apology on behalf of Frisbee(R) (with bonus self-deprecation) /* MCSBNGP+++ #270-290-291-293-294-298-299# */ MCSE 21 07-29-2005 05:09 PM
use warnings; and use Warnings; give different results Ted Sung Perl Misc 1 08-30-2004 10:22 PM
How to set -deprecation in Sun Studio 5 Ray Mitchell Java 1 11-09-2003 08:02 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57