Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
fluiddyn
transonic
Commits
7dfa75aca208
Commit
9da8f603
authored
Sep 10, 2019
by
Pierre Augier
Browse files
Python 3.8 support (gast>=0.3.0, beniget>=0.2.0)
parent
0891a5751973
Changes
3
Hide whitespace changes
Inline
Side-by-side
transonic/analyses/blocks_if.py
View file @
7dfa75ac
...
...
@@ -84,7 +84,7 @@ def get_block_definitions(code, module, ancestors, duc, udc):
# no it's not a block definition
continue
name_block
=
call
.
args
[
0
].
s
name_block
=
call
.
args
[
0
].
value
rawcode
,
comments
=
gather_rawcode_comments
(
if_node
,
code
)
...
...
transonic/analyses/util.py
View file @
7dfa75ac
...
...
@@ -44,7 +44,7 @@ def _fill_ast_annotations_function(function_def, ast_annotations):
except
AttributeError
:
name
=
arg
.
id
dict_node
.
keys
.
append
(
ast
.
Str
(
s
=
nam
e
))
dict_node
.
keys
.
append
(
ast
.
Constant
(
value
=
name
,
kind
=
Non
e
))
dict_node
.
values
.
append
(
arg
.
annotation
)
...
...
@@ -57,7 +57,7 @@ def _fill_ast_annotations_class(class_def, ast_annotations):
if
node
.
annotation
is
not
None
:
name
=
node
.
target
.
id
dict_node
.
keys
.
append
(
ast
.
Str
(
s
=
nam
e
))
dict_node
.
keys
.
append
(
ast
.
Constant
(
value
=
name
,
kind
=
Non
e
))
dict_node
.
values
.
append
(
node
.
annotation
)
...
...
@@ -67,7 +67,7 @@ def get_annotations(object_def, namespace):
# print_dump(object_def)
ast_annotations
=
ast
.
Assign
(
targets
=
[
ast
.
Name
(
id
=
"annotations"
,
ctx
=
ast
.
Store
(),
annotation
=
None
)],
targets
=
[
ast
.
Name
(
"annotations"
,
ast
.
Store
(),
None
,
None
)],
value
=
ast
.
Dict
(
keys
=
[],
values
=
[]),
)
...
...
transonic/backends/cython.py
View file @
7dfa75ac
...
...
@@ -221,6 +221,7 @@ class CythonBackend(BackendAOT):
body
=
[],
decorator_list
=
[],
returns
=
None
,
type_comment
=
None
,
)
signatures_func
=
[]
if
signatures_as_lists_strings
:
...
...
@@ -242,7 +243,7 @@ class CythonBackend(BackendAOT):
# change function parameters
if
fdef
.
args
.
defaults
:
name_start
=
ast
.
Name
(
id
=
"*"
,
ctx
=
ast
.
Param
(),
annotation
=
None
)
name_start
=
ast
.
Name
(
"*"
,
ast
.
Param
(),
None
,
None
)
fdef
.
args
.
defaults
=
[
name_start
]
*
len
(
fdef
.
args
.
defaults
)
for
name
in
fdef
.
args
.
args
:
name
.
annotation
=
None
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment