basic Class in Python

MRAB python at mrabarnett.plus.com
Mon Jan 18 20:04:08 CET 2010


bartc wrote:
> 
> "Wolfgang Rohdewald" <wolfgang at rohdewald.de> wrote in message 
> news:mailman.1056.1263771299.28905.python-list at python.org...
>> On Monday 18 January 2010, BarryJOgorman wrote:
>>> TypeError: object._new_() takes no parameters
>>
>>>     def _init_(self, name, job=None, pay=0):
>>
>> __init__ needs two underscores left and right
> 
> Any particular reason why two, and not one (or three)? In some fonts 
> it's difficult to tell how many as they run together.
> 
I believe it was borrowed from C, which has __FILE__ and __LINE__
(CPython is written in C).

With hindsight, of course, single underscores would've been
sufficient...



More information about the Python-list mailing list