Python types 模块,insert() 实例源码

我们从Python开源项目中,提取了以下5个代码示例,用于说明如何使用types.insert()

项目:oil    作者:oilshell    | 项目源码 | 文件源码
def test_inputtypes(self):
        s = 'abracadabra'
        types = [list, tuple]
        if have_unicode:
            types.insert(0, unicode)
        for T in types:
            self.assertEqual(sorted(s), sorted(T(s)))

        s = ''.join(dict.fromkeys(s).keys())  # unique letters only
        types = [set, frozenset, list, tuple, dict.fromkeys]
        if have_unicode:
            types.insert(0, unicode)
        for T in types:
            self.assertEqual(sorted(s), sorted(T(s)))
项目:python2-tracer    作者:extremecoders-re    | 项目源码 | 文件源码
def test_inputtypes(self):
        s = 'abracadabra'
        types = [list, tuple]
        if have_unicode:
            types.insert(0, unicode)
        for T in types:
            self.assertEqual(sorted(s), sorted(T(s)))

        s = ''.join(dict.fromkeys(s).keys())  # unique letters only
        types = [set, frozenset, list, tuple, dict.fromkeys]
        if have_unicode:
            types.insert(0, unicode)
        for T in types:
            self.assertEqual(sorted(s), sorted(T(s)))
项目:packaging    作者:blockstack    | 项目源码 | 文件源码
def test_inputtypes(self):
        s = 'abracadabra'
        types = [list, tuple]
        if True:      # Was: if have_unicode:
            types.insert(0, unicode)
        for T in types:
            self.assertEqual(sorted(s), sorted(T(s)))

        s = ''.join(dict.fromkeys(s).keys())  # unique letters only
        types = [set, frozenset, list, tuple, dict.fromkeys]
        if True:      # Was: if have_unicode:
            types.insert(0, unicode)
        for T in types:
            self.assertEqual(sorted(s), sorted(T(s)))
项目:pefile.pypy    作者:cloudtracer    | 项目源码 | 文件源码
def test_inputtypes(self):
        s = 'abracadabra'
        types = [list, tuple]
        if have_unicode:
            types.insert(0, unicode)
        for T in types:
            self.assertEqual(sorted(s), sorted(T(s)))

        s = ''.join(dict.fromkeys(s).keys())  # unique letters only
        types = [set, frozenset, list, tuple, dict.fromkeys]
        if have_unicode:
            types.insert(0, unicode)
        for T in types:
            self.assertEqual(sorted(s), sorted(T(s)))
项目:ndk-python    作者:gittor    | 项目源码 | 文件源码
def test_inputtypes(self):
        s = 'abracadabra'
        types = [list, tuple]
        if have_unicode:
            types.insert(0, unicode)
        for T in types:
            self.assertEqual(sorted(s), sorted(T(s)))

        s = ''.join(dict.fromkeys(s).keys())  # unique letters only
        types = [set, frozenset, list, tuple, dict.fromkeys]
        if have_unicode:
            types.insert(0, unicode)
        for T in types:
            self.assertEqual(sorted(s), sorted(T(s)))