@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

Anyone with some Javascript/HTML knowledge want to help me fix what should be a simple problem with the coverage.py HTML report? https://github.com/nedbat/coveragepy/issues/1765

nedbat,
@nedbat@hachyderm.io avatar

@danzin Thanks! This was indeed the problem. I have to validate the whole file, i've been misusing closing tags.

renedudfield, to python
@renedudfield@fosstodon.org avatar

In is there a standard for custom commands? (development scripts/tasks)

Like scripts in package.json with JavaScript or Makefile targets, or custom commands in rust (and alias in rust). For development tasks like format, test, make check... and custom dev scripts.

In python with setup.py you could define custom commands. But now?

Doesn't seem to be a standard for this, just a bunch of separate tools. But I would love to know if I'm missing something for custom commands/scripts.

nedbat,
@nedbat@hachyderm.io avatar

@renedudfield People choose different approaches. Common ones are make, tox, and nox.

nedbat, (edited ) to random
@nedbat@hachyderm.io avatar

Is there a changelog for deadsnakes nightly builds? Looks like 3.11 was just removed. https://launchpad.net/~deadsnakes/+archive/ubuntu/nightly

Is there a way for me to know it's happening other than my GitHub Actions failing?

(update: I asked on the deadsnakes issue tracker: https://github.com/deadsnakes/issues/issues/281)

nedbat,
@nedbat@hachyderm.io avatar

@boxed 3.11 is removed from the nightly builds, not from deadsnakes entirely.

nedbat, to random
@nedbat@hachyderm.io avatar

Be careful with negative assertions in tests!
assert file_doesnt_exist("old_name_for_file") will still be true after you change how files are named and accidentally make the file with the new name.

nedbat, to random
@nedbat@hachyderm.io avatar

Pro-tip (that I should remember): just because you are online doesn't mean you have to defend all of your opinions.

nedbat,
@nedbat@hachyderm.io avatar

@xahteiwi I knew I could count on you! :D

mariatta, to random
@mariatta@fosstodon.org avatar

Dear event organizers, thanks for putting it all together, but please also state:

  • your time zone (and be explicit about "UTC+-???", instead of just "EST")

  • your event hashtag (is it # EventName?, or # EventNameWithYear?)

nedbat,
@nedbat@hachyderm.io avatar

@philip @mariatta I share this pet peeve. People who say EST really mean "Eastern time in effect during the event." I say "Eastern time" to avoid the problem. I'm sure there's an issue with that too.

nedbat,
@nedbat@hachyderm.io avatar

@mariatta @philip Oops, yes, "US Eastern time" ftw.

nedbat,
@nedbat@hachyderm.io avatar

@mariatta @philip BTW, I see "EST" right now on the PyCon site.... :(

nedbat, to random
@nedbat@hachyderm.io avatar

In which I write a blog post simply to record what I learned reverse-engineering my own site's flexbox layout: https://nedbatchelder.com/blog/202404/my_flexbox_layout.html

nedbat, to random
@nedbat@hachyderm.io avatar

Just realized that I wore the same shirt for my 2012 PyCon talk about Unicode and eleven years later for my 2023 PyCon keynote. Not the same kind of shirt. The SAME SHIRT.
Unicode: https://nedbatchelder.com/text/unipain.html
Keynote: https://nedbatchelder.com/text/key23.html

Me in 2012: Unicode

yantor3d, to python
@yantor3d@mograph.social avatar

Currently having an argument in an MR about a function because the code in it is, quote, "not complicated or reused."

nedbat,
@nedbat@hachyderm.io avatar

@yantor3d It's good to give even simple things their own name and space.

hynek, to random
@hynek@mastodon.social avatar

Kent Beck’s pithy “for each desired change, make the change easy (warning: this may be hard), then make the easy change” is so profound & underrated.

nedbat,
@nedbat@hachyderm.io avatar

@hynek I just had this experience: a solid week of refactoring code, then implement the feature. "The feature only needed that few lines!?"

nedbat, to random
@nedbat@hachyderm.io avatar

Coverage.py function coverage reports! Please try it and give feedback:

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

rochacbruno, to python
@rochacbruno@hachyderm.io avatar

It is disappointing that #python TypedDict doesn't support setting default values.

from typing import TypedDict

class Con(TypedDict):  
 host: str  
 port: int = 9090

data = {"host": "test.com"}  
connection = Con(**data)  

I expected it to give me "port": 9090 by default but it does not!

Looks like building the dict as instance of Con doesn't make any difference than just building a {} and that is very confusing.

nedbat,
@nedbat@hachyderm.io avatar

@rochacbruno I don't find TypedDict useful. Try dataclass.

nedbat, to python
@nedbat@hachyderm.io avatar

Do people run unittest suites from inside Jupyter notebooks? Any insights into this as an approach? https://github.com/nedbat/coveragepy/issues/1762

nedbat,
@nedbat@hachyderm.io avatar

@paulzuradzki Would you run coverage with it also?

nedbat, to random
@nedbat@hachyderm.io avatar

Why do I have a directory in my $TMPDIR named ${DaemonNameOrIdentifierHere} ?

loriemerson, to random
@loriemerson@post.lurk.org avatar

"The Computer Girls" from Cosmopolitan Magazine (April 1967). "Now have come the big, dazzling computers--and a whole new kind of work for women: programming. Telling the miracle machines what to do and how to do it...And if it doesn't sound like women's work--well, it just is."

nedbat,
@nedbat@hachyderm.io avatar

@loriemerson My mom was doing this kind of work around this time...!

nedbat, to python
@nedbat@hachyderm.io avatar

Quick packaging tip: if you ever find yourself wanting to type import src.anything or from src import anything, turn back. src should never be part of an import.

nedbat,
@nedbat@hachyderm.io avatar

@elhult yes, i wasn't sure of a clearer way to say it!

nedbat,
@nedbat@hachyderm.io avatar

@moehrenfeld Don't use the word src in an import statement.

nedbat,
@nedbat@hachyderm.io avatar

@moehrenfeld The latter. People use the src layout, but then try to use import src.etc

nedbat,
@nedbat@hachyderm.io avatar

@moehrenfeld @blakeNaccarato I see these mistakes when someone is stuck trying to get something to work, so I'm not sure a linter would be consulted.

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