|
|
|
|
|
by _flux
1649 days ago
|
|
You may find that actually making this code to use data from user-provided data will make the code look quite unnatural and I doubt it would be accidentally written. For example: >>> user_data='{print("helo"}}'
>>> print(user_data)
{print("helo"}}
>>> print(f"{user_data}")
{print("helo"}}
>>> print(f"user_data")
user_data
>>> print(user_data.format())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
KeyError: 'print("helo"'
Maybe there's some other way to express this bug? |
|