[Python-Dev] Terminology for PEP 343

Nick Coghlan ncoghlan at gmail.com
Tue Jul 5 15:04:05 CEST 2005


Raymond Hettinger wrote:
>>"""
>>With Statements and Suite Management
> 
> 
> 
> This is nicely done :-)
> 
> Nit:  Replace "e.g." with "such as".
> 
> BTW, do you support changing __exit__ to __leave__?  I think it provides
> a small but useful gain in usability.

I was initially -0 on the idea, and I've moved to a solid -1 after 
spending more time thinking about it.

The only real pro I can see for 'leave' is that it is more common than 
'exit' in conversational English, particularly when using the past 
tense. However, I've come to see significant pros for staying with 'exit':

1. 'Exit' is more precise than 'leave'. 'exit' has just the one real 
meaning - to go out of something. It has a couple of variants on the 
theme, and can be used as both a verb and a noun, but the basic 
meaning stays the same. However, the same cannot be said for 'leave'. 
In addition to its usage as a synonym for 'exit', it can be used in 
the sense of not taking something ('leave it behind'), not doing 
something ('leave the lights on') or handing over responsibility 
('leave it to me'). When used as a noun, it refers to permission ('you 
have my leave') and absences ('annual leave').
'Exit' covers just what we mean, while 'leave' covers that and a hell 
of a lot more, leading me to favour 'exit' as the more precise term.

2. Enter/exit and arrive/leave are the natural terminology pairings in 
English. The first pair are more specific, implying the existence of 
an 'inside' and an 'outside', while the latter pair are significantly 
less fussy (e.g. consider arriving at and leaving a picnic in the 
park, versus trying to enter and exit that same picnic). It is just a 
quirk of the language that the more general term 'leave' is 
substituted for many uses of 'exit' (particularly when the past tense 
is involved). I suspect the single syllable of 'left' tends to win out 
over the three syllable verbal gymnastics of 'exited' (try saying the 
two words out loud - I found the difference to be surprising, and 
significantly more marked than the difference between 'enter' and 
'arrive').
In our case, code is written and read far more often than it is 
spoken, again leading me to favour the use of 'exit', this time as the 
more natural counterpart to 'enter'.

3. The common starting letter gives a nice visual pairing for 
enter/exit. This is not the case for enter/leave, again leading to a 
preference for the use of 'exit'.

Using 'leave' instead of 'exit' is an interesting idea, but I think 
these are good reasons to stick with the PEP 343 terminology.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
---------------------------------------------------------------
             http://boredomandlaziness.blogspot.com


More information about the Python-Dev mailing list