frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

Python string literals are kinda funny

https://sebsite.pw/w/20260806-pystrings.html
17•jandeboevrie•2d ago

Comments

xg15•2d ago
here's a valid f-string:

>>> f'{'}'}' '}'

Huh? I remember learning the rule that you can't nest quotes inside fstrings if they are the same kind (unlike in bash) - e.g

  f"{mydict["foo"]}"
would be a syntax error, but

  f"{mydict['foo']}"
or

  f'{mydict["foo"]}'
would be valid.

The reason being the same like for the rstring weirdness: The lexer comes first and identifies the string literal, then for fstrings, the python parser is invoked again for each {...} expression to parse it.

This is unlike other nested expressions, which are already split up by the lexer and then parsed in one go.

Did that change at some point?

xg15•2d ago
Update: They really changed it! (in python 3.12)

There was a PEP about it:

https://stackoverflow.com/questions/78388333/nested-quotes-i...

https://docs.python.org/3.12/whatsnew/3.12.html#pep-701-synt...

smitty1e•30m ago
Whenever I'm building a JSON document, I revert to the old %s syntax just because it's more tidy than an f-string.
folkrav•15m ago
Am I understanding that you’re building JSON with string interpolation? If so any special reason you wouldn’t build a dict and json.dumps() it?
dwdz•17m ago
I'm not a fan of f-strings.

I feel like 90% of new Python features in the last 10 years just increased language complexity without any benefit.

Denmark Requires Oral Defenses for Students' Written Work to Counter AI Cheating

https://mezha.net/eng/bukvy/ca117584_denmark_requires_oral/
192•theanonymousone•1h ago•87 comments

Fastmail offers EU data region

https://www.fastmail.com/blog/fastmail-offers-eu-data-region/
173•groomlake•3h ago•89 comments

LinkedIn Feed Blocker

https://github.com/andrewpollack/linkedin-feed-blocker
94•andrewpollack•3h ago•52 comments

"Code was never the hard part" is an insult to all programmers

https://blog.senko.net/code-was-never-the-hard-part-is-an-insult-to-all-programmers
241•senko•5h ago•165 comments

A domain can now say it is for sale, in DNS

https://specification.website/spec/foundations/for-sale-dns/
252•shaunpud•6h ago•114 comments

Can Intel finally beat ARM on performance per Watt?

https://hackaday.com/2026/08/08/want-energy-efficiency-dude-youre-getting-a-dell/
64•gumby•3h ago•17 comments

DeepMind's WeatherNext model achieves breakthrough forecasting cyclones

https://deepmind.google/blog/weathernext-ai-model-achieves-breakthrough-in-forecasting-cyclones/
313•bhavansig•10h ago•99 comments

Timeline of the OpenAI accidental attack against Hugging Face

https://simonwillison.net/2026/Aug/7/openai-timeline/
240•882542F3884314B•8h ago•249 comments

Triton: DirectX 11 Driver for QEMU

https://blog.getutm.app/2026/introducing-triton-directx-11-driver-for-qemu/
90•electricant•6h ago•15 comments

TinySol, a tiny solitaire game for DOS

https://classicbits.net/coding-and-software/my-software/monosol/
16•skibz•2h ago•3 comments

Gateway 2000's hilariously bad ads in the 90s (Part II)

https://buttondown.com/suchbadtechads/archive/gateway-2000-part-2/
71•rfarley04•7h ago•56 comments

Python string literals are kinda funny

https://sebsite.pw/w/20260806-pystrings.html
17•jandeboevrie•2d ago•6 comments

Amazon Is Creating the Biggest Pollution Source in the Country

https://newrepublic.com/post/214111/amazon-data-center-biggest-pollution-source-entire-country
70•geox•2h ago•20 comments

US Military's cyber command unit grapples with cluster of deaths by suicide

https://www.bloomberg.com/news/articles/2026-08-06/us-military-s-cyber-command-unit-grapples-with...
158•rbanffy•9h ago•238 comments

Voyager 1 FDS Computer Emulator

https://zaneham.github.io/voyager-fds-emulator/
57•rahen•6h ago•12 comments

Monitors for Work

https://etbe.coker.com.au/2026/08/05/monitors-for-work/
36•edward•3d ago•15 comments

A physicist rigged his pet hamster’s wheel to upload to Strava

https://www.runnersworld.com/news/a73355106/hamster-wheel-strava-running/
381•aanet•2d ago•95 comments

BYOC Is Not Just 'Deploy into Their Cloud'

https://omnistrate.com/blog/byoc-anywhere-the-spectrum-of-bring-your-own-cloud-deployments
54•kkgupta•4d ago•10 comments

Preventing Misfolding by Preventing Folding

https://www.science.org/content/blog-post/preventing-misfolding-preventing-folding
3•surprisetalk•4d ago•0 comments

From your doorbell to your home network

https://adepts.of0x.cc/eufy-doorbell-hacking/
56•mmoogle•3d ago•3 comments

DeepSeek V4 Flash 0731

https://arcprize.org/results/deepseek-v4-flash-0731
737•tosh•1d ago•445 comments

Hardware backdoors in some x86 CPUs

https://github.com/xoreaxeaxeax/rosenbridge
287•epestr•12h ago•87 comments

What happens if an entire class of workers loses faith in their careers

https://www.noemamag.com/why-is-everyone-in-tech-so-sad/
919•RickJWagner•1d ago•1087 comments

U.S. Department of Energy Launches the Genesis Open Models Initiative

https://genesisopenmodels.anl.gov/
330•moelf•21h ago•135 comments

Gentoo bugzilla closed due AI bot scraper overload

https://social.treehouse.systems/@mgorny/117058483039362779
119•happosai•5h ago•84 comments

k-Coloring is Faster than Computing the Chromatic Number

https://arxiv.org/abs/2607.25973
57•matt_d•1w ago•12 comments

Wireblast a 100 Gbps packet generator in Go using AF_XDP

https://toonk.io/index.html
15•bgpdude•3h ago•6 comments

Assembly Hall of Shame

https://github.com/xoreaxeaxeax/asm-hall-of-shame
401•piotrgrabowski•1d ago•98 comments

Lost my phone at the office. Claude suggested tracking Bluetooth signal strength

https://twitter.com/un1c0rnioz/status/2084686552299634805
137•ilamont•23h ago•118 comments

ao486: x86-compatible Verilog core implementing all features of a 486 SX (2014)

https://github.com/alfikpl/ao486
64•csmantle•6d ago•9 comments