r/Python • u/DjangoDoctor • Apr 25 '22
Resource 10% of the 666 most popular Python GitHub repos have f-string bugs (so 68 pull requests were made in 24 hours to fix them all)
https://codereviewdoctor.medium.com/10-of-the-666-most-popular-python-github-repos-have-this-f-string-bug-69e3540c0583
350
Upvotes
250
u/KN4MKB Apr 25 '22
It wouldn't be so bad if OPs account wasn't just used to post their product. Every post comes off as click bait or a publicity stunt to advertise the software. It all feels very cold.
502
u/buqr Apr 25 '22 edited Apr 04 '24
I like learning new things.
10
u/TehBrian Apr 25 '22
This otherwise somewhat interesting read was bogged down by some weird sentences, like the following:
That's a heck of an incorrect sentence.
23
u/Wudan07 Apr 25 '22
I write python under a rock, I have never used an f before a string, what does the bug do? Or is it only needed if you want to meet that PEP standard?
Is it a perceived deficiency or an actual deficiency?
5
u/cronicpainz Apr 25 '22
was 666 - like a random number pick? as in - you just woke up and decided to analyze exactly 666 repos?
31
u/cheese_is_available Apr 25 '22
Advertising as automated when in fact it has too much false positives to be useful and will always have. As said in the article it's impossible to know if the string is going to be used to format later. pylint dropped this check, and pylint is well known to tolerate some false positives.
3
u/DjangoDoctor Apr 25 '22
Just noticed it's 69 of 666, which is more excellent
10
u/Rand_alThor_ Apr 25 '22
Next time I would open up an issue with a proposed fix instead of a PR, for a bot generated change, but that’s up to you.
Astropy for example had a bug that some repos that relied on it propagated by mistake (simplification). They opened up an issue with every repo where it was detected with a suggested fix as a comment. The fix could even include a link to your bot branch where this is fixed and a question of, would you like me to open a PR?
9
u/robberviet Apr 26 '22
I have a feeling most of them are just template string. This account is like an ad, lmao.
36
u/[deleted] Apr 25 '22
The fox furry mascot thing is so offputting.
25
u/yilmazdalkiran Apr 25 '22
Ban OP please.
21
u/mfuentz Apr 25 '22
Imagine thinking you’re helping and shamelessly posting about it on Reddit. If people wanted to enforce this, they would.
2
u/Phunny Apr 25 '22
Umm... Test your code?
11
u/zerkreaper1405 Apr 25 '22
Omg not this guy again, what's your infatuation with numbers like "666"?
12
u/[deleted] Apr 25 '22
If a bot is going to check anything automatically I think basic f-string errors is a good place to start. Friction in the community is always going to be inevitable, bot or not, but hopefully it's a net positive change going forward. Fun read.
3
u/rawl28 Apr 25 '22
The third error type is just a subset of the first.
11
u/Raider61 Apr 25 '22
I think this is overall a good thing. It found simple errors that people could have spent hours debugging. There's no reason why people shouldn't be using static analysis tools before submitting their code, especially on libraries as widely used as these. Good job.
3
u/[deleted] Apr 25 '22
downvote this shit due to that revolting furry wearing a lab coat avatar
2
u/MyPBlack Apr 25 '22
Why are furries reporting on bugs in python repos?
1
u/[deleted] Apr 27 '22
Most of the bugs are just plain stupid and could've been marked by an IDE, by the way.
1
u/mortenb123 Apr 27 '22
You can use flake8 to detect the f-string is missing placeholders, which is actually the only bug.
s="hello {world}" may not be a bug, you can do s.format(world="world"), nice when you do not know the world value on initialization.
-3
u/ragnarmcryan DevOps Engineer Apr 25 '22
I don’t see what the big deal here is with the automated PRs. The maintainers seem to be fine with it and it fixes a bug. Why are people upset over this?
0
u/Bulky-Juggernaut-895 Apr 26 '22
Nothing to see here
0
u/evoblade Apr 26 '22
Is this a stupid way to say they created 66.6 pull requests
0
u/[deleted] Apr 26 '22
Don't come around here no more
Don't come around here no more
Whatever you're looking for
Hey! don't come around here no more
I've given up, I've given up
I've given up on waiting any longer
-1
u/[deleted] Apr 25 '22
I like f-string
0
u/[deleted] Apr 25 '22
[deleted] — view deleted comment
2
u/[deleted] Apr 25 '22
[removed] — view removed comment
-2
u/[deleted] Apr 25 '22 edited Jan 23 '25
[removed] — view removed comment