Re: Extension type inherit from Python int

2020-01-16 Thread Greg Ewing
On 17/01/20 11:12 am, Random832 wrote: pure-python types that derive from int place __dict__ at the end of the object, I don't know if it's possible for you to do the same with the fields you intend to add (for some reason it isn't done with __slots__), but if all else fails you could do the sam

Re: Extension type inherit from Python int

2020-01-16 Thread Random832
On Thu, Jan 16, 2020, at 12:33, Mathias Enzensberger via Python-list wrote: > Has anyone already done something like that? Is there some trick to > work around that issue, or is it simply not possible to inherit from > PyLongObject? pure-python types that derive from int place __dict__ at the en

Extension type inherit from Python int

2020-01-16 Thread Mathias Enzensberger via Python-list
Hello, I am trying to write an extension type that inherits from Pythons int. Based on the documentation, this should be possible, but I checked Pythons implementation and the struct defining a PyLongObject u