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

Dropping Python 2 support #59

Closed
Eric-Arellano opened this issue Dec 27, 2019 · 2 comments
Closed

Dropping Python 2 support #59

Eric-Arellano opened this issue Dec 27, 2019 · 2 comments

Comments

@Eric-Arellano
Copy link
Contributor

Hello. Thank you for this awesome library!

I'm wondering if you have thought about removing Python 2 support?

The main benefit would be being able to move the type hints from the type stub library directly to the source implementation. This would simplify things for type-hint users because type hints would work out of the box, rather than needing to install a separate library and needing to ensure that MyPy points to the stubs.

--

Thanks to setup.py's python_requires, Python 2 users would safely resolve ordered-set==3.1.1 when calling pip2 install ordered-set. Meanwhile, Python 3 users would resolve the newest version, e.g. ordered-set==4.0.0.

That is, this won't negatively impact Python 2 users at all outside of missing possible future changes (although, this library seems very stable already).

--

Given the go-ahead, I'd be happy to put up a PR that inlines the type hints, tweaks setup.py, and runs MyPy in CI.

(Type stubs give some issues to the wrapper around MyPy that I'm using, so I would love to see this change and am eager to help however possible.)

--

Finally, see https://python3statement.org for precedent from most of the Python ecosystem for no longer supporting Python 2 once it goes EOL in 5 days. Includes Pytest, TensorFlow, Apache Spark, and Requests. https://python3statement.org

@Eric-Arellano
Copy link
Contributor Author

I realized that the typing change does not in any way depend on dropping Python 2, thanks to PEP 561. See #60.

Due to the greater ecosystem initiative to drop support for Python 2, I still personally think it would be great to drop Python 2 support for new releases, although I understand possibly not wanting to do this because the burden of Python 2 support is so minimal for this library.

The benefits (I see) to dropping are:

  • Support the greater ecosystem initiative to drop Python 2.
  • Can use modern versions of tools like Pytest 5, whereas now you'd need to use Pytest 4.
  • Can inline the type hints, which improves code readability and reduces duplication.
  • Remove the collections vs. collections.abc compatibility code.

The downside is Python 2 users missing out on any future changes to this library (although they can keep using 3.1.1.). ordered-set seems to be a very foundational library and the maintenance burden is light, so I think both choices are compelling and justified.

Either way, thanks again for this awesome library!

@rspeer
Copy link
Owner

rspeer commented Feb 4, 2020

I'm definitely interested in dropping Python 2 support and have a branch where I've done that, bringing the type hints inline. Would you like to take a look at #61 ?

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

No branches or pull requests

2 participants