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

S

Steven Bethard

Felipe said:
> 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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,139
Latest member
JamaalCald
Top