【文件属性】:
文件名称:uniontypes:联合类型或python
文件大小:12KB
文件格式:ZIP
更新时间:2021-05-14 09:22:07
Python
uniontypes 0.1
联合类型对于python。
这些出现其他语言,例如Haskell( Either )和Scala( Union或\/ )。
这扩展到任何类型的集合。
例子
创建联合类型
>> > from uniontypes import Union
>> > u = Union [ list , tuple , str ]
>> > u
< class>
创建装箱的值
>> > u ([ 1 , 2 , 3 ])
Union [ list , tuple , str ][ list ] [ 1 , 2 , 3 ]
>> > u (( 1 , 2 , 3 ))
Union [ list , tuple , str ][ tuple ] ( 1 , 2 , 3 )
>> > u ( '123
【文件预览】:
uniontypes-master
----.gitignore(518B)
----uniontypes()
--------tests()
--------__init__.py(5KB)
----README.rst(2KB)
----LICENSE(18KB)
----setup.py(978B)
----.travis.yml(272B)