News for hackers. Stuff that matters.
Re:What Python learned from economics by cabalamat on Wednesday November 19, 2008 @10:45AM (#369535)
Regarding the code:

  l = []
  def f(param = l): pass
  def g(param = []): pass
I would say f should be a syntax error, as languages shouldn't allow a default parameter to be an expression. If people wanted that behavour, they could write:

   def f(param =[]):
      if param==[]: param = l
      #...etc...
Re:What Python learned from economics by jerf on Thursday November 20, 2008 @07:20PM (#371248)
In Python, [] is an expression too; it is an expression that constructs an empty list and returns it.

Again, if you change this just for argument lists, you're looking at another wart.

I'm not disagreeing with you. Your logic makes sense in isolation. However, language design invariably requires this sort of tradeoff.