period.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:pendulum 作者: sdispater 项目源码 文件源码
def xrange(self, unit, amount=1):
        method = 'add'
        op = operator.le
        if not self._absolute and self.invert:
            method = 'subtract'
            op = operator.ge

        start, end = self.start, self.end

        i = amount
        while op(start, end):
            yield start

            start = getattr(self.start, method)(**{unit: i})

            i += amount
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号