Skip to content

add types to sys.getrefcount #237

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 2, 2016
Merged

Conversation

tharvik
Copy link
Contributor

@tharvik tharvik commented Jun 1, 2016

getrefcount works on any object. It nicer to be explicit in stubs.

@@ -122,7 +122,7 @@ def getcheckinterval() -> int: ... # deprecated
def getdefaultencoding() -> str: ...
def getdlopenflags() -> int: ... # Unix only
def getfilesystemencoding() -> str: ... # cannot return None
def getrefcount(object) -> int: ...
def getrefcount(object: Any) -> int: ...
Copy link
Member

Choose a reason for hiding this comment

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

Could you rename the argument? E.g. to arg.

Also please do the 2.7 version too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

But changing the name of the argument will make a perfect valid python code fail (explicit kwargs)

import sys

sys.getrefcount(object=1)

gives

asd2.py:3: error: Unexpected keyword argument "object" for "getrefcount"

@gvanrossum gvanrossum merged commit a32d8a9 into python:master Jun 2, 2016
@tharvik tharvik deleted the improve_sys branch June 2, 2016 07:45
hswong3i pushed a commit to alvistack/python-typeshed that referenced this pull request May 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants