On Dec 29, 7:17 pm, Istvan Albert <[EMAIL PROTECTED]> wrote:
> On Dec 29, 12:50 pm, bukzor <[EMAIL PROTECTED]> wrote:
>
> > Is this functionality intended? It seems very unintuitive. This has
> > caused a bug in my programs twice so far, and both times I was
> > completely mystified until I realized that the default value was
> > changing.
>
> it is only unintuitive when you do not know about it
>
> once you realize how it works and what it does it can actually be very
> useful
>
> i.

I agree it is a potentially useful feature, yet it can still bite you
even after a decade of Python... Scenario: long running server
process, Bug report: "people aren't getting older", Code:

   def age(dob, today=datetime.date.today()):
       ...

None of my unit tests caught that one :-)

-- bjorn
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to