Re: What are python closures realy like?

2006-12-11 Thread John Nagle
ation with the callback function, which would be called when a request to the server completed. A global variable wouldn't have worked, because multiple instances of the object making the callback are possible. It's a useful tool, but not one you need frequently. Don't get car

Re: Obtaining SSL certificate info from SSL object - proposal

2006-12-13 Thread John Nagle
John Nagle wrote: > Michael Ströder wrote: > >> John Nagle wrote: >> >>>The Python SSL object offers two methods from obtaining >>> the info from an SSL certificate, "server()" and "issuer()". >>> The actual values in the certif

Re: YouTube written in Python

2006-12-14 Thread John Nagle
ctual video passes through Python at any point. Transcoding in Python would take forever. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: MySQLdb windows binaries for Python 2.5?? Yes, but from a World of Warcraft guild.

2006-12-14 Thread John Nagle
thon community. Perl and PHP come with MySQL support built in. Python is out to lunch on this. John Nagle Animats -- http://mail.python.org/mailman/listinfo/python-list

Re: MySQLdb windows binaries for Python 2.5?? Yes, but from a World of Warcraft guild.

2006-12-14 Thread John Nagle
Fuzzyman wrote: > johnf wrote: > >>John Nagle wrote: >> >> >>>Jan Dries wrote: >>> >>>>[EMAIL PROTECTED] wrote: >>>> >>>> >>>>>I'm also looking for a MySQLdb binary for windows. This is holding me

Re: MySQLdb windows binaries for Python 2.5?? Yes, but from a World of Warcraft guild.

2006-12-14 Thread John Nagle
John Nagle wrote: >What's happened is that Python fell through the cracks here. MySQL > themselves support Java, Microsoft ".NET", PHP, and a C interface. > The Perl interface to MySQL is part of the supported Perl distribution. > But for for Python, everybody is ru

Re: Roundtrip SQL data especially datetime

2006-12-15 Thread John Nagle
e MySQL objects have a year range from 1000 to , while Python only has the UNIX range of 1970 to 2038. Remember, a database may have DATETIME dates which reflect events in the distant past or future. None of this will help performance; dates and times are sent over the connection to a MySQL database as strings. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Roundtrip SQL data especially datetime

2006-12-16 Thread John Nagle
John Machin wrote: > John Nagle wrote: > >>dyork wrote: >> >>>"John Machin" <[EMAIL PROTECTED]> wrote in message >>>news:[EMAIL PROTECTED] >>> >>> >>>>If you have, as you should, Python 2.5, you can use this: >

Re: Roundtrip SQL data especially datetime

2006-12-16 Thread John Nagle
Marc 'BlackJack' Rintsch wrote: > In <[EMAIL PROTECTED]>, John Nagle wrote: > >>John Machin wrote: >> >>>John Nagle wrote: >>> >>>>dyork wrote: >>>> >>>>>"John Machin" <[EMAIL PROTECTED]>

Re: How to test if two strings point to the same file or directory?

2006-12-16 Thread John Nagle
no system-independent way. It's often not possible for files accessed across a network; the information just isn't being sent. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: trees

2006-12-17 Thread John Nagle
Delaney, Timothy (Tim) wrote: > vertigo wrote: > > >>Hello >> >>What library/functions/classes could i use to create trees ? SpeedTree, of course. http://www.speedtree.com They have great downloadable demos.

Re: dealing with special characters in Python and MySQL

2006-12-17 Thread John Nagle
index.php?func=detail&aid=1559350&group_id=22307&atid=374932 and look at other charset related bugs at http://sourceforge.net/tracker/?atid=374932&group_id=22307&func=browse Also note that MySQLdb didn't support this until recently, so check you

Re: Roundtrip SQL data especially datetime

2006-12-18 Thread John Nagle
side needs code from the other. The protocol is published. So there's no license issue. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Unescaping URLs in Python

2006-12-24 Thread John Nagle
scaped form that will work for all URLs. There's "htmldecode" at "http://zesty.ca/python/scrape.py";, which works, but this should be a standard library function. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Unescaping URLs in Python

2006-12-25 Thread John Nagle
Lawrence D'Oliveiro wrote: > In message <[EMAIL PROTECTED]>, John Nagle > wrote: > > >>Here's a URL from a link on the home page of a major company. >> >>About Us >> >>What's the appropriate Python function to call to unescape a U

BeautifulSoup vs. loose & chars

2006-12-25 Thread John Nagle
why this is a problem. I need valid XML out, even if what went in wasn't quite valid. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: BeautifulSoup vs. loose & chars

2006-12-26 Thread John Nagle
ers, numbers, and '#' ending with a ';' Admittedly this would let something like '&xx#2;', which isn't a legal entity, through unmodified. There's still a potential problem with unknown entities in the output XML, but at least they're recognized as entities. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

BeautifulSoup bug when ">>>" found in attribute value

2006-12-26 Thread John Nagle
. It first parsed it right, but then stuck in an extra, totally bogus line. Note the entity "&linkurl;", which appears nowhere in the original. It looks like code to handle a missing quote mark did the wrong thing. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: BeautifulSoup bug when ">>>" found in attribute value

2006-12-27 Thread John Nagle
Duncan Booth wrote: > John Nagle <[EMAIL PROTECTED]> wrote: > > >>And this came out, via prettify: >> >>>url="http%3A//www.apartmentsapart.com/Europe/Spain/Madrid/FAQ"> >> > value="/images/offersBanners/sw04.swf?binfot=We off

urllib.urlopen unwanted password prompts - documentation problem

2006-12-27 Thread John Nagle
m you have encountered is with a project web site hosted by SourceForge.net. This issue should be reported to the SourceForge.net-hosted project (not to SourceForge.net). John Nagle -- http://mail.python.org/mailman/listinfo/python-list

No way to set a timeout in "urllib".

2006-12-29 Thread John Nagle
ged from doing so. The code was forked by Zope as a workaround in 2003: http://pywebsvcs.sourceforge.net/apidocs/wstools/Utility.html but that's not in the mainstream Python tree. The correct fix would probably be to add methods to class URLopener to control this; that's the usual way of handling

Re: No way to set a timeout in "urllib".

2006-12-29 Thread John Nagle
finishing the Python SSL library, which doesn't even check certificates, let alone revocation lists. It's a pure interface problem. OpenSSL does all the hard parts, but the Python glue code is crude and incomplete. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Question concerning this list [WebCrawler]

2006-12-31 Thread John Nagle
d by a grammar-level parser. Any compiler book will cover this. Using regular expressions for LALR(0) parsing is a vice inherited from Perl, in which regular expressions are easy and "get next character from string" is unreasonably expensive. In Python, at least you can inde

Re: C/C++, Perl, etc. to Python converter

2007-01-04 Thread John Nagle
t be worth doing. The languages have quite different syntax, but roughly the same functionality. You'd probably have to write a set of libraries in Python with the equivalent definitions to their Perl counterparts, but that's just time-consuming, not difficult. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: MySQLdb windows binaries for Python 2.5?? Yes, but from a World of Warcraft guild.

2007-01-05 Thread John Nagle
oblems. There hasn't been a new release of MySQLdb since April 2006, and there's no official support for either Python 2.5 or Windows. Realistically, you have to run Python 2.4 or earlier if you need database access. We dropped back to Python 2.4, with good results.

Re: Why less emphasis on private data?

2007-01-07 Thread John Nagle
n via "self._x" forms, so they'd be inaccessable outside the object. It's undesirable from a maintenance standpoint to have an unenforced convention like a lead underscore. The maintenance programmer can't trust its meaning. As Python grows up, and larger systems are written in it, these issues become more important. John Nagle Animats -- http://mail.python.org/mailman/listinfo/python-list

Re: M2Crypto-0.17 blocks python threads?

2007-06-03 Thread John Nagle
undation.org/show_bug.cgi?id=9401 > > Thanks for the report! That helps. I've been getting occasional stalls and timeouts in a multithreaded program that can have several M2Crypto operations going, and this is probably the explaination. John Nagle

Re: Accessing function in a module by name

2007-06-06 Thread John Nagle
In any case, SOAP servers should have a separate object for each connection, or the thing will mess up if two requests are made at the same time. See http://www.ibm.com/developerworks/library/ws-pyth5/ John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Verify server certificate in HTTPS transaction

2007-06-08 Thread John Nagle
right now. John Nagle Hamish Moffatt wrote: > Hi, > I'm fetching some files over HTTPS from Python and I want to verify the > server certificate. (Not just the name etc provided in certificate.) > > How can I get access to this information? > > urllib2 do

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-09 Thread John Nagle
p. Then the simple Physics 101 approach isn't so simple any more. John Nagle Animats -- http://mail.python.org/mailman/listinfo/python-list

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-10 Thread John Nagle
[EMAIL PROTECTED] wrote: > On Jun 9, 12:16 pm, James Stroud <[EMAIL PROTECTED]> wrote: > >>Terry Reedy wrote: >> >>>In Python, you have a choice of recursion (normal or tail) >> >>Please explain this. I remember reading on this newsgroup that an >>advantage of ruby (wrt python) is that ruby has ta

Re: Python optimization (was Python's "only one way to do it" philosophy isn't good?)

2007-06-10 Thread John Nagle
f loops. Hoisting reference count updates out of loops. Keeping frequently used variables in registers. And elimination of many unnecessary dictionary lookups. Python could get much, much faster. Right now CPython is said to be 60X slower than C. It should be possible to get at least an order of magnitude over CPython. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Python optimization (was Python's "only one way to do it" philosophy isn't good?)

2007-06-10 Thread John Nagle
Steve Howell wrote: > --- John Nagle <[EMAIL PROTECTED]> wrote: > >>With this, the heavy optimizations are possible. >>Strength reduction. Hoisting >>common subexpressious out of loops. Hoisting >>reference count updates out of >>loops. Keeping freq

Re: Python optimization (was Python's "only one way to do it" philosophy isn't good?)

2007-06-11 Thread John Nagle
ctually facing that because Python's HTML parsing is so slow. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-12 Thread John Nagle
In LISP, one might iterate over a list using tail recursion, but in Python, that would be both silly and inefficient. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-12 Thread John Nagle
ly replaceable. The compiler would have to detect that the function doesn't modify or replace itself while recursing for this optimization to be valid. Worst case, another thread could replace the function while it was recursing, invalidating the tail recursion optimization. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Python optimization (was Python's "only one way to do it" philosophy isn't good?)

2007-06-13 Thread John Nagle
startup JavaScript, then lets you examine the DOM. There are too many pages now that just come through as blank if you don't run the OnLoad JavaScript.) John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: The Modernization of Emacs

2007-06-19 Thread John Nagle
The "I'm so l33t" thing. I used EMACS back in the LISP era, but really, that approach is mostly of historical interest at this late date. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: HTMLParser.HTMLParseError: EOF in middle of construct

2007-06-19 Thread John Nagle
comments. The default action is to suck up the rest of the entire document into the comment, which is usually not what you want. I have a fix for that at http://mail.python.org/pipermail/python-list/2007-May/440370.html John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: How can I know the name of "caller"

2007-06-19 Thread John Nagle
on libraries which I import. (I've reported all of them in the tracker as bugs, and some later version of Python will contain the fixes. But that can take years.) John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-20 Thread John Nagle
ot here yet. Modula 3 was getting close, but it was being developed at DEC, which had no software business outside of selling for DEC systems. Then Compaq bought DEC and HP bought Compaq and all the research units disappeared. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-06-21 Thread John Nagle
ot really essential to Python. (PEAK, the main effort in that direction, seems to be defunct.) What we need are better implementations than CPython, not hokey attribute schemes bolted onto the language. We're seeing stuff go in that's easy to add to CPython, but not necessarily good f

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-06-22 Thread John Nagle
l language baggage. PEP 3107 adds the excess baggage without providing the benefit of compile time checks. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

urllib interpretation of URL with ".."

2007-06-22 Thread John Nagle
which results in an HTTP error 400. Is "urllib" wrong? John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: urllib interpretation of URL with ".."

2007-06-23 Thread John Nagle
Martin v. Löwis wrote: > John Nagle schrieb: > >>Here's a URL, found in a link, which gives us trouble >>when we try to follow the link: >> >>http://sportsbra.co.uk/../acatalog/shop.html >> >>Browsers immediately turn this into >> >&g

Re: automatical pdf generating

2007-06-24 Thread John Nagle
> Thanks > > Jackie > Generate HTML for such pages, open them with OpenOffice, and have OpenOffice generate the PDF file. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: urllib interpretation of URL with ".."

2007-06-25 Thread John Nagle
dea whether it's being used by a client or a server, so it, reasonably enough, takes option 1. (Yet another hassle in processing real-world HTML.) John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-06-27 Thread John Nagle
Bruno Desthuilliers wrote: > harri a écrit : > Indeed - static typing is for compilers, not for programmers. Actually, static typing is for detecting errors before the program is run. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-06-27 Thread John Nagle
sort of thing. Remember "Hungarian notation"? "LPSTR"? Yes, that stuff. Moving to C++ and strong typing was generally considered a major improvement in the Windows world. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Too many 'self' in python.That's a big flaw in this language.

2007-06-27 Thread John Nagle
Bruno Desthuilliers wrote: > Jorgen Bodde a écrit : > >> But, what about something in between like only >> using the dot (.) for a shorter notation? How about "Mavis Beacon Teaches Typing"? John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-27 Thread John Nagle
re.) With those approaches, destructors would be sound, order of destruction would be well defined, and the "here be dragons" notes about destructors could come out of the documentation. With that, we wouldn't need "with". Or a garbage collector. If you like minimalism, this is the way to go. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-28 Thread John Nagle
Andy Freeman wrote: > On Jun 27, 11:41 pm, John Nagle <[EMAIL PROTECTED]> wrote: > While I agree that weak pointers are good and can not be an > afterthought, I've written code where "back" changed dynamically, and > I'm pretty sure that Nagle has as well.

Re: Too many 'self' in python.That's a big flaw in this language.

2007-06-28 Thread John Nagle
will refuse that, > and force you to use this->a instead;-). Yes, as Strostrup admits, "this" should have been a reference. Early versions of C++ didn't have references. One side effect of that mistake was the "delete(this)" idiom, which does not play well with i

Re: Rappresenting infinite

2007-06-29 Thread John Nagle
Okay, I thought you meant that there was an actual symbol 'inf' in the > builtins > or in a module somewhere. > > >>>No. You can make one that fits your requirements, though. That sounds like a bug. If Python numerics don't define +INF, -INF, and NaN, along with the tests for them, that's a flaw in the language. We can assume IEEE floating point at this late date; it's been standard for twenty years and Java assumes it. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Python compilation ??

2007-07-02 Thread John Nagle
to Microsoft's byte code as used by their ".NET" common language runtime. This is then compiled to machine code by a just-in-time compiler. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Rappresenting infinite

2007-07-02 Thread John Nagle
his differs across platforms. Your code won't work on > Windows, > for example. Yes. This is CPython bug #1255395, status "open". Also CPython bug #44585 (Pickle fails on "inf" values) PEP 42 contains excuses for not calling it a bug.

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-07-02 Thread John Nagle
member function in the whole program. (And, in fact, in Python you pay exactly the dispatch cost that would take.) The problem is that in both C++ and Java, the first round of the type system was botched. C++ originally had neither generics nor checked downcasting (a la "dynamic_cast"). Java originally lacked generics. Both languages added those as bolt-ons, and it shows. But, again, this really isn't a Python issue. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: mysteries of urllib/urllib2

2007-07-03 Thread John Nagle
(Coyote Point uses regular expressions to parse HTTP headers, and I think somebody wrote "\m" where they meant "\n".) John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: object references/memory access

2007-07-03 Thread John Nagle
cost. "repr/eval" is not an efficient way to marshall. Try using "pack" and "unpack", if you control both ends of the connection. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: object references/memory access

2007-07-03 Thread John Nagle
a killer if there's another compute bound process running; on each message pass you lose your turn for the CPU. (There have been worse operating systems. The classic MacOS allows you one (1) message pass per clock tick, or 60 messages per second.) John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: object references/memory access

2007-07-04 Thread John Nagle
ot filled up. >>... > If the problem does not require two way communication, which is > typical of a producer-consumer, it is a lot faster to allow P to fully > run before C is started. > > If P and C are tied using a pipe, in most linux like OS (QNX may be > doing somethi

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-07-04 Thread John Nagle
forced static typing requires a quality assurance group that reads code and checks coding standards. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Python's "only one way to do it" philosophy isn't good?

2007-07-05 Thread John Nagle
ction. Relying on the specific semantics of refcounting to give >>certain lifetimes is a logic error. We may need a guarantee that if you create a local object and don't copy a strong reference to it to an outer scope, upon exit from the scope, the object will be destroyed. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Auto-parallelizing without decorators?

2007-07-06 Thread John Nagle
ve been reduced. See: http://labs.google.com/papers/mapreduce.html Contrast this with Python's "reduce", which is inherently sequential. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a way to program a robot with python (ex, an electric motor, control it's speed, etc)

2007-07-08 Thread John Nagle
\ > > ex: what if i want the motor to turn for 10 seconds. stop for 5. then > turn the other direction. > > would you program it the same way you would on a personal computer > (via c, python, etc)? Try "comp.robotics.misc" for the basics of robot motor control.

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-07-08 Thread John Nagle
h time you go through the loop, but never goes negative. Most type issues can be resolved at compile time if you can see the whole program. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-07-08 Thread John Nagle
ode, as the DEC effort. Back when I was working on this, we only had a 1 MIPS VAX, and theorem proving was slow. That's much less of a problem now. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Problem with Python's "robots.txt" file parser in module robotparser

2007-07-11 Thread John Nagle
The value of this field specifies a partial URL that is not to be visited. This can be a full path, or a partial path; any URL that starts with this value will not be retrieved." That suggests that "//" should only disallow paths beginning with "//".

Re: Problem with Python's "robots.txt" file parser in module robotparser

2007-07-11 Thread John Nagle
re denied: > User-agent: * > Disallow: / > Ah, that's it. The problem is that "ibm.com" redirects to "http://www.ibm.com";, but but "ibm.com/robots.txt" does not redirect. For comparison, try "microsoft.com/robots.txt", which does redirect.

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-07-11 Thread John Nagle
ng in high performance aircraft and flying with the software written there. I've worked with car-sized robot vehicles, ones big enough to injure people. This gives one a stronger feeling about wanting to eliminate software defects early. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-07-12 Thread John Nagle
w. The basic problem is that C and C++ aren't well suited to proof of correctness, yet none of the other hard-compiled languages have any significant market share left. This is irrelevant to Python issues, though. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-07-12 Thread John Nagle
hat took a while to overcome. Much of that was from trying to cram interactive systems into computers with very modest capacity per user. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with Python's "robots.txt" file parser in module robotparser

2007-07-12 Thread John Nagle
Nikita the Spider wrote: > In article <[EMAIL PROTECTED]>, > John Nagle <[EMAIL PROTECTED]> wrote: > > >>Nikita the Spider wrote: >> >> >>>Hi John, >>>Are you sure you're not confusing your sites? The robots.txt file at >&g

Re: access to the namespace of a function from within its invocation

2007-07-12 Thread John Nagle
everything is a dictionary. Don't get carried away. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Can a low-level programmer learn OOP?

2007-07-13 Thread John Nagle
g. The main implementation, CPython, is about 60x slower than C, though, so if you're trying to implement, say, a rapidly changing digital oscilloscope display, the result may be sluggish. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Fetching a clean copy of a changing web page

2007-07-15 Thread John Nagle
ten while being sent by the server. Any good way to deal with this, short of reading it twice and comparing? John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Fetching a clean copy of a changing web page

2007-07-16 Thread John Nagle
Miles wrote: > On Jul 16, 1:00 am, John Nagle <[EMAIL PROTECTED]> wrote: > >>I'm reading the PhishTank XML file of active phishing sites, >>at "http://data.phishtank.com/data/online-valid/"; This changes >>frequently, and it's big (about 10

Re: Best method for inter process communications

2007-07-16 Thread John Nagle
orry about the socket overhead. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: urllib to cache 301 redirections?

2007-07-16 Thread John Nagle
code in real scenario yet with a 301 redirect. > If its okay, I shall test it and submit a patch for the tracker item. That assumes you're reusing the same object to reopen another URL. Is this thread-safe? That's also an inefficient way to test for an empty dictionary. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Fetching a clean copy of a changing web page

2007-07-16 Thread John Nagle
Miles wrote: > On Jul 16, 1:00 am, John Nagle <[EMAIL PROTECTED]> wrote: > >>I'm reading the PhishTank XML file of active phishing sites, >>at "http://data.phishtank.com/data/online-valid/"; This changes >>frequently, and it's big (about 10

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-07-19 Thread John Nagle
heck out the "Spec#" effort at Microsoft for current work. Work continues in Europe on Extended Static Checking for Java, which was developed at DEC before DEC disappeared. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-07-20 Thread John Nagle
herently wrong. It was a good idea in the 1970s when it was developed, but we know better now. If you were doing proofs of correctness for Python, the biggest headache would be checking for all the places where some object like a module or function might be dynamically modified and making sure nobody was patching the code. Enough on this issue, though. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-07-21 Thread John Nagle
paper: http://www.computationallogic.com/news/amd.html This stuff is hard to do, but notice that AMD hasn't had any recalls for floating point problems. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

URL parsing for the hard cases

2007-07-22 Thread John Nagle
'm parsing URLs used by hostile sites, and the wierd cases come up all too frequently. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Python un-plugging the Interpreter

2007-04-19 Thread John Nagle
d none of which really became finished products. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Python un-plugging the Interpreter

2007-04-19 Thread John Nagle
se with the hash mechanism for attribute lookup. The generality should be there if it's needed, but when it's not, the excess baggage should be removed. That's how you get the performance of the language up. This doesn't require type declarations. There are arguments

Re: Python un-plugging the Interpreter

2007-04-20 Thread John Nagle
Steve Holden wrote: > Marc 'BlackJack' Rintsch wrote: > >> In <[EMAIL PROTECTED]>, John Nagle wrote: >> >>> Many cases are easy. If a smart compiler sees >>> >>> for i in range(n) : >>>... # something >>

Unexpected exception from socket.getaddrinfo on Unicode URL

2007-04-20 Thread John Nagle
or" exceptions. It's worth a mention in the documentation for "socket". John Nagle D:\>/python25/python.exe Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] on win 32 Type "help", "copyright",

Re: newbie: HTTPS screen scraping

2007-04-21 Thread John Nagle
ubclass. That function will be called when a password is needed, and you return (username, password) as a tuple, which gets sent to the web server. Python, instead of having one library for reading URLs that works, has at least three, all with different problems. J

Re: Unexpected exception from socket.getaddrinfo on Unicode URL

2007-04-21 Thread John Nagle
Steve Holden wrote: > John Nagle wrote: > >> Here's a strange little bug. "socket.getaddrinfo" blows up >> if given a bad domain name containing ".." in Unicode. The >> same string in ASCII produces the correct "gaierror" ex

Python "robots.txt" parser broken since 2003

2007-04-21 Thread John Nagle
def prompt_user_passwd(self, host, realm): return None, None robotparser.URLopener.prompt_user_passwd = prompt_user_passwd # temp patch John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Easy make money!

2007-04-21 Thread John Nagle
abase. No address found on site. No usable SSL certificate. Rating: "Site ownership unknown or questionable." Any questions? John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: No speedup on multi-processor machine?

2007-04-21 Thread John Nagle
ed more CPUs. There's a numerics library for Python called NumPy, but it doesn't have a convolution function, although it has an FFT, which may be useful. But this is just homework. Do something reasonable and turn it in. A high performance solution to this problem is probably more

Re: Python "robots.txt" parser broken since 2003

2007-04-22 Thread John Nagle
Terry Reedy wrote: > "John Nagle" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > | This was reported in 2003, and a patch was uploaded in 2005, but the > patch > | never made it into Python 2.4 or 2.5. > > If the patch is still open, perhaps

Re: Python "robots.txt" parser broken since 2003

2007-04-22 Thread John Nagle
Steven Bethard wrote: > John Nagle wrote: > >> Terry Reedy wrote: >> >>> "John Nagle" <[EMAIL PROTECTED]> wrote in message >>> news:[EMAIL PROTECTED] >>> | This was reported in 2003, and a patch was uploaded in 2005, but >>>

Socket exceptions aren't in the standard exception hierarchy

2007-04-22 Thread John Nagle
except IOError, message:# I/O error But it wasn't. The "IOError" fell through, was caught by the next outer exception block, and was logged as a generic error. I can't find where in the Python socket module an "IOError" could be raised. I would have expec

Re: Socket exceptions aren't in the standard exception hierarchy

2007-04-23 Thread John Nagle
Dennis Lee Bieber wrote: > On Sun, 22 Apr 2007 23:20:25 -0700, John Nagle <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > >>2. File "D:\Python24\lib\socket.py", line 295, in read >>data = self._sock.recv(recv_size) &g

Re: Socket exceptions aren't in the standard exception hierarchy

2007-04-23 Thread John Nagle
Steve Holden wrote: > John Nagle wrote: > >> Dennis Lee Bieber wrote: >> >>> On Sun, 22 Apr 2007 23:20:25 -0700, John Nagle <[EMAIL PROTECTED]> >>> declaimed the following in comp.lang.python: >>> >>> >>>> 2. File &q

Does socket.setdefaulttimeout affect the timeouts in MySQLdb?

2007-04-23 Thread John Nagle
s don't hang. But MySQLdb uses the MySQL C library, which doesn't use Python opens. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Socket exceptions aren't in the standard exception hierarchy

2007-04-24 Thread John Nagle
Steve Holden wrote: > John Nagle wrote: > [socket.error bug report] > >>> >>> Where did you get this information? If true it would certainly need >>> to be logged as a bug, but under Windows on 2,4 I see >>> >>> >>> issubclass(soc

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