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

Update core.py #98

Closed
wants to merge 2 commits into from
Closed

Update core.py #98

wants to merge 2 commits into from

Conversation

jkienegger
Copy link
Contributor

make inverse_mode to keyword only

make inverse_mode to keyword only
@@ -195,7 +195,7 @@ class ArrayInterval:
from_str = staticmethod(ArrayInterval_from_str)
inverse_mode = False

def __init__(self, array, inverse_mode: bool = False):
def __init__(self, array, *ignore, inverse_mode: bool = False):
Copy link
Member

Choose a reason for hiding this comment

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

def __init__(self, array, *, inverse_mode: bool = False): does exactly what you want without the TypeError below.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But we want the type error, or not?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So we know, e.g. the parameter we gave has no purpose?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, I understand, i didn't know it worked like this

keyword only from PEP 3102
@jkienegger jkienegger closed this Mar 15, 2024
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