r/Python • • Jan 14 '24

Tutorial The LiteralString in Python 3.11

If you are confused by the new LiteralString type in Python, here's an article explaining it.

0 Upvotes

33 comments sorted by

View all comments

56

u/jwink3101 Jan 14 '24

I will never understand why people post on Medium. It offers few benefits and limits your audience.

But I digress


This is an interesting idea. My first thought was that it’s not needed because you can be careful about what you eval. It’s keeping you safe from yourself.

But then when you think about, that’s all type annotations do anyway!

3

u/MrKooops Jan 14 '24

Save it in Pocket and you can read any article without hassle.

1

u/jormungandrthepython Jan 14 '24

Pocket doesn’t let you read premium medium articles though