88 BinaryIO ,
99 Literal ,
1010 NoReturn ,
11- Optional ,
1211 Protocol ,
13- Text ,
1412 TextIO ,
1513 overload ,
1614 runtime_checkable ,
@@ -25,7 +23,7 @@ class ResourceReader(metaclass=abc.ABCMeta):
2523 """Abstract base class for loaders to provide resource reading support."""
2624
2725 @abc .abstractmethod
28- def open_resource (self , resource : Text ) -> BinaryIO :
26+ def open_resource (self , resource : str ) -> BinaryIO :
2927 """Return an opened, file-like object for binary reading.
3028
3129 The 'resource' argument is expected to represent only a file name.
@@ -37,7 +35,7 @@ def open_resource(self, resource: Text) -> BinaryIO:
3735 raise FileNotFoundError
3836
3937 @abc .abstractmethod
40- def resource_path (self , resource : Text ) -> Text :
38+ def resource_path (self , resource : str ) -> str :
4139 """Return the file system path to the specified resource.
4240
4341 The 'resource' argument is expected to represent only a file name.
@@ -50,7 +48,7 @@ def resource_path(self, resource: Text) -> Text:
5048 raise FileNotFoundError
5149
5250 @abc .abstractmethod
53- def is_resource (self , path : Text ) -> bool :
51+ def is_resource (self , path : str ) -> bool :
5452 """Return True if the named 'path' is a resource.
5553
5654 Files are resources, directories are not.
@@ -90,9 +88,7 @@ def read_bytes(self) -> bytes:
9088 with self .open ('rb' ) as strm :
9189 return strm .read ()
9290
93- def read_text (
94- self , encoding : Optional [str ] = None , errors : Optional [str ] = None
95- ) -> str :
91+ def read_text (self , encoding : str | None = None , errors : str | None = None ) -> str :
9692 """
9793 Read contents of self as text
9894 """
0 commit comments