@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

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

Automatic text truncation is tricky. I got a notification for an event "Presentation night: the pdb debugger", and it replaced "ht: the pdb de" with an ellipsis..!

nedbat, to random
@nedbat@hachyderm.io avatar

The only way to make hold music worse is to occasionally interrupt it to say, "please continue to hold." Oh, right: that's what all hold music does... :(

glyph, to random
@glyph@mastodon.social avatar

I saw someone ask the other day what the kernel panic screen looks like on Apple Silicon, and I realized that I wasn't sure I'd seen a panic at all on my M1; a far cry from my frequent acquaintance with the "You need to restart your computer" screen. Felt good, for a moment, about the improvements to reliability.

Today I achieved a kernel panic by accidentally appending to a BytesIO in Python unit test in a loop. (What this looks like is "full-screen magenta flash for one frame, then reboot.)

nedbat,
@nedbat@hachyderm.io avatar

@vathpela I'm sure people would be willing to help you with the problems you are seeing. This sounds like an extreme exaggeration, or a misunderstanding, but we can help.

nedbat,
@nedbat@hachyderm.io avatar

@vathpela Every month was surely an exaggeration. Python tries very hard to be explicit about its compatibility guarantees which are basically, your code will keep working. There are exceptions, but they are visible and slowly rolled out. Perhaps the problems you had were with third-party libraries? In any case, let us know if you run into problems again.

nedbat, to random
@nedbat@hachyderm.io avatar

This was an interesting large addition to coverage. Please give it a try!

Sponsor me: https://github.com/sponsors/nedbat
Hire me: https://nedbatchelder.com/site/hirened.html

https://hachyderm.io/@coveragepy/112326377899877172

nedbat,
@nedbat@hachyderm.io avatar

@tshirtman It was requested long ago, and there had been a steady stream of people asking for it as well. An overview of functions with low coverage could be an easier way to see where work is needed than to dive into each file separately.

nedbat, to random
@nedbat@hachyderm.io avatar

Just had a great discussion with a senior tech team based on ideas from my PyCon keynote (People, the API User's Guide: https://nedbatchelder.com/text/key23.html). It got me thinking about introverts and extroverts, and how wrong that division is. There aren't two kinds of people. Everyone has places they want to be small, and places they want to be big. Understand your own factors, and find your spaces.

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

@hugovk I also like having the title of the step say "windows" instead of "windows-latest".

nedbat,
@nedbat@hachyderm.io avatar

@hugovk ugh, i just did the latest/13 hack on the cog repo....

nedbat,
@nedbat@hachyderm.io avatar

@hugovk Is there a page that will reliably tell me in the future what versions of Python are available on what versions of macOS?

nedbat,
@nedbat@hachyderm.io avatar

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

nedbat, to random
@nedbat@hachyderm.io avatar

A difficult thing when writing docs: wanting to use English words that have more specific meanings in Python. Like "Values should be in the set returned by all_possibilities()" when all_possibilities returns an iterable, not a set.

nedbat,
@nedbat@hachyderm.io avatar

@slott56 All the good words have been taken!

  • All
  • Subscribed
  • Moderated
  • Favorites
  • megavids
  • rosin
  • mdbf
  • khanakhh
  • tacticalgear
  • modclub
  • DreamBathrooms
  • thenastyranch
  • magazineikmin
  • InstantRegret
  • Youngstown
  • osvaldo12
  • slotface
  • kavyap
  • JUstTest
  • cubers
  • cisconetworking
  • tester
  • anitta
  • ngwrru68w68
  • everett
  • ethstaker
  • Durango
  • normalnudes
  • provamag3
  • Leos
  • GTA5RPClips
  • lostlight
  • All magazines