MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / __sub__

Method __sub__

lib/matplotlib/tests/test_dates.py:1003–1015  ·  view source on GitHub ↗
(self, other)

Source from the content-addressed store, hash-verified

1001 """
1002
1003 def __sub__(self, other):
1004 r = super().__sub__(other)
1005 tzinfo = getattr(r, 'tzinfo', None)
1006
1007 if tzinfo is not None:
1008 localizer = getattr(tzinfo, 'normalize', None)
1009 if localizer is not None:
1010 r = tzinfo.normalize(r)
1011
1012 if isinstance(r, datetime.datetime):
1013 r = self.mk_tzaware(r)
1014
1015 return r
1016
1017 def __add__(self, other):
1018 return self.mk_tzaware(super().__add__(other))

Callers

nothing calls this directly

Calls 2

mk_tzawareMethod · 0.95
normalizeMethod · 0.80

Tested by

no test coverage detected