python-minifier 2.11.0__py3-none-any.whl → 2.11.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -85,7 +85,8 @@ def arg_rename_in_place(node):
85
85
  return True
86
86
 
87
87
  if isinstance(func.namespace, ast.ClassDef) and not isinstance(func, ast.Lambda):
88
- if len(func.args.args) > 0 and node is func.args.args[0]:
88
+ all_args = (func.args.posonlyargs if hasattr(func.args, 'posonlyargs') else []) + func.args.args
89
+ if len(all_args) > 0 and node is all_args[0]:
89
90
  if len(func.decorator_list) == 0:
90
91
  # rename 'self'
91
92
  return True
@@ -120,11 +120,11 @@ class RemoveAnnotations(SuiteTransformer):
120
120
  if is_dataclass_field(node) or is_typing_sensitive(node):
121
121
  return node
122
122
  elif node.value:
123
- return self.add_child(ast.Assign([node.target], node.value), parent=node.parent)
123
+ return self.add_child(ast.Assign([node.target], node.value), parent=node.parent, namespace=node.namespace)
124
124
  else:
125
125
  # Valueless annotations cause the interpreter to treat the variable as a local.
126
126
  # I don't know of another way to do that without assigning to it, so
127
127
  # keep it as an AnnAssign, but replace the annotation with '0'
128
128
 
129
- node.annotation = self.add_child(ast.Num(0), parent=node.parent)
129
+ node.annotation = self.add_child(ast.Num(0), parent=node.parent, namespace=node.namespace)
130
130
  return node
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python_minifier
3
- Version: 2.11.0
3
+ Version: 2.11.2
4
4
  Summary: Transform Python source code into it's most compact representation
5
5
  Home-page: https://github.com/dflook/python-minifier
6
6
  Author: Daniel Flook
@@ -19,11 +19,11 @@ python_minifier/rename/name_generator.py,sha256=70Klx2DteYRpBT8dr6jYDB31ARfinS42
19
19
  python_minifier/rename/rename_literals.py,sha256=n_XHME6mhT9pR_RTiRjWo3YWvVuQoPNBERyCOgNrpBQ,7156
20
20
  python_minifier/rename/renamer.py,sha256=RitT7xFr8G1V3wQtxTvxgr1EXbQM6puUeK39CSUYtMo,6706
21
21
  python_minifier/rename/resolve_names.py,sha256=J3Yv32uc2KPfsTa-p9hUNNCEbQDDS-b0na6EUqVeGAo,4356
22
- python_minifier/rename/util.py,sha256=TYLWnpmjEI5elonitelsooo-22v873Eauv1iL0Uy3F8,5358
22
+ python_minifier/rename/util.py,sha256=UchrXPibRr338POF-64zWRfl5OoxwUrE4uOnQstni2s,5451
23
23
  python_minifier/transforms/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
24
24
  python_minifier/transforms/combine_imports.py,sha256=rXbX8ygOMgDti1B_zwU5trEIRoDrGjUpQcC8VvQMioI,2298
25
25
  python_minifier/transforms/constant_folding.py,sha256=LWH2z210i9ZTFY8rgjEayifB7DPYkb6XSdHEQATurF4,4435
26
- python_minifier/transforms/remove_annotations.py,sha256=z4MMw2UVXaQAubj7XAIIDEq0lnXcIPVhrZw6mwdQFIE,4652
26
+ python_minifier/transforms/remove_annotations.py,sha256=uBjka4wt22hPJQ66xpCj5B5HaFL3gZ6gr6OsGgq9yo4,4704
27
27
  python_minifier/transforms/remove_annotations_options.py,sha256=K-E9-TQlCyGRO-YKDfri0kyLevYxQweZhyViwiRAM7Y,1867
28
28
  python_minifier/transforms/remove_annotations_options.pyi,sha256=BUz465OPI88YKMpDLyLfPwiJ50sL0nBJtUf6Vot23Sc,575
29
29
  python_minifier/transforms/remove_asserts.py,sha256=jatGfsPeSzPuEHhTg9c6XaJRInM_t74zRmSEB1FoYYE,784
@@ -35,10 +35,10 @@ python_minifier/transforms/remove_object_base.py,sha256=MvI1XwwB9zcwdClhyTeoD6Wo
35
35
  python_minifier/transforms/remove_pass.py,sha256=A2c4psmYxQ6cYnk6u2KISZW6XhpDEaY-1zFx9Gy6RqI,781
36
36
  python_minifier/transforms/remove_posargs.py,sha256=ecLdKGr0kKx6uf7OXiB_SgF57xWRiDq6ixn5OBSVi7Y,330
37
37
  python_minifier/transforms/suite_transformer.py,sha256=zzQKf8QIVCHJ0IGF8i0yBi7kbyazaDQxrnu6eB4v6bg,6246
38
- python_minifier-2.11.0.dist-info/LICENSE,sha256=FzsyDHb8pAZupSGFjIOuHcHMlFf6N-aIxq9gOYGbNyE,1069
39
- python_minifier-2.11.0.dist-info/METADATA,sha256=2XhuwZVdMgra5uJscQUFLRv2Xan1DzsMl75uJZwrCVo,6455
40
- python_minifier-2.11.0.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
41
- python_minifier-2.11.0.dist-info/entry_points.txt,sha256=ew5TjfSuFJMd5wefRaK3zeoPc_MNQ_o4XN2JiJC5v8Q,59
42
- python_minifier-2.11.0.dist-info/top_level.txt,sha256=4SRDfWKi_KMq7LDrjlzUFoDCs6INYPtxc1Pun4z8LsU,16
43
- python_minifier-2.11.0.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
44
- python_minifier-2.11.0.dist-info/RECORD,,
38
+ python_minifier-2.11.2.dist-info/LICENSE,sha256=FzsyDHb8pAZupSGFjIOuHcHMlFf6N-aIxq9gOYGbNyE,1069
39
+ python_minifier-2.11.2.dist-info/METADATA,sha256=ZsmYQfipB_MoOg-TUnCxbZ5-Ki3EFFmOVB3LBVPwYLc,6455
40
+ python_minifier-2.11.2.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
41
+ python_minifier-2.11.2.dist-info/entry_points.txt,sha256=ew5TjfSuFJMd5wefRaK3zeoPc_MNQ_o4XN2JiJC5v8Q,59
42
+ python_minifier-2.11.2.dist-info/top_level.txt,sha256=4SRDfWKi_KMq7LDrjlzUFoDCs6INYPtxc1Pun4z8LsU,16
43
+ python_minifier-2.11.2.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
44
+ python_minifier-2.11.2.dist-info/RECORD,,