liese

[ləˈiːs]

Grad student in CS. Monotropic nerd who spends way too much time with computers (and books (and computer books)). Likes space.


posts from @liese tagged #smells like vaporized cancer

also:

  • Python has "implicit namespace packages". The last time I used Python seriously, you had to include __init__.py files at every level of your package hierarchy, or else their containing directories wouldn't be considered packages at all and would be skipped right over.

    PEP 420 (🧐) changed this: if a regular package isn't found during normal package search, but a bare directory was found, then Pything synthesizes a namespace package by that name. In particular, all such matching directories are overlaid into the namespace package. This means that multiple distinct filetrees can contribute to the same package substructure: one filetree can provide package foo.bar, and another can provide foo.baz, as long as neither provides its own foo/__init__.py file.

    I'm not sure if you can nest namespace packages under regular packages -- initial experiments aren't promising. Maybe there's a way to do it I haven't figured out yet?

  • Fields in a C++ class are not zero-initialized by default. I would swear there were certain rules about when variables do get zero-initialized and when they don't, but I can't for the life of me find them. Nonetheless, I thought that all fields of a class would be default-initialized unless an explicit constructor were called on them, but that's apparently just not the case! I did a little experimenting here, and the rules for how initialization intersects with, say, explicit vs. synthesized default constructors are still completely unclear to me. Augh!

  • Freshly-painted underground garages smell strongly of gasoline. Don't breathe this!