P
Peng Yu
Hi,
'open' is not a function according to inspect module. But according to
help(open), it is a function. Is there something wrong with inspect
module?
$ cat main.py
#!/usr/bin/env python
import inspect
def hello():
print "Hello World!"
return
print inspect.isfunction(str)
print inspect.isfunction(open)
print inspect.isfunction(hello)
$ ./main.py
False
False
True
Help on built-in function open in module __builtin__:
open(...)
open(name[, mode[, buffering]]) -> file object
Open a file using the file() type, returns a file object. This is the
preferred way to open a file.
'open' is not a function according to inspect module. But according to
help(open), it is a function. Is there something wrong with inspect
module?
$ cat main.py
#!/usr/bin/env python
import inspect
def hello():
print "Hello World!"
return
print inspect.isfunction(str)
print inspect.isfunction(open)
print inspect.isfunction(hello)
$ ./main.py
False
False
True
Help on built-in function open in module __builtin__:
open(...)
open(name[, mode[, buffering]]) -> file object
Open a file using the file() type, returns a file object. This is the
preferred way to open a file.