difference 2.3 versus 2.2

Martin v. Löwis martin at v.loewis.de
Fri Jan 24 04:46:04 EST 2003


mis6 at pitt.edu (Michele Simionato) writes:

> Therefore, if I understand correctly, 'heap type' means 'user-defined type',
> as opposed to built-in typ). 

Roughly, yes. You can define a heap type using the C API if you want,
but they are typically defined through a class statement.

> This restriction (i.e. it is possible to change the __class__ attribute 
> only for heap types) should be reported in "What's new in Python 2.3", 
> since it is a change that breaks old code. I will send a copy of the 
> present mail to python-docs at python.org.

It would be much better if you posted a documentation patch to
sf.net/projects/python. 

I don't think this change is major enough to find mentioning in
"What's new"; I really doubt any real application will be affected by
that. It is listed in the NEWS file, as

- Assignment to __class__ is disallowed if either the old or the new
  class is a statically allocated type object (such as defined by an
  extension module).  This prevents anomalies like 2.__class__ = bool.

Regards,
Martin





More information about the Python-list mailing list