I’m creating a class from a dictionary like this:
class MyClass:
def __init__(self, dictionary):
for k, v in dictionary.items():
setattr(self, k, v)
I’m trying to figure out how I can get Intellisense for this dynamically generated class. Most IDEs can read pyi files for this sort of thing.
Do the attributes of MyClass vary dynamically, or are they fixed and only populated from the dict out of convenience?
I don’t want to write out a pyi file manually though.
Is it possible to instantiate this class and programmatically write a pyi file to disk from it?
https://sign.zoho.eu/zsstateless#/review/234b4d535f495623f360dbff2645d4de37f2b5a9a4ac36105b4cde3aa97ebb28807b89888d167bb2faa2080ea78e72f7f0dc0a950a23e17b4e660f60f68778a8b4c3338050749498810fb6f431213b7d6b7804cf64e47658?request_id=3865000001324307&action_id=3865000001324313&same_user=false&zs_user=false&user_loggedin=false&ishost=false&locale=fr&is_invoked_from_mail=true&is_doc_corrected=false&is_zoho_user=false
hsjsjsys jsbsbsbs is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.