« first day (4881 days earlier)      last day (282 days later) » 

00:04
@thisbeShiva The new internet juice (and hence, valuations) is optimizing site content to be targeted by GenAI. All considerations about human users (e.g. facilitating a never-ending flood of duplicate or repetitive questions) come second. Also, look at SO Discussions; some are great, some are incoherent; they've deliberately removed the ability to add comments (admittedly some can be harsh), so...
... so a user who repeatedly asks low-quality questions is unlikely to spontaneously figure out how to improve them. It's intentionally removing the key dynamic on SO (instead of trying to fix it).
@smci They are referring to this chat room. It's ColdSpeed just under a different name. To be fair, I hadn't noticed until PM2Ring called them "SC" and I went back through their answers to check. Changing names/identities every few months makes it pretty hard for a community to rally around someone nobody knows saying "yey, I got 100 gold bages" from nowhere. I don't know what the strategy is here
I never bothered to check. A random high-rep user with a name I've never seen but just wants congratulations -> meh. I'd only investigate people if they are a disruption to chat. Changing handles is IMO disruptive to SO itself, though; you learn to know who to trust and who not, despite the upvotes/downvotes. All of that meta goes in the bin if you keep cycling your display name
 
3 hours later…
02:56
@PM2Ring Hey! I see some familiar names still, but also missing many of the names I was accustomed to seeing back when I was much more active 3 or so years ago. The number of users in chat is also greatly reduced from back in the day. I've also seen the discussions around AI and the moderation strikes. Disappointing to see leadership continue to make poor choices.
@roganjosh thank you, much appreciated!
@roganjosh They are going ... I try to count my blessings as much as I can. Still working for the same team, same company. Going on 5 years now :)
@roganjosh I temporarily changed my display name because I've entered my Stack Overflow career into a show-and-tell on another community and needed some way to prove it was me there. I would change it back when all is done, I am cs95 after all which I've had for several years. Folks change their usernames all the time here. I didn't think it was that deep :(
 
3 hours later…
05:41
@roganjosh just use a Windows VM. I recall there is many ways to do that on Mac. Parallel desktop, QUEMU, etc. Or just use Krita or GIMP
 
3 hours later…
08:48
fun times
For other readers: os.system is fine here, nobody is getting owned by this, although it's worth using subprocess because it has a lot of other improvements over os.system. If you were concerned about users injecting malicious code into url, the solution is to validate and sanitize url (maybe with urlparse) before plugging it into the command, not to rely on subprocess to clean up your dirty input after the fact. — gomennathan Feb 23 at 1:21
@gomennathan so how do you suggest to validate the url with urlparse? — Antti Haapala -- Слава Україні 2 days ago
@AnttiHaapala--СлаваУкраїні This is a completely separate matter from the Q&A post you are commenting on. You can ask a separate question on stackoverflow, "How do you validate a URL with urlparse?" and I'm sure you will get many great explanations, including from me if I see it. — gomennathan 2 days ago
09:04
I'm actually not sure about this, is https://www.google.com"; python3 a valid URL?
It doesn't crash urlparse, but that doesn't necessarily mean much
@Aran-Fey Yes, it parses to ParseResult(scheme='https', netloc='www.google.com"; python3', path='', params='', query='', fragment='')
Are we sure we trust urlparse to correctly implement the standard, though?
It doesn't really matter whether it's technically correct as long as it doesn't solve the practical problem.
@Aran-Fey I am not the one who suggested for the use of urlparse for url validation or ensuring that it is then safe to interpolate on a command line :D
09:24
Right. We all know that urlparse doesn't solve the practical problem. The only reason I'm talking about it is because I want to know whether that's a valid URL
A shocking amount of search results for "What's a valid hostname in a URL?" returns answers like "Here's a spec for host names that may or may not be related to URLs in any way"
curl doesn't like it, to stay on the practical side of things. :P
ah, but only because there's a / missing after the address itself.
https://www.google.com/";python3 is fine
cromulently obwioußlee.
Haha. Feels like C programming
Human: "I wonder if this is UB."
Machine: "Fool, the UB was somewhere else all along!"
10:25
@Aran-Fey there has been considerable discussion of this on discuss.python.org recently-ish
Oh right, I remember hearing about some kind of exploit where someone tried to validate a URL with urlparse but then passed the URL to some other tool which parsed it differently, so it was possible to bypass the validation
Makes sense for it to be a strongly debated topic I guess
 
2 hours later…
12:53
Last week I refactored my project with the intention of making it better, and today I'm already planning to pretty much undo all of that. That's a new personal worst!
13:24
Just noticed something weird about pyright
def func(foo: str, bar: int): ...

func(
    foo=3,  # type checking error here, as expected
    bar=int(...)  # type: ignore
)

func(
    bar=int(...)  # type: ignore
) # no error because of missing foo?
IIRC your second code snippet is the same as func(bar=int(...) # type: ignore which would make sense to ignore the foo error.
What's the logic, though? Why is one function call treated as a single line, but not the other one?
Because the first has a statement after the whitespace
Not sure what you mean. In both cases the only thing after the type: ignore is a closing parenthesis
13:42
Interestingly enough, black considers the second call to be equivalent to a single-line version.
Does adding the final , change blacks perspective? int(...),
@Peilonrayz Indeed it does.
Perhaps it's similar to the difference between (foo) and (foo,)?
IIRC people were annoyed black kept rolling up function arguments (and such) into one line so added , to mean "don't roll up".
Does black use the regular ast module (or typed-ast for backports) like mypy does? That one should handle type: … comments; my guess is that the distinction is lost at that level.
@Aran-Fey If you have an AST where would you place the error and what nodes would be silenced by type: ignore?
13:50
Hm, the AST is the same for both versions.
I'm not a fan of how pyright highlights function calls, but based on how it currently highlights them, everything from func( to ) should be highlighted as an error.
The # type: ignore would only suppress errors in the int(...) and errors such as "function func has no parameter bar". Not that it matters when everything is highlighted anyway
14:20
Is there a way to define a TypedDict without additional keys? Specifically, I'm trying to define an empty dict right now but I also occasionally need this for **kwargs.
class EmptyDict(TypedDict, total=True): pass should work
also as an example in the pep: peps.python.org/pep-0589/#class-based-syntax
@Aran-Fey Hm, pyright agrees but pydantic isn't pedantic enough. :/
14:35
Is that not-a-bug?
14:48
It's sad firefox is definitely loosing me, I used it for years, but lately it's just not been the same anymore. Freezes, crashes, lag and all the while Chrome works just fine
@Aran-Fey It's reality in PROD, so 🤷
Eh, surely prod can wait 2 months until that's fixed :P
15:14
Eh, I'm still hyped on having Py3.11 available since a few months. I'm so not going back to the way of the dodo!
Hello! I am looking to help a friend with a project on nlp. It has to do with topic modelling and we want to use lda. Is there some sample code that goes through the implementation with comments? Or maybe in pseudocode?
@MisterMiyagi what are some nice new features?
waves hand Like, the modern, like, future thingamabobs! sweats nervously
good to know xD
Honestly, I couldn't give you a rundown unless I went through the release logs. Everytime we have a major bump in versions it's a frantic few months throwing old code and configs out the window and then forgetting about those unelegant whatchamacallit from a less civilized age.
15:45
not having to import list, dict, and tuple from typing any more is nice
and the 2 places in your code base where pattern matching is the more elegant solution, removing those clunky if-elses also felt good
Hmm, so not really worth the upgrade
I've been hounding our admins to upgrade one of our last remaining 3.9 machines for months already because of those two so...
I was being serious 😅
oh, and having | to write type unions, also very nice
"but Arne you could use | with from __future__ import annotations already!" Yeah, except that libs who didn't actively keep a pre-py3.10 catch around would blow up if they tried to interpret those at runtime
16:03
Wish there was language level support for tristate variables.
I mean, there isn't language level support for any particular number of states for any variable, or indeed for typed variables - annotations are a third-party use of an intentionally vague feature at the language level.
If you want to have a variable that's expected to refer to either, say, True, False or None, nobody can stop you (they can only recommend against it).
but the standard library does offer enum.Enum which is probably much more useful for you.
16:18
Good old Optional[bool]... I miss the little bugger.
Well but enum is so inefficient when storing in a database :/
To store usesettings like "<filter>_records_in_query": [yes, ignored, excluded]
16:40
hey Miyagi, remember when you taught me how to use signals to interrupt threads? I wrote it and it does its job, belated thanks for the help.
.. but it does not work when time-outing a time.sleep statement: gist.github.com/a-recknagel/6f688cb18e8b7c9fe79975a4a2e0e305 do you know if they are blocking?
now that I wrote it out, I immediately have an idea how to solve the issue. rubber ducking sure is powerful
Hmm enums are good for this, just a bit more boilerplate than I'd like in python
@Arne Is that linux-only? I get an error invalid signal value
i didn't test it on windows, so probably yes. I chose 99 initially and got the same error, and then I saw a 64 in the signal list and thought "so that's the limit". probably a different one on windows
SIGRTMAX = 64, line 70 in my _signal.py
@Aran-Fey Windows practically has no signals. Even the few that it has are basically emulated.
@Arne I remember we had that problem a few days ago with Event.wait. Many c-functions that pause the process are impossible to interrupt.
for those who are curious, my idea didn't work. I thought calling subprocess.run(["sleep", f"{self.seconds}"]) in line 29 would work, but it didn't
@MisterMiyagi ctrl+c does work though. so cruel, knowing that there must be a solution that I'm somehow not getting
17:18
@Arne There's a very good writeup for signals on Windows here. Hm, perhaps SIGTERM would be useful for your needs.
18:13
I'm considering to just use it. I'm not the only one after all. If I press ctrl+c in a program and in doesn't crash, the first thing I do is press it a second time, which usually does it
18:26
update: sending SIGTERM also didn't exit early while asleep
which is weird, because when I ctrl+c in the debug window, it does exit early. there is trickery afoot.
 
1 hour later…
19:39
@MisterMiyagi Huh, I didn't intend to star that
 
2 hours later…
21:15
(you should be able to click again to unstar it?)
There's a time limit, unfortunately
Mods can unstar (a waste), I think ROs can too
22:15
@roganjosh Ah. Hmm.

« first day (4881 days earlier)      last day (282 days later) »