Comments (7)
With
for k in dir(stuff.modulestuff.__code__):
if k.startswith("co_"):
print(k, getattr(stuff.modulestuff.__code__, k) == getattr(code, k))
we get
co_argcount True
co_cellvars True
co_code True
co_consts True
co_exceptiontable True
co_filename True
co_firstlineno True
co_flags True
co_freevars True
co_kwonlyargcount True
co_lines False
co_linetable True
co_lnotab True
co_name True
co_names True
co_nlocals True
co_positions False
co_posonlyargcount True
co_qualname True
co_stacksize True
co_varnames True
which might narrow it down to just These differ because are bound methods. Their return values seem to coincide too.co_lines
and co_positions
.
from bytecode.
Can you confirm if this is a real issue or not ?
from bytecode.
It depends on what we mean by "issue". We have round-trip tests that take a CodeType
object from a function, add some extra bytecode in different order and places, then take it off, and rebuild a CodeType
object. Up until CPython 3.11 we get equal CodeType
objects (but not identical, because they are indeed different objects). With CPython 3.12, the equality checks fail, which is a bit of a concern. There is no evidence, however, that the new CodeType
object is "functionally" different from the original.
from bytecode.
Ok. It is just that from the list you made in your previous comment the code object did look equal and that got me confused. I guess one would have to check the implementation of __eq__
on CodeType to know why it changed between 3.11 and 3.12.
from bytecode.
@P403n1x87 is this still an actual issue ?
from bytecode.
ping @P403n1x87
from bytecode.
Sorry for the late reply. Because I have disabled the "round-trip" tests I don't know if the issue has been solved. I don't think I'll be able to look back at this any time soon unfortunately 🙁 .
from bytecode.
Related Issues (20)
- Missing tag on 0.12.0 release HOT 1
- Update jump address handling for 3.10 HOT 1
- Bytecode doesn't properly set linenumbers (in corner case in Python 3.10rc1) HOT 2
- Errors in compute stacksize on 3.10 HOT 7
- Please clarify the copyright HOT 4
- Remove `Compare.EXC_MATCH` on Python>=3.9 HOT 1
- Update pre_and_post_stack_effect HOT 1
- Labels don't seem to be handled correctly with Python<3.9 HOT 5
- The `Compare` enum is broken starting from Python 3.9
- Python 3.11 support HOT 5
- EXTENDED_ARG + NOP Error HOT 3
- except Exception as e fails on Python 3.11 HOT 1
- read .pyc HOT 3
- `ValueError: ('TryBegin target must a BasicBlock, got %s', 'Label')` when using `Label` with `TryBegin` HOT 14
- `LOAD_METHOD` is still a valid opname but doesn't seem to be fully supported HOT 1
- `_encode_varint` cannot handle 0 HOT 1
- Running pytest segfaults with Python 3.12 on armhf HOT 11
- Can't call function with no arguments (py312) HOT 2
- Cannot decompile code with empty try block HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bytecode.