[Python-bugs-list] [ python-Bugs-638610 ] Instantiation init-less class with param

noreply@sourceforge.net noreply@sourceforge.net
Thu, 14 Nov 2002 11:53:32 -0800


Bugs item #638610, was opened at 2002-11-14 11:53
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=638610&group_id=5470

Category: Type/class unification
Group: Python 2.2.2
Status: Open
Resolution: None
Priority: 5
Submitted By: Shalabh Chaturvedi (shalabh)
Assigned to: Nobody/Anonymous (nobody)
Summary: Instantiation init-less class with param

Initial Comment:
Instantiation new style __init__-less class with
parameters does not raise exception. Old style classes
raise TypeError: this constructor takes no arguments.

Python 2.2.2 (#37, Oct 14 2002, 17:02:34) [MSC 32 bit
(Intel)] on win32
>>> class C:
...     pass
...
>>> c = C('extra', 'params')
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
TypeError: this constructor takes no arguments
>>>
>>> class C(object):
...     pass
...
>>> c = C('whos','eating','my', 'params')
>>> c
<__main__.C object at 0x007A49B8>
>>>

Who?


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=638610&group_id=5470