mirror of
https://github.com/dgelessus/python-rsrcfork.git
synced 2025-01-01 22:32: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:
|
||||
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."""
|
||||
|
||||
# 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."""
|
||||
|
||||
_resfile: "ResourceFile"
|
||||
|
Loading…
Reference in New Issue
Block a user