How naive is Python?

2007-01-14 Thread John Nagle
Is this O(N) or O(N^2) because of recopying of "s"? I just want a sense of what's unusually inefficient in the current implementation. Thanks. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: How naive is Python?

2007-01-15 Thread John Nagle
that, but wasn't sure. That's the kind of answer I was looking for. That kind of optimization is a huge win. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Does class patching actually work

2007-01-15 Thread John Nagle
open_https of class URLopener with a local, patched version. Does that actually work? When I've tried to do that in other code, it seems to have no effect. In fact, I can write URLopener.open_https = None and nothing changes. John Nagle --

Re: Does class patching actually work

2007-01-16 Thread John Nagle
James Stroud wrote: > John Nagle wrote: >> The intent of this is to replace method open_https of class URLopener >> with a local, patched version. >> >> Does that actually work? When I've tried to do that in other code, it >> seems to

import vs. subdirectory search

2007-01-17 Thread John Nagle
he namespace. I'm trying to avoid that; it causes obscure aliasing problems. On Python 2.4 under Windows 2000, importing from a subdirectory appears to work. Is that a Python 2.3.4 thing, or a Linux thing, or something else? (The idea is to be able to run (mostly) the same Python co

More M2Crypto issues

2007-01-17 Thread John Nagle
teger, which fails. M2Crypto is supposed to work with Python 2.3, so this should work. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: More M2Crypto issues

2007-01-18 Thread John Nagle
Is "long" supposed to operate on C objects? John Nagle John Nagle wrote: > I've been running M2Crypto successfully using Python 2.4 on Windows 2000, > and now I'm trying to get it to work on Python 2.3.4 on Linux. > > Att

Re: More M2Crypto issues

2007-01-19 Thread John Nagle
Gabriel Genellina wrote: > At Thursday 18/1/2007 04:41, John Nagle wrote: > On a previous version of M2Crypto that line said: map()[self.ctx] = > self, and that failed too ("unhashable object", I think). > I changed the class _ctxmap (the map() above returns an instance of

Re: More M2Crypto issues

2007-01-19 Thread John Nagle
Heikki Toivonen wrote: > John Nagle wrote: > >>Actually, at the moment I'm having an M2Crypto problem related >>to a SWIG/OpenSSL conflict. Older versions of OpenSSL have an >>include file that needs __i386__ defined, which is something GCC >>does based on

Re: More M2Crypto issues

2007-01-19 Thread John Nagle
Heikki Toivonen wrote: > John Nagle wrote: > >>OpenSSL version: "OpenSSL 0.9.7a Feb 19 2003" > > > Hmm, I've never actually used that old OpenSSL myself, just assumed from > the original author's notes that anything from 0.9.7 onward worked

Python does not play well with others

2007-01-23 Thread John Nagle
should have been fixed by now. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Python does not play well with others

2007-01-24 Thread John Nagle
Harry George wrote: > John Nagle <[EMAIL PROTECTED]> writes: > You experience isn't shared by everyone. Some of us find Python the > most functional and portable of the candidates you mention. The language is fine. It's the bindings to other packages that are the

Re: Python does not play well with others

2007-01-24 Thread John Nagle
Chris Mellon wrote: > On 1/24/07, John Nagle <[EMAIL PROTECTED]> wrote: > >> Harry George wrote: >> > John Nagle <[EMAIL PROTECTED]> writes: > Just to be clear: The problem here is "my personal itch is not being > scratched by other people for me&q

Re: The reliability of python threads

2007-01-24 Thread John Nagle
thon from within Python via concurrency errors? Does the garbage collector run concurrently or does it freeze all threads? What's different depending upon whether you're using real OS threads or simulated Python threads? John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Catching floating point errors from linked C code

2007-01-24 Thread John Nagle
ng point mode when you leave, if you want. This is probably only worth doing under a debugger, because otherwise you just end up with an aborted instance of Python. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Catching floating point errors from linked C code

2007-01-24 Thread John Nagle
John Pye wrote: > Hi John, > > On Jan 25, 3:43 pm, John Nagle <[EMAIL PROTECTED]> wrote: > >>Python is probably running with floating point exceptions disabled, >>but you can enable them in your C code, and restoring the floating >>point mode when you leave, i

Re: Do I need Python to run Blender correctly?

2007-01-25 Thread John Nagle
l never figure Blender out. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Python does not play well with others

2007-01-25 Thread John Nagle
em as event-driven systems in Twisted. Yet the main packages aren't seriously broken. It's just that the learning curve to make a small fix to any of them is substantial, so nobody new takes on the problem. John Nagle Animats -- http://mail.python.org/mailman/listinfo/python-list

Re: Python does not play well with others

2007-01-25 Thread John Nagle
ork with the built-in SSL module, and 4) get rid of SWIG. If somebody will do 1), I'll take a look at 2). John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Python does not play well with others

2007-01-25 Thread John Nagle
Paul Rubin wrote: > John Nagle <[EMAIL PROTECTED]> writes: > >>That's the problem. We now have four SSL implementations for >>Python, none of which let you do all the things OpenSSL can do. > > > I'm aware of some OpenSSL wrappers plus TLSlite. A

Re: Do I need Python to run Blender correctly?

2007-01-27 Thread John Nagle
AKA gray asphalt wrote: > "John Nagle" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > >>AKA gray asphalt wrote: >> >>>I downloaded Blender but there was no link for python. Am I on the right >>>track? >> >>

Re: Do I need Python to run Blender correctly?

2007-01-28 Thread John Nagle
AKA gray asphalt wrote: > "John Nagle" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > Is the manual you refer to the group project on blender.org or the $ manual > like the one on Ebay? > The "Blender 2.3 Guide" book. Also,

Possible security hole in SSL - was Random Passwords Generation

2007-01-29 Thread John Nagle
on glue code for SSL doesn't seem to have the machinery to seed SSL with randomness. I suspect that on platforms without '/dev/urandom', Python's SSL package may be using the same keys every time. This needs to be looked at by a crypto expert. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: SQL connecting

2007-01-29 Thread John Nagle
Scripter47 wrote: > Hey > > It got a problem with python to connect to my SQL DBs, that's installed > on my apache server. how do i connect to sql? Gettting data? Insert into > it? You need a third-party open source package called "MySQLdb".

Re: The reliability of python threads

2007-01-30 Thread John Nagle
time systems have some form of stall timer like that; there's often a stall timer in hardware. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Convert raw data to XML

2007-01-30 Thread John Nagle
if the next thing to see that XML is a program, not a human, why bother? John Nagle Justin Ezequiel wrote: > On Jan 30, 10:42 am, [EMAIL PROTECTED] wrote: > >>For example the raw data is as follows >> >>SomeText >Description>PassorFail

Re: Executing Javascript, then reading value

2007-01-30 Thread John Nagle
ule. This requires a browser emulator, a browser without a renderer. Useful for spam filters and such. It's not clear if the original poster needs that much capability, though. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Sourcing Python Developers

2007-01-30 Thread John Nagle
, but maybe the > following place is of interest for you: > > http://www.opensourcexperts.com > > Ralf Schoenian I'd recommend against Rent-A-Coder. I put a job out there (overhauling "rwhois.py"), and three "coders" in succession tried it and gave up. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Convert raw data to XML

2007-01-30 Thread John Nagle
uch. Work on the tree, not a file with the text of the indented output. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: how to "free" an object/var ?

2007-01-30 Thread John Nagle
, you're leaking memory. On servers, this sometimes matters. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: division by 7 efficiently ???

2007-01-31 Thread John Nagle
that the fastest way to divide by 7 is to use the divide instruction. You'd have to go down to a really old 8-bit microprocessor like the Intel 8051 to find something where bit-twiddling like that pays off. And no way would this be a win in Python, which is interpreted.

Re: Python does not play well with others

2007-02-01 Thread John Nagle
d these are companies that say they support Python. Python still isn't ready for prime time in the web hosting world. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Python does not play well with others

2007-02-01 Thread John Nagle
ession testing with each new Python distribution, but they don't really need to be part of the main build. Right now, SSL is too far inside, while the other two are too far outside. A middle ground would help. Otherwise, you get version hell. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: mysqldb duplicate entry error handling

2007-02-01 Thread John Nagle
else: raise # unexpected error, reraise John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Timeout for M2Crypto working - patch

2007-02-02 Thread John Nagle
-- http://mail.python.org/mailman/listinfo/python-list

Re: Where Does One Begin?

2007-02-02 Thread John Nagle
Mister Newbie wrote: > I have no programming experience. I want to learn Python so I can make > simple, 2D games. Where should I start? Can you recommend a good book? > > Thank you. Blender GameKit. John Nagle -- http://mail.python

How to suppress "DeprecationWarning: Old style callback, use cb_func(ok, store) instead"

2007-02-03 Thread John Nagle
How do I suppress "DeprecationWarning: Old style callback, use cb_func(ok, store) instead". A library is triggering this message, the library is being fixed, but I need to make the message disappear from the output of a CGI program. John Nagl

Re: How to suppress "DeprecationWarning: Old style callback, use cb_func(ok, store) instead"

2007-02-03 Thread John Nagle
Gabriel Genellina wrote: > En Sat, 03 Feb 2007 06:12:33 -0300, Peter Otten <[EMAIL PROTECTED]> > escribió: > >> John Nagle wrote: >> >>>How do I suppress "DeprecationWarning: Old style callback, use >>>cb_func(ok, >>> store) i

Re: Python does not play well with others

2007-02-04 Thread John Nagle
one with dependencies on other components, can be a big deal. So, focus on problems with modules which have C components. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Unicode problem in BeautifulSoup; worked in Python 2.4, fails in Python 2.5.

2007-02-04 Thread John Nagle
To replicate, run http://www.bankofamerica.com or http://www.gm.com through BeautifulSoup. Something about this code doesn't like big companies. Web sites of smaller companies are going through OK. Also reported as a bug: [ 1651995 ] sgmllib _convert_ref UnicodeDecodeError exception, new in 2.5 John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Python does not play well with others

2007-02-04 Thread John Nagle
nsaction program is launched in a separate process, and, once done with one transaction, can be used to do another one without reloading. When things are slow, the extra transaction processes are told to exit; when load picks up, more of them are forked. Security is comparable to CGI.) John Nagle -- http://mail.python.org/mailman/listinfo/python-list

sgmllib bug in Python 2.5, works in 2.4.

2007-02-04 Thread John Nagle
I think the code is trying to handle single quotes inside of double quotes, or something like that. To replicate, run http://www.bankofamerica.com or http://www.gm.com through BeautifulSoup. Something about this code doesn't like big companies. Web sites of smaller compan

Re: Python does not play well with others

2007-02-05 Thread John Nagle
[EMAIL PROTECTED] wrote: > John Nagle wrote: > >>Graham Dumpleton wrote: >> >>>On Feb 4, 1:05 pm, Paul Rubin <http://[EMAIL PROTECTED]> wrote: >>> >>> >>>>"Paul Boddie" <[EMAIL PROTECTED]> writes: >> Rea

Re: huge amounts of pure Python code broken by Python 2.5?

2007-02-06 Thread John Nagle
ioning issues between Python, SWIG, gcc, and OpenSSL, and getting everything to play together can be difficult. This is a packaging issue; major Linux distros aren't shipping a compatible set of components. But my own pure Python code is working fine in both version of Python, and on both W

Trouble fixing a broken ASCII string - "replace" mode in codec not working.

2007-02-06 Thread John Nagle
I'm trying to clean up a bad ASCII string, one read from a web page that is supposedly in the ASCII character set but has some characters above 127. And I get this: File "D:\projects\sitetruth\InfoSitePage.py", line 285, in httpfetch sitetext = sitetext.encode('ascii','replace') # for

Re: sgmllib bug in Python 2.5, works in 2.4.

2007-02-07 Thread John Nagle
John Nagle wrote: > (Was prevously posted as a followup to something else by accident.) > >I'm running a website page through BeautifulSoup. It parses OK > with Python 2.4, but Python 2.5 fails with an exception: > > Traceback (most recent call last): >File &q

Re: multithreading concept

2007-02-07 Thread John Nagle
ectly to multicore desktops and laptops. I went to a talk at Stanford last week by one of Intel's CPU architects, and he said we're going have hundreds of CPUs per chip reasonably soon. Python needs to get ready. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Does the world need another v0.1 python compiler?

2007-02-07 Thread John Nagle
g excess baggage. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: pygame and python 2.5

2007-02-09 Thread John Nagle
In the GCC world, any compiler since 3.2 should generate interchangeable output. http://gcc.gnu.org/onlinedocs/gcc/Compatibility.html In the Windows world, I'm not sure about compatibility across the VC6/.NET transition, but I think you only need one version for either side of that

What does "del" actually do?

2007-02-10 Thread John Nagle
eleted from the object? Is behavior the same for both old and new classes? I'm trying to break cycles to fix some memory usage problems. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: standardized us address

2007-02-12 Thread John Nagle
s it. It's a non-trivial > task. There's a US address normalizer written in Perl available. http://cpan.uwinnipeg.ca/htdocs/Geo-StreetAddress-US/Geo/StreetAddress/US.html Not too big, too; it's mostly tables. Might not be too bad to convert. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Segmentation faults using threads

2007-02-13 Thread John Nagle
bly in some non-Python component; you shouldn't be able to force a memory protection error from within Python code. Also note that the "marshal" module may be unsafe. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

How can this Perl regular expression be expressed in Python?

2007-02-13 Thread John Nagle
irect}) are other regular expressions, being used here as subexpressions. Those have already been converted to forms like "Addr_Match.direct" in Python. But how to call them? Is that possible in Python, and if so, where is it documented? Jo

Re: How can this Perl regular expression be expressed in Python?

2007-02-13 Thread John Nagle
Gabriel Genellina wrote: > En Wed, 14 Feb 2007 01:07:33 -0300, John Nagle <[EMAIL PROTECTED]> > escribió: > >> Here's a large Perl regular expression, from a Perl address parser in >> CPAN: >> >> use re 'eval'; >> $Addr_Matc

Re: Segmentation faults using threads

2007-02-14 Thread John Nagle
t my scipy and Numeric aren't quite up-to-date: > scipy version 0.3.2, Numeric v 24.2 That sounds like the case where the array has to be reallocated from 4-byte floats to 8-byte doubles is being botched. Take a look at "http://www.mail-archive.com/numpy-discussion@lists.sourc

Re: threading and multicores, pros and cons

2007-02-14 Thread John Nagle
If locking is expensive on x86, it's implemented wrong. It's done right in QNX, with inline code for the non-blocking case. Not sure about the current libraries for Linux, but by now, somebody should have gotten this right. John Nagle Paul R

Re: threading and multicores, pros and cons

2007-02-14 Thread John Nagle
Paul Rubin wrote: > John Nagle <[EMAIL PROTECTED]> writes: > >>If locking is expensive on x86, it's implemented wrong. >>It's done right in QNX, with inline code for the non-blocking case. > > > Acquiring the lock still takes an expensive instruc

Re: Python 3.0 unfit for serious work?

2007-02-20 Thread John Nagle
t for seven years now. The user base just wasn't interested. Perl 5 was good enough, and users migrated to PHP for the little stuff and other languages for the bigger stuff. As Wikipedia says, "As of 2007, Perl 6 was still under development, with no planned completion date."

Re: Python 3.0 unfit for serious work?

2007-02-20 Thread John Nagle
Paul Rubin wrote: > John Nagle <[EMAIL PROTECTED]> writes: > >> There's always the possiblity that Python 3 won't happen. Look at >>what happened with Perl 6. That's been talked about for >>seven years now. The user base just wasn't intere

Re: Parsing HTML

2007-02-23 Thread John Nagle
BeautifulSoup would be a good test case for the PyPy crowd to work on. It really needs the speedup. John Nagle sofeng wrote: > On Feb 8, 11:43 am, "metaperl" <[EMAIL PROTECTED]> wrote: >>On Feb 8, 2:38 pm, "mtuller" <[EMAIL

Are weak refs slower than strong refs?

2007-02-24 Thread John Nagle
reaks the loops that give reference counting trouble. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

BeautifulSoup modified to use weak refs and avoid circular links.

2007-02-25 Thread John Nagle
John Nagle wrote: > Are weak refs slower than strong refs? I've been considering making the > "parent" links in BeautifulSoup into weak refs, so the trees will release > immediately when they're no longer needed. In general, all links back > towards the root of

Weakref problem: no way to get original object from proxy object?

2007-02-25 Thread John Nagle
Is there some way to get a strong ref to the original object back from a weakref proxy object? I can't find any Python function to do this. ".ref()" doesn't work on proxy objects. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: convert strings to utf-8

2007-02-25 Thread John Nagle
go into a stream of 8-bit bytes, not a Unicode string. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Weakref problem: no way to get original object from proxy object?

2007-02-25 Thread John Nagle
Gabriel Genellina wrote: > En Sun, 25 Feb 2007 19:07:38 -0300, John Nagle <[EMAIL PROTECTED]> > escribió: > >> Is there some way to get a strong ref to the original object back >> from a weakref proxy object? I can't find any Python function to do >

Re: Jobs: Lisp and Python programmers wanted in the LA area

2007-02-26 Thread John Nagle
find Lisp programmers. As someone who knows both languages, I'd stay with Python, although trying to do heavy number crunching in a naive interpreter may be a problem. That's a tough scheduling problem. It took about a year for the NetJets people to develop their applic

Re: Python / Socket speed

2007-02-26 Thread John Nagle
rprocess communication message passing system. There's the cost of one extra copy for every I/O operation, but you don't notice it much in practice. I've run 640x480x15FPSx24bits video through QNX messaging and only used 2% of an 1.5GHZ x86 CPU doing it. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Extension Building Network

2007-11-09 Thread John Nagle
od idea. Can you get some corporate support? It would be good to have some organization behind this. Binaries are a security issue; you need an organization or a reputation to distribute binaries. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Codec lookup fails for bad codec name, blowing up BeautifulSoup

2007-11-09 Thread John Nagle
n charset codec = None try: codecs.lookup(charset) codec = charset except (LookupError, ValueError): pass return codec John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Codec lookup fails for bad codec name, blowing up BeautifulSoup

2007-11-09 Thread John Nagle
//bugs.python.org/issue960874 How did you find that? I put "codecs.lookup" into the tracker's search box, and it returned five hits, but not that one. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Feeding data into MySQLdb LOAD DATA from Python

2007-11-14 Thread John Nagle
ach update. And can this be done portably across UNIX and Windows? Thanks. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Python too complex ?!?!?!

2007-11-18 Thread John Nagle
SQL and OpenSSL on a shared hosting server and see how far you get. Or try to install the same set of modules on both Linux and Windows. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

How to read gzipped utf8 file in Python?

2007-11-22 Thread John Nagle
pen" doesn't support an "encoding" parameter. (It probably should, for consistency.) Is there some way to do this? Is it possible to express "unzip, then decode utf8" via "codecs.open"? John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Web page from hell breaks BeautifulSoup, almost

2007-12-10 Thread John Nagle
s huge. Worst HTML I've seen in a while. (We use BeautifulSoup to parse hostile web sites in bulk, so we tend to discover more hard cases than most users.) John Nagle SiteTruth -- http://mail.python.org/mailman/listinfo/python-list

DNS servers in Python - which ones are a good base for work?

2007-12-11 Thread John Nagle
I need to do a non-standard DNS server in Python. This is for a spam blacklist type DNS server, not for IP lookup. "dnspython" seems to be client side only. Oak DNS is deprecated. Suggestions? John Nagle -- http://mail.python.org/mailman/listinfo/python-list

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

2007-12-11 Thread John Nagle
age." So that's what's possible. I'm surprised that Google management isn't pushing Guido towards doing something about the performance problem. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

After running for four days, Python program stalled

2007-12-12 Thread John Nagle
Had a Python program stall, using no time, after running OK for four days. Python 2.4, Windows. Here's the location in Python where it's stalled. Any idea what it's waiting for? John Nagle 77FA1428 mov ecx,dword ptr [ebp-10h]

urlparse.urlparse bug - misparses long URL

2007-12-13 Thread John Nagle
wonderful world of parsing hostile sites in Python. This is from a phishing attack, and that URL is in PhishTank.) John Nagle SiteTruth -- http://mail.python.org/mailman/listinfo/python-list

Re: urlparse.urlparse bug - misparses long URL

2007-12-13 Thread John Nagle
John Nagle wrote: > Here's a hostile URL that "urlparse.urlparse" seems to have mis-parsed. ... Simpler example: import urlparse s = 'http://www.example.com.mx?https://www.example.com' print urlparse.urlparse(s) produces ('http', 'www

Re: urlparse.urlparse bug - misparses long URL

2007-12-14 Thread John Nagle
Matt Nordhoff wrote: > John Nagle wrote: >> Here's a hostile URL that "urlparse.urlparse" seems to have mis-parsed. >> ... > > It's breaking on the first slash, which just happens to be very late in > the URL. > >>>> urlparse

Re: urlparse.urlparse bug - misparses long URL

2007-12-14 Thread John Nagle
John Nagle wrote: > Matt Nordhoff wrote: >> John Nagle wrote: >>> Here's a hostile URL that "urlparse.urlparse" seems to have mis-parsed. >>> > ... > >> >> It's breaking on the first slash, which just happens to be very late i

Re: urlparse.urlparse bug - misparses long URL - FIX

2007-12-14 Thread John Nagle
John Nagle wrote: > John Nagle wrote: >> Matt Nordhoff wrote: >>> John Nagle wrote: >>>> Here's a hostile URL that "urlparse.urlparse" seems to have mis-parsed. >>>> >> ... >> >>> >>> It's breakin

Re: Is Python really a scripting language?

2007-12-14 Thread John Nagle
A, for example, and in theory you can script OpenOffice and Gnome via CORBA. But nobody does that. Exercise: write a Python program to convert a ".doc" file to a ".pdf" file by invoking OpenOffice via CORBA. At least in theory, this is possible. All the necessary parts supposedly exist. Somebody tried back in 2003, but gave up. See "http://mail.python.org/pipermail/python-list/2003-April/198094.html"; John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Is Python really a scripting language?

2007-12-15 Thread John Nagle
Eric S. Johansson wrote: > John Nagle wrote: >> Yes. One of the basic design flaws of UNIX was that interprocess >> communication was originally almost nonexistent, and it's still not >> all that >> great. It's easy to run other programs, and easy to

Re: MySQLdb syntax issues - HELP

2007-12-16 Thread John Nagle
p things by any field, which is the whole point of having a database. (The database looks up much faster if you specify that some fields are INDEX fields. But that can come later.) John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: MySQLdb syntax issues - HELP

2007-12-17 Thread John Nagle
rom different accounts. If you wanted to allow duplicate names from the same account, you could write UNIQUE INDEX (name,characcount) which requires that the combo of name and characcount be unique. With that rule in the database, an INSERT that tries to insert a duplicate name will raise

Re: urlparse.urlparse bug - FIX/IN TRACKER

2007-12-17 Thread John Nagle
John Nagle wrote: >>>>> Here's a hostile URL that "urlparse.urlparse" seems to have >>>>> mis-parsed. >>>>> Added to tracker, with proposed fix: http://bugs.python.org/issue1637 J

Re: It's ok to __slots__ for what they were intended

2007-12-21 Thread John Nagle
from setting attributes on "their" > instances. Agreed. I'd like to hear more about what kind of performance gain can be obtained from "__slots__". I'm looking into ways of speeding up HTML parsing via BeautifulSoup. If a significant speedup can be ob

Re: It's ok to __slots__ for what they were intended

2007-12-22 Thread John Nagle
Fredrik Lundh wrote: > John Nagle wrote: > >> I'd like to hear more about what kind of performance gain can be >> obtained from "__slots__". I'm looking into ways of speeding up >> HTML parsing via BeautifulSoup. If a significant speedup can b

Re: Inter-process communication, how? Part 2

2007-12-23 Thread John Nagle
al time process had its text output labeled, timestamped, and transmitted using QNX interprocess communication to a lower priority logging process on a different machine. Text output never blocked; if a queue filled, "..." appeared in the log file. That's a special real-time situation.

Re: How to get Python to default to UTF8

2007-12-23 Thread John Nagle
; encoding, for example), or ignoring unexpected characters, or converting them to "?". John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Choosing a new language

2007-12-28 Thread John Nagle
uage spec tied to CPython, the other implementations are always playing catch-up and run far behind the CPython implementation. As languages, C# and Java are reasonably good. They tend to come with too much excess baggage in the form of frameworks, run-time systems, and packagers, but as lang

Re: Tab indentions on different platforms?

2007-12-29 Thread John Nagle
the problem has to do with tab indention, It really should be a syntax error in Python to mix leading tabs and leading spaces in the same file. One can argue over which to use, but a file with both usually leads to trouble. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

urllib timeout hole - long timeout if site doesn't send headers.

2008-01-03 Thread John Nagle
ver sent, while "http://www.example.com"; yields a proper web page. Even Firefox doesn't time this out properly. Try "http://soton.ac.uk"; in Firefox, and be prepared for a long wait. There was some active work in the urllib timeout area last summer. What happened to t

Re: How a smart editor could make "Postfix type declarations PEP3117" in Python3000 more readable

2008-01-04 Thread John Nagle
ked very strictly typed languages like Ada and Modula. Python actually does unusually well without declarations. Most languages that don't have declarations run into difficulties. Consider Basic, TCL, and Matlab, to name three rather diverse examples. Python managed to avoid the problems those la

Cost of "unicode(s)" where s is Unicode

2008-01-06 Thread John Nagle
Does text = unicode(text) make a copy of a Unicode string, or is that essentially a free operation if the input is already Unicode? John Nagle -- http://mail.python.org/mailman/listinfo/python-list

python-list@python.org

2008-01-06 Thread John Nagle
e" tries to convert "1234567" into a Unicode character with that decimal number, and gets a Unicode overflow. For our own purposes, I rewrote "htmldecode" to require a sequence ending in ";", which means some bogus HTML escapes won't be recognized, but correct

Analyzing Python GC output - what is a "cell", and what information is available about it.

2008-01-10 Thread John Nagle
them? Is there any way to find out what the 'function object' is from within Python? (I'm looking for a possible memory leak, obviously.) John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Analyzing Python GC output - what is a "cell", and what information is available about it.

2008-01-11 Thread John Nagle
Duncan Booth wrote: > John Nagle <[EMAIL PROTECTED]> wrote: > >> I'm printing out each entry in "gc.garbage" after a garbage collection in >> DEBUG_LEAK mode, and I'm seeing many entries like >> >> >> >> That's the output

Re: Analyzing Python GC output - turns out to be MySQLdb problem

2008-01-11 Thread John Nagle
Francesco Guerrieri wrote: > On Jan 11, 2008 6:20 PM, John Nagle <[EMAIL PROTECTED]> wrote: >> Tried: >> print item.dir() >> got: >> 'cell' object has no attribute 'dir' It's a problem inside MySQLdb's "con

<    1   2   3   4   5   6   7   8   9   10   >