[Python-ideas] Documenting Python warts

Oleg Broytman phd at phdru.name
Wed Jan 2 04:16:16 CET 2013


On Wed, Jan 02, 2013 at 11:07:58AM +1000, Nick Coghlan <ncoghlan at gmail.com> wrote:
> Mutable default arguments make perfect sense once you
> understand the difference between compile time, definition time and
> execution time for a function. Defaults are evaluated at definition
> time, thus they are necessarily shared across all invocations of the
> function.

   I.e., users have to understand the current implementation. Mutable
defaults are not a language design choice, they are dictated by the
implementation, right?

Oleg.
-- 
     Oleg Broytman            http://phdru.name/            phd at phdru.name
           Programmers don't die, they just GOSUB without RETURN.



More information about the Python-ideas mailing list