You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
# test builtin dir
|
|
|
|
|
|
|
|
# dir of locals
|
|
|
|
print('__name__' in dir())
|
|
|
|
|
|
|
|
# dir of module
|
|
|
|
import sys
|
|
|
|
print('platform' in dir(sys))
|
|
|
|
|
|
|
|
class Foo:
|
|
|
|
def __init__(self):
|
|
|
|
self.x = 1
|
|
|
|
foo = Foo()
|
|
|
|
print('__init__' in dir(foo))
|
|
|
|
print('x' in dir(foo))
|
|
|
|
|