Create an object that uses deferred reference counting. Only objects that use deferred refence counting may be stored in inline caches in free-threaded builds. This constructs a new class named Foo, which uses deferred reference counting.
()
| 610 | self.assert_specialized(instantiate, "CALL_EX_NON_PY_GENERAL") |
| 611 | |
| 612 | def make_deferred_ref_count_obj(): |
| 613 | """Create an object that uses deferred reference counting. |
| 614 | |
| 615 | Only objects that use deferred refence counting may be stored in inline |
| 616 | caches in free-threaded builds. This constructs a new class named Foo, |
| 617 | which uses deferred reference counting. |
| 618 | """ |
| 619 | return type("Foo", (object,), {}) |
| 620 | |
| 621 | |
| 622 | @threading_helper.requires_working_threading() |