D
Deep
If i start a python shell. Is there a way to list the currently defined
classes, methods,
variables?
classes, methods,
variables?
Deep said:If i start a python shell. Is there a way to list the currently defined
classes, methods,
variables?
Deep said:yes that works.
but, it gives one list, which contains everything.
now about inferring types?
Deep said:I have been looking a bit and am stuck at this point.
Given a string, how do i find what is the string bound to.
Let me give an example.
def deep():
print "Hello"
now inspect.ismethod(deep) returns true. (As it should).
But if I am trying to make a list of all bound methods), i use
dir(), which is a list of strings. I get the string "deep" from this
list.
How do I obtain the reference to the method it is bound to.
The same problem can be extended to attributes and classes.
Deep said:I have been looking a bit and am stuck at this point.
Given a string, how do i find what is the string bound to.
Let me give an example.
def deep():
print "Hello"
now inspect.ismethod(deep) returns true. (As it should).
But if I am trying to make a list of all bound methods), i use
dir(), which is a list of strings. I get the string "deep" from this
list.
>>> globals()['deep']
How do I obtain the reference to the method it is bound to.
The same problem can be extended to attributes and classes.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.