anomaly

Mark Lawrence breamoreboy at yahoo.co.uk
Mon May 11 07:47:24 EDT 2015


On 11/05/2015 12:39, Antoon Pardon wrote:
> Op 11-05-15 om 12:40 schreef Mark Lawrence:
>> On 11/05/2015 11:15, Antoon Pardon wrote:
>>> Op 10-05-15 om 19:28 schreef Gary Herron:
>>>
>>>> Common Python thought::  "We're all adults here."    If you want to
>>>> override a builtin within your own namespace, who are we to stop you?
>>>> Besides, it's still available as __builtins__.int  (unless you've also
>>>> overridden that).
>>>
>>> This is a common python myth. That is selectively used when
>>> convenient and
>>> ignored when that is convenient.
>>>
>>> Try overriding None, True or False in python3 and see what happens.
>>>
>>
>> According to
>> https://docs.python.org/3/reference/lexical_analysis.html#keywords
>> None, True and False are all keywords in Python 3, int isn't as I
>> believe has already been pointed out.
>>
> Which is exactly the point! They were turned into keywords because the
> developers didn't want to allow them being overridden. There is no
> a priori reason why we should turn "True" into a keyword and allow
> "int" in the builtins.
>
> We are only allowed to be adults, for as far as the developers let us.
> They allow us to be adults with regards to "int" but they don't allow
> us to be adults with regards to "True".
>
> Defending "int" being overridable by declating "We're all adults" is
> being selective.
>

If you say so but I disagree and can't be bothered to say anything else.

-- 
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence




More information about the Python-list mailing list