File tree 2 files changed +14
-0
lines changed
2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -322,6 +322,10 @@ def emit_line() -> None:
322
322
fields ['tp_vectorcall_offset' ] = 'offsetof({}, vectorcall)' .format (
323
323
cl .struct_name (emitter .names ))
324
324
flags .append ('_Py_TPFLAGS_HAVE_VECTORCALL' )
325
+ if not fields .get ('tp_vectorcall' ):
326
+ # This is just a placeholder to please CPython. It will be
327
+ # overriden during setup.
328
+ fields ['tp_call' ] = 'PyVectorcall_Call'
325
329
fields ['tp_flags' ] = ' | ' .join (flags )
326
330
327
331
emitter .emit_line (f"static PyTypeObject { emitter .type_struct_name (cl )} _template_ = {{" )
Original file line number Diff line number Diff line change @@ -2206,3 +2206,13 @@ def test_serializable_sub_class_call_new() -> None:
2206
2206
base: NonSerializable = sub
2207
2207
with assertRaises(AttributeError):
2208
2208
base.s
2209
+
2210
+ [case testClassWithInherited__call__]
2211
+ class Base:
2212
+ def __call__(self) -> int:
2213
+ return 1
2214
+
2215
+ class Derived(Base):
2216
+ pass
2217
+
2218
+ assert Derived()() == 1
You can’t perform that action at this time.
0 commit comments