Hacker News new | past | comments | ask | show | jobs | submit | pepoluan's comments login

Have you ever seen algorithms written as "pseudo code"?

Why do you think they do that?

Answer: To make algorithms easier to understand for other humans.

Python more closely resemble pseudo-code compared to Ruby.

Hence Python is more aligned toward "built for humans" than Ruby.


This is why you should use type hints and some kind of type checking.

sorted_list: list = my_list.sort()

will raise a red flag with a type checker.


Will using HTMX save a lot?


As long as it is now deprecated then it's no longer ironic.


The problem with Unix Epoch is that it began in 1970.

There are applications where you need dates before 1970 and that starts to get hairy.


Bigger problem of 1970 epoch is that the 1970-1972 period was confusing time for UTC; having the epoch at 1972 would be arguably much cleaner

Fun excerpt from Wikipedia:

> As an intermediate step at the end of 1971, there was a final irregular jump of exactly 0.107758 TAI seconds, making the total of all the small time steps and frequency shifts in UTC or TAI during 1958–1971 exactly ten seconds, so that 1 January 1972 00:00:00 UTC was 1 January 1972 00:00:10 TAI exactly, and a whole number of seconds thereafter. At the same time, the tick rate of UTC was changed to exactly match TAI.

I'll leave it as exercise to the reader to think of all the implications of whatever timesteps and tickrate shifts that happened pre-1972.


Signed integers exist. What is hairy about using them?


PyCharm professional understands Django natively. Maybe try that? PyCharm also has its own type-checker that's a lot less fussy than mypy.


Well the guys at astral has no plans in the near future to create a static type checker.

Ruff is great, though. I now stop using flake8+black+isort and have gone all-in with Ruff.


Use lots of typing.Protocol and you get all the goodness of duck-typing.


I maintain aiosmtpd using PyCharm and... That's it.

Playing around with Ruff nowadays.

mypy was proposed early during aiosmtpd development but we decided it's not worth the headache.


I just use the built-in one in PyCharm.

It serves my need, which is to ensure I haven't done mistakes in specifying parameters to functions.

I have no desire making Python to be statically-typed.


Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: