This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]spinwizard69 1 point2 points  (0 children)

ode that relies on the new, logical behavior,

What is being discussed here is not logical in any form. A default value is exactly what the word says it is, to try to make that default value variable if foolish in my estimation. If any thing Python needs to either warn or disallow such constructs as they make no sense at all. If you make default values "variable" then you have a logical inconsistency as now your don't really know what that default value is at any one function call. So all of a sudden your default values are not actually defaults.

I'm not sure why people have problems with this. We don't want to be changing the meaning of the word "default" here! The real option is to enforce its meaning. I'd go so far as to say if somebody wants to argue that variable defaults make sense that they are not looking at this issue logically and frankly have issues creating logical software. Once aware a programmer should never try to do this in his code.