Am 27.07.2019 um 23:10 schrieb Chris Angelico: > When talking about indistinguishable objects, is it correct to talk > about "the <x>" or "an <x>"? > > Example: > > def f(s): > """Frob a thing. > > If s is an empty string, frobs all the things. > OR > If s is the empty string, frobs all the things. > """ > > It's entirely possible that a Python implementation will optimize > small strings and thus have exactly one empty string, but it's also > entirely possible to have multiple indistinguishable empty strings. > Grammatically, is it better to think of empty strings as an entire > category of object, and you were passed one from that category ("an > empty string"), or to think of zero-length instances of 'str' as being > implementation details referring to the one and only Platonic "empty > string"? > > Does it make a difference to usage if the object is mutable? For > instance, would you say "the empty string" but "an empty set"? > > ChrisA >
Quite frankly, even as a professional (german) writer and texter (but hobby-programmer), I consider this question to be an exaggeration about a very minor grammatical aspect. Yes, it makes a difference if you are allowed to eat *an* apple or *this* apple (*this* apple might be mine). But, I hobby-program since 20 years or so, but I can not remember a situation, where a documentation that confused "an" with "this" caused any troubles. Anyway: Python 3.6.7 (default, Oct 22 2018, 11:32:17) [GCC 8.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> x="" >>> y="" >>> x is y True Jython 2.5.3 (, Sep 21 2017, 03:12:48) [OpenJDK 64-Bit Server VM (Oracle Corporation)] on java1.7.0_131 Type "help", "copyright", "credits" or "license" for more information. >>> x="" >>> y="" >>> x is y False So, obviously there are multiple empty strings possible, so I'd write "an". HTH -- https://mail.python.org/mailman/listinfo/python-list