3 ms·
It's blindingly wrong. It creates a mutable snapshot of the other object. Depending on the size of `a` and how many instances are being wrapped in this way, it
by thesmallestcat 9y ago
It's blindingly wrong. It creates a mutable snapshot of the other object. Depending on the size of `a` and how many instances are being wrapped in this way, it could increase memory footprint substantially. I can't imagine a time where you'd want to do this. This sort of effect is usually achieved by a __getattribute__ that falls back to whichever object(s) are being shadowed. Not that that's ideal, but weird to see somebody who knows Python so well throw out such a useless example.