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

Recognise magic methods #81

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Conversation

jalanb
Copy link

@jalanb jalanb commented Jun 22, 2022

Fixes #80

Adds the missing names to python.txt

Adds a test case to check a Python class which includes every possible magic method name

@jalanb
Copy link
Author

jalanb commented Jun 22, 2022

I see that the linting check failed, but that seems to because of the job setup rather than because of my code (?)

If you can let me know how to fix it I'd be happy to adjust as needed.

@MichaelAquilina
Copy link
Owner

MichaelAquilina commented Jun 29, 2022

Yep lining is broken but its not your fault :) I'll fix it on main, I'll let you know when to rebase

docstring
elif
endswith
enum
env
environ
eq
Copy link
Owner

Choose a reason for hiding this comment

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

Ideally we would only allow theses exclusively in the context of __ __. But right now there is no way to do that in flake8-spellcheck

Something for me to consider in the future :)

Copy link
Author

Choose a reason for hiding this comment

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

Yes - did think of that, especially the 2-letter names

I did some investigation, but not obvious how to achieve that

@MichaelAquilina
Copy link
Owner

@jalanb please rebase on latest main to fix the lint failure issue :)

@jalanb
Copy link
Author

jalanb commented Jun 29, 2022

Rebased from upstream's main, lints failed on black, fixed that

All tests now passing

jalanb and others added 5 commits April 18, 2023 10:11
Test a Python class with all possible dunder methods
These are valid names for magic methods
    But are already recognised as English (en_US)
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.

Recognise Python's magic methods
2 participants