Software Development
Tips, ideas, examples, and tutorials of Python programming
עלינו
Python Maven is for people who are interested in Python tips, ideas and tutorials.
- תעשייה
- Software Development
- גודל החברה
- 1 עוֹבד
- משרדים ראשיים
- Modiin
- התמחויות
עדכונים
-
Everything you need to know about docstrings, but never wanted to ask Remember early grade school and those repetitive handwriting drills in exercise books? We grew up and swapped notebooks for a code editor, but the habit stuck. Let's face it: for most developers, writing docstrings is just another programmer drill - something we feel forced to do, even though few remember why. It ends up acting as nothing more than a graphical separator between a function's signature and its implementation. Many of us live with the mindset that "good code documents itself," making triple quotes feel like a waste of time. The result? We either skip docstrings entirely or generate automated monstrosities that proudly reveal get_user_id(user) is meant to... get user id. Join this session if you dread writing docstrings. I promise that afterwards, you're still allowed to dislike it - but at least doing it will be less painful and far more useful! With Maria Lowas-Rzechonek https://luma.com/a1xtcmqi
-
Online presentation and free chat nanobind is the official successor to the widely used pybind11 library, allowing you to quickly create seamless and maintainable Python bindings for C++ code. For pybind11, an extension called pybind11_json was developed to easily pass JSON objects between Python and C++. This package has been used in an open-source project that I contribute to. However, when we decided to migrate to nanobind, we discovered a major issue: the nanobind equivalent - which is even linked directly from the pybind11_json README - did not work at all. In this talk, I will share the fun (and not-so-fun) parts of my journey to fix this package. I'll go over what pybind11 is and how nanobind improves it. I'll provide a brief overview of the open-source project I was working on, and explain why we needed JSON interoperability. From there, I’ll dive into the specific bugs, quirks, and issues I encountered while resurrecting nanobind_json. Throughout the whole talk I will showcase necessary examples and code snippets. Follow our calendar and register here: https://lnkd.in/dEzSQAWR Gracjan Adamus #Python
-
Discussing language features, runtime reflections and direction forward in #Python the lazy way. Coming up on 30 years and Python programming language has been growing faster than ever. It has endured many paradigm shifts along the way as well as many competitors for the throne of prototyping king. Unlike its contemporaries which has come and gone, Python is more popular than ever and it topped every popularity chart before agents skewed all datasets. Reflecting on where we had been and where we are going make for a great realignment. Will Python's explicit typing cost its personality or force an evolution rarely seen since Python 2.7? Speaker: Aekasitt Guruvanich https://lnkd.in/ePUZXzDh
Lazing for Impact, Python in 2026 with Aekasitt (Sitt) Guruvanich
https://www.youtube.com/
-
Another example of sequential and synchronous execution of tasks in a loop. In this example too we'll use `sleep` to pretend we are waiting for some external task to finish, but this time we'll start a number of jobs based on what the user supplies. We can't know up-front how many tasks we'll have to call. Output Start 0 End 0 Start 1 End 1 Start 2 End 2 Start 3 End 3 Elapsed 4.004362344741821 As one could expect from such code, the total time required for such program to run is the sum of all the tasks as they run sequentially. Source: https://lnkd.in/dm9GBJXd Author: Gábor Szabó
-
Plain printing example with async #Python * This is almost the same example as we had previously, but we wait asynchronously. * The order of the output is now different. * It also finishes 1 sec faster. It finishes when the longest wait ends. What did we don? * We added async in-front of the function definitions to make them co-routines. * We replaced the time.sleep by asyncio.sleep that can handle async sleep. * We called this new sleep function with the await keyword. That tells the even-loop that other tasks can run till this thing we are awaiting-for finishes. * We called the say function inside an await-ed call to asyncio.gather. * We started the event loop with asyncio.run. Output <coroutine object main at 0x78265ad9a4d0> start main Second First Elapsed: 2.0022734529920854 The first print shows that what the main function returns is a object of type coroutine. The "Second" print appears before the "First", because the former only had to wait 1 second why the latter waited 2 seconds. source: https://lnkd.in/dhqq35jN Author: Gábor Szabó
-
Before getting into async in #Python this is a simple example of printing in sync. * In this example we use sleep to imitate some external task we need to wait for and then we print out some text. * We do it sequentially. No async here. The output is First Second Elapsed: 3.0015416080132127 So it takes slightly more than 3 seconds to wait first for 2 and then for 1 second. No big surprise there. Source: https://lnkd.in/dXZiwSt6 Author: Gábor Szabó