Stefan Richthofer

Results 228 comments of Stefan Richthofer

I think currently forward declarations are only supported directly in annotations. Not sure if a mix of types and forward declarations is supported, but I suppose it's not (yet). Currently...

Quickly looked into the code. The relevant position is at https://github.com/Stewori/pytypes/blob/15ec80c27e6f933b85ebdf4a6885a5c62552a50f/pytypes/type_util.py#L836. There it detects a string eventually and would resolve forward declaration. We could add such a case to ``_issubclass``...

Sorry, I was rather busy during christmas time. It would be great to have some help on this one. I already spent some thoughts about implementing the resolve function. I'll...

So, I spontaneously committed some work on this as of https://github.com/Stewori/pytypes/commit/0f454aec2cc2ba92efa7dd3aed2215a2cc986394. This should help with your issue for now. However, it maybe does not yet handle callables correctly. And it...

The first return value is the type itself. In case the input was one pure forward declaration as a string this is relevant. The second return value is a boolean...

> Care to release a version with this improvement? I want to have a new release soon, but would like to get some more stuff in, e.g. at least some...

> maybe resolve_fw_decl could validate that? Is it possible to have a recursion issue with a type not involving ``Union``? I'm spontaneously not entirely sure. If so, I think it...

> I think Union + forward declarations. I mean are there examples *without* ``Union``, i.e. is this issue specific to ``Union`` checking or do we have to think more general?...

Any solution to this would require at least one more new arg for ``_issubclass`` and thus the whole type checking function family. I wonder if it would be better to...

As of https://github.com/Stewori/pytypes/commit/74ef4b9babfe3b1d70b0d547e8e8eea575dcdd1b ``_issubclass`` performs recursion-checks if a ``_ForwardRef`` is encountered. As far as I tested, this solves the recursion issue you observe. Would be good if you could confirm...