cs doesn't change that fact.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis
I will always remember / This moment
-- Sade
--
http://mail.python.org/mailman/listinfo/python-list
> Just keep doing what you are doing, please.
Note quite. The assignment of the resources to its variable needs to be
done before the try:
f = open(file)
try:
contents = f.read()
finally:
f.close()
--
Erik Max Francis && [EMAIL PROTECTED] &
aticMethod(x, y, z):
...
aStaticMethod = staticmethod(aStaticMethod)
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis
Wyrd has swept all my kin / all the brave chiefs away
d not only is that a major PITA, you almost never get it
> bug-for-bug right...
Especially since all of his examples have the same number of significant
digits (3), as the term is usually meant. Zeroes to the right are
significant, not zeroes to the left.
--
Erik Max Francis && [
Robert Kern wrote:
> There is no such command built in. You will have to build it yourself
> out of the components that are available.
linecache is probably what he's looking for.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose,
ly wanted to get the number of digits involved, then that's
fine, but that's not what significance is.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis
Eternity is very long, especially near the end.
-- Woody Allen
--
http://mail.python.org/mailman/listinfo/python-list
D H wrote:
> Yet again someone bitches about a thread right after they hypocritically
> throw their own little darts into the mix.
No one cares. Please take it elsewhere.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA &
Jonathan Bartlett wrote:
> I think you're misreading some of what is being said.
I think you're giving the author too much credit.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AI
this way?
Because it's not always needed. See staticmethod or classmethod.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis
The basis of optimism is sheer terror.
-- Oscar Wilde
--
http://mail.python.org/mailman/listinfo/python-list
lias_, which acts as a verb, but won't be
automatically scanned as a verb when help is finding the list of valid
verbs:
alias_hi = verb_hello
...
That way, you get maximum effectiveness for minimum clutter.
--
Erik Max Francis && [EMAIL PROTECTED] && http:
uestion was asked before he went on to show what wasn't working
for him.)
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis
To understand is to forgive, even oneself.
-
Jan Danielsson wrote:
>Is there any way to create a file with a specified size?
What do you want to put in the file? Once you've answered that
question, the solution should present itself.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
Sa
hen will all this information you can easily arrange the code to select
the best existing hand. Note that these all use well-established
techniques and reveal nothing secret.
> 3. x wild.
> For games like "deuces wild", what would be the best way to manage
> those? I tought
he same as the
straight set, then it's a straight. (Do this by reverse order of the
relative values of the straights, and stop when you find the first one,
to get the highest straight.) The most efficient way to do this is with
a bitmask, so that's how it's usually done.
--
s
> ...
You can also deal with them as a mask of card indexes. So the deuce of
clubs is bit 0, the three of clubs is bit 1, all the way up to the ace
of spades, which is bit 51. (That obviously won't fit in an int; you'll
need a long.)
--
Erik Max Francis && [EMAIL PR
Xah Lee wrote:
> Fuck the python doc wasted my time. Fuck python coders.
Use your words!
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis
The mind is not a vessel to
ents, then that is trivially easy to do by creating such an
object and overriding its `__call__` method.
If you're not willing to do that, but still insisting that `c[:]()`
makes sense, then perhaps it would be more advisable to learn more about
Python rather than try to suggest profoun
ast):
File "", line 1, in ?
TypeError: 'str' object is not callable
You also seem to be under the impression that `x[:]()` is somehow
special syntax that is treated differently than `y = x[:]; y()`. It is not.
Besides, _ambiguity_ was never the problem. _Functionality_ is the p
window of opportunity for profound changes.
Soon isn't all that soon. Furthermore, it is very unlikely that someone
is going to be able to suggest profound and useful changes to Python
without first being familiar with it. So stabbing in the dark is not
going to be very constructive for
efined as the length of the subtended arc divided by the
length of the radius, which is a length divided by a length, and thus
dimensionless. (Like in a lot of dimensional analysis, you write "rad"
when desired to give a helpful hint, not because it's necessary; the
radian has the s
ret sin(1.2) as sine of an angle measured in
> degrees or radians (or whatever else).
The problem with this reasoning is when angular-dimensioned quantities
pop out of trigonometric functions, which happens routinely in the world
of calculus. When that happens, you use radians (or steradians) o
for the original function.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM, Y!M erikmaxfrancis
The time to repair the roof is when the sun is shining.
-- John F. Kennedy
--
http://mail.python.org/mailman/listinfo/python-list
nd, now.
> It sounds like list comprehension may be slower because it builds a list
> that never gets used. I'm curious if eval statements are faster than def
> statements? Any bytecode experts?
Are you serious? Something that builds a list that never gets used is
exactly what you w
ed to iterate over the first 2**22 items in a list of 2**22+1
> items, making a copy of the sub-list first would probably be a bad idea :)
Then again, in that case, so would making a list of the indices with
`range`, which is what the original poster was suggesting.
--
Erik Max Francis &&am
, as there's no point in reading in the whole
file before iterating over it. To get the same effect as file iteration
in later versions, use the .xreadlines method::
for line in aFile.xreadlines():
...
--
Erik Max Francis && [EMAIL PROTECTED] &&
ay to do it -- and it isn't
to read the whole thing in first for no reason whatsoever other than to
avoid an `x`.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM, Y!M erikmaxfrancis
ess waste. This falls in the latter category.
Besides, someone was asking for/needing an older equivalent to iterating
over a file. That's obviously .xreadlines, not .readlines.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA &
which defaults to identity), and only support
comparisons when the user defines what it is he wants them to mean.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM, Y!M erikmaxfrancis
Water whic
it in hex string escape notation.
> Then if I try this:
>
> ---
> u_str = u"abc\u"
> reg_str = u_str.encode("utf-8")
> print reg_str
> ---
>
> I get the output:
>
> abc
>
> Here it looks like python isn't using the asci
onundrum of not understanding how the null set
relates to intersections.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM, Y!M erikmaxfrancis
Perfect girl / She was never me
-- Lamya
--
http://mail.python.org/mailman/listinfo/python-list
7 ( as
> defined in iso-8859-15 )
U+2019 is RIGHT SINGLE QUOTATION MARK. The APOSTROPHE (U+0027) is a
cross-reference as a similar code point, but they're not the same thing.
Your problem is that ISO-8859-15 doesn't have the RIGHT SINGLE QUOTATION
MARK, so you'll have to do the
**c), or they would have written
it more efficiently and clearly.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM, Y!M erikmaxfrancis
Men with empires in their purpose / And new eras in their b
ith ints!
But that's because ints are immutable, not because there is an explicit
copy of anything being made.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM, Y!M erikmaxfrancis
Ip
ld really like it if I could somehow do it in one
> line.
Why is doing it in one line a priority? Clarity is more important than
brevity.
Regardless, you can do it in one line with the sorted builtin:
>>> sorted(a.keys())
[1, 2, 3]
--
Erik Max Francis && [EMAIL PROTECT
g 1 forces me to do).
>
> Is there any way to combine the two? The ultimate would be if I
> somehow could take vector2 and hook the member self.vals[0] to self.x
> or something.
There are also full-featured Vector and Matrix classes in the la.py
module of ZOE:
http://www.alcyon
Ron Garret wrote:
> So this is clearly a bug, but surely I'm not the first person to have
> encountered this? Is there a known workaround?
It's hard to see how this demonstrates a bug in anything, since you're
telnetting to the wrong port in your example.
--
Erik
cent call last):
> File "", line 1, in
> File "", line 1, in bind
> socket.error: (48, 'Address already in use')
>>>> s.bind(('',8081))
>>>> s.listen(5)
>>>> f = s.accept()[0].makefile()
>>>> f.re
more general name for asyncore/asynchat is Medusa, and there are some
resources with more examples available here:
http://www.nightmare.com/medusa/
http://www.amk.ca/python/code/medusa.html
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
thing.
if x:
...
is not the same thing as
if x == True:
...
it's the same as
if bool(x):
...
So a more meaningful comparison of your two tests are:
>>> bool(0) == bool(False)
True
>>> bool([]) == bool(Fal
the end. Yes, it's the Laura Creighton
> article again:
>
> http://groups.google.com/group/comp.lang.python/msg/2de5e1c8384c0360
If so, be sure to click "More options," then "View thread," and then
read the responses. There were many reasonable objections to
g.
Really. He's not. That's a perfect example of a style guideline that
not only wastes energy, misses the point, but is totally wrong.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W &&
since it was not widely
granted as true.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM, Y!M erikmaxfrancis
Fear is an emotion indispensible for survival.
-- Hannah Arendt
--
http://mail.python.org/mailman/listinfo/python-list
Donn Cave wrote:
> "Not that it is of no historical interest" may have been too
> hard to follow, my apologies.
Yeah, my reading comprehension wasn't up to snuff that night.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jos
ng "PING" then
you do not want to do so by identity, but rather value, so you use the
`==` operator, not `is`.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM, Y!M erikmaxfrancis
You could have another fate / You could be in another place
-- Anggun
--
http://mail.python.org/mailman/listinfo/python-list
Gilles Ganault wrote:
> I'm sure there's a much easier way to read a two-column, CSV file into
> an array, but I haven't found it in Google.
>
> Should I use the Array module instead?
The csv module? Or just .rstrip and .split?
--
Erik Max Francis &
ady
bound to it; probably you have an HTTP server already running as part of
your default software installation and don't realize it.
Choose another port.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W &
ntinel object (e.g., `mySentinel = object()`), because that
is the only time you actually _are_ interested in identity. All other
times you are not really interested in identity.
Sample code as above is essentially showing unimportant implementation
details that should never concern you.
of large tuples can be expensive). Admittedly the empty
> tuple is a special case but then 'Special cases aren't special enough to
> break the rules'.
>
> A bit odd.
It doesn't save time if you have to check through all the existing
tuples for matches ...
--
Erik Max
e user (that's you and
> I) should *not* expect any particular behaviour to hold between
> different implementations.
Right. In the terminology of language standards, it is implementation
defined.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
loop, but since it's going to
be processing massive amounts of data, the faster the better. Are there
any tricks I'm not thinking of, or perhaps helper functions in other
modules that I'm not thinking of?
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcy
And of course I meant fastest, not "fatest." Fattest wouldn't be good,
either.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM, Y!M erikmaxfrancis
Whoever named it necking w
the sums as ints/longs to avoid losing precision, so
converting to floating point isn't an optional. (The sums are
normalized by the sizes of the files and expanded to 32 bits in order to
maximize precision.)
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.co
appear to work quite as dramatically well for me with strings
instead of lists, but it certainly is an improvement.
> Of course, that optimization doesn't work for the squared sum; using a
> lambda only pessimizes it.
Right.
--
Erik Max Francis && [EMAIL PROTECTED] &
unt)
> ordinalSumSquared = sum(ord(c)**2 * count[c] for c in count)
This approach is definitely faster than using a generator in my tests,
and was second fastest overall. I'm actually a bit surprised that it's
as fast as it is; it never would have occurred to me to try it this wa
l
the next day, but got a factor of two speedup within half an hour!
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM, Y!M erikmaxfrancis
It is morale that wins the victory.
-- Gen. George C. Marshall
--
http://mail.python.org/mailman/listinfo/python-list
negative. The usual translation from polar to Cartesian coordinates
makes this meaningful, albeit weird, so in effect the resulting
positions are just reflections around the origin.
Which I suppose is what the original poster was asking about, but it's
still not clear.
--
Erik Max Fra
u're going to have to
give more information about what you're doing, what you're using to do
it, and where it's giving you unexpected or undesired results if you
want help solving your problem.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/ma
6, 17:16:11)
[GCC 3.2.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 0x
4294967295L
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM, Y!M erikmaxfrancis
Black vinyl man with black plasticized imagination
-- Nik Kershaw
--
http://mail.python.org/mailman/listinfo/python-list
uch tasks
would be your ability to manipulate them and write your own. If tools
already exist that do what you need, which languages they were written
in would be completely irrelevant.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA &
ith a list,
then the sets-difference-and-then-make-a-list mechanism is appropriate.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM, Y!M erikmaxfrancis
It [freedom] must be demanded by the oppressed.
-- Dr. Martin Luther King, Jr.
--
http://mail.python.org/mailman/listinfo/python-list
assigning mutates the sequence. Slicing alone
returns a copy.
>>> L = ['one', 'two', 'three', 'four', 'five']
>>> x = L[1:] # grab a slice
>>> x[:] = [] # mutate it
>>> x
[]
>>> L # original li
t; towards the back of my mouth.
Native English accents vary as well, but _roll_ rhymes with _troll_, not
_trawl_. _Trawl_ would rhyme with _fall_, and _fall_ definitely doesn't
rhyme with _roll_.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San
t; sound in any
accent I've ever heard of. Which you pronounce _boat_ and _bot_ the
same way, too?
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM, Y!M erikmaxfrancis
There are no dul
;, ...]
for method in methods:
setattr(MyClass, method, lambda *x: Node(method, *x))
The first argument here will be the implicit self, if you don't want
that, strip off the first argument (or use lambda self, *x: ...).
--
Erik Max Francis && [EMAIL PROTECTED] &
Erik Max Francis wrote:
> Something like::
>
> method = ['fun', ...]
> for method in methods:
> setattr(MyClass, method, lambda *x: Node(method, *x))
Err, that first line was supposed to be methods = ...
--
Erik Max Francis && [EMAIL PROTECT
Asun Friere wrote:
> How do you figure that? Isn't the chart showing the frequency of
> those particular terms combined as a fraction of the total search
> volume on Google?
Who knows? The graph has no labeling or calibration for the y-axis, so
it's meaningless.
-
Hi,
How can I transform b so that the assertion holds? I.e., how can I
reverse the backslash-replaced encoding, while retaining the str-type?
>>> a = u'æ'
>>> b = a.encode('ascii', 'backslashreplace')
>>> b
'\\xe6'
>>> assert isinstance(b, str) and b == 'æ'
Traceback (most recent call last):
F
programming
language design. Excessive and needless verbosity is one thing; but
saving keystrokes for its own sake is not a priority and never should be.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM, Y!M erikmaxfrancis
I am not afraid / To be a lone Bohemian
-- Lamya
--
http://mail.python.org/mailman/listinfo/python-list
etter programmer, not just a better
Python programmer. I only wish I'd read through it earlier, which
would have saved me a lot of agony:)
-Tor Erik
--
http://mail.python.org/mailman/listinfo/python-list
def __init__(self, *a, **k):
super(Int, self).__init__(self, *a, **k)
>>> i = Int(1)
>>> i
1
Regards,
Tor Erik
--
http://mail.python.org/mailman/listinfo/python-list
since Io makes no such requirements.
The attribute and method (not made distinct in Io; they're called
"slots") is much the same as with Python; the current instance is
checked for the object, then its parents, then _its_ parents, and so on.
--
Erik Max Francis && [EMA
t the source sending the
object I'm sure someone must have had the same need and created
code for it... Maybe Pypy has what I need??? Haven't looked though...
Regards,
Tor Erik
PS: The string repr is created by a server outside of my control...
--
http://mail.python.org/mailman/listinfo/python-list
hat), but I wouldn't take the chance and rely on such an
implementation detail.
If you want to keep track of the order in which objects were added to a
dictionary, you'll need to keep a separate list of (sorted) keys, which
is easy enough. If you're lazy there are plenty of
g wrong. Without seeing actual code, it's
impossible to say what.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM, Y!M erikmaxfrancis
So little time, so little to do.
-- Oscar Lev
elf, x):
... self.x = x
... def __mul__(self, other):
... return C(self.x*other.x)
...
>>> result = C(2)*C(3)
>>> print result
<__main__.C instance at 0x402e13ec>
>>> result.x
6
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.
Hi,
What do I need to do to make the code below work as expected:
class str2(str):
def __setitem__(self, i, y):
assert type(y) is str
assert type(i) is int
assert i < len(self)
self = self[:i] + y + self[1+i:]
a = str2('1
our M's and a silent Q like the famous
> author Farles Wickens *wink*
"I knew a guy whose first name was Ed. He was so cool, he spelled it
with a hyphen." -- George Carlin
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA,
ees if the job has completed -- showing the results if it has --
or refreshes periodically if it hasn't yet.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM, Y!M erikmaxfrancis
You coul
7;t show anything until the entire process
> is complete and it's just a bunch of echo statements in a for loop,
> I'm not sure why they behave differently.
In a word: buffering.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA
ppreciated.
regards, Tor Erik
--
http://mail.python.org/mailman/listinfo/python-list
unwise. Instead
use int:
>>> int('00052')
52
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM, Y!M erikmaxfrancis
God grant me to contend with those that understand me
when it reaches the surface of Mars.
It was units of momentum that were inappropriately compared, actually.
(And it broke up before hitting the ground, but that's a minor quibble.)
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, US
eral, etc are appreciated. As
this is a contribution to the community I suggest that any
improvements are posted in this thread...
-Tor Erik
Code (tested on 2.5, but should work for versions >= 2.3):
'''
Recursive evaluation of:
tuples, lists, dicts, strings, unicode strings,
;credits" or "license" for more information.
>>>> import md5
>>>> s = md5.new()
>>>> s.update('snagglefrob')
>>>> s.hexdigest()
> '9eb2459fcdd9f9b8a9fef7348bcac933'
echo inserts a newline, your Python snippet doesn
popen, or one of the more involved
popen... modules, and then parse it however you like.
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 18 N 121 57 W && AIM, Y!M erikmaxfrancis
Who'd ever think it / Such
pass
the keywords no bother.
But if I call Bar with keywords, it calls the C++ version of Foo with
all arguments bunched together in "args" and not separated in args and
keywords.
What am doing wrong?
This is Python 2.5.1 - on Ubuntu 7.0.4 if that makes any difference.
Thanks
Duh
of course. Not sure what I had done in Python/Python.
Now it works. Thanks a lot.
Sven Erik
Chris Mellon wrote:
On Nov 27, 2007 6:47 AM, Sven Erik Knop <[EMAIL PROTECTED]> wrote:
Hi
I am getting slightly frustrated and wonder if you can help me.
Consider a Python cla
5)
>>> b = range(5, 8)
>>> min(a) if sum(a) < sum(b) else min(b)
0
In prior versions, you can use the and/or trick:
>>> (sum(a) < sum(b) and [min(a)] or [min(b)])[0]
0
-Tor Erik
--
http://mail.python.org/mailman/listinfo/python-list
et unpredictable behavior, you just get different behavior
you didn't expect, which is not the same thing. Python is a programming
language, like any other; randomly dropping letters in names is going to
result in bad behavior, so be more careful about it.
--
Erik Max Francis && [EMAI
ne"
> ... else:
> ... print "X is not None"
> ...
No, because you're iterating over an empty list, which does nothing:
>>> for x in []: print 'hi'
...
>>>
--
Erik Max Francis && [EMAIL PROTECTED] &&a
[EMAIL PROTECTED] wrote:
> Thanks, it looks like empy is what I need.
:-)
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis
The object of war is not to die for your country b
[EMAIL PROTECTED] wrote:
> Actually, that looks even better that EmPy for what I need.
:-(
--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis
All bad poetry springs from
ng pages for "python in" does not reveal very many relevant
> sources.
Yes, `in` is the relevant operator. It's quite simple to use:
>>> a = [1, 4, 9, 16, 25]
>>> 2 in a
False
>>> 4 in a
True
If you're having problems using it in some circumstan
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
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
[EMAIL PROTECTED] wrote:
> L = [4,3,2,1]
> L=L.sort()
> L will refer to None, why L.sort() don't return the L?
> I want to ask why the designer of Python do so?
Because that's the convention that signifies that a Python method
mutates the object rather than returns a
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
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
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 &&
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
701 - 800 of 988 matches
Mail list logo