-
Notifications
You must be signed in to change notification settings - Fork 12
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
Missing C fields? #17
Comments
Ok, forget about the inplace sequence issue. On the Python level there's no extra double under method for them, but instead the number special methods (e.g. On the C level there's some magic, which also seems to re-use the number specific functions. Some yet unresolved complicated interaction is mentioned in http://bugs.python.org/issue11477. |
Hi, regarding these fields
I don't see that we have to worry about them. If they are not set, python automatically sets good defaults when For the inplace sequence operations. First of all, python double checks if they are set to
are called with a acquisition wrapped |
Hi. Sorry, I didn't fully appreciate what the PyTypeReady and friends were doing. I think we can ignore For |
I've been looking over
tp_flags
and what these imply in different Python versions.It looks like we declare
Py_TPFLAGS_DEFAULT
, which implies Py_TPFLAGS_HAVE_INPLACEOPS.That in turn says PySequenceMethods should have the
sq_inplace_concat
andsq_inplace_repeat
fields. Our method definition ends withsq_contains
. OurPyNumberMethods
defines all the inplace fields. The inplace operators were added in Python 2.0.Py_TPFLAGS_DEFAULT
also impliesPy_TPFLAGS_HAVE_CLASS
, which wants a whole host of fields. We now define all of them up to tp_new, but miss the rest of them:Looking over the
tp_flags
for Python 3.6, there's only one new flag worth mentioningPy_TPFLAGS_HAVE_FINALIZE
. This is a new addition as of Python 3.4, where they reworked how destructors worked.In Python 3.5 the
tp_compare
flag got repurposed astp_as_async
, but we luckily have set that one to0
.I'm not quite sure what to do about these. I think we can ignore the new opt-in finalize and async flags.
Do we need to do something about the new-style classes additions (
Py_TPFLAGS_HAVE_CLASS
)?The inplace sequence methods seem like something we maybe should wrap and add to both the Python and C code.
@stephan-hof Thoughts?
The text was updated successfully, but these errors were encountered: