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
Failed to construct CodeType on Python-3.8.0a4 #81067
Comments
remark: I get a similar error from two packages, when experimenting with Python-3.8.0a4 on Windows
import cloudpickle
|
If types is not supposed to be stable, could a warning be added at top of https://docs.python.org/3/library/types.html that it should not be considered stable, and/or to CodeType docs to indicate the signature has changed in 3.8 ? If it is supposed to be stable can the |
There are other projects that have already added a fix for the new parameter positionally. If we add it to be the last (that still will break the old call) we would break them again. |
The documentation never documented the arguments for the code type (probably on purpose), so not sure if adding a notice there will help much: https://docs.python.org/3.8/library/types.html#types.CodeType We can maybe add something more clear to the "what's new" section or the changelog. |
As a final note, notice that when keyword-only arguments were implemented, the parameter was not added at the end of the constructor: commit 4f72a78
--- a/Objects/codeobject.c PyCodeObject *
-PyCode_New(int argcount, int nlocals, int stacksize, int flags,
+PyCode_New(int argcount, int kwonlyargcount,
+ int nlocals, int stacksize, int flags,
PyObject *code, PyObject *consts, PyObject *names,
PyObject *varnames, PyObject *freevars, PyObject *cellvars,
PyObject *filename, PyObject *name, int firstlineno, |
Understandable
Understandable as well, just thinking that a CYA sentence in types.rst: And maybe the docstrings. I rarely open the documentation on python.org and work most of the time by calling I'm happy to do it if it is deemed useful. |
I am +1 to such a sentence, but I think this is a decision that more core devs should agree on. Taking into account previous history (like the linked commit) and I would recommend opening such PR if you have some time and let others review it as well. |
After PR 13255 is merged, let's open a new issue for the notice in types.rst to keep the discussion isolated. |
I found a third project that is impacted microsoft/python-language-server#1070. |
Thanks for the update to the what's new Pablo.
See bpo-36896 |
I created bpo-37032 to add a new CodeType.replace() helper which help projects to be more future-proof (no longer break if CodeType gets yet another parameter). |
Hi, is there a simple fix for the error below? |
That's a closed issue, it's the wrong place to ask questions. Please report the issue to the maintainer of the zipline project. |
Thanks Victor
2022년 5월 31일 (화) 오후 8:00, Victor Stinner ***@***.***>님이 작성:
… That's a closed issue, it's the wrong place to ask questions. Please
report the issue to the maintainer of the zipline project.
—
Reply to this email directly, view it on GitHub
<#81067 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AZLDGSNHCDJ7NBEXMXHSFN3VMXWMRANCNFSM5XMW326A>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: