diff options
author | Guido van Rossum <guido@python.org> | 2001-08-16 09:18:56 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2001-08-16 09:18:56 (GMT) |
commit | c35422109b36d20f409a3a72f60c0c7e2e0bc824 (patch) | |
tree | 361f6efa619212bddc3789f37ddde4ba6142be55 /Objects/dictobject.c | |
parent | 83f56cb2dbb0e5df04ae2a6d2847991449cfde6b (diff) | |
download | cpython-c35422109b36d20f409a3a72f60c0c7e2e0bc824.zip cpython-c35422109b36d20f409a3a72f60c0c7e2e0bc824.tar.gz cpython-c35422109b36d20f409a3a72f60c0c7e2e0bc824.tar.bz2 |
Fix SF bug #442501: calculate __module__ properly.
- type_module(), type_name(): if tp_name contains one or more period,
the part before the last period is __module__, the part after that
is __name__. Otherwise, for non-heap types, __module__ is
"__builtin__". For heap types, __module__ is looked up in
tp_defined.
- type_new(): heap types have their __module__ set from
globals().__name__; a pre-existing __module__ in their dict is not
overridden. This is not inherited.
- type_repr(): if __module__ exists and is not "__builtin__", it is
included in the string representation (just as it already is for
classes). For example <type '__main__.C'>.
Diffstat (limited to 'Objects/dictobject.c')
0 files changed, 0 insertions, 0 deletions