Re: where are isinstance types documented?

2006-09-26 Thread Simon Brunning
On 9/26/06, Simon Brunning <[EMAIL PROTECTED]> wrote: > On 26 Sep 2006 02:59:07 -0700, codefire <[EMAIL PROTECTED]> wrote: > > For example isinstance(a, int) works fine but isinstance(s, string) > > doesn't - because 'string is not known'. > > In this case, you want "str" rather than "string". A c

Re: Logfile analysing with pyparsing

2006-09-26 Thread Nick Vatamaniuc
You can parse it just once, you just have to setup your data structure (the structure of your XML schema) and fill it up as you parse. For example, you can represent you data structure as a dictionaries in Python: message={ MID : { ' timestamp' : TIMESTAMP,

Re: Surprise using the 'is' operator

2006-09-26 Thread Christophe
codefire a écrit : > Haha! > > OK thanks guys. > > I was just trying to check if objects were the same (object), didn't > know Integers were a special case. They are not a special case so much. It's just that "is" is extremly unreliable unless you're the one who created the objects. In the case

Re: Algorithm Question

2006-09-26 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Andrew McLean wrote: > I have the ability to query a database in a legacy system and extract > records which match a particular pattern. Specifically, I can perform > queries for records that contain a given search term as a sub-string of > a particular column. Wha

Re: QuoteSQL

2006-09-26 Thread Sybren Stuvel
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 to escape, not the characters in that string. 1) Quoting of

Re: where are isinstance types documented?

2006-09-26 Thread Fredrik Lundh
Fredrik Lundh wrote: > Sequences: > str > unicode footnote: to simplify, there's also a "basestring" base class that can be used to check for either str or unicode: isinstance(obj, basestring) is equivalent to isinstance(obj, (str, unicode)) -- http://mail.python.org/m

concat next line with previous

2006-09-26 Thread s99999999s2003
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 -- http://mail.python.org/mailman/listinfo/python-list

Re: SSL meta data

2006-09-26 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, BerndWill wrote: > The only solution from me and my colleagues view (as poor at it sounds) > is to setup a little python script "pinging" an amount of about 2.000 > servers in daily intervals checking for the validity of those SSL > certificates. There's no need t

Re: concat next line with previous

2006-09-26 Thread Simon Brunning
On 26 Sep 2006 03:16:25 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > 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 line1 = "l

Re: where are isinstance types documented?

2006-09-26 Thread Sybren Stuvel
codefire enlightened us with: > 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/classes are supported. > For example isinstance(a, int) works fine but isinstance(s, string) > doesn't - because 'string is not known'.

Re: ruby %w equivalent

2006-09-26 Thread Antoine De Groote
Antoine De Groote wrote: > 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'

Re: Makin search on the other site and getting data and writing in xml

2006-09-26 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > GOOGLE IS NOT OUR SUBJECT ANY MORE. > > MY GOAL IS NOT MAKING SEARCH ON GOOGLE: > MY GOAL IS MAKING A SEARCH ON > www.onelook.com, for example this is usenet; you don't "own" the threads you start. if there's a subthread that you don't find relevant to your original

Re: I need some help with a regexp please

2006-09-26 Thread Fredrik Lundh
Frederic Rentsch wrote: > If I may add another thought along the same line: regular expressions > seem to tend towards an art form, or an intellectual game. Many > discussions revolving around regular expressions convey the impression > that the challenge being pursued is finding a magic formul

Re: Makin search on the other site and getting data and writing in xml

2006-09-26 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > GOOGLE IS NOT OUR SUBJECT ANY MORE. > > MY GOAL IS NOT MAKING SEARCH ON GOOGLE: > MY GOAL IS MAKING A SEARCH ON > www.onelook.com, for example """ Can you send me the list of words in the index? May I extract it from your site? No, sorry. If you're thinking about wri

Re: where are isinstance types documented?

2006-09-26 Thread Simon Brunning
On 26 Sep 2006 02:59:07 -0700, codefire <[EMAIL PROTECTED]> 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. > > For example isinstance(a, int) works fine but isinstance(s, string) > doesn't - because 'string is not kno

Re: A critique of cgi.escape

2006-09-26 Thread Sion Arrowsmith
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 quotes then this change would break i

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]>, Max M wrote: >>> Lawrence is right that the escape method doesn't work the way he expects it to. Rewriting a library module sim

Re: Surprise using the 'is' operator

2006-09-26 Thread Fredrik Lundh
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 Python implementation may always reuse an existing object, if it w

Re: does anybody earn a living programming in python?

2006-09-26 Thread Gerald Klix
AOL^H^H^H, me too. And it's paid better than C++ programming. HTH, Gerald Gabriel Genellina schrieb: > At Monday 25/9/2006 20:09, walterbyrd wrote: > > I do. > >> If so, I doubt there are many. > > > That's why they get well paid :) > (uhm, not really... :( ) > > > > Gabriel Genellina > So

Re: Python CTypes translation of (pv != NULL)

2006-09-26 Thread Thomas Heller
[EMAIL PROTECTED] schrieb: > Q: The C idea of (pv != NULL) is said most directly in Python ctypes > how? > > A: We are of course supposed to write something like: > > def c_not_null(pv): > return (ctypes.cast(pv, ctypes.c_void_p).value != None) > > Yes? > > Working from

Re: newbe's re question

2006-09-26 Thread Frederic Rentsch
[EMAIL PROTECTED] wrote: > Frederic Rentsch wrote: > >> [EMAIL PROTECTED] wrote: >> >>> These are csound files. Csound recently added python as a scripting >>> language and is allowing also allowing csound calls from outside of >>> csound. The nice thing about csound is that instead of wo

Re: QuoteSQL

2006-09-26 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Sybren Stuvel wrote: > Lawrence D'Oliveiro enlightened us with: >> The trouble with this is that, instead of offering extra functionality, >> it leaves the door open to making two stupid mistakes: >> >> 2) quoting of wildcards BEFORE quoting of non-wildcards >

Re: does anybody earn a living programming in python?

2006-09-26 Thread Bruno Desthuilliers
walterbyrd wrote: > If so, I doubt there are many. We're at least two here... > I wonder why that is? > I wonder why you have such an a priori ? -- bruno desthuilliers python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for p in '[EMAIL PROTECTED]'.split('@')])" -- http://m

Re: does anybody earn a living programming in python?

2006-09-26 Thread Paul Boddie
George Sakkis wrote: > [Oslo, Norway short of 300-500 Java developers] > Um, how many of these "lots of Java developers looking for work" live > in, or are willing to relocate to, Oslo? Well, I really meant to say that the "lots of Java developers" I've seen actually are in Oslo. Certainly, ever

Re: Surprise using the 'is' operator

2006-09-26 Thread Christophe
codefire a écrit : > I thought the 'is' operator was used to identify identical objects, > whereas the '==' operator checked equality. Well, I got a surprise > here: > > IDLE 1.1.3 a = 10 b = a a is b > True a == b > True c = 10 a == c > True a is c > True > > I

Re: Surprise using the 'is' operator

2006-09-26 Thread Diez B. Roggisch
codefire wrote: > I thought the 'is' operator was used to identify identical objects, > whereas the '==' operator checked equality. Well, I got a surprise > here: > > IDLE 1.1.3 a = 10 b = a a is b > True a == b > True c = 10 a == c > True a is c > True >

Re: A critique of cgi.escape

2006-09-26 Thread Jon Ribbens
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 unpleasant in this thread. He i

Re: Printing a percent sign

2006-09-26 Thread John Machin
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

Re: Remap Mysql tuple to dictionary

2006-09-26 Thread Lawrence D'Oliveiro
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? -- http://mail.python.org/mailman/listinfo/python-list

Re: Verify an e-mail-adress - syntax and dns

2006-09-26 Thread Christophe
Steven D'Aprano a écrit : > On Mon, 25 Sep 2006 16:11:38 +0200, Christophe wrote: >> This is useless AND annoying at the same time. > > But people like us don't screw up our email address in the first place, > and if we do, we know how to fix it. Not everybody is like us. So you say that the bett

Re: Remap Mysql tuple to dictionary

2006-09-26 Thread Fredrik Lundh
Lawrence D'Oliveiro wrote: > SQL databases like MySQL are _designed_ for efficiency. unlike the Python data types, you mean ? -- http://mail.python.org/mailman/listinfo/python-list

Re: Printing a percent sign

2006-09-26 Thread Lawrence D'Oliveiro
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 "\" into a Python string constant? How do you >> >

Re: Remap Mysql tuple to dictionary

2006-09-26 Thread Simon Brunning
On 9/26/06, Lawrence D'Oliveiro <[EMAIL PROTECTED]> wrote: > All right, sorry, looks like they want to load the entire table into RAM and > key it off the first field. Kind of defeats the point of having SQL, but > there you go... Keeping an in-memory cache of small, unchanging, frequently-read ta

Re: where are isinstance types documented?

2006-09-26 Thread John Machin
codefire wrote: > 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. It supports *all* types. > > For example isinstance(a, int) works fine but isinstance(s, string) > doesn't - because 'string is not known'. That's bec

Re: concat next line with previous

2006-09-26 Thread Sybren Stuvel
[EMAIL PROTECTED] enlightened us with: > hi > what is the python way to concat 2 lines eg concated = line1 + line2 Sybren -- Sybren Stüvel Stüvel IT - http://www.stuvel.eu/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Talking to marketing people about Python

2006-09-26 Thread codefire
Dennis Lee Bieber wrote: > Unfortunately, if management goes further down the page, they find > Ruby and "D" (when did that get out) both rated so many up arrows they > had to use shorthand notation to represent 14 arrows... Yes, there is no doubt Ruby is gaining traction - mostly due to t

Re: I need some help with a regexp please

2006-09-26 Thread codefire
> for dense guys like myself, regular expressions work best if you use > them as simple tokenizers, and they suck pretty badly if you're trying > to use them as parsers. :) Well, I'm with you on that one Fredrik! :) -- http://mail.python.org/mailman/listinfo/python-list

Re: A critique of cgi.escape

2006-09-26 Thread Max M
Lawrence D'Oliveiro skrev: > In message <[EMAIL PROTECTED]>, Gabriel G > wrote: > >> At Monday 25/9/2006 11:08, Jon Ribbens wrote: >> > What precisely do you think it would "break"? existing code, and existing tests. >>> I'm sorry, that's not good enough. How, precisely, would it break >>

Re: I need some help with a regexp please

2006-09-26 Thread codefire
> I still don't touch regular expressions... They may be fast, but to > me they are just as much line noise as PERL... I can usually code a > partial "parser" faster than try to figure out an RE. Yes, it seems to me that REs are a bit "hit and miss" - the only way to tell if you've got a RE "righ

Re: QuoteSQL

2006-09-26 Thread Duncan Booth
Lawrence D'Oliveiro <[EMAIL PROTECTED]> wrote: > In message <[EMAIL PROTECTED]>, Duncan Booth wrote: > >> The spurious escaping of the apostrophe does no harm, but spuriously >> escaping a newline makes the select match the letter 'n' insteal of >> matching a newline. > > And how would you get m

Re: does anybody earn a living programming in python?

2006-09-26 Thread MaR
walterbyrd wrote: > If so, I doubt there are many. My share of the waterfall :o) I do earn my (preposterously nice *wink*) salary from doing *all* major efforts, at the company I work for, in Python. Not only that, since I started out here some 5 years ago, nearly all software development of

Re: QuoteSQL

2006-09-26 Thread Sybren Stuvel
Lawrence D'Oliveiro enlightened us with: > The trouble with this is that, instead of offering extra functionality, it > leaves the door open to making two stupid mistakes: > > 2) quoting of wildcards BEFORE quoting of non-wildcards Why is this a "stupid" mistake in your view? Please explain th

Re: Printing a percent sign

2006-09-26 Thread Lawrence D'Oliveiro
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 detect a > pattern? None of which appl

Re: Verify an e-mail-adress - syntax and dns

2006-09-26 Thread Diez B. Roggisch
> Besides, what is so special with electronic forms that we have to go > through all kind of tricks to make sure the user doesn't make mistakes > when regular paper forms just assume the user will be careful when he > fills it? Must be some kind of IQ draining field emited by all the > computers wh

Re: QuoteSQL

2006-09-26 Thread Fredrik Lundh
Sybren Stuvel wrote: > I'm suggesting functions based on the role of the string they need to > escape, not the characters in that string. > > 1) Quoting of wildcard strings for a query using LIKE etc. > 2) Quoting of values for putting into queries. it's actually quite amusing that some

Re: I need some help with a regexp please

2006-09-26 Thread Frederic Rentsch
Dennis Lee Bieber wrote: > On 25 Sep 2006 10:25:01 -0700, "codefire" <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > >> Yes, I didn't make it clear in my original post - the purpose of the >> code was to learn something about regexps (I only started coding Python >> last w

[ANN] logilab-astng 0.16.1

2006-09-26 Thread Sylvain Thénault
Hi there ! I'm pleased to announce the 0.16.1 release of Logilab astng package. This release include some major bug fixes (pylint crashs, 2.5 compatibility) and have tests passing from python 2.3 to python 2.5 :). You're higly encouraged to upgrade if you're currently using the 0.16.0 release. W

Re: A critique of cgi.escape

2006-09-26 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Dan Bishop wrote: > Lawrence D'Oliveiro wrote: >> In message <[EMAIL PROTECTED]>, Fredrik >> Lundh wrote: >> >> > Max M wrote: >> > >> >> It also makes the escaped html harder to read for standard cases. >> > >> > and slows things down a bit. >> > >> > (cgi.escape(

Re: Makin search on the other site and getting data and writing in xml

2006-09-26 Thread altemurbugra
GOOGLE IS NOT OUR SUBJECT ANY MORE. MY GOAL IS NOT MAKING SEARCH ON GOOGLE: MY GOAL IS MAKING A SEARCH ON www.onelook.com, for example -- http://mail.python.org/mailman/listinfo/python-list

Re: Remap Mysql tuple to dictionary

2006-09-26 Thread Fredrik Lundh
Lawrence D'Oliveiro wrote: > What other kind of mapping could you produce? and here we go again. how about reading the code the OP posted, or the first few followups? -- http://mail.python.org/mailman/listinfo/python-list

Surprise using the 'is' operator

2006-09-26 Thread codefire
I thought the 'is' operator was used to identify identical objects, whereas the '==' operator checked equality. Well, I got a surprise here: IDLE 1.1.3 >>> a = 10 >>> b = a >>> a is b True >>> a == b True >>> c = 10 >>> a == c True >>> a is c True >>> I was NOT expecting the last statement to ret

Re: Remap Mysql tuple to dictionary

2006-09-26 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Fredrik Lundh wrote: > Lawrence D'Oliveiro wrote: > > > Kind of defeats the point of having SQL, but there you go... > > there are plenty of reasons to use Python data structures instead of the > SQL engine for data crunching. especially if you care about effici

Re: Extend file type

2006-09-26 Thread Sybren Stuvel
abcd enlightened us with: > Any suggestions on how to find out? I did try adding to MyFile > > def __call__(self, *args): > print "calling:", args > return file.__call__(self, *args) > > but I never see that either. I don't know the answer to your problem, but I can explain why this d

Re: Query regarding grep!!

2006-09-26 Thread Nick Vatamaniuc
Of course you can always use grep as an external process (if the OS has it). For example: --- In [1]: import subprocess In [2]: out=subprocess.Popen( 'grep -i blah ./tmp/*', stdout=subprocess.PIPE, shell=True ).communicate()[0] In [

Re: QuoteSQL

2006-09-26 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Duncan Booth wrote: > The spurious escaping of the apostrophe does no harm, but spuriously > escaping a newline makes the select match the letter 'n' insteal of > matching a newline. And how would you get my QuoteSQL routine, as written, to make the same mistake yo

Re: IDLE - Customizing output format

2006-09-26 Thread James Stroud
Ilias Lazaridis wrote: > Ilias Lazaridis wrote: >> IDLE has an output format like this: >> >> >>> object >> >> >>> type >> >> >>> object.__class__ >> >> >>> object.__bases__ >> >> How can I customize it to become like that: >> >> >>> object >> >> >>> type >> >> >>> object.__cl

Re: does anybody earn a living programming in python?

2006-09-26 Thread Gabriel Genellina
At Monday 25/9/2006 20:09, walterbyrd wrote: I do. If so, I doubt there are many. That's why they get well paid :) (uhm, not really... :( ) Gabriel Genellina Softlab SRL __ Preguntá. Respondé. Descubrí.

Re: SimpleXMLRPCServer and socket

2006-09-26 Thread Juju
Hi, 2006/9/25, Fredrik Lundh <[EMAIL PROTECTED]>: > I don't have time to dig deeper into this right now, but this post might > be helpful: > > http://article.gmane.org/gmane.comp.python.general/471411 I tried to override the "verify_request" method, it managed to get the ClientAddress, but in

Re: SimpleXMLRPCServer and socket

2006-09-26 Thread Fredrik Lundh
Juju wrote: > But I still have a little question : > > How can I do to know which method I should override to make the things work ? > > Usually, I look at "python.org" but in this case, I couldn't find what > I was looking for. Finally, I had to look at the source files to under- > stand what

Re: QOTW (was Re: does anybody earn a living programming in python?)

2006-09-26 Thread Sybren Stuvel
Aahz enlightened us with: > Fredrik Lundh <[EMAIL PROTECTED]> wrote: >> >>well, if you're only watching mtv, it's easy to think that there's >>obviously not much demand for country singers, blues musicians, >>British hard rock bands, or melodic death metal acts. > > Any other votes for this being

Re: How to run in background?

2006-09-26 Thread Gabriel Genellina
At Monday 25/9/2006 09:02, billie wrote: Hi all. I know that it's possible to automatically run a Python program in background by giving it the "pyw" extension. This is useful when I release a source ditribution of my program. How could it be possible to do the same thing with an .exe file compi

Re: Remap Mysql tuple to dictionary

2006-09-26 Thread Fredrik Lundh
Lawrence D'Oliveiro wrote: > Kind of defeats the point of having SQL, but there you go... there are plenty of reasons to use Python data structures instead of the SQL engine for data crunching. especially if you care about efficiency. -- http://mail.python.org/mailman/listinfo/python-list

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]>, Max M wrote: >> >>> Lawrence is right that the escape method doesn't work the way he expects >>> it to. >>> >>> Rewriting a library module simply because a developer is surprised i

Re: A critique of cgi.escape

2006-09-26 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Gabriel G wrote: > At Monday 25/9/2006 11:08, Jon Ribbens wrote: > >> >> What precisely do you think it would "break"? >> > >> > existing code, and existing tests. >> >>I'm sorry, that's not good enough. How, precisely, would it break >>"existing code"? Can you com

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]>, Fredrik >> Lundh wrote: >> >>> Lawrence D'Oliveiro wrote: >>> > Georg Brandl wrote: > >> A function is broken if its implementation doesn't match the >> documentati

Re: accepts decorator

2006-09-26 Thread urielka
hehe i saw that,that is what made my understand it. the decorator now works. let say i have a function decorated with two decorators: @Accept(int,int) @OtherDecorator def myfunc(a,b): pass how can i make the two decorators into one(note:one get parameters and the other doesn`t) -- http://ma

Re: A critique of cgi.escape

2006-09-26 Thread Georg Brandl
Lawrence D'Oliveiro wrote: > In message <[EMAIL PROTECTED]>, Fredrik > Lundh wrote: > >> Lawrence D'Oliveiro wrote: >> Georg Brandl wrote: > A function is broken if its implementation doesn't match the > documentation. or if it doesn't match the designer's intent. cgi

Re: QuoteSQL

2006-09-26 Thread Lawrence D'Oliveiro
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 search arguments, but you absolutely >>>sh

Re: Makin search on the other site and getting data and writing in xml

2006-09-26 Thread Steve Holden
Steven D'Aprano wrote: > On Mon, 25 Sep 2006 13:51:55 +0200, Fredrik Lundh wrote: > > >>http://www.google.com/terms_of_service.html >> >>"You may not send automated queries of any sort to Google's system >> without express >>permission in advance from Google." > > > I'm not just be

Re: A critique of cgi.escape

2006-09-26 Thread Georg Brandl
Lawrence D'Oliveiro wrote: > In message <[EMAIL PROTECTED]>, Max M wrote: > >> Lawrence is right that the escape method doesn't work the way he expects >> it to. >> >> Rewriting a library module simply because a developer is surprised is a >> *very* bad idea. > > I'm not surprised. Disappointed,

Re: QuoteSQL

2006-09-26 Thread Fredrik Lundh
Steve Holden wrote: > Ah, so your quoting function will deduce the context in which arguments > intended for parameter substitution in the query will be used? Or are > you suggesting that it's unwise to rely on autoquoted parameters? That > could have a serious impact on the efficiency of some

Re: Makin search on the other site and getting data and writing in xml

2006-09-26 Thread Fredrik Lundh
Steven D'Aprano wrote: > Google don't define "automated query"it, and I don't think they can. the phrases they use are well understood in the SE business. that's good enough for everyone involved (including courts; see below). > (What on earth is "meta-searching"? If you're going to use terms

Re: does anybody earn a living programming in python?

2006-09-26 Thread Diez B. Roggisch
> well, if you're only watching mtv, it's easy to think that there's > obviously not much demand for country singers, blues musicians, British > hard rock bands, or melodic death metal acts. These days its even hard to get the idea that there is a demand of boy bands, rnb, euro trash or any oth

Re: Remap Mysql tuple to dictionary

2006-09-26 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, I wrote: > In message <[EMAIL PROTECTED]>, Fredrik > Lundh wrote: > >> Lawrence D'Oliveiro wrote: >> >>> yield dict(zip(Fields, NextRow)) >> >> the OP didn't ask for a field name => value mapping, though. > > What other kind of mapping could you produce?

Re: A critique of cgi.escape

2006-09-26 Thread Brian Quinlan
Jon Ribbens wrote: > 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

Re: Remap Mysql tuple to dictionary

2006-09-26 Thread Steve Holden
Frank Millman wrote: > 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 bet

Re: A critique of cgi.escape

2006-09-26 Thread George Sakkis
Lawrence D'Oliveiro wrote: > Fredrik Lundh wrote: > > you're not the designer... > > I don't have to be. Whoever the designer was, they had not properly thought > through the uses of this function. That's quite obvious already, to anybody > who works with HTML a lot. So the function is broken and

Re: A critique of cgi.escape

2006-09-26 Thread Brian Quinlan
Paul Rubin wrote: > 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 suppl

Re: Extend file type

2006-09-26 Thread Fredrik Lundh
abcd wrote: > Any ideas what methods the stdout (and I guess stderr) of Popen objects > from subprocess call? the external process only sees OS-level file handles (the number you get from the fileno() method on your file objects), not Python objects. no matter how you override things in your p

Re: Remap Mysql tuple to dictionary

2006-09-26 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Fredrik Lundh wrote: > Lawrence D'Oliveiro wrote: > >> yield dict(zip(Fields, NextRow)) > > the OP didn't ask for a field name => value mapping, though. What other kind of mapping could you produce? -- http://mail.python.org/mailman/listinfo/python-list

Re: A critique of cgi.escape

2006-09-26 Thread Duncan Booth
Lawrence D'Oliveiro <[EMAIL PROTECTED]> wrote: > In message <[EMAIL PROTECTED]>, Duncan Booth > wrote: > >> If I have a unicode string such as: u'\u201d' (right double quote), >> then I want that encoded in my html as '”' (or ” but the >> numeric form is better). > > Right-double-quote is not a

Re: A critique of cgi.escape

2006-09-26 Thread Duncan Booth
Lawrence D'Oliveiro <[EMAIL PROTECTED]> 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. Th

Re: accepts decorator

2006-09-26 Thread Gabriel Genellina
At Monday 25/9/2006 21:58, urielka wrote: i think i got what the * and ** mean. *args mean arguments that are assigned by position(that is why *arg is a tuple) **kwds mean arguments that are assigned using equals a=2,b=3 (that is why **kwds i a dict) but why self is in *args and other thing goes

Re: A critique of cgi.escape

2006-09-26 Thread Dan Bishop
Lawrence D'Oliveiro wrote: > In message <[EMAIL PROTECTED]>, Fredrik > Lundh wrote: > > > Max M wrote: > > > >> It also makes the escaped html harder to read for standard cases. > > > > and slows things down a bit. > > > > (cgi.escape(s, True) is slower than cgi.escape(s), for reasons that are > >

<    1   2   3   4