@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

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 #Python 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 #Python 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
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?

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