Skip to content

Commit cbf9506

Browse files
committed
lot of pep 8 and others
1 parent 117fecd commit cbf9506

17 files changed

+485
-525
lines changed

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,15 @@ assignees: ""
1010
Welcome! Before you write your Feature Request, please read below:
1111

1212
**Is your feature request related to a problem? Please describe.**
13-
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
13+
A clear and concise description of what the problem is. Ex. I'm always
14+
frustrated when [...]
1415

1516
**Describe the solution you'd like**
1617
A clear and concise description of what you want to happen.
1718

1819
**Describe alternatives you've considered**
19-
A clear and concise description of any alternative solutions or features you've considered.
20+
A clear and concise description of any alternative solutions or
21+
features you've considered.
2022

2123
**Additional context**
2224
Add any other context or screenshots about the feature request here.

setup.py

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,15 @@
1616
bug_url = "https://github.com/Marco-Sulla/python-frozendict/issues"
1717
author = "Marco Sulla"
1818
author_email = "[email protected]"
19-
license = "LGPL v3"
19+
license = "LGPL v3"
2020
license_files = "LICENSE.txt"
2121
description = "A simple immutable dictionary"
22-
keywords = "immutable hashable picklable frozendict dict dictionary map Mapping MappingProxyType developers stable utility"
22+
23+
keywords = (
24+
"immutable hashable picklable frozendict dict dictionary " +
25+
"map Mapping MappingProxyType developers stable utility"
26+
)
27+
2328
python_requires = ">=3.6"
2429

2530
classifiers = [
@@ -61,7 +66,10 @@
6166
package_path_str = str(package_path)
6267
packages = setuptools.find_packages(where = package_path_str)
6368
package_data_filenames = (py_typed_filename, mypy_filename)
64-
package_data = {package_name: package_data_filenames for package_name in packages}
69+
package_data = {
70+
package_name: package_data_filenames
71+
for package_name in packages
72+
}
6573

6674
# C extension - START
6775

@@ -118,6 +126,7 @@
118126
if argv_1_exists and argv[1] == "c_debug":
119127
undef_macros = ["NDEBUG"]
120128

129+
121130
def get_ext_module(
122131
fullname,
123132
sources,
@@ -137,6 +146,7 @@ def get_ext_module(
137146

138147
return ext_module
139148

149+
140150
def get_ext_module_1(optional):
141151
return get_ext_module(
142152
fullname = ext1_fullname,
@@ -149,13 +159,14 @@ def get_ext_module_1(optional):
149159

150160
# C extension - END
151161

162+
152163
common_setup_args = dict(
153164
name = name,
154165
author = author,
155166
author_email = author_email,
156167
version = version,
157168
python_requires = python_requires,
158-
license = license,
169+
license = license,
159170
license_files = (license_files, ),
160171
url = main_url,
161172

@@ -197,10 +208,11 @@ def get_ext_module_1(optional):
197208
pure_py = pure_py_env == '1'
198209

199210
mix_c_py_error = ValueError(
200-
"You can't specify the pure py implementation *and* C extension togheter"
211+
"You can't specify the pure py implementation *and* C " +
212+
"extension togheter"
201213
)
202214

203-
if custom_arg == None:
215+
if custom_arg is None:
204216
if impl == "PyPy" or not c_src_path.exists():
205217
custom_arg = "py"
206218
else:

src/frozendict/__init__.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,20 @@
1616

1717

1818
def _getFrozendictJsonEncoder(BaseJsonEncoder = None):
19-
if BaseJsonEncoder == None:
19+
if BaseJsonEncoder is None:
2020
from json.encoder import JSONEncoder
2121

22-
2322
BaseJsonEncoder = JSONEncoder
2423

25-
26-
class FrozendictJsonEncoder(BaseJsonEncoder):
24+
class FrozendictJsonEncoderInternal(BaseJsonEncoder):
2725
def default(self, obj):
2826
if isinstance(obj, frozendict):
2927
# TODO create a C serializer
3028
return dict(obj)
3129

32-
3330
return BaseJsonEncoder.default(self, obj)
3431

35-
36-
return FrozendictJsonEncoder
32+
return FrozendictJsonEncoderInternal
3733

3834

3935
FrozendictJsonEncoder = _getFrozendictJsonEncoder()

src/frozendict/__init__.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from __future__ import annotations
22

3-
from typing import TypeVar, overload, Optional
3+
from typing import TypeVar, overload, Optional, Union
44

55
try:
66
from typing import Mapping, Iterable, Iterator, Tuple, Type

0 commit comments

Comments
 (0)