Here's a typing puzzle: https://mypy-play.net/?mypy=latest&python=3.11&flags=strict&gist=6baf24cc7bc82ac6e8f9995d361f682e
I want to have a method decorator that constrains the type of `self` with respect to a generic, but (obviously) does not _reduce_ the type of `self` to require that it accept any instance of the bound the decorator requires. Do I just need higher-kinded TypeVars for this (https://github.com/python/typing/issues/548) or am I missing something obvious?
I have the most thoughtful kids!
They know how much I like cottage cheese, so sometimes when I give them milk, rather than drink it all, they'll save some and hide it somewhere. That way, when I am cleaning up the messes they've made around the house, I can find it and oh, look, it's turned into a papa snack!
Warms my heart every time. 😍
@bitprophet @hynek Yeah I spent a few days in a hotel in Japan standing in a cramped tub that was not intended for showering (at least not for people >6').
Better than the opposite mistake, though. 😅
It still feels like magic to me that #NumPy allows slices that aren't "rectangular". They can be arbitrary index lists, which in the simplest form allows you to "draw" polygons by first selecting the pixels and then making a single assignment. That's what ski.draw.polygon does.
But it goes further, you can have really arbitrary lists of multi-dimensional indexes so they don't have to be continuous or anything. My simple high-school math mind can barely accept it 🤯
NumPy 2.0 is coming. You should be excited and terrified in equal measure.
- Stan Siebert at #SciPy2023
@simon You really should specify the build system there. Not specifying it isn't saying, "pip, handle this for me" it's actually conveying, "I created this file in the period of time after tools other than pip started using it but before pip did."
Wow. Meta commits to dedicate three engineer-years to implement the removal of the GIL from #Python and fix upcoming compatibility and performance issues with it.
All this dependent on whether the Steering Council accepts PEP 703.
https://discuss.python.org/t/a-fast-free-threading-python/27903/99?u=ambv
@bitecode @treyhunner @pycon No, I started where everyone else did and I still don't recommend pendulum. They have a somewhat incoherent model, are much slower.
@bitecode @treyhunner @pycon I would disagree with this in the strongest terms.
Need to work with timezones in #Python?
Don't use pytz! Use zoneinfo.
It's included in the Python standard library from Python 3.9 onward and pip install-able if you're on Python 3.8.
If your code needs to run on Windows, note that you'll need to pip install tzdata to use Python's zoneinfo module properly.
If you're really curious to understand this topic deeply, watch @pganssle's talk from @pycon: https://m.youtube.com/watch?v=rYzgroaK8_Q&feature=youtu.be
The scope of a feature request often isn't obvious to the asker. For example, someone just asked on the Python forum to make it possible to subclass `pathlib.Path.` Meanwhile, Barney Gale has spent the last *three years* or so working on all the nuances of that, and it's finally making it into Python 3.12 although there's more to do. He worked so much they made him a core dev. #Python #TodayInOpenSource
Once again, I am so frustrated by Python static typing https://github.com/pallets/click/issues/2558 If any typing expert out there wants to help, that would be wonderful. #Python
WTF is wrong with the Apple ecosystem? I've tried 3 different podcast apps now (Podcasts, @overcastfm and PocketCasts) and it seems like none of them are capable of easily like... opening a link to an RSS feed and turning that into a podcast if the feed is only available on the LAN. It's infuriating that every time I deal with some Apple thing it's something like this.
This weekend I’ve spent more time in the tox rabbit hole than I expected, but check out how I’ve cut the runtime of full tox runs of the attrs test suite by 75%:
Two Ways to Turbo-Charge tox
https://hynek.me/articles/turbo-charge-tox/
@RichardNairn Note that approximately no one in my extended family looked at it in any serious way after I did that 😅
@RichardNairn I started out with gramps but ended up creating a Webtrees installation to make it easier to show the data to my family and let them modify it.
@kevin Looking forward to my layovers in Wakanda and Agrabah.
Programmer working at Google. Python core developer and general FOSS contributor. I also post some parenting content.