Skip to content

Commit

Permalink
place OderedDcit in quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
Amourspirit committed Nov 12, 2021
1 parent 37857d3 commit 6c44cf7
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"python.pythonPath": "${workspaceFolder}/env",
"python.pythonPath": "/home/paul/miniconda3/envs/py36/bin/python",
"python.testing.unittestArgs": [
"-v",
"-s",
Expand Down
22 changes: 11 additions & 11 deletions kwhelp/decorator/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ def name(self) -> str:

class _FnInstInfo(object):
# region init
def __init__(self, fninfo: _FuncInfo, fn_args: tuple, fn_kwargs: OrderedDict[str, Any]):
def __init__(self, fninfo: _FuncInfo, fn_args: tuple, fn_kwargs: "OrderedDict[str, Any]"):
"""
[summary]
Expand Down Expand Up @@ -353,7 +353,7 @@ def _process_args(self, args: tuple):
# endregion init

# region Private Methods
def _get_all_kw(self) -> OrderedDict[str, Any]:
def _get_all_kw(self) -> "OrderedDict[str, Any]":
"""Get all keword args combined into one dictionary"""
key = 'all_kw'
if key in self._cache:
Expand All @@ -374,7 +374,7 @@ def _missing_args_error(self, missing_names: List[str]):

# region Public Methods

def get_filter_arg(self) -> OrderedDict[str, Any]:
def get_filter_arg(self) -> "OrderedDict[str, Any]":
"""
Get a dictionary of args only.
Expand All @@ -396,7 +396,7 @@ def get_filter_arg(self) -> OrderedDict[str, Any]:
self._cache[cache_key] = result
return self._cache[cache_key]

def get_filter_noargs(self) -> OrderedDict[str, Any]:
def get_filter_noargs(self) -> "OrderedDict[str, Any]":
"""
Gets a dictionary of all keyword args that has all plain args omitted.
Expand All @@ -405,7 +405,7 @@ def get_filter_noargs(self) -> OrderedDict[str, Any]:
"""
return self._get_all_kw()

def get_filtered_kwargs(self) -> OrderedDict[str, Any]:
def get_filtered_kwargs(self) -> "OrderedDict[str, Any]":
"""
Gets a dictionary of only kwargs
Expand All @@ -418,7 +418,7 @@ def get_filtered_kwargs(self) -> OrderedDict[str, Any]:
self._cache[key] = OrderedDict(self.kwargs)
return self._cache[key]

def get_filtered_key_word_args(self) -> OrderedDict[str, Any]:
def get_filtered_key_word_args(self) -> "OrderedDict[str, Any]":
"""
Gets a dictionary of only keyword args
Expand All @@ -431,7 +431,7 @@ def get_filtered_key_word_args(self) -> OrderedDict[str, Any]:
self._cache[key] = OrderedDict(self.key_word_args)
return self._cache[key]

def get_all_args(self) -> OrderedDict[str, Any]:
def get_all_args(self) -> "OrderedDict[str, Any]":
"""
Gets all keyword, kwarg and args in a single dictionary
Expand Down Expand Up @@ -479,11 +479,11 @@ def info(self) -> _FuncInfo:
return self._fn_info

@property
def key_word_args(self) -> OrderedDict[str, Any]:
def key_word_args(self) -> "OrderedDict[str, Any]":
return self._kw

@property
def kwargs(self) -> OrderedDict[str, Any]:
def kwargs(self) -> "OrderedDict[str, Any]":
return self._real_kw

@property
Expand Down Expand Up @@ -677,7 +677,7 @@ def _get_inst_info(self, **kwargs) -> _FnInstInfo:
raise TypeError(msg)
return info

def _get_args_dict(self, **kwargs) -> OrderedDict[str, Any]:
def _get_args_dict(self, **kwargs) -> "OrderedDict[str, Any]":
"""
Gets OrderedDict of all Args, and Keyword args.
Expand All @@ -694,7 +694,7 @@ def _get_args_dict(self, **kwargs) -> OrderedDict[str, Any]:
info = self._get_inst_info(kwargs=kwargs)
return info.get_all_args()

def _get_filtered_args_dict(self, opt_filter: DecArgEnum = DecArgEnum.All_ARGS) -> OrderedDict[str, Any]:
def _get_filtered_args_dict(self, opt_filter: DecArgEnum = DecArgEnum.All_ARGS) -> "OrderedDict[str, Any]":
"""
Gets filtered dictionary
Expand Down
3 changes: 1 addition & 2 deletions kwhelp/helper/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# coding: utf-8
from collections.abc import Iterator
from inspect import isclass
import re
from typing import Iterable, List, Optional
from typing import Iterable, List, Optional, Iterator

class Singleton(type):
"""Singleton abstrace class"""
Expand Down
2 changes: 1 addition & 1 deletion tests/test_cls_Formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
sys.path.append(os.path.realpath('.'))

from kwhelp.helper import Formatter

from typing import Iterator

class TestFormatter(unittest.TestCase):
def test_ordianl(self):
Expand Down

0 comments on commit 6c44cf7

Please sign in to comment.