Re: NoneType object not iterable

2007-07-13 Thread Paul Rubin
Stargaming <[EMAIL PROTECTED]> writes: > It does not turn into something. The `sort()` method just works "in > place", i. e. it will mutate the list it has been called with. It > returns None (because there is no other sensible return value). > > For you, that means: You don't have to distinguish

Re: NoneType object not iterable

2007-07-13 Thread Daniel
On Fri, 13 Jul 2007 21:13:20 +0300, Bjoern Schliessmann <[EMAIL PROTECTED]> wrote: > > Daniel wrote: > >> db is out of scope, you have to pass it to the function: > > What's wrong about module attributes? > I made a mistake -- http://mail.python.org/mailman/listinfo/python-list

Re: NoneType object not iterable

2007-07-13 Thread Bjoern Schliessmann
Daniel wrote: > db is out of scope, you have to pass it to the function: What's wrong about module attributes? Regards, Björn -- BOFH excuse #418: Sysadmins busy fighting SPAM. -- http://mail.python.org/mailman/listinfo/python-list

Re: NoneType object not iterable

2007-07-13 Thread Daniel
On Fri, 13 Jul 2007 20:44:13 +0300, <[EMAIL PROTECTED]> wrote: > > Hi! > My code is > > > db = {} > > >> def display(): >> keyList = db.keys() >> sortedList = keyList.sort() >> for name in sortedList: >> line = 'Name: %s, Number: %s' % (name, db[name]) >> print line.r

Re: NoneType object not iterable

2007-07-13 Thread Stargaming
[EMAIL PROTECTED] schrieb: > Hi! > My code is > > > db = {} > > > >> def display(): >> keyList = db.keys() >> sortedList = keyList.sort() >> for name in sortedList: >> line = 'Name: %s, Number: %s' % (name, db[name]) >> print line.replace('\r', '') > > > And it giv

NoneType object not iterable

2007-07-13 Thread tom
Hi! My code is > db = {} > > def display(): > keyList = db.keys() > sortedList = keyList.sort() > for name in sortedList: > line = 'Name: %s, Number: %s' % (name, db[name]) > print line.replace('\r', '') And it gives following error: > for name in sortedList: >