Ivan Levkivskyi added the comment:
Thanks for reporting!
The runtime implementation of protocol classes will be thoroughly reworked as a
part of PEP 544, see also https://github.com/python/typing/pull/417 for a proof
of concept runtime implementation.
Also, there is another ongoing
New submission from Oren Ben-Kiki:
In 3.6.0, invocation of isinstance calls
typing._ProtocolMeta._get_protocol_attrs.
This creates a set of all attributes in all base classes, loops on these
attributes to check they exist, and discards the set. It is very slow.
My program uses isinstance to