This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mloskot
Recipients benjamin.peterson, cjw296, eric.araujo, georg.brandl, mloskot
Date 2012-06-07.17:16:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1339089415.96.0.0474727789745.issue4442@psf.upfronthosting.co.za>
In-reply-to
Content
Is this report about documenting of the concept of immutable types in Python in general or regarding existing built-in types, like datetime.datetime?

Generally, the concept of immutable type with relation to tp_new is mentioned (sneaked) here:

1) http://docs.python.org/release/3.2.2/c-api/typeobj.html

"A good rule of thumb is that for immutable types, all initialization should take place in tp_new, while for mutable types, most initialization should be deferred to tp_init."

2) http://www.python.org/dev/peps/pep-0253/

Note that for immutable object types, the initialization
cannot be done by the tp_init() slot: this would provide the Python 
user with a way to change the initialization.  Therefore, immutable
objects typically have an empty tp_init() implementation and do
all their initialization in their tp_new() slot.

IMHO, it deserves a dedicated section/chapter in the docs.
History
Date User Action Args
2012-06-07 17:16:56mloskotsetrecipients: + mloskot, georg.brandl, cjw296, benjamin.peterson, eric.araujo
2012-06-07 17:16:55mloskotsetmessageid: <1339089415.96.0.0474727789745.issue4442@psf.upfronthosting.co.za>
2012-06-07 17:16:55mloskotlinkissue4442 messages
2012-06-07 17:16:54mloskotcreate