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.
It is
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
(1, 4, 5)
The only new language I
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
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
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 using objects?), Chris Smith replied
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 record content
deconstructing in the aspect example I
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 noticed
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 used by
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
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 is better and why (or is there a more correct
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,
orc,
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 character
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
pattern, in
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
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
return tv == 'relates to A'
lest your zen master hit you.
Peter
[[ 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
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.
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 it seems I
better look around some more
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 keen on the
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.
#This program
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
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
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 runtime.
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 required for
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 is
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
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]
Immediately after posting and shutting down last night, I had one of
those expansive moments that visit us
Patrick Rutkowski wrote:
I couldn't help but make an even better list in reference to this thread:
snip
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
--
28 matches
Mail list logo