2.2 features

William Tanksley wtanksle at dolphin.openprojects.net
Wed Aug 1 15:42:16 EDT 2001


On Tue, 31 Jul 2001 23:28:54 -0400, Guido van Rossum wrote:
>> I'm starting to like the is{subclass,instance}() version. It's probably
>> quicker for one to understand code written by others, and for
>> non-fulltime-python-programmers to remember what "in" means in each
>> context.

>You may be right.  isinstance() and issubclass() are somewhat standard
>in other languages I believe, and hard to misunderstand.  The form
>  if x in list: ...
>looks a lot more confusing.  I may withdraw this idea.

If you insist.  I think "x in type" is cleaner than isinstance(x,type).
The main problem with the second one is that it requires memory of the
order of the arguments, as well as the name of the syntax.

I do admit that "for x in type" is a nasty surprise, though.  I can't
think of anything obvious to do with that.  Aside from having classes and
types be capable of returning their own iterators, of course.  (That would
be an odd way of allowing introspection.)

>--Guido van Rossum (home page: http://www.python.org/~guido/)

-- 
-William "Billy" Tanksley



More information about the Python-list mailing list