Re: HTML Conventions

2005-07-04 Thread Chinook
Patrick Rutkowski wrote: > I couldn't help but make an even better list in reference to this thread: > I'll go you one better :<)) I found the source of what I pulled that table from: http://jaynes.colorado.edu/PythonGuidelines.html Lee C -- http://mail.python.org/mailman/listinfo/python-l

Re: Speaking of list-comprehension?

2005-07-01 Thread Chinook
Chinook wrote whilst his head was elsewhere: >> >>So, where might I have found this construct. >> >>>>>ta = [5, 15, 12, 10, 9] >>>>>nta = [tai+[10,-10][tai>=10]for tai in ta] >>>>>nta >> >>[15, 5, 2, 0, 19] &g

Re: Speaking of list-comprehension?

2005-07-01 Thread Chinook
Thank you all for taking the time to consider and respond. I had received the answer OL and responded with: > Thank you, and your elaboration is well taken. I was just exploring here > and the construct you noted is IMHO intuitively readable - at least for a > simple expression and cond

Speaking of list-comprehension?

2005-06-30 Thread Chinook
I'm probably just getting languages mixed up, but I thought in my Python readings over the last couple months that I had noticed an either/or expression (as opposed to a bitwise or, or truth test). Being a curious sort, I tried several variations of how a list comprehension *might* be construc

Re: Boss wants me to program

2005-06-29 Thread Chinook
On Wed, 29 Jun 2005 08:11:43 -0400, phil wrote (in article <[EMAIL PROTECTED]>): > > Comes down to preference. Isn't it absolutely amazing how many > choices we have. Remember the 70's - Cobol, ASM, C, Basic.CICS(shudder) > And please, no eulogies (especially for CICS) - being reminded of them

Re: OO refactoring trial ??

2005-06-28 Thread Chinook
On Wed, 29 Jun 2005 00:18:24 -0400, Paul McGuire wrote (in article <[EMAIL PROTECTED]>): > Lee - > > Bruce Eckel's observation: > > "the above scaffolding of Obstacle, Player and GameElementFactory > (which was translated from the Java version of this example) is > unnecessary - it's only requir

Re: OO refactoring trial ??

2005-06-28 Thread Chinook
On Tue, 28 Jun 2005 23:23:43 -0400, Kamilche wrote (in article <[EMAIL PROTECTED]>): > ''' > You might find this interesting. Note that the object creation in > main() below could easily be read in from a text file instead, > thus meeting your requirement of not knowing an item's class > until run

Re: OO refactoring trial ??

2005-06-28 Thread Chinook
Paul, Going back over various material led to another question regarding your comments. > - I'm not keen on the coupling of forcing your A,B,etc. classes to > inherit from MF. Especially in a duck-typing language like Python, it > adds no value, the subclasses receive no default behavior from

Re: OO refactoring trial ??

2005-06-28 Thread Chinook
Never mind. > > BTW: Is duck-typing a variation on duct-taping? > http://www.rubygarden.org/ruby?DuckTyping http://en.wikipedia.org/wiki/Duck_typing Lee C -- http://mail.python.org/mailman/listinfo/python-list

Re: I need help figuring out how to fix this code.

2005-06-28 Thread Chinook
On Tue, 28 Jun 2005 14:39:47 -0400, Nathan Pinno wrote (in article <[EMAIL PROTECTED]>): > Hi all, > > I need help figuring out how to fix my code. I'm using Python 2.2.3, and > it keeps telling me invalid syntax in the if name == "Nathan" line. Here is > the code if you need it. > > #Thi

Re: OO refactoring trial ??

2005-06-28 Thread Chinook
On Tue, 28 Jun 2005 10:22:59 -0400, Paul McGuire wrote (in article <[EMAIL PROTECTED]>): > Lee, > > Interesting idea, but I think the technique of "inherit from MF to > automatically add class to the test chain" is a gimmick that wont > scale. > > Here are some things to consider: > > - I'm not

Re: OO refactoring trial ??

2005-06-28 Thread Chinook
On Tue, 28 Jun 2005 07:31:43 -0400, Chinook wrote (in article <[EMAIL PROTECTED]>): > [[ This message was both posted and mailed: see >the 'To' and 'Newsgroups' headers for details. ]] > Sorry for the duplication. I'm trying Hogwasher on OS X and

Re: OO refactoring trial ??

2005-06-28 Thread Chinook
Clarifications: 1) Truth test simplified after a %) by Peter Otten - thanks. In reality the "testit" methods will all be quite different as you might imagine (as will the "doit" methods). 2) A final subclass will always return True, so there will always be a valid result.

Re: OO refactoring trial ??

2005-06-28 Thread Chinook
[[ This message was both posted and mailed: see the 'To' and 'Newsgroups' headers for details. ]] Clarifications: 1) Truth test simplified after a %) by Peter Otten - thanks. In reality the "testit" methods will all be quite different as you might imagine (as will the "doit" methods). 2) A

Re: OO refactoring trial ??

2005-06-27 Thread Chinook
On Tue, 28 Jun 2005 02:22:13 -0400, Peter Otten wrote (in article <[EMAIL PROTECTED]>): > Chinook wrote: > >> 3) Any other comments you might offer > >> if tv == 'relates to A': >> return True >> else: >> return False > > Make that &

OO refactoring trial ??

2005-06-27 Thread Chinook
OO refactoring trial Following is a simple trial structure of a refactoring (top-down to OO) learning exercise I'm doing. Whether you call it a Factory pattern, COR pattern, or some hinze 57, I don't know what class to use till run time and I'm trying to avoid a lengthy "if

Re: OO approach to decision sequence?

2005-06-26 Thread Chinook
On Sun, 26 Jun 2005 17:58:11 -0400, George Sakkis wrote (in article <[EMAIL PROTECTED]>): > "Paul McGuire" <[EMAIL PROTECTED]> wrote: > >> Lee C - >> >> Here is a technique for avoiding the if-elseif-elseif...-else method >> for building objects. It is a modified form of ChainOfResponsibility >

Re: noob question

2005-06-26 Thread Chinook
On Sun, 26 Jun 2005 01:06:08 -0400, Matt Hollingsworth wrote (in article <[EMAIL PROTECTED]>): > Hello, > > Very new to python, so a noob question. When I've written stuff in > JavaScript or MEL in the past, I've always adopted the variable naming > convention of using a $ as the first charact

Re: OO approach to decision sequence?

2005-06-26 Thread Chinook
On Sun, 26 Jun 2005 00:54:42 -0400, Bengt Richter wrote (in article <[EMAIL PROTECTED]>): > On Sat, 18 Jun 2005 03:52:28 -0400, Brian van den Broek > <[EMAIL PROTECTED]> wrote: > [...] >> >> Now, the same sort of behaviour where the "if type" testing has been >> replaced with code more in keepi

Re: Excellent Site for Developers

2005-06-25 Thread Chinook
On Sat, 25 Jun 2005 15:36:06 -0400, Philippe C. Martin wrote (in article <[EMAIL PROTECTED]>): > Hi, > > Not being from anglo-saxon heritage, I keep wondering why spammers always > (or very often) get called 'trolls' ? > > I mean fantasy fiction has brought us many hugly beasts (goblin, warlock,

Re: Using code objects?

2005-06-21 Thread Chinook
On Tue, 21 Jun 2005 09:56:27 -0400, Konstantin Veretennicov wrote (in message <[EMAIL PROTECTED]>): > On 6/21/05, Chinook <[EMAIL PROTECTED]> wrote: >> >> When I create the code objects though, it seems a couple different ways work >> and I'm wondering which

Using code objects?

2005-06-20 Thread Chinook
Using code objects? === As an OO exercise I have a factory pattern that returns class objects that each have an "action" method. ClassObj.action() in turn returns a code object in my recursive process loop. I create the code objects as a one time step outside my factory pattern

RE: functions with unlimited variable arguments...

2005-06-19 Thread Chinook
Xah said unto the world: >oops... it is in the tutorial... sorry. > >though, where would one find it in the python reference? i>.e. the function def with variable/default parameters. > >This is not a rhetorical question, but where would one start to look >for it in the python ref? > >a language is

Re: extreme newbie

2005-06-18 Thread Chinook
On Sat, 18 Jun 2005 14:00:35 -0400, Steven D'Aprano wrote (in article <[EMAIL PROTECTED]>): > On Sat, 18 Jun 2005 12:05:59 -0400, Peter Hansen wrote: > >> Furthermore, protecting you from someone else making money off a copy of >> your program is basically what licenses are for, and if you have

Re: OO approach to decision sequence?

2005-06-18 Thread Chinook
On Sat, 18 Jun 2005 09:10:25 -0400, George Sakkis wrote (in article <[EMAIL PROTECTED]>): > "Chinook" wrote: > >> I understand what you are saying. The point I'm messing up my head with >> though, is when the entity (tree node in my case or variable

Re: Migrating from Windows to OS X

2005-06-18 Thread Chinook
On Sat, 18 Jun 2005 03:26:23 -0400, [EMAIL PROTECTED] wrote (in article <[EMAIL PROTECTED]>): > Hello, fellow programmers! > > I am sitting in front of a nice new PowerBook portable which has OS > 10.4 installed. The Python.org web site says that Apple has shipped OS > 10.4 with Python 2.3.5 ins

Re: OO approach to decision sequence?

2005-06-18 Thread Chinook
On Sat, 18 Jun 2005 03:52:28 -0400, Brian van den Broek wrote (in article <[EMAIL PROTECTED]>): > Chinook said unto the world upon 18/06/2005 02:17: >> OO approach to decision sequence? >> - >> >> In a recent thread (Cause for usi

OO approach to decision sequence?

2005-06-17 Thread Chinook
OO approach to decision sequence? - In a recent thread (Cause for using objects?), Chris Smith replied with (in part): >If your table of photo data has several types of photos, and you find >yourself saying > >if is_mugshot: >#something >

Re: Dynamic class inheritance && something else

2005-06-14 Thread Chinook
On Tue, 14 Jun 2005 12:39:09 -0400, Vero wrote (in article <[EMAIL PROTECTED]>): > Hi. My name is Veronica, I am a master student at UNAM. I am working on > something related to Artificial Inteligence and I have been looking for the > most appropriated programming language to implement my algo

Re: Going crazy...

2005-06-13 Thread Chinook
On Mon, 13 Jun 2005 20:52:43 -0400, Gary Herron wrote (in article <[EMAIL PROTECTED]>): > Jan Danielsson wrote: > >> Hello all, >> >> I'm 100% sure that I saw an example which looked something like this >> recently: >> >> >> > a=(1, 2, 3, 4, 5, 6) > b=(2, 3, 6) > a - b >

Re: case/switch statement?

2005-06-12 Thread Chinook
On Sun, 12 Jun 2005 17:19:06 -0400, Peter Hansen wrote (in article <[EMAIL PROTECTED]>): > Steven D'Aprano wrote: >> On Sat, 11 Jun 2005 19:47:58 -0500, Skip Montanaro wrote: >>> If the case values are constants known to the compiler, it can generate >>> O(1) >>> code to take the correct branch.