Skip to content
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

PEP 0418: Fix LGTM.com recommendation: First parameter of a method is not named 'self' #2078

Merged
merged 1 commit into from
Sep 20, 2021
Merged

PEP 0418: Fix LGTM.com recommendation: First parameter of a method is not named 'self' #2078

merged 1 commit into from
Sep 20, 2021

Conversation

DimitriPapadopoulos
Copy link
Contributor

Normal methods should have at least one parameter (the first of which should be 'self').

Fixes some of these LGTM.com recommendations:
https://lgtm.com/projects/g/python/peps/?severity=recommendation

… 'self'

Normal methods should have at least one parameter (the first of which should be 'self').
@vstinner
Copy link
Member

Merged, thanks.

Oh, I completely forgot about this file. It's mentioned in the PEP. The current code doesn't work, the fix is correct. The _UNIX_CLOCK_MONOTONIC code doesn't work (the code is skipped), it requires a special "_time" module which doesn't exist :-p

@DimitriPapadopoulos
Copy link
Contributor Author

Oh, _time is actually os:
https://github.com/python/peps/blob/e4f13def1435/pep-0418/clockutils.py#L19

# the module exposing OS clock features
_time = os

@DimitriPapadopoulos
Copy link
Contributor Author

But unfortunately os.clock_getres() does not exist.

@DimitriPapadopoulos
Copy link
Contributor Author

But time.clock_getres() does exist (new in version 3.3).

Perhaps the code needs to be updated for Python >= 3.3.

@vstinner
Copy link
Member

Perhaps the code needs to be updated for Python >= 3.3.

This script was a test to experiment the PEP. The final implementation is different. It doesn't matter to matter the script anymore, since Python now implements time.monotonic() and time.clock_getres() (differently).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants