Re: A critique of cgi.escape

2006-09-26 Thread Fredrik Lundh
Jon Ribbens wrote: > If you don't know the answer, you can say so y'know. I know the answer. I'm pretty sure everyone else who's actually read my posts to this thread might have figured it out by now, too. But since you're still trying to "win" the debate, long after it's over, I think it's sa

Re: Remap Mysql tuple to dictionary

2006-09-26 Thread Frank Millman
Fredrik Lundh wrote: > Frank Millman wrote: > > > I am reminded of a spoof Latin motto from the days of my youth - > > > >NIL ILLEGITIMO CARBORUNDUM > > isn't that usually written > > Illegitimi non carborundum > > ? > > or is that just due to differences between british latin and american

Re: ultra newbie question (don't laugh)

2006-09-26 Thread Larry Bates
John Salerno wrote: > Ok, I've decided to make a little project for myself which involves > storing employee information in an XML file. I'm doing this partly to > experiment with working with XML. The blocks in the file will look > something like this: > > > John > Salerno > United States

Re: Remap Mysql tuple to dictionary

2006-09-26 Thread Tim Chase
>>NIL ILLEGITIMO CARBORUNDUM > > isn't that usually written > > Illegitimi non carborundum > > or is that just due to differences between british latin and > american latin ? Wouldn't those differences make it "carbourundum" vs. "carborundum" respectively? :*) (however, yes, dredging

Re: A critique of cgi.escape

2006-09-26 Thread Jon Ribbens
In article <[EMAIL PROTECTED]>, Brian Quinlan wrote: > A summary of this pointless argument: Your summary seems pretty reasonable, but please note that later on, the thread was not about cgi.escape escaping (or not) quote characters (as described in your summary), but about Fredrik arguing, somewh

Re: ultra newbie question (don't laugh)

2006-09-26 Thread George Sakkis
John Salerno wrote: > So you see, what I'm asking for is very basic help, sort of along the > lines of "what things do I need to consider before I even begin this?" > Is OOP necessary here? Would utility functions work just as well for > simply writing the information to a file? To start with you

Re: A critique of cgi.escape

2006-09-26 Thread Fredrik Lundh
Jon Ribbens wrote: > I notice that yet again you've snipped the substantial point and > failed to answer it, presumably because you don't know how. cute. > What do XML Information Sets have to do with escaping control > characters in HTML? figure out the connection, and you'll have the answer t

Re: QuoteSQL

2006-09-26 Thread Fredrik Lundh
Sybren Stuvel wrote: > I didn't care anything about all that. I just found the way I wrote it > somewhat easier to read. absolutely. -- http://mail.python.org/mailman/listinfo/python-list

Re: odbc DbiDate date conversion

2006-09-26 Thread flupke
Frank Millman schreef: > Well waddyaknow - I get exactly the same, for dates earlier than > 1970-01-02. Thanks for finding a bug that would have bitten me sooner > or later. > > I will do some investigation. If I find an answer I will post it here, > unless some kind soul saves me the trouble an

import db data into openoffice

2006-09-26 Thread Ghido
Hi all i need to create a script for import a data from a database into a openoffice.org file with pyuno. Can someone help me with some link about this argument or with some examples? thank you very much Ghido -- http://mail.python.org/mailman/listinfo/python-list

Re: odbc DbiDate date conversion

2006-09-26 Thread Frank Millman
flupke wrote: > Frank Millman schreef: > > flupke wrote: > >> I'm using a solid DB and i'm accessing it via the odbc module > >> (activepython). > >> I get a DbiDate object returned but i don't find a way to decently print > >> it or get a format like %d/%m%/%y. > >> > > > > I convert it to a date

Re: Remap Mysql tuple to dictionary

2006-09-26 Thread Steve Holden
Lawrence D'Oliveiro wrote: > In message <[EMAIL PROTECTED]>, Pom wrote: > > >>I want to convert a Mysql resulset to a dictionary. > > > Here's a function that does this one row at a time: > > def GetEachRecord(TableName, Fields, Condition, Values, Extra = "") : > """generator which does an

Re: A critique of cgi.escape

2006-09-26 Thread Brian Quinlan
A summary of this pointless argument: Why cgi.escape should be changed to escape double quote (and maybe single quote) characters by default: o escaping should be very aggressive by default to avoid subtle bugs o over-escaping is not likely to harm most program significantly o people who do no

Extend file type

2006-09-26 Thread abcd
I have a class which extends 'file' class MyFile(file): def __init__(self, fname, mode='r'): file.__init__(self, fname, mode) def write(self, str): print "writing a string" file.write(self, str) def writelines(self, lines): print "writing lines"

Re: QuoteSQL

2006-09-26 Thread Sybren Stuvel
Fredrik Lundh enlightened us with: > and now we're waiting for the "['%s']*len(t)" vs. "'%s' for i in t" > benchmarks (and the "consistency is more important than efficiency" > and "creating extra objects is conceptually wrong" followups, and > the "it depends on what you mean by" followups to the

Re: Ordered dicts

2006-09-26 Thread Duncan Booth
[EMAIL PROTECTED] wrote: >> Then if you reinsert the deleted value it goes back in at its >> original order. > > Uhm, this doesn't sound good. Thank you, I missed this detail :-) > Then the doubly-linked list, and the links fixing seem necessary... > An alternative to a doubly linked list might

Re: Remap Mysql tuple to dictionary

2006-09-26 Thread Simon Brunning
On 9/26/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Frank Millman wrote: > > > I am reminded of a spoof Latin motto from the days of my youth - > > > >NIL ILLEGITIMO CARBORUNDUM > > isn't that usually written > > Illegitimi non carborundum According to the Wikipedia, neither is actually

Re: A critique of cgi.escape

2006-09-26 Thread Jon Ribbens
In article <[EMAIL PROTECTED]>, Fredrik Lundh wrote: >> What do XML Information Sets have to do with escaping control >> characters in HTML? > > figure out the connection, and you'll have the answer to your "substantial > point". If you don't know the answer, you can say so y'know. There's no sha

Re: A critique of cgi.escape

2006-09-26 Thread Fredrik Lundh
Jon Ribbens wrote: > It's a pity he's being rude when presented with well-informed comment > then. since when is the output of import random, sys messages = [ "that's irrelevant", "then their code is broken already", "that's not good enough", "then their t

Re: QuoteSQL

2006-09-26 Thread Steve Holden
Lawrence D'Oliveiro wrote: > In message <[EMAIL PROTECTED]>, Duncan Booth wrote: > > >>However, your QuoteSQL messes up every time because it wraps double >>quotes round the whole string, so it isn't suitable for use with >>parameterised queries at all. If you care to modify it to work in that >>

Re: A critique of cgi.escape

2006-09-26 Thread Jon Ribbens
In article <[EMAIL PROTECTED]>, Fredrik Lundh wrote: >> This has nothing to do with character encodings. > > it has *everything* to do with encoding of existing data into HTML > so it can be safely transported to, and recreated by, an HTML-aware > client. I can't tell if you're disagreeing or not

Re: does anybody earn a living programming in python?

2006-09-26 Thread George Sakkis
Paul Boddie wrote: > One example I read recently [1] described how the marketplace > in Oslo, Norway is currently short of 300-500 Java developers, but if > you look beneath the surface, knowing that there are lots of Java > developers out there looking for work, a gulf between the story and the >

Re: A critique of cgi.escape

2006-09-26 Thread Fredrik Lundh
Georg Brandl wrote: > It says "to HTML-safe sequences". That's reasonably clear without the need > to reproduce the exact replacements for each character. the same documentation tells people what function to use if they want to quote *every- thing* that might need to be quoted, so if people did

Re: Remap Mysql tuple to dictionary

2006-09-26 Thread Frank Millman
Steve Holden wrote: > > Can you please stop this incessant carping? c.l.py used to be a fun > place to hang out. > Hey, Steve, don't let it get to you. It's still 98% fun. I am reminded of a spoof Latin motto from the days of my youth - NIL ILLEGITIMO CARBORUNDUM Translation available on r

Re: QuoteSQL

2006-09-26 Thread Sybren Stuvel
Tim Chase enlightened us with: > >>> cur.execute("select * from people where last_name in (%s)" % > ','.join('%s' for i in xrange(len(t))), > t) But since the value of 'i' isn't used at all, it can be abbreviated to: >>> cur.execute("select * from people where last_name in (%s)" %

Re: A critique of cgi.escape

2006-09-26 Thread Steve Holden
Lawrence D'Oliveiro wrote: > In message <[EMAIL PROTECTED]>, Georg Brandl wrote: > > >>Lawrence D'Oliveiro wrote: >> >>>In message <[EMAIL PROTECTED]>, Georg Brandl wrote: >>> >>> Lawrence D'Oliveiro wrote: >In message <[EMAIL PROTECTED]>, Max M >wrote: > > >>Lawrence

Re: A critique of cgi.escape

2006-09-26 Thread Jon Ribbens
In article <[EMAIL PROTECTED]>, Fredrik Lundh wrote: >>> the same documentation tells people what function to use if they >>> want to quote *every-thing* that might need to be quoted, so if >>> people did actually understand everything that was written in a >>> reasonably clear way, this thread wou

Finding the file referred to in a Python traceback

2006-09-26 Thread metaperl . etc
In this traceback, the path to 3 different SQL Alchemy source files is a relative directory. However, no such directory is below my current working directory. This is problematic for two reasons: 1 - I cannot use XEmacs find-file-at-point to find the file in which the error is occurring 2 - I am n

Re: A critique of cgi.escape

2006-09-26 Thread Fredrik Lundh
Jon Ribbens wrote: > This has nothing to do with character encodings. it has *everything* to do with encoding of existing data into HTML so it can be safely transported to, and recreated by, an HTML-aware client. does the word "information set" mean anything to you? -- http://mail.python.

Re: QuoteSQL

2006-09-26 Thread Tim Chase
> "Need" is a strong word unless something like the > following doesn't work for some reason: > > cur.execute("select * from people where last_name in > (%s,%s,%s)", (name1, name2, name3) ) Which could be nicely generalized to something like >>> t = (name1, name2, name3) >>> cur.execute("s

Re: threading, subprocesses and wait

2006-09-26 Thread Gal Diskin
Jean-Paul Calderone wrote: > On 26 Sep 2006 06:29:17 -0700, Gal Diskin <[EMAIL PROTECTED]> wrote: > >Hi all, > >I'm writing a python program using threads to open several subprocesses > >concurrently (using module subprocess) and wait on them. I was > >wondering if there is a possibilty that a thr

Re: A critique of cgi.escape

2006-09-26 Thread Jon Ribbens
In article <[EMAIL PROTECTED]>, Fredrik Lundh wrote: > Jon Ribbens wrote: > >>> does the word "information set" mean anything to you? >> >> You would appear to be talking about either game theory, or XML, >> neither of which have anything to do with HTML. I notice that yet again you've snipped th

Re: threading, subprocesses and wait

2006-09-26 Thread Jean-Paul Calderone
On 26 Sep 2006 06:29:17 -0700, Gal Diskin <[EMAIL PROTECTED]> wrote: >Hi all, >I'm writing a python program using threads to open several subprocesses >concurrently (using module subprocess) and wait on them. I was >wondering if there is a possibilty that a thread will return from wait >even though

Re: does anybody earn a living programming in python?

2006-09-26 Thread Paul Boddie
Fredrik Lundh wrote: > > well, I think I prefer the "are you sure you exist?" trolls over the "python > sucks > and you are all a bunch of clueless something something" and "this thing is > broken > beyond repair and you are all a bunch of clueless something something" trolls. I can see where th

Re: Python extensions on Win32

2006-09-26 Thread Steve Holden
Martin v. Löwis wrote: > Cliff Wells schrieb: [...] >>4) How much alcohol will be required to forget all this when I'm done? > > > You shouldn't forget it. Instead, you should write your experience > into "the Web", so that others have a flatter learning curve. > After which worthy effort I'll b

Copyright lawyer advises "be careful" using Python?

2006-09-26 Thread johnzenger
I was scanning the 9/13/2006 issue of the "Electronic Commerce & Law Report," which is a newsletter for lawyers published by BNA. They have an article headlined "Game Developers Making Tomorrow's Hits Face Host of Copyright Issues Along the Way," and the article is mostly a writeup of a speech giv

Re: String Pattern Matching: regex and Python regex documentation

2006-09-26 Thread Ilias Lazaridis
Steve Holden wrote: > Xah Lee wrote: ... > > This project was undertaken as a response to a challenge put forth to > > me with a $100 reward, on 2005-04-12 on comp.lang.python newsgroup. I > > never received the due reward. > > > Your reading skills must be terrible. You never received the reward >

Re: A critique of cgi.escape

2006-09-26 Thread Paul Rubin
Brian Quinlan <[EMAIL PROTECTED]> writes: > o cgi.escape is not meant for serious web application development, What is it meant for then? Why should the library ever implement anything in a half-assed way unsuitable for serious application development, if it can supply a robust implementation ins

Re: A critique of cgi.escape

2006-09-26 Thread Jon Ribbens
In article <[EMAIL PROTECTED]>, Fredrik Lundh wrote: >> It's a pity he's being rude when presented with well-informed comment >> then. > > since when is the output of > [snip code] > > well-informed? heck, it doesn't even pass the turing test ;-) Since when did that bear any resemblance to wha

threading, subprocesses and wait

2006-09-26 Thread Gal Diskin
Hi all, I'm writing a python program using threads to open several subprocesses concurrently (using module subprocess) and wait on them. I was wondering if there is a possibilty that a thread will return from wait even though the subprocess that finished was created by another thread thats also wai

Re: A critique of cgi.escape

2006-09-26 Thread Georg Brandl
Lawrence D'Oliveiro wrote: > In message <[EMAIL PROTECTED]>, Georg Brandl wrote: > >> Lawrence D'Oliveiro wrote: >>> In message <[EMAIL PROTECTED]>, Georg Brandl wrote: >>> Lawrence D'Oliveiro wrote: > In message <[EMAIL PROTECTED]>, Max M > wrote: > >> Lawrence is right tha

Re: does anybody earn a living programming in python?

2006-09-26 Thread Christian
I said: > > Previously I used Python while earning a living working in IT at a > > college. Currently it is putting food on the table via contract jobs. > > I imagine there are "many" out there like me, doing just that. faulkner wrote: > where do you find these "contract jobs", if you don't mind

Re: QuoteSQL

2006-09-26 Thread Steve Holden
Lawrence D'Oliveiro wrote: > In message <[EMAIL PROTECTED]>, Steve > Holden wrote: > > >>Lawrence D'Oliveiro wrote: >> >>>In message <[EMAIL PROTECTED]>, Steve >>>Holden wrote: >>> >>> >>> When you use the DB API correctly and paramterise your queries you still need to quote wildcards in

Re: does anybody earn a living programming in python?

2006-09-26 Thread Mike C. Fletcher
walterbyrd wrote: > If so, I doubt there are many. > > I wonder why that is? > I've now used Python in every job I've had for the last 10 years. Started off with web-sites for a few months, then writing VRML-processing libraries to piece together and massage virtual worlds (not a *lot* of j

Re: QuoteSQL

2006-09-26 Thread Fredrik Lundh
Sybren Stuvel wrote: > >>> cur.execute("select * from people where last_name in (%s)" % > >>> ','.join('%s' for i in t), t) and now we're waiting for the "['%s']*len(t)" vs. "'%s' for i in t" benchmarks (and the "consistency is more important than efficiency" and "creating extra objects is con

Re: Surprise using the 'is' operator

2006-09-26 Thread John Roth
Antoon Pardon wrote: > > I find this a bit oddly worded. Now the "may always reuse" phrase > suggests this is not an obligation and I can certainly understand > that in the case of integers. But when you enumerate examples you > include None and Booleans, creating the suggestion these don't > have

Re: QuoteSQL

2006-09-26 Thread Steve Holden
Lawrence D'Oliveiro wrote: > In message <[EMAIL PROTECTED]>, Duncan Booth wrote: > > >>However, your QuoteSQL messes up every time because it wraps double >>quotes round the whole string, so it isn't suitable for use with >>parameterised queries at all. If you care to modify it to work in that >>

Re: odbc DbiDate date conversion

2006-09-26 Thread flupke
Frank Millman schreef: > flupke wrote: >> I'm using a solid DB and i'm accessing it via the odbc module >> (activepython). >> I get a DbiDate object returned but i don't find a way to decently print >> it or get a format like %d/%m%/%y. >> > > I convert it to a datetime() instance, like this - >

Re: A critique of cgi.escape

2006-09-26 Thread Fredrik Lundh
Lawrence D'Oliveiro wrote: >> (cgi.escape(s, True) is slower than cgi.escape(s), for reasons that are >> obvious for anyone who's looked at the code). > > What you're doing is adding to the reasons why the existing cgi.escape > function is stupidly designed and implemented. The True case is by far

Re: does anybody earn a living programming in python?

2006-09-26 Thread gslindstrom
walterbyrd wrote: > If so, I doubt there are many. I program full-time in Python writing systems to automate the processing of health care claims. Lots of database usage, lots of objects, lots of fun to write it in python (I used to code C/C++ and Perl). > I wonder why that is? Me, too. Are you

Re: ultra newbie question (don't laugh)

2006-09-26 Thread John Salerno
George Sakkis wrote: > To start with your last question, yes, they probably would, *IF* all > you need to do is take data from the user (through a GUI, command line, > etc.) and store them in some persistent state (text file, pickle, db, > etc.). In practice, chances are you'll need to do somethin

Re: A critique of cgi.escape

2006-09-26 Thread Christophe
Sion Arrowsmith a écrit : > Jon Ribbens <[EMAIL PROTECTED]> wrote: >> In article <[EMAIL PROTECTED]>, Duncan Booth wrote: >>> I guess you've never seen anyone write tests which retrieve some generated >>> html and compare it against the expected value. If the page contains any >>> unescaped quot

Re: Remap Mysql tuple to dictionary

2006-09-26 Thread Fredrik Lundh
Frank Millman wrote: > I am reminded of a spoof Latin motto from the days of my youth - > >NIL ILLEGITIMO CARBORUNDUM isn't that usually written Illegitimi non carborundum ? or is that just due to differences between british latin and american latin ? -- http://mail.python.org/m

Re: does anybody earn a living programming in python?

2006-09-26 Thread Fredrik Lundh
Anthony Baxter wrote: > This seems to be a very, very silly original post. I know of plenty of > people who make a living programming Python. It's been the vast > majority of the programming (for money) I've done in the last ten > years, and there's countless other people I know here in Melbourne

Re: Copyright lawyer advises "be careful" using Python?

2006-09-26 Thread Duncan Booth
[EMAIL PROTECTED] wrote: > Is the PSF that much different from any other open source license? Only in not having a copyleft and therefore being potentially usable by companies wishing to develop closed software. Generally such companies wouldn't even consider using GPL'd software so they don't

Re: A critique of cgi.escape

2006-09-26 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Georg Brandl wrote: > Lawrence D'Oliveiro wrote: >> In message <[EMAIL PROTECTED]>, Georg Brandl wrote: >> >>> Lawrence D'Oliveiro wrote: In message <[EMAIL PROTECTED]>, Max M wrote: > Lawrence is right that the escape method doesn't work the wa

Re: concat next line with previous

2006-09-26 Thread Tim Williams
On 26 Sep 2006 03:16:25 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > hi > what is the python way to concat 2 lines eg > > line 1 with some text > line 2 with some text > > i want to bring line 2 up , such that i get one whole string. > > line 1 with some text line 2 with some text > als

Re: QuoteSQL

2006-09-26 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Sybren Stuvel wrote: > Lawrence D'Oliveiro enlightened us with: >> You're proposing two separate functions: >> >> 1) quoting of non-wildcard specials >> 2) quoting of wildcard specials > > I'm suggesting functions based on the role of the string they need t

Ordered dicts

2006-09-26 Thread bearophileHUGS
I have found that in certain situations ordered dicts are useful. I use an Odict class written in Python by ROwen that I have improved and updated some for personal use. So I'm thinking about a possible C version of Odict (maybe fit for the collections module). On a 32 bit Win Python 2.5 requires

Re: ultra newbie question (don't laugh)

2006-09-26 Thread Gal Diskin
John Salerno wrote: > Ok, I've decided to make a little project for myself which involves > storing employee information in an XML file. I'm doing this partly to > experiment with working with XML. The blocks in the file will look > something like this: > > >John >Salerno >United State

Re: Ordered dicts

2006-09-26 Thread bearophileHUGS
Thank to Neil Cerutti and Duncan Booth for the answers. I have not tried that C AVL implementation yet. Duncan Booth: > but for your ordered dictionary if you did that you would have > to fix up the linked list. To fix the list in constant time you probably need a doubly-linked list, this requir

Re: QuoteSQL

2006-09-26 Thread Carsten Haese
On Tue, 2006-09-26 at 07:08, Lawrence D'Oliveiro wrote: > So yes, there should be two separate functions, one for escaping > non-wildcard specials, and one for escaping wildcards. > > > You only need the first one, since every database interface that > > follows PEP 249. > > You still need the se

ultra newbie question (don't laugh)

2006-09-26 Thread John Salerno
Ok, I've decided to make a little project for myself which involves storing employee information in an XML file. I'm doing this partly to experiment with working with XML. The blocks in the file will look something like this: John Salerno United States Texas Houston #etc.

Re: QuoteSQL

2006-09-26 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Duncan Booth wrote: > However, your QuoteSQL messes up every time because it wraps double > quotes round the whole string, so it isn't suitable for use with > parameterised queries at all. If you care to modify it to work in that > situation I think you'll find that

Re: Remap Mysql tuple to dictionary

2006-09-26 Thread Steve Holden
Lawrence D'Oliveiro wrote: > In message <[EMAIL PROTECTED]>, Fredrik > Lundh wrote: > > >>Lawrence D'Oliveiro wrote: >> >> > SQL databases like MySQL are _designed_ for efficiency. >> >>unlike the Python data types, you mean ? > > > Did I say it was unlike anything? Can you please stop this in

Re: odbc DbiDate date conversion

2006-09-26 Thread Frank Millman
flupke wrote: > I'm using a solid DB and i'm accessing it via the odbc module > (activepython). > I get a DbiDate object returned but i don't find a way to decently print > it or get a format like %d/%m%/%y. > I convert it to a datetime() instance, like this - mydate = datetime.datetime.from

Re: Surprise using the 'is' operator

2006-09-26 Thread Antoon Pardon
On 2006-09-26, John Roth <[EMAIL PROTECTED]> wrote: > > Antoon Pardon wrote: >> >> I find this a bit oddly worded. Now the "may always reuse" phrase >> suggests this is not an obligation and I can certainly understand >> that in the case of integers. But when you enumerate examples you >> include N

Re: does anybody earn a living programming in python?

2006-09-26 Thread Anthony Baxter
This seems to be a very, very silly original post. I know of plenty of people who make a living programming Python. It's been the vast majority of the programming (for money) I've done in the last ten years, and there's countless other people I know here in Melbourne in the same position. -- http:

Re: ultra newbie question (don't laugh)

2006-09-26 Thread Fredrik Lundh
John Salerno wrote: > So you see, what I'm asking for is very basic help, sort of along the > lines of "what things do I need to consider before I even begin this?" > Is OOP necessary here? Would utility functions work just as well for > simply writing the information to a file? when you get p

Re: A critique of cgi.escape

2006-09-26 Thread Fredrik Lundh
Jon Ribbens wrote: >> the same documentation tells people what function to use if they >> want to quote *every-thing* that might need to be quoted, so if >> people did actually understand everything that was written in a >> reasonably clear way, this thread wouldn't even exist. > > The fact that y

Re: does anybody earn a living programming in python?

2006-09-26 Thread Sybren Stuvel
walterbyrd enlightened us with: > If so, I doubt there are many. > > I wonder why that is? www.uwklantprofiel.nl and www.uwpensioenanalyse.nl, both systems are written in Python, although the website of the former is still in PHP. It'll be Python soon, too. I've created both systems. Sybren --

Re: A critique of cgi.escape

2006-09-26 Thread Jon Ribbens
In article <[EMAIL PROTECTED]>, Steve Holden wrote: >> Why do you say that? I have confined myself to simple logical >> arguments, and been frankly very restrained when presented with >> rudeness and misunderstanding from other thread participants. >> In what way should I have modified my postings?

Re: Surprise using the 'is' operator

2006-09-26 Thread Ben Finney
"codefire" <[EMAIL PROTECTED]> writes: > I was just trying to check if objects were the same (object), didn't > know Integers were a special case. They're not. The Python runtime environment can do whatever it likes underneath the hood; the language gives no promises about any relationship betwee

Re: A critique of cgi.escape

2006-09-26 Thread Fredrik Lundh
Jon Ribbens wrote: >> does the word "information set" mean anything to you? > > You would appear to be talking about either game theory, or XML, > neither of which have anything to do with HTML. you see no connection between XML's concept of information set and HTML? (hint: what's XHTML?)

odbc DbiDate date conversion

2006-09-26 Thread flupke
I'm using a solid DB and i'm accessing it via the odbc module (activepython). I get a DbiDate object returned but i don't find a way to decently print it or get a format like %d/%m%/%y. I found a few posts but the code doesn't work. >>> birthd = results[0][4] #info from db >>> birthd >>> str(birt

Re: R.S.I. solutions?

2006-09-26 Thread Nick Craig-Wood
Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > Paddy schrieb: > > All this keyboarding has finally caught up with me and I'm getting > > aches in my fingers. > But I can share some other advice: go to a physiotherapist and let him > show you some exercises for the back. My problems (both lower a

Re: where are isinstance types documented?

2006-09-26 Thread codefire
OK Simon, thanks for that link, I think I can ferret out the common types from there. Tony -- http://mail.python.org/mailman/listinfo/python-list

Re: where are isinstance types documented?

2006-09-26 Thread Fredrik Lundh
codefire wrote: > I'm using the isinstance built-in function. I've found the docs for it, > but there are no docs on the supported types. *all* types and classes can be used. > For example isinstance(a, int) works fine but isinstance(s, string) > doesn't - because 'string is not known'. > > I d

Re: A critique of cgi.escape

2006-09-26 Thread Jim
Jon Ribbens wrote: > You're right - I've never seen anyone do such a thing. It sounds like > a highly dubious and very fragile sort of test to me, of very limited > use. I have code that checks to see if my CGI scripts generate the pages that I expect. That code would break. (Whether I should n

Re: Surprise using the 'is' operator

2006-09-26 Thread codefire
Thanks for that Fredrik, that's clear. That's actually a pretty nice feature as it's nicely optimised. >>> a = 10 >>> c = 10 >>> a is c True >>> c = c +1 >>> a is c False >>> Cheers, Tony -- http://mail.python.org/mailman/listinfo/python-list

Re: Running Python script from C++ code(.NET)

2006-09-26 Thread volcano
volcano wrote: > Hello, folks! > A trivial question - I have a working Python script that I have to > invoke from C++ code. No fancy stuff - just run the whole script with > its parameters. No callbacks, no signalling - nada, just > stupid,primitive, straightforward call. > > And while there is a l

Re: A critique of cgi.escape

2006-09-26 Thread Jon Ribbens
In article <[EMAIL PROTECTED]>, Fredrik Lundh wrote: > the same documentation tells people what function to use if they > want to quote *every-thing* that might need to be quoted, so if > people did actually understand everything that was written in a > reasonably clear way, this thread wouldn't ev

Re: ruby %w equivalent

2006-09-26 Thread Antoine De Groote
Thorsten Kampe wrote: > * John Machin (24 Sep 2006 15:32:20 -0700) >> Antoine De Groote wrote: >>> is there a python equivalent for the ruby %w operator? >>> %w{a b c} creates an array with strings "a", "b", and "c" in ruby... >>> >> | >>> "a b c".split() >> | ['a', 'b', 'c'] >> >> ... appears to m

Re: Ordered dicts

2006-09-26 Thread Duncan Booth
[EMAIL PROTECTED] wrote: > Deleted keys from a dict/set aren't removed, they are tagged as > deleted. > My experience of CPython sources is tiny, I have just read few parts, > so a person much more expert than me can comment the following lines. > > During the printing of the set/dict I think suc

Re: QuoteSQL

2006-09-26 Thread Sybren Stuvel
Lawrence D'Oliveiro enlightened us with: > Because quoting the wildcards introduces backslash specials before > each wildcard. Quoting non-wildcards then causes those backslashes > to be doubled, which means they escape themselves instead of the > wildcards. I don't know about other DBMSes, but in

Re: Remap Mysql tuple to dictionary

2006-09-26 Thread Diez B. Roggisch
> > SQL databases like MySQL are _designed_ for efficiency. Efficiency with respect to what? That statement is plain wrong. They are designed for a pretty general case of data storage efficiency, in the domain of relational algebra. And for a lot of use-cases, they offer a good ratio of ease-of-u

Re: Ordered dicts

2006-09-26 Thread Neil Cerutti
On 2006-09-26, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I have found that in certain situations ordered dicts are > useful. I use an Odict class written in Python by ROwen that I > have improved and updated some for personal use. > > So I'm thinking about a possible C version of Odict (maybe

Re: Printing a percent sign

2006-09-26 Thread Fredrik Lundh
John Machin wrote: > I'll take your word for it; it's been quite a while :-) *Something* in > the dim dark past worked like that makefiles? -- http://mail.python.org/mailman/listinfo/python-list

where are isinstance types documented?

2006-09-26 Thread codefire
Hi, I'm using the isinstance built-in function. I've found the docs for it, but there are no docs on the supported types. For example isinstance(a, int) works fine but isinstance(s, string) doesn't - because 'string is not known'. I do know how to import the types module and then use defined typ

Re: Surprise using the 'is' operator

2006-09-26 Thread codefire
Haha! OK thanks guys. I was just trying to check if objects were the same (object), didn't know Integers were a special case. Thanks, Tony -- http://mail.python.org/mailman/listinfo/python-list

Re: does anybody earn a living programming in python?

2006-09-26 Thread walterbyrd
Fredrik Lundh wrote: > someone just posted this > > > Site Perl Python > > Hotjobs 2756 655 > > Monster >1000 317 > > Dice 4828 803 > >From what I have seen, most of listings are not for python developers. Rather they list python as a "nice t

Re: Printing a percent sign

2006-09-26 Thread John Machin
Fredrik Lundh wrote: > John Machin wrote: > > > I'll take your word for it; it's been quite a while :-) *Something* in > > the dim dark past worked like that > > makefiles? Bingo! Actually, double bingo!! >From the docs for GNU Make: """ Because dollar signs are used to start make variable refer

Re: A critique of cgi.escape

2006-09-26 Thread Steve Holden
Jon Ribbens wrote: > In article <[EMAIL PROTECTED]>, Steve Holden wrote: > >>>I would have hoped that people don't treat that as a licence to be >>>obnoxious, though. I am aware of Fredrik's history, which is why I >>>was somewhat surprised and disappointed that he was being so rude >>>and unpleas

Re: Printing a percent sign

2006-09-26 Thread John Machin
Lawrence D'Oliveiro wrote: > In message <[EMAIL PROTECTED]>, John > Machin wrote: > > > Lawrence D'Oliveiro wrote: > >> In message <[EMAIL PROTECTED]>, John > >> Machin wrote: > >> > >> > 1. Reasoning: How do you get a literal "'" into an SQL string constant? > >> > How do you get a literal "\" in

Re: Surprise using the 'is' operator

2006-09-26 Thread Antoon Pardon
On 2006-09-26, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > codefire wrote: > >> I was just trying to check if objects were the same (object), didn't >> know Integers were a special case. > > they're not, really; "is" works the same way for all objects. > > when you ask for a new immutable object, a

Re: where are isinstance types documented?

2006-09-26 Thread Duncan Booth
Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Sequences: > str > unicode > tuple > list It is also worth mentioning that you can use "isinstance(a, basestring)" as a way to check for either string type although, of course, "isinstance(a, (str, unicode))" also works. So far as

Re: Printing a percent sign

2006-09-26 Thread Diez B. Roggisch
Lawrence D'Oliveiro wrote: > In message <[EMAIL PROTECTED]>, John > Machin wrote: > >> 1. Reasoning: How do you get a literal "'" into an SQL string constant? >> How do you get a literal "\" into a Python string constant? How do you >> get a literal "$" into some *x shell command lines? Do you de

[ANN] logilab-common 0.19.2

2006-09-26 Thread Sylvain Thénault
Hi there ! I'm pleased to announce the 0.19.2 release of Logilab common package. This release include some bug fixes and have tests passing from python 2.3 to python 2.5 :). You may be surprised by the version number since we have been missing public annoucements recently. To quote Alexandre, we

[ANN] pylint 0.12.1

2006-09-26 Thread Sylvain Thénault
Hi there ! I'm very pleased to announce the 0.12.1 release of PyLint. This release includes some bug fixes and have tests passing from python 2.3 to python 2.5 :). You may be surprised by the version number since we have been missing public annoucements recently, and the 0.12.0 version has not r

identifying new not inherited methods

2006-09-26 Thread malkarouri
Hi, I am writing a library in which I need to find the names of methods which are implemented in a class, rather than inherited from another class. To explain more, and to find if there is another way of doing it, here is what I want to do: I am defining two classes, say A and B, as: class A(obje

<    1   2   3   4   >