AndreaCensi/contracts
> PyContracts is a #Python package that allows to declare constraints on function parameters and return values. Contracts can be specified using Python3 annotations, or inside a docstring. PyContracts supports a basic type system, variables binding, arithmetic constraints, and has several specialized contracts and an extension API.
https://github.com/AndreaCensi/contracts
https://numpy.org/neps/nep-0022-ndarray-duck-typing-overview.html
And I didn't know that #NumPy has
NEPs
I have been investigating this:
```Python
from numbers import Real
def positive(x: Real) -> bool:
return x > 0 # Type Check failed!
```
#PEP 484 said that one should use `float` instead, but this does not solve for other numerical types e.g. #GMP numbers or #NumPy numbers.
And I found some old threads like https://github.com/python/typing/issues/1663
https://github.com/python/mypy/issues/3186
https://discuss.python.org/t/numeric-generics-where-do-we-go-from-pep-3141-and-present-day-mypy/17155
https://discuss.python.org/t/clarifying-the-float-int-complex-special-case/54018/26
And it seems like none has make any real progress.
To my understanding, ABC should also provides a good protocol for typing, just like typeclasses in #Haskell.
#Python #Typing #MyPy #Pyright
#constraintprogramming #ortools #scheduling/#routing #optimization
I think I'm thinking about this wrong.
My basic problem is scheduling #radar collection intervals in continuous time. There are many constraints on the intervals already and that's all working (by which I mean "running"--I'm not actually connected to a radar yet).
However, I also want to put a constraint on interval *transitions* to make sure we don't require the dish to move instantaneously.
AFAIK, the only way to constrain adjacent items like this is via a circuit. So I was going to add a "circuit overlay" to the model. Then I could say that the "edge" from radar dwell A to radar dwell B had to be a certain time distance apart or whatever.
I'm writing a tiny test program to see how that works and it isn't doing what I expect.
But in debugging that, I think I just realized my entire plan doesn't work. There's no reason the circuit overlay is going to come out in the same order as the intervals as laid out in time. That voids the entire plan!
Also, even though all the kids are home for #christmas none of the #nerd are awake for rubber-duckying
GRRRRRRRRRRRRRR
#python #software #engineering
Nous sommes particulièrement fiers de présenter, sous votre sapin de Noël, un programme particulièrement riche pour lancer 2026 : 🤩du Zotero bien sûr (avec ou sans IA), de la veille, des "Regex", du Wikipédia/data et Openrefine, du Python et encore du Python (pour les SHS) et toujours du Python (avec les LLM?), des cartes mentales, de la découvrabilité, de l'automatisation avec N8N, du Obsidian, du Html, de la sobriété numérique, des modèles ontologiques, de l'analyse de réseaux bibliographiques, du TXM, de la TEI, de la Dataviz et de la prise de parole en public, pour finir avec, n'en jetez plus, une "install party" Linux ! Amis de l'ESR, courez vite vous inscrire, les places vont être chères (quoique gratuites) !
#openscience #urfist #ist #python #wikipedia #linux #obsidian #txm #dataviz #etc
https://sygefor.reseau-urfist.fr/#/program/lyon 🤩
Sam Keen & Max Kirchoff thảo luận Kiến trúc Sạch với Python • Tham khảo [link] | Thảo luận [comments]. #DevTopic #Python #KiếnTrúcSạch #LậpTrìnhViên
https://www.reddit.com/r/programming/comments/1pprsvj/clean_architecture_with_python_sam_keen_max/
Using TypeScript to Obtain One of the Rarest License Plates
https://www.jack.bio/blog/licenseplate
#ycombinator #Life360 #API_reverse_engineering #driving_leaderboard #speed_leaderboard #viral_project #TikTok #programming #Python #Next_js #web_app #data_visualization #hacking #job_offer #side_project
Blur an area on an image in Python
https://rodstephensbooks.com/blur_area.html
#Python #Privacy #ImageProcessing #PIL #Drawing

Type Promotion Rules — Python array API standard DRAFT documentation
https://data-apis.org/array-api/draft/API_specification/type_promotion.html
Строим сервис, который повышает собираемость показаний счетчиков ЖКХ
Привет, Хабр! Передача показаний счётчиков во многих домах всё ещё требует ручных действий. Жильцы откладывают эту задачу, пропускают сроки и получают пени. Чтобы повысить дисциплину, мы перенесли механику стриков, знакомую по одному приложению для изучения языков с совой — последовательные своевременные сдачи показаний образуют серию и небольшую скидку как вознаграждение, которая мотивирует поддерживать регулярность. В статье разберём Python-сервис, который отправляет персонализированные SMS, принимает ответы и подключает голосовой вызов для тех, кто не ответил.
https://habr.com/ru/companies/exolve/articles/977968/
#sms_api #мтс_exolve #python #игрофикация #жкх #flask #коммунальные_платежи
Graficar 9 cubos iguales en el espacio de forma asimétrica
¿ Quieres aprender a programas en Python ?
@python_cursos Costa Rica
#Python #plotly #Ramanujan #Simetrias
#Python has several constants that you cannot use as variables. 🐍🚀
Here are some examples:
