; 3. It use kind of Array/Matrix analysis style
> 4. We have to change our algorithms so that Numeric or Numpy can help
> us, Matrix style
That's correct more or less.
George
--
http://mail.python.org/mailman/listinfo/python-list
tion, and Google is picking up the tab for an hour and a half
> of open bar and food. Additionally, if you're looking for a job as a
> Python developer, bring your resume.
>
> Please RSVP at http://rsvp.nylug.org to attend, as seating is limited.
>
> - Ron
What date is it ? I
]
src_dir = path('/tmp/source/')
dest_dir = path('/tmp/destination/')
for filename in files:
srcfile = src_dir / filename
if srcfile.exists():
srcfile.copy(dest_dir)
George
--
http://mail.python.org/mailman/listinfo/python-list
w = self.__class__(**self.__dict__)
new.__dict__.update(kwds)
return new
Personally I would prefer an explicit method name, e.g. 'copy'; hiding the fact
that 'shape' is a
class while the rest are instances is likely to cause more trouble than it's
worth.
George
--
http://mail.python.org/mailman/listinfo/python-list
was this:
Apparently you're not the first to think of it:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/425445.
George
--
http://mail.python.org/mailman/listinfo/python-list
"George" <[EMAIL PROTECTED]> wrote:
> How can I do the following in python:
>
> [snipped]
In exactly the same way you could do it if you actually read the replies to the
thread with the same
topic you posted yesterday. Duh!
George
--
http://mail.python.org/mailman/listinfo/python-list
erate(description))
>
> James
>
> On Friday 14 October 2005 08:37, Steve Holden wrote:
> > >>> dct = dict((x[1], x[0]) for x in enumerate(description))
> > >>> dct
> >
> > {'second': 1, 'third': 2, 'first': 0}
Or even simplest :-)
dct = dict(enumerate(description))
George
--
http://mail.python.org/mailman/listinfo/python-list
Keith Thompson wrote:
> "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes:
> > Hm... What does this have to do with Perl?
> >
> > Why did you post this in comp.lang.perl.misc?
>
> He posted this in comp.lang.python, comp.lang.perl.misc,
> comp.unix.programmer, comp.lang.java.programmer, *and*
> comp.
ny ideas? Am I stuck with the clumsy exec-solution, or are there other
> ways to dynamically generate doc-strings of classes?
There's nothing specifically about doc-strings, but you can create and
customise a whole class
dynamically:
def makeBaseSubclass(impClassAttr):
return type('new_%s' % impClassAttr,
(base,object),
{'ImportantClassAttribute': impClassAttr,
'__doc__': 'The case %s' % impClassAttr})
>>> new = makeBaseSubclass(7)
>>> new.ImportantClassAttribute
7
>>> new.__doc__
'The case 7'
HTH,
George
--
http://mail.python.org/mailman/listinfo/python-list
_main__"). I just feel dirty about it.
Well, I feel dirty every time I have to share globals .
George
--
http://mail.python.org/mailman/listinfo/python-list
for x in some_set.intersection(another_set)]
print "unique_some:", [x.obj for x in some_set.difference(another_set)]
print "unique_another:", [x.obj for x in another_set.difference(some_set)]
George
--
http://mail.python.org/mailman/listinfo/python-list
;>> t, l = s.split('|')
> Traceback (most recent call last):
> File "", line 1, in ?
> ValueError: too many values to unpack
> >>>
>
> so, i imagine what is happening is the lhs, t,l, is really
> (t, (l)), i.e. only two items.
>
form ::upper:: or similar syntax, but can't find them in the docs.
> Maybe I'm getting it mixed up with Perl regexen.
>
> The upper() and lower() methods do work on accented characters in a
> unicode string, so there has to be some recognition of unicode case
> in there som
this to be
expected and if so, should I expect better performance (i.e. linear or almost
linear) from a real
database, e.g. sqlite ?
George
--
http://mail.python.org/mailman/listinfo/python-list
"Paul Rubin" <http://[EMAIL PROTECTED]> wrote:
> "George Sakkis" <[EMAIL PROTECTED]> writes:
> > I'm trying to create a dbm database with around 4.5 million entries
> > but the existing dbm modules (dbhash, gdbm) don't seem to cut
> >
of thanks in advance!
>
> Gonnasi
Using the path module (http://www.jorendorff.com/articles/python/path/):
from path import path
path('.').files()
George
--
http://mail.python.org/mailman/listinfo/python-list
al tests. It
would be neat to have it ported in python, at least the inference part.
George
--
http://mail.python.org/mailman/listinfo/python-list
gbuji.net/tech/akara/nodes/2003-01-01/python-xslt
Neat, though non-trivial XSLT makes my head spin. Just for kicks, I
rewrote in python Michael Kay's DTDGenerator
(http://saxon.sourceforge.net/dtdgen.html), though as the original it
has several limitations on the accuracy of the inferred DTD.
George
--
http://mail.python.org/mailman/listinfo/python-list
frozenset(['a', 'c'])
frozenset(['c', 'b'])
frozenset(['a', 'c', 'b'])
'''
yield frozenset()
for s in _powerset(iter(iterable)):
yield s
def _powerset(iterator):
first = frozenset([iterator.next()])
yield first
for s in _powerset(iterator):
yield s
yield s | first
George
--
http://mail.python.org/mailman/listinfo/python-list
'isoweekday', 'max', 'min', 'month',
'replace', 'resolution', 'strftime', 'timetuple', 'today', 'toordinal',
'weekday', 'year']
- Where do the attributes of a datetime.date instance live if it has
neither a __dict__ nor __slots__ ?
- How does dir() determine them ?
- dir() returns the attributes of the instance itself, its class and
its ancestor classes. Is there a way to determine the attributes of the
instance alone ?
TIA,
George
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> Pass your script to Perl via standard input:
> echo "print 'Hello, world'" | perl -
$ echo "print 'hello, world'" | python -
hello, world
Cheers,
--
george
--
http://mail.python.org/mailman/listinfo/python-list
utor/24986
> http://www.crummy.com/software/BeautifulSoup/
> http://www.aaronsw.com/2002/xmltramp/
> http://www.xml.com/pub/a/2005/01/19/amara.html
One more: http://www.xml.com/pub/a/2003/07/02/py-xml.html
George
--
http://mail.python.org/mailman/listinfo/python-list
want to. OTOH, you'll probably need other
people's code that is OO, so at the very least you'll have to be able
to read and use it. Fortunately, using an existing OO module/library is
much easier than designing and writing it, so you can get away with it
with little effort.
George
--
http://mail.python.org/mailman/listinfo/python-list
"Jorge Godoy" <[EMAIL PROTECTED]>:
> H... I don't see mine listed there: I'm in South America, Brasil. More
> specifically in Curitiba, ParanĂ¡, Brasil. :-)
That's funny; I was looking for mine and I stumbled across yours at
Piscataway, NJ, US. :-
and be
actually able to read, debug, refactor or extend it after 6 months.
George
--
http://mail.python.org/mailman/listinfo/python-list
quite
> appropriate here.
What about the future of itertools in python 3K ? IIRC, several
functions and methods that currently return lists are going to return
iterators. Could this imply that itertools.(imap/ifilter/izip) will
take the place of map/filter/zip as builtins ?
George
--
http:/
need to go through the whole range even if p = lambda x: x < 2
Itertools is your friend in this case:
>>> from itertools import takewhile
>>> list(takewhile(p, xrange(1000)))
[0, 1]
George
--
http://mail.python.org/mailman/listinfo/python-list
"Steve Holden" <[EMAIL PROTECTED]> wrote:
> George Sakkis wrote:
> > Itertools is your friend in this case:
> >
> >>>>from itertools import takewhile
> >>>>list(takewhile(p, xrange(1000)))
> >
> > [0, 1]
>
> Maybe,
.state = OPENED
Or if you want something closer to real enumerations, there are several
recipes in the cookbook.
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/413486 seems to
be pretty good according to the ratings.
George
--
http://mail.python.org/mailman/listinfo/python-list
link?
Not a permanent one, but I posted it at
http://rafb.net/paste/results/rbxGWw37.html if you want to grab it.
Season to taste.
George
--
http://mail.python.org/mailman/listinfo/python-list
n, you may check the recipe
here:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/409366.
George
--
http://mail.python.org/mailman/listinfo/python-list
% (name, attr))
cls.__setattr__ = __setattr__
return type.__new__(cls, name, bases, dict)
class PhysicsConstants(object):
__metaclass__ = CONST
c = 2.9979246e+08
>>> PhysicsConstants.c = 0
AttributeError: Cannot reassign constant PhysicsConstants.c
George
--
http://mail.python.org/mailman/listinfo/python-list
, 3, 1], None]}
> #why c can not append the sorted b??
In python 2.4, you can use the sorted() builtin instead:
c[2].append(sorted(b))
George
--
http://mail.python.org/mailman/listinfo/python-list
, 3, 1], None]}
> #why c can not append the sorted b??
In python 2.4, you can use the sorted() builtin instead:
c[2].append(sorted(b))
George
--
http://mail.python.org/mailman/listinfo/python-list
:
from itertools import islice
newList = zip(islice(aList,0,None,2), islice(aList,1,None,2))
George
--
http://mail.python.org/mailman/listinfo/python-list
ine a base class that provides
a default implementation of a full protocol, yet disallow its direct
instantiation,
as in the example below.
George
#===
# test_abstract.py
import unittest
from abstract import abstractclass
str expected (int given)
# >>> f('1',[2,'3'])
# (...)
# TypeError: container expected ([2, '3'] given)
# >>> f('1',[2,3,4])
# (...)
# TypeError: Container of size 3 expected ([1, 2, 3, 4] given)
I can make it available somewhere (e.g. Vaults of Parnassus) if there's enough
interest.
George
--
http://mail.python.org/mailman/listinfo/python-list
> Hi George,
> it would be nice to see how you have tackled
> the task.
> Maybe we will have a checker
> module in Python one day... ;-)
I posted my module on http://rafb.net/paste/results/voZYTG78.html and its unit
test on
http://rafb.net/paste/results/MYxMQW95.html. Any f
I'll post an entry on Vaults of Parnassus as soon as I publish it.
George
--
http://mail.python.org/mailman/listinfo/python-list
Why does slicing a tuple returns a new tuple instead of a view of the existing
one, given that
tuples are immutable ? I ended up writing a custom ImmutableSequence class that
does this, but I
wonder why it is not implemented for tuples.
George
--
http://mail.python.org/mailman/listinfo
ng
> type, but that idea was rejected, for the very same "and how do you get rid of
> the original object" reason)
>
>
Fair enough. So perhaps the question is whether such cases are more regular
than something like:
a = give_me_a_huge_tuple()
slices = [a[i:j] for i in xrange(len(a)) for j in xrange(i+1, len(a)+1)]
George
--
http://mail.python.org/mailman/listinfo/python-list
"Peter Hansen" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
> George Sakkis wrote:
> > Fair enough. So perhaps the question is whether such cases are more regular
> > than something like:
> > a = give_me_a_huge_tuple()
> > slices = [a[i:j
it doesn't have to. One can represent a view as essentially an
object with a pointer
to a memory buffer and a (start,stop,step) triple. Then a "real tuple" is just
a "view" with the
triple being (0, len(sequence), 1).
George
--
http://mail.python.org/mailman/listinfo/python-list
"Jeff Shannon" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
> [My newsreader crapped out on sending this; apologies if it appears
> twice.]
>
> George Sakkis wrote:
>
> > "Terry Reedy" <[EMAIL PROTECTED]> wrote in message
> &g
An iterator is perfectly ok if all you want is to iterate over the
elements of a view, but as you noted, iterators are less flexible than
the underlying sequence. The view should be (or at least appear)
identical in functionality (i.e. public methods) with its underlying
sequence.
George
I got one (and only
so far) good reason
for the current implementation from Fredrik Lundh, namely the reference to the
original object.
> As George Sakkis the OP noted, the essential data constituting a contiguous
> section view are the underlying sequence and two position markers. Whether
&g
"Jeff Shannon" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
> George Sakkis wrote:
>
> > An iterator is perfectly ok if all you want is to iterate over the
> > elements of a view, but as you noted, iterators are less flexible than
> > the und
ns (I know it's a stupid example, don't flame
me for this):
$ python /usr/lib/python2.3/timeit.py \
-s "x=tuple(xrange(1))" \
"[x[1:-1] for n in xrange(100)]"
10 loops, best of 3: 3.84e+04 usec per loop
$ python /usr/lib/python2.3/timeit.py \
-s "from immutableseq import ImmutableSequence" \
-s "x=ImmutableSequence(xrange(1))" \
"[x[1:-1] for n in xrange(100)]"
100 loops, best of 3: 5.85e+03 usec per loop
Feel free to comment or suggest improvements.
George
--
http://mail.python.org/mailman/listinfo/python-list
otherwise?
popen2.Popen3, popen2.Popen4 and subprosess.Popen have poll/wait methods.
These will do what you're looking for.
--
George
--
http://mail.python.org/mailman/listinfo/python-list
useful, I think they (c|sh)ould make it into the
next release of
distutils.
George
--
http://mail.python.org/mailman/listinfo/python-list
>>> '(1 (2 3) (4 5) foo)'
Here duck typing doesn't help because the function should take the if
branch only for lists and not other iterables (e.g. strings).
George
--
http://mail.python.org/mailman/listinfo/python-list
might/should be refactored so that the decision between each
obj_i_a and obj_i_b is done in a separate obj_i_factory callable. If
you provide an example or two of specific triples (type_of_obj_i,
obj_i_a, obj_i_b), we'll have a better idea of whether factories are an
overkill in this case or not.
George
--
http://mail.python.org/mailman/listinfo/python-list
s except for lists are considered atomic ? An implementation of
s-expressions would use a single data structure for the nesting (e.g. a
builtin list or a custom linked list) and objects of all other types
should be considered atoms, even if they happen to be iterable.
George
--
http://mail.python.org/mailman/listinfo/python-list
n __iter__ method.
It would be more uniform if the default 'type' metaclass added an
__iter__ method to classes that define __getitem__ but not __iter__
with something like:
from itertools import count
def __iter__(self):
for i in count():
try: yield self[i]
excep
ur of iterators for classes
that define __getitem__ without __iter__:
class AnIterable(object):
def __init__(self, it): self._it = it
def __getitem__(self,i): return self._it[i]
>>> x = AnIterable(dict(a=1,b=2))
>>> list(x)
KeyError: 0
George
--
http://mail.python.org/mailman/listinfo/python-list
>>> num2str(-1934)
'-1,934'
'''
parts = []
div = abs(num)
while True:
div,mod = divmod(div,1000)
parts.append(mod)
if not div:
if num < 0: parts[-1] *= -1
return ','.join(str(part) for part in reversed(parts))
Regards,
George
--
http://mail.python.org/mailman/listinfo/python-list
last but not least, Boost.Python. I don't think it's just a
coincidence that among all languages they chose Python to make
interoperable with C++ :-)
Thanks again,
George
--
http://mail.python.org/mailman/listinfo/python-list
arget_lang argument but CCompiler.link() does). Is there a good
reason for this ?
George
--
http://mail.python.org/mailman/listinfo/python-list
"George Sakkis" wrote:
> I'm trying to build a C++ extension on Cygwin, but it fails because
> distutils invokes gcc instead of g++. Looking into distutils internals,
> it turns out that compilation is assumed to be independent of the
> target language, while linkin
e a defined name, use del:
>>> foo=None
>>> print foo
None
>>> del foo
>>> print foo
NameError: name 'foo' is not defined
George
--
http://mail.python.org/mailman/listinfo/python-list
eful. Any ideas ?
George
--
http://mail.python.org/mailman/listinfo/python-list
to have for
time-critical situations, assuming that other optimization solutions
(psyco, pyrex, weave) are not applicable.
George
--
http://mail.python.org/mailman/listinfo/python-list
ort snippet
that works for 2.3 or later:
try: set
except NameError:
from sets import Set as set
George
--
http://mail.python.org/mailman/listinfo/python-list
ger answer is you can
create a, say, MutableInt class whose instances behave as modifiable
integers. Most probably you don't really need this, but if you think
you do, others in the list will sketch out how.
George
--
http://mail.python.org/mailman/listinfo/python-list
wordCount[word] += 1
wordPos[word].append(pos)
Other candidate optional arguments would allow type checking (e.g.
dict(keys=int, values=list)) or performance fine-tuning (e.g.
dict(minsize = 10, maxsize = 1, average = 200)). I hope the
decision for this form of the constructor is reconsidered for python
3K.
George
--
http://mail.python.org/mailman/listinfo/python-list
e searching for single characters
(such as digits), perhaps the fastest way is to use string.translate:
>>> import string
>>> allchars = string.maketrans('','') # 2 empty strings
>>> nondigits = allchars.translate(allchars, string.digits)
>>> '1 ab 34 6'.translate(allchars, nondigits)
'1346'
Note that the result is a string of the matched characters, not a list;
you can simply turn it to list by list('1346').
Hope this helps,
George
--
http://mail.python.org/mailman/listinfo/python-list
"Steven D'Aprano" wrote:
> On Sat, 25 Jun 2005 06:44:22 -0700, George Sakkis wrote:
>
> > "Roy Smith" <[EMAIL PROTECTED]> wrote:
> >
> >> I just re-read the documentation on the dict() constructor. Why does it
> >> support ke
behaviour of current built-ins.
> Filter, for instance, doesn't always return lists and map accepts more
> than one seq... Just my $.02.
>
> - kv
If they go to itertools, they can simply be:
def map(f, *iterables):
return list(imap(f,*iterables))
def filter(f, seq):
return list(ifilter(f,seq))
George
--
http://mail.python.org/mailman/listinfo/python-list
"Konstantin Veretennicov" <[EMAIL PROTECTED]> wrote:
> > On 25 Jun 2005 12:17:20 -0700, George Sakkis <[EMAIL PROTECTED]> wrote:
> > If they go to itertools, they can simply be:
> >
> > def map(f, *iterables):
> > return list(imap(f,*iterabl
gex module has since 2.2 a function (and method for regex
objects) called finditer that does exactly that. Perhaps str (and
unicode) should have it too for consistency ?
George
--
http://mail.python.org/mailman/listinfo/python-list
vention (e.g.
CamelCase for classes, mixedCase for methods, etc.). See also
http://www.python.org/peps/pep-0008.html for some (semi-)standard
conventions.
George
--
http://mail.python.org/mailman/listinfo/python-list
"Bengt Richter" <[EMAIL PROTECTED]> wrote:
> On 12 Jun 2005 08:06:18 -0700, "George Sakkis" <[EMAIL PROTECTED]> wrote:
>
> >I had written a script to do something close to this; currently it
> >doesn't do any kind of aggregation, but it s
1.0 1.0
> 1+2j (1+2j)
> 1+0j (1+0j)
> True True
> False False
> A A
Nice technique. Something that needs to be pointed out is that the
order of the converters *is* important; int takes precedence over
float, which take precedence over complex and bool takes precedence
over string. More succinctly:
{ int -> float -> complex }
{ bool -> str }
In general the converters will form a strict partially ordered set, so
the list of converters should be a topological sort of the respective
DAG.
George
--
http://mail.python.org/mailman/listinfo/python-list
ying a defaultTest if
unittest.main() was looking also for TestSuites in addition to
TestCases within each module. Is this a design choice ?
Regards,
George
--
http://mail.python.org/mailman/listinfo/python-list
I'd love to see IPython replace the standard interpreter. Pychecker
seems to be a strong candidate too.
George
--
http://mail.python.org/mailman/listinfo/python-list
> "bruno modulix" <[EMAIL PROTECTED]> wrote:
> George Sakkis wrote:
> > I'd love to see IPython replace the standard interpreter.
> I dont.
Care to say why ?
George
--
http://mail.python.org/mailman/listinfo/python-list
"Reinhold Birkenfeld" <[EMAIL PROTECTED]> wrote:
> George Sakkis wrote:
> >> "bruno modulix" <[EMAIL PROTECTED]> wrote:
> >
> >> George Sakkis wrote:
> >> > I'd love to see IPython replace the standard interprete
ors
instead of lists in several contexts (e.g. dict.keys(), dict.items()),
so perhaps zip will stand for what itertools.izip is today.
George
--
http://mail.python.org/mailman/listinfo/python-list
"Tom Anderson" <[EMAIL PROTECTED]> wrote:
> if it hadn't been for the quirks of the Cockney accent, we'd all be using
> curly
> brackets and semicolons.
+1 QOTW
George
--
http://mail.python.org/mailman/listinfo/python-list
rt re
a = 'test string'
b = re.match(r'test (\w+)', a).group(1)
print b
George
--
http://mail.python.org/mailman/listinfo/python-list
#x27;
b = re.match(r'test \w{2}(.+)', a, re.DOTALL).group(1)
print b
By the way, if you want to catch any single character (including new
lines), '.' with re.DOTALL flag is more clear than [\W\w].
George
--
http://mail.python.org/mailman/listinfo/python-list
e lack of a ternary if?then:else operator manifests itself in such
examples, but alas, there isn't much hope that even python 3K will have
one...
Would-go-with-ugly-syntax-than-no-syntax-any-day'ly yrs,
George
--
http://mail.python.org/mailman/listinfo/python-list
more efficiently written as:
from itertools import izip, islice
d = dict(izip(islice(translations,0,None,2),
islice(translations,1,None,2)))
George
--
http://mail.python.org/mailman/listinfo/python-list
gt; doing in the second line?
>
> Regards
> David
Why don't you fire up the python interpreter and type
>>> help(zip)
>>> zip([1,2,3],"abc")
Teaching-a-man-to-fish-instead-of-giving-him-a-fish'ly yrs,
George
--
http://mail.python.org/mailman/listinfo/python-list
ctly the same in that it doesn't change values in
> place, but this is similar if you are only interested in the
> values:
>
> ta = [t>=10 and t-10 or t+10 for t in ta]
Not quite; it differs for t==10.
George
--
http://mail.python.org/mailman/listinfo/python-list
"David Pratt"
> Thanks George! You guys are great! I am always learning. Python is
> awesome!!
Yeap, that was the reaction of many/most of us when we stumbled upon
python. Welcome aboard !
George
--
http://mail.python.org/mailman/listinfo/python-list
"[EMAIL PROTECTED]" wrote:
> I am a java programmer and I want to learn Python Please help me.
Google Is Your Friend:
http://www.razorvine.net/python/PythonForJavaProgrammers
http://www.ferg.org/projects/python_java_side-by-side.html
George
--
http://mail.python.org/mailman/li
recipe
(http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/410698) comes
pretty close to it, but I wouldn't mind a small addition to the
language syntax for something so useful as properties.
Keeping the language small is a worthwhile goal, but it should be
traded off with conciseness and re
"Tom Anderson" wrote:
> On Fri, 1 Jul 2005, George Sakkis wrote:
>
> > Keeping the language small is a worthwhile goal, but it should be traded
> > off with conciseness and readability; otherwise we could well be content
> > with s-expressions.
>
>
c.l.py, e.g.
http://tinyurl.com/d3lfx.
HTH,
George
--
http://mail.python.org/mailman/listinfo/python-list
an attribute should be hidden or
unnecessary to its subclasses by being declared "private" instead of
"protected". The distinction between public and non-public (private +
protected) is more understandable, but again python's philosophy is
"we're all consenting adults here". _single_underscored names just
flash a "use at your own risk" signal, instead of tying your hands in
case the original class designer made a wrong assumption.
George
--
http://mail.python.org/mailman/listinfo/python-list
e work done you need to look elsewhere. It's a
> shame...
What do we have here, a perl troll ? Perhaps you need to post elsewhere
"to have fun".
George
--
http://mail.python.org/mailman/listinfo/python-list
example I discovered that properties cannot be
unbound, i.e. using path.ext instead of getExtension raises TypeError.
Couldn't/shouldn't Class.prop(instance) be allowed as equivalent of
instance.prop, just as methods ?
> The answer to the question "is there a better w
where the middle part of the strings remains
> > unmodified.
> >
> > Any suggestions?
> >
> > Peace.
> > Vibha
Fire up the interpreter and write:
>>> import re
>>> line = 'see this man with that woman holding this dog and that cat'
&
may be
released in parallel with 2.5-2.9
(http://www.python.org/doc/essays/ppt/euro2004/euro2004.ppt), I guess
this *someday* will be no later than 2015-16, probably sooner than
that.
George
--
http://mail.python.org/mailman/listinfo/python-list
e
http://docs.sun.com/source/806-3568/ncg_goldberg.html,
http://http.cs.berkeley.edu/~demmel/cs267/lecture21/lecture21.html for
more.
George
--
http://mail.python.org/mailman/listinfo/python-list
reason for it, though.
How about 'conformance with standard mathematic notation', does this
count for a terribly good reason ? What would one expect to be the
result of 5^2 - 2^2, 29 or 21 ? Would you expect 5^2 + - 2^2 to be
different, even if you write it as 5^2 + -2 ^ 2 ? White space is not
significant in math AFAIK ;-)
George
--
http://mail.python.org/mailman/listinfo/python-list
nt, raw_input('Type 4 numbers separated '
'by spaces:').split())
If you want to do error handling later, you may need to split this line
into two steps so that you can distinguish between invalid values and
wrong count of values (less or more than 4).
George
--
http://mail.python.org/mailman/listinfo/python-list
e it in the end,
but it's better than starting from scratch. Let me know if you're
interested and I'll send it over.
Regards,
George
--
http://mail.python.org/mailman/listinfo/python-list
ther than 'unknown'. It
makes sense to have x==y, because x and y are the outcome of the *same*
invalid operation. Similarly, if z=0/0, z would also be invalid, but
different from x and y, since it is the result of a different invalid
operation. This brings us to the many-NaN situation.
George
--
http://mail.python.org/mailman/listinfo/python-list
101 - 200 of 1560 matches
Mail list logo