josh,
@josh@joshthomas.dev avatar

how's your day going? here's mine

webology,
@webology@mastodon.social avatar

@josh Four hours of Cocomelon with a two-year-old is how I started my day. 🍿

josh,
@josh@joshthomas.dev avatar

@webology 🎵 About to do something new, about to something new, I know I can do it, hop skip jump into it 🎵

oliverandrich,
@oliverandrich@fosstodon.org avatar

@webology @josh 4 hours? Sounds tough. I just had to look up what Cocomelon is and clicked on a link to YouTube channel…

webology,
@webology@mastodon.social avatar

@oliverandrich @josh From about 7:15 to 11:30 am. We did a school drop-off and picked up some doughnuts and a cheesecake for Mom's birthday, but that was all less than 30 minutes.

I recommend Netflix because you get all of the season's commercials free.

josh,
@josh@joshthomas.dev avatar

why is one generic type quoted and another not??????

josh,
@josh@joshthomas.dev avatar

It's probably my fault for not reading up more on how the static type checkers work, but man.. Python typing is not intuitive at all. Multiple static type checkers all behave in slightly different ways, and then sometimes you have to quote hints, sometimes not, and, and, and... So many paper cuts start to add up.

onelson,
@onelson@mastodon.social avatar

@josh I think it's even worse when you like types and use other typed langs and then in Python suddenly it's chaos.

josh,
@josh@joshthomas.dev avatar

@onelson Not doing myself any favors with my framework of choice (Django), but even beyond that the ecosystem is so fragmented and obtuse I don’t know how anyone makes any sense of it. Almost feels if you’re not a core dev or working on one of the static type checkers yourself, you’re SOL.

carlton,
@carlton@fosstodon.org avatar

@onelson @josh You're very brave to say it out loud. (I've taken to keeping my thoughts to myself. 😅)

onelson,
@onelson@mastodon.social avatar

@carlton @josh I think this is just what comes from trying to type things after the fact. Trying to express things in a type system that formerly existed only in "protocols," magic methods, (multiple) inheritance, classes of scalars... It's hard. Then add to that the syntax-level inconsistencies 😵‍💫😩

josh,
@josh@joshthomas.dev avatar

I guess I get what I deserve for complaining about django-stubs, after creating a package that dynamically adds fields to a model and trying to figure out how to support type hints for it 😬

carlton,
@carlton@fosstodon.org avatar

@josh Q: so “static typing” for dynamic types? 🤔

josh,
@josh@joshthomas.dev avatar

@carlton Look, I just want the type checker to read my mind and do what I want without me telling it, is that so hard to ask 🤣

josh, (edited )
@josh@joshthomas.dev avatar

@carlton But in all seriousness, it's a field that adds an additional attribute to the model using contribute_to_class -- https://github.com/westerveltco/django-opfield. I'm sure it's possible, I just need to dig in to how django-stubs/django-types adds things like the additional attrs that DateField or ForeignKey adds to a model. (Though TBH with those libraries in practice, I've never been able to feel like I've gotten it nailed down, so maybe it's a fools errand.)

carlton,
@carlton@fosstodon.org avatar

@josh I think it maybe is… I was looking into this for Neapolitan. Tl;dr I refuse to type the Model name ≈4 times in three lines just to make the type checker happy. (I recently turned off editor type checking, and I’m much happier as a result – but that’s another story.) The bottom line was, it needs a mypy plugin to do it properly, so that’s now on the long-list, but it’s not clear whether it’ll ever happen or not.

carlton,
@carlton@fosstodon.org avatar
josh,
@josh@joshthomas.dev avatar

@carlton 🙌🙌🙌🙌🙌

So easy to get caught up in the churn of typing, so hard to stop yourself when it starts to become the problem you are solving instead of the thing you actually should be working on.

Or at least my stubbornness makes it hard to stop - “I will not let this tool get the better of me!” 😅

carlton,
@carlton@fosstodon.org avatar

@josh Sure, I get that. 🤗

I think there’s also a deeper issue though.

I need to phrase this carefully not to upset the Jazz Police[*] but, roughly, I’m increasingly coming to conclude that there’s no way that Python’s typing system will ever evolve to fluently express the most interesting parts of Python – the bits of Python that are why I use it.

[*] Never miss the opportunity for a Leonard Cohen reference 🎶

carlton,
@carlton@fosstodon.org avatar

I.e. If I want and need the double entry bookkeeping, I’m switching to another language, one with an actual compiler, that will do the job properly.

josh,
@josh@joshthomas.dev avatar

@carlton 💯

What’s that saying.. you can’t truly love something (language/framework) till you see all the skeletons in the closet? I don’t think that’s it but you get my drift 😄

I don’t know why I woke up this week and chose pain aka trying to nail down some typing problems that have been a thorn in my side for a while, but I did.

josh,
@josh@joshthomas.dev avatar

@carlton One of the benefits of Python is that it all ultimately doesn’t matter at runtime, as long as you have a robust test suite you trust. I just wish it wasn’t so painful. IMO it’s worse than everyone’s favorite bugbear — packaging.

josh,
@josh@joshthomas.dev avatar

@carlton I also hope this doesn’t come across as complaining about all the hard work that has gone into getting us to where we are now. Lots of people smarter than I am working voluntarily… I admire the hell out of every one of them.

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