PEP 359: The "make" Statement
Nicolas Fleury
nid_oizo at yahoo.com_removethe_
Fri Apr 14 12:47:06 EDT 2006
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.
>
Note that there's a "special paste" in wxPython PyShell, with which you
can copy/paste these lines.
Nicolas
More information about the Python-list
mailing list