mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-06-11 10:39:31 +00:00
Using
```Python
with suppress(OSError):
os.remove('somefile.tmp')
```
instead of
```Python
try:
os.remove('somefile.tmp')
except OSError:
pass
```
makes the code more compact and more readable IMO.
This pattern was recommended by Raymond Hettinger, a Python Core
Developer in his talk "Transforming Code into Beautiful, Idiomatic Python" at https://www.youtube.com/watch?v=OSGv2VnC0go. The transcript is available at https://github.com/JeffPaine/beautiful_idiomatic_python
|
||
|---|---|---|
| .. | ||
| __init__.py | ||
| collect.py | ||
| config.py | ||
| config_data.py | ||
| highlight.py | ||
| main.py | ||
| patch.py | ||
| README.asciidoc | ||
| render.py | ||
| search.py | ||
| speedup.c | ||
See https://sw.kovidgoyal.net/kitty/kittens/diff.html