471,081 Members | 926 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,081 software developers and data experts.

">>>" 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 1220

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
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.