Better HN
topnewbestaskshowjobs
Log inSign up

ducdetronquito

53 karma · joined Jan 2, 2024 (2y ago) · 24 submissions

https://github.com/ducdetronquito
Submissions

comment 3mo ago · link · parent

Until this law is ever applied, I warmly recommend my fellow french to install the «saracroche» app to filter out unsollicited calls.

It’s free, open source, all my family uses it for about 2 months now and it just works.

Btw, if it’s creator read this : thanks A LOT ! :)

https://saracroche.org/fr/

comment 6mo ago · link · parent

I use django-types(1), which is far from perfect but does a good enough job for my usecases.

I think that Django's magic isn't statically typecheckable, so I tend to avoid those features altogether. If it's not possible, you can still provide a custom stubs for your needs, or provide a custom abstraction that wraps the not-typechecked parts, or accept that some parts of your codebase are less safe to modify than others. Nothing perfect, but it works.

(1) https://github.com/sbdchd/django-types

comment 6mo ago · link · parent

Congrats on the release, and thanks for this nice tool !

I migrated a small python/django backend project at work from basedpyright to pyrefly 1.0 yesterday to try it, and the migration was painless: just running pyrefly init converted the basedpyright config to a pyrefly config in the pyproject.toml.

The typecheking phase went from ~3/4s to 0.5s which is very nice when ran with pre-commit hooks. It also caught some unnecessary type conversion that basedpyright missed (ex: calling str(value) on a value that is already a string).

I haven't toyed too much with the LSP in zed, but I did not feel anything was missing for now.

I will try to migrate larger backends in the following weeks to see how it goes.

Anyway, it's very cool to see a new stable and fast typechecker for Python ! :)

comment 6mo ago · link · parent

You paint them wrongly as elitists.

It's a critique of low effort PRs compared to the high effort review they require.

comment 10mo ago · link · parent

Good read, TIL!

That being said, I use Django daily for 10 years but I don’t understand the ORM besides basic CRUD. Even a simple group by looks weird.

Writing plain SQL feels easier and more maintainable in the long run.

comment 11mo ago · link · parent

Good job, template partials looks like a nice improvement !

That being said, the current state of type annotations is a pain: django-stubs works on mypy but with a plugin (and mypy is slow as hell), django-types is a fork a django-stubs that works on pyright but is usually out of sync and pylance ships its owned stubs forked from django-types.

My biggest wish for next Django release would be that they finally ship type annotations themselves where it is possible. I don't need the crazy inheritance parts or the crazy stringly typed parts to be have proper type annotations, but just some simple stuff like HttpRequest, HttpResponse, View, Model, etc would help a LOT !

comment 12mo ago · link · parent

You're right, but I also don't find a way a task queue library could know that upfront either to implement progress reporting.

Does anyone know a task queue library that implement it ? I would be curious to look at it !

comment 12mo ago · link · parent

I also warmly recommend procrastinate !

We moved all our celery tasks to procrastinate at work for all our django backends since almost two years now and it has been great.

Having tasks deferred in the same transaction as the business logic stuff is something that helped us a lot to improve consistency and debugability. Moreover, it's so nice to able to inspect what's going on by just querying our database or just looking at the django admin.

For those wondering, procrastinate has no built-in alternative to django-celery-beat, but you can easily build your own in a day: no need for an extra dependency for this :)

comment 12mo ago · link · parent

To implement progress reporting, it means you are able to know the time a task would take to run upfront, no? Is it even possible to do it accurately ?

Though, I imagine you could have strategies to give an approximation of it, for example like keeping track of the past execution time of a given type of task in order to infer the progress of a currently running task of the same type.

comment 1y ago · link · parent

Pleasant and interesting read !

comment 1y ago · link · parent

First thanks for mentioning tach, I wished this tool existed for a long time and I'm happy to give in a try in the following days!

For typechecker, I also vouch for Pyright which is what we use for all our django backends at work.

Just be aware that you will have hard time to typecheck part of your code where you rely heavily on django's magic (magic strings, auto-generated properties/methods, etc...).

In these cases, it's sometimes better to avoid these features entirely or accept that some part of your code will not be typechecked.

comment 1y ago · link · parent

I subscribe to that too!

If your enjoy your time that's more than enough to continue doing what you do :D

comment 1y ago · link · parent

Yeah me too, I could not stand it.

I do agree with you !

Focusing on being healthy is in my opinion way more beneficial to avoid being sick in general than trying to avoid being sick at all cost. Being stacked by millions in cities living unhealthy lives is definitely not helping to prevent being sick. I move to the country side after the last lock down, ~50km from a big city to still be close to work, and it's been very relaxing and good for my family's overall health.

comment 1y ago · link · parent

Yeah I think these days it depends on the doctor: some don't care, some asks you to wear one. But I admit I may be wrong here, I'm lucky to be healthy and my family too so we pretty much never go to the doctor.

We had this police operations too, even in restaurants where you had to have your mask when standing up (like going to the toilet, paying the bill, etc..), but you could take it off at your table.

I remember during the first lock down we were forbidden to go 1.5km from home except to go buy food: there was a large parc close to home so a lot of families would go there to chill, play with kids, do running, etc... but after 3 weeks the police noticed and they were going around in the parc to fine everyone. Most people were more afraid to get caught than to get sick, even old people.

comment 1y ago · link · parent

To continue on sfblah's comment (just above mine): in France, before the mask mandate that came after the first covid lockdown, I don't remember a single doctor/nurse* to wear a mask to do their job even during intense period of sickness like in winter or even during previous pandemics.

I don't remember anyone wearing a mask either in the doctor's waiting room, even when it was fool of sick people (old and young mixed)

* except for dentists, surgeon and their assistants during

comment 1y ago · link · parent

It's a simple tool that makes my life easier for more than a year: thanks to the creator and contributors :)

comment 1y ago · link · parent

Works like a charm for me with Ubuntu 24.04/VSCode/Ionide (F# extension) !

For AoC I don't use a real project setup, just a `dayX.fsx` file and I run it like a script with `dotnet fsi dayX.fsx`, et voilà :)

comment 1y ago · link · parent

I will try to do it with F# and Gleam this year, but like every year I won’t have time (and brain) to do more than 10/12 days ^^

For the pythonists around here, give F# a try: it can feels very close to scripting and it has a wonderful REPL too :)

comment 2y ago · link · parent

Thanks :)

comment 2y ago · link · parent

I only toyed with F# recently, but coming from Python I really like that I can also use a REPL to experiment stuff: I wonder if experienced F# devs use it too.

I hope to have time to build a small web backend project this winter, to get to know the language and ecosystem better.

I heard good things about Oxpecker for the http part; do you have any recommendation for a good postgresql client/driver ? (I don't like ORMs)

Cf: https://lanayx.github.io/Oxpecker/

comment 2y ago · link · parent

Congrats on the release, it like every bit of it !

I hope Gleam will find more sponsors for Louis and the core contributors, especially one from a stable company !

On this side, have you thought about publishing paid educational content to both pay the bill and still contribute to Gleam’s growth ? I don’t know for others but I would love to pay for something like Luca Palmieri’s book Zero To Production in Rust but in Gleam !

Cf: https://www.zero2prod.com/index.html

comment 2y ago · link · parent

Congrats for the release !

It’s really great to see some strong contributors alongside Louis :)

I'm only learning Gleam right now but the feature set already feels small, very cohesive and well thought.

Pipelines, function capture, use expression, pattern matching: I wish I could work with this in Python at work :')

comment 2y ago · link · parent

I just discovered it this morning and it works like a charm as an asdf replacement for my Python setup at work. It also replaces "just" as a task manager for me which is very pleasant.

The fact that the python plugin uses precompiled Python binaries by default instead of building them from source remove common issues I had with the asdf's python plugin at work with missing dependencies.

Just so you know, I encountered two little quirks that needed a fix:

- "Backspace Key Doesn't work in Python REPL": https://github.com/indygreg/python-build-standalone/blob/mai...

- An issue with the mise-poetry plugin: https://github.com/mise-plugins/mise-poetry/issues/9

I will see how it goes in the long run, but I really like it so far :)