A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2015-January/137932.html below:

[Python-Dev] Any grammar experts?

[Python-Dev] Any grammar experts? [Python-Dev] Any grammar experts?Antoine Pitrou solipsis at pitrou.net
Tue Jan 27 00:07:08 CET 2015
On Mon, 26 Jan 2015 16:28:24 -0500
"R. David Murray" <rdmurray at bitdance.com> wrote:
> 
> My use case is a configuration method that takes keyword parameters.
> In tests I want to specify a bunch of default values for the
> configuration, but I want individual test methods to be able
> to override those values.  So I have a bunch of code that does
> the equivalent of:
> 
> from test.support import default_config
> [...]
>     def _prep(self, config_overrides):
>         config = default.config.copy()
>         config.update(config_overrides)
>         my_config_object.load(**config)
>         ....
> 
> With the current proposal I could instead do:
> 
>     def _prep(self, config_overrides):
>         my_config_object.load(**default_config, **config_overrides)

It sounds like the _prep() method exists once in your code base, this
isn't an idiom you are duplicating everywhere. The incentive for a
syntactic shortcut looks pretty thin.

Regards

Antoine.


More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4