Le 28/02/2017 à 13:27, Markus Meskanen a écrit :
> Well you could just use a dict subclass here with get() that takes
> callable...
> 

As I said to Angelico:


Yes but this assumes:

- I have access to the code instantiating conf;
- all code using conf are using load_from_db as a default value;
- load_from_db exists for all code using the conf object

There is always a solution to all problems, as Python is turing complete.

You don't need list comprehension, you can use a for loop.

You don't need upacking you can use indexing.

And you don't need lazy, it's just convenient.
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to