Jeremy Banks wrote: (proposing def <lhs>(<args>): ...
On Thu, Apr 23, 2009 at 11:52, Gary Herron <gher...@islandtraining.com> wrote:
Try this:
  def foo_bar():
      return(...)
  foo.bar = foo_bar
and this:
  def foo_bar():
      return(...)
  foo["bar"] = foo_bar
I understand that this is possible now, but I just don't see why it's
necessary to do it at all.

I am afraid it will make it too easy to define functions in other
modules remotely, a tempting sharp stick to poke your eye out with.
Note also, that it will not be so easy to find the definition of a
function provided as a argument to a failing function.  Right now
you can get the function name and (with a bit more effort) its module.
Imagine debugging a pile of code that includes a module with:
    import random
    def random.random():
        return .42

--Scott David Daniels
scott.dani...@acm.org
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to