typing icon indicating copy to clipboard operation
typing copied to clipboard

Document GenericMeta

Open gvanrossum opened this issue 8 years ago • 2 comments

There are some use cases where GenericMeta is essential (e.g. when combining Generic[T] with a custom metaclass). We should document that it exist, and what you can safely override (the implementation looks a bit brittle if people were to start subclassing this with impunity).

gvanrossum avatar May 15 '17 20:05 gvanrossum

Possible solution is to re-use docstrings https://github.com/python/typing/blob/master/src/typing.py#L927-L947 that already mention several restrictions. Maybe we should also add a warning like "Any use of GenericMeta except explicitly documented here is subject to breakage without warning."

ilevkivskyi avatar May 16 '17 10:05 ilevkivskyi

I think we should also provide several examples.

On May 16, 2017 3:47 AM, "Ivan Levkivskyi" [email protected] wrote:

Possible solution is to re-use docstrings https://github.com/python/ typing/blob/master/src/typing.py#L927-L947 that already mention several restrictions. Maybe we should also add a warning like "Any use of GenericMeta except explicitly documented here is subject to breakage without warning."

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/python/typing/issues/430#issuecomment-301745249, or mute the thread https://github.com/notifications/unsubscribe-auth/ACwrMgrkYb4fubFQq3sKTXcMvzjBA64zks5r6X7RgaJpZM4NbqkG .

gvanrossum avatar May 16 '17 15:05 gvanrossum

GenericMeta no longer exists, so we shouldn't document it.

JelleZijlstra avatar May 22 '23 00:05 JelleZijlstra