Hacker Newsnew | past | comments | ask | show | jobs | submit | npage97's commentslogin

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.


My post was a response to the sedatk conjectural "I wonder how much things would break if all imports were lazy by default."

I have zero concerns about this PEP and look forward to its implementation.


Requiring c++17 seems like a big change from standard lua.


You can also use from __future__ import annotations so the quotes become unnecessary. https://peps.python.org/pep-0563/


Does that work with recursive types? I have had mixed results with `from __future__ import annotations` personally, but I haven't written much Python in ~a year or so.


It's worked for many years, but you won't often see it used outside of class definitions because all of the other tools struggle with it (Pylint, Flake8, Pylance, etc. spit out some variation of an undefined variable error).


I don't think it has worked for years. I had used that same exact __annotations__ and my recollection was that recursive types still did not work.


It's worked for years. I've been using it the whole time.


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


There is dataclasses-json which does this

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


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.


Thank you! I'm going to give it a try, sounds like it could be perfect for me to finally get deeper into firmware development. Just can't stand working directly on the Pi.


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


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?


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

Search: