Skip to content

Commit fc02375

Browse files
committed
Removing duplicate imports.
1 parent 157def4 commit fc02375

File tree

3 files changed

+8
-24
lines changed

3 files changed

+8
-24
lines changed

domdf_python_tools/delegators.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,11 @@
4141

4242
# stdlib
4343
import inspect
44-
import typing
45-
from typing import Callable
44+
from typing import Callable, TypeVar, get_type_hints
4645

4746
__all__ = ["delegate_kwargs", "delegates"]
4847

49-
_C = typing.TypeVar("_C", bound="Callable")
48+
_C = TypeVar("_C", bound="Callable")
5049

5150

5251
def delegate_kwargs(to: Callable, *except_):
@@ -67,8 +66,8 @@ def _f(f: Callable):
6766

6867
to_sig = inspect.signature(to_f)
6968
from_sig = inspect.signature(from_f)
70-
to_annotations = typing.get_type_hints(to_f)
71-
from_annotations = typing.get_type_hints(from_f)
69+
to_annotations = get_type_hints(to_f)
70+
from_annotations = get_type_hints(from_f)
7271
to_params = {k: v for k, v in to_sig.parameters.items() if k not in except_}
7372
from_params = dict(from_sig.parameters)
7473

domdf_python_tools/typing.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@
4242
import typing
4343
from decimal import Decimal
4444
from json import JSONDecoder, JSONEncoder
45-
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
45+
from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional, Tuple, Type, Union
4646

4747
# 3rd party
4848
from typing_extensions import Protocol, runtime_checkable
4949

5050
# this package
5151
import domdf_python_tools
5252

53-
if typing.TYPE_CHECKING or domdf_python_tools.__docs: # pragma: no cover
53+
if TYPE_CHECKING or domdf_python_tools.__docs: # pragma: no cover
5454
# 3rd party
5555
from pandas import DataFrame, Series # type: ignore
5656

domdf_python_tools/utils.py

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -57,28 +57,13 @@
5757
# Copyright © 1995-2000 Corporation for National Research Initiatives. All rights reserved.
5858
# Copyright © 1991-1995 Stichting Mathematisch Centrum. All rights reserved.
5959
#
60-
# deprecated based on https://github.com/briancurtin/deprecation
61-
# Modified to only change the docstring of the wrapper and not the original function.
62-
# | Licensed under the Apache License, Version 2.0 (the "License"); you may
63-
# | not use this file except in compliance with the License. You may obtain
64-
# | a copy of the License at
65-
# |
66-
# | http://www.apache.org/licenses/LICENSE-2.0
67-
# |
68-
# | Unless required by applicable law or agreed to in writing, software
69-
# | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
70-
# | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
71-
# | License for the specific language governing permissions and limitations
72-
# | under the License.
73-
#
7460

7561
# stdlib
7662
import inspect
7763
import sys
78-
import typing
7964
from math import log10
8065
from pprint import pformat
81-
from typing import Any, Callable, Dict, Iterable, List, Optional, Tuple, Union
66+
from typing import TYPE_CHECKING, Any, Callable, Dict, Iterable, List, Optional, Tuple, Union
8267

8368
# 3rd party
8469
from deprecation_alias import deprecated
@@ -88,7 +73,7 @@
8873
from domdf_python_tools import __version__
8974
from domdf_python_tools.typing import HasHead, String
9075

91-
if typing.TYPE_CHECKING or domdf_python_tools.__docs: # pragma: no cover
76+
if TYPE_CHECKING or domdf_python_tools.__docs: # pragma: no cover
9277
# 3rd party
9378
from pandas import DataFrame, Series # type: ignore
9479

0 commit comments

Comments
 (0)