HNHacker News
TopNewBestAskShowJobs

NeutralForest

1,686 karma · joined January 4, 2021

submissionscomments
NeutralForest··on What the Fuck Python
That seems uncalled for, the docs are great and the various guides are usually a good starting point to understand and then use the stdlib.
NeutralForest··on The jank programming language
Maybe I'm just too used to Python (and I only know some Clojure) but I don't have the same experience. Usually using generators and itertools will really help you shorten your code. I'm working in a data science adjacent field so a lot of code is just frameworks anyways but I don't feel limited in pure Python either.

If you come across a post or an example that shows those differences, I would be very interested!

NeutralForest··on The jank programming language
> Conversely, a lot of time I can condense hundreds of lines of equivalent python into 5 or 6 lines of Clojure.

I'm curious if you have any example of this? Even if it's an hyperbole, I don't really see how.

NeutralForest··on The uv build back end is now stable
My pleasure!
NeutralForest··on The uv build back end is now stable
I'm quoting Charlie, the creator of uv https://bsky.app/profile/crmarsh.com/post/3lszmqo27b224
NeutralForest··on The uv build back end is now stable
If you take a look at the forum (https://discuss.python.org/), the core team basically doesn't have the resources to do anything else expect maintaining Python. They aren't paid and have to pick their battles.

They spend a lot of time on improving Python itself and then you have pip which is a way to install packages and that's it; it's not a package manager nor a python version manager.

NeutralForest··on The uv build back end is now stable
It was marked as experimental earlier on, the docs linked are the stable version + how to use it.
NeutralForest··on The uv build back end is now stable
You can just use uv now, that's the whole point, it will let you install any recent version of python and you can easily handle it from there. It'll also handle dependencies and one-off scripts for which you don't want to create a whole project/venv.

By rule, you should never meddle with the globally installed python because so many packages will try to look for the system installed Python and use it, better let your package manager handle it.

NeutralForest··on Public/protected/private is an unnecessary feature
I'm not familiar with C++ enough to know about circumventing `private` but in Python you can access "private" members just like any other "public" ones, with the dot notation. There's no specific enforcement at the language level, no error will be thrown.
NeutralForest··on Public/protected/private is an unnecessary feature
Sure, I think the bar to modify is higher in Java for example but I can't really find fault in what you're saying because I'd never unknowingly modify a member with double underscores in Python.
NeutralForest··on Public/protected/private is an unnecessary feature
I see what you mean what I wouldn't really qualify name mangling as private members, you're discouraged to access them but you can access them all the same.
NeutralForest··on How to run cron jobs in Postgres without extra infrastructure
Like the others said, you have to list them and save it somewhere, it could be better in that regard.
NeutralForest··on How to run cron jobs in Postgres without extra infrastructure
Tangential since it's not PG related but I'm more and more moving away from cron and I prefer using systemd timers (I'm on RHEL at work). I just find the interface to list and manager timers better and I can just handle everything like a systemd service anyways.
NeutralForest··on Pyrefly vs. Ty: Comparing Python's two new Rust-based type checkers
Nice, I'm using basedpyright right now, both as a type checker in my IDE as well as in GitHub actions. It's good and mainly does what I want.

I'm not very fond of mypy as it struggles even with simple typing at times.

NeutralForest··on Static Types Are for Perfectionists
TDD/BDD are just tools, in some cases they're useful and some other cases they're not.

If your work is deeply exploratory and you don't even know what the final interface/API will look like, you shouldn't start with TDD. You should probably test as you go though, once you find some behavior you'd like to keep and pin down variations and edge cases you met during dev.

If/Once you know what the expected behavior is, you can encapsulate that knowledge in tests, that's TDD to me. Then, I can write more code that meets the need of the expected API.

NeutralForest··on Static Types Are for Perfectionists
My style has changed over time and part of it is thanks to static type checking in Python. I rarely use dictionaries anymore when what I actually want is a different type that functions will handle down the line. So to transfer data, I usually make frozen dataclasses where I used to use dictionaries. It's more work when you want to add fields on the fly ofc but it pays dividend anytime the logic becomes more complex.
NeutralForest··on Making PyPI's test suite faster
I was using https://www.postgresql.org/docs/current/ddl-rowsecurity.html and needed to check that some complex policies were working correctly so I couldn't just replace with say, SQLite.
NeutralForest··on Making PyPI's test suite 81% faster – The Trail of Bits Blog
Pretty good article, it's really a challenge to properly isolate DB operations during testing so having a difference instance per worker is nice. I remember trying to use different schemas (not instances) but I had a hard time to isolate roles as well.
NeutralForest··on Gemini 2.5 Pro Preview
It just feels to me like trying to derive correct behavior without a proper spec so I don't see how it'll get that much better. Maybe we'll collectively remove the pathological code but otherwise I'm not seeing it.
NeutralForest··on Gemini 2.5 Pro Preview
It's only an example, there's pretty of irrelevant stuff that LLMs default to which is pretty bad Python. I'm not saying it's always bad but there's a ton of not so nice code or subtly wrong code generated (for example file and path manipulation).
NeutralForest··on Gemini 2.5 Pro Preview
I'm seeing it trying to catch blind exceptions in Python all the time. I see it in my colleagues code all the time, it's driving me nuts.
NeutralForest··on Dataframely: A polars-native data frame validation library
Something not mentioned yet is that pandas is eager and copies memory quite liberally so even not too large datasets might blow up your RAM. Polars has an eager API but also a lazy one; I know they're also working on a query optimizer for lazy queries so you could theoretically handle even large data on a laptop for example.
NeutralForest··on Pyrefly - A faster Python type checker written in Rust
Nice, I didn't know about that lib! Usually if I have very nested content I recursively parse it and I'll have some business logic in the function to handle cases here and there. Or I'll have a validation library like Pydantic.
NeutralForest··on Pyrefly - A faster Python type checker written in Rust
For maximum safety, I would write:

    if bar.get("baz", {}).get("qux") is not None:
    ...
NeutralForest··on Show HN: Advanced-Alchemy – A framework agnostic library for SQLAlchemy
I don't like SQLModel for the simple reason that it muddles boundaries between different parts of the application. I suppose when you have a pure CRUD app it's ok, but anytime you want to handle ORM objects and apply some business logic; you'll want to cleanly separate those from what you send and receive from your API.
NeutralForest··on Advanced Python Features
I'm just waiting for the astral's people (uv, ruff) type checker at this point. On large projects mypy is often unreliable and slow.
NeutralForest··on Whenever: Typed and DST-safe datetimes for Python
In that case, you'd have unit tests that confirm behaviors like compatibility or failure of some operations between types and integrations tests which pull an up to date DB of rules and tests against that.
NeutralForest··on CLP Calculus Textbooks
I think it's for the same reason people keep creating new programming languages.
NeutralForest··on Emacs Lisp Elements
When Prot writes something I try to make place to read it. He's a very nice person and also inspiring, he's living following his values and is very insightful.
NeutralForest··on Using uv and PEP 723 for Self-Contained Python Scripts
I'm not doing that but I'm not developing developer tooling either. I can go read mypy code though!
← PreviousPage 5 of 16Next →