Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32.2k
Closed
Description
This potentially affects tools like coverage.py. It also means anything usingco_code
in CPython frequently is significantly slower. Note that pre-3.11, most code would assume this operation is O(1), so it's probably called more often than we expect.
We should lazily initialise a hidden_co_code
field and cache it there. Currently it creates a fresh bytes object on eachco_code
access. This is at best O(n).