Slide 1

Slide 1 text

PEPs that hit the front page

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

Python Mauritius Usergroup site fb linkedin mailing list url pymug.com site 3

Slide 4

Slide 4 text

About me compileralchemy.com 4

Slide 5

Slide 5 text

slides 5

Slide 6

Slide 6 text

PEPs that hit the front page 6

Slide 7

Slide 7 text

PEPs -> Python Enhancement Proposal 7

Slide 8

Slide 8 text

Process: Proposal Seek sponsor Formulate draft and propose Verdict Accepted Implemented 8

Slide 9

Slide 9 text

All considerable Python improvements & features pass by PEPs 9

Slide 10

Slide 10 text

PEP 684 – A Per-Interpreter GIL 10

Slide 11

Slide 11 text

GIL -> Global Interpreter Lock 11

Slide 12

Slide 12 text

mutex only one thread executing python: on mutex / lock for threads GIL -> Allows values to be changed safely Prevents multi-core support 12

Slide 13

Slide 13 text

A Per-Interpreter GIL 13

Slide 14

Slide 14 text

Have many interpreters Sub interpreters Each one has a GIL Each thread runs interpreter with own GIL Work on PEP 554 – Multiple Interpreters in the Stdlib -- makes sense in context of this pep 14

Slide 15

Slide 15 text

PEP 703 – Making the Global Interpreter Lock Optional in CPython 15

Slide 16

Slide 16 text

Sam gross: Fb engineer Changes to internals Not much change to C API GIL optional, diabled by default: https://github.com/colesbury/nogil Allows parallelizing well up to the number of available cores Replaces CPython's allocator with https://github.com/microsoft/mimalloc helps GPU-heavy workloads 16

Slide 17

Slide 17 text

More than a POC In the Dose-3D project, the key challenge was to maintain a stable, non-trivial concurrent communication link with hardware units while utilizing a 1 Gbit/s UDP/IP connection to the maximum. Naturally, we started with the multiprocessing package, but at some point, it became clear that most CPU time was consumed by the data transfers between the data processing stages, not by data processing itself. The CPython multithreading implementation based on GIL was a dead end too. When we found out about the “nogil” fork of Python it took a single person less than half a working day to adjust the codebase to use this fork and the results were astonishing. 17

Slide 18

Slide 18 text

PEP 621 – Storing project metadata in pyproject.toml 18

Slide 19

Slide 19 text

project metadata in pyproject.toml diables code execution to read project data 19

Slide 20

Slide 20 text

PEP 8 – Style Guide for Python Code 20

Slide 21

Slide 21 text

Style guide Zen of Python 21

Slide 22

Slide 22 text

Interesting Open PEPs PEP 738 – Adding Android as a supported platform PEP 730 – Adding iOS as a supported platform 22

Slide 23

Slide 23 text

That's all folks 23