-2

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"?

14
  • 1
    As the question stands, both "io" (eye-oh) and "underscore" begin with vowels (and therefore require "an"). Perhaps a different example would be more useful.
    – Tevildo
    Feb 4 at 0:10
  • @Tevildo Indeed. Fixed it.
    – DYZ
    Feb 4 at 0:14
  • 1
    Is it actual writing, an actual text. Or is it listing this below a sentence? Your question is not clear.
    – Lambie
    Feb 4 at 0:17
  • 1
    Like all such duplicates as this, this one has nothing to do the writing, only with sound. Speak it aloud and the answer shall appear.
    – tchrist
    Feb 4 at 0:43
  • 1
    Presumably _TextIOWrapper is a class and the open() function returns an object of this class. It may be clearer (though longer) to write "the open() function returns an object of the class _TextIOWrapper". My advice is to consult your appropriate style guide, or else look for similar passages to see what other writers in your field have done.
    – Peter
    Feb 4 at 1:30

1 Answer 1

1

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"?

Since it is the case that Americans, generally, speak of “an herb,” while some Britons prefer “a herb” (The Cambridge Dictionary provides an audio sample of both here). What is written, generally (but not always), reflects the writer’s (editor’s) preferred pronunciation.

As the person writing the piece, perhaps, your choice of article could serve as a clue to guide the reader toward your preference. I’d avoid spelling out underscore-TextIOWrapper as unwieldy and inappropriate for something using the preformatted text style for code.

_TextIOWrapper is much cleaner than the alternatives. Using an may highlight the presence of the underscore, thereby amplifying its importance in the reference. The choice to use a may deemphasize the underscore, perhaps in favor of readability.


Grammarphobia contemplates the choice of article with herb: Do we say “an herb” or “a herb”?

Not the answer you're looking for? Browse other questions tagged or ask your own question.