[Python-Dev] Odd new-style class new behavior (original) (raw)
Kevin Jacobs jacobs@penguin.theopalgroup.com
Sat, 30 Mar 2002 10:00:38 -0500 (EST)
- Previous message: [Python-Dev] When will your website be finished?
- Next message: [Python-Dev] Odd new-style class __new__ behavior
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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?
Thanks, -Kevin
-- Kevin Jacobs The OPAL Group - Enterprise Systems Architect Voice: (216) 986-0710 x 19 E-mail: jacobs@theopalgroup.com Fax: (216) 986-0714 WWW: http://www.theopalgroup.com
- Previous message: [Python-Dev] When will your website be finished?
- Next message: [Python-Dev] Odd new-style class __new__ behavior
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]