Masthash

#cpython

Michał Górny
3 weeks ago

Pora na kolejną okresową przypominajkę, że #GitHub Actions, podobnie jak inne systemy CI, o których mi wiadomo, oraz dystrybucje Linuksa (w standardowej konfiguracji) instalują Pythona z wyłączonymi asercjami.

Oznacza to, że ta domyślna konfiguracja *absolutnie nie nadaje się* do testowania, czy twój kod nie łamie konwencji API CPythona. Albo musisz zbudować CPythona z `--with-assertions`, albo skompilować swoje rozszerzenie z `-UNDEBUG`, by obejść to (to drugie rozwiązanie nie wychwyci wszystkich błędów).

A jeśli ktoś włoży wysiłek, by zgłosić złamaną asercję i wyraźnie opisze, w jaki sposób odtworzyć problem, to ten ktoś naprawdę będzie wdzięczny, jeśli nie zamkniesz zgłoszenia, bo "na GHA przeszło".

https://github.com/agronholm/cbor2/issues/171#issuecomment-1703834609

#Python #CPython

Michał Górny
3 weeks ago

This is yet another periodic reminder that #GitHub Actions, as well as all other CI systems I'm aware of and Linux distributions (at least in default configuration) install #Python with assertions disabled. This means that all your C extensions are also built with assertions disabled.

This means that the default setup is completely useless for testing whether you didn't violate CPython's API. You need to either build your own #CPython with --with-assertions or explicitly built with -UNDEBUG to workaround that (and the latter option doesn't catch all violations).

And if someone goes through the effort of reporting a violated assertion and explicitly tells you how to reproduce it, that someone would certainly appreciate if you didn't close the bug saying that GHA passed.

https://github.com/agronholm/cbor2/issues/171#issuecomment-1703834609

🕹️ jbz
4 weeks ago

🐍 Understanding Immortal Objects in Python 3.12: A Deep Dive into Python Internals
➥ Abhinav Upadhyay

「 A detailed examination of Python 3.12's internal changes featuring the concept of 'immortal' objects, for performance enhancements 」

https://codeconfessions.substack.com/p/understanding-immortal-objects-in

#Python #CPython #Immortalization

Clément Robert
2 months ago

This year is very intensive in terms of migrations for scientific Python maintainers:
- a new #CPython (3.12) in October
- a major version of #Cython (3.0) announced for this summer
- a major version of #Numpy (2.0) scheduled for the end of the year

All of which will require careful testing and probably take some time to propagate through the giant mess that are dependency trees in scientific #Python 😵‍💫

Open Source JobHub
3 months ago

Job Alert: @ThePSF is seeking a full-time CPython Developer in Residence. Learn more about the position and apply now on #OSJobHub https://opensourcejobhub.com/job/8533/deputy-cpython-developer-in-residence/ #jobs #career #PSF #Python #CPython #developer #SoftwareDevelopment #OpenSource #remote

Python Software Foundation logo

Looking at a #CPython feature request from a few years ago (as one does) for iterating over extended grapheme clusters, and suddenly a wild @manishearth appears 😁

https://github.com/python/cpython/issues/74902

Our next #Stockholm #Python meetup will be on 7th, from 5:30pm in the #SUNET office. We will sit down and learn how to build #CPython itself. Hoping to get more people excited about contributing to the language itself.

https://www.meetup.com/pysthlm/events/293931938/

#Community #Upstream

A cute bit of #CPythonTrivia: there has been some Jython-specific compatibility code in #CPython for decades that was removed only last November:

https://github.com/python/cpython/pull/99484

Good news for #CPython C API users who use subinterpreters, looks like the changes to add per-interpreter GIL functionality (PEP 684) hit the main branch today!

https://github.com/python/cpython/commit/5c9ee498c6f4b75e0e020f17b6860309c3b7e11e

#Python

Paolo Melchiorre
5 months ago

Brett Cannon, developer manager at Microsoft and Python core developer, is giving the talk "Python's syntactic sugar" at PyCon US 2023 in Salt Lake City 🇺🇲🐍

#PyCon #PyConUS #CPython #Python #PythonSpeakingTour

CC @pycon @brettcannon @PyConUS

Ned presenting Brett talk
Brett on stage
Brett giving his talk
Brett thanks Andrea and Guido
Paolo Melchiorre
5 months ago

Łukasz Langa, the CPython Developer in Residence, is speaking about "Working Around the GIL with asyncio" at PyCon US 2023 in Salt Lake City 🇺🇲🐍

He's going through two examples of data processing with Python 3.11 and how asyncio with shared memory helps speed things up ⚡

#Python #GIL #SharedMemory #AsyncIO #CPython #PyCon #PyConUS #PyCon2023 #PyConUS2023 #PythonSpeakingTour

CC @pycon @PyConUS @ambv

Łukasz on the stage
Łukaszin front of the audience
Łukasz with live caption
Łukasz giving his talk

oooh, there is now a lovely chart of #Python versions and support dates in the #CPython Developer's Guide to go along with the table maintained there

https://devguide.python.org/versions/

Visualization of the release cycle of versions of Python, from 2.6 through 3.12, showing the color-coded current status (feature, bugfix, security, end-of-life) of each and the start/end of the cycle for that version, running through 2028 when 3.12 reaches end-of-life.
Paolo Melchiorre
5 months ago

I'm attending the talk "The CPU in your browser: WebAssembly demystified" by Antonio Cuni from Anaconda at PyCon DE 2023 in Berlin 🇩🇪🐍

#PyConDE #PyCon #WebAssembly #Python #Pyodide #CPython #WASM #PyScript #PythonSpeakingTour

CC @pyconde @conda

Antonio presenting is talk
Slide with tile The CPU in your browser: WebAssembly demystified
Room manager presenting Antonio Cuni talk
Slide with tile WeAssembly
Astra Kernel :verified:
6 months ago

This was shared by @David3141593 and said to be a 0day in cpython

-----
# py3.8+
unused=b'\x50K\3\4'+b'\0'*26+b'+(\xca\xcc+\xd1P\xcfHL\xceNMQ\xc8\xc9\xcfQ\xd7\4\0PK\1\2'+b'\0'*6+b'\1'+b'\0'*9+b'\x15'+b'\0'*7+b'\13'+b'\0'*17+b'__\x6da\x69n__.\x70y\x50K\5\6'+b'\0'*8+b'9\0\0\0003\0\0\0'
i=__import__
i("runpy").run_path(i("py_compile").compile(__file__))
----

"I can't think of any real-world impact from it except in contrived scenarios, but it makes a fun tweet-sized puzzle at least" - @David3141593

#cpython #python #infosec

from runpy import run_path
from py_compile import compile

current_file = __file__

unused=(
    b'PK\x03\x04' #zip magic bytes
    +b'\x00'*26
    +b'\x2b\x28\xca\xcc\x2b\xd1\x50\xcf\x48\x4c\xce\x4e\x4d\x51\xc8\xc9\xcf\x51\xd7\x04\x00' 
    +b'PK\x01\x02'  #zip local file header
    +b'\x00' * 6
    +b'\x01'
    +b'\x00' * 9
    +b'\x15'
    +b'\x00' * 7
    +b'\13'
    +b'\x00' * 17
    +b'__main__.py' 
    +b'PK\x05\x06' #zip local file header
    +b'\x00' * 8
    +b'\x39'
    +b'\x00' * 3 
    +b'\x33'
    +b'\x00' * 3
    )
    
print(unused)

 
run_path(compile(current_file))
César Román :python:
6 months ago

@aegilops For a while #IronPython appeared to be "stuck" in 2.7 just like #Jython, but in December they released version 3.4 and they've ported f-strings from #CPython 3.6.

I cannot imagine what goes into implementing Python in other programming languages, and for that they deserve my admiration. But it is indeed a shame Jython has not moved past 2.7 in almost eight years.

Maybe Inductive Automation will open their platform to other scripting languages, but until then I'm stuck in 2.7 too.

Luciano Ambrosini
6 months ago

AI as Render Engine?
🤔 The way is long, but I still wonder why pay for something that is already free or even could be not so expensive?

Below is the first personal attempt to achieve at least one of the abovementioned aims. 😉 my goal, as always, is to extend design possibilities to everyone.

https://youtu.be/-LGCvGVfWnA

#sneakpeek #AmbrosinusToolkit #DEV #Grasshopper #csharp #CPython #Python #coding #Rhino #api #design #craftsman #tools #ai #stablediffusion #ControlNET #lucianoambrosini

Laura Langdon
7 months ago

Self-awareness in an article’s narrative is a good thing, especially when it channels Bette Davis: “Yes, this is a very long article. If you just made yourself a fresh cup of tea, coffee or your favorite beverage, it’s going to be cold by the end of Part 1.”

https://realpython.com/cpython-source-code-guide/

#CPython

All About Eve Quote GIF by Top 100 Movie Quotes of All Time

Bette Davis as Margo Channing in All About Eve, saying “Fasten your seatbelts; it’s going to be a bumpy night.”
Dmitry Tantsur
8 months ago

PEP 703 – Making the Global Interpreter Lock Optional in #CPython #Python
https://peps.python.org/pep-0703/

9 months ago

@lesley @lefticus aside from that, #CPython has a garbage collector for cycles not collected by reference counting and other #Python implementations like #PyPy only use GC

hugovk
10 months ago

@brianokken This is great, thank you!

In addition to making sure your own code is ready for 3.12, you're also testing #CPython itself and might find bugs there too. If so, please report upstream :)
https://devguide.python.org/triage/issue-tracker/

Here's how I found a release blocker for 3.11 last year: https://twitter.com/hugovk/status/1482367773577822208 #Python #testing

Luciano Ambrosini
10 months ago

𝗔𝗜 𝗖𝗼𝗺𝗽𝗹𝗲𝘁𝗶𝗼𝗻-𝗔𝗶𝗱𝗲𝗱 𝗗𝗲𝘀𝗶𝗴𝗻 𝘀𝘁𝗮𝗿𝘁𝘀 𝗳𝗿𝗼𝗺 𝗮𝗻𝘀𝘄𝗲𝗿𝘀 - 𝗢𝗽𝗲𝗻𝗔𝗜 𝗖𝗼𝗺𝗽𝗹𝗲𝘁𝗶𝗼𝗻 𝗺𝗼𝗱𝗲
-
𝘞𝘪𝘭𝘭𝘪𝘢𝘮 𝘎𝘪𝘣𝘴𝘰𝘯’𝘴 𝘶𝘤𝘩𝘳𝘰𝘯𝘪𝘢 𝘪𝘯 𝘵𝘩𝘦 𝘧𝘪𝘦𝘭𝘥 𝘰𝘧 𝘥𝘦𝘴𝘪𝘨𝘯 𝘪𝘴 𝘢𝘣𝘰𝘶𝘵 𝘵𝘰 𝘩𝘢𝘱𝘱𝘦𝘯?
-
You can read here some shared reflections over a good coffee or tea --> https://lnkd.in/dDjS7cdg
-
Video demo here --> https://lnkd.in/d2u246QW
-
#cyberpunk #openai #gpt3 #davinci #artificialintelligence
#environmentaldesign #AICompletionAidedDesign #AmbrosinusToolkit #DEV #Grasshopper #CPython #coding #rhino #architects #designers #lucianoambrosini

"AI gift..." a provocative image-art by Luciano Ambrosini
Luciano Ambrosini
10 months ago

𝗔𝗱𝘃𝗮𝗻𝗰𝗲𝗱 𝘃𝗲𝗿𝘀𝗶𝗼𝗻 𝗼𝗳 𝗢𝗽𝗲𝗻𝗔𝗜 (𝗗𝗔𝗟𝗟-𝗘) 𝗶𝗻𝘀𝗶𝗱𝗲 𝗚𝗿𝗮𝘀𝘀𝗵𝗼𝗽𝗽𝗲𝗿 𝘄𝗶𝘁𝗵 𝗣𝘆𝘁𝗵𝗼𝗻
📣 There are different ways to install and test the new features, so, if you are curious... 🎶
-
✨Have a look here -->https://lnkd.in/dpBbpTiv
-
🎞️ "Edit mode" video highlights here --> https://lnkd.in/dWG_27_r
🎞️ "Variation mode" video highlights here --> https://lnkd.in/d7nG8Pig
-
Enjoy the exploration! ;)

#openai #dalle2 #img2img #AmbrosinusToolkit #DEV #Grasshopper #CPython #coding #rhino #prompt #ai #lucianoambrosini

Luciano Ambrosini
10 months ago

𝗦𝘁𝗮𝗯𝗶𝗹𝗶𝘁𝘆𝗔𝗜 (𝗦𝘁𝗮𝗯𝗹𝗲 𝗗𝗶𝗳𝗳𝘂𝘀𝗶𝗼𝗻) 𝗶𝗻𝘀𝗶𝗱𝗲 𝗚𝗿𝗮𝘀𝘀𝗵𝗼𝗽𝗽𝗲𝗿 𝘄𝗶𝘁𝗵 𝗣𝘆𝘁𝗵𝗼𝗻
📣 Thanks to Stability-AI API documentation for Stable Diffusion (v 1.5) by DreamStudio it is possible to integrate into Grasshopper our "prompts to image" process throughout my component "LA_StabilityAI-GH"
-
✨ Have a look here -->https://lnkd.in/dTyXPigP
🎞️ Video demo here -->https://lnkd.in/dhmJ7cpN
-
-
#stabilityai #stablediffusion #DreamStudio #AmbrosinusToolkit #DEV #Grasshopper #CPython #coding #rhino #ai #lucianoambrosini

StabilityAI (Stable Diffusion) inside Grasshopper with Python by Luciano Ambrosini
Luciano Ambrosini
10 months ago

𝗢𝗽𝗲𝗻𝗔𝗜 (𝗗𝗔𝗟𝗟-𝗘) 𝗶𝗻𝘀𝗶𝗱𝗲 𝗚𝗿𝗮𝘀𝘀𝗵𝗼𝗽𝗽𝗲𝗿 𝘄𝗶𝘁𝗵 𝗣𝘆𝘁𝗵𝗼𝗻

📣Thanks to Open AI API documentation for DALL-E is it possible to integrate into Grasshopper our "prompts to image" process throughout my component "LA_OpenAI-GH" (I am going to update it in my Ambrosinus-Toolkit soon!) - I am still in WIP but... 🎶
-
✨Have a look here -->https://lnkd.in/dFhTxUDR
-
-
#openai #dalle2 #AmbrosinusToolkit #DEV #Grasshopper #CPython Mahmoud M. Abdelrahman #coding #rhino #prompttoimage #ai #architects #lucianoambrosini

OpenAI inside Grasshopper by Luciano Ambrosini
μCodery
10 months ago

This week’s #FOSSSupport is the @ThePSF. I’m proud to say I am already a supporting member of the #psf but right now they are in the middle of their biggest fundraiser. If you are involved at all with Python this is an obvious choice, it will #python #cpython #pypi #pycon and more
https://www.python.org/psf/donations/2022-q4-drive/

I've done a benchmark between Rust, C, Common Lisp and Python on my SBC which has ARM processor and here are the results:

https://far.chickenkiller.com/computer/benchmarking-common-lisp-rust-c-and-python-on-arm/

#benchmark #c #lisp #cl #common_lisp #rustlang #arm #armv7 #pi #python #cpython #pypy #pypy3

Brett Cannon
10 months ago

@mike Yep, every project you depend on will have their own lifecycle policies that folks should be aware of. In general I think the science part of the Python community is a bit shorter than #CPython itself, probably so people don't get caught all at once with unsupported Python **and** dependencies.

Olivia Appleton
10 months ago

It's time for a re-#introduction!

I'm a #MastersStudent in #ComputerScience. In my spare time, I develop #OpenSourceSoftware such as
- a library to talk to #ManifoldMarkets from native #Python
- a #PredictionMarket manager using the above
- a transpiler from a subset of Python to #OpenStreetMaps's OverpassQL
- bug fixes to many other projects, including #mypy, #base58, #attrs, #cpython, and more

I'm also a hobbyist editor on OpenStreetMap.

#Bi, #transfem, and happily dating my enby sweetheart

Olivia Appleton
11 months ago

It's time for a re-#introduction!

I'm a #MastersStudent in #ComputerScience. In my spare time, I develop #OpenSourceSoftware such as
- a library to talk to #ManifoldMarkets from native #Python
- a #PredictionMarket manager using the above
- a transpiler from a subset of Python to #OpenStreetMaps's OverpassQL
- bug fixes to many other projects, including #mypy, #base58, #attrs, #cpython, and more

I'm also a hobbyist editor on OpenStreetMap.

#Bi, #transfem, and happily dating my enby sweetheart

Albert Cardona
11 months ago

@weetster Most exciting, from the #python 3.11 release notes, are the various pieces in place for a future just-in-time compiler (JIT). May #CPython catch up with #PyPy soon in performance.

Der in Python geschriebene Python-Compiler Nuitka soll in Version 1.0 Performance-Vorteile durch verbessertes Speichermanagement liefern.
Python-Compiler Nuitka 1.0 verspricht mehr Tempo
Der Facebook-Mutterkonzern verstärkt mit dem Sponsoring sein Engagement für die Programmiersprache, die intern für Machine Learning stark genutzt wird.
Machine Learning: Meta spendet 300.000 Dollar an die Python Software Foundation
Bugfixes und kleine Verbesserungen gegenüber Version 2.0 sollen der alternativen Python-Runtime weiteren Schwung bescheren.
JIT-Compiler: Pyston 2.1 soll Python-Anwendungen schneller machen
Kompatibel mit Python 3.8, aber eine bis zu 20 Prozent höhere Geschwindigkeit: So lautet das Versprechen der Runtime-Alternative Pyston – dank JIT-Kompilierung.
Pyston 2.0 will Python Beine machen
Strypey
4 years ago

@seven
"#Firefox really could run #CPython and #Unreal Engine 3 in 2013"

Woah. That is kind of cool.