RE: Need to pass a class instance to a gettext fallback

2017-09-09 Thread Josef Meile
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):

RE: Need to pass a class instance to a gettext fallback

2017-09-08 Thread Peter Otten
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

RE: Need to pass a class instance to a gettext fallback

2017-09-08 Thread Josef Meile
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

Re: Need to pass a class instance to a gettext fallback

2017-09-07 Thread Peter Otten
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

Need to pass a class instance to a gettext fallback

2017-09-07 Thread Josef Meile
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