encapsulating a global variable

Musbur musbur at posteo.org
Tue Feb 25 07:50:43 EST 2020


Am 25.02.2020 13:38 schrieb BlindAnagram:
> and I am wondering if it is possible to use a class something like
> 
> class get_it(object):
> 
>   seen = dict()
> 
>   def __call__(piece):
>     return seen[piece]

What happened when you tried it?



More information about the Python-list mailing list