Re: Tuple assignment and generators?

2006-05-05 Thread Erik Max Francis
vdrab wrote: > what the...? > does anybody else get mighty uncomfortable about this? No. Why should you ever care about whether two integers representing values are the same object? Your tests should be with `==`, not `is`. -- Erik Max Francis && [EMAIL PROT

Re: python rounding problem.

2006-05-07 Thread Erik Max Francis
do that? Floating point arithmetic is inherently imprecise. This is not a Python problem. If you want to print it to only three digits, then use something like:: >>> '%.3f' % 2.9954254 '2.995' -- Erik Max Francis && [EMAIL PROTECTED] && http

Re: Why list.sort() don't return the list reference instead of None?

2006-05-07 Thread Erik Max Francis
new one. -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis Sitting in the den and / Looking at the phone as if it owed / Owed me a favor -- Blu Cantrell -- http://mail.python.org/mailman/listinfo/python-list

Re: Question about exausted iterators

2006-05-18 Thread Erik Max Francis
y choosing to ask in such a way that guarantees practically no one will take your suggestion seriously. -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis Chance favo

Re: Why does the _winreg module start with an underscore

2006-05-19 Thread Erik Max Francis
as such you probably shouldn't use it or rely on it, unless you know the internal details very well. An identifier starting with _two_ underscores is automatically mangled in a way that makes it more difficult (but not impossible) for external clients to accidentally use them. -- Erik Max

Re: Includeing Python in text files

2006-05-22 Thread Erik Max Francis
like php or > embedded perl. > > So my little toy works not bad, but I was wondering if such a feature > already existed, if yes, can you point me out some links? Another standalone templating system is EmPy: http://www.alcyone.com/software/empy/ -- Erik Max Francis &&

Re: John Bokma harassment

2006-05-24 Thread Erik Max Francis
y were cutting you off unfairly? The alternative is that you're not surprised by this action and are simply trying to spin things in your favor. -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 20 N 121 53 W

Re: how to clear up a List in python?

2006-05-26 Thread Erik Max Francis
#x27;re > posted this on purpose, you really need to grow up.'''. > > The problem was I did post it on purpose, but not with the intent to > mess anyone up over it. His statement was a conditional. Since you're saying that the conditional does not apply, then

Re: os.tmpfile()

2008-01-01 Thread Erik Max Francis
n-line. It's a file. You read strings from it and write strings to it. It isn't a string itself. Given that what you're trying to do doesn't make any sense, it's hard to know where to begin to identify what's confusing you. -- Erik Max Francis && [EMAIL

Re: os.tmpfile()

2008-01-02 Thread Erik Max Francis
t; would automatically delete itself when the code was finished. It is more likely that keeping it in a list will be more efficient, and easier to handle anyway. -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57

Re: dictionary/hash and '1' versus 1

2008-01-04 Thread Erik Max Francis
he best bet so far. If you want to make sure something is always done in a particular situation, then solution is to have a function or method that does that, and then just call that function or method. That's true in any language -- any one that has functions, anyway. -- Erik Max Francis

Re: Embedding python code into text document question.

2008-01-10 Thread Erik Max Francis
s? Any help will be appreciated :) What you're looking for is a templating system for Python. There are already many with varying degrees of complexity and emphasis, including one I've put together, EmPy: http://www.alcyone.com/software/empy/ For more, google around for Py

Re: Newbie question on Classes

2008-01-10 Thread Erik Max Francis
class for elegance, but it's not required to get the proper functionality. -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM, Y!M erikmaxfrancis Life is a gamble so I should / Live life more carefully -- TLC -- http://mail.python.org/mailman/listinfo/python-list

Re: Why not a Python compiler?

2008-02-07 Thread Erik Max Francis
Any after-the-fact explanation of why the error was present (but not corrected or pointed out in the movie) is just so much rationalization. -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AI

Re: OT: Speed of light [was Re: Why not a Python compiler?]

2008-02-11 Thread Erik Max Francis
Jeff Schwab wrote: > Erik Max Francis wrote: >> Robert Bossy wrote: >>> I'm pretty sure we can still hear educated people say that free fall >>> speed depends on the weight of the object without realizing it's a >>> double mistake. >> >&

Re: OT: Speed of light [was Re: Why not a Python compiler?]

2008-02-11 Thread Erik Max Francis
Modern physics can get weird and spooky and counterintuitive, but any real connection made with Eastern philosophy is only in the eye of the beholder. -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W &&

Re: OT: Speed of light [was Re: Why not a Python compiler?]

2008-02-11 Thread Erik Max Francis
wavicals, > it's just that the wave-like fuzziness is usually too small to notice. It's usually spelled _wavicle_, by the way. -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM, Y!M erikm

Re: OT: Speed of light [was Re: Why not a Python compiler?]

2008-02-11 Thread Erik Max Francis
s out of impetus, then falls straight down -- is clearly contrary to everyday experience of watching two people throw a ball back and forth from a distance, since the path of the ball is clearly curved. -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.co

Re: OT: Speed of light [was Re: Why not a Python compiler?]

2008-02-11 Thread Erik Max Francis
27;s only when you're dealing with objects falling through vacuum that all objects fall at the same rate, and that's because the gravitational and inertial masses are identical. -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, C

Re: OT: Speed of light [was Re: Why not a Python compiler?]

2008-02-11 Thread Erik Max Francis
Jeff Schwab wrote: > Erik Max Francis wrote: >> Grant Edwards wrote: >> >>> On 2008-02-12, Jeff Schwab <[EMAIL PROTECTED]> wrote: >>>> Fair enough! >>> >>> Dear me, what's Usenet coming to these days... >> >> I know, rea

Re: OT: Speed of light [was Re: Why not a Python compiler?]

2008-02-11 Thread Erik Max Francis
Grant Edwards wrote: > On 2008-02-12, Jeff Schwab <[EMAIL PROTECTED]> wrote: >> Fair enough! > > Dear me, what's Usenet coming to these days... I know, really. Sheesh! Jeff, I won't stand for that! Argue with me! :-) -- Erik Max Francis && [EMAIL P

Re: OT: Speed of light [was Re: Why not a Python compiler?]

2008-02-11 Thread Erik Max Francis
even reasonable people into demonstrating technical ignorance have precisely the same problem: The desired technical context is not made clear and so that the supposedly-wrong answer is not only unsurprising, but often arguably correct. This kind of stuff is little more than a s

Re: OT: Speed of light [was Re: Why not a Python compiler?]

2008-02-12 Thread Erik Max Francis
ach physics than this, because these misunderstanding are not wrong in any meaningfully useful way. -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM, Y!M erikmaxfrancis It isn't importa

Re: OT: Speed of light [was Re: Why not a Python compiler?]

2008-02-12 Thread Erik Max Francis
Dennis Lee Bieber wrote: > On Tue, 12 Feb 2008 00:18:38 -0800, Erik Max Francis <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > >> equivalence for everyday usage and make no requirement of using the >> "proper" units for mass (kg) vs.

Re: Double underscore names

2008-02-12 Thread Erik Max Francis
ethod. > Go ahead and implement your protocol using attributes with plain > names. What makes it a protocol is that it's likely to be generally > applicable, and the names are chosen to apply to other classes equally > well. Agreed. -- Erik Max Francis && [EMAIL PROTECTED]

Re: OT: Speed of light [was Re: Why not a Python compiler?]

2008-02-12 Thread Erik Max Francis
greg wrote: > Erik Max Francis wrote: >> My point was, and still is, that if this question without further >> context is posed to a generally educated laymen, the supposedly wrong >> answer that was given is actually _correct_. > > Except that they probably don&#

Re: OT: Speed of light [was Re: Why not a Python compiler?]

2008-02-12 Thread Erik Max Francis
systems for dealing with the pound and its brethren, and different people are taught different things and are perpetually confused. And not much good comes of it. And the rest of us just use SI. (And if you bring up the _kilogram-force_, I'll just cry.) -- Erik Max Francis &

Re: OT: Speed of light [was Re: Why not a Python compiler?]

2008-02-13 Thread Erik Max Francis
Dotan Cohen wrote: > On 13/02/2008, Erik Max Francis <[EMAIL PROTECTED]> wrote: >> And the rest of us just use SI. (And if you bring up the >> _kilogram-force_, I'll just cry.) > > Don't cry, I just want to say that I've hated the kilogram-force &

Re: OT: Speed of light [was Re: Why not a Python compiler?]

2008-02-13 Thread Erik Max Francis
I V wrote: > On Mon, 11 Feb 2008 14:07:49 -0800, Erik Max Francis wrote: >> experience. The notion of impetus -- where an object throw moves in a >> straight line until it runs out of impetus, then falls straight down -- >> is clearly contrary to everyday experience of watc

Re: OT: Speed of light

2008-02-13 Thread Erik Max Francis
ecific impulse) is measured in seconds, as it's the ratio of the the thrust (force) to rate of fuel usage (would be mass divided by time, but weight on Earth is used instead of mass). Basically, physics rationalizations of Imperial/English/American (whatever you choose to call

Re: OT: Speed of light [was Re: Why not a Python compiler?]

2008-02-13 Thread Erik Max Francis
on due to gravity is a pound. The acceleration due to gravity is only approximately 32 ft/s^2, so you were just remembering the short-hand approximation for 1 gee. Let's hear it for incoherent unit systems ... -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/m

Re: OT: Speed of light

2008-02-13 Thread Erik Max Francis
for it) zepto-. The electron-volt is about 160 zJ (zeptojoules). -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM, Y!M erikmaxfrancis You are the lovers rock / The rock that I cling to -- Sade -- http://mail.python.org/mailman/listinfo/python-list

Re: Seemingly odd 'is' comparison.

2008-02-18 Thread Erik Max Francis
Tobiah wrote: >>>> print float(3.0) is float(3.0) > True >>>> print float(3.0 * 1.0) is float(3.0) > False >>>> It's implementation dependent what values these expressions will take. If you're trying to test equality, use `==`, not `is`

Re: Double underscores -- ugly?

2008-02-19 Thread Erik Max Francis
or something? -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM, Y!M erikmaxfrancis One cannot always be a hero, but one can always be a man. -- Goethe -- http://mail.python.org/mailman/listinfo/python-list

Re: Python IRC Zork

2008-02-28 Thread Erik Max Francis
ed on for my own amusement a while back but never got far enough to do anything useful at all, given the size of the task. -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM, Y!M erikmaxfrancis

Re: Pythons & Ladders

2008-02-28 Thread Erik Max Francis
then C is a > good choice. More portable than assembler but nearly as close to the > metal. > > To the OP: If you try C++, don't hold that crappy language against C#, D, > or Java. ;-) He was talking about C++, not C. Jeff has quite a good point; teaching C++ as C is not terribly

Re: sympy: what's wrong with this picture?

2008-03-03 Thread Erik Max Francis
l. No, of course not, since logically you must think all software is useless. -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM, Y!M erikmaxfrancis Life is a zoo in a jungle. -- Peter de Vries -- http://mail.python.org/mailman/listinfo/python-list

Re: sympy: what's wrong with this picture?

2008-03-04 Thread Erik Max Francis
Mensanator wrote: > On Mar 3, 11:58 pm, Erik Max Francis <[EMAIL PROTECTED]> wrote: >> Mensanator wrote: >>> I'm not hard to please at all. >> No, of course not, since logically you must think all software is useless. > > Somehow, I expected bet

Re: Looking for very light weight template library (not framework)

2008-03-06 Thread Erik Max Francis
>>> print em.expand(myOutput, globals()) The total cost is $123.45. This order will be shipped to Jack McCoy at the following address: 1 Police Plaza New York City, NY This order was generated at Thu Mar 6 18:41:58 2008 -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM, Y!M erikmaxfrancis There's a reason why we / Keep chasing morning -- Sandra St. Victor -- http://mail.python.org/mailman/listinfo/python-list

Re: List mutation method gotcha - How well known?

2008-03-13 Thread Erik Max Francis
Chris wrote: > No output because x is a NoneType... That's behavior of the interactive interpreter when printing results of expressions, not of print. It will print None. -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA &

Re: getattr(foo, 'foobar') not the same as foo.foobar?

2008-03-13 Thread Erik Max Francis
re not doing a useful test here. In Python, bound methods are dynamically generated. -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM, Y!M erikmaxfrancis There is no present or future; only the pa

Re: 'join' in the wrong word for the method in class Thread.

2008-03-15 Thread Erik Max Francis
[EMAIL PROTECTED] wrote: > 'join' in the wrong word for the method in class Thread. That's the standard term in threading. If it's not familiar to you, well, bummer, but there's not much more that can be done about that than for you to read the literature. --

Re: English-like Python

2009-01-15 Thread Erik Max Francis
ional programming language syntax. In the big picture I don't think it helps much. After all, there's a reason that most modern programming languages don't look like COBOL or AppleScript. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ S

Re: English-like Python

2009-01-16 Thread Erik Max Francis
alex23 wrote: On Jan 16, 5:39 pm, Erik Max Francis wrote: Inform 7 has some interesting ideas, but I think the general problem with English-like programming language systems is that once you get into the nitty gritty details, you end up having to know exactly the right things to type, This

Re: English-like Python

2009-01-20 Thread Erik Max Francis
x27;t require parentheses at all, since functions ("procedures") take a fixed number of arguments. Parentheses are only required when you're adding optional arguments. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA &

Re: Function arguments

2009-01-26 Thread Erik Max Francis
have been nice to be able to do that. Look up the function call syntaxes with * and **: >>> def foo(*args): print args ... >>> def bar(**keywords): print keywords ... >>> foo(1, 2, 3) (1, 2, 3) >>> bar(a=1, b=2, c=3) {'a': 1, 'c'

Re: Using equals operator without changing reference pointer

2009-01-29 Thread Erik Max Francis
there is some keyword that I don't know about. No. The assignment operator with a bare name on the left hand side is not overridable. You can override attribute access, however, with .__getattr__/.__getattribute__. -- Erik Max Francis && m...@alcyone.com && http://www.

Re: "Byte" type?

2009-02-14 Thread Erik Max Francis
element is apparently being promoted to "bytes" as soon as it comes out of the array. There's no distinction byte type. A single character of a bytes type is also a bytes. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM, Y!M erikmaxfrancis Did you ever love somebody / Did you ever really care -- Cassandra Wilson -- http://mail.python.org/mailman/listinfo/python-list

Re: Guido's new method definition idea

2008-12-06 Thread Erik Max Francis
ime for the same reason. It isn't going to happen. -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM, Y!M erikmaxfrancis There are not fifty ways of fighting, there is only one: to be the

Re: Guido's new method definition idea

2008-12-06 Thread Erik Max Francis
7;t. Is "@" a "speaking identifier? How about "#" and "!="? Last I heard, they were all part of Python. None of these are identifiers at all. You might want to read up on the language reference to see what an identifier actually is. -- Erik Max Francis

Re: Removing None objects from a sequence

2008-12-12 Thread Erik Max Francis
k Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM, Y!M erikmaxfrancis Life is a gamble so I should / Live life more carefully -- TLC -- http://mail.python.org/mailman/listinfo/python-list

Re: Removing None objects from a sequence

2008-12-12 Thread Erik Max Francis
that matter. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM, Y!M erikmaxfrancis God grant me to contend with those that understand me. -- Thomas Fuller -- http://mail.python.org/mailman/listinfo/python-list

Re: why cannot assign to function call

2008-12-28 Thread Erik Max Francis
nature, but why the interpreter refused to do that ? Because, as in most languages, it's not even clear what you might mean by this syntax. It doesn't have any meaning; assignments are made to variables, not the results of function calls. -- Erik Max Francis && m...@al

Re: why cannot assign to function call

2009-01-02 Thread Erik Max Francis
iously doesn't say anything about which "objects" are the same as each other. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM, Y!M erikmaxfrancis Scars are like memories. We d

Re: why cannot assign to function call

2009-01-02 Thread Erik Max Francis
Derek Martin wrote: On Fri, Jan 02, 2009 at 12:50:44PM -0800, Erik Max Francis wrote: Identity isn't defined on math objects, only on Python objects; there is no notion of 'is' in math. This is also false, it even has its own operator (which requires Unicode to display): ≡

Re: why cannot assign to function call

2009-01-05 Thread Erik Max Francis
dentity and the computer scientific ones (especially since the term _identity_ isn't even used in remotely the same way) is simply ignoring the fact that other people either won't know what you mean or will presume you're misunderstanding something. Because, based on your

Re: why cannot assign to function call

2009-01-07 Thread Erik Max Francis
ed, and it's not useful anyway; what you care about is whether two objects are equal or not, not whether they're the same object through some optimization behind the scenes. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM, Y!M erikmaxfrancis All delays are dangerous in war. -- John Dryden, 1631-1700 -- http://mail.python.org/mailman/listinfo/python-list

Re: type-checking support in Python?

2008-10-07 Thread Erik Max Francis
make two widgets, how many widgets can five men make in two weeks?"). -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM, Y!M erikmaxfrancis Those who forget the past are condemned to repeat

Re: Suggestion for the PythonDevelopment for next version

2008-10-13 Thread Erik Max Francis
not so good one. People like Python because of his simplicity in comparison with c++. Maybe People would like him even more it would be a bit more simple but the same powerfull. The problem is your suggestion would make Python a worse tool, not a better one. -- Erik Max Francis && [EMA

Re: python vs smalltalk 80

2008-11-19 Thread Erik Max Francis
Lawrence D'Oliveiro wrote: gavino wrote: which is nicer? If I were to lock you and INTERCAL in a room until only one is left alive, who do you think would survive? The rest of us. -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, C

Re: c.l.py dead, news at 11 (was Re: Mangle function name with decorator?)

2009-03-27 Thread Erik Max Francis
(non-spam) posts is steadily dropping over time. If you look at http://mail.python.org/pipermail/python-list/ it doesn't make it clear that there is any sort of decline. ... And made all purdy-like: http://www.alcyone.com/tmp/python-list%20traffic.pdf -- Erik Max Francis &

Re: iterator question

2009-04-02 Thread Erik Max Francis
rating over a single object, so successive calls to .next give you success iteration values like you intended. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM, Y!M erikmaxfrancis We must all

Re: Marshal vs pickle...

2009-04-25 Thread Erik Max Francis
python.org describes their functionality in detail. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM, Y!M, Skype erikmaxfrancis The hour which gives us life begins to take it away. -- Seneca -- http://mail.python.org/mailman/listinfo/python-list

Re: 4 hundred quadrillonth?

2009-05-24 Thread Erik Max Francis
erics Manual, 2nd Edition, published in 1988? It's such a classic piece that I think it should be posted somewhere... I only see used versions of it available for purchase. Care to hum a few bars? -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose,

Re: 4 hundred quadrillonth?

2009-05-24 Thread Erik Max Francis
c. Even if you restrict yourself to base-b expansions (for which the statement is true for integer bases), you can cheat there too: e is 1 in base e. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W &&a

Re: Does '!=' equivelent to 'is not'

2008-06-16 Thread Erik Max Francis
perator tests identity. If you don't specifically intend to test for identity, use `==`. If you don't know what identity tests are for (with the exception of testing for None-ness), then you don't need it. -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyon

Re: x, = y (???)

2008-07-17 Thread Erik Max Francis
rence books but I could not find the answer to (1). I hope to find a better Python reference!) It's unpacking a 1-tuple: (x,) = y The parentheses here are not necessary and are sometimes left out. -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max

Re: Python Written in C?

2008-07-20 Thread Erik Max Francis
...whereas REAL WORLD programmers who want to be generally useful go and learn C#. Psst. What language do you think the primary implementations of C# is written in? -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W

Re: Genetic programming: pygene, pygp, AST, or (gasp) Lisp?

2008-07-20 Thread Erik Max Francis
ush or PushGP. These are in effect a stack-based form of Lisp, but which use different data stacks for different types. Producing human-readable code from my genetic programming search would be a great bonus -- and for me, at this moment, this seems to mean Algol-style syntax. (Sigh.) But it

Re: Python Written in C?

2008-07-22 Thread Erik Max Francis
lackjack1.jpg http://wps.com/projects/LGP-21/Software/LGP30-Blackjack2.jpg and here's a scan of a printout of some "source code" (machine language): http://wps.com/projects/LGP-21/Software/CrapGame.tiff -- Erik Max Francis && [EMAIL PROTECTED] &&

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-07-29 Thread Erik Max Francis
nd code written to deal with sequences using duck typing (which is typically nearly all Python code) don't have to know anything special about your custom sequence class. -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18

Re: iterating "by twos"

2008-07-29 Thread Erik Max Francis
and zip. The use of islice and izip is better, particularly if the list that's being iterated over is large. -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM, Y!M erikmaxfranc

Re: iterating "by twos"

2008-07-29 Thread Erik Max Francis
- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM, Y!M erikmaxfrancis Tell me the truth / I'll take it like a man -- Chante Moore -- http://mail.python.org/mailman/listinfo/python-list

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-07-29 Thread Erik Max Francis
un drawing imaginary lines in the sand. Once again, I'm invoking the contraint against simply using x in a boolean context, or passing x to a function expecting a boolean doesn't count, since in those cases x can be set to the result of the explicit test. Next answer you&#

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-07-29 Thread Erik Max Francis
st. Simpler, in fact, than the ones you were advocating. -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM, Y!M erikmaxfrancis An ounce of hypocrisy is worth a pound of ambition. -- Michael Korda -- http://mail.python.org/mailman/listinfo/python-list

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-07-29 Thread Erik Max Francis
you're thinking of (numeric types vs. container types), there aren't any good examples. But who cares? Polymorphism applies in more than just this one special case. You're setting up a challenge that isn't very interesting, and which is rigged so that no one can win because

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-07-29 Thread Erik Max Francis
or a list. Having said that, it would sure be nice to be able to write if myList is not empty: I sure hope that's a joke. `x is not y` means something quite different. -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 1

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-07-29 Thread Erik Max Francis
g suspicion that you guys are all putting us on. -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM, Y!M erikmaxfrancis The doors of Heaven and Hell are adjacent and identical. -- Nikos Kazantzakis -- http://mail.python.org/mailman/listinfo/python-list

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-07-29 Thread Erik Max Francis
sense than the existing Boolean test. -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM, Y!M erikmaxfrancis The doors of Heaven and Hell are adjacent and identical. -- Nikos Kazantzakis -- http://mail.python.org/mailman/listinfo/python-list

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-07-29 Thread Erik Max Francis
Russ P. wrote: On Jul 29, 11:09 pm, Erik Max Francis <[EMAIL PROTECTED]> wrote: I'm getting this sneaking suspicion that you guys are all putting us on. As I said in an earlier post, I realize that this would only work if there were only one copy of "empty" (as ther

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-07-29 Thread Erik Max Francis
Russ P. wrote: Come to think of it, shouldn't the list type have an "isempty" method? Or does it? Yes. It's written: if not aList: ... -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA,

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-07-30 Thread Erik Max Francis
Russ P. wrote: On Jul 29, 11:36 pm, Erik Max Francis <[EMAIL PROTECTED]> wrote: Russ P. wrote: Come to think of it, shouldn't the list type have an "isempty" method? Or does it? Yes. It's written: if not aList: ... As you know, that is not qu

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-07-30 Thread Erik Max Francis
k Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM, Y!M erikmaxfrancis The actor is not quite a human being -- but then, who is? -- George Sanders -- http://mail.python.org/mailman/listinfo/python-list

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-07-30 Thread Erik Max Francis
hing like the modulus operator. In dynamic languages, the effect of operations depend on their types. There's really no way around that, and Boolean testing if an object as in `if x: ...` is no different. It means different things depending on what `x` is. -- Erik Max Francis && [

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-07-30 Thread Erik Max Francis
Russ P. wrote: On Jul 30, 1:07 am, Erik Max Francis <[EMAIL PROTECTED]> wrote: Russ P. wrote: Oh, Lordy. I understand perfectly well how boolean tests, __len__, and __nonzero__ work in Python. It's very basic stuff. You can quit patronizing me (and Carl too, I'm sure). You su

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-07-30 Thread Erik Max Francis
Y TO DO IT! Let me repeat that for you: I DID NOT CLAIM THAT THIS IS THE WAY TO DO IT! Did you get that, idiot? So people who can read words but not minds are idiots. Go get 'em, tiger! -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, US

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-07-30 Thread Erik Max Francis
your words. Which, by the way, includes at least three people other than myself. But I'll bet the mindless namecalling is really working out for you. Go, team, go! -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 1

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-07-30 Thread Erik Max Francis
Russ P. wrote: On Jul 30, 9:27 pm, Erik Max Francis <[EMAIL PROTECTED]> wrote: You're sure going on about a distinction without a difference for a guy who childishly likes to call other people names. A reasonable person would have long ago moved on instead of blaming oth

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-07-31 Thread Erik Max Francis
fundamentals of Python, so you're just trying to make up controversy here. -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM, Y!M erikmaxfrancis We all breathe the same air. We all cherish our

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-08-01 Thread Erik Max Francis
polymorphism. It's more confusing, if that's a benefit. -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM, Y!M erikmaxfrancis In a cosmic setting, vast and old, beyond ordinary human unde

Re: My Python error...

2008-08-03 Thread Erik Max Francis
It probably means that your text editor is saving as UTF-16 and it's seeing part of a byte order marker (0xFE 0xFF or 0xFF 0xFE depending on endianness) -- either that or you've accidentally injected some extra garbage into the file. Save as ASCII instead. -- Erik Max F

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-08-04 Thread Erik Max Francis
have a single `solve` function that accomplishes it. Therefore, the general point about polymorphism still stands. -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM, Y!M erikmaxfrancis It is

Re: Psycho question

2008-08-05 Thread Erik Max Francis
dule or two (so that code not using Psycho is absolutely unaffected)? That's correct. Hi, David! -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM, Y!M erikmaxfrancis Longevity has its plac

Re: Psycho question

2008-08-06 Thread Erik Max Francis
o. `range` creates a list which is not really what you need. -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM, Y!M erikmaxfrancis You and I / We've seen it all / Chasing our hearts' de

Re: Receive data from socket stream

2008-04-25 Thread Erik Max Francis
nt to transfer and for what purpose. -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM, Y!M erikmaxfrancis In the final choice a solider's pack is not so heavy a burden as a prisoner's

Re: #!/usr/bin/env python vs. #!/usr/bin/python

2008-05-02 Thread Erik Max Francis
or a very conscious reason. Which is why the PATH exists in the first place, and why invoking the script with env is preferable. -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM, Y!M erikmaxfrancis -- http://mail.python.org/mailman/listinfo/python-list

Re: Do you know of a much simpler way of writing a program that writes a program?

2008-05-02 Thread Erik Max Francis
templating system, where most of the text is unmodified and you only set out the specific areas where you want to insert logic. EmPy is one: http://www.alcyone.com/software/empy/ -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA &

Re: list.index crashes when the element is not found

2008-05-03 Thread Erik Max Francis
list; then, to find the index of that object. That's pointless wasteful. The Pythonic idiom is to catch the exception and then deal with it as desired. -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM, Y!M erikmaxfrancis -- http://mail.python.org/mailman/listinfo/python-list

Re: Feature suggestion: sum() ought to use a compensated summation algorithm

2008-05-03 Thread Erik Max Francis
string, which is nonsensical. You add strings to strings, or lists to lists, but mixing them up doesn't make sense. Python can't guess what you mean when you write something like ['abc', 'def'] + '' -- which is the functional equivalent of your call to s

Re: Feature suggestion: sum() ought to use a compensated summation algorithm

2008-05-03 Thread Erik Max Francis
Torsten Bronger wrote: No, the above expression should yield ''+'abc'+'efg', look for the signature of sum in the docs. You're absolutely right, I misread it. Sorry about that. -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcy

<    1   2   3   4   5   6   7   >