Re: mutually exclusive arguments to a constructor

2011-12-31 Thread Adam Funk
On 2011-12-30, Günther Dietrich wrote: > Adam Funk wrote: > >>Suppose I'm creating a class that represents a bearing or azimuth, >>created either from a string of traditional bearing notation >>("N24d30mE") or from a number indicating the angle in degrees as >>usually measured in trigonometry (65

Re: mutually exclusive arguments to a constructor

2011-12-31 Thread Adam Funk
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 p

Re: mutually exclusive arguments to a constructor

2011-12-30 Thread Chris Angelico
On Sat, Dec 31, 2011 at 10:39 AM, Roy Smith wrote: > In article , >  Chris Angelico wrote: > >> You know a Python programmer's been at your C++ code when it opens: >> #define class struct > > Why stop there? > > #define private public Probably yeah, do both. Anyway, life's so much easier when yo

Re: mutually exclusive arguments to a constructor

2011-12-30 Thread Roy Smith
In article , Chris Angelico wrote: > On Sat, Dec 31, 2011 at 10:24 AM, 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

Re: mutually exclusive arguments to a constructor

2011-12-30 Thread Chris Angelico
On Sat, Dec 31, 2011 at 10:24 AM, 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 t

Re: mutually exclusive arguments to a constructor

2011-12-30 Thread Roy Smith
In article , Adam Funk wrote: > (Warning: this question obviously reflects the fact that I am more > accustomed to using Java than Python.) > > Suppose I'm creating a class that represents a bearing or azimuth, > created either from a string of traditional bearing notation > ("N24d30mE") or fro

Re: mutually exclusive arguments to a constructor

2011-12-30 Thread Steven D'Aprano
On Fri, 30 Dec 2011 21:18:29 +, Jason Friedman wrote: > class azimuth: > def __init__(self, bearing, heading): It is conventional, and recommended, to use an initial capital letter for classes. (Yes, Python built-ins violate that rule, and indeed so do some non-built-ins.) See PEP 8 for

Re: mutually exclusive arguments to a constructor

2011-12-30 Thread Steven D'Aprano
On Fri, 30 Dec 2011 20:40:16 +, Adam Funk wrote: > (Warning: this question obviously reflects the fact that I am more > accustomed to using Java than Python.) > > Suppose I'm creating a class that represents a bearing or azimuth, > created either from a string of traditional bearing notation

Re: mutually exclusive arguments to a constructor

2011-12-30 Thread Jason Friedman
> Suppose I'm creating a class that represents a bearing or azimuth, > created either from a string of traditional bearing notation > ("N24d30mE") or from a number indicating the angle in degrees as > usually measured in trigonometry (65.5, measured counter-clockwise > from the x-axis).  The class

Re: mutually exclusive arguments to a constructor

2011-12-30 Thread Arnaud Delobelle
On 30 December 2011 20:40, Adam Funk wrote: > (Warning: this question obviously reflects the fact that I am more > accustomed to using Java than Python.) > > Suppose I'm creating a class that represents a bearing or azimuth, > created either from a string of traditional bearing notation > ("N24d30

Re: mutually exclusive arguments to a constructor

2011-12-30 Thread Mel Wilson
Adam Funk wrote: > (Warning: this question obviously reflects the fact that I am more > accustomed to using Java than Python.) > > Suppose I'm creating a class that represents a bearing or azimuth, > created either from a string of traditional bearing notation > ("N24d30mE") or from a number indi

Re: mutually exclusive arguments to a constructor

2011-12-30 Thread Günther Dietrich
Adam Funk wrote: >Suppose I'm creating a class that represents a bearing or azimuth, >created either from a string of traditional bearing notation >("N24d30mE") or from a number indicating the angle in degrees as >usually measured in trigonometry (65.5, measured counter-clockwise >from the x-axis

mutually exclusive arguments to a constructor

2011-12-30 Thread Adam Funk
(Warning: this question obviously reflects the fact that I am more accustomed to using Java than Python.) Suppose I'm creating a class that represents a bearing or azimuth, created either from a string of traditional bearing notation ("N24d30mE") or from a number indicating the angle in degrees as