On Tue, 7 Nov 2017 09:44:07 -0500
Yury Selivanov <yselivanov...@gmail.com> wrote:
> 
> One common pattern that I see frequently is this:
> 
>      def foo(**kwargs):
>           kwargs.pop('somekey', None)
>           bar(**kwargs)

I see it frequently too, but that's in code meant to be
Python 2-compatible (and therefore cannot count on any ordering
guarantee, even de facto). On Python 3 you can write:

   def foo(somekey=None, **kwargs):
       # do something with somekey?
       bar(**kwargs)

Regards

Antoine.
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to