Python

Room rules: https://sopython.com/chatroom Code formatting guide: https://tinyurl.com/urnzp7k
22h ago – roganjosh
roganjosh: 22h ago, 51703 posts (2%)VLAZ: 1d ago, 264 posts (0%)Aran-Fey: 1d ago, 21874 posts (1%)Peilonrayz: 1d ago, 1210 posts (0%)ThiefMaster: 33d ago, 2758 posts (0%)inspectorG4dget: 45d ago, 10936 posts (0%)metatoaster: 47d ago, 1683 posts (0%)toonarmycaptain: 450d ago, 4569 posts (0%)dbush: no postsflawr: no posts
6788

export all events for this room

Starred posts

1 2 3 4 5 89
Wed 16:26
What's on your mind?, a Meta Stack Exchange invitation to discussion
4
Dec 1 14:50
AoC room unfrozen
3
Thu 06:52
@ThomasOwens I'm an SRE so I focus on keeping the app running optimally, feature requests would go to a dev team. I'm giving rationale from my team's point of view. As far as hard numbers, in the last hour there were around 3.88mm requests to Stack Overflow. Around 984k requests were from non-verified bots. Without digging too deep, I'd say the majority of those requests are from scrapers and undesired. As far as respecting robots.txt, it'll be abundantly clear which bots are respecting it and what's not once we make the change, I can't give more details beyond that. — Josh Zhang ♦ Dec 3 at 21:11
Wed 16:52
if I used "AI tooling" I wouldn't be doing them in 1-2min though
Wed 16:52
the people doing them in 10-15 seconds are definitely doing this however
Dec 8 23:39
New github action attack. Shell injection in branch name leading to stolen access token and miner code snuck into pypi release github.com/ultralytics/ultralytics/issues/…
2
Dec 5 22:30
@TimurShtatland Probably would be interested in: codereview.meta.stackexchange.com/a/5252
2
Dec 3 18:40
ruff
Nov 26 11:34
I've just checked on my Venus Flytrap and a couple of its traps have cobwebs on them. What's it doing? I'm tempted to take it back a faulty product
2
Oct 21 03:20
There's a new term for LLM doing the rounds on Mastodon: Grand Theft Autocomplete
7
Nov 30 01:25
Nov 3 15:09
Narrator voice: In the year 2024, programmers realized that variables are best declared in the scope where they're relevant, rather than globally. This realization marked a significant milestone in the IT world, just like it had the previous 5823 times
3
Nov 17 20:37
@PM2Ring Wasn't aware that the definition of plagiarism is apparently "copying content without attribution except if you do it on SO and the content was taken from SO".
Nov 13 09:40
@smci Iä Iä, CSV parser fthagn!
Nov 13 09:39
@roganjosh "It was a dark and stormy night... it was dawning on him that he could .cut() but not .run()... not with this API, at least..."
Nov 13 08:58
Oct 9 00:50
This led to the old hacker joke: GOD is real, unless declared integer. :)
3
Nov 9 19:48
Bug of the day: If a module imports a submodule and then crashes, the submodule remains in sys.modules but the parent module doesn't. If this submodule is a namespace package and you try to iterate over its __path__, you get a KeyError because for some reason, it tries to look up its parent module in sys.modules
Oct 8 16:59
@AndrasDeak--СлаваУкраїні The feeling is mutual. I've gone cold turkey from SO and sadly chat is on the same login. So I'll be gone for a while but I'll sorely miss y'all, folks.
2
Nov 2 09:57
I think your best bet would be to build some toy projects on github if you haven't had an actual programming job before
Nov 1 00:01
However, we do not welcome people who just drop into the room spouting random nonsense to nobody in particular. So don't do that. ;) That means you, @GaryOak.
Oct 4 23:43
Relative-path direct imports of files from within a module, like from .. import my_module_subfile don't work in jupyter notebooks (by default), unless you manually either a) append the absolute path of the module to the Python process's sys.path or b) os.chdir into the module directory before doing the import. (Or improve on that wording. And I suggest this needs to be edited into the first line of the question).
2
Sep 26 08:32
From mathstodon.xyz/@[email protected]/113185339014640108 "I’m going to buy him a copy of the Mythical Man Month. Actually I’m going to buy him two copies so he can read it twice as fast".
2
Jul 11 16:50
it finally happened! I got called onto a tech support issue - the issue was that the monitor wasn't plugged in
4
May 13 17:05
A little game worth checking out: ncase.me/trust
6
Oct 9 00:48
In early Fortran, variables with names starting with i to n were by default integer, all other variables were by default real numbers. You could change that by an explicit declaration, though. Even though that's ancient history, there's still the tendency to use i,j,k for integer stuff like loop counters & array indices.
Oct 8 17:00
Wax on, Wax off, while I'm gone... ;)
Oct 8 00:10
@roganjosh It's not at all rude; clearly that question statement continues to be so longwinded and vague that it's unreasonable to expect users to wade through it to determine if it's a dupe or not. Hence its first sentence needed chainsaw rewording. Like the rewording I posted here that got starred. (Why did noone else do that in 4.5 years?) I'm unlikely to post much in python-canon-discussion, ...
Jul 23 06:47
Someone hasn't had their morning code yet!
3
Oct 4 23:42
@roganjosh KarlKnechtel it's not a dupe of that, so yes please don't hammer down the reopen. And after 4.5 years, I think it's time to improve the wording of the first line of the question to say something clearer like:
Jan 16 21:00
"debugging, a thriller where you're the victim, detective, and culprit"
10
Aug 14 17:11
In the shadowed realms of the internet, where the sprawling dominion of Stack Overflow reigns supreme, there lies a place both forsaken and tumultuous: Meta Stack Overflow. Much like the Dark Tower of Barad-dûr, it looms over the landscape of digital discourse, its vast corridors echoing with the cries of those who dare to debate its eternal essence.

Yet, those who traverse this somber domain might find their efforts as futile as the valorous attempts of the free peoples to unseat the might of Mordor itself. For within this realm, discussions about improvement are as ceaseless and as ultim
2
Aug 9 13:41
@me9hanics argument parsing and parsing JavaScript are two very different beasts. help="..." shows when you call the program with --help. Use if __name__ == "__main__" for the CLI entrypoint. Or use a setuptools entrypoint which points to the same main() as the if __name__ == "__main__".
2
Sep 27, 2023 09:26
@Hakaishin I have spoken to Kevin by email several months ago. He is safe and well, he's just taking a break from programming stuff in general
12
Feb 8 15:49
And I tend to avoid writing JavaScript frequently, because it makes me want to smash things and hit people. :D
7
Jul 24 19:29
@paul23 You want 'hellö'.encode('ascii', 'backslashreplace').decode("unicode_escape"), but there are caveats. See stackoverflow.com/questions/4020539. The reason your approach doesn't work is that 'backslashreplace' is an error-handling protocol, not an encoding. When you encode, the resulting bytes contains bytes corresponding to backslashes, which are perfectly valid UTF-8, so no error handling happens on the round trip.
2
Jun 9 11:26
user image
3
Apr 27 13:50
I think "mutate strings" just means "don't use this cheatsheet".
4
Jun 2, 2023 15:34
Open letter for moderation strike on SO openletter.mousetail.nl
14
Sep 6, 2023 19:59
Man, I miss Kevin
10
Sep 3 06:12
@Aran-Fey it was more an answer to other languages and not something I think you could hope to emulate in python. The point being that languages with typing as a first class citizen would inherently behave like what you're trying to achieve given that all collections can only store strictly one type and you have to use Traits to expand outwards from there - "can contain any object that strictly implements this Trait"
Feb 3 11:17
It isn't tbh, I think a lot of people gave up years ago when SO blew itself up from every possible controversy it could get itself in
5
Jun 26 19:00
In case you didn't see the announcement, it's now possible to close bountied questions. See meta.stackoverflow.com/a/430768/4014959
2
Apr 28 12:09
Just to follow up on that - it's not that people are splitting hairs about the semantics of "list" vs. "array". They are wildly different objects that behave in completely different ways.
3
Jan 21 20:07
Had a realization today. Turns out that not overcomplicating the problem significantly reduces the complexity of your code!
5
Feb 22, 2022 16:33
I got a new job. Everyone, thank you for your advice and support.
27
Aug 23 03:24
@KarlKnechtel The primary message that needs to get across much louder and clearer is Never use Python's is operator or id(obj) to compare for numerical or string equality. Secondary is that the internals of how Python, integer cache or AST manage/cache constants are thus only a curiosity (/performance optimization).
Jun 15 15:45
Nothing beats print() in debugging
2
1 2 3 4 5 89