Mathematicians use inconsistent notations all the time. Symbols meaning slightly different things based on the type of the arguments are among the benign cases.

For the present case, see https://en.wikipedia.org/wiki/Vertical_bar#Mathematics.