0

Is the colon :, when used in slices in Python, called anything special? Other than, say, the slightly medicinal sounding "colon operator"?

x = s[:5]
    # ^ this character
jonrsharpe
  • 107,083
  • 22
  • 201
  • 376
Mr Mystery Guest
  • 1,378
  • 15
  • 45
  • 1
    you could call it slice: http://stackoverflow.com/questions/509211/explain-pythons-slice-notation – toine Nov 04 '15 at 11:38
  • 1
    I'm not sure I've ever heard it referred to as anything in particular, and it's not named in [the language reference](https://docs.python.org/2/reference/expressions.html#slicings). It's incorrect to call it an operator, though; it's just a delimiter for the bounds and stride. – jonrsharpe Nov 04 '15 at 11:40
  • It's normally just called a colon. I guess you could call it a "slice colon" if you want to be specific. It's not actually an operator, it's a [delimiter](https://docs.python.org/3/reference/lexical_analysis.html?delimiters#delimiters). – PM 2Ring Nov 04 '15 at 11:45
  • Maybe `slice delimiter`. – Peter Wood Nov 04 '15 at 11:53

1 Answers1

0

Delimiter, I hearby name you : Colonic Slice

Mr Mystery Guest
  • 1,378
  • 15
  • 45