Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion 2 Doc/howto/descriptor.rst
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ this::
. . .
def __get__(self, obj, objtype=None):
"Simulate func_descr_get() in Objects/funcobject.c"
return types.MethodType(self, obj, objtype)
return types.MethodType(self, obj)

@DimitrisJim DimitrisJim May 29, 2017

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A relic of the unbound-method days, seems it was never removed when the rest was. A relic of the unbound-method days, seems it was never removed when the rest was in the ff73795 changeset.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want me to remove that as well? I left it because I think the signature should match __get__(self, instance, owner) as in regular descriptors right?

btw, I did sign the CLA, please check and let me know if I need to review.

@DimitrisJim DimitrisJim May 29, 2017

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want me to remove that as well?

You're right, it should match, it was my initial brainfart.

I did sign the CLA, please check and let me know if I need to review.

You should wait at least a day until it gets checked, see https://docs.python.org/devguide/pullrequest.html#licensing


Running the interpreter shows how the function descriptor works in practice::

Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.