@slott56@fosstodon.org
@slott56@fosstodon.org avatar

slott56

@slott56@fosstodon.org

Turning coffee into software since 1978. Author of many books. #Python #programmer. Been writing #software since the days when computers were large, expensive, and rare. I've got a pile of books available from Packt Publishing, and some self-published titles on Google Play. I've got some training courses available at LinkedInLearning. I'm a #technomad -- traveling around during hurricane season, and living on a #sailboat the rest of the year.

#DrStrangelove fan.

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

bbelderbos, to random
@bbelderbos@fosstodon.org avatar

Clean code tip: break long functions into smaller ones.

A function should do one thing, adhering to the `Single-responsibility Principle'.

This will make your code more modular and easier to test 🛠️

A hint that a function is doing too many things are inline comments.💡

slott56,
@slott56@fosstodon.org avatar

@bbelderbos

#################

Billboard Comments

another hint to refactor

#################

ucodery, to random
@ucodery@fosstodon.org avatar

Okay #PyconUS, who’s got deets on a whiskey BoF? 🥃👀

slott56,
@slott56@fosstodon.org avatar

@ucodery where? When?

slott56, to random
@slott56@fosstodon.org avatar

#PyConUS here early. Downtown is never F-150 friendly. Found a garage with 6’10” ceilings.

Hoping the hotel valet parking is equally roomy.

All badged up.

Found Nicholas coffee. Found tables in market square park.

Weather (so far) is a delight. Venue looks great.

I was on the program committee and the content looks great.

slott56,
@slott56@fosstodon.org avatar

@treyhunner Thursday night? Opening reception.

Friday Night? https://news.pypgh.org/p/join-us-for-pydata-happy-hour-at

slott56,
@slott56@fosstodon.org avatar

@treyhunner where should I look for you? Booth? Tables?

slott56,
@slott56@fosstodon.org avatar

@treyhunner I was just heading out. Near the entrance doors. You?

slott56,
@slott56@fosstodon.org avatar

@treyhunner https://www.properpittsburgh.com. Retired to an offsite venue.

slott56, to til
@slott56@fosstodon.org avatar

#TIL #nps #NationalPark

The New River is the second oldest river on the planet. I’ve only recently come to understand the real significance of the Appalachians. I was born and raised in and around these mountains, and they were always just — you know — mountains.

They reach back something like 350 million years. Predating dinosaurs? Really?

slott56,
@slott56@fosstodon.org avatar

@travisfw Presumably. Or maybe they were being ironic when they named it?

Local legend is the dumb-as-a-brick Europeans wrote "new river" in their notes, and (somehow) it stuck.

Not believing that. Going with your theory. River. New River.

The French Broad should be the Newer River.

kellogh, to python
@kellogh@hachyderm.io avatar

what's the word when, in #python, the declared types are wrong, so you have to butcher the code with assert statements? dark types?

slott56,
@slott56@fosstodon.org avatar

@kellogh isn’t it a regular old bug? You know, a defect?

slott56,
@slott56@fosstodon.org avatar

@kellogh it’s only visible when the code is viewed through specific tools.

It’s an occulting bug.

slott56, to python
@slott56@fosstodon.org avatar

Hadn't thought this before. But.

>>> a = 2  
>>> a′ = a + 1  
 File "<stdin>", line 1  
 a′ = a + 1  
 ^  
SyntaxError: invalid character '′' (U+2032)  

The Unicode Prime (and Double Prime) should be valid parts of an identifier. Maybe a few others that are widely-used.

>>> a² = a ** 2  
 File "<stdin>", line 1  
 a² = a ** 2  
 ^  
SyntaxError: invalid character '²' (U+00B2)  
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
slott56,
@slott56@fosstodon.org avatar

@nedbat Write a wrapper for pytest that collects the output, counts the characters. While prime, subtract an odd number greater than 1 for the last line of an overflow. When non-prime, pick two factors near the square root (one of which is more than the overflow) and make a rectangle (perhaps with an overflow line.)

I know it sounds complicated, but there are folks willing to let an LLM generate code from this.

slott56, to philosophy
@slott56@fosstodon.org avatar

4/25. Do your MCs have any luck in love?

First, it’s not my strong suit as a writer. Second, it seems a bit tangential for these books. But. It’s a powerful motivator. There are some glorious complications available, also.
I prefer to leave it ambiguous.

mariatta, to random
@mariatta@fosstodon.org avatar

Obvious things conference speakers should do:

  • submit a talk proposal
  • take a photo/selfie
  • write up bio
  • give the talk

Not obvious things conference speakers should do:

  • update email filter so emails from conference organizers don't end up in spam
  • when traveling, plan to arrive at Talk day - 2 days, in case of flight cancellations
  • show up at least 30 minutes before the talk slot, not 5 minutes before
  • use light mode presentation slides (light bg, dark text)

anything else?

slott56,
@slott56@fosstodon.org avatar

@mariatta It helps to remember that people went out of their way to hear you:

  • don’t apologize for anything — we want your words, not apologies.
  • try to avoid talking about things you cut or can’t get to — it’s negativity. If you have more, provide the link to your book or blog — focus on positivity. We’re delighted to get more words.
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.

slott56,
@slott56@fosstodon.org avatar

@nedbat even “collection” is potentially misleading, isn’t it?

simon, to random
@simon@simonwillison.net avatar

I've been contributing to open source projects for 20+ years, and a key goal of those contributions has always been to save other developers time and help them be more productive

I worry that LLMs are going to reduce job opportunities by making people who learn to effectively use them much more productive

I never worried about that for a second with my open source work. These two issues feel very different to me, but I'm having trouble articulating exactly why

slott56,
@slott56@fosstodon.org avatar

@simon is the jury still out on “much more productive?” I’ve seen too many useless answers, wrong answers, and incomplete answers from LLMs. Will more experience alter your perspective?

rachaelspooky, to random
@rachaelspooky@cyberpunk.lol avatar

the Indianapolis police department has launched a new form for people who need them to "deal with" homeless encampments.

i know a lot of you have some really great details to share in skillful ways, so here's the link! Thanks for helping your community!

https://forms.office.com/pages/responsepage.aspx?id=jlBowETTe0mnGssbF9Fr6ELzI725JJRFiNmaoRCJ8D1UOU1VUkxDM0xMTEZEMzQ2WElXNjJCVU5HSy4u&web=1&wdLOR=c9971AD0A-DEC3-4ECF-A5D2-CA22F3250450

slott56,
@slott56@fosstodon.org avatar

@rachaelspooky I told them to fix zoning laws to lower the rents.

driscollis, to python
@driscollis@mastodon.social avatar

Which #Python REPL have you tried?

🐍 IPython
🐍 bpython
🐍 ptpython

Something else?

slott56,
@slott56@fosstodon.org avatar
slott56, to random
@slott56@fosstodon.org avatar

#Monsterdon the credits did not disappoint.

trixter, to random
@trixter@retro.pizza avatar

As someone living in roughly the vicinity of the DC area, i am looking forward to this #Monsterdon

slott56,
@slott56@fosstodon.org avatar

@trixter I used to live in Tyson's Corner. Same feeling.

jane_jordan, to python

Whoever reads my code is gonna cry. I know, someone just told me you can never document too much, but I am doing every. single. line. Forget efficiency. I am making sure I understand it. #python

slott56,
@slott56@fosstodon.org avatar

@jane_jordan documentation has almost no measurable performance cost. Don’t think twice about it.

The labor cost to do maintenance or extension is a much larger cost. And you’re taking steps to prevent problems. It’s basic, sound engineering.

Just don’t write this

A += 1 # increment the A variable by 1.

I can see what it does. I want to know why it matters.

cstross, (edited ) to random
@cstross@wandering.shop avatar

The foundational tenet of "the Cult of Mac" is that buying products from a $3t company makes you a member of an oppressed ethnic minority and therefore every criticism of that corporation is an ethnic slur:

https://pluralistic.net/2024/01/12/youre-holding-it-wrong/#if-dishwashers-were-iphones

This actually says something about cultural continuity because back in 2004, when Apple was a roughly $3Bn (not $Tn) company, it really was a minority pursuit in a sea of Windows, universally oppressed by corporate IT departments! It only shifted after iPhone ...

slott56,
@slott56@fosstodon.org avatar

@cstross is that true of all “branding” and marketing? Or is it unique to Apple because of the scale?

SergKoren, to programming
@SergKoren@writing.exchange avatar

Last evening, I got bored and started implementing FORTH in Python. Don’t ask why. Like I said, I was bored.

#programming #python #forth

slott56,
@slott56@fosstodon.org avatar

@SergKoren did that also. Was generally pleased. I used the FALSE mini-forth as my template. It was fun.

slott56,
@slott56@fosstodon.org avatar

@SergKoren

https://esolangs.org/wiki/FALSE

I spent a bit of time trying to find some list of words that formed a rational forth kernel, around which the rest of a useful dictionary could be defined. No such luck. It appears there are competing thoughts on what could be called foundational.

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