mutually exclusive arguments to a constructor

Roy Smith roy at panix.com
Fri Dec 30 18:39:16 EST 2011


In article <mailman.4256.1325288188.27778.python-list at python.org>,
 Chris Angelico <rosuav at gmail.com> wrote:

> On Sat, Dec 31, 2011 at 10:24 AM, Roy Smith <roy at panix.com> wrote:
> > "But!", some C++/Java type bondage addicts might cry, "there's nothing
> > to prevent somebody from creating a DirectionIndicatingThingie directly,
> > bypassing the factory functions.  There's no way to make the constructor
> > private!".  To which the free-willed pythonistas would respond, "If it
> > hurts when you do that, don't do that".
> 
> You know a Python programmer's been at your C++ code when it opens:
> #define class struct

Why stop there?

#define private public



More information about the Python-list mailing list