-
Notifications
You must be signed in to change notification settings - Fork 46
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
Cleanup Python 2 compatibility wrappers #231
Merged
DifferentialOrange
merged 7 commits into
master
from
DifferentialOrange/gh-212-cleanup-python-2
Oct 10, 2022
Merged
Cleanup Python 2 compatibility wrappers #231
DifferentialOrange
merged 7 commits into
master
from
DifferentialOrange/gh-212-cleanup-python-2
Oct 10, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2da0f00
to
f016dca
Compare
93051e9
to
9b2554c
Compare
406b2ef
to
f5deabe
Compare
9b2554c
to
fc2052e
Compare
0eb252d
to
e8b1be0
Compare
fc2052e
to
1bca525
Compare
e8b1be0
to
bd9aeba
Compare
1bca525
to
34df802
Compare
bd9aeba
to
c629676
Compare
34df802
to
4f9b771
Compare
c629676
to
afa8107
Compare
4f9b771
to
cd475e1
Compare
afa8107
to
d4c577c
Compare
cd475e1
to
0936426
Compare
Merged
ac7a1e3
to
b121ac8
Compare
0936426
to
e9a4af6
Compare
e9a4af6
to
2199421
Compare
The built-in `basestring` abstract type was removed in Python 3 [1]. `str` must be used for strings and `bytes` for byte objects. `long` type was unified with `int` in Python 3 [2]. 1. https://docs.python.org/3/whatsnew/3.0.html?highlight=basestring 2. https://peps.python.org/pep-0237/ Part of #212
Since Python 3 the default encoding of source files is already UTF-8 [1]. Unless instruction says something other than some variation of "utf-8", it has no effect [2]. 1. https://docs.python.org/3/howto/unicode.html#the-string-type 2. https://stackoverflow.com/questions/4872007/where-does-this-come-from-coding-utf-8 Part of #212
__future__ .print_function brings Python 3 print to Python 2 [1]. 1. https://docs.python.org/2/reference/simple_stmts.html#future
StandardError was removed in Python 3 [1]. PEP 249 footnote 10 [2] declares that database modules targeting Python 3 should use Exception as base class instead. 1. https://docs.python.org/3/whatsnew/3.0.html?highlight=standarderror 2. https://peps.python.org/pep-0249/#footnotes Part of #212
collections.abc was introduced in Python 3.3 [1]. 1. https://docs.python.org/3/library/collections.abc.html Part of #212
ctypes.c_ssize_t was introduced in Python 2.7 [1] and Python 3.2 [2]. 1. https://docs.python.org/2.7/library/ctypes.html#ctypes.c_ssize_t 2. https://docs.python.org/3.2/library/ctypes.html#ctypes.c_ssize_t Part of #212
2199421
to
ec97d90
Compare
oleg-jukovec
approved these changes
Oct 10, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
code-health: remove built-in types wrappers
The built-in
basestring
abstract type was removed in Python 3 [1].str
must be used for strings andbytes
for byte objects.long
type was unified withint
in Python 3 [2].Part of #212
code-health: remove utf-8 encoding instruction
Since Python 3 the default encoding of source files is already UTF-8 [1]. Unless instruction says something other than some variation of "utf-8", it has no effect [2].
Part of #212
code-health: remove print compatibility wrapper
future .print_function brings Python 3 print to Python 2 [1].
code-health: remove StandardError
StandardError was removed in Python 3 [1]. PEP 249 footnote 10 [2] declares that database modules targeting Python 3 should use Exception as base class instead.
Part of #212
code-health: remove collections wrappers
collections.abc was introduced in Python 3.3 [1].
Part of #212
code-health: remove c_ssize_t type wrapper
ctypes.c_ssize_t was introduced in Python 2.7 [1] and Python 3.2 [2].
Part of #212
code-health: remove string encoding compatibility
See PR [1].
Closes #212