]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
Surprising fix for SF bug 563060: module can be used as base class.
authorGuido van Rossum <guido@python.org>
Tue, 4 Jun 2002 05:58:34 +0000 (05:58 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 4 Jun 2002 05:58:34 +0000 (05:58 +0000)
commit2e4e02620bc118c57270519c7d5f3e76996b3841
treee359f0926879c699fcbb5ca01b726b5a359c7cf2
parentc3a787e090dce76149ae86d70d4fecea3c285a40
Surprising fix for SF bug 563060: module can be used as base class.

Change the module constructor (module_init) to have the signature
__init__(name:str, doc=None); this prevents the call from type_new()
to succeed.  While we're at it, prevent repeated calling of
module_init for the same module from leaking the dict, changing the
semantics so that __dict__ is only initialized if NULL.

Also adding a unittest, test_module.py.

This is an incompatibility with 2.2, if anybody was instantiating the
module class before, their argument list was probably empty; so this
can't be backported to 2.2.x.
Misc/NEWS