Hi Peter
>> language = kwargs['language']
>> del kwargs['language']
>
>Not really important, but there's a method for that:
>
>language = kwargs.pop("language")
Thanks, this looks better and I indeed think it is important. The "del ..."
line looks ugly.
>> def __init__(self, *args, **kwargs):
Josef Meile wrote:
> language = kwargs['language']
> del kwargs['language']
Not really important, but there's a method for that:
language = kwargs.pop("language")
> def __init__(self, *args, **kwargs):
> language = kwargs['language']
> del kwargs['language']
In Python 3 this can also
riginal Message-
From: Python-list [mailto:python-list-bounces+jmeile=hotmail....@python.org] On
Behalf Of Peter Otten
Sent: Freitag, 8. September 2017 08:15
To: python-list@python.org
Subject: Re: Need to pass a class instance to a gettext fallback
Josef Meile wrote:
> Hi
>
> I'm worki
Josef Meile wrote:
> Hi
>
> I'm working with gettext and need to define a language Fallback. I got
> this working, but with a global variable. I don't really like this and I
> would like to pass this variable to the gettext Fallback's contructor, but
> I don't know how. For simplicity, I won't pu
Hi
I'm working with gettext and need to define a language Fallback. I got this
working, but with a global variable. I don't really like this and I would like
to pass this variable to the gettext Fallback's contructor, but I don't know
how. For simplicity, I won't put the whole code here, just t