-
Notifications
You must be signed in to change notification settings - Fork 518
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove remaining legacy Python 2 code (#599)
* Replace OrderedDict with plain dict() <https://docs.python.org/3/library/collections.html#ordereddict-objects>: > Ordered dictionaries are just like regular dictionaries but have some > extra capabilities relating to ordering operations. They have become > less important now that the built-in dict class gained the ability to > remember insertion order (this new behavior became guaranteed in > Python 3.7). Signed-off-by: Philipp Hahn <phahn-oss@avm.de> * construct/lib/container: Remove unneeded methods `collections.abc.MutableMapping` already implements `keys()`, `update()`, `__eq__()`, `__ne__()` and `__contains__()` – most importantly correctly, e.g. `update()` has many variants which the current implementation does not handle. Signed-off-by: Philipp Hahn <phahn-oss@avm.de> * construct: Remove Python 2 compatibility layer Remove the compatibility layer `py3compat`. PS: There is #548 to migrate from the interned version of `construct` back to "Construct 2.10+" now that it is maintained again. When that happens, this change will become moot. Until then restore some sanity back into our copy as handling Python type annotations for both Python 2 and 3 is a major pain. Signed-off-by: Philipp Hahn <phahn-oss@avm.de> * Drop remaining Python 2 compatibility code Signed-off-by: Philipp Hahn <phahn-oss@avm.de> * Drop from __future__ import print_function The project is Python 3 only, so remove the legacy Python 2 compatibility. Signed-off-by: Philipp Hahn <phahn-oss@avm.de> * Replace `bytelist2string` with `bytes` The function was used in only one place. Just use the much more efficient `bytes(list[int])` to convert from `list[int]` to `bytes`. Signed-off-by: Philipp Hahn <phahn-oss@avm.de> --------- Signed-off-by: Philipp Hahn <phahn-oss@avm.de>
- Loading branch information
Showing
32 changed files
with
32 additions
and
184 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
This file was deleted.
Oops, something went wrong.
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
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
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
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
Oops, something went wrong.