🇨🇦 tunetardis

  • 0 Posts
  • 24 Comments
Joined 2 months ago
cake
Cake day: June 8th, 2025

help-circle
  • Here in Ontario, I think we have 16 reactors spread across 3 power plants? And more are purportedly on the way.

    The CANDU reactors use heavy water and should, in theory, be safer than light water designs since they can function with unenriched uranium. OTOH the nearest reactor to where I live is in upstate New York and is rather Fukushima-like from what I’ve heard. Also, I don’t know what the new reactors will be, though the provincial gov seems to be pushing SMRs for whatever reason.










  • I think my most common use case is with dictionary lookups.

    if (val := dct.get(key)) is not None:
        # do something with val
    

    I’ve also found some cases where the walrus is useful in something like a list comprehension. I suppose expanding on the above example, you you make one that looks up several keys in a dict and gives you their corresponding values where available.

    vals =  [val for key in (key1, key2, key3) if (val := dct.get(key)) is not None]
    

  • I’m glad you found something that works. I don’t think there is a one size fits all solution to weight gain, but it’s awesome that your approach does not necessitate splurging on diet plans or gym memberships.

    I’ve been losing weight very slowly myself over the past several years since I cancelled my largely ignored gym membership during the pandemic and bought an ebike instead. I commute on it regularly and, while it’s hardly what I would call a vigorous workout, it seems to have flipped the weight curve from slight gain/time to even slighter loss. Like we’re talking a pound/month if that. But I’ll take it!










  • As with most script languages, you can hit the ground running in a very procedural sort of way, as you don’t even have to define a main entry point. You just start coding.

    But Python certainly has an object model. If I’m not mistaken, everything in Python is an object. Like even functions.

    I suppose there are some aspects of the class implementation that feel a little tacked on? Like the way you need to manage the self reference manually where it may be implicitly handled for you in other languages. At least the way you call super() now is a lot less kludgy.

    One thing I miss a bit in Python is method overloading. In a general sense, function overloading is not an OOP feature per se, but I find it useful in OOP, particularly with object initializers. You can sort of achieve it with @functools.singledispatch but it’s pretty janky. For initialization, I prefer keeping the __init__ method pretty rudimentary and writing factory functions to do more complex initializations. And with @dataclass, you can forego writing an __init__ altogether if you do it that way.