Misc questions about type objects and Python 3.0

Steve Holden sholden at holdenweb.com
Tue Oct 8 07:55:16 EDT 2002


"Carl Banks" <imbosol at vt.edu> wrote ...
>
>
> 1. Is it the plan that Python 3.0 be binary compatible with Python
>    2.x?
>
Seems unlikely, given that 2.0 isn't binary compatible with 2.2. By which I
mean that the opcodes in .pyc files can be changed from version to version,
and object layouts in memory will also vary.

I *believe* that "3.0", formerly "Python 3000", is intended to give the
designers more freedom by not placing quite such compatibility constraints
on them. I also believe it will be quite a while before we see it.

> 2. If it isn't (I'm guessing it will be), is it the plan to keep
>    reference counting?  It seems to me that getting rid of reference
>    counting might be the first step to getting rid of the GIL.
>
The reference counting isn't an essential feature of garbage collection
(Jython, for example, doesn't use it). Neither is it the reference counting
that requires the GIL. However, getting rid of the GIL would be a HUGE task
given its pervasive presence in the interpreter.

> 3. The docs say types choose their member resolution order (?), but
>    I'm wondering if that's just a temporary hack to support both
>    old-style and new-style classes.  After old-style classes are
>    dropped, will MRO be fixed for all types?  (And is it really that
>    useful for it to be customizable?)
>
There is current work on an update to the mro, which may even make it into
2.3 (or possible even into 2.2.2 if it doesn't bite any of the testers),
making it use a more reasonable definition.

> 4. What is the point of having both tp_base and tp_bases in the type
>    structure?
>
Use the source, Luke :-)

> 5. What's the deal with unification of numeric types?  What's expected
>    or planned or hoped for in 3.0?
>
Who knows? By then, certainly, integer division will be a separate
operation. But whether there will be a rational type, or a decimal type,
nobody yet really knows. We are talking *way* over the horizon here.

regards
-----------------------------------------------------------------------
Steve Holden                                  http://www.holdenweb.com/
Python Web Programming                 http://pydish.holdenweb.com/pwp/
Previous .sig file retired to                    www.homeforoldsigs.com
-----------------------------------------------------------------------






More information about the Python-list mailing list