Brendan Barnwell wrote:
> > No.  As I mentioned in the earlier thread, I don't support any proposal 
> in which an argument can "have a default" but that default is not a 
> first-class Python object of some sort.

What if a default is a function?

I was inspired by learning Django and saw in models that fields can have a 
default which is either a regular (early-bound) default such as a first-class 
Python object as one would expect, *or* a function -- which will be called 
'later' when needed.

That prompted me to contemplate a syntax for late-bound defaults, albeit a bit 
clunky, but I did think it suited a special-case requirement met by late-bound 
defaults. I still think that littering function arguments throughout all code 
with large numbers of arrows would make things less readable. Special 
requirements need special treatment, I'm thinking.

The problem is passing arguments to such a function without it looking like 
it's being called at definition time.
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/PJNVHV3UY5L67GDEZWGXMRPIL6SN4563/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to