mirror of
https://github.com/dgelessus/python-rsrcfork.git
synced 2024-06-29 11:29:30 +00:00
Use parameterized typing.Mapping in ResourceFile definition
Previously the un-parameterized collections.abc.Mapping was used, which makes type checking less accurate, as the exact key/value types are not known.
This commit is contained in:
parent
0ac6e8a3c4
commit
449bf4dd71
|
@ -197,11 +197,11 @@ class Resource(object):
|
||||||
else:
|
else:
|
||||||
return self.data_raw
|
return self.data_raw
|
||||||
|
|
||||||
class ResourceFile(collections.abc.Mapping):
|
class ResourceFile(typing.Mapping[bytes, typing.Mapping[int, Resource]]):
|
||||||
"""A resource file reader operating on a byte stream."""
|
"""A resource file reader operating on a byte stream."""
|
||||||
|
|
||||||
# noinspection PyProtectedMember
|
# noinspection PyProtectedMember
|
||||||
class _LazyResourceMap(collections.abc.Mapping):
|
class _LazyResourceMap(typing.Mapping[int, Resource]):
|
||||||
"""Internal class: Lazy mapping of resource IDs to resource objects, returned when subscripting a ResourceFile."""
|
"""Internal class: Lazy mapping of resource IDs to resource objects, returned when subscripting a ResourceFile."""
|
||||||
|
|
||||||
_resfile: "ResourceFile"
|
_resfile: "ResourceFile"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user