Feature | Python version |
---|---|
f-strings | 3.6 |
walrus operator aka := |
3.8 |
Type Hinting Generics in Standard Collections aka list[str] |
3.9 1 |
Type union operator aka int | float |
3.10 |
pip install pyinstrument
import pyinstrument
with pyinstrument.profile():
...
@pyinstrument.profile()
def f():
...
https://pyinstrument.readthedocs.io/en/latest/guide.html#profile-a-specific-chunk-of-code
pip install line_profiler
import line_profiler
line_profiler.profile.enable() # or set the environment variable LINE_PROFILE=1
@line_profiler.profile
def f():
...
# cat profile_output.txt
https://github.com/pyutils/line_profiler?tab=readme-ov-file#quick-start-modern
torch.cuda.set_sync_debug_mode(0)
export PYTHONBREAKPOINT="pudb.set_trace"
to your
~/.bashrc
ssh foobar
then you can:
DOCKER_HOST=ssh://foobar docker-compose up -d
Note: you may need to bump MaxSessions
in your server's
/etc/ssh/sshd_config
.
Python 3.8 provides from __future__ import annotations
↩