HackerTrans
TopNewTrendsCommentsPastAskShowJobs

Lunrtick

no profile record

comments

Lunrtick
·2 года назад·discuss
That's a good point! I suppose in Python that could be a guard in the column definition function.
Lunrtick
·2 года назад·discuss
They could also have done default=uuid.uuid4 to have a new id each time, or default=lambda : str(uuid.uuid4()). It's not really related to whether or not it's a database default.

It seems quite unfair to place the blame on SQLAlchemy here, or even Python.

Even a statically typed language wouldn't prevent this kind of issue - the author of the code is the only person who can decide when they mean "use this exact string each time" or "use this function to give me a new string each time".

I suppose a column description API could follow the dataclass style definition, with different argument names for default and default_func. That would (I think) prevent this from happening.
Lunrtick
·2 года назад·discuss
That would be nice. I've been using Keepass2android for years now though, and it's been really great!
Lunrtick
·6 лет назад·discuss
I think a major one is simply the easy of deployment - one self serving binary is quite refreshing after dealing with wsgi etc.

I suppose the static analysis is quite cool too...