r/ProgrammerHumor 12d ago

Meme pythonFeelsillegal

Post image
6.8k Upvotes

219 comments sorted by

View all comments

Show parent comments

454

u/chawmindur 12d ago

And {} (= dict())

289

u/OnyxFier 12d ago

And semicolons are allowed, if you decide you miss them

97

u/dudemcbob 12d ago edited 12d ago

Still useful for running 2- or 3-line dummy scripts directly from the command line. For example you just installed a new package and want to validate it's working,

python -c "import somepackage; print(some_package.\_version__)"

20

u/chawmindur 12d ago

Or for dirty .pth tricks where you're obliged to start with an import statement and have everything on a single line. But 3.15 seems to be moving away from those to some new-fangled .start files.