def _extractPitch(nOrP):
    """
    utility function to return either the object itself
    or the `.pitch` if it's a Note.

    >>> p = pitch.Pitch('D#4')
    >>> interval._extractPitch(p) is p
    True
    >>> n = note.Note('E-4')
    >>> interval._extractPitch(n) is n.pitch
    True

    """
    if 'Pitch' in nOrP.classes:
        return nOrP
    else:
        return nOrP.pitch
