is an f-sting not a literal? it fails in
ast.literal_eval()
:Output:lt2a/forums /home/forums 4> py
Python 3.6.9 (default, Jan 26 2021, 15:33:00)
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import ast
>>> a='f"""hello Python forum"""'
>>> b=ast.literal_eval(a)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.6/ast.py", line 85, in literal_eval
return _convert(node_or_string)
File "/usr/lib/python3.6/ast.py", line 84, in _convert
raise ValueError('malformed node or string: ' + repr(node))
ValueError: malformed node or string: <_ast.JoinedStr object at 0x7f42dd9486a0>
>>> a='"""hello Python forum"""'
>>> b=ast.literal_eval(a)
>>> b
'hello Python forum'
>>>
lt2a/forums /home/forums 5>
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.