[Python-Dev] Odd new-style class new behavior (original) (raw)
Michael Hudson mwh@python.net
30 Mar 2002 15:08:04 +0000
- Previous message: [Python-Dev] Odd new-style class __new__ behavior
- Next message: [Python-Dev] Odd new-style class __new__ behavior
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Kevin Jacobs <jacobs@penguin.theopalgroup.com> writes:
Suppose I define:
class Foo(object): def new(cls): return 1 class Bar(object): def new(cls): return [1,2,3] Python 2.2 returns: print Foo() > 1 print Bar() > [] I would expect that Bar() should return [1,2,3]. Am I running into some clever undocumented feature or a bug?
Is tp_init being called on the returned list?
Cheers, M.
-- But since I'm not trying to impress anybody in The Software Big Top, I'd rather walk the wire using a big pole, a safety harness, a net, and with the wire not more than 3 feet off the ground. -- Grant Griffin, comp.lang.python
- Previous message: [Python-Dev] Odd new-style class __new__ behavior
- Next message: [Python-Dev] Odd new-style class __new__ behavior
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]