Re: Decimal vs Float comparasion

2008-05-06 Thread Erik Max Francis
, so silently returning a completely invalid comparison is a tremendously bad idea. It's a bug. -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM, Y!M erikmaxfrancis Can I walk with you / 

Re: Mathematics in Python are not correct

2008-05-08 Thread Erik Max Francis
tical equation, this means (translated to Python) -(x**2), not (-x)**2. -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM, Y!M erikmaxfrancis I sleep and dream that life is / All beauty -- La

Re: why in returns values for array and keys for dictionary

2008-08-25 Thread Erik Max Francis
because that tends to be what you're usually more interested in, and is more efficient. For another thing, if you're doing a lot of testing for containment in values, then it's likely you're not using the right data structure, or combination of data structures. That's n

Re: why in returns values for array and keys for dictionary

2008-08-25 Thread Erik Max Francis
how the dictionary data structure works. If you're doing this an awful lot -- whether testing for inclusion or iterating -- then you're probably using the wrong data structure. -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA &

Re: Correcting for Drift between Two Dates

2008-09-08 Thread Erik Max Francis
ot at all clear what it is you're trying to do and why it isn't doing what you think it should. -- 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's better

Re: appending * to glob returns files with '*' !!

2008-09-21 Thread Erik Max Francis
turned anyway? :-/ A bug? No, it means you actually have a file named 'EN*' in the directory. -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM, Y!M erikmaxfrancis Many would be cowa

Re: Add vs in-place add of str to list

2008-10-02 Thread Erik Max Francis
which treats its argument as a generic sequence, and doesn't enforce type. The same thing happens with any other sequence type as the right-hand operand; for instance, tuples: >>> a = [] >>> a += (1, 2, 3) >>> a [1, 2, 3] >>> a = [] >>> a = a

Re: asynchat - operation could not complete w/ blocking

2006-03-08 Thread Erik Max Francis
doesn't block. In other words, all you want to do is call push/push_with_producer and leave it at that. -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis Eppur, si muove! [But still it moves!] -- Galileo Galilei -- http://mail.python.org/mailman/listinfo/python-list

Re: beautiful soup library question

2006-03-10 Thread Erik Max Francis
t a line break. If it were XHTML, it would be , indicating that it's a standalone tag. Instead you want to traverse the contents of the font tag, taking into account line breaks that you encounter. -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/

Re: how exactly do binary files work in python?

2006-03-12 Thread Erik Max Francis
u're dealing with a high-level language, you can also just use the pickle module for a more general form of serialization and persistence. -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 20 N 121 53 W &&

Re: markov query

2006-03-14 Thread Erik Max Francis
hether these are called markov > tables, transition tables or probability tables? I am not sure i am > referring to this correctly and what the differences would be if any They're called Markov chains. -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.co

Re: Unpythonic? Impossible??

2006-03-19 Thread Erik Max Francis
From the user's perspective, there's no difference from calling a class A to instantiate it, and calling a factory function called A that selects the appropriate class and returns an instance of it. -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ Sa

Re: Unpythonic? Impossible??

2006-03-19 Thread Erik Max Francis
lent from the user's perspective, and all require upkeep, but some require more upkeep than others. In a dynamic language like Python, the best solution is the most straightforward one that requires the least upkeep. And that's a factory pattern. -- Erik Max Francis && [

Re: Strings and % sign fails - Help Please

2006-03-23 Thread Erik Max Francis
h psycopg >> package. Any quick way to project a string from freak '%' problems? > > Try using r"string '%'"... Raw strings don't have anything to do with format specifiers. -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.c

Re: Strings and % sign fails - Help Please

2006-03-23 Thread Erik Max Francis
or.execute does format expansion with %, so a single % is not legal. -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis We are victims of our circumstance. -- Sade Adu -- http://mail.python.org/mailman/listinfo/python-list

Re: Difference between 'is' and '=='

2006-03-27 Thread Erik Max Francis
that maybe all Python entities are true objects and that integers are immutable, which are things hopefully everyone was already aware of. If you're trying to test integer equality, you should be using the `==` operator, not the `is` operator, so what you find out about how things are cachin

Re: difference between .cgi and .py

2006-03-29 Thread Erik Max Francis
, do it effects performance ?? Unless the server is fundamentally broken, it will make no difference whatsoever. -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis Physics, as we know it, w

Re: [ANN] markup.py - 1.2 - an HTML/XML generator

2006-04-03 Thread Erik Max Francis
ndicates that `klass` is more commonly mentioned than `class_`. `cls`, at least, is more commonly used within Python itself (e.g., classmethods). -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 20 N 121 53 W &&

Re: efficiency of range() and xrange() in for loops

2006-04-05 Thread Erik Max Francis
>> a, b, c = xrange(3) >>> a 0 >>> b 1 >>> c 2 There are certainly contexts where a sequence and its iterator are not interchangeable. You missed an obvious one: >>> range(3) == xrange(3) False -- Erik Max Francis && [EMAIL PROTECTED] &am

Re: New Karrigel page in Wikipedia

2006-04-13 Thread Erik Max Francis
result of an "encyclopedia" which anyone can edit. -- 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

Re: need clarification on -0

2009-11-30 Thread Erik Max Francis
ssions. See python.org/doc for more information. -- 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 You'll survive / A true Darwin star -- Des'ree -- http://mail.python.org/mailman/listinfo/python-list

Re: syntax error : first python program

2009-12-22 Thread Erik Max Francis
pradeep wrote: I have this file in linux === sample.py #!/usr/bin/env python name = "blah" print name ... Any one knows , whats the syntax error here? You're indenting for no reason. -- Erik Max Francis && m...@alcyone.com && h

Re: Why ELIF?

2009-10-11 Thread Erik Max Francis
xpressions. Variations of `else if` in `if ... else if ...` chains is routine in computer languages. Choosing a deliberately different syntax just for the sake it of is obtuse at best. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA &

Re: a=[1,2,3,4].reverse() - why "a" is None?

2009-10-12 Thread Erik Max Francis
Andre Engels wrote: The reverse function is a function to reverse the list in place, not a function to get the reverse of the list: x = [1,2,3,4] y = x z = x.reverse() will result in: x = y = [4,3,2,1] z = None .reverse returns None. See the documentation. -- Erik Max Francis &

Re: id( ) function question

2009-10-14 Thread Erik Max Francis
what the value of `id` is or how the `is` operator works, the short version is, don't worry about them, as you won't be using them. I'm really rather surprised at the number of questions about them. They're really something one does not need to worry about. -- Erik Max Fr

Re: id( ) function question

2009-10-15 Thread Erik Max Francis
x27;re the same object is pretty much never useful. The other canonical use of `is` would be comparison to `None`, which is also perfectly appropriate. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && A

Re: id( ) function question

2009-10-16 Thread Erik Max Francis
of and would have no obligation to switch to, just as with 3.0. -- 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 Nothing spoils a confession like repentence. -- Anatole France -- http://mail.python.org/mailman/listinfo/python-list

Re: (from stdlib-sig) ctypes or struct from an h file

2009-10-18 Thread Erik Max Francis
these things will be the same. -- 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 Diplomacy and defense are not substitutes for one another. Either alone would fail. -

Re: (from stdlib-sig) ctypes or struct from an h file

2009-10-19 Thread Erik Max Francis
on defined and need not be supported by any compilers. The proper way to do this is to define a protocol and translate it to the native structures on both sides of the communication -- both in Python and in C. There's really no way around this. -- Erik Max Francis && m

Re: Is there a command that returns the number of substrings in a string?

2009-10-23 Thread Erik Max Francis
ng. I'm wondering if there is a function in python which can directly return this information. The .count string method. -- 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

Re: Language mavens: Is there a programming with "if then else ENDIF" syntax?

2009-11-16 Thread Erik Max Francis
was not a suggestion to change Python. -- 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 Mona Lisa / Come to discover / I am your daughter -- Lamya -- http://mail.python.org/mailman/listinfo/python-list

Re: Language mavens: Is there a programming with "if then else ENDIF" syntax?

2009-11-16 Thread Erik Max Francis
the same syntax, with `fi` written instead of `endif` -- not sure why the difference in keyword is that big of a deal to you. As others have pointed out, either way, there are quite a few languages that use this type of syntax. -- Erik Max Francis && m...@alcyone.com && http:/

Re: Python-URL! - weekly Python news and links (Nov 24)

2009-11-24 Thread Erik Max Francis
t the answer they're looking for. The former is surely just laziness, but there's something psychological going on with the latter. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM/Y!

Re: Draft PEP on RSON configuration file format

2010-03-01 Thread Erik Max Francis
not one of them. Agreed. Even YAML's acronym indicates that it is already a bridge too far; we don't need more. -- 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 erikmax

Re: Draft PEP on RSON configuration file format

2010-03-01 Thread Erik Max Francis
point out that in their opinion it's not such a good idea. You don't own this or any other thread. -- 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 It's better to be quotable than to be honest. -- Tom Stoppard -- http://mail.python.org/mailman/listinfo/python-list

Re: Draft PEP on RSON configuration file format

2010-03-01 Thread Erik Max Francis
make your own "more readable" format. If JSON is unreadable, so must be RSON. -- 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 It's better to be quotab

Re: Draft PEP on RSON configuration file format

2010-03-02 Thread Erik Max Francis
#x27;s the argument being used against you, not the argument being ascribed to you. You're getting confused about something, somewhere. -- 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

Re: Draft PEP on RSON configuration file format

2010-03-02 Thread Erik Max Francis
Patrick Maupin wrote: On Mar 2, 9:20 pm, Erik Max Francis wrote: Patrick Maupin wrote: On Mar 2, 5:36 pm, Steven D'Aprano wrote: You seem to be taking the position that if you start with a config file config.json, it is "too hard to edit", but then by renaming it to config.rs

Re: Classes and threading

2010-05-18 Thread Erik Max Francis
t_ take any arguments, and explicitly call its parent constructor not passing anything. So it shouldn't be a wonder that it won't accept any arguments. If you don't intend to override the constructor in the parent class, simply don't define it. -- Erik Max Francis &&am

Re: question of style

2009-07-02 Thread Erik Max Francis
ngely turned inside out. You're obviously looking for which one _isn't_ `None`, so write the tests that way. It's much easier for everyone else (including your potential future self) to follow. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/m

Einstein summation notation (was: question of style)

2009-07-16 Thread Erik Max Francis
sy ways to verify you have a valid tensor equation using it. -- 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 If the sky should fall, hold up your hands. -- (a Spanish

Re: len() should always return something

2009-07-25 Thread Erik Max Francis
there are numerous applications where scalars and 1x1 matrices are mathematically equivalent. -- 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 Gods are born and die, but

Re: len() should always return something

2009-07-25 Thread Erik Max Francis
Chris Rebert wrote: On Sat, Jul 25, 2009 at 4:21 PM, Erik Max Francis wrote: Steven D'Aprano wrote: But it's not "practically every function". It's hardly any function at all -- in my code, I don't think I've ever wanted this behavior. I would consider it an

Re: len() should always return something

2009-07-26 Thread Erik Max Francis
eparate entity. Especially if you're dealing with a special-purpose language where everything is really a form of an generalized array representation of something _anyway_. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA &&

Re: OT Signature quote [was Re: Unrecognized escape sequences in string literals]

2009-08-14 Thread Erik Max Francis
ell, plus or minus newlines. -- 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 It's hard to say what I want my legacy to be when I'm long gone. -- Aaliyah -- http://mail.python.org/mailman/listinfo/python-list

Re: OT Signature quote [was Re: Unrecognized escape sequences in string literals]

2009-08-14 Thread Erik Max Francis
Grant Edwards wrote: On 2009-08-14, Erik Max Francis wrote: Grant Edwards wrote: On 2009-08-14, Steven D'Aprano wrote: What the hell would it actually do??? IIRC in C++, cout << "Hello world"; is equivalent to this in C: printf("Hellow world")

Re: OT Signature quote [was Re: Unrecognized escape sequences in string literals]

2009-08-16 Thread Erik Max Francis
nt. Given the history of programming languages, it doesn't really look like the to-be-assigned variable being at the end of expression is going to get much play, since not a single major one I'm familiar with does it that way, and a lot of them have come up with the same convention

Re: OT Signature quote [was Re: Unrecognized escape sequences in string literals]

2009-08-16 Thread Erik Max Francis
Douglas Alan wrote: Personally, my favorite is Lisp, which looks like (set! y (+ y 1)) For varying values of "Lisp." `set!` is Scheme. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W &&

Re: IOError: [Errno 22] invalid mode ('wb') or filename: in windows xp while making tarfile

2009-08-23 Thread Erik Max Francis
trings), too, or that's going to bite you sometime later (but it's not your main problem here). -- 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 Every human being is a problem in search of a solution. -- Ashley Montague -- http://mail.python.org/mailman/listinfo/python-list

Re: Numeric literals in other than base 10 - was Annoying octal notation

2009-08-24 Thread Erik Max Francis
large literals, I'd go with having spaces indicate automatic concatenation (though only the first in the series can indicate the radix, whichever method you choose above). It's the same as for strings, and it's the common SI recommendation for thousands separators anyway. -- Erik Ma

Re: Numeric literals in other than base 10 - was Annoying octal notation

2009-08-24 Thread Erik Max Francis
with decimal 304? You can't, and the operation makes no sense, which is what makes the syntax unambiguous. An extended numeric literal continues the radix of wherever it started. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA &a

Re: Literal concatenation, strings vs. numbers

2009-08-24 Thread Erik Max Francis
ne so upset by this that it didn't make it into the language, or cause huge confusion on a regular basis that upsets a lot of users? Nope. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W &&

Re: Numeric literals in other than base 10 - was Annoying octal notation

2009-08-24 Thread Erik Max Francis
James Harris wrote: On 24 Aug, 09:05, Erik Max Francis wrote: Here's another suggested number literal format. First, keep the familar 0x and 0b of C and others and to add 0t for octal. (T is the third letter of octal as X is the third letter of hex.) The numbers above would be 0b1011, 0

Re: Numeric literals in other than base 10 - was Annoying octal notation

2009-08-24 Thread Erik Max Francis
hard to imagine). Either way, conversion is, as Max showed, one line of code. It's hard to see the explicit need for truly arbitrary-radix literals in any language -- and I'm the guy who's put quaternary literals in syntaxes he's had to develop just for fun. Binary

Re: Numeric literals in other than base 10 - was Annoying octal notation

2009-08-24 Thread Erik Max Francis
Hendrik van Rooyen wrote: I also tried to include an example of a literal with a base of a Googol but I ran out of both ink and symbols. :-) ... or particles in the observable Universe, for that matter. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ S

Re: Annoying octal notation

2009-08-24 Thread Erik Max Francis
gure. 9 is not the same as 9.0 or 9.000. -- 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 If the sky should fall, hold up your hands. -- (a Spanish proverb) -- http://mail.python.org/mailman/listinfo/python-list

Re: Temat:,Re: IOError: [Errno 22] invalid mode ('wb') or filename: in windows xp while making tarfile

2009-08-24 Thread Erik Max Francis
lt with it. Had to change 'w:bz2' into 'w|bz2'. But now have another problem: It's the same problem, asked and answered. Why not read the replies of the people telling you what the problem is? -- Erik Max Francis && m...@alcyone.com && http://www.alcyon

Re: Numeric literals in other than base 10 - was Annoying octal notation

2009-08-26 Thread Erik Max Francis
ant to talk about it you have to disclaim that it's not a proper base and that's you're making up as you go. But you can't pretend like it's the "obvious" mathematical meaning just because the usual mathematical meaning doesn't apply, which is what you see

Re: "Strong typing vs. strong testing"

2010-09-28 Thread Erik Max Francis
ror: and do not have compatible units And everybody's favorite: >>> print ((epsilon_0*mu_0)**-0.5).simplify() 299792458.011 m/s >>> print c # floating point accuracy aside 299792458.0 m/s -- 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 In Heaven all the interesting people are missing. -- Friedrich Nietzsche -- http://mail.python.org/mailman/listinfo/python-list

Re: "Strong typing vs. strong testing"

2010-09-28 Thread Erik Max Francis
Keith Thompson wrote: Erik Max Francis writes: [...] >>> print c # floating point accuracy aside 299792458.0 m/s Actually, the speed of light is exactly 299792458.0 m/s by definition. (The meter and the second are defined in terms of the same wavelength of light; this wa

Re: "Strong typing vs. strong testing"

2010-10-12 Thread Erik Max Francis
ey'll work will help alone. If you're calling a trigonometric function with a dimensionless argument, you either mean radians are you've got bigger problems with the understanding of unit systems. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/

ANN: EmPy 4.0.1

2024-01-01 Thread Erik Max Francis via Python-list
nges between EmPy 3._x_ and 4.0](http://www.alcyone.com/software/empy/ANNOUNCE.html#full-list-of-changes-between-empy-3-x-and-4-0) for a more comprehensive list. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57

ANN: EmPy 4.2 -- a powerful, robust and mature templating system for Python

2024-08-25 Thread Erik Max Francis via Python-list
. See [Full list of changes between EmPy 3._x_ and 4.0](http://www.alcyone.com/software/empy/ANNOUNCE.html#all-changes) for a more comprehensive list. -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W &am

Re: Python List is Not Dead

2024-12-30 Thread Erik Max Francis via Python-list
list gatewayed to usenet though, there's really nothing so good as usenet for proper discourse (!). Hear, hear! -- Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && Skype erikmaxfrancis The quality

<    2   3   4   5   6   7