Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

7
  • 6
    A bit like docstrings then ;-) Of course, Python has a handy mode to strip those, -OO, for those few who need it. Commented Aug 27, 2014 at 15:24
  • 19
    The space taken is by far the least important reason this convention stinks. It's a dozen bytes per name (per process). I feel like having wasted my time just reading the part of your answer pertaining to it, that's how unimportant it the space cost. Commented Aug 27, 2014 at 16:20
  • 9
    @delnan I agree about the memory size of the entries being meaningless, i was more thinkin gof the logical/mental space taken up, making introspective debugging and such require more reading and sorting, i would guess. I~LL Commented Aug 27, 2014 at 18:46
  • 3
    Actually, if you were this paranoid about space, you would notice that this saves space, and wastes time. The uninitialized members fall through to use the class value, and therefore there aren't a bunch of copies of the variable name mapped to None (one for each instance). So the cost is a few bytes at the class and the savings is a few bytes per instance. But each failing variable name search costs a tiny bit of time. Commented Aug 27, 2014 at 20:48
  • 3
    If you were worried about 8 bytes you wouldn't be using Python. Commented Apr 30, 2018 at 13:58