468,765 Members | 1,726 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,765 developers. It's quick & easy.

">>>" and "..." (WAS PEP 359: The "make" Statement)

Felipe Almeida Lessa wrote:
Em Sex, 2006-04-14 ąs 09:31 -0600, Steven Bethard escreveu:
[1] Here's the code I used to test it.
>>> def make(callable, name, args, block_string):

... try:
... make_dict = callable.__make_dict__
... except AttributeError:
... make_dict = dict
... block_dict = make_dict()
... exec block_string in block_dict
... return callable(name, args, block_dict)
...
>>> (snip)


I think it would be nice not to put those ">>>" and "..." to make copy
and paste easier. Okay, I know we can do "".join(line[4:] for line in
text), but that's just my humble opinion.


Depends what you're copying and pasting to. In PythonWin, you have to
have the "... ", so I include it.

If you have an editor with block-select, you should just be able to
select the appropriate section (ignoring the first four characters).
TextPad is one such editor (on Windows), but I'm sure there are many
others and hopefully if you're on Unix someone here can let you know
what works there.

STeVe
Apr 14 '06 #1
0 1152

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Eric A. Forgy | last post: by
35 posts views Thread by Will Stuyvesant | last post: by
1 post views Thread by Christian Schmidbauer | last post: by
18 posts views Thread by zoilus | last post: by
29 posts views Thread by not.here.now | last post: by
36 posts views Thread by Roedy Green | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by Marin | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.