Re: basic Class in Python

2010-01-19 Thread Richard Brodie
"bartc" wrote in message news:xl_4n.28001$ym4.5...@text.news.virginmedia.com... > Any particular reason why two, and not one (or three)? In some fonts it's > difficult to > tell how many as they run together. It follows the C convention for reserved identifers. -- http://mail.python.org/

Re: basic Class in Python

2010-01-18 Thread MRAB
bartc wrote: "Wolfgang Rohdewald" wrote in message news:mailman.1056.1263771299.28905.python-l...@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

Re: basic Class in Python

2010-01-18 Thread bartc
"Wolfgang Rohdewald" wrote in message news:mailman.1056.1263771299.28905.python-l...@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 An

Re: basic Class in Python

2010-01-17 Thread Wolfgang Rohdewald
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 -- Wolfgang -- http://mail.python.org/mailman/listinfo/python-list

Re: basic Class in Python

2010-01-17 Thread BarryJOgorman
On Jan 17, 11:09 pm, John Bokma wrote: > BarryJOgorman writes: > > class Person: > >     def _init_(self, name, job=None, pay=0): > >       def __init__(self, name, job=None, pay=0): > > Note 2x _ before and after init. > > -- > John Bokma                                                          

Re: basic Class in Python

2010-01-17 Thread Wolodja Wentland
On Sun, Jan 17, 2010 at 15:05 -0800, BarryJOgorman wrote: [...] > class Person: > def _init_(self, name, job=None, pay=0): ^^ --> __init__(self, ... It's __init__() not _init_()! Have fun learning Python! -- .''`. Wolodja Wentland : :' : `. `'` 4096R/CAF

Re: basic Class in Python

2010-01-17 Thread Peter Otten
BarryJOgorman wrote: > Working through Lutz's 'Learning Python' > > Trying to run the following code (from file person.py - see below): > > The file is held in Python31. > > at the Python31 prompt am entering ''person.py' > > Getting the following error: > Traceback (most recent call last) > F

Re: basic Class in Python

2010-01-17 Thread John Bokma
BarryJOgorman writes: > class Person: > def _init_(self, name, job=None, pay=0): def __init__(self, name, job=None, pay=0): Note 2x _ before and after init. -- John Bokma j3b Hacking & Hiking in Mexico - http://johnbokm

basic Class in Python

2010-01-17 Thread BarryJOgorman
Working through Lutz's 'Learning Python' Trying to run the following code (from file person.py - see below): The file is held in Python31. at the Python31 prompt am entering ''person.py' Getting the following error: Traceback (most recent call last) File "C:python31\person.py", line 9, in (modu