[prev in list] [next in list] [prev in thread] [next in thread] 

List:       python-list
Subject:    Re: mutually exclusive arguments to a constructor
From:       Adam Funk <a24061 () ducksburg ! com>
Date:       2011-12-31 20:59:17
Message-ID: 5m94t8x025.ln2 () news ! ducksburg ! com
[Download RAW message or body]

On 2011-12-30, Roy Smith 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".

Actually one problem that can occur in large Java projects is that the
package structure requires some things to have public constructors
(even when you'd rather not do that) so the Factory class in the main
package has access to them.


-- 
English has perfect phonetic spelling. It just doesn't have phonetic
pronunciation.                                        [Peter Moylan]
-- 
http://mail.python.org/mailman/listinfo/python-list
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic