“要么”和“也许”数据结构

either的Python项目详细描述


https://github.com/kennknowles/python-either

这个库为python提供了两个基本的几乎微不足道的数据结构:

  • Either also known as “coproduct”, “sum type”, “variant”, “tagged union”, “disjoint union”, etc: A value that comes from one of two sets
  • Maybe also known as “option” or “Either Nothing”: A value that may be missing. (Python has “None” but it does not compose)

每行大约10行,大部分是样板文件,但现在它们在一个库中的一个位置。

贡献者

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java在Hibernate中是否可以实现独占析取?   java使用Hashset计算数组中的字符串数量,无重复项   javascript如何在java中使用正则表达式实现字符限制?   java是否有最大值或输出到BigInteger?   java无法正确生成校验和   简单的java程序“你好,世界!”在eclipse中安装Android插件后不工作   使用Eureka服务器AWS Elastic Beanstalk注册java Eureka客户端   Liferay中的javajunit和mock   java Hibernate如何正确使用关系中的级联   javajlabel。setText的工作方式很奇怪   java Search()StringIndexOutOfBoundsException   是否可以使用Java将PDF文档转换为Word?   java在iText元素上添加阴影效果