A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2002-May/024259.html below:

[Python-Dev] Re: [Python-checkins] python/dist/src/Lib types.py,1.26,1.27

[Python-Dev] Re: [Python-checkins] python/dist/src/Lib types.py,1.26,1.27Skip Montanaro skip@pobox.com
Wed, 22 May 2002 11:58:09 -0500
    Guido> I don't see where I'm forcing people to use isinstance().

Assume you've got a module that uses elements of the types module.  Now you
need to add some code to it that manipulates boolean objects.  Without
BooleanType you have two choices:

    * convert all your uses of types.* objects to use isinstance() or "type(x)
      is something".  Your code is uniform.

    * leave your use of types.* objects alone and just use isinstance() or
      "type(x) is bool" for boolean objects.  Your code works, but treats
      booleans different than other objects.

All I'm doing by adding BooleanType to types is providing a third option:

    * do nothing.  

Given that types is not yet deprecated, I think that's a viable option.  I'd
be happy to see the types module deprecated, but it isn't at this point in
time, so I believe it should support BooleanType. 

    Guido> I think the plan is to stop recommending the types module --
    Guido> maybe deprecating it too.

deprecate-away-ly, y'rs,

Skip






RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4