Re: python concurrency proposal

2006-01-04 Thread Mike Meyer
Corey Coughlin <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: >> Calls to methods of a separate object are non-blocking. The calls are >> queued, and executed later. Reading an attribute from a separate >> object is a blocking action. Calling a method with a separate object >> as an argument caus

Re: itertools.izip brokeness

2006-01-04 Thread Bengt Richter
On 4 Jan 2006 15:20:43 -0800, "Raymond Hettinger" <[EMAIL PROTECTED]> wrote: >Paul Rubin wrote: >> What do you think of my suggestion of passing an optional arg to the >> StopIteration constructor, that the caller can use to resume the >> iterator or take other suitable recovery steps? Maybe this

Re: python concurrency proposal

2006-01-04 Thread Corey Coughlin
Mike Meyer wrote: > [Rest elided] > > This really has a lot in common with SCOOP. SCOOP makes concurrent > stuff easier, but i'm not sure it fits well with Python. I'll describe > it, on the off chance you may get some ideas from it. See http://archive.eiffel.com/doc/manuals/technology/concurren

Re: Getting module location

2006-01-04 Thread limodou
2006/1/5, Thomas Dybdahl Ahle <[EMAIL PROTECTED]>: > Is it possible for an imported module to find its own location? you can access __file__(missing for built-in modules) or __path__(used for a package) attribute to find a module's location. -- I like python! My Blog: http://www.donews.net/limodo

Are there anybody using python as the script engine for ASP?

2006-01-04 Thread [EMAIL PROTECTED]
Hi everyone, I'm planning using python with asp, and wonder if some people do use python/asp in real life projects. (I'm going to) cheers, === kychan -- http://mail.python.org/mailman/listinfo/python-list

Re: Memoization and encapsulation

2006-01-04 Thread Mike Meyer
[EMAIL PROTECTED] writes: >> Faster is: >>class FastHashableList(list): >> def __hash__(self): >> return id(self) > But that's wrong. You're right - I should have fixed equality while I was at it. The results may not be what you had in mind, but it's a perfectly reasonable use case. >> The

Re: xsl and unicode surrogate characters

2006-01-04 Thread Sakcee
thanks very much for the info, it really helped we are using the text from file to display on webpage and we have a method for conversion the parsed data to utf-8 and then displaying, all the data looks fine after parsing except the surrogate pair, since i can not guess what it was supposed to be

Getting module location

2006-01-04 Thread Thomas Dybdahl Ahle
Is it possible for an imported module to find its own location? -- Programmers should realize their critical importance and responsibility in a world gone digital. They are in many ways similar to the priests and monks of Europe's Dark Ages; they are the only ones with the training and insight to

Re: Regex anomaly

2006-01-04 Thread Bryan Olson
Roy Smith wrote: > LOL, and you'll be LOL too when you see the problem :-) > > You can't give the re.I flag to reCompiled.match(). You have to give > it to re.compile(). The second argument to reCompiled.match() is the > position where to start searching. I'm guessing re.I is defined as 2, > wh

Re: Xah's Edu Corner: the bug-reporting attitude

2006-01-04 Thread Tim Roberts
Roedy Green <[EMAIL PROTECTED]> wrote: >On 2 Jan 2006 13:16:26 -0800, "Xah Lee" <[EMAIL PROTECTED]> wrote, quoted >or indirectly quoted someone who said : > >>When a software is ostensibly incorrect, and if it is likely in >>connection to egregious irresponsibility as most software companies are >

Re: Try Python update

2006-01-04 Thread Mike Meyer
"Szabolcs Nagy" <[EMAIL PROTECTED]> writes: > Hello > Thanks for trypython, it's a cool idea Thank you. > I got TryPythonError after an IdentationError and i could not get rid > of it (other than refreshing the page): > > Python 2.4.2 (#3, Dec 16 2005, 23:54:20) > [GCC 2.95.4 20020320 [FreeBSD]]

Re: Is 'everything' a refrence or isn't it?

2006-01-04 Thread Donn Cave
Quoth Steven D'Aprano <[EMAIL PROTECTED]>: | Mike Meyer wrote: [... dragging out his own terminology hangup ] |> Except this doesn't have *anything at all* to do with python being (or |> not being) call by reference. This is a confusion about name binding |> vs. assignment to a variable. The proper

Processing and adding numbers from lines.

2006-01-04 Thread sanfranc415
Hello, Group: Is there an easy way to automate the processing of adding the following numbers in two lines? test test test description (100-10-0, 6700 test) test test test description (100-10-0, 6350 test) I'd like to be able run a script on the file above to produce the following

how to encode tamil fonts in python (parthasarathy)([EMAIL PROTECTED])

2006-01-04 Thread 0B85
i tried to encode tamil font in python using unicode but i couldn't.Can u help me in encoding it.ex:  >>> u'have \u0061 nice day'  u'have a nice day'--     \u0061 - a    

Re: Is 'everything' a refrence or isn't it?

2006-01-04 Thread Bryan Olson
Mike Meyer wrote: > Steven D'Aprano writes: [...] >>Because the Original Poster said so! He said, to paraphrase, "Hey, I >>thought Python was call by reference, but I tried this, and it didn't >>work, what gives???" > > > And he's right, and you're wrong. Look at the *code*. There isn't a > singl

Re: Is 'everything' a refrence or isn't it?

2006-01-04 Thread Bryan Olson
Steven D'Aprano wrote: > Mike Meyer wrote: [...] >> Correct. What's stored in a list is a reference. > > Nonsense. What is stored in the list is an object. According to the Python Language Reference: Some objects contain references to other objects; these are called containers. Example

Re: python concurrency proposal

2006-01-04 Thread Mike Meyer
[EMAIL PROTECTED] writes: > Alright, so I've been following some of the arguments about enhancing > parallelism in python, and I've kind of been struck by how hard things > still are. It seems like what we really need is a more pythonic > approach. I certainly agree, and have thought about it som

Re: Memoization and encapsulation

2006-01-04 Thread drewp
> Faster is: > >class FastHashableList(list): > def __hash__(self): > return id(self) But that's wrong. Two equal objects must hash to the same value, and you're not guaranteeing that at all. My degenerate __hash__ does guarantee that, and I still claim the performance impact from collision

IMAP4_SSL error

2006-01-04 Thread Russell Stewart
I'm trying to log into a secure IMAP4 server using imaplib, and I'm getting a strange error. If I do the following (name of mail server x'ed out in example): >>> import imaplib >>> m = imaplib.IMAP4_SSL("mail.xxx.xxx") I get: Traceback (most recent call last): File "", line 1, in ? File "

Re: trouble pyparsing

2006-01-04 Thread the.theorist
Boy, do I feel sheepish. Yes, what I wanted were Literals. That clarifies things greatly. Thank you. Also, I went browsing around further, and found on O'reilly's CodeZoo: Most of the methods in the pyparsing module are very easy to figure out. Forward() might not be as obvious. To get going with

Re: trouble pyparsing

2006-01-04 Thread the.theorist
Sorry, got a bit of formatting wrong. Messed up what I was really trying to point out. container_tag << Group(open_tag + OneOrMore(container_tag | content) # ^name^recursive reference -- http://mail.python.org/mailman/listinfo/python-list

Re: trouble pyparsing

2006-01-04 Thread the.theorist
Looks like the fundamental error was in my understanding. Boy, do I feel sheepish. Yes, what I wanted were Literals. That clarifies things greatly. Thank you. Also, I went browsing around further, and found on O'reilly's CodeZoo: Most of the methods in the pyparsing module are very easy to figure

Re: Is 'everything' a refrence or isn't it?

2006-01-04 Thread Mike Meyer
Steven D'Aprano <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: >> Peter Hansen <[EMAIL PROTECTED]> writes: >>>Steven D'Aprano wrote: Python does not have references or pointers, except internally where Python coders can not get to them. It has names and objects. Keep thinking about "ca

Re: Is 'everything' a refrence or isn't it?

2006-01-04 Thread Stuart D. Gathman
On Wed, 04 Jan 2006 10:54:17 -0800, KraftDiner wrote: > I was under the assumption that everything in python was a refrence... > > so if I code this: > lst = [1,2,3] > for i in lst: >if i==2: > i = 4 > print lst > > I though the contents of lst would be modified.. (After reading that >

is there a smaple to create syslog server on Windows.

2006-01-04 Thread liujixuan
I am a new bie of Python. I knew there is module for syslog of Linux, but I want to create a syslog server on the windows server like windows 2k or 2k3, to collect the log message sent from our firewall. Any one has any idea about this? Many thanks. Jason Liu -- http://mail.python.org/mailman/li

Re: Is 'everything' a refrence or isn't it?

2006-01-04 Thread Shalabh Chaturvedi
KraftDiner wrote: > I was under the assumption that everything in python was a refrence... For a good writeup on the 'name-binding' behavior others are talking about: http://starship.python.net/crew/mwh/hacks/objectthink.html Cheers, Shalabh -- http://mail.python.org/mailman/listinfo/python-li

Re: Is 'everything' a refrence or isn't it?

2006-01-04 Thread Mike Meyer
Steven D'Aprano <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: >> Steven D'Aprano <[EMAIL PROTECTED]> writes: >>>On Wed, 04 Jan 2006 10:54:17 -0800, KraftDiner wrote: I was under the assumption that everything in python was a refrence... so if I code this: lst = [1,2,3] for i in ls

Re: trouble pyparsing

2006-01-04 Thread Paul McGuire
"the.theorist" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hey, I'm trying my hand and pyparsing a log file (named l.log): > FIRSTLINE > > PROPERTY1 DATA1 > PROPERTY2 DATA2 > > PROPERTYS LIST > ID1 data1 > ID2 data2 > > ID1 data11 >

Re: Is 'everything' a refrence or isn't it?

2006-01-04 Thread Aahz
In article <[EMAIL PROTECTED]>, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > >Nonsense. What is stored in the list is an object. Python doesn't have >pointers. You are confusing the underlying C implementation, which >implements lists as an array of pointers, with the high-level Python >code, whi

Re: Is 'everything' a refrence or isn't it?

2006-01-04 Thread Steven D'Aprano
Mike Meyer wrote: > Peter Hansen <[EMAIL PROTECTED]> writes: > > >>Steven D'Aprano wrote: >> >>>Python does not have references or pointers, except internally where >>>Python coders can not get to them. It has names and objects. Keep thinking >>>about "call by reference" and you just confuse you

Re: xsl and unicode surrogate characters

2006-01-04 Thread Martin v. Löwis
Sakcee wrote: > Hi > > In one of the data files that I have , I am seeing these characters > \xed\xa0\xa0 . They seem to break the xsl. [...] > is this a unicode utf-16 surrogate pair ? Yes and no. This is the UTF-8 encoding of U+D820, which is a high surrogate code point. So yes. It's not yet a

Re: Is 'everything' a refrence or isn't it?

2006-01-04 Thread Steven D'Aprano
Mike Meyer wrote: > Steven D'Aprano <[EMAIL PROTECTED]> writes: > >>On Wed, 04 Jan 2006 10:54:17 -0800, KraftDiner wrote: >> >>>I was under the assumption that everything in python was a refrence... >>>so if I code this: >>>lst = [1,2,3] >>>for i in lst: >>> if i==2: >>> i = 4 >>>print lst

subprocess problem in cygwin with Tkinter

2006-01-04 Thread Stewart Midwinter
this has me puzzled; I've created a small test app to show the problem I'm having. I want to use subprocess to execute system commands from inside a Tkinter app running under Cygwin. When I open a python interpreter and run my subprocess command, all is well. But when I run the same command from

Re: Newbie with some doubts.

2006-01-04 Thread Edgar A. Rodriguez
Thanks, I'll do that. -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie with some doubts.

2006-01-04 Thread BartlebyScrivener
Try this. http://www.ibiblio.org/g2swap/byteofpython/read/oops.html Best thing is to do a little reading, then wait until you have a problem or a project that would provide the occasion to create your first class. Then try it, and if it doesn't work, post it here with (1) what you were trying to

Re: Hypergeometric distribution

2006-01-04 Thread Bengt Richter
On 4 Jan 2006 12:46:47 -0800, "Raven" <[EMAIL PROTECTED]> wrote: >Cameron Laird wrote: > >> This thread confuses me. >> >> I've lost track of the real goal. If it's an exact calculation of >> binomial coefficients--or even one of several other potential >> targets mentioned--I echo Steven D'Apran

Re: Python as a Server vs Running Under Apache

2006-01-04 Thread grahamd
fuzzylollipop wrote: > there are lots of things you can't do or can't do easily or can't do at > efficiently in Apache using python as cgi or as anyone would more > likely assume mod_python. anything that requires any shared state or > shared resources in Apache is next to impossible. Doing similar

Newbie with some doubts.

2006-01-04 Thread Edgar A. Rodriguez
Hi everybody, Im newbie to Python (I found it three weeks ago) , in fact Im newbie to programming. I'm being reading and training with the language, but I still wondering about what Classes are used to. Could you please give me some examples?? Thanks. -- http://mail.python.org/mailman/listinfo/

Re: OT: Degrees as barriers to entry [was Re: - E04 - Leadership! Google, Guido van Rossum, PSF]

2006-01-04 Thread DaveM
On 3 Jan 2006 20:09:34 -0800, [EMAIL PROTECTED] (Aahz) wrote: >Unfortunately, this isn't quite true. Medicine and law both require the >passing of an apprenticeship, so there's still some room for favoritism >and blackballing. In the UK, in Medicine, House Officer jobs pretty much match the qual

Re: Microsoft IronPython?

2006-01-04 Thread Ray
Luis M. González wrote: > I'm not en expert on the subject, but I guess that any language > implementation running on .Net should be able to at least "understand" > generics or any other feature available on this framework, because > languages are supposed to interact and use all kinds of classes a

Re: What's wrong with this code snippet?

2006-01-04 Thread Karlo Lozovina
Dave Hansen <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > I'm not sure what rn is, but it looks like a standard library > random.Random object. If so, I don't think you want to seed your PRNG > each time you use it -- your numbers might be much less random that > way. If it is the stan

Re: smtplib error('Connection reset by peer')

2006-01-04 Thread Van_Gogh
I should mention that I'm on Windows XP. -- http://mail.python.org/mailman/listinfo/python-list

Re: Is 'everything' a refrence or isn't it?

2006-01-04 Thread Steven D'Aprano
Peter Hansen wrote: > Steven D'Aprano wrote: > >> Python does not have references or pointers, except internally where >> Python coders can not get to them. It has names and objects. Keep >> thinking >> about "call by reference" and you just confuse yourself and others. Think >> about names and

Re: Is 'everything' a refrence or isn't it?

2006-01-04 Thread Steven D'Aprano
Claudio Grondi wrote: [snip] >> See, this confusion is precisely why I get the urge to slap people who >> describe Python as "call by reference". It isn't. >> >> It isn't "call by value" either -- Python never copies objects unless you >> explicitly tell it to. >> >> It is "call by object" -- you

xsl and unicode surrogate characters

2006-01-04 Thread Sakcee
Hi In one of the data files that I have , I am seeing these characters \xed\xa0\xa0 . They seem to break the xsl. --- Extra content at the end of the document XML/XSL Error:

trouble pyparsing

2006-01-04 Thread the.theorist
Hey, I'm trying my hand and pyparsing a log file (named l.log): FIRSTLINE PROPERTY1 DATA1 PROPERTY2 DATA2 PROPERTYS LIST ID1 data1 ID2 data2 ID1 data11 ID2 data12 SECTION So I wrote up a small bit of code (named p.py): from pyparsing im

Re: Calling GPL code from a Python application

2006-01-04 Thread Paul Boddie
Tim Churches wrote: > > The key verb is "containing", and I'm sorry, but "link" (or "reference" or > "call" or whatever other verb could reasonably used to describe > dynamic run-time linking) does not mean the same as "contain". What's interesting with respect to distribution of works (of course,

Re: Is 'everything' a refrence or isn't it?

2006-01-04 Thread Donn Cave
In article <[EMAIL PROTECTED]>, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > See what confusing, complicated hoops people have to jump through to > hammer the round peg of Python's behaviour into the square peg of "call by > reference"? > > http://effbot.org/zone/call-by-object.htm > > Python d

Apology Re: Is 'everything' a refrence or isn't it?

2006-01-04 Thread Steven D'Aprano
Steven D'Aprano wrote: > On Wed, 04 Jan 2006 10:54:17 -0800, KraftDiner wrote: >>I though the contents of lst would be modified.. (After reading that >>'everything' is a refrence.) > > See, this confusion is precisely why I get the urge to slap people who > describe Python as "call by reference"

Re: What's wrong with this code snippet?

2006-01-04 Thread Dave Hansen
You've received good answers to your original question. Just a side issue... On Wed, 4 Jan 2006 22:19:27 + (UTC) in comp.lang.python, Karlo Lozovina <[EMAIL PROTECTED]> wrote: [...] >def GenerateRandomColour(): >rn.seed() >colour = rn.choice(['C', 'P', 'Z']) >retu

smtplib error('Connection reset by peer')

2006-01-04 Thread Van_Gogh
Hi, I am learning how to use the smtplib module, but am having some very early problems, maybe because I don't understand it. So, am I correct that by following the example in the Python: >>> import smtplib >>> server = smtplib.SMTP('localhost') >>> server.sendmail('[EMAIL PROTECTED]', '[EMAIL PR

Re: Win32 Binary-only for 2.3.x?

2006-01-04 Thread Fuzzyman
[EMAIL PROTECTED] wrote: [snip..] > > So, I give. Can someone point me to somewhere where there is a pile of > Python 2.3 EXE and DLLs that I can happily dump somewhere on my system > without having to install? In case it matters, this is for a WAMP-like > project I'm developing that includes a w

Re: problems with libxml2dom

2006-01-04 Thread Paul Boddie
ankit wrote: > Hi, > I am working with libxml2dom package for having DOM support with > libxml2. > There are some test examples are given along with the package but when > I try to run that, it gives me following error: [...] > File > "/usr/lib/python2.2/site-packages/libxml2dom/macrolib/macro

Re: Re: Calling GPL code from a Python application

2006-01-04 Thread Tim Churches
Steven D'Aprano <[EMAIL PROTECTED]> wrote: > > On Wed, 04 Jan 2006 21:53:32 +1100, Tim Churches wrote: > > >> Secondly, perhaps you should consider that dynamically linking to a > >> work is creating a derivative work, which most certainly falls under > >> the "modification" clause. > > [snip] >

Re: Is 'everything' a refrence or isn't it?

2006-01-04 Thread Mike Meyer
Peter Hansen <[EMAIL PROTECTED]> writes: > Steven D'Aprano wrote: >> Python does not have references or pointers, except internally where >> Python coders can not get to them. It has names and objects. Keep thinking >> about "call by reference" and you just confuse yourself and others. Think >> ab

Re: itertools.izip brokeness

2006-01-04 Thread Raymond Hettinger
Paul Rubin wrote: > What do you think of my suggestion of passing an optional arg to the > StopIteration constructor, that the caller can use to resume the > iterator or take other suitable recovery steps? Maybe this could > interact with PEP 343 in some useful way. Probably unworkable. Complex

Re: PyHtmlGUI Project is looking for developers

2006-01-04 Thread Paul Boddie
[EMAIL PROTECTED] wrote: > John J. Lee schrieb: > > > > I guess this is 'rendering' in a more general/abstract sense than > > 'graphical rendering'. > > Exactly. In these case rendering means that you traverse a tree with > widget objects and every is "rendered" to a text representation of > itself

Re: Is 'everything' a refrence or isn't it?

2006-01-04 Thread Mike Meyer
Steven D'Aprano <[EMAIL PROTECTED]> writes: > On Wed, 04 Jan 2006 10:54:17 -0800, KraftDiner wrote: >> I was under the assumption that everything in python was a refrence... >> so if I code this: >> lst = [1,2,3] >> for i in lst: >>if i==2: >> i = 4 >> print lst >> I though the contents o

Re: Is 'everything' a refrence or isn't it?

2006-01-04 Thread Peter Hansen
Steven D'Aprano wrote: > Python does not have references or pointers, except internally where > Python coders can not get to them. It has names and objects. Keep thinking > about "call by reference" and you just confuse yourself and others. Think > about names and objects and it is simple and strai

Re: itertools.izip brokeness

2006-01-04 Thread rurpy
> I don't understand this. Why do you need look ahead? Just before I posted, I got it (I think) but didn't want to rewrite everything. The need for unget() (or peek(), etc) is to fix the thrown-away-data problem in izip(), right? As an easier alternative, what about leaving izip() alone and si

Re: Worthwhile to reverse a dictionary

2006-01-04 Thread Mike Meyer
crc <[EMAIL PROTECTED]> writes: > I assume your talking about building a new dictionary with the key and > value pair switched. I have seen no built in function to do this but I > have found a way to create another dictionary that is the inverse of > the first. Note that you can't reliable "revers

Re: Win32 Binary-only for 2.3.x?

2006-01-04 Thread Mike Meyer
[EMAIL PROTECTED] writes: > Yeah, I guess that is one route to go down. It just seems, I don't > know, hacky. I will try it though, if I can't find the binaries online > by themselves. I don't think it's a question of being "hard to do" > using the method you suggested, I just find it really odd

Re: Is 'everything' a refrence or isn't it?

2006-01-04 Thread Claudio Grondi
Steven D'Aprano wrote: > On Wed, 04 Jan 2006 10:54:17 -0800, KraftDiner wrote: > > >>I was under the assumption that everything in python was a refrence... >> >>so if I code this: >>lst = [1,2,3] >>for i in lst: >> if i==2: >> i = 4 >>print lst >> >>I though the contents of lst would be mo

Re: What's wrong with this code snippet?

2006-01-04 Thread Karlo Lozovina
"Gerard Flanagan" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > Class methods must have at least the 'self' argument. So Argh! :) Thanks guys! -- ___Karlo Lozovina - Mosor | | |.-.-. web: http://www.mosor.net || ICQ#: 1

Re: inline function call

2006-01-04 Thread bearophileHUGS
I haven't examined the code very well, but generally I don't suggest to use exceptions inside tight loops that that have to go fast. Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: What's wrong with this code snippet?

2006-01-04 Thread Gerard Flanagan
Karlo Lozovina wrote: > Here is it: > > class Population: > def __init__(self): > self.house = [] > for i in range(0, POPULATION_COUNT): > self.house.append(Human(self.GenerateRandomColour(), > self.GenerateRandomColour())) > >

Re: What's wrong with this code snippet?

2006-01-04 Thread Brian van den Broek
Karlo Lozovina said unto the world upon 04/01/06 04:19 PM: > Here is it: > > --- > class Human: > def __init__(self, eye_one, eye_two): > self.eye_one = eye_one > self.eye_two = eye_two > > class Population: > def __init__(self): > self.house = [] >

Re: Win32 Binary-only for 2.3.x?

2006-01-04 Thread Claudio Grondi
Thomas Heller wrote: > [EMAIL PROTECTED] writes: > > >>Hi, >> >>I must be going nutty, but I can't seem to find anywhere where I can >>get just the binaries for, say, 2.3.5 for win32. I've googled high and >>low and all I come up with is installer (MSI/EXE) binaries and the >>source code. They

Re: itertools.izip brokeness

2006-01-04 Thread rurpy
"Raymond Hettinger" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > [EMAIL PROTECTED] wrote: > > izip's uses can be partitioned two ways: > > 1. All iterables have equal lengths > > 2. Iterables have different lengths. > > > > Case 1 is no problem obviously. > > In Case 2 there are t

Re: Calling GPL code from a Python application

2006-01-04 Thread Mike Meyer
Ernst Noch <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: >> In my case, I get paid for building custom applications. If I use >> GPL'ed software, I'm required to give my client the software under the >> GPL (or, as you point out, a GPL-compatible license). I never bother - >> I hand them a tarbal

What's wrong with this code snippet?

2006-01-04 Thread Karlo Lozovina
Here is it: --- class Human: def __init__(self, eye_one, eye_two): self.eye_one = eye_one self.eye_two = eye_two class Population: def __init__(self): self.house = [] for i in range(0, POPULATION_COUNT): self.house.append(Human(s

Re: Is 'everything' a refrence or isn't it?

2006-01-04 Thread Steven D'Aprano
On Wed, 04 Jan 2006 20:05:38 +0100, Christian Tismer wrote: > KraftDiner wrote: >> I was under the assumption that everything in python was a refrence... > > This is true. No it is not. >> so if I code this: >> lst = [1,2,3] > > lst is a reference to a list that holds references to 1, 2, and 3

Re: Calling GPL code from a Python application

2006-01-04 Thread Mike Meyer
Grant Edwards <[EMAIL PROTECTED]> writes: >> Of course, in cases where it matters (i.e. - I provide public >> access to my legally purchased copy of the Brittanica, or some >> such), copyrights on things other than the program come into >> play. Possibly multiple copyrights. > Huh? As you pointed

Re: Is 'everything' a refrence or isn't it?

2006-01-04 Thread Steven D'Aprano
On Wed, 04 Jan 2006 10:54:17 -0800, KraftDiner wrote: > I was under the assumption that everything in python was a refrence... > > so if I code this: > lst = [1,2,3] > for i in lst: >if i==2: > i = 4 > print lst > > I though the contents of lst would be modified.. (After reading that >

Re: When Python *Eggs* better than Python *distutils*?? What's Eggs?

2006-01-04 Thread Paul Boddie
Phillip J. Eby wrote: > Paul Boddie wrote: > > Could anyone enlighten me/us as to why the Smart Package Manager [1] > > (written in Python, presented at EuroPython this year) isn't being more > > closely investigated as part of a suitable solution? > > More closely investigated by whom, as a soluti

Re: Worthwhile to reverse a dictionary

2006-01-04 Thread crc
I assume your talking about building a new dictionary with the key and value pair switched. I have seen no built in function to do this but I have found a way to create another dictionary that is the inverse of the first. for example you have designed a dictionary such as a={} a['one']=1 a['two'

Re: inline function call

2006-01-04 Thread Peter Hansen
Riko Wichmann wrote: > the difference between running with and without psyco is about a factor > 3 for my MC simulation. > A factor 3 I consider worthwhile, especially since it doesn't really > cost you much. Definitely. "import psyco; psyco.full()" is pretty hard to argue against. :-) > Th

Re: inline function call

2006-01-04 Thread Steven D'Aprano
On Wed, 04 Jan 2006 13:18:32 +0100, Riko Wichmann wrote: > hi everyone, > > I'm googeling since some time, but can't find an answer - maybe because > the answer is 'No!'. > > Can I call a function in python inline, so that the python byte compiler > does actually call the function, but sort of

Re: Win32 Binary-only for 2.3.x?

2006-01-04 Thread Trent Mick
[EMAIL PROTECTED] wrote] > So, I give. Can someone point me to somewhere where there is a pile of > Python 2.3 EXE and DLLs that I can happily dump somewhere on my system > without having to install? ftp://ftp.activestate.com/ActivePython/windows/2.3/ActivePython-2.3.5-236-win32-ix86.zip > In

Re: Memoization and encapsulation

2006-01-04 Thread Mike Meyer
[EMAIL PROTECTED] writes: > class HashableList(list): > def __hash__(self): > return 0 This will suck for performance if you put a lot of lists in the same dictionary. Faster is: class FastHashableList(list): def __hash__(self): return id(self) > I think python is broken

Re: Calling GPL code from a Python application

2006-01-04 Thread Steven D'Aprano
On Wed, 04 Jan 2006 21:53:32 +1100, Tim Churches wrote: >> Firstly, perhaps you could use a mail/news client that correctly limits >> lines to (say) 72 characters, that would make it a lot easier to read your >> comments. > > Sorry, was using the Optus webmail client which does not do line > wrap

Re: Win32 Binary-only for 2.3.x?

2006-01-04 Thread dumpingrounds
Claudio Grondi wrote: > [EMAIL PROTECTED] wrote: > > Hi, > > > > I must be going nutty, but I can't seem to find anywhere where I can > > get just the binaries for, say, 2.3.5 for win32. I've googled high and > > low and all I come up with is installer (MSI/EXE) binaries and the > > source code.

Re: Win32 Binary-only for 2.3.x?

2006-01-04 Thread Thomas Heller
[EMAIL PROTECTED] writes: > Hi, > > I must be going nutty, but I can't seem to find anywhere where I can > get just the binaries for, say, 2.3.5 for win32. I've googled high and > low and all I come up with is installer (MSI/EXE) binaries and the > source code. They have to be somewhere. I cant

RE: UDP socket, the solution

2006-01-04 Thread Sells, Fred
import socket, threading, time, binascii, struct from Configure import Debug thanks to all, here's my final code that works, if it helps anyone import socket, threading, time, binascii, struct from Configure import Debug ZERO = chr(0) class Udp: def __init__(self, my_address, destination_a

Re: Win32 Binary-only for 2.3.x?

2006-01-04 Thread Claudio Grondi
[EMAIL PROTECTED] wrote: > Hi, > > I must be going nutty, but I can't seem to find anywhere where I can > get just the binaries for, say, 2.3.5 for win32. I've googled high and > low and all I come up with is installer (MSI/EXE) binaries and the > source code. They have to be somewhere. I cant

Re: inline function call

2006-01-04 Thread Riko Wichmann
Hi Peter, > Riko, any chance you could post the final code and a bit more detail on > exactly how much Psyco contributed to the speedup? The former would be > educational for all of us, while I'm personally very curious about the > latter because my limited attempts to use Psyco in the past ha

Re: Hypergeometric distribution

2006-01-04 Thread Paul Rubin
"Raven" <[EMAIL PROTECTED]> writes: > The problem with Stirling's approximation is that I need to calculate > the hypergeometric hence the factorial for numbers within a large range > e.g. choose(14000,170) or choose(5,2) Stirling's approximation to second order is fairly accurate even at low valu

Re: memory usage of a specific function

2006-01-04 Thread Sverker Nilsson
Stephen Kellett wrote: > In message <[EMAIL PROTECTED]>, > > Sverker Nilsson <[EMAIL PROTECTED]> writes > [Note that actually it was Hermann Maier that wrote the following but as quoted, it may look like it was I that wrote it.] > >> i need to find out the memory usage of a specific function th

Win32 Binary-only for 2.3.x?

2006-01-04 Thread dumpingrounds
Hi, I must be going nutty, but I can't seem to find anywhere where I can get just the binaries for, say, 2.3.5 for win32. I've googled high and low and all I come up with is installer (MSI/EXE) binaries and the source code. They have to be somewhere. I cant be the only person that doesn't want

Re: Microsoft IronPython?

2006-01-04 Thread Luis M. González
> Oh, yeah, that's undoubtedly true. What I was referring to were things > such as using [] for generic, that doesn't exist in current CPython > does it? I'm not en expert on the subject, but I guess that any language implementation running on .Net should be able to at least "understand" generics

Re: Hypergeometric distribution

2006-01-04 Thread Raven
Cameron Laird wrote: > This thread confuses me. > > I've lost track of the real goal. If it's an exact calculation of > binomial coefficients--or even one of several other potential > targets mentioned--I echo Steven D'Aprano, and ask, are you *sure* > the suggestions already offered aren't adequ

Re: Visualisation Engine for Python

2006-01-04 Thread Gerard Flanagan
rodmc wrote: > I am looking for a 2D data visualisation or graphics library for > Python. Can anyone point me in the right direction? > > > Thanks in advance, > > rod http://www.mps.mpg.de/dislin/ (Scientific Plotting Software) Gerard -- http://mail.python.org/mailman/listinfo/python-list

Re: Is 'everything' a refrence or isn't it?

2006-01-04 Thread Claudio Grondi
KraftDiner wrote: > I was under the assumption that everything in python was a refrence... > > so if I code this: > lst = [1,2,3] > for i in lst: >if i==2: > i = 4 > print lst > > I though the contents of lst would be modified.. (After reading that > 'everything' is a refrence.) > so it

Re: Memoization and encapsulation

2006-01-04 Thread Tom Anderson
On Wed, 4 Jan 2006 [EMAIL PROTECTED] wrote: > I think python is broken here-- why aren't lists hashable, or why isn't > there a straightforward way to make memoised() work? a = [1, 2, 3] d = {a: "foo"} a[0] = 0 print d[a] I feel your pain, but i don't think lists (and mutable objects generally)

Re: Why doesn't this work--Extending Python--?

2006-01-04 Thread jeremito
Well what do you know, that worked! It's one of those errors that you can't see yourself, but someone else can see it instantly. Thanks, Jeremy -- http://mail.python.org/mailman/listinfo/python-list

Re: Why doesn't this work--Extending Python--?

2006-01-04 Thread Todd
jeremito wrote: > I have written a simple C++ program in my efforts to learn how to > extend Python. It is shown below. Everything compiles and installs > correctly, but I get strange answers. I know the function "Pi" is > correct because when I call it from a C++ code it gives the correct > ans

Re: Calling GPL code from a Python application

2006-01-04 Thread Ernst Noch
Heiko Wundram wrote: > Heiko Wundram wrote: > >>..., unless I convince the >>people at my univ to _release_ the code I've written under a >>GPL-compatible open source license itself. > > > The can of worms in this is basically that management at my uni doesn't want > employees to take the softwa

urllib2 and proxies support ?

2006-01-04 Thread tomazi75-nospam(at)gmail.com
Hello all, I've a problem using urllib2 with a proxy which need authentication. I've tested the 'simple way' : -- code -- import urllib # example values for the post my_url = 'http://www.python.org' proxy_info = { 'host' : 'netcache.monentreprise.com', 'port' : 3128,

Re: Try Python update

2006-01-04 Thread Szabolcs Nagy
Hello Thanks for trypython, it's a cool idea I got TryPythonError after an IdentationError and i could not get rid of it (other than refreshing the page): Python 2.4.2 (#3, Dec 16 2005, 23:54:20) [GCC 2.95.4 20020320 [FreeBSD]] on freebsd4 Type "help", "copyright", "credits", or "license" for mor

Re: Calling GPL code from a Python application

2006-01-04 Thread Ernst Noch
Mike Meyer wrote: > In my case, I get paid for building custom applications. If I use > GPL'ed software, I'm required to give my client the software under the > GPL (or, as you point out, a GPL-compatible license). I never bother - > I hand them a tarball and installation instructions and they ins

  1   2   >