Pre-PEP ideas

Alex Martelli aleaxit at yahoo.com
Tue Feb 18 07:07:07 EST 2003


Greg Ewing (using news.cis.dfn.de) wrote:

> Richard Jones wrote:
>  >
> 
>> On Mon, 17 Feb 2003 1:06 pm, Steven Cummings wrote:
> 
>>
>> > def A.print(self):
>> >    "print a string representation to sys.stdout"
>> >    print self._value
> 
>  >
> 
>> I'd vote -1 for this simply because there's already a way to do this.
> 
> 
> The existing way is fine assuming assuming you only want
> to do this rarely. But I can think of a reason for wanting
> to do this a lot.

And why, even then, would the reasonably simple style:

def _A__pprint(self):
    print self._value
A.pprint = _A_pprint

be so bad as to warrant a syntax addition to Python?


Alex





More information about the Python-list mailing list