News for hackers. Stuff that matters.

npage97

Re:PEP 810 – Explicit lazy imports on Friday October 03, 2025 @04:06PM (#45467216)
You have to opt in with the lazy import keyword no matter what. This pep also prevents lazy import in try catch. I think your concern matters if ‘module’ itself has a lazy import that you want to check exists. With this you now need to be more rigorous in check those sub dependencies.

This can already happen with non top level imports so it is not a necessarily a new issue, but could become more prevalent if there is an overall uptake in this feature for optional dependencies.

Re:Pluto, a Modern Lua Dialect on Thursday December 28, 2023 @01:01AM (#38790539)
Requiring c++17 seems like a big change from standard lua.
Re:Writing and Linting Python at Scale on Wednesday November 22, 2023 @02:44PM (#38384129)
You can also use from __future__ import annotations so the quotes become unnecessary. https://peps.python.org/pep-0563/
Re:Astral on Tuesday April 18, 2023 @08:53PM (#35622749)
Ruff is definitely faster by lacking type-checking. That requires way more analysis.

Ruff will work fine without type hints.

I believe it rightfully leaves it to mypy for those who want those features.

Mypy transpiles itself to c using mypyc and that can still take a while to complete when caches get invalidated.

For anyone curious, the reasoning for the slowness is briefly described here: https://python-poetry.org/docs/faq/#why-is-the-dependency-re...
In the lua realm, there is teal. It is very much like a typescript for lua

https://github.com/teal-language/tl

Re:Don't Pickle Your Data on Thursday August 11, 2022 @11:03PM (#32434329)
There is dataclasses-json which does this

https://pypi.org/project/dataclasses-json/

Show HN: SBS – A reformulation of SDS without heap allocation

https://github.com/nathanrpage97/sbs

I've been using SDS a lot and really like the library. However it sometimes feels like overkill because when I'm building strings I frequently know that it will be within some bound of length. The full dynamic length capabilities aren't necessary and can become a pain-point when doing error handling. But on the otherhand the <string.h> functions always feel very verbose to maintain.As...

( Read More... | no comments | 3 points | on HN )
I've done this exact setup (though not for firmware development). VS Code C/C++ extension also supports arm64 as well (https://devblogs.microsoft.com/cppblog/visual-studio-code-c-...). This works well with remote ssh.
code-server (vscode in gerneral with remote development extensions) does a lot of splitting of processes between the server and client. This makes normal code writing done on the client side. Intellisense still has the network delay, but is something that takes time anyway. The terminal doesnt get this benefit so they instead add local echo to make the delay a little easier to handle with [1]. I do not know if this works in code server.

[1] https://code.visualstudio.com/updates/v1_51#_local-echo

Re:New iPhone SE on Tuesday March 08, 2022 @03:56PM (#30606823)
From tech spec pages:

iPhone SE (3rd gen) (https://www.apple.com/iphone-se/specs)

Video playback:

    Up to 15 hours
Video playback (streamed):

    Up to 10 hours
Audio playback:

    Up to 50 hours
iPhone SE (2nd gen) (https://support.apple.com/kb/SP820?locale=en_US)

Video playback:

    Up to 13 hours
Video playback (streamed):

    Up to 8 hours
Audio playback:

    Up to 40 hours
So looking like a ~25% improvement. For some reason Apple likes to hide the mAh... so not sure how much is the chip vs possibly a bigger battery?
Re:Black, the uncompromising Python code formatter, is stable on Saturday January 29, 2022 @04:54PM (#30130936)
To add onto this, I also found that Black works as a nice heuristic indicating to split up code when the formatted output isn't "pretty" into separate lines.
Re:Ask HN: Good Python projects to read for modern Python? on Monday December 27, 2021 @08:19AM (#29702249)
Yea it is there for devs to see different rich features in their console.

You can run some examples using the -m flag + the submodule:

  python -m rich.live
  python -m rich.markdown # this is actually a markdown to terminal cli
https://rich.readthedocs.io/en/stable/live.html https://rich.readthedocs.io/en/stable/markdown.html
Re:Ask HN: Good Python projects to read for modern Python? on Sunday December 26, 2021 @10:36PM (#29698851)
I’ve worked on rich https://github.com/willmcgugan/rich including adding strict mypy typing https://mypy.readthedocs.io/en/stable/command_line.html#cmdo....

I found Will’s codebase easy to read and reason about, making it easy to help extend.

Re:Please Shrink the Trackpad on Wednesday November 03, 2021 @01:41PM (#29097944)
Not to mention that the clicking firmness is programmable: https://support.apple.com/en-us/HT204352
Re:Writing Makefiles for Python Projects on Thursday April 01, 2021 @10:25PM (#26668507)
take a look at taskipy https://github.com/illBeRoy/taskipy as it resembles npm scripts.
Re:Hypermodern Python on Thursday May 28, 2020 @11:35AM (#23338511)
So you shouldn't need to use pip install -e . as poetry already configures your package to be installed as editable.

For adding a separate package in your filesystem, I believe using https://python-poetry.org/docs/dependency-specification/#pat... is what you are looking for

``` poetry add ../path/to/package ```