copy list into variable - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: copy list into variable (/thread-12123.html) |
copy list into variable - poroton - Aug-10-2018 Hi, I want to fill the variable "__adress" with content: class MyClass def __init__(self,**args): for key in argus: if key == "adress": __adress = argus[key].copy()I call it over: tmpVar = MyClass(adress=["foo","bar"]) RE: copy list into variable - Gribouillis - Aug-10-2018 Why not use the simpler class MyClass: def __init__(self, address): self.__address = list(address) |