app.py 文件源码

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

项目:pogom-linux 作者: PokeHunterProject 项目源码 文件源码
def default(self, obj):
        try:
            if isinstance(obj, datetime):
                if obj.utcoffset() is not None:
                    obj = obj - obj.utcoffset()
                millis = int(
                        calendar.timegm(obj.timetuple()) * 1000 +
                        obj.microsecond / 1000
                )
                return millis
            iterable = iter(obj)
        except TypeError:
            pass
        else:
            return list(iterable)
        return JSONEncoder.default(self, obj)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号