pixelarray_test.py 文件源码

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

项目:Projects 作者: it2school 项目源码 文件源码
def test_repr (self):
        # Python 3.x bug: the tp_repr slot function returned NULL instead
        # of a Unicode string, triggering an exception.
        sf = pygame.Surface ((3, 1), pygame.SRCALPHA, 16)
        ar = pygame.PixelArray(sf)
        ar[...] = 42
        pixel = sf.get_at_mapped ((0, 0))
        self.assertEqual(repr (ar),
                         type (ar).__name__ + "([\n  [42, 42, 42]]\n)")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号