social.dk-libre.fr is a Fediverse instance that uses the ActivityPub protocol. In other words, users at this host can communicate with people that use software like Mastodon, Pleroma, Friendica, etc. all around the world.

This server runs the snac software and there is no automatic sign-up process.

Search results for tag #python

[?]Mariusz Felisiak » 🌐
@felixxm@fosstodon.org

Who would expect that my tiny contribution would be merged into Python 🐍 🎉 Be patient folks, there is no rush 🧘

github.com/python/cpython/pull

    [?]James Bennett [he/him] » 🌐
    @ubernostrum@infosec.exchange

    Last year @yossarian wrote a brief post on the surprising complexity of the "splitlines()" method. As a busy Unicode pedant, it took me a while to write up something explaining *why* it's complex, but here it finally is:

    b-list.org/weblog/2026/aug/10/

      [?]LWN.net » 🌐
      @lwn@fedi.lwn.net

      Django moves to an annual release cycle

      lwn.net/Articles/1088059/

        [?]Python Software Foundation » 🌐
        @ThePSF@fosstodon.org

        Need more information on running for the inaugural Python Packaging Council? Check out our blog post: pyfound.blogspot.com/2026/07/g

          [?]Python Software Foundation » 🌐
          @ThePSF@fosstodon.org

          Need more information on running for the PSF Board? Check out our blog post: pyfound.blogspot.com/2026/07/g

            [?]Python Software Foundation » 🌐
            @ThePSF@fosstodon.org

            You have a little more than 24 hours left to submit a PSF Board or Python Packaging Council nomination for yourself or someone else 🩵🐍💛 Submit your nominations by tomorrow, Tuesday, August 11th, 2:00 pm UTC!
            python.org/nominations/electio

              [?]Trey Hunner 🐍 » 🌐
              @treyhunner@mastodon.social

              Python Tip #221 (of 365):

              Implement appropriate dunder methods.

              Dunder methods are a contract between your class and the Python interpreter.

              • __add__ & __radd__ power +
              • __eq__ powers ==
              • __len__ powers len()

              Dunder methods are what third-party library authors use to make their objects feel like NATIVE Python objects.

              Django QuerySet objects support indexing, iteration, len(...), and truthiness.

              And Pandas DataFrames support a whole BUNCH of syntax.

              🧵 (1/2)

                [?]Trey Hunner 🐍 » 🌐
                @treyhunner@mastodon.social

                “In addition to os.name and sys.platform, there's an even higher level approach to find the platform that your code is running on, with the platform module.”

                Read more 👉 pym.dev/operating-system-check

                  [?]Juhis » 🌐
                  @hamatti@mastodon.world

                  h is for htmx

                  A short teaser for htmx for those who don't yet know it exists. I plan to write more in-depth posts about it when I'm not in a daily post grind like with Blaugust but wanted to give a shoutout to it anyway.

                  For the past couple of years, all my new Django projects are built with htmx and it's one of my favourite tools in my toolbox these days.

                  hamatti.org/posts/h-is-for-htm

                    [?]Trey Hunner 🐍 » 🌐
                    @treyhunner@mastodon.social

                    Python Tip #220 (of 365):

                    Trying quack like a duck? Seek help.

                    When implementing a common Python protocol (a sequence, a mapping, etc.), inherit from the matching abstract base class (ABC):

                    from collections.abc import MutableSequence

                    class MyCustomList(MutableSequence):
                    ...

                    Benefits:

                    1. isinstance & issubclass checks work well (i.e. isinstance(x, Sequence))

                    2. Python will complain LOUDLY if you forget to implement a required method for the protocol

                    🧵 (1/3)

                      [?]Adam Johnson :django: :python: » 🌐
                      @adamchainz@fosstodon.org

                      ✍️ I just released a new version of my little Python profiler, tprof, with less overhead for more accurate results.

                      adamj.eu/tech/2026/08/08/pytho

                        [?]Trey Hunner 🐍 » 🌐
                        @treyhunner@mastodon.social

                        “As you write your code, pause and ask: “what should stand out here at a glance?””

                        Read more 👉 pym.dev/embrace-whitespace/

                          Lily boosted

                          [?]Marijke Luttekes @ DjangoCPH [she/her] » 🌐
                          @mahryekuh@hachyderm.io

                          RE: mastodon.social/@djangonews/11

                          New Django just dropped! 🙌🏻 🚀

                          I’m happy to see an implementation of one of my accessibility feature requests in there as well: `django.db.models.fields.BLANK_CHOICE_LABEL`.

                          I don’t have the spoons to explain it right now, but the backstory is in the ticket.

                            [?]codingjoe :django: :python: » 🌐
                            @codingjoe@fosstodon.org

                            [?]Trey Hunner 🐍 » 🌐
                            @treyhunner@mastodon.social

                            New article on goose typing in Python (yes, that's actually a thing).

                            You can duck typing WHILE type checking.

                            pym.dev/goose-typing

                              [?]Trey Hunner 🐍 » 🌐
                              @treyhunner@mastodon.social

                              Python Tip #219 (of 365):

                              Validate your ducks with goose typing.

                              You can use isinstance() WHILE duck typing. This is called goose typing (coined by Alex Martelli).

                              >>> from collections‍.abc import Iterable
                              >>> isinstance([1, 2, 3], Iterable)
                              True

                              Point doesn't inherit from Iterable:

                              class Point:
                              def __init__(self, x, y): self.x, self.y = x, y
                              def __iter__(self): yield from (self.x, self.y)

                              And yet...

                              >>> isinstance(Point(1, 2), Iterable)
                              True

                              🧵 (1/3)

                                [?]Adam Johnson :django: :python: » 🌐
                                @adamchainz@fosstodon.org

                                🎨 I’m really enjoying the redesigned PyPI project pages. Thanks to Nicole Harris and team for making these improvements!

                                Blog post:

                                blog.pypi.org/posts/2026-07-22

                                Django’s project page on PyPI, showcasing the new design.

                                Alt...Django’s project page on PyPI, showcasing the new design.

                                  [?]Hugo van Kemenade » 🌐
                                  @hugovk@mastodon.social

                                  @mgorny The good news is that was merged in 2024 but never actually released, so this change only affects those using unreleased source directly? And it's been archived on PyPI, so perhaps find a replacement.

                                    [?]Jesus Michał von Gentoo 🏔 (he) » 🌐
                                    @mgorny@social.treehouse.systems

                                    Today in things that couldn't have aged well:

                                    "Unpin flit-core dependency" 2 years ago without actually updating the metadata to use the newer pyproject.toml format.

                                    github.com/sethmlarson/socksio

                                      [?]Trey Hunner 🐍 » 🌐
                                      @treyhunner@mastodon.social

                                      Python Tip #218 (of 365):

                                      Don't needlessly convert between data types.

                                      Looping over a file once? There's no reason to convert it to a list first:

                                      for line in my_file:
                                      print(line, end="")

                                      Another example: if you're looping over a set, there's no reason to convert it to a list either:

                                      >>> colors = {'red', 'blue', 'yellow'}
                                      >>> for color in colors:
                                      ... print(color)
                                      ...
                                      red
                                      yellow
                                      blue

                                      "for" loops don't need a list. They accept ANY iterable.

                                      🧵 (1/2)

                                        [?]Adam Johnson :django: :python: » 🌐
                                        @adamchainz@fosstodon.org

                                        🆙 Updated my post on unittest base test cases with a new preferred technique: using a plain class as a container.

                                        adamj.eu/tech/2025/05/30/pytho

                                          [?]Trey Hunner 🐍 » 🌐
                                          @treyhunner@mastodon.social

                                          Python 3.15.0 release candidate 1 is out!

                                          python.org/downloads/release/p

                                          Test your code against it and let the core devs know if you find bugs!

                                          If you have uv, getting it is easy:

                                          uv self update
                                          uv python install

                                          That even works if you already have an alpha or beta version installed (it'll upgrade it for you).

                                            [?]Jeff Triplett » 🌐
                                            @webology@mastodon.social

                                            RE: fosstodon.org/@ThePSF/11704441

                                            For devs who like to fill out surveys... ✅

                                            [?]Python Software Foundation » 🌐
                                            @ThePSF@fosstodon.org

                                            The 2026 Python Type System & Tooling Survey is live 🐍📝❓ No typing experience needed—your perspective as a dev matters most. Take a couple minutes to help improve Python typing for all!

                                            surveymonkey.com/r/python_typi

                                            This survey was developed with support from the Pyrefly team at Meta, the PyCharm team at JetBrains, the Python team at Microsoft, and the typing community on discourse.python.org.

                                                [?]Python Software Foundation » 🌐
                                                @ThePSF@fosstodon.org

                                                The 2026 Python Type System & Tooling Survey is live 🐍📝❓ No typing experience needed—your perspective as a dev matters most. Take a couple minutes to help improve Python typing for all!

                                                surveymonkey.com/r/python_typi

                                                This survey was developed with support from the Pyrefly team at Meta, the PyCharm team at JetBrains, the Python team at Microsoft, and the typing community on discourse.python.org.

                                                  [?]Trey Hunner 🐍 » 🌐
                                                  @treyhunner@mastodon.social

                                                  Python Tip #217 (of 365):

                                                  Think in terms of the minimum viable duck.

                                                  In other words: "what's the least this object needs to do to work in this context?"

                                                  For example, csv.reader is usually given a file object... but it accepts ANY iterable of delimited lines:

                                                  >>> import csv
                                                  >>> rows = ['a,b,c', '1,2,3']
                                                  >>> list(csv.reader(rows))
                                                  [['a', 'b', 'c'], ['1', '2', '3']]

                                                  🧵 (1/4)

                                                    [?]Hugo van Kemenade » 🌐
                                                    @hugovk@mastodon.social

                                                    [?]Hugo van Kemenade » 🌐
                                                    @hugovk@mastodon.social

                                                    Peter's PEP 797 – Shared Object Proxies was also the first PEP rejected for 3.16 as well! ✌️
                                                    peps.python.org/pep-0797/

                                                      [?]Hugo van Kemenade » 🌐
                                                      @hugovk@mastodon.social

                                                      Forget Python 3.15 (don't forget it, please test!), the first PEP for Python 3.16 has been accepted:

                                                      PEP 828 – Supporting ‘yield from’ in asynchronous generators, by Peter Bierma

                                                      peps.python.org/pep-0828/

                                                        [?]Jesus Michał von Gentoo 🏔 (he) » 🌐
                                                        @mgorny@social.treehouse.systems

                                                        Me after laboriously backporting 3.15 fixes to 6.0.x in : "oh, nice, the patchset applies cleanly to 5.2.x as well."

                                                        And today, I have to laboriously backport another patch to 6.0.x, and it turns out the backport doesn't apply cleanly to 5.2.x, so I have to laboriously backport it there as well.

                                                        I honestly *hate* Django Python version support policy. Shifting all the burden downstream.

                                                          [?]Marcos Dione » 🌐
                                                          @mdione@en.osm.town

                                                          TIL that 's `pathlib.Path` is expensive compared to plain `str`ings. I tested by `.walk()`ing a 2 level directory structure with 40M files and it took 9m. When I tried with `os.walk()`, it only took 1m. Of course, I tested this several times to avoid cold vs hot cache.

                                                          Tritium#python@libera.chat tracked it down to the constructor to `pathlib.Path`, which does a lot of things than being just a `str`:

                                                          github.com/python/cpython/blob

                                                            [?]yossarian » 🌐
                                                            @yossarian@infosec.exchange

                                                            my keynote from europython is online!

                                                            youtu.be/wMPe_KepOjc

                                                              [?]Trey Hunner 🐍 » 🌐
                                                              @treyhunner@mastodon.social

                                                              Python Tip #216 (of 365):

                                                              In Python, we often care more about the behavior of an object than its type.

                                                              We say "if it looks like a duck and quacks like a duck, it's a duck".

                                                              When we check for duckness, we don't test DNA, we observe behavior.

                                                              Instead of asking "what TYPE can I use here?", ask "does my object have the BEHAVIOR that's expected here?"

                                                              🧵 (1/3)

                                                                [?]Hugo van Kemenade » 🌐
                                                                @hugovk@mastodon.social

                                                                Some things sooner than others:

                                                                3.15 RC 1 is out, but we'll wait until tomorrow to do 3.13 and 3.14 so we can include this fix for macOS that will become a problem in mid-September:

                                                                github.com/python/cpython/issu

                                                                3.15 will have another release (1st Sept) before then, but 3.13 and 3.14's next one is in October, so better wait for the fix.

                                                                  [?]Hugo van Kemenade » 🌐
                                                                  @hugovk@mastodon.social

                                                                  🐍🚀 Out now: Python 3.15 release candidate 1!

                                                                  Please test and report bugs!

                                                                  We strongly encourage maintainers of to prepare their projects for 3.15 during this phase, and publish Python 3.15 wheels on PyPI to be ready for the final release of 3.15.0, and to help other projects do their own testing.

                                                                  Any binary wheels built against Python 3.15.0 release candidates will work with future versions of Python 3.15.

                                                                  discuss.python.org/t/python-3-

                                                                    [?]Python Software Foundation » 🌐
                                                                    @ThePSF@fosstodon.org

                                                                    The nomination period for the PSF Board and Python Packaging Council elections is open now, closing next Tuesday, August 11th, 2:00 pm UTC 📝🐍 Don't wait until the last minute, though! Nominate yourself or someone else today: python.org/nominations/electio

                                                                      [?]Hugo van Kemenade » 🌐
                                                                      @hugovk@mastodon.social

                                                                      🔒🐍 Coming soon, Python 3.15 release candidate 1! The 3.15 branch is now locked until 3.15.0 final in October.
                                                                      discuss.python.org/t/the-3-15-

                                                                      Also coming soon: Python 3.13.15 and 3.14.7.
                                                                      hugovk.dev/next-release/

                                                                        [?]Kushal Das :python: :tor: 🇸🇪 » 🌐
                                                                        @kushal@toots.dgplug.org

                                                                        Jag har också en kurs som hjälper Scratch-generationen att ta steget över till genom den välbekanta miljön. Kursen innehåller även grundläggande hårdvaruprogrammering för att göra inlärningen rolig. Kurserna startar i slutet av augusti. Dela gärna så att fler föräldrar får se detta.

                                                                        enkelkod.se/beginner.html

                                                                          [?]Trey Hunner 🐍 » 🌐
                                                                          @treyhunner@mastodon.social

                                                                          Python Tip #215 (of 365):

                                                                          Know what it means to be a "sequence" in Python.

                                                                          Lists, strings, and tuples are all sequences:

                                                                          >>> fruits = ["apple", "lemon", "pear"]
                                                                          >>> coordinates = (1, 8, 2)
                                                                          >>> greeting = "Hi y'all!"

                                                                          A sequence is an ordered collection that:

                                                                          1. Has a length
                                                                          2. Can be indexed from "0" up to one less than its length
                                                                          3. Can be looped over

                                                                          >>> len(fruits)
                                                                          3
                                                                          >>> fruits[0]
                                                                          'apple'
                                                                          >>> for c in coordinates: print(c)
                                                                          1
                                                                          8
                                                                          2

                                                                          🧵 (1/3)

                                                                            [?]Trey Hunner 🐍 » 🌐
                                                                            @treyhunner@mastodon.social

                                                                            “The defaultdict is very handy, but I find that it's rarely useful enough that I feel the need to use it.”

                                                                            Read more 👉 pym.dev/default-dictionary-val

                                                                              [?]Adam Johnson :django: :python: » 🌐
                                                                              @adamchainz@fosstodon.org

                                                                              ✍️ New post demonstrating the runtime advantage of my package time-machine over its inspiration, freezegun.

                                                                              adamj.eu/tech/2026/08/03/pytho

                                                                                [?]Juhis » 🌐
                                                                                @hamatti@mastodon.world

                                                                                B is for batteries included

                                                                                Python comes with batteries included — meaning it has a fantastic, powerful standard library. Two years ago, I spent an entire August writing about my favourite parts of it.

                                                                                hamatti.org/posts/b-is-for-bat

                                                                                  [?]Juhis » 🌐
                                                                                  @hamatti@mastodon.world

                                                                                  A is for assert

                                                                                  assert is handy built-in in Python that can be used as a failsafe for scripts and for writing tests with pytest.

                                                                                  hamatti.org/posts/a-is-for-ass

                                                                                    [?]Adam Johnson :django: :python: » 🌐
                                                                                    @adamchainz@fosstodon.org

                                                                                    ✍️ time-machine 3.3.0 is out, with Python 3.15 support, performance improvements, subinterpreter support, and various bug fixes.

                                                                                    Check it out, and if you’re using freezegun, try the updated Migration CLI to convert and speed up your tests.

                                                                                    adamj.eu/tech/2026/07/31/pytho

                                                                                      [?]Hugo van Kemenade » 🌐
                                                                                      @hugovk@mastodon.social

                                                                                      RE: fosstodon.org/@adamchainz/1170

                                                                                      "Wheels are also now built with frame pointers enabled, per the PEP 831 change in Python 3.15. Frame pointers are a debugging feature for low-level languages like C, which allow debuggers to reconstruct the call stack of a program. Python has decided to enable frame pointers by default and encourage the ecosystem to do so as well, to make debugging easier for us all, so time-machine is joining the party."

                                                                                      Enabled by default for 3.15, do this for older versions:

                                                                                      github.com/adamchainz/time-mac

                                                                                      [?]Adam Johnson :django: :python: » 🌐
                                                                                      @adamchainz@fosstodon.org

                                                                                      ✍️ time-machine 3.3.0 is out, with Python 3.15 support, performance improvements, subinterpreter support, and various bug fixes.

                                                                                      Check it out, and if you’re using freezegun, try the updated Migration CLI to convert and speed up your tests.

                                                                                      adamj.eu/tech/2026/07/31/pytho

                                                                                          AodeRelay boosted

                                                                                          [?]Trey Hunner 🐍 » 🌐
                                                                                          @treyhunner@mastodon.social

                                                                                          Python Tip #214 (of 365):

                                                                                          Use truthiness for integers with caution.

                                                                                          I DO rely on truthiness checks for integers, but not always. I would recommend only using them when they seem to improve readability.

                                                                                          I find this:
                                                                                          if hours: ...

                                                                                          More readable than this:
                                                                                          if hours > 0: ...

                                                                                          But I find this:
                                                                                          if number % 2 != 0: ...

                                                                                          More readable than this:
                                                                                          if number % 2: ...

                                                                                          🧵 (1/2)

                                                                                            [?]Hugo van Kemenade » 🌐
                                                                                            @hugovk@mastodon.social

                                                                                            The German translation of the Python docs is being restarted. Want to help out? Get in touch with Swen!

                                                                                            discuss.python.org/t/starting-

                                                                                              Christian boosted

                                                                                              [?]🌈 ☯️Teresita🐧👭 » 🌐
                                                                                              @linuxgal@techhub.social

                                                                                              Plot a 3D sphere with

                                                                                              #!/usr/bin/python3
                                                                                              import numpy as np
                                                                                              import matplotlib.pyplot as plt
                                                                                              theta, phi = np.linspace(0, 2 * np.pi, 50), np.linspace(0, np.pi, 20)
                                                                                              THETA, PHI = np.meshgrid(theta, phi)
                                                                                              R = 1.0
                                                                                              X = R * np.sin(PHI) * np.cos(THETA)
                                                                                              Y = R * np.sin(PHI) * np.sin(THETA)
                                                                                              Z = R * np.cos(PHI)
                                                                                              fig = plt.figure()
                                                                                              ax = fig.add_subplot(1,1,1, projection='3d')
                                                                                              plot = ax.plot_wireframe(X, Y, Z, rstride=1, cstride=1, linewidth=.1, color='red', antialiased=False, alpha=1)
                                                                                              plt.show()

                                                                                                Dryusdan boosted

                                                                                                [?]Fabien LOISON (FLOZz) » 🌐
                                                                                                @FLOZz@mastodon.social

                                                                                                🚀 I just released rst2gemtext v0.7.0!

                                                                                                It is a library and a CLI tool to convert reStructuredText to Gemtext (Gemini markup format).

                                                                                                ➡️ github.com/flozz/rst2gemtext/r

                                                                                                This version adds support for the Docutils' csv-table and list-table directives. Thank you @Dryusdan to make me know about them! 😁

                                                                                                  Wolf boosted

                                                                                                  [?]input » 🌐
                                                                                                  @feed@igeek.gamer-geek-news.com

                                                                                                  📰 New GitHub, PyPI Policies Hope to Boost Supply Chain Security

                                                                                                  "GitHub and the Python Package Index (PyPI) have introduced new policies meant to boost supply chain security," reports SecurityWeek, "by preventing the fast propagation of poisoned package version...

                                                                                                  📰 Source: Slashdot
                                                                                                  🔗 Link: https://developers.slashdot.org/story/26/08/01/0511237/new-github-pypi-policies-hope-to-boost-supply-chain-security?utm_source=rss1.0mainlinkanon&utm_medium=feed

                                                                                                  #Python #AI #ArtificialIntelligence

                                                                                                    [?]Hugo van Kemenade » 🌐
                                                                                                    @hugovk@mastodon.social

                                                                                                    Oh look, a new version of Delorean, the datetime enhancement library, has been released after just eight years:
                                                                                                    github.com/myusuf3/delorean/is 🚀🕒

                                                                                                      [?]Trey Hunner 🐍 » 🌐
                                                                                                      @treyhunner@mastodon.social

                                                                                                      Python Tip #213 (of 365):

                                                                                                      Replace "or"-chained equality comparisons with a containment check.

                                                                                                      Instead of this:

                                                                                                      is_vowel = c == "a" or c == "e" or c == "i" or c == "o" or c == "u"

                                                                                                      You can write this:

                                                                                                      is_vowel = c in ("a", "e", "i", "o", "u")

                                                                                                      In fact, you could even give that tuple a name:

                                                                                                      vowels = ("a", "e", "i", "o", "u")
                                                                                                      is_vowel = c in vowels

                                                                                                      🧵 (1/2)

                                                                                                        [?]gyptazy » 🌐
                                                                                                        @gyptazy@gyptazy.com

                                                                                                        just got released in v1.0 and is out of beta now!

                                                                                                        PegaProx for VE and clusters made a huge step and is finally out of beta!

                                                                                                        The first stable release also comes around with companies providing enterprise support. If you need SLA-backed help running PegaProx in production (or training sessions) you can now find a support partner at:

                                                                                                        Enterprise Support & Sponsors: https://pegaprox.com/sponsors.html
                                                                                                        Release: https://github.com/PegaProx/project-pegaprox/releases/tag/v1.0
                                                                                                        Website: https://pegaprox.com


                                                                                                        PegaProx v1.0 Release

                                                                                                        Alt...PegaProx v1.0 Release

                                                                                                          [?]Trey Hunner 🐍 » 🌐
                                                                                                          @treyhunner@mastodon.social

                                                                                                          “In order to use a for loop, you must have an iterable to loop over.”

                                                                                                          Read more 👉 pym.dev/while-loops/

                                                                                                            [?]Trey Hunner 🐍 » 🌐
                                                                                                            @treyhunner@mastodon.social

                                                                                                            "Or we could use the zip function with the strict=True argument to compare line-by-line in a for loop"

                                                                                                            Read more 👉 trey.io/0frqkp

                                                                                                              [?]Adam Johnson :django: :python: » 🌐
                                                                                                              @adamchainz@fosstodon.org

                                                                                                              ✍️ time-machine 3.3.0 is out, with Python 3.15 support, performance improvements, subinterpreter support, and various bug fixes.

                                                                                                              Check it out, and if you’re using freezegun, try the updated Migration CLI to convert and speed up your tests.

                                                                                                              adamj.eu/tech/2026/07/31/pytho

                                                                                                                [?]Trey Hunner 🐍 » 🌐
                                                                                                                @treyhunner@mastodon.social

                                                                                                                Python Tip #212 (of 365):

                                                                                                                Use any() and all() to check a condition across every item in an iterable

                                                                                                                This:

                                                                                                                any_negative = False
                                                                                                                for n in numbers:
                                                                                                                if n < 0:
                                                                                                                any_negative = True
                                                                                                                break

                                                                                                                Can be replaced with:

                                                                                                                any_negative = any(n < 0 for n in numbers)

                                                                                                                And this:

                                                                                                                all_good = True
                                                                                                                for item in iterable:
                                                                                                                if not condition(item):
                                                                                                                all_good = False
                                                                                                                break

                                                                                                                Can be replaced with:

                                                                                                                all_good = all(condition(item) for item in iterable)

                                                                                                                🧵 (1/2)

                                                                                                                all_good = True
for item in iterable:
    if not condition(item):
        all_good = False
        break

Can be rewritten as:

all_good = all(
    condition(item)
    for item in iterable
)

Also...

any_good = False
for item in iterable:
    if condition(item):
        any_good = True
        break

Can be rewritten as:

any_good = any(
    condition(item)
    for item in iterable
)

                                                                                                                Alt...all_good = True for item in iterable: if not condition(item): all_good = False break Can be rewritten as: all_good = all( condition(item) for item in iterable ) Also... any_good = False for item in iterable: if condition(item): any_good = True break Can be rewritten as: any_good = any( condition(item) for item in iterable )

                                                                                                                  [?]Trey Hunner 🐍 » 🌐
                                                                                                                  @treyhunner@mastodon.social

                                                                                                                  Did you know that map()/filter() were added to Python 6 years before comprehensions?

                                                                                                                  Also range() was added 9 years before zip() which was added 3 years before enumerate().

                                                                                                                  And strings methods weren't methods for the first 9 years... they lived in the string module!

                                                                                                                  For years I've wanted an easier way to look up facts like those.

                                                                                                                  Now I have a way! pym.dev/since

                                                                                                                  It's also available as a CLI tool via PyPI

                                                                                                                  uvx sincewhen 'sum()'

                                                                                                                    [?]Hugo van Kemenade » 🌐
                                                                                                                    @hugovk@mastodon.social

                                                                                                                    🐍🚀 Out now: Tablib 3.10.0

                                                                                                                    The format-agnostic tabular dataset library

                                                                                                                    🔒 Security fix to escape dataset title in HTML serialisation
                                                                                                                    🦥 Support for Python 3.15 with lazy imports
                                                                                                                    💧 Drop support for EOL Python 3.9
                                                                                                                    🩹 And a bunch of fixes

                                                                                                                    github.com/jazzband/tablib/rel

                                                                                                                      [?]Python Software Foundation » 🌐
                                                                                                                      @ThePSF@fosstodon.org

                                                                                                                      Thinking about nominating yourself or someone else for the upcoming PSF Board or Python Packaging Council elections? Now's your chance: take a couple minutes this weekend to submit a nomination!
                                                                                                                      python.org/nominations/electio

                                                                                                                        [?]Django News » 🤖 🌐
                                                                                                                        @djangonews@mastodon.social

                                                                                                                        [?]Trey Hunner 🐍 » 🌐
                                                                                                                        @treyhunner@mastodon.social

                                                                                                                        Using super()[key] won't work because the super class doesn't implement a __getitem__ method, but looking up the __getitem__ attribute on a super() object does work (assuming a parent class implements that method).

                                                                                                                        Read more 👉 trey.io/p0h32w

                                                                                                                          [?]AI6YR Ben » 🌐
                                                                                                                          @ai6yr@m.ai6yr.org

                                                                                                                          Great, now the AI is throwing malware into python libraries, too.

                                                                                                                          Anthropic's Claude breached 3 orgs, uploaded PyPI malware during tests

                                                                                                                          bleepingcomputer.com/news/secu

                                                                                                                            [?]Trey Hunner 🐍 » 🌐
                                                                                                                            @treyhunner@mastodon.social

                                                                                                                            Python Tip #211 (of 365):

                                                                                                                            Consider how your Boolean expressions read in English

                                                                                                                            For example, you could write "10 > x" or you could write "x < 10".

                                                                                                                            They check the same thing, but I find the latter one more readable.

                                                                                                                            Steve McConnell's Code Complete recommends writing numeric tests in "number-line order": order the values left to right, from smallest to largest.

                                                                                                                            Follow that rule and you'll always use < and <=, never > and >=.

                                                                                                                            I don't follow that advice...

                                                                                                                            🧵 (1/3)

                                                                                                                              [?]Hugo van Kemenade » 🌐
                                                                                                                              @hugovk@mastodon.social

                                                                                                                              What's New in Python 3.15:

                                                                                                                              csv

                                                                                                                              * csv.Sniffer.sniff() delimiter detection is now up to 1.6x faster. (Contributed by Maurycy Pawłowski-Wieroński.)

                                                                                                                              docs.python.org/3.15/whatsnew/

                                                                                                                                [?]Jesus Michał von Gentoo 🏔 (he) » 🌐
                                                                                                                                @mgorny@social.treehouse.systems

                                                                                                                                Zero days since added a random new functionality that depends on pip being entirely standalone and breaks when you unbundle the dependencies. And I'm unable to figure out why a bunch of tests are still failing.

                                                                                                                                EDIT: I'd appreciate some help with that. My WIP is at codeberg.org/gentoo/gentoo/pul.

                                                                                                                                  [?]Trey Hunner 🐍 » 🌐
                                                                                                                                  @treyhunner@mastodon.social

                                                                                                                                  Finding an item in a sorted list of 10 million things:

                                                                                                                                  ✅ Binary search: 23 comparisons
                                                                                                                                  ❌ The `in` operator: 2+ million comparisons

                                                                                                                                  Python's bisect module does binary search for you. New article, with recipes for closest-match and range lookups:

                                                                                                                                  pym.dev/binary-search/

                                                                                                                                    Clyde 🦣 boosted

                                                                                                                                    [?]Dalibo » 🌐
                                                                                                                                    @dalibo@mastodon.online

                                                                                                                                    JOB : nous recrutons un développeur / une développeuse backend.

                                                                                                                                    Découvrez le poste et les compétences requises, ainsi que les avantages à travailler chez Dalibo : télétravail, coopérative, grille salariale transparente… => blog.dalibo.com/2026/07/30/dev





                                                                                                                                    visuel promo du recrutement chez Dalibo

                                                                                                                                    Alt...visuel promo du recrutement chez Dalibo

                                                                                                                                    [?]Seth Larson » 🌐
                                                                                                                                    @sethmlarson@mastodon.social

                                                                                                                                    The Python Software Foundation is hiring a Security Developer to join @miketheman and I on triaging vulnerability reports and mitigating malware published to PyPI.

                                                                                                                                    If you've got experience with Python, security, and collaborating with open source projects then we'd love to hear from you:

                                                                                                                                    jobs.pyfound.org/apply/ei03ut6

                                                                                                                                      [?]Hugo van Kemenade » 🌐
                                                                                                                                      @hugovk@mastodon.social

                                                                                                                                      Lots of new stuff in pip 26.2:

                                                                                                                                      🍊 Support for Python 3.15
                                                                                                                                      🍊 Selecting only dependencies
                                                                                                                                      🍊 Experimental: venv based build isolation
                                                                                                                                      🍊 Faster repeated resolves by caching index simple responses
                                                                                                                                      🍊 No more progress bar spam in CI
                                                                                                                                      🍊 Deprecation to remove the legacy dependency resolver (--use-deprecated=legacy-resolver)

                                                                                                                                      See @ichard26's post for more!

                                                                                                                                      sichard.ca/blog/2026/07/whats-

                                                                                                                                        [?]Trey Hunner 🐍 » 🌐
                                                                                                                                        @treyhunner@mastodon.social

                                                                                                                                        For checking whether any items match a more complex condition, we could use the built-in any() or all functions

                                                                                                                                        Read more 👉 trey.io/xtql6h

                                                                                                                                          [?]Trey Hunner 🐍 » 🌐
                                                                                                                                          @treyhunner@mastodon.social

                                                                                                                                          Python Tip #210 (of 365):

                                                                                                                                          Instead of an "if" under an "else", consider using "elif".

                                                                                                                                          You likely know about Python's "elif" statement, but you might occasionally underuse it.

                                                                                                                                          If you find yourself writing an "if" statement just under an "else", ask "should I use an "elif" here instead?"

                                                                                                                                          🧵 (1/3)

                                                                                                                                            [?]Lobsters » 🤖 🌐
                                                                                                                                            @lobsters@mastodon.social

                                                                                                                                            xy is very fast and customizable charting library for Python lobste.rs/s/vnfk4x
                                                                                                                                            github.com/reflex-dev/xy

                                                                                                                                              [?]Trey Hunner 🐍 » 🌐
                                                                                                                                              @treyhunner@mastodon.social

                                                                                                                                              New Python Morsels article: Binary search with the bisect module 🔍

                                                                                                                                              You don't need to implement binary search yourself. Python's bisect module already did it for you.

                                                                                                                                              In this article:

                                                                                                                                              🎯 An interactive guessing game that demonstrates binary search
                                                                                                                                              ⚡ Why 10 million items take just 23 comparisons
                                                                                                                                              🤔 Why a set or dict can't always replace binary search
                                                                                                                                              🧰 Recipes: closest match, first/last match, all values in a range

                                                                                                                                              pym.dev/binary-search/

                                                                                                                                                [?]Hugo van Kemenade » 🌐
                                                                                                                                                @hugovk@mastodon.social

                                                                                                                                                What's New in Python 3.15:

                                                                                                                                                contextlib

                                                                                                                                                * Added support for arbitrary descriptors __enter__(), __exit__(), __aenter__(), and __aexit__() in ExitStack and contextlib.AsyncExitStack, for consistency with the `with` and `async with` statements.

                                                                                                                                                * ContextDecorator and AsyncContextDecorator now detect generator functions, coroutine functions, and asynchronous generator functions and keep the context manager open across iteration or await.

                                                                                                                                                docs.python.org/3.15/whatsnew/

                                                                                                                                                  [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                  @treyhunner@mastodon.social

                                                                                                                                                  I've recently been updating many of my mini helper apps and I made a page for them: pythonmorsels.com/tools/

                                                                                                                                                  Note that the strptime & format tools now link to CLI versions (strptime-cli & fguess) and the pastebin & REPL tool recently got a big rework.

                                                                                                                                                  Have thoughts on one of these tools? Or an idea for another one? I'd love to hear either!

                                                                                                                                                    [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                    @treyhunner@mastodon.social

                                                                                                                                                    Python Tip #209 (of 365):

                                                                                                                                                    Remember Python's "inline ifs"

                                                                                                                                                    Python doesn't have traditional ternary operators (cond ? one : two) but instead has an inline "if" expression (technically a "conditional expression") for the same purpose.

                                                                                                                                                    Instead of:

                                                                                                                                                    if amount == 1:
                                                                                                                                                    noun = "item"
                                                                                                                                                    else:
                                                                                                                                                    noun = "items"

                                                                                                                                                    We can write

                                                                                                                                                    noun = "item" if amount == 1 else "items"

                                                                                                                                                    The condition is in the MIDDLE. The first value is the "true" case and the last is the "false" case.

                                                                                                                                                    🧵 (1/2)

                                                                                                                                                      [?]codingjoe :django: :python: » 🌐
                                                                                                                                                      @codingjoe@fosstodon.org

                                                                                                                                                      Usually a quick chore, but with the feature update, an unexpected ton of work…

                                                                                                                                                        [?]Hugo van Kemenade » 🌐
                                                                                                                                                        @hugovk@mastodon.social

                                                                                                                                                        🪟🦾🥈 Windows on Arm (aka aarch64-pc-windows-msvc) has now been promoted to tier 2 of CPython platform support.

                                                                                                                                                        Tier 3 has no response SLA to failures. Tier 2 requires breaking changes to be fixed or reverted within 24 hours, and failures block a release.

                                                                                                                                                        Tier 3 requires at least one core team member signed up to support the platform. Tier 2 requires at least two, and we have three here.

                                                                                                                                                        peps.python.org/pep-0011/

                                                                                                                                                          [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                          @treyhunner@mastodon.social

                                                                                                                                                          Python Tip #208 (of 365):

                                                                                                                                                          Break up long boolean expressions

                                                                                                                                                          Have a long condition in your "if" statement?

                                                                                                                                                          You could:

                                                                                                                                                          1. Wrap it in parentheses to break it up over multiple lines
                                                                                                                                                          2. Use variables to give names to each sub-expression
                                                                                                                                                          3. Use functions to name sub-expressions

                                                                                                                                                          🧵 (1/4)

                                                                                                                                                            [?]Adam Johnson :django: :python: » 🌐
                                                                                                                                                            @adamchainz@fosstodon.org

                                                                                                                                                            ✍️ New post on a Python testing technique: inspecting interleaved calls across multiple mocks with attached mocks.

                                                                                                                                                            adamj.eu/tech/2026/07/27/pytho

                                                                                                                                                              [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                              @treyhunner@mastodon.social

                                                                                                                                                              “Sets are also great when you need fast containment checks.”

                                                                                                                                                              Read more 👉 pym.dev/practical-uses-of-sets/

                                                                                                                                                                [?]Linux Professional Institute » 🌐
                                                                                                                                                                @LPI@fosstodon.org

                                                                                                                                                                Some remain widely used for decades, while others fulfill an important role during their time before receding.

                                                                                                                                                                Our author Andrew Oram explores the stories of C, C++, C#, , , , , , , , and others. Dive into it 👇
                                                                                                                                                                lpi.org/xq3f

                                                                                                                                                                  [?]Alnotz » 🌐
                                                                                                                                                                  @alnotz@toot.gnous.eu

                                                                                                                                                                  @bearstech
                                                                                                                                                                  Une suggestion pour de jolies TUI en Python ?

                                                                                                                                                                    [?]Python Software Foundation » 🌐
                                                                                                                                                                    @ThePSF@fosstodon.org

                                                                                                                                                                    Please congratulate our newest PSF Fellow Members for Q2, 2026! Their continued contributions to the Python ecosystem are so very important to our community.
                                                                                                                                                                    pyfound.blogspot.com/2026/07/a

                                                                                                                                                                      [?]pvergain (framapiaf) » 🌐
                                                                                                                                                                      @pvergain@framapiaf.org

                                                                                                                                                                      wsvincent.com/deploying-web-ap (Deploying Web Apps in 2026: My EuroPython 2026 Conference Talk by Will Vincent )

                                                                                                                                                                      --<--
                                                                                                                                                                      This is the text version of my EuroPython talk, Deploying Python Web Apps in 2026, which I recently presented in Krakow, Poland.

                                                                                                                                                                      I will add the video version when it it is ready in a few weeks. The EuroPython team traditionally does an amazing job making the talks available shortly after the conference.
                                                                                                                                                                      -->--

                                                                                                                                                                        [?]Python Software Foundation » 🌐
                                                                                                                                                                        @ThePSF@fosstodon.org

                                                                                                                                                                        The PSF is hiring a Security Developer! Help triage vulnerabilities in CPython, fight malware/supply-chain attacks on PyPI, and build tools to keep the ecosystem safe for millions of users 🐍🔒 This is a global, remote, 1 year term role, with the possibility of renewal.

                                                                                                                                                                        Apply today:
                                                                                                                                                                        pythonsoftwarefoundation.apply

                                                                                                                                                                          [?]rixx » 🌐
                                                                                                                                                                          @rixx@chaos.social

                                                                                                                                                                          I did not realise I had strong feelings on docstrings. I use them sparingly, and while they are a hack, at least they serve a good purpose.

                                                                                                                                                                          I know people have opinions on the placement of line breaks and quotes, but I thought I was above these things. That this was Python programmers yearning for curly-brace level style wars.

                                                                                                                                                                          I was mistaken.

                                                                                                                                                                          I just encountered docstrings written in regular quotes rather than triple quotes and, no, apparently I DO have strong feelings on docstrings.

                                                                                                                                                                            [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                            @treyhunner@mastodon.social

                                                                                                                                                                            Python Tip #207 (of 365):

                                                                                                                                                                            Get fancy with your subprocess‍.run calls.

                                                                                                                                                                            When launching a subprocess, consider passing the keyword arguments capture_output, text, and check to subprocess‍.run.

                                                                                                                                                                            Passing capture_output=True will capture both stdout & stderr from the subprocess.

                                                                                                                                                                            Passing text=True will decode the captured output into strings (instead of providing raw bytes).

                                                                                                                                                                            Passing check=True will raise an exception if the subprocess exited with an error code.

                                                                                                                                                                            🧵 (1/2)

                                                                                                                                                                              [?]Hugo van Kemenade » 🌐
                                                                                                                                                                              @hugovk@mastodon.social

                                                                                                                                                                              Now we have pymanager for Windows, Python 3.16 drops the old MSI-based installer.

                                                                                                                                                                              Here's Steve Dower's +389 -17,781 PR! 🧹

                                                                                                                                                                              github.com/python/cpython/pull

                                                                                                                                                                              peps.python.org/pep-0773/

                                                                                                                                                                                [?]Ned Batchelder » 🌐
                                                                                                                                                                                @nedbat@hachyderm.io

                                                                                                                                                                                Because someone in the Discord was asking about structuring tests alongside their project code, I added a bit of test structure to my pkgsample explainer: github.com/nedbat/pkgsample

                                                                                                                                                                                  [?]Hugo van Kemenade » 🌐
                                                                                                                                                                                  @hugovk@mastodon.social

                                                                                                                                                                                  The next PyPy will be 8.0.0 and should add support for Python 3.12 and be the last to support 3.11, and require glibc 2.28 (AlmaLinux8, Amazon Linux 2023, Debian 10, Ubuntu 20.04).

                                                                                                                                                                                  pypy.org/posts/2026/07/moving-

                                                                                                                                                                                    [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                    @treyhunner@mastodon.social

                                                                                                                                                                                    Python Tip #206 (of 365):

                                                                                                                                                                                    Know your combination and permutation tools in Python.

                                                                                                                                                                                    Python ships with tools for combinations, permutations, and random selections.

                                                                                                                                                                                    The itertools module includes various combinatorics-oriented utilities:

                                                                                                                                                                                    from itertools import combinations, combinations_with_replacement, permutations, product

                                                                                                                                                                                    This joins tuples of characters into a comma-separated string:

                                                                                                                                                                                    def join(groups):
                                                                                                                                                                                    return ", ".join("".join(g) for g in groups)

                                                                                                                                                                                    🧵 (1/5)

                                                                                                                                                                                      [?]Adam Johnson :django: :python: » 🌐
                                                                                                                                                                                      @adamchainz@fosstodon.org

                                                                                                                                                                                      ✍️ New post on using unittest.mock to spy on function calls. 🕵️‍♂️

                                                                                                                                                                                      I recently learned how to use the wraps argument to track all calls to a target function for later assertions. Very useful for testing things like “is caching working?” without having to mock the function completely.

                                                                                                                                                                                      adamj.eu/tech/2026/07/25/pytho

                                                                                                                                                                                        [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                        @treyhunner@mastodon.social

                                                                                                                                                                                        “So if you find this feature jarring enough that you'd like to never use it in your code, you can probably configure your linter to disallow it entirely.”

                                                                                                                                                                                        Read more 👉 pym.dev/implicit-string-concat

                                                                                                                                                                                          [?]Adam Johnson :django: :python: » 🌐
                                                                                                                                                                                          @adamchainz@fosstodon.org

                                                                                                                                                                                          ✍️ Django’s release code words, up to the pending Django 6.1 “mélange”.

                                                                                                                                                                                          adamj.eu/tech/2026/07/24/djang

                                                                                                                                                                                            [?]Django News » 🤖 🌐
                                                                                                                                                                                            @djangonews@mastodon.social

                                                                                                                                                                                            [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                            @treyhunner@mastodon.social

                                                                                                                                                                                            “Python's print function is usually one of the first built-in functions that new Pythonistas learn about, but many Python programmers don't realize how versatile the print function is.”

                                                                                                                                                                                            Read more 👉 pym.dev/print-features/

                                                                                                                                                                                              [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                              @treyhunner@mastodon.social

                                                                                                                                                                                              Python Tip #205 (of 365):

                                                                                                                                                                                              Use statistics.multimode to get the most common items.

                                                                                                                                                                                              To get the most common items in an iterable, you might be tempted to use collections.Counter. Consider using statistics.multimode instead.

                                                                                                                                                                                              Compare this:

                                                                                                                                                                                              counts = collections.Counter(items)
                                                                                                                                                                                              [(_, top_count)] = counts.most_common(1)
                                                                                                                                                                                              commonest = [
                                                                                                                                                                                              item
                                                                                                                                                                                              for item, count in counts.items()
                                                                                                                                                                                              if count == top_count
                                                                                                                                                                                              ]

                                                                                                                                                                                              To this:

                                                                                                                                                                                              commonest = statistics.multimode(items)

                                                                                                                                                                                              Simpler, right?

                                                                                                                                                                                                [?]Hugo van Kemenade » 🌐
                                                                                                                                                                                                @hugovk@mastodon.social

                                                                                                                                                                                                🐍🚀 Out now: em-keyboard 5.4.0

                                                                                                                                                                                                An emoji search CLI.

                                                                                                                                                                                                Adds support for Python 3.15 and Unicode 17.0:

                                                                                                                                                                                                ❯ em "distorted face" "fight cloud" "hairy creature" "ballet dancer" "orca" "landslide" "trombone" "treasure chest"
                                                                                                                                                                                                Copied! 🫪 🫯 🫈 🧑‍🩰 🫍 🛘 🪊 🪎

                                                                                                                                                                                                Your device might not support them yet 🫠

                                                                                                                                                                                                blog.emojipedia.org/whats-new-

                                                                                                                                                                                                  [?]Hugo van Kemenade » 🌐
                                                                                                                                                                                                  @hugovk@mastodon.social

                                                                                                                                                                                                  🐍🚀 Out now: flake8-implicit-str-concat 0.7.0

                                                                                                                                                                                                  A Flake8 plugin to encourage string literal concatenation. It can help tidy up after Black/Ruff.

                                                                                                                                                                                                  This release adds a new ISC004 rule: "unparenthesized implicit string concatenation in collection". See examples in the README.

                                                                                                                                                                                                  Also support Python 3.15 and use PEP 639 licence expression and remove deprecated Trove classifier.

                                                                                                                                                                                                  github.com/flake8-implicit-str

                                                                                                                                                                                                    [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                    @treyhunner@mastodon.social

                                                                                                                                                                                                    The Python Morsels pastebin & REPL pages recently got some BIG updates.

                                                                                                                                                                                                    pastebin: pym.dev/paste
                                                                                                                                                                                                    REPL: pym.dev/repl

                                                                                                                                                                                                    Some of the many new things you can do with the pastebin and REPL that you couldn't before:

                                                                                                                                                                                                    • Run a paste before even saving it
                                                                                                                                                                                                    • Add additional files to a paste
                                                                                                                                                                                                    • Pass command-line arguments
                                                                                                                                                                                                    • Run pastes in interactive mode
                                                                                                                                                                                                    • Edit a paste after you've created it
                                                                                                                                                                                                    • Drop into PDB to debug tracebacks
                                                                                                                                                                                                    • Open a paste within the Python REPL

                                                                                                                                                                                                      [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                      @treyhunner@mastodon.social

                                                                                                                                                                                                      “How can you check which operating system your Python code is running on?”

                                                                                                                                                                                                      Read more 👉 pym.dev/operating-system-check

                                                                                                                                                                                                        [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                        @treyhunner@mastodon.social

                                                                                                                                                                                                        Python Tip #204 (of 365):

                                                                                                                                                                                                        Generate unique identifiers with the uuid module

                                                                                                                                                                                                        >>> import uuid
                                                                                                                                                                                                        >>> uid = uuid.uuid4()
                                                                                                                                                                                                        >>> uid
                                                                                                                                                                                                        UUID('922a6cea-c3e9-473d-bf88-efb10793c931')
                                                                                                                                                                                                        >>> str(uid)
                                                                                                                                                                                                        '922a6cea-c3e9-473d-bf88-efb10793c931'

                                                                                                                                                                                                        UUID stands for universally unique identifiers.

                                                                                                                                                                                                        The uuid module has functions for UUID version 1, 3, 4, 5, 6, 7, and 8 from RFC 4122/9562.

                                                                                                                                                                                                        Versions 7 and 8 were added in Python 3.14.

                                                                                                                                                                                                        🧵 (1/2)

                                                                                                                                                                                                          [?]Python Software Foundation » 🌐
                                                                                                                                                                                                          @ThePSF@fosstodon.org

                                                                                                                                                                                                          You can be a part of kickstarting the brand new Python Packaging Council ✨🐍📦 Nominate yourself or someone else for the council for the inaugural election! Nominations open Tuesday, July 28th, 2:00 pm UTC and close Tuesday, August 11th, 2:00 pm UTC.
                                                                                                                                                                                                          pyfound.blogspot.com/2026/07/g

                                                                                                                                                                                                            [?]Mindiell » 🌐
                                                                                                                                                                                                            @Mindiell@mamot.fr

                                                                                                                                                                                                            @ffeth sinon, il y a -fr sur IRC <3

                                                                                                                                                                                                              [?]Feth 🎉 » 🌐
                                                                                                                                                                                                              @ffeth@hostux.social

                                                                                                                                                                                                              Hmm, I got a question on , specifically .

                                                                                                                                                                                                              I just coded a very short module with dynamically generated functions that I export, and mypy complains when I use these functions, because they're not in the module?! What am I doing wrong?

                                                                                                                                                                                                              code:

                                                                                                                                                                                                              import sys
                                                                                                                                                                                                              from functools import partial
                                                                                                                                                                                                              __cur_mod = sys.modules[__name__]
                                                                                                                                                                                                              _COLORS: dict[str, str] = {
                                                                                                                                                                                                              "grey":'\x1b[38;21m',
                                                                                                                                                                                                              [...]
                                                                                                                                                                                                              }
                                                                                                                                                                                                              for color in _COLORS:
                                                                                                                                                                                                              setattr(__cur_mod, color, partial(color_generic, color))
                                                                                                                                                                                                              __all__ = list(_COLORS)

                                                                                                                                                                                                                [?]Python Software Foundation » 🌐
                                                                                                                                                                                                                @ThePSF@fosstodon.org

                                                                                                                                                                                                                You can be a part of guiding the future direction of the PSF 🩵🐍💛 Nominate yourself or someone else for the PSF Board for the 2026 election! Nominations open Tuesday, July 28th, 2:00 pm UTC and close Tuesday, August 11th, 2:00 pm UTC.
                                                                                                                                                                                                                pyfound.blogspot.com/2026/07/g

                                                                                                                                                                                                                  [?]Adam Johnson :django: :python: » 🌐
                                                                                                                                                                                                                  @adamchainz@fosstodon.org

                                                                                                                                                                                                                  ✍️ Introducing django-crawl, a tool for crawling your local Django site, useful for quickly finding what’s broken or performing site-wide checks.

                                                                                                                                                                                                                  adamj.eu/tech/2026/07/22/intro

                                                                                                                                                                                                                    Fred de CLX boosted

                                                                                                                                                                                                                    [?]Agenda du Libre » 🤖 🌐
                                                                                                                                                                                                                    @agenda_du_libre@pouet.chapril.org

                                                                                                                                                                                                                    Lyon: C’est l’été !, Le jeudi 30 juillet 2026 de 18h00 à 21h00. agendadulibre.org/events/35507

                                                                                                                                                                                                                      [?]Gabriel-le » 🌐
                                                                                                                                                                                                                      @Gabrielhle@pouet.chapril.org

                                                                                                                                                                                                                      Bonjour,
                                                                                                                                                                                                                      Comment me présenter rapidement ?
                                                                                                                                                                                                                      un côté :

                                                                                                                                                                                                                      j'ai exercé longtemps dans la :

                                                                                                                                                                                                                      je suis en , en

                                                                                                                                                                                                                      Politiquement à , dans le milieu de défense des droits +,

                                                                                                                                                                                                                      loisirs :

                                                                                                                                                                                                                        [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                        @treyhunner@mastodon.social

                                                                                                                                                                                                                        “Some blank lines improve readability, but not all blank lines do.”

                                                                                                                                                                                                                        Read more 👉 pym.dev/embrace-whitespace/

                                                                                                                                                                                                                          [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                          @treyhunner@mastodon.social

                                                                                                                                                                                                                          Python Tip #203 (of 365):

                                                                                                                                                                                                                          When you need precise decimal numbers, use decimal.Decimal

                                                                                                                                                                                                                          Floating point numbers have precision gotchas.

                                                                                                                                                                                                                          For example, 0.1 + 0.02 isn't 0.12:

                                                                                                                                                                                                                          >>> one_two = 0.1 + 0.02
                                                                                                                                                                                                                          >>> one_two == 0.12
                                                                                                                                                                                                                          False
                                                                                                                                                                                                                          >>> one_two
                                                                                                                                                                                                                          0.12000000000000001

                                                                                                                                                                                                                          Using Decimal fixes this:

                                                                                                                                                                                                                          >>> from decimal import Decimal
                                                                                                                                                                                                                          >>> one_two = Decimal("0.1") + Decimal("0.02")
                                                                                                                                                                                                                          >>> one_two == Decimal("0.12")
                                                                                                                                                                                                                          True
                                                                                                                                                                                                                          >>> one_two
                                                                                                                                                                                                                          Decimal('0.12')

                                                                                                                                                                                                                          Note that we pass strings to Decimal.

                                                                                                                                                                                                                          🧵 (1/4)

                                                                                                                                                                                                                            [?]Mike Fiedler, Code Gardener » 🌐
                                                                                                                                                                                                                            @miketheman@hachyderm.io

                                                                                                                                                                                                                            If you use the `setup-uv` in your workflows, consider upgrading to version 9.0.0 soon.

                                                                                                                                                                                                                            This version changes the default behavior to store the downloaded wheels from in GHA Cache, shedding load from PyPI, especially relevant for frequent CI/CD runs.

                                                                                                                                                                                                                            The maintainers considered this a breaking change, hence the version bump, probably because it flips existing expectations.

                                                                                                                                                                                                                            If you expected that the Action was caching downloads before, now it actually does, so it's a logical fix in that regard.
                                                                                                                                                                                                                            Read more: github.com/astral-sh/setup-uv/

                                                                                                                                                                                                                              [?]Hugo van Kemenade » 🌐
                                                                                                                                                                                                                              @hugovk@mastodon.social

                                                                                                                                                                                                                              Welcome @kushal back to the Python Security Response Team!

                                                                                                                                                                                                                              devguide.python.org/security/p

                                                                                                                                                                                                                              Following PEP 811, we have a much clearer process for PSRT membership.

                                                                                                                                                                                                                              peps.python.org/pep-0811/

                                                                                                                                                                                                                              Thanks to Kushal and the rest of the team for helping keep Python secure.

                                                                                                                                                                                                                              hugovk.dev/blog/2026/security-

                                                                                                                                                                                                                                [?]Le Filament » 🌐
                                                                                                                                                                                                                                @le_filament@pouet.chapril.org

                                                                                                                                                                                                                                Bonjour à toutes et tous,

                                                                                                                                                                                                                                La Scop Le Filament cherche une développeuse ou un développeur Open Source, principalement pour du Python sur des modules Odoo.

                                                                                                                                                                                                                                L'offre d'emploi est ici : le-filament.com/offres-emploi/

                                                                                                                                                                                                                                CDI forfait 200 jours, basé à Toulouse (télétravail ponctuel possible).

                                                                                                                                                                                                                                  [?]ploum » 🌐
                                                                                                                                                                                                                                  @ploum@mamot.fr

                                                                                                                                                                                                                                  3.2 has been released.

                                                                                                                                                                                                                                  The biggest news is that the network part is now handled by (except for ). HTML tables are also supported !

                                                                                                                                                                                                                                  git.sr.ht/~lioploum/offpunk/re

                                                                                                                                                                                                                                    [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                    @treyhunner@mastodon.social

                                                                                                                                                                                                                                    “So because we're using __slots__, we can't expand the number of attributes that are on each instance of this class.”

                                                                                                                                                                                                                                    Read more 👉 pym.dev/__slots__/

                                                                                                                                                                                                                                      ClaudioM boosted

                                                                                                                                                                                                                                      [?]Jon Moller » 🌐
                                                                                                                                                                                                                                      @guofu@mastodon.sdf.org

                                                                                                                                                                                                                                      @gemlog @bstuf @northernlights @claudiom @darkstar @stug @jirka @RJF @pizzapal @pizza_pal @stebby @normandc @kelbot Last but not least, I wanted to share my revamped version of an existing for syncing with PCs over . My version also offers the option to delete fit files from the device and timestamps for benchmarking, amongst other features. What a great learning experience! github.com/molleraj/enhanced_x

                                                                                                                                                                                                                                        [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                        @treyhunner@mastodon.social

                                                                                                                                                                                                                                        Python Tip #202 (of 365):

                                                                                                                                                                                                                                        When prompting the user to enter a password, use getpass

                                                                                                                                                                                                                                        The getpass.getpass function prompts the user to enter a password and what the user types is completely hidden:

                                                                                                                                                                                                                                        >>> from getpass import getpass
                                                                                                                                                                                                                                        >>> password = getpass()
                                                                                                                                                                                                                                        Password:

                                                                                                                                                                                                                                        🧵 (1/2)

                                                                                                                                                                                                                                          [?]Python Software Foundation » 🌐
                                                                                                                                                                                                                                          @ThePSF@fosstodon.org

                                                                                                                                                                                                                                          Want to support the PSF and stock up on books at the same time? The 'Ultimate Python Development' Humble Bundle is available now 🐍 📚 You can customize your donation split: click "Adjust Donation" → "Custom Amount" to boost the % going to the PSF!
                                                                                                                                                                                                                                          humblebundle.com/books/ultimat

                                                                                                                                                                                                                                            [?]Benjamin Geer » 🌐
                                                                                                                                                                                                                                            @benjamingeer@piaille.fr

                                                                                                                                                                                                                                            Candidature rejetée, après deux entretiens, parce que l'entreprise «s'oriente vers une adoption forte de l'IA dans ses pratiques de développement, une direction qui ne semble pas alignée avec vos attentes à ce stade».

                                                                                                                                                                                                                                            Est-ce qu'il y a encore des éditeurs de logiciels en France qui sont prêts à embaucher un développeur qui préfère écrire lui-même son code ?

                                                                                                                                                                                                                                              [?]Mike Fiedler, Code Gardener » 🌐
                                                                                                                                                                                                                                              @miketheman@hachyderm.io

                                                                                                                                                                                                                                              I'm about to head home after a truly amazing experience at my first .
                                                                                                                                                                                                                                              I was honored to be able to share some stories, but more importantly I met a bunch of awesome people.

                                                                                                                                                                                                                                              Kudos to the @europython organization and all the folks who make magic happen!

                                                                                                                                                                                                                                              This volunteer-driven event has been running for 25 years, and the overwhelming joy of bringing folks together from all over with a common thread is something you don't experience often (insert Free-threading joke here.)

                                                                                                                                                                                                                                              I hope to return in the future!

                                                                                                                                                                                                                                              EuroPython closing event with as many volunteers on stage as could make it

                                                                                                                                                                                                                                              Alt...EuroPython closing event with as many volunteers on stage as could make it

                                                                                                                                                                                                                                                [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                @treyhunner@mastodon.social

                                                                                                                                                                                                                                                You probably won't use t-strings and Template objects in your own code, but you might pass them to code written by others.

                                                                                                                                                                                                                                                Read more 👉 trey.io/n4mlgb

                                                                                                                                                                                                                                                  James C boosted

                                                                                                                                                                                                                                                  [?]Jeff Triplett » 🌐
                                                                                                                                                                                                                                                  @webology@mastodon.social

                                                                                                                                                                                                                                                  RE: mastodon.social/@farhanaliraza

                                                                                                                                                                                                                                                  If you missed it over the weekend, @farhanaliraza released Taipan, which bundles a Python app (file, project, files, etc) into a one-file binary that just works.

                                                                                                                                                                                                                                                  I bundled up a few PyGame projects to try it out, and to my amazement, it just worked!

                                                                                                                                                                                                                                                    [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                    @treyhunner@mastodon.social

                                                                                                                                                                                                                                                    Python Tip #201 (of 365):

                                                                                                                                                                                                                                                    Suggest typo fixes with difflib.get_close_matches

                                                                                                                                                                                                                                                    >>> import difflib
                                                                                                                                                                                                                                                    >>> options = ['quack', 'swim', 'walk']
                                                                                                                                                                                                                                                    >>> difflib.get_close_matches('swam', options)
                                                                                                                                                                                                                                                    ['swim']

                                                                                                                                                                                                                                                    If you want to control how close the match must be to be suggested, you can change the cutoff argument from its default (0.6):

                                                                                                                                                                                                                                                    >>> difflib.get_close_matches('swam', options, cutoff=0.5)
                                                                                                                                                                                                                                                    ['swim', 'walk']

                                                                                                                                                                                                                                                    argparse's new suggest_on_error relies on this: docs.python.org/3/library/argp

                                                                                                                                                                                                                                                      mmu_man boosted

                                                                                                                                                                                                                                                      [?]Les Scop & Scic AURA :labscop: » 🌐
                                                                                                                                                                                                                                                      @LesScopAura@mastodon.scop.coop

                                                                                                                                                                                                                                                      💻 Akretion : Scop spécialisée dans l’intégration et le développement autour d’, l’ .

                                                                                                                                                                                                                                                      Créée en 2008, l'équipe de développeur·euses et consultant·es spécialisé·es accompagne les entreprises dans leurs projets de gestion : analyse des besoins, intégration, développement sur mesure, migration, hébergement, e-commerce, comptabilité, formation…

                                                                                                                                                                                                                                                      En tant que coopérative, le partage des connaissances et la gestion horizontale sont mots d'ordres.

                                                                                                                                                                                                                                                      ,

                                                                                                                                                                                                                                                      ODOO : compatibilité, production, CRM, gestion commerciale, achat, point de vente.

                                                                                                                                                                                                                                                      Alt...ODOO : compatibilité, production, CRM, gestion commerciale, achat, point de vente.

                                                                                                                                                                                                                                                      [?]Paolo Melchiorre » 🌐
                                                                                                                                                                                                                                                      @paulox@fosstodon.org

                                                                                                                                                                                                                                                      I’ve published my @europython 2026 recap blog post 🇪🇺

                                                                                                                                                                                                                                                      It brings together the Mastodon posts and photos I shared live during the conference, creating a timeline of talks, community moments, people, ...👇
                                                                                                                                                                                                                                                      paulox.net/2026/07/20/my-europ

                                                                                                                                                                                                                                                      Credits 👥
                                                                                                                                                                                                                                                      @BajoranEngineer @Marlene @Yhg1s @ambv @anorthall @antocuni @baconandcoconut @bmispelon @dongheena @ester @gi0baro @hjwp @hugovk @hynek @kirschner @marco @miketheman @pauleveritt @sabderemane @saptaks @savannah @sethmlarson @vlad @wsvincent

                                                                                                                                                                                                                                                        [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                        @treyhunner@mastodon.social

                                                                                                                                                                                                                                                        “Any object that supports concatenation probably also supports self-concatenation.”

                                                                                                                                                                                                                                                        Read more 👉 pym.dev/self-concatenation/

                                                                                                                                                                                                                                                          [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                          @treyhunner@mastodon.social

                                                                                                                                                                                                                                                          Python Tip #200 (of 365):

                                                                                                                                                                                                                                                          Beta-test the latest Python version with uv

                                                                                                                                                                                                                                                          You can use uv to try out alpha, beta, and rc (release candidate) Python versions.

                                                                                                                                                                                                                                                          🧵 (1/4)

                                                                                                                                                                                                                                                            [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                            @treyhunner@mastodon.social

                                                                                                                                                                                                                                                            Python Tip #199 (of 365):

                                                                                                                                                                                                                                                            Use uvx to try out tools without installing them 🧵

                                                                                                                                                                                                                                                            For example, "uvx fguess" installs & runs my fguess package in an isolated temporary environment.

                                                                                                                                                                                                                                                            This also doesn't JUST work with scripts. You can use uvx to try out Python packages in a REPL!

                                                                                                                                                                                                                                                            You can also use "uvx --with better-dedent python" to launch a REPL with my "better-dedent" package installed.

                                                                                                                                                                                                                                                            It'll even install Python 3.14 if needed since "better-dedent" requires it!

                                                                                                                                                                                                                                                            🧵 (1/2)

                                                                                                                                                                                                                                                              [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                              @treyhunner@mastodon.social

                                                                                                                                                                                                                                                              “Standard error is often used for printing messages related to errors, but it's also used for diagnostic output or for pretty much any output that shouldn't be mixed together with the main program output.”

                                                                                                                                                                                                                                                              Read more 👉 pym.dev/standard-error/

                                                                                                                                                                                                                                                                [?]Hugo van Kemenade » 🌐
                                                                                                                                                                                                                                                                @hugovk@mastodon.social

                                                                                                                                                                                                                                                                🐍🚀 Out now: the final 3.15 beta, live from the sprints!

                                                                                                                                                                                                                                                                All the same goodies as beta 3, plus the official macOS installer now also installs the free-threaded `python3.15t` binary.

                                                                                                                                                                                                                                                                And thanks to 3.16 RM @savannah for helping out!

                                                                                                                                                                                                                                                                discuss.python.org/t/python-3-

                                                                                                                                                                                                                                                                People discussions and working on laptops in the EuroPython sprint room.

                                                                                                                                                                                                                                                                Alt...People discussions and working on laptops in the EuroPython sprint room.

                                                                                                                                                                                                                                                                  [?]Hugo van Kemenade » 🌐
                                                                                                                                                                                                                                                                  @hugovk@mastodon.social

                                                                                                                                                                                                                                                                  Just released! 🚀

                                                                                                                                                                                                                                                                  🪑 PrettyTable 3.17.0

                                                                                                                                                                                                                                                                  github.com/prettytable/prettyt

                                                                                                                                                                                                                                                                  Add support for Python 3.15, drop 3.9, test 3.13t-3.15t
                                                                                                                                                                                                                                                                  Set dicts with column-specific config for all column-specific attrs
                                                                                                                                                                                                                                                                  Update type hints
                                                                                                                                                                                                                                                                  Replace pre-commit with prek
                                                                                                                                                                                                                                                                  & more!

                                                                                                                                                                                                                                                                    [?]Hugo van Kemenade » 🌐
                                                                                                                                                                                                                                                                    @hugovk@mastodon.social

                                                                                                                                                                                                                                                                    🐍🚀 Out now: Python 3.15 alpha 7!

                                                                                                                                                                                                                                                                    This is the first one with lazy imports (PEP 810) and frozendict (PEP 814)! Try it out and give us feedback.

                                                                                                                                                                                                                                                                    discuss.python.org/t/python-3-

                                                                                                                                                                                                                                                                    ☃️ Just one alpha left until the feature freeze! Core team: get your PEPs in!

                                                                                                                                                                                                                                                                    PEP810

                                                                                                                                                                                                                                                                      [?]Hugo van Kemenade » 🌐
                                                                                                                                                                                                                                                                      @hugovk@mastodon.social

                                                                                                                                                                                                                                                                      It's been a fun and packed week, but it's not over. My main task for today's sprint is to release the final 3.15 beta with @savannah!🚀

                                                                                                                                                                                                                                                                      Collage of photos of people and events of EuroPython: summits, talks, keynote, dinners...

                                                                                                                                                                                                                                                                      Alt...Collage of photos of people and events of EuroPython: summits, talks, keynote, dinners...

                                                                                                                                                                                                                                                                        [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                        @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                        Python Tip #198 (of 365):

                                                                                                                                                                                                                                                                        Lock the dependencies for your Python scripts

                                                                                                                                                                                                                                                                        After you start using inline script metadata to have uv automatically manage your script's dependencies (tip 197), how can you ensure the dependencies of your dependencies don't break your code?

                                                                                                                                                                                                                                                                        You could pin your dependencies... but you'd also want to pin the dependencies of your dependencies and such.

                                                                                                                                                                                                                                                                        🧵 (1/3)

                                                                                                                                                                                                                                                                          [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                          @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                          “The fromkeys method doesn't attempt to copy the object you give it.”

                                                                                                                                                                                                                                                                          Read more 👉 pym.dev/default-dictionary-val

                                                                                                                                                                                                                                                                            [?]Matthias Kirschner » 🌐
                                                                                                                                                                                                                                                                            @kirschner@mastodon.social

                                                                                                                                                                                                                                                                            Big thank you to all the many people who were involved in organising ! Amazing how many people volunteered to make this event happen and enable the sharing of knowledge around ❤️

                                                                                                                                                                                                                                                                            stage with many people in yellow organiser shirts

                                                                                                                                                                                                                                                                            Alt...stage with many people in yellow organiser shirts

                                                                                                                                                                                                                                                                              [?]Cyril Brulebois » 🌐
                                                                                                                                                                                                                                                                              @CyrilBrulebois@mamot.fr

                                                                                                                                                                                                                                                                              Oh wow, that's a pretty bad regression: bugs.debian.org/1141977

                                                                                                                                                                                                                                                                              Fixed packages should end up in trixie-proposed-updates (for inclusion in the next point release) but should also be published via trixie-updates much earlier: bugs.debian.org/1142261

                                                                                                                                                                                                                                                                                Taggart :ifin: boosted

                                                                                                                                                                                                                                                                                [?]David Lord :python: » 🌐
                                                                                                                                                                                                                                                                                @davidism@mas.to

                                                                                                                                                                                                                                                                                Pallets now documents our LLM and AI tool use policy, explaining why we value human contributions rather than trying to instruct the tools. I don't think this will make a difference to the amount of generated junk we get, but I hope people who care find value in it. palletsprojects.com/contributi

                                                                                                                                                                                                                                                                                  xcanehan boosted

                                                                                                                                                                                                                                                                                  [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                                  @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                                  Python Tip #197 (of 365):

                                                                                                                                                                                                                                                                                  Use uv for one-off Python scripts

                                                                                                                                                                                                                                                                                  Have a Python script that requires dependencies?

                                                                                                                                                                                                                                                                                  Use inline script metadata, change your file mode to executable, and put this shebang line at the top of the file:

                                                                                                                                                                                                                                                                                  #!/usr/bin/env -S uv run --script

                                                                                                                                                                                                                                                                                  To add a dependency to your script, you can either manually edit the "# /// script" block by hand or use "uv add":

                                                                                                                                                                                                                                                                                  $ uv add --script my_script.py requests

                                                                                                                                                                                                                                                                                  🧵 (1/3)

                                                                                                                                                                                                                                                                                    [?]Yann Büchau :nixos: » 🌐
                                                                                                                                                                                                                                                                                    @nobodyinperson@fosstodon.org

                                                                                                                                                                                                                                                                                    It's 2026 and :python: 's standard library *still* does not have a flatten function? 🤨

                                                                                                                                                                                                                                                                                    (Yes, more-itertools, that's not the point)

                                                                                                                                                                                                                                                                                      lux 🦊:therian: boosted

                                                                                                                                                                                                                                                                                      [?]Soblow Xaselgio :dragn_heart: [she/her, they/them] » 🌐
                                                                                                                                                                                                                                                                                      @Soblow@eldritch.cafe

                                                                                                                                                                                                                                                                                      New blogpost! :dragn_heart:

                                                                                                                                                                                                                                                                                      xaselgio.net/posts/029.shazam_

                                                                                                                                                                                                                                                                                      I have used Shazam, the song identification app, for several years.
                                                                                                                                                                                                                                                                                      While it still serves its purpose marvelously, I do not feel okay with the idea of keeping the history of songs I found this way on this service, with no way to export it. :dragn_blanket:

                                                                                                                                                                                                                                                                                      In this blogpost, I dig into how to export your Shazam library as a readable CSV.
                                                                                                                                                                                                                                                                                      I also describe my little scripting adventure to make a Python script which would use that CSV to download music from Youtube (using yt-dlp) and then make sure that it is the right song, matching what was inside the CSV export. :dragn_cookie:

                                                                                                                                                                                                                                                                                      Sources are available on our Git forge as well.~
                                                                                                                                                                                                                                                                                      Hope you'll enjoy the read!~ :dragn_loaf:

                                                                                                                                                                                                                                                                                        [?]Mike Fiedler, Code Gardener » 🌐
                                                                                                                                                                                                                                                                                        @miketheman@hachyderm.io

                                                                                                                                                                                                                                                                                        Listening to @anwesha speak on Demystifying the EU Cyber Resilience Act at

                                                                                                                                                                                                                                                                                        This slide is the new reality!

                                                                                                                                                                                                                                                                                          [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                                          @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                                          “Once the condition becomes False (or a falsey value) the loop stops.”

                                                                                                                                                                                                                                                                                          Read more 👉 pym.dev/while-loops/

                                                                                                                                                                                                                                                                                            [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                                            @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                                            Python Tip #196 (of 365):

                                                                                                                                                                                                                                                                                            Manage your virtual environments with uv

                                                                                                                                                                                                                                                                                            You can get the speed of uv while still using venvs and pip the way you always have.

                                                                                                                                                                                                                                                                                            Instead of "python3.14 -m venv .venv", use "uv venv -p 3.14"

                                                                                                                                                                                                                                                                                            Instead of "pip install" use "uv pip install"

                                                                                                                                                                                                                                                                                            But... why?

                                                                                                                                                                                                                                                                                            Speed!

                                                                                                                                                                                                                                                                                            Using "uv pip install" is often MUCH faster than using "pip install".

                                                                                                                                                                                                                                                                                            🧵 (1/2)

                                                                                                                                                                                                                                                                                              [?]Pete Prodoehl 🍕 » 🌐
                                                                                                                                                                                                                                                                                              @rasterweb@mastodon.social

                                                                                                                                                                                                                                                                                              I wrote this function to do some math, and I got it working, tested it, but now I have to explain it to someone and...

                                                                                                                                                                                                                                                                                              Well, that's the difficult part!

                                                                                                                                                                                                                                                                                              I knew the input and desired output and built up how to get what I needed but making it explainable is a bit of a challenge...

                                                                                                                                                                                                                                                                                              Which is good though, as it's forcing me to double-check my work.

                                                                                                                                                                                                                                                                                              (And I am *not* good at math!)

                                                                                                                                                                                                                                                                                                [?]Hugo van Kemenade » 🌐
                                                                                                                                                                                                                                                                                                @hugovk@mastodon.social

                                                                                                                                                                                                                                                                                                "We're just normal men" -- @ambv, with Pablo interviewing Guido at .

                                                                                                                                                                                                                                                                                                Seated on stage: Pablo in a baby shark hat, Guido in a octopus hat, and Łukasz in a. VLC traffic cone hat.

                                                                                                                                                                                                                                                                                                Alt...Seated on stage: Pablo in a baby shark hat, Guido in a octopus hat, and Łukasz in a. VLC traffic cone hat.

                                                                                                                                                                                                                                                                                                  [?]Jesus Michał von Gentoo 🏔 (he) » 🌐
                                                                                                                                                                                                                                                                                                  @mgorny@social.treehouse.systems

                                                                                                                                                                                                                                                                                                  The state of ecosystem right now: almost everything is slop. Some projects are complete vibe-coded slop (autobahn, chardet, cryptography). Some projects are disguised slop ("Coding agents shouldn't co-author themselves.")

                                                                                                                                                                                                                                                                                                  There is only a handful of human projects left (Flask being one bright example). And they're being killed. They're being killed by the neverending slew of slop pull requests. They're being killed by all their dependencies becoming slop. They're being killed because this whole ecosystem has became such a complete cesspit that you have zero motivation to do anything.

                                                                                                                                                                                                                                                                                                  EDIT: and honestly, this is only going to get worse. When you kill the incentive to work on projects, you only get more slop. Maintainers give in, and more projects become slop. Or they give up, and projects get forked unto slop.

                                                                                                                                                                                                                                                                                                    [?]Python Software Foundation » 🌐
                                                                                                                                                                                                                                                                                                    @ThePSF@fosstodon.org

                                                                                                                                                                                                                                                                                                    We want your vote! Voting eligible PSF Members (Supporting, Contributing, and Fellow) need to affirm their membership to vote in this year’s PSF Board and/or Python Packaging Council elections to ensure that each election reaches quorum 🗳️

                                                                                                                                                                                                                                                                                                    pyfound.blogspot.com/2026/07/a

                                                                                                                                                                                                                                                                                                      [?]John Shaft » 🌐
                                                                                                                                                                                                                                                                                                      @shaft@piaille.fr

                                                                                                                                                                                                                                                                                                      Ayé, 3.14 est dans Forky (aka Testing)

                                                                                                                                                                                                                                                                                                      Et oui, il y a la blague (faite par python3-venv je dirais)

                                                                                                                                                                                                                                                                                                      $ /opt/venv/john/bin/πthon -V
                                                                                                                                                                                                                                                                                                      Python 3.14.6

                                                                                                                                                                                                                                                                                                        [?]Jesus Michał von Gentoo 🏔 (he) » 🌐
                                                                                                                                                                                                                                                                                                        @mgorny@social.treehouse.systems

                                                                                                                                                                                                                                                                                                        The state of ecosystem right now: almost everything is slop. Some projects are complete vibe-coded slop (autobahn, chardet, cryptography). Some projects are disguised slop ("Coding agents shouldn't co-author themselves.")

                                                                                                                                                                                                                                                                                                        There is only a handful of human projects left (Flask being one bright example). And they're being killed. They're being killed by the neverending slew of slop pull requests. They're being killed by all their dependencies becoming slop. They're being killed because this whole ecosystem has became such a complete cesspit that you have zero motivation to do anything.

                                                                                                                                                                                                                                                                                                        EDIT: and honestly, this is only going to get worse. When you kill the incentive to work on projects, you only get more slop. Maintainers give in, and more projects become slop. Or they give up, and projects get forked unto slop.

                                                                                                                                                                                                                                                                                                          [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                                                          @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                                                          Python sees a line feed (\n) as the canonical way to represent a newline.

                                                                                                                                                                                                                                                                                                          Read more 👉 trey.io/ca0qyn

                                                                                                                                                                                                                                                                                                            Marcos Dione boosted

                                                                                                                                                                                                                                                                                                            [?]Paul :python: :django: » 🌐
                                                                                                                                                                                                                                                                                                            @pbx@fosstodon.org

                                                                                                                                                                                                                                                                                                            We're at PowerDash! I know there are a lot of people in my network with the perfect mix of skills for this role — full stack with a strong / bent. Throw your hat in, or pass the word. It's a great little company in an important space.

                                                                                                                                                                                                                                                                                                            Office is in Cambridge (Harvard Square). Role is on-site or hybrid.

                                                                                                                                                                                                                                                                                                            Senior Full Stack Software Engineer: apply.workable.com/powerdash/j

                                                                                                                                                                                                                                                                                                              [?]Adam Johnson :django: :python: » 🌐
                                                                                                                                                                                                                                                                                                              @adamchainz@fosstodon.org

                                                                                                                                                                                                                                                                                                              ✍️ New post covering a debugging hack using gc.get_objects() to find all instances of a class in Python.

                                                                                                                                                                                                                                                                                                              adamj.eu/tech/2026/07/14/pytho

                                                                                                                                                                                                                                                                                                                [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                                                                @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                                                                Python Tip #195 (of 365):

                                                                                                                                                                                                                                                                                                                Globally install Python-powered command-line tools with "uv tool install"

                                                                                                                                                                                                                                                                                                                To install my Python-powered countdown-cli globally, I can do this:

                                                                                                                                                                                                                                                                                                                $ uv tool install countdown-cli
                                                                                                                                                                                                                                                                                                                Resolved 2 packages in 169ms
                                                                                                                                                                                                                                                                                                                Installed 2 packages in 5ms
                                                                                                                                                                                                                                                                                                                + click==8.3.2
                                                                                                                                                                                                                                                                                                                + countdown-cli==2.2.1
                                                                                                                                                                                                                                                                                                                Installed 1 executable: countdown

                                                                                                                                                                                                                                                                                                                Then I can run "countdown" ANYWHERE on my machine to start a countdown timer.

                                                                                                                                                                                                                                                                                                                🧵 (1/3)

                                                                                                                                                                                                                                                                                                                  [?]Hugo van Kemenade » 🌐
                                                                                                                                                                                                                                                                                                                  @hugovk@mastodon.social

                                                                                                                                                                                                                                                                                                                  Finally!

                                                                                                                                                                                                                                                                                                                  ⚡ Lightning talks! ⚡

                                                                                                                                                                                                                                                                                                                  Mark Shannon - One-time ABI breakage

                                                                                                                                                                                                                                                                                                                  Daniele Parmeggiani – Safer and Generic Interruptions

                                                                                                                                                                                                                                                                                                                  @kushal - EktuPy, Python for Scratch generation

                                                                                                                                                                                                                                                                                                                  @gpshead & @ambv - agents.md and skills for CPython repo

                                                                                                                                                                                                                                                                                                                  Ken Jin - pls read PEP 836

                                                                                                                                                                                                                                                                                                                  And we're done! That was fun! The next Language Summit will be at @pycon US next year at Long Beach, then back at @europython for 2028!

                                                                                                                                                                                                                                                                                                                  Mark

                                                                                                                                                                                                                                                                                                                  Alt...Mark

                                                                                                                                                                                                                                                                                                                  Daniele

                                                                                                                                                                                                                                                                                                                  Alt...Daniele

                                                                                                                                                                                                                                                                                                                  Kushal

                                                                                                                                                                                                                                                                                                                  Alt...Kushal

                                                                                                                                                                                                                                                                                                                  Łukasz and Greg

                                                                                                                                                                                                                                                                                                                  Alt...Łukasz and Greg

                                                                                                                                                                                                                                                                                                                    [?]Hugo van Kemenade » 🌐
                                                                                                                                                                                                                                                                                                                    @hugovk@mastodon.social

                                                                                                                                                                                                                                                                                                                    Last regular talk/discussion before lightning talks!

                                                                                                                                                                                                                                                                                                                    PEP 827 - Type manipulation and annotationlib — Michael J. Sullivan

                                                                                                                                                                                                                                                                                                                    ep2026.europython.eu/language-

                                                                                                                                                                                                                                                                                                                    Sully presenting.

                                                                                                                                                                                                                                                                                                                    Alt...Sully presenting.

                                                                                                                                                                                                                                                                                                                    Łukasz asking.

                                                                                                                                                                                                                                                                                                                    Alt...Łukasz asking.

                                                                                                                                                                                                                                                                                                                    Daniele asking.

                                                                                                                                                                                                                                                                                                                    Alt...Daniele asking.

                                                                                                                                                                                                                                                                                                                    Yury asking.

                                                                                                                                                                                                                                                                                                                    Alt...Yury asking.

                                                                                                                                                                                                                                                                                                                      [?]Hugo van Kemenade » 🌐
                                                                                                                                                                                                                                                                                                                      @hugovk@mastodon.social

                                                                                                                                                                                                                                                                                                                      I wrote about how, like many other open-source projects, CPython is experiencing a huge increase in security reports. Charts inside!
                                                                                                                                                                                                                                                                                                                      hugovk.dev/blog/2026/security-

                                                                                                                                                                                                                                                                                                                        [?]Hugo van Kemenade » 🌐
                                                                                                                                                                                                                                                                                                                        @hugovk@mastodon.social

                                                                                                                                                                                                                                                                                                                        And now:

                                                                                                                                                                                                                                                                                                                        Thinking about the post era of free-threading Python — @dongheena, Tobias Wrigstad, Fridtjof

                                                                                                                                                                                                                                                                                                                        ep2026.europython.eu/language-

                                                                                                                                                                                                                                                                                                                        Tobias, Donghee and Fridtjof presenting.

                                                                                                                                                                                                                                                                                                                        Alt...Tobias, Donghee and Fridtjof presenting.

                                                                                                                                                                                                                                                                                                                        Fridtjof presenting.

                                                                                                                                                                                                                                                                                                                        Alt...Fridtjof presenting.

                                                                                                                                                                                                                                                                                                                        Tobias answering a question, Donghee and Fridtjof on stage.

                                                                                                                                                                                                                                                                                                                        Alt...Tobias answering a question, Donghee and Fridtjof on stage.

                                                                                                                                                                                                                                                                                                                        Thomas asking.

                                                                                                                                                                                                                                                                                                                        Alt...Thomas asking.

                                                                                                                                                                                                                                                                                                                          [?]Python Software Foundation » 🌐
                                                                                                                                                                                                                                                                                                                          @ThePSF@fosstodon.org

                                                                                                                                                                                                                                                                                                                          The July edition of the PSF Board Office Hour is about to begin 🐍 🗒️ 1 PM UTC. We welcome you to join us to share how we can help your community, express your perspectives, and we'd love to answer your questions about the upcoming PSF Board Election!
                                                                                                                                                                                                                                                                                                                          pyfound.blogspot.com/2025/10/a

                                                                                                                                                                                                                                                                                                                            [?]Hugo van Kemenade » 🌐
                                                                                                                                                                                                                                                                                                                            @hugovk@mastodon.social

                                                                                                                                                                                                                                                                                                                            Next up!

                                                                                                                                                                                                                                                                                                                            Developer in Residence update & future — @encukou

                                                                                                                                                                                                                                                                                                                            ep2026.europython.eu/language-

                                                                                                                                                                                                                                                                                                                            Petr presenting.

                                                                                                                                                                                                                                                                                                                            Alt...Petr presenting.

                                                                                                                                                                                                                                                                                                                            Slide showing dev-in-res responsibilities.

                                                                                                                                                                                                                                                                                                                            Alt...Slide showing dev-in-res responsibilities.

                                                                                                                                                                                                                                                                                                                            Toshio asking.

                                                                                                                                                                                                                                                                                                                            Alt...Toshio asking.

                                                                                                                                                                                                                                                                                                                            Savannah asking.

                                                                                                                                                                                                                                                                                                                            Alt...Savannah asking.

                                                                                                                                                                                                                                                                                                                              [?]Paolo Melchiorre » 🌐
                                                                                                                                                                                                                                                                                                                              @paulox@fosstodon.org

                                                                                                                                                                                                                                                                                                                              On my way to Krakow to attend @europython 2026 🇪🇺

                                                                                                                                                                                                                                                                                                                              PSR to KRK ✈️

                                                                                                                                                                                                                                                                                                                              See you all there 👋

                                                                                                                                                                                                                                                                                                                              CC @europython

                                                                                                                                                                                                                                                                                                                              A selfie of me with an airplane in the background

                                                                                                                                                                                                                                                                                                                              Alt...A selfie of me with an airplane in the background

                                                                                                                                                                                                                                                                                                                                [?]Hugo van Kemenade » 🌐
                                                                                                                                                                                                                                                                                                                                @hugovk@mastodon.social

                                                                                                                                                                                                                                                                                                                                Then:

                                                                                                                                                                                                                                                                                                                                Spicycrab, the Rust transpiler — @kushal

                                                                                                                                                                                                                                                                                                                                ep2026.europython.eu/language-

                                                                                                                                                                                                                                                                                                                                Kushal presenting.

                                                                                                                                                                                                                                                                                                                                Alt...Kushal presenting.

                                                                                                                                                                                                                                                                                                                                Ken Jin asking.

                                                                                                                                                                                                                                                                                                                                Alt...Ken Jin asking.

                                                                                                                                                                                                                                                                                                                                Greg asking.

                                                                                                                                                                                                                                                                                                                                Alt...Greg asking.

                                                                                                                                                                                                                                                                                                                                  [?]Hugo van Kemenade » 🌐
                                                                                                                                                                                                                                                                                                                                  @hugovk@mastodon.social

                                                                                                                                                                                                                                                                                                                                  Back from lunch!

                                                                                                                                                                                                                                                                                                                                  A Roadmap for Rust for CPython — @davidhewitt

                                                                                                                                                                                                                                                                                                                                  ep2026.europython.eu/language-

                                                                                                                                                                                                                                                                                                                                  David presenting.

                                                                                                                                                                                                                                                                                                                                  Alt...David presenting.

                                                                                                                                                                                                                                                                                                                                  A proposed roadmap for Rust for CPython.

                                                                                                                                                                                                                                                                                                                                  Alt...A proposed roadmap for Rust for CPython.

                                                                                                                                                                                                                                                                                                                                  Pablo asking a question.

                                                                                                                                                                                                                                                                                                                                  Alt...Pablo asking a question.

                                                                                                                                                                                                                                                                                                                                    [?]Hugo van Kemenade » 🌐
                                                                                                                                                                                                                                                                                                                                    @hugovk@mastodon.social

                                                                                                                                                                                                                                                                                                                                    A packed morning concludes with:

                                                                                                                                                                                                                                                                                                                                    Memory snapshots and the CPython runtime — Hood Chatham

                                                                                                                                                                                                                                                                                                                                    ep2026.europython.eu/language-

                                                                                                                                                                                                                                                                                                                                    Hood presenting.

                                                                                                                                                                                                                                                                                                                                    Alt...Hood presenting.

                                                                                                                                                                                                                                                                                                                                    Mark Shannon asking a question.

                                                                                                                                                                                                                                                                                                                                    Alt...Mark Shannon asking a question.

                                                                                                                                                                                                                                                                                                                                      [?]Hugo van Kemenade » 🌐
                                                                                                                                                                                                                                                                                                                                      @hugovk@mastodon.social

                                                                                                                                                                                                                                                                                                                                      And then:

                                                                                                                                                                                                                                                                                                                                      Improving the Python buffer protocol — Nathan Goldbaum

                                                                                                                                                                                                                                                                                                                                      ep2026.europython.eu/language-

                                                                                                                                                                                                                                                                                                                                      Nathan presenting.

                                                                                                                                                                                                                                                                                                                                      Alt...Nathan presenting.

                                                                                                                                                                                                                                                                                                                                      Hood Chatham asking a question.

                                                                                                                                                                                                                                                                                                                                      Alt...Hood Chatham asking a question.

                                                                                                                                                                                                                                                                                                                                        [?]Hugo van Kemenade » 🌐
                                                                                                                                                                                                                                                                                                                                        @hugovk@mastodon.social

                                                                                                                                                                                                                                                                                                                                        And now:

                                                                                                                                                                                                                                                                                                                                        GC: Generational? Incremental? Both. — Mark Shannon

                                                                                                                                                                                                                                                                                                                                        ep2026.europython.eu/language-

                                                                                                                                                                                                                                                                                                                                        Mark presenting

                                                                                                                                                                                                                                                                                                                                        Alt...Mark presenting

                                                                                                                                                                                                                                                                                                                                        Attendees sitting in a big U shape, about 15 per section.

                                                                                                                                                                                                                                                                                                                                        Alt...Attendees sitting in a big U shape, about 15 per section.

                                                                                                                                                                                                                                                                                                                                        Larry Hastings asking a question.

                                                                                                                                                                                                                                                                                                                                        Alt...Larry Hastings asking a question.

                                                                                                                                                                                                                                                                                                                                        Pablo Galindo Salgado asking a question.

                                                                                                                                                                                                                                                                                                                                        Alt...Pablo Galindo Salgado asking a question.

                                                                                                                                                                                                                                                                                                                                          [?]Hugo van Kemenade » 🌐
                                                                                                                                                                                                                                                                                                                                          @hugovk@mastodon.social

                                                                                                                                                                                                                                                                                                                                          [?]Hugo van Kemenade » 🌐
                                                                                                                                                                                                                                                                                                                                          @hugovk@mastodon.social

                                                                                                                                                                                                                                                                                                                                          First up: One namespace to namespacing them all — Pablo Galindo Salgado

                                                                                                                                                                                                                                                                                                                                          ep2026.europython.eu/language-

                                                                                                                                                                                                                                                                                                                                          Pablo presenting

                                                                                                                                                                                                                                                                                                                                          Alt...Pablo presenting

                                                                                                                                                                                                                                                                                                                                            [?]Hugo van Kemenade » 🌐
                                                                                                                                                                                                                                                                                                                                            @hugovk@mastodon.social

                                                                                                                                                                                                                                                                                                                                            Hello from Kraków and the sun is shining for the at !

                                                                                                                                                                                                                                                                                                                                            The Wawel caste reflecting across the Vistula river.

                                                                                                                                                                                                                                                                                                                                            Alt...The Wawel caste reflecting across the Vistula river.

                                                                                                                                                                                                                                                                                                                                              [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                                                                                              @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                                                                                              Python Tip #194 (of 365):

                                                                                                                                                                                                                                                                                                                                              Install Python with uv

                                                                                                                                                                                                                                                                                                                                              I recommend using:

                                                                                                                                                                                                                                                                                                                                              $ uv python install --default 3.14

                                                                                                                                                                                                                                                                                                                                              Specifying "--default" will install symbolic links for python, python3, and python3.N (where N is the minor version number).

                                                                                                                                                                                                                                                                                                                                              Using uv to install Python makes it easy to upgrade subminor versions.

                                                                                                                                                                                                                                                                                                                                              Just run:

                                                                                                                                                                                                                                                                                                                                              $ uv python upgrade

                                                                                                                                                                                                                                                                                                                                              If you have Python 3.14.4 installed after 3.14.5 is out, that "python upgrade" command will install it.

                                                                                                                                                                                                                                                                                                                                              🧵 (1/3)

                                                                                                                                                                                                                                                                                                                                                [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                                                                                                @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                                                                                                Python Tip #193 (of 365):

                                                                                                                                                                                                                                                                                                                                                To compare iterables while ignoring order and duplication, use a set equality check.

                                                                                                                                                                                                                                                                                                                                                Like this:

                                                                                                                                                                                                                                                                                                                                                >>> set(iterable1) == set(iterable2)
                                                                                                                                                                                                                                                                                                                                                True

                                                                                                                                                                                                                                                                                                                                                Like all things set-related, this requires hashable items.

                                                                                                                                                                                                                                                                                                                                                🧵 (1/2)

                                                                                                                                                                                                                                                                                                                                                  [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                                                                                                  @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                                                                                                  “Unless you really need an index for your substring match, a containment check will do just fine.”

                                                                                                                                                                                                                                                                                                                                                  Read more 👉 pym.dev/avoid-indexes-in-pytho

                                                                                                                                                                                                                                                                                                                                                    [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                                                                                                    @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                                                                                                    “Sorted will call that key function on each item in the given iterable, and it'll sort the items by the result of whatever that key function returns for each item.”

                                                                                                                                                                                                                                                                                                                                                    Read more 👉 pym.dev/sorting-in-python/

                                                                                                                                                                                                                                                                                                                                                      [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                                                                                                      @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                                                                                                      Python Tip #192 (of 365):

                                                                                                                                                                                                                                                                                                                                                      To compare iterables while counting duplicates but ignoring order, use Counter.

                                                                                                                                                                                                                                                                                                                                                      A Counter tallies how many times each item appears. Counters are equal when every item appears the same number of times, regardless of order:

                                                                                                                                                                                                                                                                                                                                                      >>> from collections import Counter
                                                                                                                                                                                                                                                                                                                                                      >>> Counter([1, 2, 2, 3]) == Counter([3, 2, 1, 2])
                                                                                                                                                                                                                                                                                                                                                      True
                                                                                                                                                                                                                                                                                                                                                      >>> Counter([1, 2, 3]) == Counter([1, 2, 2, 3])
                                                                                                                                                                                                                                                                                                                                                      False

                                                                                                                                                                                                                                                                                                                                                      The second check is False because one iterable has an extra 2.

                                                                                                                                                                                                                                                                                                                                                      🧵 (1/2)

                                                                                                                                                                                                                                                                                                                                                        [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                                                                                                        @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                                                                                                        Python Tip #191 (of 365):

                                                                                                                                                                                                                                                                                                                                                        Compare iterables item-by-item with all() & zip().

                                                                                                                                                                                                                                                                                                                                                        The == operator won't compare a list and a tuple by their contents:

                                                                                                                                                                                                                                                                                                                                                        >>> a = [1, 2, 3]
                                                                                                                                                                                                                                                                                                                                                        >>> b = (1, 2, 3)
                                                                                                                                                                                                                                                                                                                                                        >>> a == b
                                                                                                                                                                                                                                                                                                                                                        False

                                                                                                                                                                                                                                                                                                                                                        And two generators can't be compared by their contents at all.

                                                                                                                                                                                                                                                                                                                                                        You can compare any iterables item-by-item, regardless of their type like this:

                                                                                                                                                                                                                                                                                                                                                        >>> all(x == y for x, y in zip(a, b, strict=True))
                                                                                                                                                                                                                                                                                                                                                        True

                                                                                                                                                                                                                                                                                                                                                        🧵 (1/2)

                                                                                                                                                                                                                                                                                                                                                          [?]Django News » 🤖 🌐
                                                                                                                                                                                                                                                                                                                                                          @djangonews@mastodon.social

                                                                                                                                                                                                                                                                                                                                                          [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                                                                                                          @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                                                                                                          “The simplest use of a set is probably also its most common use: checking for duplicates.”

                                                                                                                                                                                                                                                                                                                                                          Read more 👉 pym.dev/practical-uses-of-sets/

                                                                                                                                                                                                                                                                                                                                                            [?]Hacker News » 🤖 🌐
                                                                                                                                                                                                                                                                                                                                                            @h4ckernews@mastodon.social

                                                                                                                                                                                                                                                                                                                                                            [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                                                                                                            @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                                                                                                            Python Tip #190 (of 365):

                                                                                                                                                                                                                                                                                                                                                            To remove duplicates while maintaining the original iterable order, use dict.fromkeys.

                                                                                                                                                                                                                                                                                                                                                            Converting to a set removes duplicates, but it loses the original order:

                                                                                                                                                                                                                                                                                                                                                            >>> colors = ["red", "green", "blue", "green", "red"]
                                                                                                                                                                                                                                                                                                                                                            >>> set(colors)
                                                                                                                                                                                                                                                                                                                                                            {'blue', 'green', 'red'}

                                                                                                                                                                                                                                                                                                                                                            🧵 (1/2)

                                                                                                                                                                                                                                                                                                                                                              [?]Romain Tartière » 🌐
                                                                                                                                                                                                                                                                                                                                                              @smortex@mamot.fr

                                                                                                                                                                                                                                                                                                                                                              Dear ,

                                                                                                                                                                                                                                                                                                                                                              I am looking for a way to generate a simple in without extra run-time dependencies.

                                                                                                                                                                                                                                                                                                                                                              I am happy to use whatever tooling is needed to generate the parser, but the generated Python code must be standalone (just like lex/yacc generate standalone C code).

                                                                                                                                                                                                                                                                                                                                                              I found a lot of parser generators for Python but they all introduce run-time dependencies that I would really like to avoid.

                                                                                                                                                                                                                                                                                                                                                              Do you know a tool that fits this use-case?

                                                                                                                                                                                                                                                                                                                                                              Retoots appreciated!

                                                                                                                                                                                                                                                                                                                                                                [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                                                                                                                @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                “It's easy to overdo it when defaulting dictionary values.”

                                                                                                                                                                                                                                                                                                                                                                Read more 👉 pym.dev/default-dictionary-val

                                                                                                                                                                                                                                                                                                                                                                  [?]Kushal Das :python: :tor: 🇸🇪 » 🌐
                                                                                                                                                                                                                                                                                                                                                                  @kushal@toots.dgplug.org

                                                                                                                                                                                                                                                                                                                                                                  I am wondering how many of friends here worked with ?

                                                                                                                                                                                                                                                                                                                                                                    [?]Out of Control :laravel: 🇨🇦 » 🌐
                                                                                                                                                                                                                                                                                                                                                                    @outofcontrol@phpc.social

                                                                                                                                                                                                                                                                                                                                                                    Any Python users here? Not really a Python dev here, but I use pip when asked to install something. Today I saw `uv` to install something.

                                                                                                                                                                                                                                                                                                                                                                    Which do Python devs here prefer, `uv` or `pip`?

                                                                                                                                                                                                                                                                                                                                                                      Nicoco boosted

                                                                                                                                                                                                                                                                                                                                                                      [?]mathieui » 🌐
                                                                                                                                                                                                                                                                                                                                                                      @mathieui@piaille.fr

                                                                                                                                                                                                                                                                                                                                                                      Happy to announce the release of slixmpp, the python XMPP library in its 1.17.0 version.

                                                                                                                                                                                                                                                                                                                                                                      It has a few improvements alongside an important bugfix for components, as well as many other changes.

                                                                                                                                                                                                                                                                                                                                                                      Read the full changelog at blog.mathieui.net/slixmpp-1-17

                                                                                                                                                                                                                                                                                                                                                                        [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                                                                                                                        @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                        “But what if you need to perform an operation repeatedly and you don't have an iterable to loop over?”

                                                                                                                                                                                                                                                                                                                                                                        Read more 👉 pym.dev/while-loops/

                                                                                                                                                                                                                                                                                                                                                                          [?]Hugo van Kemenade » 🌐
                                                                                                                                                                                                                                                                                                                                                                          @hugovk@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                          [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                                                                                                                          @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                          Python Tip #189 (of 365):

                                                                                                                                                                                                                                                                                                                                                                          Check for duplicates by converting to a set.

                                                                                                                                                                                                                                                                                                                                                                          To check whether your collection contains duplicate items, make a set out of it and compare the original length to the set length:

                                                                                                                                                                                                                                                                                                                                                                          >>> len(set(colors)) == len(colors)
                                                                                                                                                                                                                                                                                                                                                                          False

                                                                                                                                                                                                                                                                                                                                                                          Sets can't hold duplicates, so if a set conversion shrinks the length, there were duplicates.

                                                                                                                                                                                                                                                                                                                                                                          A caveat: this assumes all item are hashable (like strings, numbers, & tuples of hashable items).

                                                                                                                                                                                                                                                                                                                                                                          More: pym.dev/practical-uses-of-sets/

                                                                                                                                                                                                                                                                                                                                                                            [?]codingjoe :django: :python: » 🌐
                                                                                                                                                                                                                                                                                                                                                                            @codingjoe@fosstodon.org

                                                                                                                                                                                                                                                                                                                                                                            [?]codingjoe :django: :python: » 🌐
                                                                                                                                                                                                                                                                                                                                                                            @codingjoe@fosstodon.org

                                                                                                                                                                                                                                                                                                                                                                            BIG NEWS! 😮

                                                                                                                                                                                                                                                                                                                                                                            got another task backend. 🎉

                                                                                                                                                                                                                                                                                                                                                                            Threadmill has a durable message queue based on Redis as well as a monitoring interface based on textual.

                                                                                                                                                                                                                                                                                                                                                                            github.com/codingjoe/threadmill

                                                                                                                                                                                                                                                                                                                                                                              Lily boosted

                                                                                                                                                                                                                                                                                                                                                                              [?]Ronny Vedrilla » 🌐
                                                                                                                                                                                                                                                                                                                                                                              @GitRon@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                              I keep asking the same question on every Django project: where do my queries actually go?
                                                                                                                                                                                                                                                                                                                                                                              Wrote up the answer that's worked for me — selectors: plain functions, one per use case, no magic. Views go back to being thin controllers, services shed 40–60% of their bulk.
                                                                                                                                                                                                                                                                                                                                                                              medium.com/ambient-innovation/

                                                                                                                                                                                                                                                                                                                                                                                [?]Hugo van Kemenade » 🌐
                                                                                                                                                                                                                                                                                                                                                                                @hugovk@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                What's New in Python 3.15:

                                                                                                                                                                                                                                                                                                                                                                                Upgraded JIT compiler

                                                                                                                                                                                                                                                                                                                                                                                Results from pyperformance suite: 8-9% geometric mean performance improvement over the standard CPython interpreter built with all optimisations enabled on x86-64 Linux.

                                                                                                                                                                                                                                                                                                                                                                                On AArch64 macOS, 12-13% speedup over the tail calling interpreter with all optimisations enabled.

                                                                                                                                                                                                                                                                                                                                                                                The speedups versus no JIT builds range from roughly 15% slowdown to over 100% speedup on x86-64 Linux and AArch64 macOS.

                                                                                                                                                                                                                                                                                                                                                                                docs.python.org/3.15/whatsnew/

                                                                                                                                                                                                                                                                                                                                                                                  [?]Hugo van Kemenade » 🌐
                                                                                                                                                                                                                                                                                                                                                                                  @hugovk@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                  RE: fosstodon.org/@pillow/11684469

                                                                                                                                                                                                                                                                                                                                                                                  New @pillow release!

                                                                                                                                                                                                                                                                                                                                                                                  🛞 Wheels for Python 3.15 beta
                                                                                                                                                                                                                                                                                                                                                                                  🧾 An SBOM in all the wheels
                                                                                                                                                                                                                                                                                                                                                                                  🚅 Performance improvements thanks to @akx
                                                                                                                                                                                                                                                                                                                                                                                  🔒 Security fixes
                                                                                                                                                                                                                                                                                                                                                                                  ❌ No longer a wheel for free-threaded Python 3.13, it was experimental and 3.14+ has official support with better performance

                                                                                                                                                                                                                                                                                                                                                                                    [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                                                                                                                                    @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                    To remember that you need strptime for parsing instead of strftime, remember that it's "string parse time" and "string format time".

                                                                                                                                                                                                                                                                                                                                                                                    Read more 👉 trey.io/l4b84k

                                                                                                                                                                                                                                                                                                                                                                                      oldsysops boosted

                                                                                                                                                                                                                                                                                                                                                                                      [?]Krios101 » 🌐
                                                                                                                                                                                                                                                                                                                                                                                      @Krios101@mastodonapp.uk

                                                                                                                                                                                                                                                                                                                                                                                      Hi All, I am looking for full time, mid-senior level UK job roles. I am based in the UK and I've got 9 years experience working with it primarily in scientific disciplines (Earth Observation ) and a small amount in doing backend work. I've designed a wide variety of scientific Python scripts and programs and I've had the privellige of working with on several projects including presenting my work internationally and having my investigations published on their websites.

                                                                                                                                                                                                                                                                                                                                                                                      I'm looking for more coding work in scientific disciplines or more work if possible. I am also skilled in QA like work, deep analysis, Git and self hosting.

                                                                                                                                                                                                                                                                                                                                                                                      I'm primarily open to remote work within the UK and remote European work dependent on what is available. I am open to hybrid work based in Buckinghamshire but it would preferably have to be 1 day a week in an office, potentially 2. Reply or DM me for more details. Boosts appreciated!

                                                                                                                                                                                                                                                                                                                                                                                        [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                                                                                                                                        @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                        Python Tip #188 (of 365):

                                                                                                                                                                                                                                                                                                                                                                                        To find the first item that matches a condition, combine next with a generator expression.

                                                                                                                                                                                                                                                                                                                                                                                        Like this:

                                                                                                                                                                                                                                                                                                                                                                                        >>> numbers = [4, -1, 8, -3, 0, 6]
                                                                                                                                                                                                                                                                                                                                                                                        >>> next(n for n in numbers if n < 0)
                                                                                                                                                                                                                                                                                                                                                                                        -1

                                                                                                                                                                                                                                                                                                                                                                                        The generator expression finds matching items lazily and next stops as soon as a match is found.

                                                                                                                                                                                                                                                                                                                                                                                        🧵 (1/2)

                                                                                                                                                                                                                                                                                                                                                                                          [?]Lythops | Nils » 🌐
                                                                                                                                                                                                                                                                                                                                                                                          @lythops@rollenspiel.social

                                                                                                                                                                                                                                                                                                                                                                                          @treyhunner I love your contribution to 3.14!
                                                                                                                                                                                                                                                                                                                                                                                          It often are the small things that are the most annoying. :)

                                                                                                                                                                                                                                                                                                                                                                                            [?]yossarian » 🌐
                                                                                                                                                                                                                                                                                                                                                                                            @yossarian@infosec.exchange

                                                                                                                                                                                                                                                                                                                                                                                            AodeRelay boosted

                                                                                                                                                                                                                                                                                                                                                                                            [?]radiotux » 🌐
                                                                                                                                                                                                                                                                                                                                                                                            @radiotux@jit.social

                                                                                                                                                                                                                                                                                                                                                                                            Python-Power für dein Terminal! 🐍 Heute im : **xonsh**.

                                                                                                                                                                                                                                                                                                                                                                                            Es ist kein einfacher Bash-Ersatz, sondern eine Shell, die Python 3 als Grundlage nutzt. Das heißt: Shell-Befehle und Python-Code nahtlos mischen! Pipelines, Variablen, Module – alles in einem Guss. 🚀

                                                                                                                                                                                                                                                                                                                                                                                            Nutzt ihr schon Python-Logik direkt in eurer Shell oder bleibt ihr bei klassischer Bash/Zsh? Schreibt es uns! 🎙️

                                                                                                                                                                                                                                                                                                                                                                                            Link: xon.sh/

                                                                                                                                                                                                                                                                                                                                                                                              [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                                                                                                                                              @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                              Python Tip #187 (of 365):

                                                                                                                                                                                                                                                                                                                                                                                              Need to count how many items match a condition? Sum up booleans. 🧵

                                                                                                                                                                                                                                                                                                                                                                                              Booleans are integers in Python:

                                                                                                                                                                                                                                                                                                                                                                                              >>> issubclass(bool, int)
                                                                                                                                                                                                                                                                                                                                                                                              True

                                                                                                                                                                                                                                                                                                                                                                                              True acts just like 1 and False acts just like 0.

                                                                                                                                                                                                                                                                                                                                                                                              I wouldn't rely on that fact often... BUT there's one specific place where this fact is very handy...

                                                                                                                                                                                                                                                                                                                                                                                              🧵 (1/3)

                                                                                                                                                                                                                                                                                                                                                                                                [?]Kushal Das :python: :tor: 🇸🇪 » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                @kushal@toots.dgplug.org

                                                                                                                                                                                                                                                                                                                                                                                                And if you need then use pybergshamra.readthedocs.io/en for all in pure level in .

                                                                                                                                                                                                                                                                                                                                                                                                  [?]Kushal Das :python: :tor: 🇸🇪 » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                  @kushal@toots.dgplug.org

                                                                                                                                                                                                                                                                                                                                                                                                  pyuppsala.readthedocs.io/en/la I released 0.9.0 of my based library. A lot of hardening and very good improvement.

                                                                                                                                                                                                                                                                                                                                                                                                    [?]Hugo van Kemenade » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                    @hugovk@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                    What's New in Python 3.15:

                                                                                                                                                                                                                                                                                                                                                                                                    warnings

                                                                                                                                                                                                                                                                                                                                                                                                    * Improve filtering by module in warnings.warn_explicit() if no module argument is passed. It now tests the module regular expression in the warnings filter not only against the filename with .py stripped, but also against module names constructed starting from different parent directories of the filename (with /__init__.py, .py and, on Windows, .pyw stripped). (Contributed by Serhiy Storchaka.)

                                                                                                                                                                                                                                                                                                                                                                                                    docs.python.org/3.15/whatsnew/

                                                                                                                                                                                                                                                                                                                                                                                                      victor héry boosted

                                                                                                                                                                                                                                                                                                                                                                                                      [?]Miss Mint 🦊 :no_ai: » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                      @Mint@piaille.fr

                                                                                                                                                                                                                                                                                                                                                                                                      Appel à bonnes âmes 😁

                                                                                                                                                                                                                                                                                                                                                                                                      Mon compagnon, cet homme incroyable, m'a fait un script python pour me permettre de tamponner des pièces de procédure en 3 secondes.

                                                                                                                                                                                                                                                                                                                                                                                                      En ayant parlé à d'autres, il s'avère qu'iels seraient intéressé.e.s mais ne sont pas sous linux (cheh)

                                                                                                                                                                                                                                                                                                                                                                                                      J'ai deux questions :
                                                                                                                                                                                                                                                                                                                                                                                                      - où mettre son dépôt git pour pouvoir le partager
                                                                                                                                                                                                                                                                                                                                                                                                      - est-ce qu'il y a des trucs pour pouvoir faire fonctionner facilement ce truc sans passer par un terminal => le rendre humain compatible 😁 et éventuellement mac et windows accessible
                                                                                                                                                                                                                                                                                                                                                                                                      Tout en réalisant le traitement sur le PC et non en ligne (secret pro 4ever)

                                                                                                                                                                                                                                                                                                                                                                                                      Merci d'avance pour votre aide

                                                                                                                                                                                                                                                                                                                                                                                                        [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                        @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                        Python's error messages have improved a lot in the past few versions, and this is exactly the kind of change that makes Python even more beginner-friendly.

                                                                                                                                                                                                                                                                                                                                                                                                        Read more 👉 trey.io/flfwr9

                                                                                                                                                                                                                                                                                                                                                                                                          Wolf boosted

                                                                                                                                                                                                                                                                                                                                                                                                          [?]Stylus [He/Him/They/Them] » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                          @stylus@social.afront.org

                                                                                                                                                                                                                                                                                                                                                                                                          I wrote something today using __init_subclass__. Do I get a prize?

                                                                                                                                                                                                                                                                                                                                                                                                            Erwan 🚄 boosted

                                                                                                                                                                                                                                                                                                                                                                                                            [?]Feth 🎉 » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                            @ffeth@hostux.social

                                                                                                                                                                                                                                                                                                                                                                                                            Fiston est méga motivé pour, à la rentrée, remplir un site web avec
                                                                                                                                                                                                                                                                                                                                                                                                            - photo d'aménagement piéton/vélo ridicule
                                                                                                                                                                                                                                                                                                                                                                                                            - localisation dans l'agglo
                                                                                                                                                                                                                                                                                                                                                                                                            - textes

                                                                                                                                                                                                                                                                                                                                                                                                            Si possible avec des mômes de son âge, qui feront le design.

                                                                                                                                                                                                                                                                                                                                                                                                            Je vais bien sûr mettre ce site web en place.
                                                                                                                                                                                                                                                                                                                                                                                                            Idéalement, j'aimerais que ça soit le moins de maintenance possible hors mises à jour de contenu.

                                                                                                                                                                                                                                                                                                                                                                                                            En gros, une galerie de photos géolocalisées et un blog. Je parle pas trop mal le et je tiens pas à tout réinventer.

                                                                                                                                                                                                                                                                                                                                                                                                            :retoot:

                                                                                                                                                                                                                                                                                                                                                                                                              [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                              @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                              Python Tip #186 (of 365):

                                                                                                                                                                                                                                                                                                                                                                                                              Use the errors argument when reading files with encoding issues.

                                                                                                                                                                                                                                                                                                                                                                                                              When reading a file, invalid bytes in the chosen encoding will raise an exception:

                                                                                                                                                                                                                                                                                                                                                                                                              >>> p = pathlib.Path("p")
                                                                                                                                                                                                                                                                                                                                                                                                              >>> p.write_text("café", encoding="cp1252")
                                                                                                                                                                                                                                                                                                                                                                                                              >>> p.‍read_text(encoding="utf-8")
                                                                                                                                                                                                                                                                                                                                                                                                              UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe9 in position 3: unexpected end of data

                                                                                                                                                                                                                                                                                                                                                                                                              With the "errors" argument, we can suppress this exception.

                                                                                                                                                                                                                                                                                                                                                                                                              🧵 (1/3)

                                                                                                                                                                                                                                                                                                                                                                                                                [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                “Python's while loops are for looping based on a condition.”

                                                                                                                                                                                                                                                                                                                                                                                                                Read more 👉 pym.dev/while-loops/

                                                                                                                                                                                                                                                                                                                                                                                                                  [?]Nicolas Delsaux » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                  @Riduidel@framapiaf.org

                                                                                                                                                                                                                                                                                                                                                                                                                  Sans doute la façon la plus simple de télécharger un album, un artiste depuis Spotify. L'astuce, c'est bien sûr qu'il ne télécharge pas les chansons depuis Spotify. Le seul truc à personnaliser, c'est le format des fichiers (j'utilise ce formatage "output": "{artist}/({year}) - {album}/{track-number} - {title}.{output-ext}") spotdl.github.io/spotify-downl

                                                                                                                                                                                                                                                                                                                                                                                                                    [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                    @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                    “What if you want every key lookup you ever perform on your dictionary to have a default value?”

                                                                                                                                                                                                                                                                                                                                                                                                                    Read more 👉 pym.dev/default-dictionary-val

                                                                                                                                                                                                                                                                                                                                                                                                                      [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                      @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                      Python Tip #185 (of 365):

                                                                                                                                                                                                                                                                                                                                                                                                                      Normalize Unicode strings before comparing them.

                                                                                                                                                                                                                                                                                                                                                                                                                      Some Unicode characters can be written in more than one way.

                                                                                                                                                                                                                                                                                                                                                                                                                      Python's == won't consider them equal even if they look identical.

                                                                                                                                                                                                                                                                                                                                                                                                                      Use unicodedata.normalize() to fix this.

                                                                                                                                                                                                                                                                                                                                                                                                                      The letter "é" can be stored two ways:

                                                                                                                                                                                                                                                                                                                                                                                                                      • 1 precomposed character
                                                                                                                                                                                                                                                                                                                                                                                                                      • "e" plus a combining accent

                                                                                                                                                                                                                                                                                                                                                                                                                      Both look the same, but they're not:

                                                                                                                                                                                                                                                                                                                                                                                                                      >>> x, y = "café", "café"
                                                                                                                                                                                                                                                                                                                                                                                                                      >>> x == y
                                                                                                                                                                                                                                                                                                                                                                                                                      False
                                                                                                                                                                                                                                                                                                                                                                                                                      >>> len(x), len(y)
                                                                                                                                                                                                                                                                                                                                                                                                                      (4, 5)

                                                                                                                                                                                                                                                                                                                                                                                                                      🧵 (1/2)

                                                                                                                                                                                                                                                                                                                                                                                                                        [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                        @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                        The reversed() function works on all sequences, but it also works on some other iterables, like dictionaries

                                                                                                                                                                                                                                                                                                                                                                                                                        Read more 👉 trey.io/ur7l4g

                                                                                                                                                                                                                                                                                                                                                                                                                          [?]Hugo van Kemenade » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                          @hugovk@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                          step 1: do an experimental JIT
                                                                                                                                                                                                                                                                                                                                                                                                                          step 2: do a website called doesjitgobrrr.com to track performance
                                                                                                                                                                                                                                                                                                                                                                                                                          step 3: write a PEP called "JIT Go Brrr"
                                                                                                                                                                                                                                                                                                                                                                                                                          step 4: non-experimental JIT gone brrr?
                                                                                                                                                                                                                                                                                                                                                                                                                          step 5: CPython gone brr?
                                                                                                                                                                                                                                                                                                                                                                                                                          step 6: brrr?

                                                                                                                                                                                                                                                                                                                                                                                                                          peps.python.org/pep-0836/

                                                                                                                                                                                                                                                                                                                                                                                                                            AodeRelay boosted

                                                                                                                                                                                                                                                                                                                                                                                                                            [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                            @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                            Python Tip #184 (of 365):

                                                                                                                                                                                                                                                                                                                                                                                                                            Always specify the encoding when opening text files.

                                                                                                                                                                                                                                                                                                                                                                                                                            With no encoding specified, Python will pick a platform-dependent default encoding.

                                                                                                                                                                                                                                                                                                                                                                                                                            A wrong encoding may raise an exception or may result in "mojibake" (garbled nonsense).

                                                                                                                                                                                                                                                                                                                                                                                                                            Opening a UTF-8 file as CP-1252 turns "✨" into "✨":

                                                                                                                                                                                                                                                                                                                                                                                                                            >>> path = pathlib.Path("sparkles.txt")
                                                                                                                                                                                                                                                                                                                                                                                                                            >>> path.write_text("✨", encoding="utf-8")
                                                                                                                                                                                                                                                                                                                                                                                                                            >>> path.read_text(encoding="cp1252")
                                                                                                                                                                                                                                                                                                                                                                                                                            '✨'

                                                                                                                                                                                                                                                                                                                                                                                                                            🧵 (1/2)

                                                                                                                                                                                                                                                                                                                                                                                                                              [?]PyCon NL » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                              @pycon_nl@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                              🎉 The Call for Proposals for PyCon NL 2026 is OPEN!

                                                                                                                                                                                                                                                                                                                                                                                                                              📅 15 October 2026
                                                                                                                                                                                                                                                                                                                                                                                                                              📍 Jaarbeurs Utrecht

                                                                                                                                                                                                                                                                                                                                                                                                                              We want to hear YOUR Python story. Beginner talk, deep technical dive, war story from production, something completely quirky... we want it all 🐍✨

                                                                                                                                                                                                                                                                                                                                                                                                                              Do you want to give a workshop? Perfect! We have a track for that as well 💪

                                                                                                                                                                                                                                                                                                                                                                                                                              👉 Submit your talk (or workshop!) here: pycon-nl.org/call-for-papers

                                                                                                                                                                                                                                                                                                                                                                                                                                [?]Hugo van Kemenade » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                @hugovk@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                🗓️ The Language Summit schedule is now up!

                                                                                                                                                                                                                                                                                                                                                                                                                                ep2026.europython.eu/language-

                                                                                                                                                                                                                                                                                                                                                                                                                                ⚡ Lightning talks can be submitted on site on the day.

                                                                                                                                                                                                                                                                                                                                                                                                                                  [?]Hugo van Kemenade » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                  @hugovk@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                  Have you written a new PEP and are ready for a PEP number? (Either you're a Python core team member or found one to sponsor your PEP.)

                                                                                                                                                                                                                                                                                                                                                                                                                                  Old way: scour through peps.python.org/ and github.com/python/peps/pulls to find which is next

                                                                                                                                                                                                                                                                                                                                                                                                                                  Better way:

                                                                                                                                                                                                                                                                                                                                                                                                                                  ❯ uvx pepotron next
                                                                                                                                                                                                                                                                                                                                                                                                                                  Next available PEP: 837

                                                                                                                                                                                                                                                                                                                                                                                                                                  🆕 New: visit hugovk.dev/next-pep-number/

                                                                                                                                                                                                                                                                                                                                                                                                                                    [?]Marcos Dione » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                    @mdione@en.osm.town

                                                                                                                                                                                                                                                                                                                                                                                                                                    EuroPython's sponsors have open opportunities... in , of course:

                                                                                                                                                                                                                                                                                                                                                                                                                                    blog.europython.eu/europython-

                                                                                                                                                                                                                                                                                                                                                                                                                                    Summary: 8 positions, 6 on AI, 2 in marketing, 3 in Finance or Banks. 3 without location; 2 hybrid, Kraków and Paris; 2 on site, Dublin and US or UK; and 1 remote but on selected countries in Europa.

                                                                                                                                                                                                                                                                                                                                                                                                                                      [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                      @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                      “Most of our loops in Python are modeled from the perspective of looping over an iterable: that's what Python's for loops are for.”

                                                                                                                                                                                                                                                                                                                                                                                                                                      Read more 👉 pym.dev/while-loops/

                                                                                                                                                                                                                                                                                                                                                                                                                                        [?]Laurent Cheylus » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                        @lcheylus@bsd.network

                                                                                                                                                                                                                                                                                                                                                                                                                                        uv audit: a new Command for the Python project manager ; scans your dependencies for known vulnerabilities and "adverse" project statuses (such as being deprecated). Alternative to pip-audit, and is between 4x and 10x faster on typical projects astral.sh/blog/uv-audit

                                                                                                                                                                                                                                                                                                                                                                                                                                          [?]Python Software Foundation » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                          @ThePSF@fosstodon.org

                                                                                                                                                                                                                                                                                                                                                                                                                                          Got questions about the 2026 PSF Board election? Curious about running? Join the upcoming PSF Board Office Hours session on Tuesday, July 14th, at 1 PM UTC on the PSF Discord to chat with current board members!
                                                                                                                                                                                                                                                                                                                                                                                                                                          pyfound.blogspot.com/2026/07/t

                                                                                                                                                                                                                                                                                                                                                                                                                                            [?]Carlton Gibson » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                            @carlton@chaos.social

                                                                                                                                                                                                                                                                                                                                                                                                                                            If you’re at a loose end, I’m chatting to @mkennedy on @talkpython later on this afternoon. You can get it live at 2pm UTC, or watch the replay later🎙️

                                                                                                                                                                                                                                                                                                                                                                                                                                            m.youtube.com/watch?v=J1WXYE1W

                                                                                                                                                                                                                                                                                                                                                                                                                                              [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                              @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                              Python Tip #183 (of 365):

                                                                                                                                                                                                                                                                                                                                                                                                                                              Wrap text to a fixed width with textwrap.wrap.

                                                                                                                                                                                                                                                                                                                                                                                                                                              Need to hard-wrap a long string to 70 (or any number of) characters?

                                                                                                                                                                                                                                                                                                                                                                                                                                              Use wrap() or fill() from Python's textwrap module.

                                                                                                                                                                                                                                                                                                                                                                                                                                              The wrap() function breaks text into a list of lines:

                                                                                                                                                                                                                                                                                                                                                                                                                                              >>> import textwrap
                                                                                                                                                                                                                                                                                                                                                                                                                                              >>> text = "Permission is hereby granted, free of charge, to any person obtaining a copy of this software..."
                                                                                                                                                                                                                                                                                                                                                                                                                                              >>> textwrap.wrap(text, width=20)[:2]
                                                                                                                                                                                                                                                                                                                                                                                                                                              ['Permission is hereby', 'granted, free of']

                                                                                                                                                                                                                                                                                                                                                                                                                                              🧵 (1/2)

                                                                                                                                                                                                                                                                                                                                                                                                                                                [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                How can you improve the readability of long Boolean expressions in Python?

                                                                                                                                                                                                                                                                                                                                                                                                                                                Read more 👉 trey.io/f98u5c

                                                                                                                                                                                                                                                                                                                                                                                                                                                  [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                  @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                  Python Tip #182 (of 365):

                                                                                                                                                                                                                                                                                                                                                                                                                                                  Use textwrap.dedent to unindent multi-line strings.

                                                                                                                                                                                                                                                                                                                                                                                                                                                  Without dedent:

                                                                                                                                                                                                                                                                                                                                                                                                                                                  >>> def help_text():
                                                                                                                                                                                                                                                                                                                                                                                                                                                  ... return """
                                                                                                                                                                                                                                                                                                                                                                                                                                                  ... Usage: my_tool [options]
                                                                                                                                                                                                                                                                                                                                                                                                                                                  ... -h, --help Show this message
                                                                                                                                                                                                                                                                                                                                                                                                                                                  ... """
                                                                                                                                                                                                                                                                                                                                                                                                                                                  ...
                                                                                                                                                                                                                                                                                                                                                                                                                                                  >>> print(help_text())

                                                                                                                                                                                                                                                                                                                                                                                                                                                  Usage: my_tool [options]
                                                                                                                                                                                                                                                                                                                                                                                                                                                  -h, --help Show this message

                                                                                                                                                                                                                                                                                                                                                                                                                                                  With dedent:

                                                                                                                                                                                                                                                                                                                                                                                                                                                  >>> from textwrap import dedent
                                                                                                                                                                                                                                                                                                                                                                                                                                                  >>> print(dedent(help_text()))

                                                                                                                                                                                                                                                                                                                                                                                                                                                  Usage: my_tool [options]
                                                                                                                                                                                                                                                                                                                                                                                                                                                  -h, --help Show this message

                                                                                                                                                                                                                                                                                                                                                                                                                                                  🧵 (1/3)

                                                                                                                                                                                                                                                                                                                                                                                                                                                    [?]Marud :mastodont_v2: » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                    @marud@social.marud.fr

                                                                                                                                                                                                                                                                                                                                                                                                                                                    Hey la team : quelqu'un saurait m'expliquer pourquoi dès qu'il est utilisé, mon objet CSV (ici reader) se retrouve vidé ?
                                                                                                                                                                                                                                                                                                                                                                                                                                                    Je cherche à l'utiliser plusieurs fois, c'est quoi la bonne méthode pour le conserver entre deux usages ? J'ai pas envie de refaire un open, c'est un gros fichier.

                                                                                                                                                                                                                                                                                                                                                                                                                                                    f = open("Lexique4.tsv", encoding="utf-8")
                                                                                                                                                                                                                                                                                                                                                                                                                                                    reader = csv.DictReader(f, delimiter="\t")

                                                                                                                                                                                                                                                                                                                                                                                                                                                      [?]Feoh [He/Him] » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                      @feoh@oldbytes.space

                                                                                                                                                                                                                                                                                                                                                                                                                                                      @zarfeblong Have you looked into at all?

                                                                                                                                                                                                                                                                                                                                                                                                                                                      I'm pretty excited by it.

                                                                                                                                                                                                                                                                                                                                                                                                                                                      The idea of having an Ink like language for composing stories but having the ability to put inline for when things get more complex really has me inspired.

                                                                                                                                                                                                                                                                                                                                                                                                                                                      github.com/katelouie/bardic

                                                                                                                                                                                                                                                                                                                                                                                                                                                      (I'm working on a @neovim plugin to graph the story structure because I don't like VS Code :)

                                                                                                                                                                                                                                                                                                                                                                                                                                                        [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                        @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                        Python Tip #181 (of 365):

                                                                                                                                                                                                                                                                                                                                                                                                                                                        Don't use Python's "str.title()" method.

                                                                                                                                                                                                                                                                                                                                                                                                                                                        It capitalizes letters after apostrophes, turning "don't" into "Don'T".

                                                                                                                                                                                                                                                                                                                                                                                                                                                        Here's the problem:

                                                                                                                                                                                                                                                                                                                                                                                                                                                        >>> "Python is a don't-miss language".title()
                                                                                                                                                                                                                                                                                                                                                                                                                                                        "Python Is A Don'T-Miss Language"

                                                                                                                                                                                                                                                                                                                                                                                                                                                        str.title() defines a "word" as anything following a non-letter character.
                                                                                                                                                                                                                                                                                                                                                                                                                                                        Since ' isn't a letter, the t in "don't" gets capitalized.

                                                                                                                                                                                                                                                                                                                                                                                                                                                        For most cases, capwords() from the string module is a better choice.

                                                                                                                                                                                                                                                                                                                                                                                                                                                        🧵 (1/2)

                                                                                                                                                                                                                                                                                                                                                                                                                                                          [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                          @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                          “Self-concatenation is useful for making strings that contain the same character or the same sequence of characters a specific number of times.”

                                                                                                                                                                                                                                                                                                                                                                                                                                                          Read more 👉 pym.dev/self-concatenation/

                                                                                                                                                                                                                                                                                                                                                                                                                                                            [?]Hugo van Kemenade » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                            @hugovk@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                            @skjaeve You're in luck when you upgrade to 3.13!

                                                                                                                                                                                                                                                                                                                                                                                                                                                            A better interactive interpreter
                                                                                                                                                                                                                                                                                                                                                                                                                                                            ...
                                                                                                                                                                                                                                                                                                                                                                                                                                                            * Direct support for REPL-specific commands like help, exit, and quit, without the need to call them as functions.

                                                                                                                                                                                                                                                                                                                                                                                                                                                            docs.python.org/3.13/whatsnew/

                                                                                                                                                                                                                                                                                                                                                                                                                                                              [?]Hugo van Kemenade » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @hugovk@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                              🐍🚀 Out now: Humanize 4.16!

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Add Latvian language localization
                                                                                                                                                                                                                                                                                                                                                                                                                                                              Add i18n support for naturalsize() and French translation

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Performance improvements: 1.07x - 8.4x
                                                                                                                                                                                                                                                                                                                                                                                                                                                              Lazy imports for Python 3.15+
                                                                                                                                                                                                                                                                                                                                                                                                                                                              Drop experimental Python 3.13 free-threaded
                                                                                                                                                                                                                                                                                                                                                                                                                                                              Refactor: simplify scientific() and extract _SUPERSCRIPT_MAP constant

                                                                                                                                                                                                                                                                                                                                                                                                                                                              And seven assorted bug fixes!

                                                                                                                                                                                                                                                                                                                                                                                                                                                              github.com/python-humanize/hum

                                                                                                                                                                                                                                                                                                                                                                                                                                                                Wallace boosted

                                                                                                                                                                                                                                                                                                                                                                                                                                                                [?]Feoh [He/Him] » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                @feoh@oldbytes.space

                                                                                                                                                                                                                                                                                                                                                                                                                                                                My wife pointed out that I tend to be REALLY LOUD when I'm on a zoom/Meet call for work.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                I realized she's right, so I built a tool called "Inside Voice" that beeps at me if my microphone's audio gets louder than an adjustable threshold.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                I'm pretty happy with it!

                                                                                                                                                                                                                                                                                                                                                                                                                                                                github.com/feoh/inside-voice

                                                                                                                                                                                                                                                                                                                                                                                                                                                                  [?]Hugo van Kemenade » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                  @hugovk@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                  🚀 It's out!

                                                                                                                                                                                                                                                                                                                                                                                                                                                                  🥧 Please install and enjoy Python 3.14!

                                                                                                                                                                                                                                                                                                                                                                                                                                                                  discuss.python.org/t/python-3-

                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Two snakes enjoying a pie with 3.14 on the top and π crimping.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Alt...Two snakes enjoying a pie with 3.14 on the top and π crimping.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                    [?]Hugo van Kemenade » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                    @hugovk@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                    🐍🚀 Out now: pylast 7.1.0!

                                                                                                                                                                                                                                                                                                                                                                                                                                                                    pylast is a Python interface to Last.fm and Libre.fm

                                                                                                                                                                                                                                                                                                                                                                                                                                                                    🎹 Replace HTTPX with HTTPX2
                                                                                                                                                                                                                                                                                                                                                                                                                                                                    🎶 Remove legacy Python 2 code
                                                                                                                                                                                                                                                                                                                                                                                                                                                                    🪇 And five bug fixes

                                                                                                                                                                                                                                                                                                                                                                                                                                                                    github.com/pylast/pylast/relea

                                                                                                                                                                                                                                                                                                                                                                                                                                                                      [?]Hugo van Kemenade » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                      @hugovk@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Forget* about Python 3.14, all the cool kids are trying out Python 3.15.0 alpha 1 (but not on production)! 🚀

                                                                                                                                                                                                                                                                                                                                                                                                                                                                      🔬 PEP 799: A dedicated profiling package for Python profiling tools
                                                                                                                                                                                                                                                                                                                                                                                                                                                                      💬 PEP 686: Python now uses UTF-8 as the default encoding
                                                                                                                                                                                                                                                                                                                                                                                                                                                                      🌊 PEP 782: A new PyBytesWriter C API to create a Python bytes object
                                                                                                                                                                                                                                                                                                                                                                                                                                                                      ⚠️ Better error messages

                                                                                                                                                                                                                                                                                                                                                                                                                                                                      discuss.python.org/t/python-3-

                                                                                                                                                                                                                                                                                                                                                                                                                                                                      * Please don't forget about 3.14...

                                                                                                                                                                                                                                                                                                                                                                                                                                                                        [?]Hugo van Kemenade » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        @hugovk@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                        [?]Hugo van Kemenade » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        @hugovk@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Just released! 🚀

                                                                                                                                                                                                                                                                                                                                                                                                                                                                        📜 Python Docs Sphinx Theme, with added Arabic, French, Romanian and Russian translations.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                        github.com/python/python-docs-

                                                                                                                                                                                                                                                                                                                                                                                                                                                                          [?]Hugo van Kemenade » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          @hugovk@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Just released! 🚀

                                                                                                                                                                                                                                                                                                                                                                                                                                                                          🎨 termcolor 3.2.0

                                                                                                                                                                                                                                                                                                                                                                                                                                                                          github.com/termcolor/termcolor

                                                                                                                                                                                                                                                                                                                                                                                                                                                                          🟣 Expose `can_colorize` as public API
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          🟢 Add support for Python 3.15 (🥉 at pyreadiness.org/3.15/)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          🔴 Drop support for EOLish Python 3.9

                                                                                                                                                                                                                                                                                                                                                                                                                                                                            [?]Hugo van Kemenade » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                            @hugovk@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Out now: pepotron 1.6.0, with the new Python 3.16 schedule:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ❯ pep 3.16
                                                                                                                                                                                                                                                                                                                                                                                                                                                                            peps.python.org/pep-0826/

                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ❯ pep 8
                                                                                                                                                                                                                                                                                                                                                                                                                                                                            peps.python.org/pep-0008/

                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ❯ pep lazy
                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Score Result
                                                                                                                                                                                                                                                                                                                                                                                                                                                                            90 PEP 810: Explicit lazy imports
                                                                                                                                                                                                                                                                                                                                                                                                                                                                            73 PEP 690: Lazy Imports
                                                                                                                                                                                                                                                                                                                                                                                                                                                                            68 PEP 217: Display Hook for Interactive Use
                                                                                                                                                                                                                                                                                                                                                                                                                                                                            68 PEP 802: Display Syntax for the Empty Set
                                                                                                                                                                                                                                                                                                                                                                                                                                                                            57 PEP 227: Statically Nested Scopes

                                                                                                                                                                                                                                                                                                                                                                                                                                                                            peps.python.org/pep-0810/

                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ❯ uvx pepotron 3.16
                                                                                                                                                                                                                                                                                                                                                                                                                                                                            peps.python.org/pep-0826/

                                                                                                                                                                                                                                                                                                                                                                                                                                                                            mastodon.social/@peps@feedsin.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                              [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                              @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Python Tip #180 (of 365):

                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Zero-pad numbers with f-strings.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Need to format a time like "9:05" instead of "9:5"?

                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Use "02d" in your f-string format spec.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Without zero-padding:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                              >>> hour, minute = 9, 5
                                                                                                                                                                                                                                                                                                                                                                                                                                                                              >>> f"{hour}:{minute}"
                                                                                                                                                                                                                                                                                                                                                                                                                                                                              '9:5'

                                                                                                                                                                                                                                                                                                                                                                                                                                                                              With zero-padding on the minutes:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                              >>> f"{hour}:{minute:02d}"
                                                                                                                                                                                                                                                                                                                                                                                                                                                                              '9:05'

                                                                                                                                                                                                                                                                                                                                                                                                                                                                              The "02d" format spec pads the number with zeros until it's 2 digits long. 0 means "zero pad", 2 is the minimum width, and "d" means integer.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                              🧵 (1/2)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                “The get method is the classic way to look up a value for a dictionary key without raising an exception for missing keys.”

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Read more 👉 pym.dev/default-dictionary-val

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  [?]Python Software Foundation » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  @ThePSF@fosstodon.org

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Big news for the packaging world: The inaugural Python Packaging Council election is coming up soon! The council will be the technical decision-making body for Python packaging specs, coordinating across tools, teams, and the wider community. Learn more on the PSF blog:
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  pyfound.blogspot.com/2026/06/p

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    [?]yossarian » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    @yossarian@infosec.exchange

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    [?]Hugo van Kemenade » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    @hugovk@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    [?]Anthony » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    @anthony@indieweb.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    RE: social.breizhcamp.org/@pythonr

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Mercredi soir, c'est la dernière session de de la saison. On y parlera majoritairement de donc ça peut vous intéresser même si vous ne faîtes pas de .

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    - Plaidoyer pour un monde sans par Jonathan Leger.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    - SQL avancé (via ORM ) par moi même.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Il reste des places et la météo sera agréable. Inscription sur meetup.com/python-rennes/event.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Merci Liksi pour l'accueil !

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    [?]Python Rennes » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    @pythonrennes@social.breizhcamp.org

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    🐍📣 la prochaine session de aura finalement lieu le mercredi 1er juillet 2026 à 19h chez Liksi (🙏 pour l'accueil) 🎉

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Jonathan Leger questionnera l'utilisation d', @anthony vous parlera de avancé avec @django.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Inscription gratuite mais nécessaire sur meetup.com/python-rennes/event

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      [?]Python Lyon » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      @python_lyon@piaille.fr

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      La 2026 a lieu du 29 octobre au 1e novembre à ☀️

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      > L’appel à sujet est ouvert jusqu’au 31 juillet
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      > L’évènement est gratuit, géré par des bénévoles, et recherche des soutiens financiers

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      ➡️ pycon.fr/2026/fr/

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      @AFPy

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        “Python will be happy with it, but other programmers will probably find it pretty confusing.”

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Read more 👉 pym.dev/unnecessary-parenthese

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Ash_Crow boosted

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Python Tip #179 (of 365):

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Use history & paste mode in the new REPL. 🧵

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          F2 enters history: previous code is shown WITHOUT >>> prompts, so you can copy just the code.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          F3 enters paste mode: Enter won't accidentally run your code block while you're editing it.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          I find history mode (F2) useful for copying code out of the REPL.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          In history mode, you see just the code you typed, without the prompts and output intermixed.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          pym.dev/repl-features/#history

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          🧵 (1/2)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            [?]Adam Johnson :django: :python: » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            @adamchainz@fosstodon.org

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ✍️ New post on using WeakKeyDictionary to store extra per-object data

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Documenting a pattern I’ve used in several places to store extra data without touching the object itself.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            adamj.eu/tech/2026/06/27/pytho

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Python Tip #178 (of 365):

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Hack your Python REPL.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              The REPL in Python 3.14 includes syntax highlighting. It's pretty great!

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              But did you know that you can customize the color scheme it uses?

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              You can also customize other REPL features, like adding your own custom keyboard shortcuts.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              🧵 (1/3)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                [?]Mike Fiedler, Code Gardener » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                @miketheman@hachyderm.io

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                RE: fosstodon.org/@europython/1167

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Very excited to share stories, insights, recommendations at my first @europython

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                I'll also be attending the Packaging and Language Summits, as well as any other opportunities to increase awareness of and initiatives.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Python Tip #177 (of 365):

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Learn your REPL's keyboard shortcuts. 🧵

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  This is especially useful in Python 3.13+ because there are even more useful shortcuts.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  The most useful: Ctrl+P and Ctrl+N navigate between blocks (not lines).

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  There's also:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  • Ctrl+L: clear screen
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  • Ctrl+R: search your history
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  • Alt+Enter: run current block
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  • Ctrl+K: delete from cursor to end of line
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  • Ctrl+Left / Ctrl+Right: jump one word at a time

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  🧵 (1/2)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    [?]Stylus [He/Him/They/Them] » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    @stylus@social.afront.org

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Leveraging Python 3.13+'s improved repl to show a preview of what my RPN calculator will calculate ...

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    _1k switches the calculator into a mode where it shows fractions as repeating decimals.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    It's RPN so in the end, (1 - 2/3) is shown as the repeated decimal 0.3 with a bar over the 3.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    I updated my blog post about using pyrepl in your own programs: emergent.unpythonic.net/017819

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Alt...A screencast of a short session in an RPN calculator. The result of the calculation is shown continuously below the entry area until the user confirms it by hitting enter. This is helpful because the user can edit the line to switch into fraction mode instead of integer mode after realizing it's not giving the result they want.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      [?]Wieferich Prime [he / him] » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      @pikesley@mastodon.me.uk

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      question:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      So I can do this to increment some value:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      ```
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      a += 1
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      ```

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      And I can do this do make a value roll through `0, 1, 2, 0, 1, 2`:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      ```
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      a = (a + 1) % 3
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      ```

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Is there some shorthand which combines these two?

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Python Tip #176 (of 365):

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Customize your REPL with PYTHONSTARTUP. 🧵

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        If you set the PYTHONSTARTUP environment variable to point to a file containing Python code:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        export PYTHONSTARTUP=~/.pythonstartup.py

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Python will run that file at the start of each new Python REPL.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        For example, ~/.pythonstartup.py might contain:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        from pprint import pp
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        from pathlib import Path

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Now those are available in each new REPL:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        >>> Path.cwd()
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        PosixPath('/home/trey')

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        docs.python.org/3/tutorial/app

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          “All forms of iteration do the same thing in Python.”

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Read more 👉 pym.dev/all-iteration-is-the-s

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            [?]Python Software Foundation » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            @ThePSF@fosstodon.org

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Great coverage from @lwn of the PSF PyPI Safety & Security Engineer @miketheman's talk on Trusted Publishing at Open Source Summit. 36% of @pypi uploads now use Trusted Publishing. Is yours one of them?

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            lwn.net/Articles/1076205/

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              [?]Mike Fiedler, Code Gardener » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              @miketheman@hachyderm.io

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              This is what collaborative, coordinated, responsible disclosure looks like.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              It was a pleasure to work with GitGuardian on this investigation to help protect the global

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              blog.gitguardian.com/hunting-l

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Also serves as a reminder to adopt Trusted Publishing whenever possible!
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              docs.pypi.org/trusted-publishe

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                [?]Julien Palard » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                @mdk@mamot.fr

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Dev depuis 2003, dev Python depuis 2010 (donc je code sans LLM).

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Je suis à l'aise aussi côté réseau, sysadmin, devops, Linux, C, SQL...

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Vrai Full Stack quoi : du métal au CLI, ou du métal à l'API comme tu veux tant qu'il n'y a pas de JS, pas de HTML, pas de CSS (si c'est moi qui fait le front c'est moche).

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Mon CV au cas où ça serve encore : mdk.fr/Julien-Palard.pdf

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Région : Yvelines/Hauts-de-Seine/Paris. TT apprécié.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  [?]Fabien LOISON (FLOZz) » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  @FLOZz@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  🐍 Petit rappel pour les adeptes du fourchelang lyonnais : ce soir il y a un Meetup Python à 19h chez @WanadevDigital

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Au programme : découverte de Doctest, un framework de test atypique.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Info et inscription :

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  ➡️ meetup.com/fr-fr/python-afpy-l

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Python Tip #175 (of 365):

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Pass "-i" to to drop into a REPL after your script runs.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    $ python -i fibonacci.‍py
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    >>> nth_fibonacci(10)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    55

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    You'll have access to everything the script defined.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Passing "-i" is like pasting your script into a REPL.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    After the script runs, you're dropped into an interactive session with all variables still in scope, even if the script crashed.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    It's handy for debugging: run your script, inspect what's in scope, and figure out what went wrong.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      [?]Kushal Das :python: :tor: 🇸🇪 » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      @kushal@toots.dgplug.org

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Released a new version of my library for written in pypi.org/project/pyuppsala/

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        “You can (unofficially) customize the Python REPL syntax highlighting as well.”

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Read more 👉 pym.dev/repl-features/

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          [?]Hugo van Kemenade » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          @hugovk@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          "Dependabot no longer supports Python version 3.9, which has reached its end-of-life. If you continue to use Python 3.9, there’s a risk that Dependabot will not create pull requests to update dependencies. If this affects you, please update to a supported release of Python."

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          github.blog/changelog/2026-06-

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            [?]Python Software Foundation » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            @ThePSF@fosstodon.org

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Ever wonder how Python's grammar actually fits together? PSF CPython Developer in Residence @encukou is presenting a full railroad diagram of 's entire grammar in the poster session at @europython 2026 on July 16- make sure to check it out! ep2026.europython.eu/session/p

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Python Tip #174 (of 365):

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Python modules are cached.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              The first time each Python process imports a module, it caches it in sys.modules.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              The second time you import the same module, Python returns the cached module object without re-running the module code.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              This means if you edit a file and then re-import it in the same REPL session, your changes won't appear.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Re-importing a module does not reload it.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              The simplest fix: RESTART PYTHON.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              🧵 (1/2)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                [?]Python Software Foundation » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                @ThePSF@fosstodon.org

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Reminder: The PSF's Strategic Plan full draft is available and we want your feedback! Check out the full draft and tell us: Are these the right goals? Is anything missing?

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                The feedback window closes in a couple of days on June 25, 2026, AoE.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                pyfound.blogspot.com/2026/06/p

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  [?]Seth Larson » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  @sethmlarson@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  RE: fosstodon.org/@ThePSF/11680003

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Completely remediating this report was a massive coordinated team effort and would not be possible without paid security staffing at the PSF. Confirmed remediation in 48 hours from report with extensive follow-up auditing, hardening, and coordinating a third-party audit from Trail of Bits.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Thank you to Alpha-Omega for funding my time and OpenAI for funding the audit through "Patch the Planet".

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Please see the write-up for details.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  [?]Python Software Foundation » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  @ThePSF@fosstodon.org

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  The Python Security Response Team patched an authentication bypass in the python.org release management API in under 48 hours. No evidence of exploitation, all artifacts verified.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Check out the full writeup 👇
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  pyfound.blogspot.com/2026/06/m

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      [?]Python Software Foundation » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      @ThePSF@fosstodon.org

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      The Python Security Response Team patched an authentication bypass in the python.org release management API in under 48 hours. No evidence of exploitation, all artifacts verified.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Check out the full writeup 👇
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      pyfound.blogspot.com/2026/06/m

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        [?]Hugo van Kemenade » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        @hugovk@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        🐍🚀 Out now: Python 3.15 beta 3!

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        💤 Lazy imports!
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        🧊 frozendict builtin!
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        💂 sentinel builtin!
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        📉 Tachyon profiler!
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        🖼️ Frame pointers everywhere!
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        🛅 Unpacking in comprehensions!
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        🗣️ UTF-8 as the default encoding!
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        🆕 Package startup config files!
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ⌨️ TypedDict and TypeForm!
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        🐎 Faster JIT!
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        🎨 More colour!
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        🚌 & more!

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Library maintainer? We *strongly encourage* you to add 3.15 to your CI and test during the beta. And send us those bugs reports!

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        discuss.python.org/t/python-3-

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          [?]Python Software Foundation » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          @ThePSF@fosstodon.org

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          The supplemental June edition of the PSF Board Office Hour is about to begin 🐍 🗒️ 1 PM UTC. We welcome you to join us to share how we can help your community, express your perspectives, and we'd love to receive your questions and feedback about the ongoing strategic planning at the PSF!
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          pyfound.blogspot.com/2025/10/a

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            [?]cle » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            @cleder@hachyderm.io

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            RE: hachyderm.io/@cleder/116796446

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            My for and is now at 60 hooks. 🎉

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Find linters, formatters, security scanners, code quality tools, and more in one place.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Contributions welcome! 🔧

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Languages

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            docker, go, img, js, md, nb, py, ru, sh, sql, tf, toml, ts, yaml

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Frameworks

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            bevy, django, git, k8s, react, sphinx

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ⭐ github.com/cleder/awesome-pre-

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              So the next time you find yourself making a list of lists or flattening a list of lists, try out the comprehension approach.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Read more 👉 trey.io/aeo9fg

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                [?]Mike Fiedler, Code Gardener » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                @miketheman@hachyderm.io

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Look! It's @sethmlarson and I at the !
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                We presented, facilitated, and listened to others.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Python Tip #173 (of 365):

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Use _ to see the previous REPL result.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Say you ran an expression in the REPL and only decided AFTER you ran it that you want to capture the result:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  >>> 2**50
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  1125899906842624

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  This is what the REPL's magical _ variable is for.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  The last result the REPL generated is stored in the _ variable.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  So you can just point a different variable to that value:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  >>> n = _
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  >>> n
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  1125899906842624

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  This week's tips are all about the Python REPL.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    [?]Hugo van Kemenade » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    @hugovk@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Out now: linkotron 0.7!

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    CLI to format links in a shorter format.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    🖇️ Format regular links
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    🔗 Format GHSA links -- thanks @stanfromireland!
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    🖇️ Add support for Python 3.15-3.16
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    🔗 Stop testing experimental 3.13t

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Maybe one day I'll remember how to write reStructuredText links but now I don't need to:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    ❯ linkotron example.com --rst
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Copied! `example.com <example.com>`__

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    github.com/hugovk/linkotron/re

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      [?]Hugo van Kemenade » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      @hugovk@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Out now: PrettyTable 3.18!

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Library to display tabular data in a visually appealing ASCII table format.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Lots of stuff here, including performance improvements, some thanks to improvements in wcwidth dependency.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Add support for:
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Python 3.16
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      reStructuredText tables
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      multiline headers
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      captions in Markdown

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      And more!

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      github.com/prettytable/prettyt

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        [?]Hugo van Kemenade » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        @hugovk@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        🐍🅰️ Out now, Python 3.15 alpha 6!

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        PEP 799: A high-frequency, low-overhead, statistical sampling profiler
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        PEP 798: Unpacking in comprehensions with * and **
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        PEP 686: Python now uses UTF-8 as the default encoding
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        PEP 782: A new PyBytesWriter C API to create a Python bytes object
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        PEP 728: TypedDict with typed extra items
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        The JIT compiler has been significantly upgraded with up to 7-8% speedup

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        🧊 Just two more alphas until the feature freeze! 🧊

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        discuss.python.org/t/python-3-

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          [?]Thayer » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          @Thayer@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ! Senior Engineer, based full stack but leaning to devops/infra. 70/30 would be my ideal split. Fully remote UK only, £63,000 non negotiable sadly, but ~20% pension on top. Closing date: WEDS NOON! So get in touch (thayer@team-prime.com) asap if this might be you.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Org: healthcare, data, ~30 person team. Zero AI currently in place, but some may be implemented very gently/ethically/thoughtfully over the next year, or not!

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Would esp suit someone who prefers chill vs rocket ship.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            [?]Python Software Foundation » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            @ThePSF@fosstodon.org

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Watch PSF PyPI Safety & Security Engineer @miketheman's talk from Open Source Summit NA 2026: Trusted Publishing uses OIDC to generate short-lived tokens from CI/CD. No passwords. No tokens to rotate. No secrets in repos.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            youtube.com/watch?v=i0BWrWdZ3Wg

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              [?]synister 🎃 [[DATA EXPUNGED]] » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              @syn@plasmatrap.com

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              TIL about named escapes: "\N{FIGURE SPACE}" is equivalent to and more self-explanatory than "\u2007"

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                “Dataclasses allow us to create friendly classes while writing less boilerplate code.”

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Read more 👉 pym.dev/friendly-classes/

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Python Tip #172 (of 365):

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Know your object introspection tools

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  When you're in an interactive Python environment remember that these 4 tools can be helpful for introspecting the state of your Python process:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  1. type
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  2. help
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  3. dir
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  4. vars

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  type shows the class of an object (the terms "class" and "type" are synonyms in Python).

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  If you have a mystery object, type can tell you what it is:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  >>> type(letter_counts)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  <class 'collections.Counter'>

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  🧵 (1/4)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    [?]SpookJ 👻 [He/him/they, please] » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    @SnoopJ@hachyderm.io

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    RE: mastodon.social/@coredispatch/

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    If you are interested in the beating hearts of the community (the language core, the PSF, and other things), then reading @coredispatch is well worth your time, it is always informative!

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      [?]Stylus [He/Him/They/Them] » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      @stylus@social.afront.org

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      I blogged what I've learned about using the _pyrepl module in Python 3.14+ to add multiline & colorized input to my own project. emergent.unpythonic.net/017819

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Terminal session showing colorized multi-lineinput. Text not screenreader friendly, so not transcribed.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Alt...Terminal session showing colorized multi-lineinput. Text not screenreader friendly, so not transcribed.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Customize PDB with a ~/.pdbrc file.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        You can make a ~/.pdbrc file to add your own commands to the Python debugger.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        This ISN'T a Python file, so it's a bit tricky to create, but spending a few minutes making one is well worth it.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        At startup, PDB runs commands from a ~/.pdbrc file.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        The handiest thing to put there are custom PDB aliases.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        🧵 (1/4)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          AodeRelay boosted

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          [?]Dendrobatus Azureus » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          @Dendrobatus_Azureus@mastodon.bsd.cafe

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          I was told about this blog site, a couple of weeks ago. There are interesting pages listed here

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          The subjects vary in the manner as seen in the first page (check the screencaps)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ## What I really like about this place, is that it loads blazingly fast

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          I also love the fact that you can use browsers in your,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          * bash
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          * csh
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          * ksh
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          * zsh
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          * sh
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          * fish
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          * without any bloat just like browsing should be, everywhere

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          rldane.space/junited-2026.html

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Thank you @rl_dane

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            AodeRelay boosted

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            [?]Arint - SEO+KI » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            @Arint@arint.info

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            RT @__tinygrad__: Wir leben in einer seltsamen Zeit, in der wir Dinge überhyped, die in wenigen Wochen vergessen sein werden. Linux und Python stammen beide aus dem Jahr 1991. LLVM begann als Forschungsprojekt im Jahr 2000.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            mehr auf Arint.info

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            https://x.com/__tinygrad__/status/2068035229324062804#m

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              [?]Tyrone Slothrop [he/him, they/them] » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              @slothrop@chaos.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              An perhaps?

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              I’m this middle-aged dad from Germany. I have a wonderful partner, 4 kids and a cat.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              I care about society and technology. A retired activist, these days I work at a globocorp doing IT stuff for trains 🚄

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              My interests include baking , stuff, paddling a whitewater , n00bing around with , and , and oh so many books.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              There’s never enough time, and I haven’t been bored in more than a decade.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Python Tip #170 (of 365):

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Use b to set a breakpoint while you're in PDB

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                You can use the b command to set a breakpoint at a certain line of code:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                (Pdb) b 4
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Breakpoint 1 at script.py:4

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                But why...?

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Why not just add another breakpoint() call?

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Well, imagine you've entered PDB via post-mortem debugging (see tip 154 from yesterday).

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                You've realized once you're IN PDB that it would be useful to pause on a particular line.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                The b command makes that easy!

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                🧵 (1/2)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  “You can make a self-documenting expression by putting an = sign at the end of an f-string's replacement field (the part between { and }).”

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Read more 👉 pym.dev/debugging-with-f-strin

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    [?]Arthur Vuillard » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    @arthru@framapiaf.org

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    La communauté Python au Togo @pytogo_org lève des fonds pour offrir des bourses à 100 étudiant·e·s pour participer à la prochaine PyCon Togo.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    J'ai été invité à parler de ma relation à lors d'un stream cet après midi : inv.thepixora.com/watch?v=U1a-

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Et pour donner des sous, c'est là : pycontg.pytogo.org/donate

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      [?]Python Rennes » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      @pythonrennes@social.breizhcamp.org

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      La configuration d'une application Django se fait habituellement via un script Python dont les résultats dépendent de l'environnement d'exécution (variables d'environnement). Ce projet de @adamghill permet de déporter tout ou partie de la configuration dans des fichiers TOML qu'on peut associer à des environnements différents : github.com/adamghill/dj-toml-s

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        [?]Stylus [He/Him/They/Them] » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        @stylus@social.afront.org

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        I just submitted my (first ever!) affirmation of my intention to vote in a PSF election pyfound.blogspot.com/2026/06/p

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Python Tip #169 (of 365):

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Use PDB's post-mortem mode to debug exceptions

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Python script raising an exception and want to drop into an interactive environment RIGHT after the exception occurs?

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Use "python -m pdb your_script.py"

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Using "-m" runs the pdb module as a script.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          When launched like this, PDB enters "post-mortem debugging" mode.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          You'll drop into PDB as soon as your program launches.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          🧵 (1/3)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            [?]Python Software Foundation » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            @ThePSF@fosstodon.org

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            The 2026 PSF Board Elections are coming up soon 🗳️ Whether you share our social media posts, vote, or decide to run, your engagement in the election makes all the difference!

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Check out the timeline on our blog: pyfound.blogspot.com/2026/06/p

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Python Tip #168 (of 365):

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Want to start a proper Python REPL within PDB?

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Run the interact command:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              (Pdb) interact
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              *pdb interact start*
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              >>>

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Before Python 3.13 added support for multi-line Python expressions within PDB, I used interact often.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Launching a Python REPL was essential whenever I needed to run a block of code or even to span one line over multiple lines with code wrapped in braces/brackets/parentheses (thanks to implicit line continuation).

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              🧵 (1/3)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                [?]Paolo Melchiorre » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                @paulox@fosstodon.org

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                My talk from @posetteconf : An Event for Postgres 2026 is now available on YouTube 🎥🐘

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                If you missed it live, you can now watch “PostgreSQL Generated Columns by Example” online.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                I’ve also collected links and additional information on my blog, and I plan to publish the slides there next week ✨

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                youtu.be/wExoyNdua0g

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  [?]Jeff Triplett » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  @webology@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  RE: mastodon.social/@djangonews/11

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Thanks to the support of six of our sponsors, the Django Software Foundation has secured initial funding to support an Executive Director.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  This is the very beginning, and we have a lot of planning and discussions to go, but this is a big step towards hiring an Executive Director.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    “When you find yourself using indexes in Python, ask yourself is there a specialized tool for this task that might avoid indexing and make my code more readable?”

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Read more 👉 pym.dev/avoid-indexes-in-pytho

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Python Tip #167 (of 365):

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      In PDB, prepending a line with ! will force it to be treated as Python code.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      This is especially handy when your expression starts with something that PDB thinks is a debugger command.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      For example, n is a PDB command ("next line"), so if you have a variable named n, typing this won't show its value:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      (Pdb) n

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Instead, use "!n":

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      (Pdb) !n
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      '1'

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      The ! tells PDB to treat n as Python code, not as a PDB command.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        AodeRelay boosted

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        [?]dewomser » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        @dewomser@social.tchncs.de

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Da gibt es so eine LED-Badge in 🔴 oder 🟢 oder 🔵 mit einem programmierbaren LED Feld . Herkunft und Link zum ursprünglichen Bashslript gibts hier.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Das Python GUI hat Dankward, Teilnehner am Wolust gemacht. Ein Fork
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        github.com/dewomser/LED-badge-

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          [?]Python Software Foundation » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          @ThePSF@fosstodon.org

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ICYMI: There’s a new Humble Bundle from No Starch Press with 15 related titles!! Grab ‘Python: the Good Stuff’ for just $36 and a percentage of the proceeds goes to supporting the PSF 💝🐍 humblebundle.com/books/python-

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          5 book covers with "Python: the good stuff" and the No Starch Press logo on a blue background. At the bottom there is a red banner that says "Get  a bundle of books for $36" and the Humble logo.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Alt...5 book covers with "Python: the good stuff" and the No Starch Press logo on a blue background. At the bottom there is a red banner that says "Get a bundle of books for $36" and the Humble logo.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Python Tip #166 (of 365):

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Consider using PDB to debug your code.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Instead of temporary print calls, consider using Python's breakpoint() function to pause your program and drop you into the Python debugger (PDB).

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Here's a tiny example:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            from random import randint

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            breakpoint()

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            answer = randint(0, 1)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            n = input("Guess: 0 or 1? ")

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            🧵 (1/2)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              “What if you wanted to sort by something that wasn't quite the original item?”

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Read more 👉 pym.dev/sorting-in-python/

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Wolf boosted

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                [?]Runtime Arguments » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                @RuntimeArguments@hachyderm.io

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Episode 30 of @RuntimeArguments is live at RuntimeArguments.fm — "Available compute: way more than you need, right up until you need it." Wolf @YesJustWolf leads a deep dive into why almost every program you've ever written has wasted most of the hardware it runs on, while Jim @jammcq brings the infrastructure angle on what happens when one machine genuinely isn't enough. Concurrency and parallelism aren't the same answer — maybe they aren't even the same problem. This episode maps the whole stack from SIMD up through goroutines, async/await, and actor models, takes a hard look at GPU transfer costs (and why Apple Silicon sidesteps them for some kinds of problems), and lands on the one truth that unites everything: shared state is your enemy.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                As always, we want to know what you think:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                feedback@RuntimeArguments.fm

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                buzzsprout.com/2469780/1933340

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  [?]Mark Dominus » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  @mjd@mathstodon.xyz

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  I'm looking for work, please boost!

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  I'm a senior software engineer with 35 years of experience. I've worked across an unusually wide range of domains: mobile game backends, privacy-preserving data platforms, high-throughput COVID testing infrastructure, email and account systems, e-payment processing, job marketplace systems, and bioinformatics. I pick up new domains quickly and have a track record of doing it repeatedly. I understand how to turn business needs into engineering requirements.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  I've worked remotely since the 1990s and can operate with minimal supervision. I don't need hand-holding to find the right problem to solve. Several of my most valued projects were self-directed: I identified the need, built the thing, and shipped it.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Some of the technologies I'm familiar with include: Python, Perl, TypeScript/JavaScript, Haskell, Go, C, Java. Postgres, MySQL, SQLite. Flask, SQLAlchemy. AWS (Lambda, S3, RDS, SQS, EC2). Docker, Git. Github and Gitlab.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  I've also repeatedly picked up new languages and stacks as needed: Haskell for differential privacy research, TypeScript for a 24/7 AWS Lambda system, Flask for my most recent employer. I've become productive with new systems over and over, and I can do it quickly.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  I'm also a published author (Higher-Order Perl, Morgan Kaufmann), longtime blogger, and conference speaker with a reputation for making complex ideas clear.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  My résumé is at plover.com/~mjd/cv/Mark%20Jaso

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  mjd@pobox.com

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Thanks for your attention!

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Wolf boosted

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    [?]David Zaslavsky » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    @diazona@techhub.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    @JallBarret Hardcoding the path like that would break execution of the script in a virtual environment (which is exceedingly common these days), so I wouldn't do that. A better shebang line would be `#!/usr/bin/env python3`, since that will resolve it using PATH, and I believe /usr/bin/env is very standard on POSIX-ish systems.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      [?]Python Rennes » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      @pythonrennes@social.breizhcamp.org

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      pyodide est un portage de l'interpréteur Python en webassembly, qui permet donc de faire tourner du code écrit en Python dans le navigateur, code qui a accès à toute l'API web du navigateur.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Avec l'acceptation de la PEP 783, il est désormais possible de publier sur PyPI des paquets construits pour PyOdide : blog.pyodide.org/posts/314-rel.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Michel Caradec nous avait parlé de PyOdide dans son intervention "Python loin de ton ordinateur" : youtu.be/Dzjjwhx2Amk?list=PLv7

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        [?]Python Lyon » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        @python_lyon@piaille.fr

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Prochain meetup à  : jeudi 25 juin à 19h !

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Rendez-vous à @WanadevDigital où @FLOZz nous parlera de Doctest, un framework de… tests 🐍

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Pour vous inscrire ⬇️
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        meetup.com/fr-fr/python-afpy-l

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Python Tip #165 (of 365):

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          You can make a set of sets by using frozenset.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Sets can only contain hashable objects. And regular sets are NOT hashable:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          >>> groups = {{"a", "b"}, {"c", "d"}}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Traceback (most recent call last):
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ...
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          TypeError: unhashable type: 'set'

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          So you can't make a set-of-sets with regular sets.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          🧵 (1/3)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            [?]Hacker News » 🤖 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            @h4ckernews@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Pyodide 314.0: Python packages can now publish WebAssembly wheels to PyPI

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            blog.pyodide.org/posts/314-rel

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            #314.0

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              [?]Lobsters » 🤖 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              @lobsters@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Python Tip #164 (of 365):

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Thinking in terms of a Venn diagram? You need a set.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Need to find all items in one collection but not another? Intersect two collections? Check what's unique to each?

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Python's sets support set arithmetic using operators:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              >>> a = {1, 2, 3, 4, 7}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              >>> b = {1, 3, 5, 7, 9}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              >>> a | b
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              {1, 2, 3, 4, 5, 7, 9}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              >>> a & b
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              {1, 3, 7}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              >>> a - b
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              {2, 4}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              >>> a ^ b
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              {2, 4, 5, 9}

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              🧵 (1/2)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                [?]Hugo van Kemenade » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                @hugovk@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                RE: mastodon.social/@hugovk/116731

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                I wrote about the stuff I got up to during the Sovereign Tech Fellowship pilot last year. Turns out it was a lot! Expect more this year!

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                hugovk.dev/blog/2026/sovereign

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                @sovtechfund

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Erik Moeller boosted

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                [?]Hugo van Kemenade » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                @hugovk@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                RE: mastodon.social/@sovtechfund/1

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                After our successful pilot last year, I'm very excited to not only rejoin the 2026 Sovereign Tech Fellowship, but also that @georgically and @stanfromireland are also joining! Plus looking forward to meeting the other new Fellows!

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                [?]Sovereign Tech Agency » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                @sovtechfund@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                We’re thrilled to announce the 2026 cohort. Welcome to Jan Kowalleck, Philipp Sauberzweig, Pablo Neira Ayuso, @jorisvandenbossche, @yabellini, Denis Cornehl, Jakub Beránek, @matk, @georgically, @stanfromireland, @hugovk, Alexander Ziaee, @elioqoshi and @b0rk

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Meet the 14 maintainers, community managers, and technical writers building and sustaining the critical open source infrastructure we all rely on: sovereign.tech/news/meet-the-2

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Graphic for the Sovereign Tech Fellowship with that wordmark and the tagline “Effective support for essential experts and future contributors in the open source ecosystem” below it. At the bottom is the Sovereign Tech Agency.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Alt...Graphic for the Sovereign Tech Fellowship with that wordmark and the tagline “Effective support for essential experts and future contributors in the open source ecosystem” below it. At the bottom is the Sovereign Tech Agency.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Python Tip #163 (of 365):

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Commit the most important time complexities to memory.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Time complexity is about how your code slows as your data grows (I stole that phrase from @nedbat).

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      You don't need a Computer Science degree to benefit from knowing a handful of common complexities.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      🧵 (1/4)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        “Unlike many programming languages, you can accomplish quite a bit in Python without ever making a class.”

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Read more 👉 pym.dev/when-are-classes-used/

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Python Tip #162 (of 365):

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Avoid modifying a list while you're looping over it.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Adding or removing items while looping over a list can cause clear bugs due to skipped or double-visited items.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          This loop misses -3:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          >>> numbers = [4, -1, -3, 2, -1, 5]
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          >>> for n in numbers:
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ... if n < 0:
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ... numbers.remove(n)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ...
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          >>> numbers
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          [4, -3, 2, 5]

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          🧵 (1/3)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            [?]Seth Larson » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            @sethmlarson@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            @hugovk @georgically @stanfromireland This is absolutely incredible news for the ecosystem and for all ecosystems. The STA Fellowship Program is one of the most exciting things happening right now IMO, I am so happy to see it return after the pilot and to have even more lovely Pythonistas among the ranks of fellows.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Congratulations everyone!

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              [?]Martin Owens :inkscape: :flag_nonbinary: » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              @doctormo@floss.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              One of those "I wonder if I could" not "I wonder if I should" results...

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              A command line sub-pixel renderer (gray scale). Uses 7 sub pixel emoji and 5 semi-shade emoji all in bash.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              A terminal screen showing a greyscale image with visible pixelation. The original image can be seen: it's a cloud of eight red bordered transparent filled ovals arranged in a flower pattern. There is a red gradient pushing from solid red to full transparent from the center to the edges.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Alt...A terminal screen showing a greyscale image with visible pixelation. The original image can be seen: it's a cloud of eight red bordered transparent filled ovals arranged in a flower pattern. There is a red gradient pushing from solid red to full transparent from the center to the edges.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Original vector image: it's a cloud of eight red bordered transparent filled ovals arranged in a flower pattern. There is a red gradient pushing from solid red to full transparent from the center to the edges.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Alt...Original vector image: it's a cloud of eight red bordered transparent filled ovals arranged in a flower pattern. There is a red gradient pushing from solid red to full transparent from the center to the edges.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Djedouas boosted

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                [?]Oslandia » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                @oslandia@fosstodon.org

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                💬 Interested by QGIS Plugin development ? Let's talk during Oslandia's next webinar !

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                👉 "Creating QGIS plugins in 2026 : issues, expectations and concerns!", Tuesday, June 30th at 5pm ( Paris time ).

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Schedule :
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                - An Oslandia QGIS developer shares his experience and vision
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                - quick presentation of useful tools for QGIS development
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                - open discussion to share experiences

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ✍️ Registration is free but mandatory : framaforms.org/webinar-discuss

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Oslandia's webinar on QGIS plugin development, June 30th 5PM ( Paris time )

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Alt...Oslandia's webinar on QGIS plugin development, June 30th 5PM ( Paris time )

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Python Tip #161 (of 365):

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  To flatten an iterable-of-iterables, use chain.from_iterable.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Got a list of lists?

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  >>> groups = [["Hong", "Ryan"], ["Anthony", "Willa"], ["Margaret", "Adrian"]]

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  You could flatten it with a nested comprehension:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  names = [name for group in groups for name in group]

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Or you could use chain.from_iterable:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  from itertools import chain

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  names = list(chain.from_iterable(groups))

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  🧵 (1/4)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    [?]Hugo van Kemenade » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    @hugovk@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Out now: Python 3.14.6 and 3.13.14!

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    A day late to include a last-minute OpenSSL release in the installers. Thanks to @standupmaths for the help with the release notes :)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    discuss.python.org/t/python-3-

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      [?]Hugo van Kemenade » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      @hugovk@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Just released! 🚀

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      🎶 pylast 6.0.0

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      🎤 A Python interface to Last.fm and Libre.fm

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      📯 Restore proxy support (potential breaking change: proxies are now always stored as a dict, before it was a str or dict)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      🪇 Drop support for almost-EOL Python 3.9

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      github.com/pylast/pylast/relea

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        [?]Hugo van Kemenade » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        @hugovk@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Just released! 🚀

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        em-keyboard 5.3.0

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        🎲 Pick a random emoji from a search. For example:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ❯ em --search music --random
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Copied! 👩‍🎤 woman_singer

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        🧛‍♂️ Drop support for Python 3.9

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        github.com/hugovk/em-keyboard/

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          [?]Hugo van Kemenade » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          @hugovk@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Just released! 🚀

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          flake8-implicit-str-concat 0.6.0

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          A Flake8 plugin to identify those unjoined strings that a first Black run leaves behind:
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          "111111111111111111111" "222222222222222222222"

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          I hear there's another big release tomorrow? This release adds support for Python 3.14 and for once code changes were needed due to AST deprecation removals.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Also drop support for almost-very-nearly-EOL Python 3.9.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          github.com/flake8-implicit-str

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            [?]Hugo van Kemenade » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            @hugovk@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            New screencast on stack-like and queue-like operations in Python.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Lists are great for one of these and not so great for the other.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            pym.dev/stacks-and-queues/

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              [?]Marcus Adams » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              @gerowen@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Just posted an updated version of my little frontend to yt-dlp. With this one I'm no longer bundling yt-dlp, but instead it gets downloaded to a config directory. As a result, if there's an update to yt-dlp, I don't have to go updating my software, anybody else who uses it doesn't have to install an update, all they have to do is run the "Component Updater" shortcut in their applications menu and it'll automatically pull down the updated yt-dlp.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              gitlab.com/gerowen/youtube-dl-

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                [?]Python Rennes » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                @pythonrennes@social.breizhcamp.org

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                les outils Python écrits en rust se multiplient : polars, uv, prek, pydantic, pyarrow, etc. À l’aune de cette belle collaboration entre les langages, ce guide "Rust pour les développeur·euses Python" de Microsoft est intéressant. Il explique les rouages de rust pour des personnes ayant les concepts de Python en tête.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                microsoft.github.io/RustTraini

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  [?]Python Software Foundation » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  @ThePSF@fosstodon.org

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  The June edition of the PSF Board Office Hour is about to begin 🐍 🗒️ 9 PM UTC. We welcome you to join us to share how we can help your community, express your perspectives, and we'd love to receive your questions and feedback about the ongoing strategic planning at the PSF!
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  pyfound.blogspot.com/2025/10/a

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Python Tip #160 (of 365):

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Using list.insert(0, ...) in Python? Consider using a deque instead.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Inserting at the beginning of a list is slow because every existing item needs to be shuffled over.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    On my machine, this takes multiple seconds to run:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    numbers = []
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    for n in range(200_000):
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    numbers.insert(0, n)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    There's a better structure than a list for this situation...

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    🧵 (1/3)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      [?]Python Software Foundation » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      @ThePSF@fosstodon.org

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      The June edition of the PSF Board Office Hour is about to begin 🐍 🗒️ 9 PM UTC. We welcome you to join us to share how we can help your community, express your perspectives, and we'd love to receive your questions and feedback about the ongoing strategic planning at the PSF!
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      pyfound.blogspot.com/2025/10/a

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        To remove a prefix or suffix, use the removeprefix or removesuffix methods.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Read more 👉 trey.io/dley4p

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          “Generator expressions also pair nicely with reducer functions.”

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Read more 👉 pym.dev/custom-comprehensions/

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            [?]Python Rennes » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            @pythonrennes@social.breizhcamp.org

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            🐍📣 la prochaine session de aura finalement lieu le mercredi 1er juillet 2026 à 19h chez Liksi (🙏 pour l'accueil) 🎉

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Jonathan Leger questionnera l'utilisation d', @anthony vous parlera de avancé avec @django.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Inscription gratuite mais nécessaire sur meetup.com/python-rennes/event

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            [?]Python Software Foundation » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            @ThePSF@fosstodon.org

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Hear from PSF's @pypi Support Specialist Maria Ashna on what her day-to-day looks like, how she cleared multiple months-long backlogs, and the future of PyPI Orgs in this Behind the Commit episode from Mia Bajić.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ▶️ youtube.com/watch?v=OGIznDrFa2U

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              [?]Karolina Surma » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              @karo@floss.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Aaaand the rebuild of 3.15 in Rawhide is largely done. It was the shortest-lived side tag (i.e. a special pocket in which we brew the whole change) in my memory: we started on June 3rd and got it merged on June 6th.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              A few remarks in 🧵.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Nested functions are possible in Python

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Read more 👉 trey.io/4u4pj0

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  “So the next time you need to split a string into lines, don't use the string split method.”

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Read more 👉 pym.dev/splitlines/

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    [?]Trey Hunner 🐍 » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    @treyhunner@mastodon.social

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Python Tip #159 (of 365):

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    When it comes to modifications, think of lists as stack-like.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    This week's tips are all about lists and data structures.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Regardless of how large your list is, these are both very fast operations:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    items.append("more")

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    last = items.pop()

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Lists are optimized for adding items to the end and removing items from the end.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    🧵 (1/3)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Nicoco boosted

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      [?]mathieui » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      @mathieui@piaille.fr

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Released yesterday, but only got to publish the blogpost and push to pypi today: happy to announce the version 1.16 of slixmpp, the library.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      This release brings two new XEPs into the fold, and has quite a few internal changes as well.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      blog.mathieui.net/slixmpp-1-16

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        [?]Annabelle Wiegart » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        @pyanna@fosstodon.org

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        i'm very excited about joining in september 🏖️ 🌊 djangomed.eu/

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        looking forward to sprinting, meeting experienced contributors and hanging out with the community!

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          [?]Python Software Foundation » 🌐
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          @ThePSF@fosstodon.org

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          🐱 What can cats teach us about open source leadership? A lot, actually.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          PSF Executive Director @baconandcoconut spoke at @NorthBayPython 2026 on staying focused, filtering noise, and not letting the internet knock you off course.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Check it out: youtube.com/watch?v=lHlAY1bLRBs

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Back to top - More...