Skip to content

Commit

Permalink
import generic abstract collections from typing module, instead of co…
Browse files Browse the repository at this point in the history
  • Loading branch information
anthrotype authored and khaledhosny committed Dec 2, 2023
1 parent 420444a commit 2f24905
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
3 changes: 1 addition & 2 deletions src/ufoLib2/objects/contour.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
from __future__ import annotations

import warnings
from collections.abc import MutableSequence
from typing import Iterable, Iterator, List, Optional, overload
from typing import Iterable, Iterator, List, MutableSequence, Optional, overload

from attrs import define, field
from fontTools.pens.basePen import AbstractPen
Expand Down
3 changes: 1 addition & 2 deletions src/ufoLib2/objects/image.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from __future__ import annotations

from collections.abc import Mapping
from typing import Any, ClassVar, Iterator, Optional, Tuple
from typing import Any, ClassVar, Iterator, Mapping, Optional, Tuple

from attrs import define, field
from fontTools.misc.transform import Identity, Transform
Expand Down
6 changes: 3 additions & 3 deletions src/ufoLib2/objects/misc.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
from __future__ import annotations

import collections.abc
import uuid
from abc import abstractmethod
from collections.abc import Mapping, MutableMapping
from copy import deepcopy
from functools import lru_cache
from typing import (
TYPE_CHECKING,
Any,
Dict,
Iterator,
Mapping,
MutableMapping,
NamedTuple,
Optional,
Sequence,
Expand Down Expand Up @@ -121,7 +121,7 @@ def _object_lib(parent_lib: dict[str, Any], obj: HasIdentifier) -> dict[str, Any
object_libs = parent_lib["public.objectLibs"] = {}
else:
object_libs = parent_lib["public.objectLibs"]
assert isinstance(object_libs, collections.abc.MutableMapping)
assert isinstance(object_libs, MutableMapping)

if obj.identifier in object_libs:
object_lib: dict[str, Any] = object_libs[obj.identifier]
Expand Down

0 comments on commit 2f24905

Please sign in to comment.