python warnings got way better in 3.12!

  Рет қаралды 3,856

anthonywritescode

anthonywritescode

Күн бұрын

Пікірлер: 13
@spencer3752
@spencer3752 7 күн бұрын
Oh man. For internal calls to user-facing APIs that may invoke a warning, I've been doing things like `warnings.catch_warnings` and re-emitting warnings to correct the stack level. This seems a lot more convenient.
@eliottwillis784
@eliottwillis784 29 күн бұрын
Nice! I wonder why `skip_file_prefixes` parameter has not been added to the new `warnings.deprecated` decorator in Python 3.13.
@SQADIqw
@SQADIqw 29 күн бұрын
Does it have the same issue pointing on library code instead of library user calls?
@anthonywritescode
@anthonywritescode 29 күн бұрын
weird that they didn't add the api there too -- even more confusing they have `stacklevel=1` as the default... but it acts as `stacklevel=2` (so at least they got that part right?)
@aditya_marathe
@aditya_marathe 29 күн бұрын
Finally installed 3.12 looking forward to daily driving it for the foreseeable future.
@mrswats
@mrswats 29 күн бұрын
Never skip profecies
@ruroruro
@ruroruro 25 күн бұрын
Btw, I wonder, how would one use this feature if your python package provides both the libary code and an executable entrypoint (via __main__.py or via console_scripts or similar).
@anthonywritescode
@anthonywritescode 25 күн бұрын
imo the warning system doesn't really make sense for cli tools -- it's more for programmatic warnings
@CooperE16
@CooperE16 28 күн бұрын
You mentioned you mainly write tools as opposed to libraries. What’s the distinction? I understand libraries v applications? Are tools just applications for developers? eg CLI
@AcuteAangle
@AcuteAangle 28 күн бұрын
I usually understand a ‘tool’ to be a program with a single primary purpose. I would describe the Coreutils as ‘tools’, as well as single-purpose GUI utilities like balenaEtcher. The CLI programs provided by ImageMagick, `ffmpeg`, or `btrfs-progs` as well. I wouldn’t call Firefox, Emacs, or KDE tools, however, as they have an expansive scope, being more like long-lived workspaces you perform a variety of tasks in, rather than narrowly-scoped utilities for a specific class of uses. Daemons and games are also not usually called ‘tools’.
@anthonywritescode
@anthonywritescode 25 күн бұрын
for me libraries are imported and used by other software. tools are kinda everything else (self contained, don't provide programmatic apis) and for me they are almost all in the form of command line applications
@ln11389
@ln11389 28 күн бұрын
I have been working with 3.12 for a while and this was very informative. Thanks for the video.
how does python's module `__getattr__` actually work?
17:38
anthonywritescode
Рет қаралды 6 М.
I fixed my computer!
21:09
anthonywritescode
Рет қаралды 5 М.
Farmer narrowly escapes tiger attack
00:20
CTV News
Рет қаралды 12 МЛН
The Ultimate Sausage Prank! Watch Their Reactions 😂🌭 #Unexpected
00:17
La La Life Shorts
Рет қаралды 8 МЛН
Accompanying my daughter to practice dance is so annoying #funny #cute#comedy
00:17
Funny daughter's daily life
Рет қаралды 21 МЛН
From Small To Giant 0%🍫 VS 100%🍫 #katebrush #shorts #gummy
00:19
python 3.13 release highlights
49:56
anthonywritescode
Рет қаралды 21 М.
Being Competent With Coding Is More Fun
11:13
TheVimeagen
Рет қаралды 119 М.
stop making giant changesets!
14:12
anthonywritescode
Рет қаралды 7 М.
Is Functional Programming DEAD Already?
21:07
Continuous Delivery
Рет қаралды 69 М.
why I will never use python-poetry
9:09
anthonywritescode
Рет қаралды 63 М.
debugging flaky cascading failure after upgrading pytest!
26:15
anthonywritescode
Рет қаралды 3,7 М.
Why is Python 150X slower than C?
10:45
Mehul - Codedamn
Рет қаралды 26 М.
He wrote this out BY HAND? // Code Review
24:01
The Cherno
Рет қаралды 194 М.
typing the untype-able with mypy plugins (advanced) anthony explains #574
25:06
Farmer narrowly escapes tiger attack
00:20
CTV News
Рет қаралды 12 МЛН