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

Small incompatibility with Python 3.14 #121

Open
frenzymadness opened this issue Oct 30, 2024 · 1 comment · May be fixed by #122
Open

Small incompatibility with Python 3.14 #121

frenzymadness opened this issue Oct 30, 2024 · 1 comment · May be fixed by #122

Comments

@frenzymadness
Copy link

This is no longer allowed in Python 3.14:

if lt is NotImplemented:

According to https://docs.python.org/3.14/whatsnew/3.14.html:

Using NotImplemented in a boolean context will now raise a TypeError. It had previously raised a DeprecationWarning since Python 3.9. (Contributed by Jelle Zijlstra in gh-118767.)

@hroncok
Copy link

hroncok commented Oct 30, 2024

It's actually the line bellow:

if lt is NotImplemented:
return not self.__lt__(other)

That causes this.

See the test failure:

    def __gt__(self, other):
        lt = other.__lt__(self)
        if lt is NotImplemented:
>           return not self.__lt__(other)
E           TypeError: NotImplemented should not be used in a boolean context

frenzymadness added a commit to frenzymadness/boolean.py that referenced this issue Nov 11, 2024
Using NotImplemented in a boolean context will now raise
a TypeError. It had previously raised a DeprecationWarning since
Python 3.9.

Fixes: bastikr#121
@frenzymadness frenzymadness linked a pull request Nov 11, 2024 that will close this issue
frenzymadness added a commit to frenzymadness/boolean.py that referenced this issue Nov 18, 2024
Using NotImplemented in a boolean context will now raise
a TypeError. It had previously raised a DeprecationWarning since
Python 3.9.

Fixes: bastikr#121
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 a pull request may close this issue.

2 participants