test_tzinfo.py 文件源码

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

项目:epg-dk.bundle 作者: ukdtom 项目源码 文件源码
def _roundtrip_datetime(self, dt):
        # Ensure that the tzinfo attached to a datetime instance
        # is identical to the one returned. This is important for
        # DST timezones, as some state is stored in the tzinfo.
        tz = dt.tzinfo
        p = pickle.dumps(dt)
        unpickled_dt = pickle.loads(p)
        unpickled_tz = unpickled_dt.tzinfo
        self.assertTrue(tz is unpickled_tz, '%s did not roundtrip' % tz.zone)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号