Closed MartinThoma closed 2 years ago
$ astpretty --no-show-offsets /dev/stdin <<< `cat example.txt`
Module(
body=[
Assign(
targets=[Name(id='domains', ctx=Store())],
value=Call(
func=Attribute(
value=Constant(value='de com net org', kind=None),
attr='split',
ctx=Load(),
),
args=[],
keywords=[],
),
type_comment=None,
),
],
type_ignores=[],
)
The relevant part is:
Call(
func=Attribute(
value=Constant(value='de com net org', kind=None),
attr='split',
ctx=Load(),
)
Explanation
You want a list of strings? Create one directly:
Example