<html><head>

<link media="all" type="text/css" href="/webmail/static/deg/css/wysiwyg-3933289048.css" rel="stylesheet">
</head><body>
This looks like a public class exposing an implementation private class.<br><br><br>Jun 22, 2010 10:39:05 PM, zac256@gmail.com wrote:<br><blockquote style="border-left: 3px solid rgb(102, 153, 204);">In the threading module there are several code bits following this convention:<br><br>###<br>def Class(*args, **kwargs):<br>    return _Class(*args, **kwargs)<br><br>class _Class(...<br>###<br><br>This is true for Event, RLock, and others.<br>
<br>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?<br>
<br>--<br clear="all">Zachary Burns<br>(407)590-4814<br>Aim - Zac256FL<br>Production Engineer<br>Zindagi Games<br>
<br><hr size="1"><br>-- <br>http://mail.python.org/mailman/listinfo/python-list<br></blockquote></body></html>