News for hackers. Stuff that matters.
Re:Performance Analysis of Python's Dict() and {} by pphysch on Monday January 22, 2024 @04:53PM (#39096005)
One place where I prefer dict() is where dicts are used as "nested kwargs", e.g. in Django's ORM for passing default values.

    User.objects.get_or_create(
      username="bob",
      defaults=dict(
        email="[email protected]",
      )
this makes it easy to move fields between `defaults` and `kwargs`. Granted, you could achieve the same isomorphism with ** operator, but less readably IMO.

There are no comments on this comment yet.