

Not true. It takes advantage of hardware features that are available on consoles but not on PC. That isn’t laziness.
Not true. It takes advantage of hardware features that are available on consoles but not on PC. That isn’t laziness.
it does a great job yelling at me to keep methods short and simple
Yes style things like that are what I would consider trivial. I also think those are actively bad lints. Yes methods should be short in general, but making it a hard enforced limit means you end up getting sidetracked by refactoring when you only wanted to add one line to a method.
Yeah I tried Ruff about a year ago and it only had really trivial lints so it wasn’t a good replacement for Pylint. Is it on par yet?
Yeah Pylint catches this. If you aren’t using Pylint you are writing bad Python.
I don’t know why you think maintaining uv will require magical superpowers. Writing it in the first place requires a ton of work, sure. But that seems to be mostly done.
It literally doesn’t matter how long it takes.
Found the Python dev…
Well I can think of a couple:
uv clean
uv
which you may not want to impose on users, or CI.But it’s sooooo much better than the official tooling (and the competition like Poetry) that the conclusion is still the same: you should definitely use it.
The biggest praise i have is, it follows the UNIX philosophy, do one thing and do it well.
That isn’t a pro on its own, and it’s also a very wooly rule. Uv does one thing and it does it well - Python project management.
the issue comes down to resources required to maintain a super complex thing
They seem to be managing fine. I guess having a company back it is enough. But that is also probably my biggest worry about it - what if Astral goes away (which given their apparent lack of business model I suspect they eventually will)? Hopefully uv is popular enough by that point it won’t die.
I DONT GIVE TWO SHIATS IF ITS FASTER
It’s literally 10x faster. I’m not sure what kind of person wouldn’t care about that.
Well… the else condition (bar
) needs to be covered. I haven’t used branch coverage tools in Python but in any sane language you cover the actual semantics, not the lines. It shouldn’t make any difference if you write your code on one line, or with ternary expressions, or whatever.
If you branch coverage tool can’t handle branches on the same line I would suggest you use a different one! Does it handle if foo or bar
?
Will not see the value that gets past into self.float_button.setIcon
Uhm, yes you will? Just step into the function.
Easily above average code for Python. I’m going to pick on one method:
def _set_float_icon(self, is_floating: bool):
""" set the float icon depending on the status of the parent dock widget """
if is_floating:
self.float_button.setIcon(self.icon_dock)
else:
self.float_button.setIcon(self.icon_float)
First, Python does have ternary expressions so you can
self.float_button.setIcon(self.icon_dock if is_floating else self.icon_float)
Second, what does this code do?
foo._set_float_icon(true)
Kind of surprising that it sets the icon to icon_dock
right? There are two easy fixes:
*, is_floating: bool
so you have to name the parameter when you call it._update_float_icon()
or something.Also use Black or Ruff to auto-format your code (it’s pretty well formatted already but those will still improve it and for zero effort).
But don’t you loose polymorphism?
No. You’ll have to be more specific about what kind of polymorphism you mean (it’s an overloaded term), but you can have type unions, like int | str
.
Your points 1-3 are handled by running the code and reading the error messages, if any
Not unless you have ridiculously exhaustive tests, which you definitely don’t. And running tests is still slower than your editor telling you of your mistake immediately.
I probably didn’t explain 4-6 well enough if you haven’t actually ever used static types.
They make it easier to navigate because your IDE now understands your code and you can do things like “find all references”, and “go to definition”. With static types you can e.g. ctrl-click on mystruct.myfield
and it will go straight to the definition of myfield
.
They make the code easier to understand because knowing the types of variables tells you a lot of information about what they are and how to use them. You’ll often see in untyped code people add comments saying what type things are anyway.
Refactoring is easier because your IDE understands your code, so you can do things like renaming variables and moving code and it will update all the things it needs to correctly. Refactoring is also one of those areas where it tends to catch a lot of mistakes. E.g. if you change the type of something or the parameters of a function, it’s very easily to miss one place where it was used.
I don’t think “you need to learn it” really counts as slowing down development. It’s not that hard anyway.
I can understand the appeal for enterprise code but that kind of project seems doomed to go against the Zen of Python anyways, so it’s probably not the best language for that.
It’s probably best not to use Python for anything, but here we are.
I will grant that data science is probably one of the very few areas where you may not want to bother, since I would imagine most of your code is run exactly once. So that might explain why you don’t see it as worthwhile. For code that is long-lived it is very very obviously worth it.
Just in case that’s a genuine question, the reasons people like static types are:
Often people say it slows development down but it’s actually the opposite. Especially for large projects or ones involving multiple people.
The only downside really is that sometimes the types can get more complicated than they’re worth, but in that case you have an escape hatch via the Any
type.
Pyright is very good. The rest are worthless though.
How powerful do you want it? Python’s type system is actually pretty good already and relatively sound when checked with Pyright (not Mypy though).
It’s not Typescript-level, but it’s better than e.g. Java or C++.
The main problem is Python developers writing code that can’t be statically type checked. E.g. using magically generate method names via __dict__
or whatever (I think lxml does that).
Well, if you want to have Pip-installed tools available generally (e.g. until distros started screwing it up, pip
was the best way to install CMake), the suggestion was to have a venv for the user that would be activated in your .bashrc
or whatever.
I think that would work, but then what happens if you want to use a project-level venv, which is really what they’re designed for? If you create and activate a venv when you already have one activated does it all work sensibly? My guess would be that it doesn’t.
Can you create venvs inside venvs? That sounds like stuff is going to break tbh.
How big is the app? Distributing Python software is a colossal clusterfuck, so if it’s not enormous it may be easier just to translate it to another language that is easier to distribute, e.g. Typescript.
AI can make that relatively easy.
It literally says in the article. Hardware IO controllers that handle compression. I guess this is related to DirectStorage but it doesn’t seem like that takes advantage of dedicated hardware on PC (because as far as I know it doesn’t exist) and apparently only a handful of games actually use it.
They also have integrated RAM (like Apple M-series laptops).