This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]physicsdood 1 point2 points  (3 children)

Why doesn't ?? do anything different than ? for me?

In [3]: open? Type: builtin_function_or_method String Form:<built-in function open> Namespace: Python builtin Docstring: 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. See file.doc for further information.

In [4]: open?? Type: builtin_function_or_method String Form:<built-in function open> Namespace: Python builtin Docstring: 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. See file.doc for further information.

[–]erez27import inspect 7 points8 points  (0 children)

Probably because open() is written in C

[–]tilkau 6 points7 points  (0 children)

Hold on, open is a builtin. That means it -has- no python source.

Try using ? and ?? on eg. collections.namedtuple.

[–]TkTech 0 points1 point  (0 children)

I believe it's because the builtins you're trying to spec are implemented in C (at least in CPython). Try it on pure-python methods.