In >= 3.8, this code raises "TypeError: Cannot inherit from plain Generic":

class Foo(typing.Generic):
pass

but this one works:

class Protocol(typing.Generic):
pass

Follow

And in Python 3.7 it works if you call it _Protocol instead

Sign in to participate in the conversation
Octodon

oc.todon.fr is a mostly French-speaking Mastodon instance with an active moderation. oc.todon.fr est une instance Mastodon principalement francophone et avec une modération active.