@@ -614,10 +614,11 @@ def __getitem__(self, params):
614614_PROTO_ALLOWLIST = {
615615 'collections.abc' : [
616616 'Callable' , 'Awaitable' , 'Iterable' , 'Iterator' , 'AsyncIterable' ,
617- 'AsyncIterator' ,'Hashable' , 'Sized' , 'Container' , 'Collection' ,
618- 'Reversible' , 'Buffer'
617+ 'AsyncIterator' , 'Hashable' , 'Sized' , 'Container' , 'Collection' ,
618+ 'Reversible' , 'Buffer' ,
619619 ],
620620 'contextlib' : ['AbstractContextManager' , 'AbstractAsyncContextManager' ],
621+ 'io' : ['Reader' , 'Writer' ],
621622 'typing_extensions' : ['Buffer' ],
622623 'os' : ['PathLike' ],
623624}
@@ -655,8 +656,10 @@ def _caller(depth=1, default='__main__'):
655656
656657# `__match_args__` attribute was removed from protocol members in 3.13,
657658# we want to backport this change to older Python versions.
658- # Breakpoint: https://github.com/python/cpython/pull/110683
659- if sys .version_info >= (3 , 13 ):
659+ # 3.14 additionally added `io.Reader`, `io.Writer` and `os.PathLike` to
660+ # the list of allowed non-protocol bases.
661+ # https://github.com/python/cpython/issues/127647
662+ if sys .version_info >= (3 , 14 ):
660663 Protocol = typing .Protocol
661664else :
662665 def _allow_reckless_class_checks (depth = 2 ):
0 commit comments