question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Python 2 Cleanup tracking issue

See original GitHub issue

A list of cleanups and improvements we can make when dropping python 2.

Relates to #767. Maintainers, please add items to this list / edit the list to link PRs.

Easy changes:

If you’re a new contributor, these are a great place to start.

  • Adjust (#1337) https://github.com/cocotb/cocotb/blob/9caf77cb6ceae739858ecd4a3760631470aac77c/setup.py#L59
  • Change minimum supported version in documentation (gh-1341)
  • Remove 2.7 version from Travis CI setup
  • Remove reference from tox.ini
  • Remove function isclose from tests/test_cases/test_cocotb/test_cocotb.py (#1489)
  • Combine cocotb_test and cocotb_test_35 testbenches (#1489)
  • Remove from __future__ import line from Python files (but not Makefile.pylib.*) (gh-1579)
  • Remove (object) from class MyClass(object): (gh-1579)
  • use type(self) instead of self.__class__. (gh-1579)
  • Use __class__.__qualname__ instead of __class__.__name__
  • Remove all __nonzero__ functions which alias __bool__ (gh-1579)
  • Remove 2x “# NOTE: isclose is a Python 3.5+ feature” from documentation/source/coroutines.rst (gh-1576)
  • Update/check installation instructions in documentation and READM
  • Remove the conditional compilation here: https://github.com/cocotb/cocotb/blob/ad1e718eab6a107b56c47032f53f282f7d2dbae0/examples/endian_swapper/cosim/io.c#L116.
  • Marginal:
    • make u"" strings normal strings (e.g. in documentation/source/conf.py) (gh-1579)
    • Move to format string language instead of using old modulus string formatting.

More involved

Very involved

  • Fix all of the “binary string” interfaces to actually use bytes
    • cocotb.utils.hexdump (gh-1519)
    • cocotb.utils.hexdiffs (gh-1519)
    • BinaryValue.buff (gh-1514)
    • cocotb.generators.byte (gh-1493) (gh-1514)
    • All of the drivers that produce binary data streams (#1545, gh-1514) (h
  • Change all library coroutines to use async def, for speed (gh-1523)
  • Add type annotations (for user-facing code) Filed separately as gh-1582

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:25 (25 by maintainers)

github_iconTop GitHub Comments

1reaction
ktbarrettcommented, Mar 27, 2020

@eric-wieser I was documenting the interfaces on #1526 when I ran into this, which is why it has no annotations.

def fork(coro: Union[Coroutine, cocotb.decorators.RunningTask]) -> cocotb.decorators.RunningTask:
    # ...
1reaction
cmarqucommented, Jan 9, 2020

Not all of those are strictly cleanup:

  • remove from __future__ import line from Python files (but not Makefile.pylib.*)
  • Remove (object) from def MyClass(object):
  • Use __class__.__qualname__ instead of __class__.__name__
  • Add type annotations (for user-facing code)
Read more comments on GitHub >

github_iconTop Results From Across the Web

multiprocessing cleanup occasionally throws exception
Approximately 3,300 runs on Python 2.7.9 on the same machine have not resulted in any crashes. I now built 3.4.3 from source using...
Read more >
Should we auto-close Python 2.7 bugs in 2020? - Core Workflow
If a Python2-only issue is active for less than 6 months, I suggest to leave it open and wait until it becomes inactive...
Read more >
Issue 5679: cleanUp stack for unittest - Python tracker
[see the two where-it-breaks sequences below]. The issue is that cleanups are not connected to the inheritance heirarchy.
Read more >
Issue 17703: Trashcan mechanism segfault during interpreter ...
This issue tracker has been migrated to GitHub, and is currently read-only. ... It's the only way to do module cleanup in Python...
Read more >
Issue 22427: TemporaryDirectory attempts to clean up twice
Issue 22427: TemporaryDirectory attempts to clean up twice - Python tracker. This issue tracker has been migrated to GitHub, and is currently ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found