Skip to content

Initial work to drop Python 2 support#17

Open
pabloyoyoista wants to merge 18 commits intoexaxorg:masterfrom
combine-control-systems:drop-python2
Open

Initial work to drop Python 2 support#17
pabloyoyoista wants to merge 18 commits intoexaxorg:masterfrom
combine-control-systems:drop-python2

Conversation

@pabloyoyoista
Copy link
Copy Markdown
Collaborator

There are surely a lot more cleanups that can be done, but this is a start

Fixes #8

@pabloyoyoista
Copy link
Copy Markdown
Collaborator Author

Last commits fix #9 but should probably get more testing. I'm happy if we can start using this internally if that is wished

This is legacy from when Python (<2) was dumber. There's no need to
keep that now. And everywhere where long was being used "int" was also
used, making it completely pointless. The definition in compat is kept
for backwards compatibility.
This is legacy from when in Python 2 builtins.open was different to
io.open. Python 3 open is right straight away, so there is no need to
importing it from compat.
This is only for Python 2 compatibility, which we no longer need. We
can use the built-in without risk.
This is legacy from when Python (<2) was dumber. There's no need to
keep that now. The definition in compat is kept for backwards
compatibility.
All those used: division, absolute_import, print_function,
unicode_literals are mandatory since Python 3.0. Given we support only
from 3.6, removing these imports is a nice cleanup to reduce code
clutter with things that are unnecessary.
This has been done automatically using flynt:
https://github.com/ikamensh/flynt

It is using aggressive mode with some later fixups to fix issues.
Uses across functions keep using strings, but at least simplifies
uses within functions
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.

Drop Python <3.6 support

1 participant