How to get type of object's attribute in python -


assume have following class:

class myclass():     def __init__(self, number):         self.mystr = "bla"         self.myint = number * 3 

how the attributes types? mean want following list: ['str','int']?

i want work on derived classes.

thanks lot :)

use type() function. can use print out variable type this:

print(type(variable_name)) 

Comments

Popular posts from this blog

python Tkinter Capturing keyboard events save as one single string -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

javascript - Z-index in d3.js -