oh god I fucked it up even harder than I thought. I didn't even name it foo.bar
I accidentally had my attributes named .foo.bar
obj..foo.bar
oh god I fucked it up even harder than I thought. I didn't even name it foo.bar
I accidentally had my attributes named .foo.bar
obj..foo.bar
@foone foone.bar
@foone heh, I recently ran into an object storage ORM library that did exactly this. the root object had ".foo.bar" attribute keys for representing the nested objects and then magic functions to compute the lookup key and set/get, rather than properly constructing nested objects. they also injected callback functions and some other weird DI stuff. properly cursed.
@foone I think the point of it was to lazy-construct the objects when accessed but I'm not sure I want to ascribe any kind of logic to the design.
@gsuberland @foone this is the kind of thing I've done when I want a cache or sidecar object with the same lifetime and copy semantics.
I've done munged __private, leading symbol, leading null, non-string, everything.
@gsuberland @foone (I've also got a weakref object identity dictionary I copy occasionally, which does something similar, but it forgets the extra data if the object gets copied.)
@foone dotfiles, but for objects