Re: Strange factory pattern

2010-06-22 Thread Gabriel Genellina
En Tue, 22 Jun 2010 23:33:55 -0300, Zac Burns escribió: 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

Re: Strange factory pattern

2010-06-22 Thread Gerry Reno
This looks like a public class exposing an implementation private class.Jun 22, 2010 10:39:05 PM, zac...@gmail.com wrote: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

Strange factory pattern

2010-06-22 Thread Zac Burns
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(),