[Python-ideas] What about allowing '?' in method names?

Jesse Noller jnoller at gmail.com
Thu Aug 6 23:07:28 CEST 2009


+100

On Thu, Aug 6, 2009 at 2:57 PM, Guido van Rossum<guido at python.org> wrote:
> Adding '?' to identifiers in Python ain't gonna happen.
>
> On Thu, Aug 6, 2009 at 11:11 AM, Lucas Prado
> Melo<lucaspradomelo at gmail.com> wrote:
>> On Thu, Aug 6, 2009 at 12:16 PM, Greg Falcon <veloso at verylowsodium.com>
>> wrote:
>>>
>>> On Wed, Aug 5, 2009 at 9:01 PM, Tennessee
>>> Leeuwenburg<tleeuwenburg at gmail.com> wrote:
>>> > def shouldSomethingHappen?(self, context):
>>>
>>> > I just think it looks nicer, and is a good hint that a true/false or
>>> > other
>>> > kind of flag is likely to come back.
>>>
>>> Two problems I immediately see with this:
>>>
>>> 1) '?' is punctuation, and uninitiated readers are likely to guess
>>> that it is some sort of postfix operator.
>>
>> Actually, Ruby allows this notation and, until now, I have not seen many
>> complains about it.
>> Despite that, its use would be pretty clear for the beginner, since it would
>> be associated with meaningful identifiers:
>>
>> oil_tank.isItFull?()
>>
>> The worst problem could be the useless parenthesis after the '?' sign.
>>
>>>
>>> 2) IPython gives a special meaning to ?, and it would be a shame to
>>> collide with that.
>>
>>  IMHO, IPython might not be mature enough to interfere with Python design
>> decisions yet.
>>
>> _______________________________________________
>> Python-ideas mailing list
>> Python-ideas at python.org
>> http://mail.python.org/mailman/listinfo/python-ideas
>>
>>
>
>
>
> --
> --Guido van Rossum (home page: http://www.python.org/~guido/)
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> http://mail.python.org/mailman/listinfo/python-ideas
>



More information about the Python-ideas mailing list