Odd new-style class __new__ behavior

March 30, 2002
3 p.m.
1
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() 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
8358
Age (days ago)
8358
Last active (days ago)
0 comments
1 participants
participants (1)
-
Kevin Jacobs