@@ -183,14 +183,14 @@ class Invalid(Exception):
183
183
pass
184
184
185
185
186
- def propability (parents , child_name ):
186
+ def probability (parents , child_name ):
187
187
try :
188
- return propability_try (parents , child_name )
188
+ return probability_try (parents , child_name )
189
189
except Invalid :
190
190
return 0
191
191
192
192
193
- def propability_try (parents , child_name ):
193
+ def probability_try (parents , child_name ):
194
194
parent_types = [p [0 ] for p in parents ]
195
195
196
196
def inside (types , not_types = ()):
@@ -1010,7 +1010,7 @@ def is_valid(node: ast.AST, parents):
1010
1010
if (
1011
1011
isinstance (node , (ast .AST ))
1012
1012
and parents
1013
- and propability (
1013
+ and probability (
1014
1014
parents ,
1015
1015
type_name ,
1016
1016
)
@@ -1021,7 +1021,7 @@ def is_valid(node: ast.AST, parents):
1021
1021
print ("node:" , node )
1022
1022
1023
1023
try :
1024
- propability_try (
1024
+ probability_try (
1025
1025
parents ,
1026
1026
node .__class__ .__name__ ,
1027
1027
)
@@ -1560,7 +1560,7 @@ def child_node(n, t, q, parents):
1560
1560
1561
1561
if isinstance (info , UnionNodeType ):
1562
1562
options_list = [
1563
- (option , propability (parents , option )) for option in info .options
1563
+ (option , probability (parents , option )) for option in info .options
1564
1564
]
1565
1565
1566
1566
invalid_option = [
@@ -1663,11 +1663,11 @@ def generate(
1663
1663
1664
1664
# design targets:
1665
1665
# * enumerate "all" possible ast-node combinations
1666
- # * check if propability 0 would produce incorrect code
1666
+ # * check if probability 0 would produce incorrect code
1667
1667
# * the algo should be able to generate every possible syntax combination for every python version.
1668
1668
# * hypothesis integration
1669
1669
# * do not use compile() in the implementation
1670
- # * generation should be customizable (custom propabilities and random values)
1670
+ # * generation should be customizable (custom probabilities and random values)
1671
1671
1672
1672
# features:
1673
1673
# * node-context: function-scope async-scope type-scope class-scope ...
0 commit comments