RE: Picking a license

2010-05-20 Thread Delaney, Timothy (Tim)
From: Ben Finney > This thread is already off-topic and too long. I'm conflicted about my role in that; > I have endeavoured only to address falsehoods that IMO were not otherwise being addressed. > > So I'll try to keep this brief. > > Ethan Furman writes: > >> This doesn't make sense to me, but

RE: Re: Super() function

2010-03-29 Thread Delaney, Timothy (Tim)
Gabriel Genellina write: > En Sun, 28 Mar 2010 21:58:07 -0300, Delaney, Timothy (Tim) > escribió: >>> Gabriel Genellina wrote: >>>> Alan Harris-Reid escribió: >>>> >>>>> Using Python 3.1, I sometimes use the super() function to call the &g

RE: Re: Super() function

2010-03-28 Thread Delaney, Timothy (Tim)
> Gabriel Genellina wrote: >> Alan Harris-Reid escribió: >> >>> Using Python 3.1, I sometimes use the super() function to call the >>> equivalent method from a parent class, for example >>> >>> def mymethod(self): >>> super().mymethod() >>> some more code... >>> >>> Is there any way of wr

RE: missing 'xor' Boolean operator

2009-07-26 Thread Delaney, Timothy (Tim)
Mark Dickinson wrote: >> Since the 'and' and 'or' already return objects (and objects >> evaluate to true or false), then 'xor' should behave likewise, IMO. >> I expect that would be the case if it were ever added to the >> language. > > I'm not so sure. Did you ever wonder why the any() and al

RE: with open('com1', 'r') as f:

2009-04-06 Thread Delaney, Timothy (Tim)
Lawrence D'Oliveiro wrote: > In message , > Terry Reedy wrote: > >> Lawrence D'Oliveiro wrote: >> >>> All Python objects are reference-counted. >> >> Nope. Only in CPython, and even that could change. > > Why should it? Because Guido has said it might some time in the future. >>> Once the f

RE: Python Goes Mercurial

2009-04-05 Thread Delaney, Timothy (Tim)
Sorry - it's early and I didn't force Outlook to not top-post. Unfortunately, I get asked to top-post here at work ... Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

RE: Python Goes Mercurial

2009-04-05 Thread Delaney, Timothy (Tim)
As someone who has to use ClearCase UCM at work (damned politics!) I can tell you that I very much prefer creating a separate view (directory) for each branch as I used to do in Base ClearCase. All too often you end up having to deliver multiple activities together because someone else made a cha

RE: Introducing Python to others

2009-03-26 Thread Delaney, Timothy (Tim)
Rhodri James wrote: > On Thu, 26 Mar 2009 09:35:55 -, Paddy O'Loughlin > wrote: > >> Because of this, I was thinking of making sure I included exceptions >> and handling, the richness of the python library and a pointing out >> how many modules there were out there to do almost anything one

RE: Is python worth learning as a second language?

2009-03-19 Thread Delaney, Timothy (Tim)
Aahz wrote: > In article <49b58b35$0$3548$426a7...@news.free.fr>, > Bruno Desthuilliers wrote: >> Tomasz Rola a écrit : >>> >>> I may not be objective (tried Java, hated it after 6 years). >> >> Arf - only took me 6 months !-) > > That long? It only took me six minutes. I was young and fool

RE: Is python worth learning as a second language?

2009-03-09 Thread Delaney, Timothy (Tim)
ZikO wrote: > I am a C++ programmer and I am thinking of learning something else > because I know second language might be very helpful somehow. I have > heard a few positive things about Python but I have never writen any > single line in python so I do not know this language at all. > > Do you t

RE: Peculiar swap behavior

2009-02-23 Thread Delaney, Timothy (Tim)
Tim Chase wrote: > # swap list contents...not so much... > >>> m,n = [1,2,3],[4,5,6] > >>> m[:],n[:] = n,m > >>> m,n > ([4, 5, 6], [4, 5, 6]) > > > The first two work as expected but the 3rd seems to leak some > internal abstraction. It seems to work if I force content-copying: > > >>> m[:

RE: Python binaries with VC++ 8.0?

2009-02-10 Thread Delaney, Timothy (Tim)
bearophileh...@lycos.com wrote: > Paul Rubin: >> Gideon Smeding of the University of >> Utrecht has written a masters' thesis titled "An executable >> operational semantics for Python". > > A significant part of Computer Science is a waste of time and money. The same can be said for any research

RE: Ordered dict by default

2009-02-08 Thread Delaney, Timothy (Tim)
bearophileh...@lycos.com wrote: > I have missed another example: It may be possible to create a sorting > routine that's not stable but is faster than the current stable > timsort (for example in C++ STL you have both sorting routines, and > the unstable one is a variant of introsort that is faste

RE: spam on the list - how are things now?

2009-01-21 Thread Delaney, Timothy (Tim)
s...@pobox.com wrote: > We've been running SpamBayes on the news-to-mail gateway on > mail.python.org for a couple weeks now. To me it seems like the > level of spam leaking onto the list has dropped way down but I'd like > some feedback from people who read the python-list@python.org mailing > l

RE: Does Python really follow its philosophy of "Readability counts"?

2009-01-20 Thread Delaney, Timothy (Tim)
Terry Reedy wrote: >> The compiled code differs. > > I *strongly* doubt that. Properties are designed to be transparent to > user code that access atrributes through the usual dotted name > notation precisely so that class code can be changed from >x = ob > to >x = property(get_x, set_x,

RE: Commercial Products in Python

2008-10-21 Thread Delaney, Timothy (Tim)
Paulo J. Matos wrote: > Question cleared: > http://wiki.python.org/moin/DistributionUtilities Another option that we've used in the past was to write the "sensitive" bits in Pyrex/Cython. These get compiled to executable code (a .pyd/DLL on Windows, .so on Unix-like systems). They are tied to the

RE: I want to release the GIL

2008-10-20 Thread Delaney, Timothy (Tim)
Piotr Sobolewski wrote: > Hello, > I have such program: > > import time > import thread > def f(): >     global lock >     while True: >         lock.acquire() >         print thread.get_ident() >         time.sleep(1) >         lock.release() > lock=thread.allocate_lock() > thread.start_new_thre

RE: Numeric literal syntax

2008-09-03 Thread Delaney, Timothy (Tim)
Steven D'Aprano wrote: > On Thu, 04 Sep 2008 01:22:22 +0100, Alexander Schmolck wrote: > >> It seems to me that the right choice for thousands seperator is the >> apostrophe. > > You mean the character already used as a string delimiter? Hey - I just found a new use for the backtick! 123`456`7

RE: exception handling in complex Python programs

2008-08-24 Thread Delaney, Timothy (Tim)
Lie wrote: > Ah... now I understand what the Zen is talking about when it said: > "Now is better then never, although never is often better than *right* > now." If you don't have all the necessary resources to fix an > exception right now, don't try to fix it, instead let it propagate, > and allow

RE: Psycho question

2008-08-07 Thread Delaney, Timothy (Tim)
David C. Ullrich wrote: > f: 0.0158488750458 > g: 0.000610113143921 > h: 0.00200295448303 > f: 0.0184948444366 > g: 0.000257015228271 > h: 0.00116610527039 I suspect you're hitting the point of diminishing returns with g, and any further investigations into optimisation are purely for fun and lea

RE: Execution speed question

2008-07-29 Thread Delaney, Timothy (Tim)
Diez B. Roggisch wrote: >> For sets, I presume they are built on top of or like dicts, and >> there is nothing crazy in the low level implementation so that I can >> be guaranteed that if I don't alter the set, then the order, >> although arbitrary, will be maintained in successive iterations over

RE: Getting python 2.4 dll

2008-07-28 Thread Delaney, Timothy (Tim)
Guillermo wrote: > Hi there, > > Is it possible to get a 2.4 dll of python for Windows easily? I need > it to use python as scripting language for Vim. http://www.python.org/ which leads you to: http://www.python.org/download/ which leads you to: http://www.python.org/download/releases/2.4.5/

RE: Python Written in C?

2008-07-21 Thread Delaney, Timothy (Tim)
Fredrik Lundh wrote: > rynt wrote: > >> You're either --- >> A. A Troll >> B. A young, immature programmer trying to show off or >> C. A total idiot. > > you forgot the "All of the above" choice. I read it as an inclusive "or". Tim Delaney -- http://mail.python.org/mailman/listinfo/python-l

RE: how are strings immutable in python?

2008-07-06 Thread Delaney, Timothy (Tim)
ssecorp wrote: > so why would you ever want mutability? > > > seems very counterintuitive and unreliable. Because immutability imposes a lot of restrictions and performance characteristics that mutable objects don't have. For example, compare building up a list and a tuple element-by-element (u

RE: Use of the "is" statement

2008-06-29 Thread Delaney, Timothy (Tim)
Maric Michaud wrote: > Le Friday 27 June 2008 18:26:45 Christian Heimes, vous avez écrit : >> Ask yourself if you are interested if f.tell() returns exactly the >> same 0 object ("is") or a number that is equal to 0 ("=="). > > That said, "f.tell() == 0" and "f.tell() != 0" should be written > "f

RE: multiprocessing module (PEP 371)

2008-06-04 Thread Delaney, Timothy (Tim)
Christian Heimes wrote: > Can you provide a C implementation that compiles under VS 2008? Python > 2.6 and 3.0 are using my new VS 2008 build system and we have dropped > support for 9x, ME and NT4. If you can provide us with an > implementation we *might* consider using it. You'd have to at leas

RE: Misuse of list comprehensions?

2008-05-27 Thread Delaney, Timothy (Tim)
Ian Kelly wrote: > It sounds like the wasteful list creation is the biggest objection to > using a list comprehension. I'm curious what people think of this > alternative, which avoids populating the list by using a generator > expression instead (apart from the fact that this is still quadratic,

RE: do you fail at FizzBuzz? simple prog test

2008-05-12 Thread Delaney, Timothy (Tim)
Mensanator wrote: > Ok, I agree with 101, but I wouldn't necessarily > say the others were unfortunate. You might be > surprised at how often such fixations discover > bugs, something that I have a gift for. The discovering, the making, or both? ;) Tim Delaney -- http://mail.python.org/mailman/l

RE: troll poll

2008-03-31 Thread Delaney, Timothy (Tim)
George Sakkis wrote: > On Mar 31, 1:46 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > >>> More specifically, who can create a bigger mess on c.l.py? (check >>> one) >> >>> [ ] - Xah Lee >>> [X] - castironpi >> >> Xah Lee's postings might be trolls but sometimes they spark some >> re

RE: Do any of you recommend Python as a first programming language?

2008-03-26 Thread Delaney, Timothy (Tim)
Steven D'Aprano wrote: > On Sat, 22 Mar 2008 21:11:51 -0700, sturlamolden wrote: > >> Yes. And because Python is a "scripting language" > > > Python is a programming language. It can be used for scripting, but > that's not all it can do. Describing it as a "scripting language" is > like describ

RE: Prototype OO

2008-03-25 Thread Delaney, Timothy (Tim)
John Machin wrote: > On Mar 23, 12:32 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: >> John Machin schrieb: >> >>> On Mar 21, 11:48 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: >> [1] Just one example:http://docs.mootools.net/Class/Class.js >> >>> Mootools being something a cowork

RE: Failed saving throw

2008-03-06 Thread Delaney, Timothy (Tim)
Aahz wrote: > For anyone who hasn't heard, E. Gary Gygax died yesterday. Some > people think we should build a tomb in his honor. ;-) Well, you sure wouldn't get a saving throw there ;) Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

RE: Looping through the gmail dot trick

2008-01-20 Thread Delaney, Timothy (Tim)
Steven D'Aprano wrote: > Postfix, I think, interpets "foo+bar" the same as "foo". Gmail does the same. It's quite useful - apart from using it to determine which site I signed up to has sent me mail, I also use it so I can have multiple Guild Wars accounts using the same email account e.g. [EMAI

RE: plz help how to print python variable using os.system()

2008-01-20 Thread Delaney, Timothy (Tim)
Grant Edwards wrote: > On 2008-01-16, Lutz Horn <[EMAIL PROTECTED]> wrote: >> Hi, >> >> On Wed, 16 Jan 2008 05:29:08 -0800 (PST), [EMAIL PROTECTED] >> said: >>> var = "/home/anonymous" >>> os.system("echo $var) >> >> os.system("echo %s" % var) > > Though one wonders why one wou

RE: ISO Python example projects (like in Perl Cookbook)

2008-01-10 Thread Delaney, Timothy (Tim)
You know you've been working at a large company for too long when you see that subject and think "ISO-certified Python?" Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

RE: Don't use __slots__ (was Re: Why custom objects take so much memory?)

2007-12-18 Thread Delaney, Timothy (Tim)
Aahz wrote: > In article <[EMAIL PROTECTED]>, > Chris Mellon <[EMAIL PROTECTED]> wrote: >> >> You can reduce the size of new-style classes (inherit from object) by >> quite a bit if you use __slots__ to eliminate the class dictionary. > > You can also reduce your functionality quite a bit by usi

RE: Is a "real" C-Python possible?

2007-12-13 Thread Delaney, Timothy (Tim)
Aahz wrote: >> Unless it's a new style class with __slots__ > > [] > > Naw, I'll skip the rant this time. ;-) Wuss! I was looking forward to it :) Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

RE: Problem of Readability of Python

2007-10-10 Thread Delaney, Timothy (Tim)
Licheng Fang wrote: > This is enlightening. Surely I shouldn't have worried too much about > performance before doing some measurement. And with that statement you have truly achieved enlightenment. Or to put it another way ... performance tuning without profiling is a waste of time. Tim Delane

RE: Fwd: NUCULAR fielded text searchable indexing

2007-10-10 Thread Delaney, Timothy (Tim)
[EMAIL PROTECTED] wrote: >> From: Grant Edwards >> >> Anyway, I apologize for my attempt at humor, since it appears >> to have somehow offended. > > Why apologize? If someone doesn't like the name given to a piece of > software by its author(s), screw them. If I find the software useful, > I'l

RE: NUCULAR fielded text searchable indexing

2007-10-09 Thread Delaney, Timothy (Tim)
[EMAIL PROTECTED] wrote: > ANNOUNCE: > NUCULAR fielded text searchable indexing Does "NUCULAR" stand for anything? The (apparent) misspelling of "nuclear" has already turned me off wanting to find out more about it. Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

RE: Python 3.0 migration plans?

2007-10-04 Thread Delaney, Timothy (Tim)
TheFlyingDutchman wrote: > On Sep 28, 1:09 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > >> That's because the tutor list doesn't offer a newsgroup. He was >> probably just trying to get rid of you. >> >> Now at 98.75% ... > > Not sure if that's the reading on your trollmeter or on the meter th

RE: sorting a list numbers stored as strings

2007-09-26 Thread Delaney, Timothy (Tim)
Hrvoje Niksic wrote: > "Delaney, Timothy (Tim)" <[EMAIL PROTECTED]> writes: > >> Yep - appears I must have been misremembering from another language >> (dunno which) > > Tcl Not bloody likely - only used Tcl for expect, and then only very minimally

RE: sorting a list numbers stored as strings

2007-09-26 Thread Delaney, Timothy (Tim)
ZeD wrote: > thebjorn wrote: > >> int("020") >>> 20 >> 020 >>> 16 >> >> You can get the latter behavior using eval: > > why using eval when int has the "base" optional parameter? > int("020") > 20 int("020", 8) > 16 int("09", 8) > Traceback (most recent call last): > F

RE: sorting a list numbers stored as strings

2007-09-24 Thread Delaney, Timothy (Tim)
Carsten Haese wrote: > On Mon, 2007-09-24 at 19:58 +0800, Delaney, Timothy (Tim) wrote: >> I'm sure that in some version of Python it would have given a >> ValueError (due to the default radix being 0) but it appears to have >> changed to a default radix of 10 somewhe

RE: Almost There - os.kill()

2007-09-24 Thread Delaney, Timothy (Tim)
Delaney, Timothy (Tim) wrote: > Nope - pretty sure that an earlier version of Python defaulted to a > radix of 0, but it appears to default to a radix of 10 in Python 2.5. > > In any case, I've submitted a bug report and suggested new text for > the documentation of int() t

RE: Almost There - os.kill()

2007-09-24 Thread Delaney, Timothy (Tim)
Carsten Haese wrote: > On Mon, 2007-09-24 at 19:48 +0800, Delaney, Timothy (Tim) wrote: >> Always be careful with int() incase any of the values have a leading >> zero - check the documentation for int() carefully. > > Why would leading zeroes be a problem? > >>&

RE: sorting a list numbers stored as strings

2007-09-24 Thread Delaney, Timothy (Tim)
Carsten Haese wrote: > That interpreter session is a work of fiction, since sorted returns > the sorted list instead of sorting the list in place. Also, it's > better (i.e. more readable and likely faster) to use a sort key > function instead of a comparison function whenever possible. In this > c

RE: Almost There - os.kill()

2007-09-24 Thread Delaney, Timothy (Tim)
Always be careful with int() incase any of the values have a leading zero - check the documentation for int() carefully. Cheers, Tim Delaney From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Robert Rawlins - Think Blue Sent: Monday, 24 September 2

RE: Would Anonymous Functions Help in Learning Programming/Python?

2007-09-24 Thread Delaney, Timothy (Tim)
Carsten Haese wrote: >> Where the heck does *this* come from? Neither Python 2.5.1 nor the >> 3.0alpha has this in `__builtin__`. > > It comes from the 'new' module: > import new help(new.function) > Help on class function in module __builtin__: > ... > > Oddly enough, the help misre

RE: I could use some help making this Python code run faster usingonly Python code.

2007-09-23 Thread Delaney, Timothy (Tim)
Python Maniac wrote: > Some benchmarks showing the effectiveness of using Psyco: > > scramble: 4.210 > scramble_listcomp: 2.343 > scramble_gencomp: 2.599 > scramble_map: 1.960 > scramble_imap: 2.231 > scramble_dict: 2.387 > scramble_dict_map: 0.535 > scramble_dict_imap:

RE: Python 3K or Python 2.9?

2007-09-17 Thread Delaney, Timothy (Tim)
Ben Finney wrote: > The latter two statements are equivalent. The 'instance.method(args)' > syntax is just sugar for 'Class.method(instance, args)'. Only in the case that "instance" is an instance of "Class", and not an instance of a subclass of "Class". For example, the following are not equival

RE: creating really big lists

2007-09-05 Thread Delaney, Timothy (Tim)
Hrvoje Niksic wrote: > Dr Mephesto <[EMAIL PROTECTED]> writes: > >> I would like to create a pretty big list of lists; a list 3,000,000 >> long, each entry containing 5 empty lists. My application will >> append data each of the 5 sublists, so they will be of varying >> lengths (so no arrays!).

RE: How to free memory ( ie garbage collect) at run time with Python2.5.1(windows)

2007-08-28 Thread Delaney, Timothy (Tim)
Alex Martelli wrote: > rfv-370 <[EMAIL PROTECTED]> wrote: > >> have made the following small test: >> >> Before starting my test my UsedPhysicalMemory(PF): 555Mb >> > tf=range(0,1000)PF: 710Mb ( so 155Mb for my List) > tf=[0,1,2,3,4,5] PF: 672Mb (Why? Why the remaini

RE: Jython - problem import os

2007-08-08 Thread Delaney, Timothy (Tim)
[EMAIL PROTECTED] wrote: > I'm using Jython in combination with Java, webservices and jboss4.0.4. > > The webservice is implemented in java and creates an PythonInterpreter > object which loads the jython scripts. > I wrote an jython script which uses a function from another jython > file called

RE: All leading tabs or all leading spaces - why isn't that enforced?

2007-08-06 Thread Delaney, Timothy (Tim)
John Nagle wrote: >One can argue over tab vs. space indentation, but mixing the two > is just wrong. Why not have CPython report an error if a file has > both leading tabs and leading spaces? I know that was proposed at > some point, but I don't think it ever went in. That would catch a > co

RE: Broken MUA interactions

2007-07-09 Thread Delaney, Timothy (Tim)
Ben Finney wrote: > If your MUA is not using the information, provided in every message > from the mailing list, to do what you want, don't ask mailing list > admmministrators to accomodate your broken MUA. There would be nothing wrong with an MUA for example, having a "reply" button where the us

RE: deleated bios?

2007-07-04 Thread Delaney, Timothy (Tim)
acprkit wrote: > Hi > > I have an ibm thinkpad x23, and shut it down about an hour ago. When I > went to > reboot , all the lights come on then they go off and only the light > with the z in a circle stays on. The screen stays blank and the hard > drive spins. Could I have deleated the bios when

RE: Plugging a pseudo-memory leak

2007-07-04 Thread Delaney, Timothy (Tim)
Adam Atlas wrote: > I have a program that seemed to be leaking memory, but after > debugging, it seemed it just wasn't getting around to collecting the > objects in question often enough. The objects are very long-lived, so > they probably end up in generation 2, and don't get collected for a > lo

RE: Probably simple syntax error

2007-07-01 Thread Delaney, Timothy (Tim)
Dustin MacDonald wrote: > [code] > randomizing_counter = 0 > # Put the loop counter for the randomizing to zero. > until_val = 36 > # Set the "until val" to 36. We'll compare them to make sure we're not > at the end of our wordlist_both. > > while randomizing_counter < until_val: > big_rand

RE: Q: listsort and dictsort - official equivalents?

2007-06-20 Thread Delaney, Timothy (Tim)
Steve Howell wrote: > I think Gabriel was making the point that the *input* > to sorted() cannot be a generator, even thought > sorted() itself could in theory be a generator with > the right underlying implementation (e.g. heapsort). Actually, the input to sorted() can be any iterable - sorted p

RE: Python 2.5.1 - sqlite3.dll issue

2007-06-07 Thread Delaney, Timothy (Tim)
Delaney, Timothy (Tim) wrote: > Josh Ritter wrote: > >> A number of our Windows customers have an issue with the sqlite3 >> module included with Python 2.5.1 >> >> We've tracked the problem down to the sqlite3.dll included with the >> Python >&

RE: Python 2.5.1 - sqlite3.dll issue

2007-06-07 Thread Delaney, Timothy (Tim)
Josh Ritter wrote: > A number of our Windows customers have an issue with the sqlite3 > module included with Python 2.5.1 > > We've tracked the problem down to the sqlite3.dll included with the > Python > 2.5.1 distrubtion. It is stripped and thus cannot be relocated. This > causes the followi

RE: lists - append - unique and sorted

2007-06-07 Thread Delaney, Timothy (Tim)
Terry Reedy wrote: > "Dan Bishop" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> If you don't need the list to be sorted until you're done building >> it, you can just use: >> >> lst = sorted(set(lst)) > > ?? looks same as > lst.sort() You missed that the OP wants only unique

RE: Trying to choose between python and java

2007-05-15 Thread Delaney, Timothy (Tim)
Duncan Booth wrote: > "Hamilton, William " <[EMAIL PROTECTED]> wrote: > >> >> No, they'll work just fine. They just won't work with Python 3. >> It's not like the Python Liberation Front is going to hack into your >> computer in the middle of the night and delete you 2.x installation. > > Is

RE: Why NOT only one class per file?

2007-04-10 Thread Delaney, Timothy (Tim)
Bruno Desthuilliers wrote: > I came to this conclusion from my own experience, and it seems that > quite a few other programmers (most of them either better and/or more > experimented than me) came to the same conclusion. But feel free to Been more experimented on, or have experimented more on ot

RE: tuples, index method, Python's design

2007-04-10 Thread Delaney, Timothy (Tim)
Carsten Haese wrote: > assert current_player in p > opponents = tuple(x for x in p if x is not current_player) That would perform better as: opponents = tuple(x for x in p if x is not current_player) assert opponents Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

RE: RFC: Assignment as expression (pre-PEP)

2007-04-09 Thread Delaney, Timothy (Tim)
Alex Martelli wrote: >> As others have mentioned, your particular instance is probably >> evidence that you need to restructure your code a little bit, but I >> do agree that "x = y; if x: ..." is a common enough idiom that it >> warrants a shortcut. And reusing "as", I think, is nice and readable

RE: how can I clear a dictionary in python

2007-04-04 Thread Delaney, Timothy (Tim)
Antoon Pardon wrote: > People are often enough not very exact in their communication and > that goes double for people who are new in a particular subject. > So I think it is entirely appropiate to think about the real question > the person is strugling with that hides between the question > actua

RE: Mocking OpenOffice in python?

2007-03-14 Thread Delaney, Timothy (Tim)
"Your father was a hamster, and your mother smelled of elderberry." Oh - unit testing. Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

RE: Python Source Code Beautifier

2007-02-28 Thread Delaney, Timothy (Tim)
Alan Franzoni wrote: > Yeah, that's right, it could have semantic differences, but that > shouldn't be the case anyway. I mean, if I don't define an __iadd__ > method, writing > > a += n > > or > > a = a + n > > is just the same, right? > > So, if I bother to define an __iadd__ method, I sho

RE: Python Source Code Beautifier

2007-02-27 Thread Delaney, Timothy (Tim)
Alan Franzoni wrote: >> self.scriptcount = self.scriptcount + 1 => self.scriptcount += 1 > > the += operator is syntactic sugar just to save time... if one > doesn't use it I don't think it's a matter of beauty. This change can have semantic differences, and so should not be done for anything ex

RE: a=b change b a==b true??

2007-02-26 Thread Delaney, Timothy (Tim)
[EMAIL PROTECTED] wrote: > All, > It works great now. Thank you for all of your incredibly quick > replies. > Rob You should have a read of these: http://wiki.python.org/moin/BeginnersGuide http://effbot.org/zone/python-objects.htm Cheers, Tim Delaney -- http://mail.python.org/mailman/listin

RE: [OT] python notation in new NVIDIA architecture

2007-02-26 Thread Delaney, Timothy (Tim)
Daniel Nogradi wrote: >>> Something funny: >>> >>> The new programming model of NVIDIA GPU's is called CUDA and I've >>> noticed that they use the same __special__ notation for certain >>> things as does python. For instance their modified C language has >>> identifiers such as __device__, __glob

RE: BeautifulSoup modified to use weak refs and avoid circular links.

2007-02-25 Thread Delaney, Timothy (Tim)
John Nagle wrote: > "weakref.proxy()" probably should work that way. > Weakref proxies are supposed to be transparent, but they're not > quite transparent enough. Submit a patch to SourceForge. Please don't use tabs in email/usenet postings - use 4-space indents. "return" is not a function, a

RE: is it possible to remove the ':' symbol in the end of lines startingwith 'if', 'while' etc?

2007-02-22 Thread Delaney, Timothy (Tim)
[EMAIL PROTECTED] wrote: > I don't know to which forum should I post the message > I hope someone related to the Python kernel development will read & > consider the idea It has been considered and rejected. http://www.python.org/doc/faq/general/#why-are-colons-required-for-the-i f-while-def-cla

RE: f---ing typechecking

2007-02-21 Thread Delaney, Timothy (Tim)
Nick Craig-Wood wrote: > Which appears to support my point, x (and a for that matter) are the > same for both methods wheter you do x = x + a or x += a. > > The mechanism is different certainly, but the result should be the > same otherwise you are breaking the basic rules of arithmetic the > prog

RE: f---ing typechecking

2007-02-20 Thread Delaney, Timothy (Tim)
Nick Craig-Wood wrote: > x += a > > does not equal > > x = x + a > > which it really should for all types of x and a Actually, this will *never* be the case for classes that do in-place augmented assignment. a = [1] b = [2] c = a + b print a, b, c a += b prin

RE: Method overloading?

2007-02-15 Thread Delaney, Timothy (Tim)
Steven D'Aprano wrote: > This is an example of overloading: > > class Cheese(object): > def flavour(self): > return "tasty and scrumptious" > def colour(self): > return "yellow" > > Now we define a sub-class which overloads some methods: > > class BlueVein(Cheese): >

RE: python not returning true

2007-02-14 Thread Delaney, Timothy (Tim)
John Machin wrote: agent-s wrote: >> btw Steven you are so witty I hope to one day pwn noobs on newsgroups >> too. > > Wit has nothing to do with it. The fact that you are a Python noob is > also irrelevant. Your problem statement was unintelligible, as is your > response. What does "pwn" mean?

RE: Conditional expressions - PEP 308

2007-01-31 Thread Delaney, Timothy (Tim)
Colin J. Williams wrote: > Yes, I agree. The ternary operator is a step forward. That's still debateable ;) Pro: It puts paid to the "python doesn't have a ternary operator" and and/or abuse. Con: It shouldn't ever be used. Cheers, Tim Delaney -- http://mail.python.org/mailman/listinfo/pyth

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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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-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: 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: 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: 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: 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 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: 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: 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-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

  1   2   3   >