[Python-Dev] PEP 8 and optional underscores

skip at pobox.com skip at pobox.com
Fri Jun 13 18:29:07 CEST 2008


    Nick> Have you looked at what the methods we're proposing to turn into
    Nick> properties are actually doing?:

    Nick>      def getName(self):
    Nick>          assert self.__initialized, "Thread.__init__() not called"
    Nick>          return self.__name
    ...
    Nick> Checking whether or not an Event is set is hardly an expensive
    Nick> operation...

Precisely my point.  The fact that the body of the method does almost
nothing means that the cost of method lookup and function call will likely
be much greater than the actual work being done.

Skip


More information about the Python-Dev mailing list