@nedbat@hachyderm.io
@nedbat@hachyderm.io avatar

nedbat

@nedbat@hachyderm.io

Python, software, coverage.py, typography, juggling, Boston, autism (dad). Laughing at the world doesn't mean I don't take it seriously. He/him.

This profile is from a federated server and may be incomplete. Browse more on the original instance.

nedbat, to random
@nedbat@hachyderm.io avatar

Here's a PDF of the resulting printable schedule, tweaked to avoid the right-hand cutoff: https://static.nedbat.com/PyCon-US-2024.pdf
Four pages, print two-up to get two sheets.

https://mastodon.social/@hugovk/112422128910004621

Kirkman, to Typography
@Kirkman@mastodon.social avatar

One of my favorite road signs in all of Missouri, seen heading west on Interstate 70 in St. Charles County.

I very seldom drive there, but when I do, I love to startle the rest of my family by saying "Look everyone, we're coming up to Bryan ..." then screaming "ROAD!" at the top of my lungs.

I'm not sure why they decided to make "ROAD" uppercase, but I am forever grateful.

nedbat,
@nedbat@hachyderm.io avatar

@Kirkman Den Rd in Stamford CT is "Dr Ned" backwards :)

nedbat, to random
@nedbat@hachyderm.io avatar

I think I am unreasonably pained when I see an expert not able to communicate well with non-experts. Case in point:
N-E: "What's the difference between wifi and bluetooth?"
E: "Well, they use the same frequencies, but wifi is more powerful."

I don't think that gets at the N-E's perspective at all. :(

nedbat, to python
@nedbat@hachyderm.io avatar

Remember that dicts can have tuples as keys! Consider a dict with (x,y) keys instead of nested lists for a grid. It simplifies sparse grids, "resizes" are automatic, it doesn't matter where (0,0) is, and you can use negative positions:

Adding more to the board in flexible ways. https://gist.github.com/nedbat/f22b03f70ceb9686881c4bcd442fad11

nedbat,
@nedbat@hachyderm.io avatar

@freeradical Complex numbers are hashable, and so can be used as dict keys. I never liked that technique though, because it doesn't generalize to more dimensions.

nedbat,
@nedbat@hachyderm.io avatar

@thcrt @glyph If your grid isn't sparse, it could use more memory than other representations.

edrogers, to madisonwi
@edrogers@fosstodon.org avatar

@nedbat Here in #MadisonWI, we were very fortunate to have Sydney Runkle, leading contributor to @pydantic, give a talk at our most recent @madpy meetup. It was a great walk-through of how Pydantic works, and brought out a huge audience of people excited to discuss it

I mention it because she's moving to Boston next week 😢 Wisconsin's loss can be #BostonPython's gain. I highly recommend recruiting her for a talk!

https://madpy.com/meetups/2024/5/9/20240509-mastering-pythonic-data-validation-and-transformation-with-pydantic/

nedbat,
@nedbat@hachyderm.io avatar

@edrogers @pydantic @madpy Thanks for the tip! <3

nedbat, to random
@nedbat@hachyderm.io avatar

People in this thread are suggesting other terms besides "slop", but slop works really well because of the parallel to the existing meaning: food that used to be fit for human consumption, but now is just leftover pieces mixed and mashed indiscriminately so that it's used to feed pigs.

https://fedi.simonwillison.net/@simon/112406874796870923

nedbat, to python
@nedbat@hachyderm.io avatar

You can use Unicode characters in identifiers if they are classified as letter-like, but that doesn't mean that you should!

(Full rules at https://docs.python.org/3/reference/lexical_analysis.html#identifiers)

nedbat,
@nedbat@hachyderm.io avatar

@waltertross It happened to look better in my font. You shouldn't use either!! :D

nedbat,
@nedbat@hachyderm.io avatar

@FriendlyPossum @TheRealPomax It is not possible to say everything important about a function in its name.

nedbat,
@nedbat@hachyderm.io avatar

@TheRealPomax @FriendlyPossum OK, now I understand :D ... satire ...

nedbat, to random
@nedbat@hachyderm.io avatar

Week after next is , and we will of course be juggling there!

https://mstdn.social/@RobLudwick/112390675286786576

nedbat, to python
@nedbat@hachyderm.io avatar

Another sorting tidbit: the key= function can return a tuple. Tuples are sorted lexicographically: by first element and where firsts are equal, by second element, etc.

shac, to python
@shac@ioc.exchange avatar

If 🔥 can fix ’s stupid versioning problems then it wins by default.

nedbat,
@nedbat@hachyderm.io avatar

@rcelectron @shac I'm interested in these sorts of problems. Are you seeing incompatibilities between versions of the language, or restrictions on which version third-party libraries will support?

nedbat,
@nedbat@hachyderm.io avatar

@rcelectron @shac Yes, this can be an issue. Often, the third-party code will run fine on newer versions, but they haven't updated the package metadata to make that clear. It leaves people in a sea of uncertainty.

nedbat,
@nedbat@hachyderm.io avatar

@shac @rcelectron Do you have any details about why? Is it the language or is it third-party dependencies?

nedbat,
@nedbat@hachyderm.io avatar

@shac @rcelectron I'm trying to understand what changes would cause that. The core devs seem to take care to prevent breakage, so I'm trying to see where the theory and the practice are colliding.

nedbat, to python
@nedbat@hachyderm.io avatar

A tidbit: with data in a dict, you can use d.get as a function providing the same mapping. Here we sort the student names by their test scores:

nedbat,
@nedbat@hachyderm.io avatar

@gertvdijk Yup, that works too, or even: sorted(scores, ...) This shows that one list of data can be sorted by the values in a different dictionary.

nedbat, to random
@nedbat@hachyderm.io avatar

I appreciate companies willing to host tech meetups, but do you understand these events are open to the public? "We need your final attendee list a week before the event" doesn't make sense in this context.

nedbat, to random
@nedbat@hachyderm.io avatar

My test suite has just one dot on the last line. What would you do?

  • Delete one test
  • Change the width of the terminal
  • Keep it as a visceral reminder of the uncomfortably chaotic nature of the universe
  • Write more tests
ehmatthes, to random
@ehmatthes@fosstodon.org avatar

Python people, do you make short-lived intermediate variables to make your return statements readable?

For example, which of these would you tend to prefer?

def get_project_name(output_str): """Get project name from output of

nedbat,
@nedbat@hachyderm.io avatar

@ehmatthes I vote for the first, though I'm sure if I scoured my projects, it would come out 50/50 which I've actually done!

nedbat,
@nedbat@hachyderm.io avatar

@ehmatthes No one has answers, it's all chaos!!

nedbat, to random
@nedbat@hachyderm.io avatar
nedbat,
@nedbat@hachyderm.io avatar

@hugovk Maybe I don't know how to read it: It says "darwin" without a version number?

  • All
  • Subscribed
  • Moderated
  • Favorites
  • normalnudes
  • tsrsr
  • DreamBathrooms
  • everett
  • magazineikmin
  • osvaldo12
  • Youngstown
  • InstantRegret
  • slotface
  • ngwrru68w68
  • rosin
  • hgfsjryuu7
  • kavyap
  • PowerRangers
  • Leos
  • thenastyranch
  • Durango
  • cisconetworking
  • ethstaker
  • tacticalgear
  • mdbf
  • khanakhh
  • vwfavf
  • cubers
  • modclub
  • GTA5RPClips
  • tester
  • anitta
  • All magazines