Re: Encapsulation, inheritance and polymorphism

2012-08-19 Thread Mark Lawrence
On 19/08/2012 12:50, lipska the kat wrote: On 19/08/12 09:55, Mark Lawrence wrote: On 19/08/2012 06:21, Robert Miles wrote: On 7/23/2012 11:18 AM, Albert van der Horst wrote: In article <5006b48a$0$29978$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: [snip] that functions mus

Re: Encapsulation, inheritance and polymorphism

2012-08-19 Thread lipska the kat
On 19/08/12 09:55, Mark Lawrence wrote: On 19/08/2012 06:21, Robert Miles wrote: On 7/23/2012 11:18 AM, Albert van der Horst wrote: In article <5006b48a$0$29978$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: [snip] that functions must only have one exit? [snip[ Surely the

Re: Encapsulation, inheritance and polymorphism

2012-08-19 Thread Mark Lawrence
On 19/08/2012 06:21, Robert Miles wrote: On 7/23/2012 11:18 AM, Albert van der Horst wrote: In article <5006b48a$0$29978$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: Even with a break, why bother continuing through the body of the function when you already have the result? When

Re: Encapsulation, inheritance and polymorphism

2012-08-18 Thread John Ladasky
On Tuesday, July 17, 2012 12:39:53 PM UTC-7, Mark Lawrence wrote: > I would like to spend more time on this thread, but unfortunately the 44 > ton artic carrying "Java in a Nutshell Volume 1 Part 1 Chapter 1 > Paragraph 1 Sentence 1" has just arrived outside my abode and needs > unloading :-)

Re: Encapsulation, inheritance and polymorphism

2012-08-18 Thread Robert Miles
On 7/23/2012 11:18 AM, Albert van der Horst wrote: In article <5006b48a$0$29978$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: Even with a break, why bother continuing through the body of the function when you already have the result? When your calculation is done, it's done, just

Re: Encapsulation, inheritance and polymorphism

2012-07-23 Thread Albert van der Horst
In article , Erik Max Francis wrote: >Anything's trivial to "write down." Just say "the number such that ..." >and you've written it down. Even "numbers" that aren't really numbers, >such as transfinite cardinals! Now it isn't trivial to write down. It has been proven (of course in an anti-in

Re: Encapsulation, inheritance and polymorphism

2012-07-23 Thread Chris Angelico
On Tue, Jul 24, 2012 at 2:18 AM, Albert van der Horst wrote: > Example from recipee's: > > Stirr until the egg white is stiff. > > Alternative: > Stirr egg white for half an hour, > but if the egg white is stiff keep your spoon still. > > (Cooking is not my field of expertise, so the wording may >

Re: Encapsulation, inheritance and polymorphism

2012-07-23 Thread Albert van der Horst
In article <5006b48a$0$29978$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: Even with a break, why bother continuing through the body of the function >when you already have the result? When your calculation is done, it's >done, just return for goodness sake. You wouldn't write a sear

Re: Encapsulation, inheritance and polymorphism

2012-07-21 Thread Erik Max Francis
On 07/20/2012 03:28 AM, BartC wrote: "Erik Max Francis" wrote in message news:gskdnwoqpkoovztnnz2dnuvz5s2dn...@giganews.com... On 07/20/2012 01:11 AM, Steven D'Aprano wrote: On Thu, 19 Jul 2012 13:50:36 -0500, Tim Chase wrote: I'm reminded of Graham's Number, which is so large that there ar

Re: Encapsulation, inheritance and polymorphism

2012-07-21 Thread Erik Max Francis
On 07/20/2012 02:05 AM, Virgil Stokes wrote: On 20-Jul-2012 10:27, Steven D'Aprano wrote: The fellow looked relived and said "Oh thank god, I thought you said *million*!" How does this relate to the python list? It's also a seriously old joke. -- Erik Max Francis && m...@alcyone.com && http

Re: Encapsulation, inheritance and polymorphism

2012-07-20 Thread Hans Mulder
On 20/07/12 11:05:09, Virgil Stokes wrote: > On 20-Jul-2012 10:27, Steven D'Aprano wrote: >> On Fri, 20 Jul 2012 08:20:57 +1000, Chris Angelico wrote: >> >Since the current evidence indicates the universe will just > keep > expanding, it's more of a "deep freeze death..." H

Re: Encapsulation, inheritance and polymorphism

2012-07-20 Thread BartC
"Erik Max Francis" wrote in message news:gskdnwoqpkoovztnnz2dnuvz5s2dn...@giganews.com... On 07/20/2012 01:11 AM, Steven D'Aprano wrote: On Thu, 19 Jul 2012 13:50:36 -0500, Tim Chase wrote: I'm reminded of Graham's Number, which is so large that there aren't enough molecules in the universe

Re: Encapsulation, inheritance and polymorphism

2012-07-20 Thread Virgil Stokes
On 20-Jul-2012 10:27, Steven D'Aprano wrote: On Fri, 20 Jul 2012 08:20:57 +1000, Chris Angelico wrote: Since the current evidence indicates the universe will just keep expanding, it's more of a "deep freeze death..." Heat death means *lack* of heat. The second law of thermodynamics sta

Re: Encapsulation, inheritance and polymorphism

2012-07-20 Thread Erik Max Francis
On 07/20/2012 01:11 AM, Steven D'Aprano wrote: On Thu, 19 Jul 2012 13:50:36 -0500, Tim Chase wrote: On 07/19/12 13:28, Chris Angelico wrote: On Fri, Jul 20, 2012 at 4:20 AM, Tim Chase wrote: Sure it terminates...If you don't run out of RAM to represent the number "i" in question, there's al

Re: Encapsulation, inheritance and polymorphism

2012-07-20 Thread Mark Lawrence
On 19/07/2012 22:13, Ian Kelly wrote: On Thu, Jul 19, 2012 at 3:01 PM, John Gordon wrote: In Dennis Lee Bieber writes: Sure it terminates...If you don't run out of RAM to represent the number "i" in question, there's also this "heat death of the universe" limit I keep hearing about ;-)

Re: Encapsulation, inheritance and polymorphism

2012-07-20 Thread Steven D'Aprano
On Fri, 20 Jul 2012 08:20:57 +1000, Chris Angelico wrote: >>> Since the current evidence indicates the universe will just keep >>> expanding, it's more of a "deep freeze death..." >> >> Heat death means *lack* of heat. > > The second law of thermodynamics states that energy tends to go from

Re: Encapsulation, inheritance and polymorphism

2012-07-20 Thread Steven D'Aprano
On Thu, 19 Jul 2012 13:50:36 -0500, Tim Chase wrote: > On 07/19/12 13:28, Chris Angelico wrote: >> On Fri, Jul 20, 2012 at 4:20 AM, Tim Chase >> wrote: >>> Sure it terminates...If you don't run out of RAM to represent the >>> number "i" in question, there's also this "heat death of the universe"

Re: Encapsulation, inheritance and polymorphism

2012-07-20 Thread Devin Jeanpierre
On Thu, Jul 19, 2012 at 5:01 PM, John Gordon wrote: >> Since the current evidence indicates the universe will just keep >> expanding, it's more of a "deep freeze death..." > > Heat death means *lack* of heat. But it doesn't mean low temperature! The term is agnostic as to what the temperatu

Re: Encapsulation, inheritance and polymorphism

2012-07-20 Thread Ian Kelly
On Thu, Jul 19, 2012 at 3:01 PM, John Gordon wrote: > In Dennis Lee Bieber > writes: > >> > Sure it terminates...If you don't run out of RAM to represent the >> > number "i" in question, there's also this "heat death of the >> > universe" limit I keep hearing about ;-) >> > >> Since the c

Re: Encapsulation, inheritance and polymorphism

2012-07-20 Thread Steven D'Aprano
On Thu, 19 Jul 2012 09:06:45 -0400, Roy Smith wrote: > Heh. This reminds me of one of my current pet peeves. I've run across > documentation for more than one Python project (django is the one that > comes to mind, but I'm sure there's others) which misuse words like > "set" and "list". They're

Re: Encapsulation, inheritance and polymorphism

2012-07-19 Thread John Gordon
In Chris Angelico writes: > The second law of thermodynamics states that energy tends to go from > higher states to lower, with heat being the very lowest. It's possible > to do work using (say) kinetic energy, and in the process, some of > that energy becomes heat. It's also possible to do wor

Re: Encapsulation, inheritance and polymorphism

2012-07-19 Thread Chris Angelico
On Fri, Jul 20, 2012 at 7:01 AM, John Gordon wrote: > In Dennis Lee Bieber > writes: > >> > Sure it terminates...If you don't run out of RAM to represent the >> > number "i" in question, there's also this "heat death of the >> > universe" limit I keep hearing about ;-) >> > >> Since the c

Re: Encapsulation, inheritance and polymorphism

2012-07-19 Thread OKB (not okblacke)
MRAB wrote: > """Thus spake the Lord: Thou shalt indent with four spaces. No > more, no less. > Four shall be the number of spaces thou shalt indent, and the > number of thy indenting shall be four. Eight shalt thou not indent, > nor either indent thou > two, excepting that thou then proceed to fo

Re: Encapsulation, inheritance and polymorphism

2012-07-19 Thread John Gordon
In Dennis Lee Bieber writes: > > Sure it terminates...If you don't run out of RAM to represent the > > number "i" in question, there's also this "heat death of the > > universe" limit I keep hearing about ;-) > > > Since the current evidence indicates the universe will just keep > expandi

Re: Encapsulation, inheritance and polymorphism

2012-07-19 Thread Tim Chase
On 07/19/12 13:28, Chris Angelico wrote: > On Fri, Jul 20, 2012 at 4:20 AM, Tim Chase > wrote: >> Sure it terminates...If you don't run out of RAM to represent the >> number "i" in question, there's also this "heat death of the >> universe" limit I keep hearing about ;-) > > I'd be more worried a

Re: Encapsulation, inheritance and polymorphism

2012-07-19 Thread Chris Angelico
On Fri, Jul 20, 2012 at 4:20 AM, Tim Chase wrote: > Sure it terminates...If you don't run out of RAM to represent the > number "i" in question, there's also this "heat death of the > universe" limit I keep hearing about ;-) I'd be more worried about the heat death of your computer, it's likely to

Re: Encapsulation, inheritance and polymorphism

2012-07-19 Thread Tim Chase
> If you think that people can routinely detect infinite loops, then > perhaps you would care to tell me whether this is an infinite loop or not: > > i = 1 > while not is_perfect(i): > i += 2 > print "odd perfect number discovered" > > > where is_perfect() returns True if the integer argume

Re: Encapsulation, inheritance and polymorphism

2012-07-19 Thread Paul Rudin
Steven D'Aprano writes: > For example, both ML and Haskell can, under some circumstances, report a > type-error for an infinite loop, *at compile time*. ... and in Charity all programs are guaranteed to terminate. Of course it's not Turing complete.

Re: Encapsulation, inheritance and polymorphism

2012-07-19 Thread rusi
On Jul 19, 1:56 pm, Lipska the Kat wrote: > Academic twiddling with the distorted meaning of words spun by > vested interests is all very interesting I'm sure but doesn't really > advance the discussion does it? Well lets back up the discussion a bit. You coming from a Java background have one vi

Re: Encapsulation, inheritance and polymorphism

2012-07-19 Thread Roy Smith
In article <500804cc$0$29978$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > On Wed, 18 Jul 2012 23:09:13 -0700, rusi wrote: > > > Its not so much a question of language as in programming as language as > > in layman-speak. > > One characteristic with our field is that we take ord

Re: Encapsulation, inheritance and polymorphism

2012-07-19 Thread Steven D'Aprano
On Wed, 18 Jul 2012 23:09:13 -0700, rusi wrote: > Its not so much a question of language as in programming as language as > in layman-speak. > One characteristic with our field is that we take ordinary words and > then distort them so much the original meaning is completely lost. All technical fi

Re: Encapsulation, inheritance and polymorphism

2012-07-19 Thread Lipska the Kat
On 19/07/12 07:09, rusi wrote: On Jul 19, 6:34 am, Steven D'Aprano wrote: On Wed, 18 Jul 2012 15:40:00 +0100, Lipska the Kat wrote: Object Oriented programming is all about encapsulating human concepts in a way that makes sense to human beings. Make no mistake, it is NEVER the case that a soft

Re: Encapsulation, inheritance and polymorphism

2012-07-18 Thread Terry Reedy
On 7/18/2012 10:40 AM, Lipska the Kat wrote: fact ... and I have never been forced to admit that I don't know what I wrote six months ago. That is an explicit objective of Python's design. Python looks like an interesting language and I will certainly spend time getting to know it but at the

Re: Encapsulation, inheritance and polymorphism

2012-07-18 Thread rusi
On Jul 19, 6:34 am, Steven D'Aprano wrote: > On Wed, 18 Jul 2012 15:40:00 +0100, Lipska the Kat wrote: > > Object Oriented programming is all about encapsulating human concepts in > > a way that makes sense to human beings. Make no mistake, it is NEVER the > > case that a software system is writte

Re: Encapsulation, inheritance and polymorphism

2012-07-18 Thread Chris Angelico
On Thu, Jul 19, 2012 at 11:22 AM, Steven D'Aprano wrote: > On Thu, 19 Jul 2012 01:04:50 +1000, Chris Angelico wrote: > >> Python isn't object oriented in the way Java is ("EVERYTHING has to be >> in a class! Look, it's all OO now!"). > > Actually, Python is more object-oriented than Java. In Pytho

Re: Encapsulation, inheritance and polymorphism

2012-07-18 Thread Steven D'Aprano
On Wed, 18 Jul 2012 15:40:00 +0100, Lipska the Kat wrote: [...] >> Even with a break, why bother continuing through the body of the >> function when you already have the result? When your calculation is >> done, it's done, just return for goodness sake. You wouldn't write a >> search that keeps goi

Re: Encapsulation, inheritance and polymorphism

2012-07-18 Thread MRAB
On 19/07/2012 02:14, Steven D'Aprano wrote: On Wed, 18 Jul 2012 15:48:28 +0100, Lipska the Kat wrote: On 18/07/12 15:34, Grant Edwards wrote: Unless you're asking about the tabs vs. spaces argument. In that case, people who use 4 spaces per level are 'correct'; people who use a different nu

Re: Encapsulation, inheritance and polymorphism

2012-07-18 Thread Steven D'Aprano
On Thu, 19 Jul 2012 01:04:50 +1000, Chris Angelico wrote: > Python isn't object oriented in the way Java is ("EVERYTHING has to be > in a class! Look, it's all OO now!"). Actually, Python is more object-oriented than Java. In Python, everything is an object. We have no distinction between boxed

Re: Encapsulation, inheritance and polymorphism

2012-07-18 Thread Steven D'Aprano
On Wed, 18 Jul 2012 12:33:01 -0400, Dave Angel wrote: > On 07/18/2012 08:58 AM, Steven D'Aprano wrote: >> >> For bonus points, can you see the mistake? [...] >> > There are actually two bugs in that function. One is in the assertion, > but more importantly, there's a typo earlier. One that wou

Re: Encapsulation, inheritance and polymorphism

2012-07-18 Thread Steven D'Aprano
On Wed, 18 Jul 2012 15:48:28 +0100, Lipska the Kat wrote: > On 18/07/12 15:34, Grant Edwards wrote: >> Unless you're asking about the tabs vs. spaces argument. In that case, >> people who use 4 spaces per level are 'correct'; people who use a >> different number of spaces are a bit less correct;

Re: Encapsulation, inheritance and polymorphism

2012-07-18 Thread BartC
"Lipska the Kat" wrote in message news:c76dnv778_sw4zvnnz2dnuvz8ukdn...@bt.com... On 18/07/12 01:46, Andrew Cooper wrote: if not (you are permitted to do this): return -EPERM if not (you've given me some valid data): return -EFAULT if not (you've given me some sensible data): r

Re: Encapsulation, inheritance and polymorphism

2012-07-18 Thread Dave Angel
On 07/18/2012 08:58 AM, Steven D'Aprano wrote: > > > > 2) To check your internal reasoning in a function or method. > > For example: > > def foo(something): > n = len(something) > x = math.sqrt(x) > # We expect that x must be less than half of n. > # E.g. n=100 gives 10 < 50, whic

Re: Encapsulation, inheritance and polymorphism

2012-07-18 Thread Lipska the Kat
On 18/07/12 16:32, Ethan Furman wrote: Lipska the Kat wrote: On 18/07/12 14:05, Steven D'Aprano wrote: Even with a break, why bother continuing through the body of the function when you already have the result? When your calculation is done, it's done, just return for goodness sake. You wouldn'

Re: Encapsulation, inheritance and polymorphism

2012-07-18 Thread Lipska the Kat
On 18/07/12 16:09, Chris Angelico wrote: On Thu, Jul 19, 2012 at 12:48 AM, Lipska the Kat wrote: hmm, I've been using tabs ... snip We must meet half way, you know. Seems reasonable to me, I'll let you suggest it ;-) As to tab vs spaces: I'm a fan of tabs, myself. There was an argument

Re: Encapsulation, inheritance and polymorphism

2012-07-18 Thread Ethan Furman
Lipska the Kat wrote: On 18/07/12 14:05, Steven D'Aprano wrote: Even with a break, why bother continuing through the body of the function when you already have the result? When your calculation is done, it's done, just return for goodness sake. You wouldn't write a search that keeps going after

Re: Encapsulation, inheritance and polymorphism

2012-07-18 Thread Chris Angelico
On Thu, Jul 19, 2012 at 12:48 AM, Lipska the Kat wrote: > hmm, I've been using tabs ... still, why use one key press when you can use > 4 ;-). Actually I quite like this aspect of Python, it's rapidly growing on > me. Wonder if I could introduce this in a future release of Java ... nah, > I'd be

Re: Encapsulation, inheritance and polymorphism

2012-07-18 Thread Chris Angelico
On Thu, Jul 19, 2012 at 12:40 AM, Lipska the Kat wrote: > Python looks like an interesting language and I will certainly spend time > getting to know it but at the moment it seems to me that calling it an > Object Oriented language is just plain misleading. Python isn't object oriented in the way

Re: Encapsulation, inheritance and polymorphism

2012-07-18 Thread Andrew Berg
On 7/18/2012 9:34 AM, Grant Edwards wrote: > people who us tabs are wrong Don't make me get my flamethrower! > and people who mix spaces and tabs -- well, we don't > talk about them in polite company. Mixing can make sense, but not in Python. *hides* -- CPython 3.3.0b1 | Windows NT 6.1.7601.1780

Re: Encapsulation, inheritance and polymorphism

2012-07-18 Thread Lipska the Kat
On 18/07/12 15:34, Grant Edwards wrote: On 2012-07-17, Lipska the Kat wrote: and what's this obsession with 'correct' indentation of code ??? If you can explain to us Java's obsession with 'correct' placemnt of curly-braces, then you've explained indentation in python. I'm not getting into

Re: Encapsulation, inheritance and polymorphism

2012-07-18 Thread Lipska the Kat
On 18/07/12 14:05, Steven D'Aprano wrote: On Wed, 18 Jul 2012 01:46:31 +0100, Andrew Cooper wrote: Take for example a Linux system call handler. The general form looks a little like (substituting C for python style pseudocode) if not (you are permitted to do this): return -EPERM if not (

Re: Encapsulation, inheritance and polymorphism

2012-07-18 Thread Grant Edwards
On 2012-07-17, Lipska the Kat wrote: > and what's this obsession with 'correct' indentation of code ??? If you can explain to us Java's obsession with 'correct' placemnt of curly-braces, then you've explained indentation in python. Unless you're asking about the tabs vs. spaces argument. In th

Re: Encapsulation, inheritance and polymorphism

2012-07-18 Thread Steven D'Aprano
On Wed, 18 Jul 2012 09:07:22 -0400, Roy Smith wrote: >> Keep in mind that assertions are not guaranteed to run. Code like the >> above is buggy, because if Python is run under the -O (optimize) flag, >> assertions will be stripped out. > > One could equally say that "code like the above is effici

Re: Encapsulation, inheritance and polymorphism

2012-07-18 Thread Roy Smith
In article <5006b2e2$0$29978$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > On Tue, 17 Jul 2012 09:52:59 -0400, Roy Smith wrote: > > > you could write in Python: > > > > # Type matching will get checked at run-time > > def my_function(mpf, ot): > >assert isinstance(mpf, Mas

Re: Encapsulation, inheritance and polymorphism

2012-07-18 Thread Steven D'Aprano
On Wed, 18 Jul 2012 01:46:31 +0100, Andrew Cooper wrote: > Take for example a Linux system call handler. The general form looks a > little like (substituting C for python style pseudocode) > > if not (you are permitted to do this): > return -EPERM > if not (you've given me some valid data):

Re: Encapsulation, inheritance and polymorphism

2012-07-18 Thread Steven D'Aprano
On Tue, 17 Jul 2012 09:52:59 -0400, Roy Smith wrote: > you could write in Python: > > # Type matching will get checked at run-time > def my_function(mpf, ot): >assert isinstance(mpf, MassivelyParallelFrobinator) >assert isinstance(ot, OtherThing) Keep in mind that assertions are not gu

Re: Encapsulation, inheritance and polymorphism

2012-07-18 Thread Steven D'Aprano
On Tue, 17 Jul 2012 12:01:21 +0100, Lipska the Kat wrote: > For the past 9 years I have been developing in Java [...] > Anyway, I'm looking at Python as a rapid prototyping language. I have an > idea and just want to get it down in basic outline code as quickly as > possible before it departs my a

Re: Encapsulation, inheritance and polymorphism

2012-07-18 Thread Ulrich Eckhardt
Am 18.07.2012 11:06, schrieb Lipska the Kat: On 18/07/12 01:46, Andrew Cooper wrote: Take for example a Linux system call handler. The general form looks a little like (substituting C for python style pseudocode) if not (you are permitted to do this): return -EPERM if not (you've given me

Re: Encapsulation, inheritance and polymorphism

2012-07-18 Thread Arnaud Delobelle
On 17 July 2012 13:01, Lipska the Kat wrote: > Well I've set myself a task. > I have a text file containing a list of stock items > each line contains the number in stock followed by a tab followed by the > name of the item. I need to implement something that reads in the text file > and outputs

Re: Encapsulation, inheritance and polymorphism

2012-07-18 Thread Lipska the Kat
On 18/07/12 01:46, Andrew Cooper wrote: On 17/07/2012 19:36, Lipska the Kat wrote: On 17/07/12 19:18, Mark Lawrence wrote: On 17/07/2012 18:29, Ethan Furman wrote: Terry Reedy wrote: On 7/17/2012 10:23 AM, Lipska the Kat wrote: snip Take for example a Linux system call handler. The gen

Re: Encapsulation, inheritance and polymorphism

2012-07-18 Thread Larry Hudson
On 07/17/2012 04:24 AM, Lipska the Kat wrote: ... Thanks for your time and I'll try to do a bit better with the reading thing before asking more questions... not sure about this obsession with code indentation though :-| I think it's inaccurate to call this indentation an obsession, it's part

Re: Encapsulation, inheritance and polymorphism

2012-07-17 Thread rusi
On Jul 18, 5:46 am, Andrew Cooper wrote: > On 17/07/2012 19:36, Lipska the Kat wrote: > > > > > > > > > > > On 17/07/12 19:18, Mark Lawrence wrote: > >> On 17/07/2012 18:29, Ethan Furman wrote: > >>> Terry Reedy wrote: > On 7/17/2012 10:23 AM, Lipska the Kat wrote: > > > Well 'type-bondag

Re: Encapsulation, inheritance and polymorphism

2012-07-17 Thread Andrew Cooper
On 17/07/2012 19:36, Lipska the Kat wrote: > On 17/07/12 19:18, Mark Lawrence wrote: >> On 17/07/2012 18:29, Ethan Furman wrote: >>> Terry Reedy wrote: On 7/17/2012 10:23 AM, Lipska the Kat wrote: > Well 'type-bondage' is a strange way of thinking about compile time > type > c

Re: Encapsulation, inheritance and polymorphism

2012-07-17 Thread Lipska the Kat
On 17/07/12 20:39, Mark Lawrence wrote: On 17/07/2012 20:29, Lipska the Kat wrote: On 17/07/12 18:07, Terry Reedy wrote: On 7/17/2012 10:23 AM, Lipska the Kat wrote: snip How easy was it to write max, or a universal sort in Java? Well java.lang.Math.max() (or min() depending on what you

Re: Encapsulation, inheritance and polymorphism

2012-07-17 Thread Ian
On 17/07/2012 19:43, Ethan Furman wrote: Mark Lawrence wrote: On 17/07/2012 18:29, Ethan Furman wrote: Terry Reedy wrote: On 7/17/2012 10:23 AM, Lipska the Kat wrote: Well 'type-bondage' is a strange way of thinking about compile time type checking and making code easier to read (and theref

Re: Encapsulation, inheritance and polymorphism

2012-07-17 Thread Mark Lawrence
On 17/07/2012 20:29, Lipska the Kat wrote: On 17/07/12 18:07, Terry Reedy wrote: On 7/17/2012 10:23 AM, Lipska the Kat wrote: Well 'type-bondage' is a strange way of thinking about compile time type checking and making code easier to read (and therefor debug snip How easy was it to writ

Re: Encapsulation, inheritance and polymorphism

2012-07-17 Thread Mark Lawrence
On 17/07/2012 19:43, Ethan Furman wrote: Mark Lawrence wrote: On 17/07/2012 18:29, Ethan Furman wrote: Terry Reedy wrote: On 7/17/2012 10:23 AM, Lipska the Kat wrote: Well 'type-bondage' is a strange way of thinking about compile time type checking and making code easier to read (and therefo

Re: Encapsulation, inheritance and polymorphism

2012-07-17 Thread Lipska the Kat
On 17/07/12 18:07, Terry Reedy wrote: On 7/17/2012 10:23 AM, Lipska the Kat wrote: Well 'type-bondage' is a strange way of thinking about compile time type checking and making code easier to read (and therefor debug snip How easy was it to write max, or a universal sort in Java? Well ja

Re: Encapsulation, inheritance and polymorphism

2012-07-17 Thread Devin Jeanpierre
On Tue, Jul 17, 2012 at 1:07 PM, Terry Reedy wrote: > 'type-bondage' is the requirement to restrict function inputs and output to > one declared type, where the type declaration mechanisms are usually quite > limited. This is interesting, I hadn't expected that sort of definition. So Haskell is n

Re: Encapsulation, inheritance and polymorphism

2012-07-17 Thread Lipska the Kat
On 17/07/12 19:18, Mark Lawrence wrote: On 17/07/2012 18:29, Ethan Furman wrote: Terry Reedy wrote: On 7/17/2012 10:23 AM, Lipska the Kat wrote: Well 'type-bondage' is a strange way of thinking about compile time type checking and making code easier to read (and therefor debug 'type-bondage

Re: Encapsulation, inheritance and polymorphism

2012-07-17 Thread Ethan Furman
Mark Lawrence wrote: On 17/07/2012 18:29, Ethan Furman wrote: Terry Reedy wrote: On 7/17/2012 10:23 AM, Lipska the Kat wrote: Well 'type-bondage' is a strange way of thinking about compile time type checking and making code easier to read (and therefor debug 'type-bondage' is the requireme

Re: Encapsulation, inheritance and polymorphism

2012-07-17 Thread Lipska the Kat
On 17/07/12 18:24, Terry Reedy wrote: On 7/17/2012 8:01 AM, Lipska the Kat wrote: On 17/07/12 09:45, Lipska the Kat wrote: Pythoners Python 2.7.3 Ubuntu Linux 12.04 LTS I've been taking a brief look at Python. snip >> Well I've set myself a task. I have a text file containing a list of s

Re: Encapsulation, inheritance and polymorphism

2012-07-17 Thread Mark Lawrence
On 17/07/2012 18:29, Ethan Furman wrote: Terry Reedy wrote: On 7/17/2012 10:23 AM, Lipska the Kat wrote: Well 'type-bondage' is a strange way of thinking about compile time type checking and making code easier to read (and therefor debug 'type-bondage' is the requirement to restrict function

Re: Encapsulation, inheritance and polymorphism

2012-07-17 Thread Tim Chase
On 07/17/12 12:29, Ethan Furman wrote: > Terry Reedy wrote: >> On 7/17/2012 10:23 AM, Lipska the Kat wrote: >> >>> Well 'type-bondage' is a strange way of thinking about compile time type >>> checking and making code easier to read (and therefor debug >> >> 'type-bondage' is the requirement to rest

Re: Encapsulation, inheritance and polymorphism

2012-07-17 Thread Chris Angelico
On Wed, Jul 18, 2012 at 12:23 AM, Lipska the Kat wrote: > Well 'type-bondage' is a strange way of thinking about compile time type > checking and making code easier to read (and therefor debug) but > I'm not about to get into some religious war about declaring a variables > type. There are option

Re: Encapsulation, inheritance and polymorphism

2012-07-17 Thread Andrew Berg
On 7/17/2012 12:30 PM, Terry Reedy wrote: > (In some ways, it is already better than 3.2.3.) I certainly make heavy use of some of the new features. I'm not sure we can have enough separate exceptions for OS errors without exhausting every possibility and I might start looking for excuses to use th

Re: Encapsulation, inheritance and polymorphism

2012-07-17 Thread Tim Chase
On 07/17/12 12:24, Terry Reedy wrote: > On 7/17/2012 8:01 AM, Lipska the Kat wrote: >> In bash this is laughably trivial >> >> sort -nr $1 | head -${2:-10} > > Won't sort work alphabetically and leave the following as is? > > 1\talpha > 11\tbeta > 2\tgamma Only if Lipska had omitted the "-n" whi

Re: Encapsulation, inheritance and polymorphism

2012-07-17 Thread MRAB
On 17/07/2012 18:24, Terry Reedy wrote: On 7/17/2012 8:01 AM, Lipska the Kat wrote: On 17/07/12 09:45, Lipska the Kat wrote: Pythoners Python 2.7.3 Ubuntu Linux 12.04 LTS I've been taking a brief look at Python. snip Well I've set myself a task. I have a text file containing a list of sto

Re: Encapsulation, inheritance and polymorphism

2012-07-17 Thread Ethan Furman
Terry Reedy wrote: On 7/17/2012 10:23 AM, Lipska the Kat wrote: Well 'type-bondage' is a strange way of thinking about compile time type checking and making code easier to read (and therefor debug 'type-bondage' is the requirement to restrict function inputs and output to one declared type,

Re: Encapsulation, inheritance and polymorphism

2012-07-17 Thread Terry Reedy
On 7/17/2012 10:16 AM, Andrew Berg wrote: On 7/17/2012 9:01 AM, Lipska the Kat wrote: Wow, that was a blast from the past Just downloaded, unzipped, untarred, configured, made and installed python 3.2.3 ... it's YEARS since I've done this, makes me feel young again. Most Linux distributions s

Re: Encapsulation, inheritance and polymorphism

2012-07-17 Thread Terry Reedy
On 7/17/2012 8:01 AM, Lipska the Kat wrote: On 17/07/12 09:45, Lipska the Kat wrote: Pythoners Python 2.7.3 Ubuntu Linux 12.04 LTS I've been taking a brief look at Python. snip Well I've set myself a task. I have a text file containing a list of stock items each line contains the number in

Re: Encapsulation, inheritance and polymorphism

2012-07-17 Thread Terry Reedy
On 7/17/2012 10:23 AM, Lipska the Kat wrote: Well 'type-bondage' is a strange way of thinking about compile time type checking and making code easier to read (and therefor debug 'type-bondage' is the requirement to restrict function inputs and output to one declared type, where the type decla

Re: Encapsulation, inheritance and polymorphism

2012-07-17 Thread Lipska the Kat
On 17/07/12 17:26, Mark Lawrence wrote: On 17/07/2012 15:23, Lipska the Kat wrote: On 17/07/12 14:52, Roy Smith wrote: snip Still, I'm sure you're only kidding around with me :-) Kidding around on a Python mailing list, never, how dare you Sir, simply wouldn't be cricket :-) As in "The

Re: Encapsulation, inheritance and polymorphism

2012-07-17 Thread Mark Lawrence
On 17/07/2012 15:23, Lipska the Kat wrote: On 17/07/12 14:52, Roy Smith wrote: In article<-8sdnvrxgqie25jnnz2dnuvz7qkdn...@bt.com>, Lipska the Kat wrote: I'm not used to using variables without declaring their type If you truly wanted to recreate this type-bondage style of programming in

Re: Encapsulation, inheritance and polymorphism

2012-07-17 Thread Lipska the Kat
On 17/07/12 15:16, Andrew Berg wrote: On 7/17/2012 9:01 AM, Lipska the Kat wrote: Wow, that was a blast from the past Just downloaded, unzipped, untarred, configured, made and installed python 3.2.3 ... it's YEARS since I've done this, makes me feel young again. Most Linux distributions should

Re: Encapsulation, inheritance and polymorphism

2012-07-17 Thread Lipska the Kat
On 17/07/12 14:52, Roy Smith wrote: In article<-8sdnvrxgqie25jnnz2dnuvz7qkdn...@bt.com>, Lipska the Kat wrote: I'm not used to using variables without declaring their type If you truly wanted to recreate this type-bondage style of programming in Python, it's easy enough to do. snip Well

Re: Encapsulation, inheritance and polymorphism

2012-07-17 Thread Andrew Berg
On 7/17/2012 9:01 AM, Lipska the Kat wrote: > Wow, that was a blast from the past > Just downloaded, unzipped, untarred, configured, made and installed > python 3.2.3 ... it's YEARS since I've done this, makes me feel young again. Most Linux distributions should have a premade package for stable P

Re: Encapsulation, inheritance and polymorphism

2012-07-17 Thread Lipska the Kat
On 17/07/12 12:37, Andrew Berg wrote: On 7/17/2012 6:01 AM, Lipska the Kat wrote: snip On a side note, I would highly recommend learning Python 3 (3.2 is the latest stable version) unless you have an explicit need for Python 2 (some major 3rd-party libraries have not been ported yet). Python

Re: Encapsulation, inheritance and polymorphism

2012-07-17 Thread Roy Smith
In article <-8sdnvrxgqie25jnnz2dnuvz7qkdn...@bt.com>, Lipska the Kat wrote: > I'm not used to using variables without declaring their type If you truly wanted to recreate this type-bondage style of programming in Python, it's easy enough to do. Where you would write in C++: // Type matching

Re: Encapsulation, inheritance and polymorphism

2012-07-17 Thread Mark Lawrence
On 17/07/2012 12:44, Lipska the Kat wrote: You're not kidding, the 'duck' example at http://en.wikipedia.org/wiki/Duck_typing made me check I hadn't overdone the medication this morning. That is just plain ...weird. It will take me a while to form non knee jerk opinions of this for sure. Lipska

Re: Encapsulation, inheritance and polymorphism

2012-07-17 Thread Mark Lawrence
On 17/07/2012 12:01, Lipska the Kat wrote: Anyway, I'm looking at Python as a rapid prototyping language. Lipska One of the huge advantages of Python here is that you can simply blast stuff into the interactive prompt and see what happens, no need to write a script. -- Cheers. Mark Lawr

Re: Encapsulation, inheritance and polymorphism

2012-07-17 Thread Ulrich Eckhardt
Am 17.07.2012 13:01, schrieb Lipska the Kat: On 17/07/12 10:30, Ulrich Eckhardt wrote: Am 17.07.2012 10:45, schrieb Lipska the Kat: I was expecting (hoping) to see in depth documentation relating to Class construction, extension mechanisms and runtime polymorphism. In addition to this forum f

Re: Encapsulation, inheritance and polymorphism

2012-07-17 Thread Lipska the Kat
On 17/07/12 09:45, Lipska the Kat wrote: Pythoners Python 2.7.3 Ubuntu Linux 12.04 LTS I've been taking a brief look at Python. snip Well I've set myself a task. I have a text file containing a list of stock items each line contains the number in stock followed by a tab followed by the nam

Re: Encapsulation, inheritance and polymorphism

2012-07-17 Thread Andrew Berg
On 7/17/2012 6:44 AM, Lipska the Kat wrote: > I'll check it out, thanks. I forgot to add this: http://wiki.python.org/moin/Python2orPython3 It's a little outdated (there is more progress toward py3k by 3rd-party libraries every day), but still quite helpful. -- CPython 3.3.0b1 | Windows NT 6.1.76

Re: Encapsulation, inheritance and polymorphism

2012-07-17 Thread Lipska the Kat
On 17/07/12 12:37, Andrew Berg wrote: On 7/17/2012 6:01 AM, Lipska the Kat wrote: Anyway, I'm looking at Python as a rapid prototyping language. snip "Pythonic" is (or at least should be) a word you encounter frequently in discussions of Python code. Learn what is considered Pythonic and the

Re: Encapsulation, inheritance and polymorphism

2012-07-17 Thread Andrew Berg
On 7/17/2012 6:01 AM, Lipska the Kat wrote: > Anyway, I'm looking at Python as a rapid prototyping language. > I have an idea and just want to get it down in basic outline code as > quickly as possible before it departs my aging brain... I'm not used to > using variables without declaring their t

Re: Encapsulation, inheritance and polymorphism

2012-07-17 Thread Lipska the Kat
On 17/07/12 11:03, Devin Jeanpierre wrote: On Tue, Jul 17, 2012 at 4:45 AM, Lipska the Kat wrote: Is Python truly OO or is it just one way to use the language. I see some documentation relating to classes but nothing on instantiation .. in fact the documentation appears to say that classes are

Re: Encapsulation, inheritance and polymorphism

2012-07-17 Thread Dave Angel
On 07/17/2012 07:01 AM, Lipska the Kat wrote: > > > Anyway, I'm looking at Python as a rapid prototyping language. > I have an idea and just want to get it down in basic outline code as > quickly as possible before it departs my aging brain... I'm not used > to using variables without declaring th

Re: Encapsulation, inheritance and polymorphism

2012-07-17 Thread Lipska the Kat
On 17/07/12 10:30, Ulrich Eckhardt wrote: Welcome! Am 17.07.2012 10:45, schrieb Lipska the Kat: I was expecting (hoping) to see in depth documentation relating to Class construction, extension mechanisms and runtime polymorphism. In addition to this forum for direct help and discussion, two s

Re: Encapsulation, inheritance and polymorphism

2012-07-17 Thread Ulrich Eckhardt
Welcome! Am 17.07.2012 10:45, schrieb Lipska the Kat: I was expecting (hoping) to see in depth documentation relating to Class construction, extension mechanisms and runtime polymorphism. In addition to this forum for direct help and discussion, two suggestions: Firstly, it could help if you

Re: Encapsulation, inheritance and polymorphism

2012-07-17 Thread Devin Jeanpierre
On Tue, Jul 17, 2012 at 4:45 AM, Lipska the Kat wrote: > Is Python truly OO or is it just one way to use the language. I see some > documentation relating to classes but nothing on instantiation .. in fact > the documentation appears to say that classes are used in a static way e.g > ClassName.met

  1   2   >