[Zope-Coders] RE: [Zope-Checkins] CVS: Zope/doc - INSTALL.txt:1.32

Shane Hathaway shane@zope.com
Thu, 30 May 2002 13:18:11 -0400


Guido van Rossum wrote:
> I think it would be nice if the issues were captured in a Wiki like
> Brian did for 2.1.  But since that doesn't exist (and I'm not going to
> set it up myself):

I figured it might be good to just chat first anyway.

>>- We often have to use type() instead of isinstance() because we're 
>>using ExtensionClass.
> 
> 
> Are you saying ExtensionClass instances don't support isinstance?

Hmm, I just checked, and Python 2.2(.1) apparently has a fix that makes 
ExtensionClass and isinstance() play together nicely.  Previously, 
isinstance() didn't think ExtensionClass instances were classes, so it 
raised a TypeError.

>>- You can't use new-style classes, metaclasses, and descriptors in 
>>Python Scripts.  (You never could, because you can't declare a name that 
>>starts with an underscore.  I know Jim doesn't like this rule, but it 
>>avoids both current and *future* security issues.  And you don't have 
>>access to the "object" builtin.)
> 
> 
> Won't you have access to builtins like 'int' or 'str' that let you
> create subclasses?

Ah-ha, good point.  We could take two approaches to this: investigate 
whether that's a problem, or ban class creation in scripts.  You can 
create classes in scripts today but it's so restricted that it's not 
really worth having the capability.

>>- You can append "object" to the list of base classes of an 
>>ExtensionClass subclass.  What does that do, I wonder?
> 
> 
> When you do this to a classic class, the result is a new-style class.
> I expect that when you mix an ExtensionClass and object as base
> classes, you'll get a metaclass conflict error.

Check this out.  It depends on the order!

[shane@shane python]$ python
Python 2.2.1 (#1, May 10 2002, 11:57:27)
[GCC 2.96 20000731 (Mandrake Linux 8.1 2.96-0.63.1mdk)] on linux-i386
Type "help", "copyright", "credits" or "license" for more information.
 >>> from ExtensionClass import Base
 >>> class b(Base, object): pass
...
 >>> class b(object, Base): pass
...
Traceback (most recent call last):
   File "<stdin>", line 1, in ?
TypeError: metatype conflict among bases

>>- I don't know whether iterators are allowed, but they should be.
> 
> 
> They are hard to avoid; all sorts of constructs now create iterators,
> and there are methods like dict.iterkeys() or "for key in dict".  Or
> maybe I misunderstand what you said.

I think we agree. :-)

>>- The build process didn't work unless you had a Makefile.pre.in, which 
>>isn't available anymore in Python 2.2.  I created a distutils-based 
>>setup.py.
> 
> 
> Matt Behrens is working on a replacement, although I'm not sure what
> his enhancements are about.

Matt, can you clarify this?

Shane