RE: A quick c.l.p netiquette question

2005-09-29 Thread Delaney, Timothy (Tim)
Richie Hindle wrote: > I didn't read every one of his 158 lines, but his code is pure > poetry, or possibly triple-distilled evil, depending on your point of > view. 158 lines very well spent either way! I definitely fall in the "pure evil" camp ;) It's been a while since I chuckled at code ...

RE: A Moronicity of Guido van Rossum

2005-09-29 Thread Delaney, Timothy (Tim)
Sherm Pendley wrote: > "Matt" <[EMAIL PROTECTED]> writes: > >> OK... your post seems to indicate a belief that everyone else is >> somehow incompetent. > > Xah's just a troll - best to just ignore him. He posts these diatribes > to multiple groups hoping to start a fight. You have to admit thou

RE: A Moronicity of Guido van Rossum

2005-09-29 Thread Delaney, Timothy (Tim)
Tony Meyer wrote: > I expect that if you look at the clues for such messages, you'll find > that any 'Xah Lee' clues are swamped by lots of 'c.l.p message' > clues. A big problem with filtering mailing lists at the user end > (rather than before the post is accepted) is that the mailing > softwar

RE: RELEASED Python 2.4.2 (final)

2005-09-29 Thread Delaney, Timothy (Tim)
Bugs wrote: > It says ActivePython 2.4.1 but I downloaded the 2.4.2 binary installer > from python.org and the python.exe executable I'm running is > timestamped 9/28/2005 12:41PM... Any ideas what I'm doing wrong? Visit this site: http://www.catb.org/~esr/faqs/smart-questions.html Then try run

RE: Merging sorted lists/iterators/generators into one stream of values...

2005-10-06 Thread Delaney, Timothy (Tim)
Lasse Vågsæther Karlsen wrote: > I need to merge several sources of values into one stream of values. > All of the sources are sorted already and I need to retrieve the > values from them all in sorted order. > > In other words: > s1 = [10, 20, 30, 40, 50] > s2 = [15, 25] > s3 = [17, 27, 37] > >

RE: TurboGears slashdotted

2005-10-10 Thread Delaney, Timothy (Tim)
Grig Gheorghiu wrote: > "TurboGears: Python on Rails?" post: > > http://developers.slashdot.org/developers/05/10/10/0650207.shtml?tid=156 Actually, since the submitter used a coral URL (.nyud.net:8090) the TurboGears site survived remarkably well. Tim Delaney -- http://mail.python.org/mailman/

RE: Looking for info on Python's memory allocation

2005-10-11 Thread Delaney, Timothy (Tim)
Fredrik Lundh wrote: > Alex Martelli wrote: > >> (there is no common Python type on which you can both call >> len(...) AND the .next() method, for example -- a combination >> which really makes no sense). > L = [1, 2, 3] len(L) > 3 I = iter(L) I > > > (it's probably not a g

RE: Python's garbage collection was Re: Python reliability

2005-10-12 Thread Delaney, Timothy (Tim)
Tom Anderson wrote: > Except that in smalltalk, this isn't true: in ST, every variable > *appears* to contain a reference to an object, but implementations > may not actually work like that. In particular, SmallTalk 80 (and > some earlier smalltalks, and all subsequent smalltalks, i think) > handl

RE: If Statement Error (Tic Tac Toe)

2005-11-01 Thread Delaney, Timothy (Tim)
This site will help you get a useful answer: http://www.catb.org/~esr/faqs/smart-questions.html Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

RE: [ x for x in xrange(10) when p(x) ]

2005-11-10 Thread Delaney, Timothy (Tim)
Colin J. Williams wrote: > Are there generally accepted guidelines on what is appropriate for the > builtin namespace? Yes. If Guido can be convinced it should be in builtins, it should be. Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

RE: Python as Guido Intended

2005-11-24 Thread Delaney, Timothy (Tim)
Ben Sizer wrote: > I agree with you that sometimes, the responses here can come across as > a bit condescending. I don't think this is intentional, as everybody > seems friendly enough, but I do see a pattern of people replying to a > query and implying that the original poster should know better

RE: Python as Guido Intended

2005-11-27 Thread Delaney, Timothy (Tim)
Bryan wrote: > i agree with you... pyrex should be part of the python distribution :) And this has been discussed on python-dev. Greg has stated though that he doesn't feel it's ready (there are other factors, but this one is overriding). There were also discussions about the fact that to get max

RE: New Ordered Dictionery to Criticise

2005-11-28 Thread Delaney, Timothy (Tim)
"Martin v. Löwis" wrote: > A couple of minor points: > - I would drop 2.2 compatibility Unfortunately, there are a *lot* of systems out there where only 2.2 is support (Red Hat 3.0 anyone?). I know we'd like to be able to not support earlier versions (yes, I saw today's messages on the djgpp p

RE: Making immutable instances

2005-11-30 Thread Delaney, Timothy (Tim)
Was it *really* necessary to send 4 separate emails to reply to four sections of the same email? Good netiquette is to intersperse your comments with quoted sections in a single email. Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

RE: Making immutable instances

2005-12-01 Thread Delaney, Timothy (Tim)
Rick Wotnaz wrote: > Good netiquette might also suggest quoting what you're replying to, > wouldn't you think? Damn - I trimmed [EMAIL PROTECTED] instead of python-list from the To: list. I stuffed up. This one intentionally sent to python-list. Tim Delaney -- http://mail.python.org/mailman/l

RE: Thoughts on Guido's ITC audio interview

2005-06-27 Thread Delaney, Timothy (Tim)
Aahz wrote: > Perhaps. But adding the time to learn those IDEs in addition to the > time > to learn Java is ridiculous. I've been forced to use Java a bit to > support credit cards for our web application; I've got a friend whose > Java-vs-Python argument hinges on the use of Eclipse; I was una

RE: When someone from Britain speaks, Americans hear a "Britishaccent"...

2005-06-30 Thread Delaney, Timothy (Tim)
Tom Anderson wrote: > How about carrier? Ends in an "a" (Australian ;) Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

RE: When someone from Britain speaks, Americans hear a "Britishaccent"...

2005-06-30 Thread Delaney, Timothy (Tim)
Grant Edwards wrote: > On 2005-06-30, Delaney, Timothy (Tim) <[EMAIL PROTECTED]> wrote: >> Tom Anderson wrote: >> >>> How about carrier? >> >> Ends in an "a" (Australian ;) > > Right, but due to some wierd property requiring conservatio

RE: What are __slots__ used for?

2005-07-04 Thread Delaney, Timothy (Tim)
Ric Da Force wrote: > I am a C# programmer and new to the language and I am trying to debug > some code which uses this feature. Can anyone elaborate on what it > is and how it is used? __slots__ is used for memory and performance gains in classes that need them. A class with __slots__ has a fix

RE: Conditionally implementing __iter__ in new style classes

2005-07-06 Thread Delaney, Timothy (Tim)
Thomas Heller wrote: > I forgot to mention this: The Base class also implements a __getitem__ > method which should be used for iteration if the .Iterator method in > the subclass is not available. So it seems impossible to raise an > exception in the __iter__ method if .Iterator is not found - _

RE: I am a Java Programmer

2005-07-06 Thread Delaney, Timothy (Tim)
[EMAIL PROTECTED] wrote: > I am a java programmer and I want to learn Python Please help me. My condolences. I am a programmer who is currently forced to program in Java. These two sites will help you a lot in learning to program in Python: http://www.catb.org/~esr/faqs/smart-questions.html htt

RE: frozenset question

2005-07-06 Thread Delaney, Timothy (Tim)
Steven D'Aprano wrote: > If, over a thousand runs of the program, you save a millisecond of > time in total, but it costs you two seconds to type the comment in > the code explaining why you used frozenset instead of the more > natural set, then your "optimization" is counter-productive. Even > ju

RE: Thoughts on Guido's ITC audio interview

2005-07-07 Thread Delaney, Timothy (Tim)
Tony Meyer wrote: > It would be interesting to know which JRE the Eclipse advocates are > using, and which the people that dislike Eclipse are using... For me, performance is the minor issue. Usability is the major issue. If find Eclipse to be highly unusable, so I don't use it. Tim Delaney --

RE: functions without parentheses

2005-07-28 Thread Delaney, Timothy (Tim)
Jerry He wrote: > def examine(str): > . > . > > Is there some way to define it so that I can call it > like > > examine "string" > instead of examine("string")? No. Python's syntax does not work that way. Why would you want to? For more information about this, read: http://ww

RE: [path-PEP] Path inherits from basestring again

2005-07-31 Thread Delaney, Timothy (Tim)
I have to say, the examples of using / don't really suggest path concatenation to me. However, I think the problem is the use of whitespace. Specifically:: path = Path() subdir = "subdir" f = "filname" path = path / subdir / f looks more like division (even with the obvious name

RE: Is this Pythonic?

2005-08-01 Thread Delaney, Timothy (Tim)
Peter Hansen wrote: > Change those to "raise NotImplementedError('blah')" instead and you'll > be taking the more idiomatic approach. One thing I've noticed, which I may raise on python-dev ... NotImplementedError does *not* play well with super() ... class A (object): def test (self):

RE: HELP:sorting list of outline numbers

2005-08-02 Thread Delaney, Timothy (Tim)
Scott David Daniels wrote: > For 2.3: (using DSU -- Decorate, Sort, Undecorate) > def numparts(outlinetext): > return [int(number) for number in outlinetext.split('.')] > > lst = ['1', '1.2', '1.12', '1.1', '3.1'] > decorated = [(numparts(txt), txt) for txt in lst] >

RE: HELP:sorting list of outline numbers

2005-08-03 Thread Delaney, Timothy (Tim)
Scott David Daniels wrote: > Delaney, Timothy (Tim) wrote: >> Scott David Daniels wrote: >>> For 2.3: (using DSU -- Decorate, Sort, Undecorate) > ... >>> lst = ['1', '1.2', '1.12', '1.1', '3.1'] >>&g

RE: Art of Unit Testing

2005-08-03 Thread Delaney, Timothy (Tim)
phil hunt wrote: >> tests? If they were unit tests, they should take only a few minutes >> to run, total, > > Eek! Seconds, more like. Unfortunately, when you've got umteen zillion of them, having individually fast test suites doesn't help much :( The complete test suite for my current project

RE: Bizarre error from help()

2005-08-09 Thread Delaney, Timothy (Tim)
Roy Smith wrote: > Traceback (most recent call last): > File "", line 1, in ? > File "/usr/local/lib/python2.3/site.py", line 307, in __call__ > import pydoc > File "/usr/local/lib/python2.3/pydoc.py", line 49, in ? > from string import expandtabs, find, join, lower, split, strip, >

RE: Recommendations for CVS systems

2005-08-09 Thread Delaney, Timothy (Tim)
Roy Smith wrote: > Mike Meyer <[EMAIL PROTECTED]> wrote: >> Well, the only thing that subversion does that I'd call bad is leave >> turds in my development directory. I'm tired of having to tell >> commands to ignore .svn files. Of course, Perforce is the only source >> control system I know of th

RE: "Ordered" dicts

2005-08-10 Thread Delaney, Timothy (Tim)
Martin Miller wrote: > To avoid continued reinvention of this wheel, I'd also vote to have > this functionality be at least included in a standard module, if not > built-in. This has been discussed on python-dev (I proposed it actually). The final consensus was that no such implementation would b

FW: List copying idiom was Re: [Python-Dev] implementation of copystandard lib

2005-08-16 Thread Delaney, Timothy (Tim)
Tom Anderson wrote: > When you say [:], do you mean that you copy lists like this: > > l = someList() > m = [] > m[:] = l Forwarded to python-list, where it belongs. The idiom is actually: a = [1, 2, 3] b = a[:] Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

RE: while c = f.read(1)

2005-08-23 Thread Delaney, Timothy (Tim)
Donn Cave wrote: > Before leaving this topic, I wanted to make a rare visit > to the ruins of Google's USENET archive and pull out this > giant post on the subject of True and False, when they were > being considered for adoption into Python. There is some > stuff to ignore, where she addresses q

RE: Well, another try Re: while c = f.read(1)

2005-08-23 Thread Delaney, Timothy (Tim)
Robert Kern wrote: > James asked a question in such a way that I didn't think it would get > answered. Judging from the other non-responses to his post, I was > right. I showed him the way to ask questions such that they *will* get > answered, and he came back, did so, and got his questions answer

RE: Doubt C and Python

2005-08-23 Thread Delaney, Timothy (Tim)
Terry Hancock wrote: >* The claim that a Human can optimize code better than > the compiler assumes a very smart and talented Human, > and/or a very dumb compiler. Compilers are getting smarter, > and since a lot more people find the need to program, the >

RE: micro-python - is it possible?

2005-08-30 Thread Delaney, Timothy (Tim)
Wouter van Ooijen (www.voti.nl) wrote: >> No, not a tiny microcontroller environment. In the >> microcontroller world, "tiny" means 100 bytes of ram and 4KB of >> code space. > > That's medium :) > > PIC10F200: 256 12-bit instructions, 16 bytes RAM. Show off. Tim Delaney -- http://mail.pytho

RE: GETTING IMAGEDATA FROM A BUTTON

2005-09-04 Thread Delaney, Timothy (Tim)
pythonprogrammer wrote: > Does anyone know how to get pixeldata from the image of a button > without taking a screenshot? Yes. http://www.catb.org/~esr/faqs/smart-questions.html Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

RE: Magic Optimisation

2005-09-04 Thread Delaney, Timothy (Tim)
[EMAIL PROTECTED] wrote: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/277940 For an even bigger improvement (in general), look at psyco: http://psyco.sourceforge.net/. Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

RE: Unexpected Behavior Iterating over a Mutating Object

2005-09-13 Thread Delaney, Timothy (Tim)
Dave Hansen wrote: > Again, iterating over an item that is mutating seems like a Bad > Idea(tm) to me. Absolutely. It can be safe to do it, but only if the iterator in question supports it, and all modifications occur through the iterator (this is how Java does it). In a Python for loop, the actu

RE: Roguelike programmers needed

2005-09-18 Thread Delaney, Timothy (Tim)
Mike Meyer wrote: > And *portable*. I was delighted to discover a port of the original > rogue to the Palm. Then shocked to realize that my (old, obsolete) > Palm had four times as much RAM as the 11/70 I originally ran Rogue > on. And probably an equal overabundance of mips. I actually started o

RE: Why is map() preferable in this case?

2005-09-19 Thread Delaney, Timothy (Tim)
Devan L wrote: > Map is in C. It's faster, but not as clear. Some people do think > map(f, L) is nicer though. Google is your friend here, if you want to > read the old arguments. map() will be faster if the function you are calling from map() is *also* in coded in C. If it's coded in python, the

RE: style question: anything wrong with super(type(self), self).f() ?

2005-09-19 Thread Delaney, Timothy (Tim)
As Tom said, using super(type(self), self) will fail when your class gets subclassed. Otherwise we wouldn't have needed that kind of syntax in the first place. You may be interested in my self.super recipe: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/286195 and the considerably faster

RE: inspect getsource() minor fix?

2005-09-19 Thread Delaney, Timothy (Tim)
Ron Adam wrote: > While playing around with the inspect module I found that the > Blockfinder doesn't recognize single line function definitions. > > Adding the following two lines to it fixes it, but I'm not sure if it > causes any problems anywhere else. > > elif self.indent == 0: >

RE: Can someone explain what I've done wrong...

2005-09-19 Thread Delaney, Timothy (Tim)
Tim Roberts wrote: > Everything works OK while your script runs. When the script exits, > your "main" module goes to clean things up. Apparently, it does so > alphabetically. Nope - it would do it in the iteration order of the module's __dict__. Not something that can be relied on. Tim Delaney

RE: bizarre id() results

2005-12-15 Thread Delaney, Timothy (Tim)
Stuart McGraw wrote: > Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel)] > on win32 Type "help", "copyright", "credits" or "license" for more > information. class A: > ... def m1(self): print "m1" > ... def m2(self): print "m2" > ... a = A() a.m1() > m1 a

RE: Why and how "there is only one way to do something"?

2005-12-15 Thread Delaney, Timothy (Tim)
Simon Brunning wrote: > On 12/15/05, Steve Holden <[EMAIL PROTECTED]> wrote: >> Aahz wrote: >>> python -c 'import this' >> >> Faster: >> >>python -m this > > So, there's two ways to do it. ;-) It's actually a perfect example of an "new" one-obvious-way replacing an old way (or rather,

RE: IsString

2005-12-15 Thread Delaney, Timothy (Tim)
Chris Mellon wrote: > >> Terminology is important, because we understand the world through >> language. If your language is confused or misleading, your >> understanding will also be confused or incomplete. > > I think the issue is pretty simple, myself: > > So you could say that Python has bot

RE: Calling foreign functions from Python? ctypes?

2006-01-09 Thread Delaney, Timothy (Tim)
Thomas Heller wrote: > As the author, I would be happy to see ctypes included with the > standard Python build. I'm sure you know the magical incantation to get that to happen ... 1. Propose it on python-dev. 2. Commit to maintain it in the python core (or alternatively, propose to use the Elem

RE: New Python.org website ?

2006-01-11 Thread Delaney, Timothy (Tim)
Steve Holden wrote: > http://beta.python.org > > Happy New Year. We could do with some help completing the conversion > if people have some free time. It would be nice if it could be > completed for PyCon. Start at Nice - except for those damned pictures taking up useful space on the home page.

RE: Bug? Certainly a new *behavior* from subprocess in 2.5 on Win32

2006-07-20 Thread Delaney, Timothy (Tim)
Larry Hastings wrote: > Under Python 2.5, both beta 1 and beta 2, it dumps the results to the > command shell, but *also* prints this: > > Exception exceptions.AttributeError: "'NoneType' object has no > attribute 'append'" in > ignored Could you raise this as a bug on Sourceforge? Cheers, Ti

RE: Programming newbie coming from Ruby: a few Python questions

2006-08-01 Thread Delaney, Timothy (Tim)
Edmond Dantes wrote: > Of course, it's all what you really mean by "clever". To me, being > "clever" partly means writing code without bugs in the first place, > so there is nothing that needs debugging "Clever" in this context generally means using a trick/hack that is non-obvious (often

RE: Question about using python as a scripting language

2006-08-06 Thread Delaney, Timothy (Tim)
Steve Lianoglou wrote: > One thing you could do is use the eval or compile methods. These > functions let you run arbitray code passed into them as a string. > > So, for instance, you can write: > my_list = eval('[1,2,3,4]') This is just asking for trouble. my_list = eval('import shutil; shutil

RE: Newbie - How to iterate list or scalar ?

2006-08-09 Thread Delaney, Timothy (Tim)
Bruno Desthuilliers wrote: > What I wonder here is why __iter__ has been added to lists and tuples > but not to strings (not that I'm complaining, it's just curiousity...) Because someone got around to doing it. Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

RE: Question about using python as a scripting language

2006-08-09 Thread Delaney, Timothy (Tim)
Carl Banks wrote: > Delaney, Timothy (Tim) wrote: >> Steve Lianoglou wrote: >> >>> So, for instance, you can write: >>> my_list = eval('[1,2,3,4]') >> >> This is just asking for trouble. >> >> my_list = eval('import shu

RE: Sorting by item_in_another_list

2006-10-23 Thread Delaney, Timothy (Tim)
Cameron Walsh wrote: > Hi, > > I have two lists, A and B, such that B is a subset of A. > > I wish to sort A such that the elements in B are at the beginning of > A, and keep the existing order otherwise, i.e. stable sort. The > order of elements in B will always be correct. > > for example: >

RE: Sorting by item_in_another_list

2006-10-24 Thread Delaney, Timothy (Tim)
Carsten Haese wrote: > The current documentation states that "Starting with Python 2.3, the > sort() method is guaranteed to be stable." However, it's not clear > whether this specifies language behavior that all implementations must > adhere to, or whether it simply documents an implementation de

RE: Sorting by item_in_another_list

2006-10-24 Thread Delaney, Timothy (Tim)
Fredrik Lundh wrote: > Delaney, Timothy (Tim) wrote: > >> This is a requirement for all implementations claiming to be 2.3 or >> higher. > > the language reference only guarantees this for CPython: > > The C implementation of Python 2.3 introduced a stable

RE: Fatal Python error: deallocating None

2006-10-25 Thread Delaney, Timothy (Tim)
George Sakkis wrote: > What makes the problem worse is that it's not deterministic; I can > restart it from (a little before) the point of crash and it doesn't > happen again at the same point, but it might happen further down. Now, > I wouldn't mind restarting it manually every time since the cra

RE: Python development time is faster.

2006-11-14 Thread Delaney, Timothy (Tim)
Éric Daigneault wrote: > This being said after a bit of experience in programming, design > patterns and other marvels of the modern brains, doing bad code in > python requires a conscious effort to do. The bright side is that it > gives all the justification to reviewers to smack the offend

RE: genexp performance problem?

2006-05-30 Thread Delaney, Timothy (Tim)
Giovanni Bajo wrote: > python -mtimeit "sum(int(L) for L in xrange(3000))" > 100 loops, best of 3: 5.04 msec per loop > > python -mtimeit "import itertools; sum(itertools.imap(int, > xrange(3000)))" 100 loops, best of 3: 3.6 msec per loop > > I thought the two constructs could achieve the same s

RE: genexp performance problem?

2006-05-30 Thread Delaney, Timothy (Tim)
Kent Johnson wrote: > Reusing the generator doesn't give a correct answer; after the first > sum() the generator is exhausted: Duh - good point. I forgot it was returning a generator object, not generator function. Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

RE: C# equivalent to range()

2006-06-04 Thread Delaney, Timothy (Tim)
Luis M. González wrote: > There are thousands of threads to choose from in this forum. > If they didn't like this question, they could have picked any other > one to discuss. > There's no need to be disagreeable :-) Well, there are reasons to reply to a message stating that it's not on-topic for

RE: Which exceptions are recommended to me handled?

2006-06-04 Thread Delaney, Timothy (Tim)
Florencio Cano wrote: > Hello, > Is it recommended as a good programming practice to catch all > exceptions and raise our own exceptions or let Python itself raise > these kinds of exceptions? > For example imagine a function that needs an integer and '34' is > passed, this is ok because inside

RE: Which exceptions are recommended to me handled?

2006-06-05 Thread Delaney, Timothy (Tim)
Fredrik Lundh wrote: > Delaney, Timothy (Tim) wrote: > >> The most important problem here is that you've lost the stack trace from >> the original exception. > > which, in many cases, is a good thing, especially if you replace "int" > with a call to some

RE: C# equivalent to range()

2006-06-05 Thread Delaney, Timothy (Tim)
*Very* strong suggestion - read the following link: http://www.catb.org/~esr/faqs/smart-questions.html Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

RE: queue deadlock possibility

2006-06-26 Thread Delaney, Timothy (Tim)
Michael Bayer wrote: > i was just going through this thread: http://mail.python.org/ > pipermail/python-list/2006-April/336948.html , where it is suggested > that the Lock instance used by Queue.Queue should be publically > configurable. I have identified another situation where a Queue can > be

RE: Dictionary .keys() and .values() should return a set [with Python3000 in mind]

2006-07-02 Thread Delaney, Timothy (Tim)
[EMAIL PROTECTED] wrote: > This has been bothering me for a while. Just want to find out if it > just me or perhaps others have thought of this too: Why shouldn't the > keyset of a dictionary be represented as a set instead of a list? There has been much discussion of this on the Python-3000 mail

RE: Dictionary .keys() and .values() should return a set [withPython3000 in mind]

2006-07-02 Thread Delaney, Timothy (Tim)
Paul Rubin wrote: > "Delaney, Timothy (Tim)" <[EMAIL PROTECTED]> writes: >> The eventual consensus was that keys(), etc should return views on >> the dictionary. These views would be re-iterable and will have >> basically the same behaviour as the lists return

RE: Dictionary .keys() and .values() should return a set[withPython3000 in mind]

2006-07-03 Thread Delaney, Timothy (Tim)
Paul Rubin wrote: > "Delaney, Timothy (Tim)" <[EMAIL PROTECTED]> writes: >> If you want an independent data set, you have to take a snapshot. >> For the above, that's doing: >> >> k0 = list(d.keys()) > > I don't understand. Why

RE: Dictionary .keys() and .values() should return a set [withPython3000 in mind]

2006-07-03 Thread Delaney, Timothy (Tim)
Paul Rubin wrote: > "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: >> And a "view" of the dictionary is orders faster than creating a copy >> of it (which is required to keep k0 from changing in your example). >> If you're LUCKY, copying a dictionary is O(n), > > There are ways to do it so you

RE: Dictionary .keys() and .values() should return a set[withPython3000 in mind]

2006-07-03 Thread Delaney, Timothy (Tim)
Scott David Daniels wrote: > Delaney, Timothy (Tim) wrote: >> Plus copy-on-write isn't something you want in general - it's *much* >> slower since it needs to copy the internal data every time it's >> modified. The vast majority of uses of data struc

RE: python reference counting and exceptions

2006-09-12 Thread Delaney, Timothy (Tim)
Andreas Huesgen wrote: > In c++, it is possible to write a locking system similar to the one > below: > > > void myFunction() > { > # create a resource lock. Locks some resource > ResourceLock myLock; > > # the following line may throw an exception > doStuff(); > } RII

RE: Are Python's reserved words reserved in places they dont need tobe?

2006-09-13 Thread Delaney, Timothy (Tim)
Antoon Pardon wrote: > This is just an idea of mine, nothing I expect python to adapt. > But just suppose the language allowed for words in bold. A word > in bold would be considered a reserved word, a word in non bold > would be an identifier. Exactly how am I supposed to use my text editor to m

RE: Python programs always open source?

2006-09-19 Thread Delaney, Timothy (Tim)
Steve Holden wrote: > Given that many people distribute (enough of) the interpreter with > their Python programs I wouldn't like the above to be regarded as a > blanket statement that the Python license doesn't have to be > considered when distributing the interpreter with program source. In prac

RE: does anybody earn a living programming in python?

2006-09-25 Thread Delaney, Timothy (Tim)
walterbyrd wrote: > If so, I doubt there are many. > > I wonder why that is? Well, I'm not qualified to analyse the reasons for your doubts, but I'd guess it's because you have preconceived notions. Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

RE: productivity and long computing delays

2006-09-27 Thread Delaney, Timothy (Tim)
Paul Rubin wrote: > Anyone got any suggestions? How do you deal with this? It could be > mitigated with a faster computer (I'm using a 1.2 ghz Pentium M) but > the overall task isn't large enough to justify going out and buying > one. Anyway, I did the same build on a 2 ghz Athlon 64 and was >

RE: syntax error in sum(). Please explicate.

2006-11-19 Thread Delaney, Timothy (Tim)
John Machin wrote: > Michael Press wrote: >> I have not written python codes nor run any. I saw this >> code posted and decided to try it. It fails. I read the >> tutorial and the entry for the built in function sum, >> but still do not see the problem. The code was cut and >> paste. > > I doubt

RE: dict.has_key(x) versus 'x in dict'

2006-12-07 Thread Delaney, Timothy (Tim)
[EMAIL PROTECTED] wrote: > Hendrik> why? - the main point is actually that the code worked, > and was Hendrik> stable - that should make you proud, not > embarrassed. that Hendrik> there is far too much emphasis on > doing things the quickest way Hendrik> - as long as it works, an

RE: problems caused by very large for-loop

2006-12-07 Thread Delaney, Timothy (Tim)
sam wrote: > so far so good, but i was using 'for i in the range(iterations):' a > for loop over each slice of time, where the number of iterations was > getting into the tens of millions. up until about 125,000,000 it > worked, then i got a MemoryError. Your analysis was correct - range() return

RE: merits of Lisp vs Python

2006-12-14 Thread Delaney, Timothy (Tim)
Ken Tilton wrote: >> But this is not a case where a function can't handle the job. > > Is, too. And Ken moves one step closer towards Python ... http://www.google.com.au/search?q=monty+python+argument+sketch Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

RE: trees

2006-12-17 Thread Delaney, Timothy (Tim)
vertigo wrote: > Hello > > What library/functions/classes could i use to create trees ? I would suggest either a horticultural or religious class. I'm sure that any library will contain functional texts on both. Or you could just read the following: http://www.catb.org/~esr/faqs/smart-questions

RE: glibc detected double free or corruption

2006-12-20 Thread Delaney, Timothy (Tim)
Grant Edwards wrote: > When I try to run pycadia > > I get the following error message as soon as I click "start game" > > *** glibc detected *** python: double free or corruption (out): > 0xbff43b10 *** > > Then the program locks up and has to

RE: Fall of Roman Empire

2006-12-21 Thread Delaney, Timothy (Tim)
Hendrik van Rooyen wrote: > naaah - you don't have to worry - for real control He uses assembler. > with jump statements. > so the loops are closed. > > Unfortunately its not open source. Yet. People are working hard on reverse-engineering it though. I hope no one slaps them with a DMCA-style l

RE: OpenGL

2006-01-29 Thread Delaney, Timothy (Tim)
Mike C. Fletcher wrote: > ctypes re-re-implementation of the same Python API to OpenGL. My > intention is that the ctypes implementation will become the 3.0.0 > release when it is finished and optimised. You should be aware then that it's likely that ctypes will be included in Python 2.5. Tim D

RE: Too Many if Statements?

2006-02-07 Thread Delaney, Timothy (Tim)
Terry Reedy wrote: > The OP did not specify whether all of his if-tests were sequential as > in your test or if some were nested. I vaguely remember there being > an indent limit (40??). I'm pretty sure the OP has hit the python script line limit (32767?). Goggle searches haven't turned up the

RE: module with __call__ defined is not callable?

2006-02-07 Thread Delaney, Timothy (Tim)
adam johnson wrote: > Hi All. > I was wondering why defining a __call__ attribute for a module > doesn't make it actually callable. For the same reason that the following doesn't work class A (object): def __init__(self): self.__call__ = A.hello def hello (self

RE: module with __call__ defined is not callable?

2006-02-07 Thread Delaney, Timothy (Tim)
limodou wrote: > On 2/8/06, adam johnson <[EMAIL PROTECTED]> wrote: >> Thanks for you answer. >> >> I was under the impression that you could tack methods onto an >> object at any time, your example almost works with old style classes >> and would with a function instead of a method. In fact it

RE: module with __call__ defined is not callable?

2006-02-08 Thread Delaney, Timothy (Tim)
Steven D'Aprano wrote: > That's not a _reason_, it is just a (re-)statement of fact. We know > that defining a __call__ method on a module doesn't make it callable. > Why not? The answer isn't "because defining a __call__ method on a > module or an instance doesn't make it callable", that's just a

RE: by reference

2006-02-09 Thread Delaney, Timothy (Tim)
Rene Pijlman wrote: > dirvine: >> I would like to create a dictionary based on a variable [...] > > And what seems to be the problem? He forgot to read http://www.catb.org/~esr/faqs/smart-questions.html. And *you* forgot to point him to it ;) Tim Delaney -- http://mail.python.org/mailman/list

RE: Too Many if Statements?

2006-02-09 Thread Delaney, Timothy (Tim)
slogging_away wrote: > Delaney, Timothy (Tim) wrote: > >> I'm pretty sure the OP has hit the python script line limit (32767?). > > The script is 4903 lines long. Well blow that idea out of the water. I was then going to suggest looping over tests, but noticed s

RE: ordered sets operations on lists..

2006-02-12 Thread Delaney, Timothy (Tim)
Steve Holden wrote: > The basic answer is that so far no developer has felt it worthwhile to > expend time on adding these optimizations. Mainly because it's rare to find such constructs in anything except contrived examples ... Nearly every time you use a literal, it's being added to (subtracted

RE: ordered sets operations on lists..

2006-02-12 Thread Delaney, Timothy (Tim)
Delaney, Timothy (Tim) wrote: > Adding such optimisations to Python may improve it's benchmark scores, Blegh! Time to give myself a good kicking! Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

RE: how do you pronounce 'tuple'?

2006-02-13 Thread Delaney, Timothy (Tim)
Grant Edwards wrote: >> Well, I hope this doesn't make me lose credibility, but I've >> actually never seen the show! I saw Holy Grail several years >> ago, though. But I'm very curious about this whole cheese shop >> skit, so when I get home tonight I'm going to download it. :) > > IMO, it's not

RE: Which is faster? (if not b in m) or (if m.count(b) > 0)

2006-02-15 Thread Delaney, Timothy (Tim)
Two additional things beyond the important lesson to always time things: 1. Be careful with operator precedence. In this case, people got lucky: not b in m has the precedence: not (b in m) 2. Python has a "not in" operator: b not in m which is the clearest and fastest way to test

RE: Which is faster? (if not b in m) or (if m.count(b) > 0)

2006-02-19 Thread Delaney, Timothy (Tim)
Farel wrote: > Tim, Are you saying that: > not (b in m) > is faster than: > b not in m On the contrary. `not (b in m)` requires negating the result of `b in m` (via an additional bytecode operation). `b not in m` doesn't. However, the difference in performance is minimal, as testing usin

RE: Which is faster? (if not b in m) or (if m.count(b) > 0)

2006-02-19 Thread Delaney, Timothy (Tim)
Jean-Paul Calderone wrote: > Not since Python 2.4: > > >>> dis.dis(lambda: x not in y) > 1 0 LOAD_GLOBAL 0 (x) > 3 LOAD_GLOBAL 1 (y) > 6 COMPARE_OP 7 (not in) > 9 RETURN_VALUE > >

RE: Python vs. Lisp -- please explain

2006-02-20 Thread Delaney, Timothy (Tim)
Donn Cave wrote: > for very long. If you give me a Python program, you have 3 choices: > cross your fingers and hope that I have the required Python > interpreter version, slip in a 25Mb Python interpreter install and > hope I won't notice, or come clean and tell me that your program > needs an

RE: Python vs. Lisp -- please explain

2006-02-21 Thread Delaney, Timothy (Tim)
Terry Reedy wrote: >>> The the compiler is built into the VM as opposed to a separate tool >>> (like Java) is just an implementation issue. That was me, not Paul - careful with the attributions. Otherwise Paul might think you were trying to ascribe some awful, inaccurate statement to him ;) > Th

RE: Use of __slots__

2006-02-26 Thread Delaney, Timothy (Tim)
Steve Juranich wrote: > IMHO, __slots__ is unpythonic. Many others have stated so on the > list. That's why it's great that you're free to ignore that variable. > I suggest that you do so (as I have chosen to do). I'm sure that > there are situations where you *MUST* have this kind of capability

  1   2   3   >