[Zope-Coders] RE: [Zope-Checkins] CVS: Zope/doc - INSTALL.txt:1.32
Shane Hathaway
shane@zope.com
Thu, 30 May 2002 10:56:04 -0400
Brian Lloyd wrote:
> It's actually more than any particular issue like Makefile.pre.in.
> It's a question of resources. I'm not willing to make Python 2.2
> the "official" platform for 2.6 until we've done the requisite
> homework, and right now there is no one available to do it.
Ok. A good amount of work has gone into supporting Python 2.2, but it
has all been informal. We need a project simply assess the impact of
each change.
> While there are probably fewer changes from 2.1 -> 2.2, we still
> need to assess their impacts before making 2.2 the officially
> platform. In particular, I'd be surprised if new-style classes,
> descriptors, etc. didn't have some sort of impact (I _know_
> we use explicit type() checks in places where we probably
> wouldn't want to in 2.2).
Just to hopefully get the future project started, I'm going to answer
some of the questions (and add some questions of my own).
- We often have to use type() instead of isinstance() because we're
using ExtensionClass.
- 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.)
- You can append "object" to the list of base classes of an
ExtensionClass subclass. What does that do, I wonder?
> Another issue is making sure that none of the new features in
> 2.2 have a side effect of opening a trap door in the Zope 2
> security model - or a side effect of breaking things that people
> might expect to work. Will the Zope 2 security policy let you
> use an iterator? Can you write generators in Python Script objects?
> etc.
- You can't write generators in Python Scripts; they are specifically
disallowed. We could research whether they should be allowed but it's
really a YAGNI thing. :-)
- I don't know whether iterators are allowed, but they should be.
Some other changes already made:
- In Python 2.2, getattr with a default only captures AttributeErrors,
but HTTPRequest.__getattr__() was an alias for __getitem__().
HTTPRequest.__getattr__() now transforms the KeyErrors into AttributeErrors.
- 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.
Shane