RFC PEP candidate: q'<delim>'quoted<delim> ?

Roman Suzi rnd at onego.ru
Fri Mar 8 13:13:48 EST 2002


On 4 Mar 2002, Bengt Richter wrote:

>On Sun, 3 Mar 2002 14:56:45 +0300 (MSK), Roman Suzi <rnd at onego.ru> wrote:
>
>>On 3 Mar 2002, Bengt Richter wrote:
>>
>>>Problem: How to put quotes around an arbitrary program text?
>>
>>Have it in a separate file.
>>
>That's fine in a lot of cases, but does require reliable presence
>of both files. It's not so convenient if you are trying to write
>e.g. a program generator and want to write out snippets containing
>mixed triple quoted doc strings and data etc. Or if you are
>writing copied example snips as part of dynamic HTML from CGI.

>===the stuff I want===
>
>
>Sure, I can copy it and make a separate file, and write some code to
>read the file into my snippet string, but would you actually prefer to
>do it that way? Ok, I could write a class to systematize it. Maybe I
>will, when I want use file-stored snippets, but I'd like both options
>;-) And I guess I'd like to have Q' as well as q' ;-)

Well, maybe my first impressions were wrong. After all, the feature is
convenient. But probably you will need to coordinate it well
with encoding things. What if "dochere"'s encoding need to be
different from main program one? Are binary data allowed?
Otherwise the feature will become grammatical disaster...

>>Making Python as gibberish as Perl is. And all that only to
>>have Windows path be written without double-\
>Not 'only'. I said 'also' ;-)  Perhaps my choice of '|' delimiter triggered
>your 'gibberish as Perl' detector?

;-) Maybe. I wonder why Perl novices do not know about "dochere"
capabilities of Perl.

Sincerely yours, Roman Suzi
-- 
_/ Russia _/ Karelia _/ Petrozavodsk _/ rnd at onego.ru _/
_/ Friday, March 08, 2002 _/ Powered by Linux RedHat 6.2 _/
_/ "People are always available for work in the past tense." _/





More information about the Python-list mailing list