MCPcopy Index your code
hub / github.com/python/cpython / repl

Method repl

Lib/_strptime.py:468–477  ·  view source on GitHub ↗
(m)

Source from the content-addressed store, hash-verified

466 year_in_format = False
467 day_of_month_in_format = False
468 def repl(m):
469 directive = m.group()[1:] # exclude `%` symbol
470 match directive:
471 case 'Y' | 'y' | 'G':
472 nonlocal year_in_format
473 year_in_format = True
474 case 'd':
475 nonlocal day_of_month_in_format
476 day_of_month_in_format = True
477 return self[directive]
478 format = re_sub(r'%[-_0^#]*[0-9]*([OE]?[:\\]?.?)', repl, format)
479 if day_of_month_in_format and not year_in_format:
480 import warnings

Callers

nothing calls this directly

Calls 1

groupMethod · 0.45

Tested by

no test coverage detected