Re:Ty: A fast Python type checker and language server
by zo1 on Thursday May 08, 2025 @01:56AM
(#43923461)
You should be doing this dynamically based on the version of python you are running against, so that you don't have to hardcode or make such "conservative" choices by hand.
Re:Ty: A fast Python type checker and language server
by lacasito25 on Thursday May 08, 2025 @05:13AM
(#43924452)
I think they probably know that, this is alpha software, no need to be condescending.
Re:Ty: A fast Python type checker and language server
by johnisgood on Thursday May 08, 2025 @07:49AM
(#43925219)
How is it condescending in any way? I found it to be a constructive criticism; i.e. useful help.
Re:Ty: A fast Python type checker and language server
by mahogany on Thursday May 08, 2025 @12:01PM
(#43927494)
I don't necessarily read it as condescending, but I do read it as presumptuous. What someone "should" do depends on many things. Maybe, because this is software in alpha stage, they should _not_ focus on this part of the code if it is minor compared to other obligations. Or maybe there are other reasons they've chosen not to do this (as was explained in an above comment).
IMO, a less presumptuous criticism would be phrased like "if you did X then benefits Y would happen", or "if you haven't, consider X", or even (the least presumptuous - make it a conversation!) "have you considered X?", rather than "you should do X".
Re:Ty: A fast Python type checker and language server
by johnisgood on Thursday May 08, 2025 @03:51PM
(#43930588)
I see what you mean. Perhaps it was just a "poor" choice of words for whatever reasons. I am sure we can assume he intended it in a way of "have you considered X?".
Re:Ty: A fast Python type checker and language server
by lionkor on Thursday May 08, 2025 @06:24AM
(#43924824)
They said they will default to some newer version, which indicates they are not planning to do this dynamically.
Re:Ty: A fast Python type checker and language server
by zarathustreal on Thursday May 08, 2025 @06:49AM
(#43924947)
Criticism isn’t necessarily condescending. “You should be doing x because y” is just a plain assertion, it doesn’t imply any moral judgement or opinion of the author.
Re:Ty: A fast Python type checker and language server
by dcreager on Thursday May 08, 2025 @09:24AM
(#43925901)
Note that we're not ever spinning up a Python interpreter to run your code, or monitoring an existing running Python process. So we do need some kind of metadata.
But yes, if you have a Python version specified in pyproject.toml, we respect that, and if you have a virtualenv, we can see the Python version that was used to create that. And that's what we use to type-check your code.
The default being discussed here is what we fall back on if that project metadata isn't available.
This is a known issue — we're currently defaulting to a conservative Python version, and `datetime.UTC` really doesn't exist until Python 3.11!
https://docs.python.org/3/library/datetime.html#datetime.UTC
We will probably change the default to "most recent supported Python version", but as mentioned elsewhere, this is very early and we're still working out these kinds of kinks!