Deprecation warnings (2.7 -> 3 )

Discussion in 'Python' started by rusi, Dec 10, 2010.

  1. rusi

    rusi Guest

    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?
    rusi, Dec 10, 2010
    #1
    1. Advertising

  2. rusi

    Terry Reedy Guest

    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
    Terry Reedy, Dec 10, 2010
    #2
    1. Advertising

  3. rusi

    nn Guest

    On Dec 9, 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?


    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.
    nn, Dec 10, 2010
    #3
  4. rusi

    nn Guest

    On Dec 10, 11:17 am, nn <> wrote:
    > On Dec 9, 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?

    >
    > 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.
    nn, Dec 10, 2010
    #4
  5. rusi

    Tim Golden Guest

    On 10/12/2010 16:17, nn wrote:
    > On Dec 9, 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 quite an answer, but:

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

    TJG
    Tim Golden, Dec 10, 2010
    #5
  6. rusi

    rusi Guest

    On Dec 10, 9:17 pm, nn <> wrote:
    > On Dec 9, 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?

    >
    > 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.
    rusi, Dec 10, 2010
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ray Mitchell
    Replies:
    1
    Views:
    340
  2. Silas Snider

    StringBufferInputStream deprecation

    Silas Snider, Aug 25, 2004, in forum: Java
    Replies:
    2
    Views:
    4,620
    Simon Fairfax
    Aug 25, 2004
  3. Replies:
    9
    Views:
    6,154
    John B. Matthews
    Apr 20, 2009
  4. rh0dium
    Replies:
    7
    Views:
    2,194
    Simon Forman
    Oct 26, 2009
  5. Ted Sung
    Replies:
    1
    Views:
    299
    Sherm Pendley
    Aug 30, 2004
Loading...

Share This Page