Steven Bethard wrote:
That is, you can just keep track of all the names of a Robot in the Robot object. In the simple case, where there's only one name, you can display it as such. In the more complicated case, where there's some aliasing, you can display the multiple aliases. This means you don't have to teach about aliasing right off the bat, but if a student accidentally discovers it on their own, the machinery's there to explain it...

Incidentally, this discussion made me realise the real reason why using a lambda to create a named function is evil:


Py> def f(): pass
...
Py> f.func_name
'f'
Py> f = lambda: None
Py> f.func_name
'<lambda>'

I think I've heard that explanation before, but it never really clicked.

Cheers,
Nick.

--
Nick Coghlan   |   [EMAIL PROTECTED]   |   Brisbane, Australia
---------------------------------------------------------------
            http://boredomandlaziness.skystorm.net
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to