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

class Foo(typing.Generic):

but this one works:

class Protocol(typing.Generic):


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

· · Web · 0 · 0 · 0
Sign in to participate in the conversation
Octodon is a mostly French-speaking Mastodon instance with an active moderation. est une instance Mastodon principalement francophone et avec une modération active.