I have some words in my [technical] text that begin with an underscore. Should I use "a" or "an" in front of them? For example, should it be a _TextIOWrapper or an _TextIOWrapper? If I ignore the underscore, the first alphabetic symbol in the word is a consonant, which warrants an "a." However, when one reads the text aloud, the word is pronounced as "underscore-TextIOWrapper," starts with a vowel, and needs an "an."
A real example from a real text:
In such a scenario, the object created and returned by the open() function, an _TextIOWrapper, acts as a generator.
P.S. As suggested by the commenters, the answer depends on whether the underscore is voiced or silent, with which I agree. Then the question is, what would be a common reading practice: to spell it out as "underscore-TextIOWrapper" or ignore it and just say "TextIOWrapper"?
Text_IO_Wrapper, or evenstring_overload_method: notice that underscores in identifiers are for the most part nothing more than spaces in phrases to make them easier to read. That being said, there is also a tradition of distinguishing for exampleexit()from_exit()in speech. In some programming languages a leading underscore does something special, just like how a leading capital letter might. But would you really distinguishtextIOWrapperfromTextIOWRapperfromTEXT_IO_WRAPPERin speech? I bet not. – tchrist Feb 04 '24 at 01:42_TextIOWrapperobject created and returned by the open() function acts as a generator. – Tinfoil Hat Feb 04 '24 at 03:00Dogand assign the instance to variable_dog" – TimR Feb 04 '24 at 12:24