Skip Navigation
blog.codingconfessions.com Python Performance: Why 'if not list' is 2x Faster Than Using len()

Discover why 'if not mylist' is twice as fast as 'len(mylist) == 0' by examining CPython's VM instructions and object memory access patterns.

Python Performance: Why 'if not list' is 2x Faster Than Using len()
21
www.hacksoft.io Quick and Sweet Django - Print queryset in a table format, for shell purposes

In this article, we show how to leverage the tabulate Python module, so we can print good-looking querysets in our Django shell.

Quick and Sweet Django - Print queryset in a table format, for shell purposes
0
adamj.eu Django: what’s new in 5.2 - Adam Johnson

Django 5.2 was released last Wednesday, another exciting step forward for our favourite web framework. It comes with a composite of new features, contributed to by many, some of which I am happy to have helped with. Below is my pick of highlights from the release notes.

Django: what’s new in 5.2 - Adam Johnson

Via https://fosstodon.org/@adamchainz/114296390441362261

0
Squashing Django Migrations Easily

Via https://social.jacklinke.com/@jack/113534810333094258

Also see: https://django-model-info.readthedocs.io/en/latest/index.html

0
Python-related happenings for the week of 14 October 2024
  • Let me know if you have things to add!

  • Python-related happenings for the week of 14 October 2024

    Events

    • 14 October
      • CLEpy meetup - via https://fosstodon.org/@clepy/113311328924148486

    Releases

    • 14 October
      • pyparsing 3.2.0 - via https://fosstodon.org/@ptmcg/113302603878074247
    • 15 October
      • eve 2.2 - via https://fosstodon.org/@nicola/113310333550705121
      • pillow 11.0.0 - via https://mastodon.social/@hugovk/113312137194438039 (and https://fosstodon.org/@pillow/113312110767354794)
      • validate-pyproject 0.21 - via https://fosstodon.org/@henryiii/113312246938821428
    2
    How not to change PostgreSQL column type | boringSQL
    notso.boringsql.com How not to change PostgreSQL column type

    Changing PostgreSQL column types can be tricky. Avoid common pitfalls like table rewrites and locks, and follow best practices for safe, efficient migrations with minimal downtime.

    Via https://fosstodon.org/@hunleyd/113205392466307810

    0
    www.mattlayman.com Layman's Guide to Python Built-in Functions · Matt Layman

    This is a plain language guide to every built-in function in Python, paired with a simple example that shows each function in action.

    Layman's Guide to Python Built-in Functions · Matt Layman

    Via https://mastodon.social/@mblayman/113028791455699212

    1
    softwarecrafts.co.uk Using Groups for the staff and superuser flags - Software Crafts

    A prototype for a possibly more aligned authentication system

    Via https://indiehackers.social/@nanorepublica/112909832749194692

    0
    Welcome to c/Python!
  • Hey Ulrik, apologies for not responding sooner.

    I'm more than happy to talk about adding one (or more!) mods for any of the communities I mod for right now, including c/python. I have at least one person in mind, who has been pretty active both in c/python and c/django. I'd also like to talk more about mod expectations, particularly with regard to reported posts/comments.

  • [Accepted] Django Enhancement Proposal 14: Background Workers
  • That's the way I read the proposal, which I definitely like.

  • Looking for feedback/review on my project starter template (DRF + Nuxt + Docker compose)
  • I haven't had a chance to look yet, but I'm using a pretty similar stack at, although with React instead of Nuxt/Vue. I definitely love using Docker, at least as a dev platform, because of the way it evens the field across OS's and makes it easy to onboard new contributors. Will definitely take a closer look when I get more time.

    Buuut ... I do mod the !django@programming.dev community, which you might be interested in checking out. There's also the !docker@programming.dev, which is also worth checking out.

  • Send Web Push Notifications from your own Server
  • Thanks, I appreciate the reply and openness to doing things besides just video.

  • Send Web Push Notifications from your own Server
  • Do you have a written version?

    I really dislike having to watch an entire video to catch the one bit of useful information. I wish I had the time to watch entire videos, but honestly, I don't. On top of that, my brain has often wandered off well before I get to the interesting bit.

  • Fitting logo for the community
  • Love it. Thanks for the improvement!

  • Ford is cutting F-150 Lightning production due to waning demand
  • There's a brake pedal, but it's almost never needed (and if it is, it's always been because of me being stupid). Releasing the accelerator engages the regenerative breaking, up to and including coming to a stop. I love it and don't ever want to go back.

    Having said that, I have had zero problem adapting back to normal breaking in my wife's car (ICE) when I need to drive it for some reason.

    I really don't understand people that complain about the 1-pedal driving.

  • Help trying to extract some data
  • Looking at the docs, it looks like it's an instance of ID3Tags, which appears to be based on couple of helper classes mutagen._util.DictProxy and mutagen._tags.Tags, where DictProxy (and its base DictMixin) provides the dict-like interface. Underneath that, it looks like it's storing the actual values in a simple dict (DictProxy.__dict) and proxying to that.

    I'm not seeing anything obvious that would muck with the incoming lookup key anywhere in ID3Tags or DictProxy.__getitem__ or any of the other base classes.

    I have to jump off to pack for a trip, but might try this out later in a live shell session to see if there's something odd going on with the API.

    In the meantime, OP, are you positive you were looking at the same file each time? Was this in a script or in a live Python shell session?

  • Federated Charging Location Database?
  • Would love it if this happened. Keep us updated if you do something with the idea.

  • Found the ultimate case for framework expansion cards.
  • Looking at the thinkTank website, I think you're talking about the Secure Pocket Rocket model, but I'm not sure.

  • PSA: Fire Your Pharmacy and Find One That Respects and Takes Care of You
  • Anecdata here in the US, but my local mom and pop pharmacy (which I love) currently would lose $200/mo on my vyvanse because of my insurance and the whole generic vyvanse nonsense. This system sucks.

    For the time being, I fill my vyvanse at Walgreens and hope they're losing $200/mo on it. I fill everything else at the mom and pop, until they let me know the situation is better.

  • Hail montage
  • Aaaaaand I'm cleaning the garage this week ...

  • jnovinger Jason Novinger @programming.dev

    Backend (and sometimes frontend) software engineer working on sports data at Elias Sports Bureau.

    Experience with: Python, Django, Typescript/JS, infrastructure, databases

    Find me:

    • Github: github.com/jnovinger
    • Mastodon: https://mastodon.social/@jnovinger
    Posts 282
    Comments 129
    Moderates