FAQ
In the threading module there are several code bits following this
convention:

###
def Class(*args, **kwargs):
return _Class(*args, **kwargs)

class _Class(...
###

This is true for Event, RLock, and others.

Why do this? It seems to violate the rule of least astonishment
(isinstance(Event(), Event) raises an exception). I assume there must be
some trade-off that the designer intended to achieve. So, what is that
trade-off and when should I follow this in my code?

--
Zachary Burns
(407)590-4814
Aim - Zac256FL
Production Engineer
Zindagi Games
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20100622/d6d49320/attachment.html>

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 3 | next ›
Discussion Overview
grouppython-list @
categoriespython
postedJun 23, '10 at 2:33a
activeJun 23, '10 at 5:35a
posts3
users3
websitepython.org

People

Translate

site design / logo © 2022 Grokbase