python模式匹配

patternmatching的Python项目详细描述


python模式匹配但我想让你改变。不是你,是我。真的。
看,你没有模式匹配。但是,这不是问题的根源。宏
是它的根。你没有宏,但没关系。现在,我想要
模式匹配。我知道你给了我‘if `/`elif `/`else ``语句,但我需要更多。我要滥用你的职能。吉多,等等,我希望你能原谅我。这只会造成一点伤害。

"python pattern matching"是一个apache2许可的python模块,用于类似于函数式编程语言中的"pattern
matching"。大多数处理python模式匹配的项目都关注语法和简单的案例。运算符
重载通常用于更改运算符的语义以支持
模式匹配。在其他情况下,函数装饰器用于实现
多次分派,有时称为函数重载。在模式匹配的应用中,每个语法、运算符和修饰符都是非常详细的。不知怎么的,它没有采取。我可能应该将其称为另一个python模式匹配模块,但是"yappmm"并没有脱离舌头。其他人尝试过重载
运算符和更改编解码器。这个模块最初是作为一个编解码器黑客,但是那些
很难,因为它们需要emacs模式、vim模式等的生态系统才能真正方便。


python模式匹配关注的是
python中模式匹配的语义。python中的动态duck类型行为不同于函数式编程语言中的标记联合。这个项目不是试图模拟函数模式匹配的行为,而是试图实现看起来和感觉都是python固有的模式匹配。在这样做时,使用
传统函数调用作为语法。没有导入挂钩,没有
编解码器,没有ast转换。

…待办事项:

python``match``函数示例。

最后,python模式匹配!如果您以前在"函数"语言(如erlang、haskell、clojure、f_、ocaml等)中体验过这个特性,那么您可以猜测语义。

待办事项:

待办事项:

-完整记录
-100%测试覆盖率
-压力测试小时数

…图片::https://api.travis-ci.org/grantjenks/python-pattern-matching.svg?branch=master
:目标:http://www.grantjenks.com/docs/patternmatching/

…图片::https://ci.appveyor.com/api/projects/status/github/grantjenks/python-pattern-matching?branch=master&svg=true
:目标:http://www.grantjenks.com/docs/pattern matching/


quickstart
--


>安装"python pattern matching"很简单,只需使用"pip
<;http://www.pip-installer.org/>;`:

$pip install patternmatching

您可以使用python内置的"help"函数访问解释器中的文档。"help"在"pattern
匹配"中的模块、类和函数上工作。代码块::python

>;>;来自pypatt import match,bind,bind,like
>;>;帮助(match)




但类似的设计
-https://github.com/suor/patterns
-decorator,其语法很时髦
-在python巴西2013上共享
-https://github.com/mariusae/match
-http://monkey.org/~marius/pattern matching in python.html
-运算符重载
-http://blog.chadselph.com/add将函数样式模式匹配到python.html
-多方法
-http://svn.colorstudy.com/home/ianb/recipes/patmatch.py
-多方法
-http://www.artima.com/weblogs/viewpost.jsp?thread=101605
-原始的多方法
-http://speak.codebunk.com/post/77084204957/python中的模式匹配
-支持可调用的多方法
-http://www.aclevername.com/projects/splarnektity/
-不确定它是如何工作的,但是语法还有很多待改进所需的
-http s://github.com/martinblech/pyfpm
-带字符串解析的多分派
-https://github.com/jldupont/pyfnc
-多分派
-http://www.pyret.org/
-它自己的语言
-https://pypi.python.org/pypi/peak rules
-通用的多分派样式业务规则
-http://home.in.tum.de/~bayerj/patternmatch.py
-模式对象思想(无绑定)
-https://github.com/admk/patmat
-多分派样式




其他语言-https://doc.rust-lang.org/book/patterns.html rust
-https://www.haskell.org/tutorial/patterns.html haskell
-http://erlang.org/doc/reference\u manual/expressions.html pattern erlang
-https://ocaml.org/learn/tutorials/data\u types\u and\u matching.html ocaml


指南
----

*`python pattern matching tutorial`\u
*`python pattern matching reference`\u
*`python pattern matching search`\u
*`python pattern matching index`\u

……_` python模式匹配教程:http://www.grantjenks.com/docs/pattern matching/tutorial.html
。_` python模式匹配参考`:http://www.grantjenks.com/docs/pattern matching/reference.html
。_` python模式匹配搜索:http://www.grantjenks.com/docs/pattern matching/search.html
。_` python模式匹配索引`:http://www.grantjenks.com/docs/pattern matching/genindex.html



project links
---------

*`python模式匹配`\u
*`python模式匹配在pypi `\u
*`python模式匹配在github `\u
*`python模式匹配问题跟踪器_` python模式匹配`:http://www.grantjenks.com/docs/pattern matching/
。_` pypi上的python模式匹配:https://pypi.python.org/pypi/pattern matching/
…_` github上的python模式匹配:https://github.com/grantjenks/python模式匹配
。_` python pattern matching issue tracker`:https://github.com/grant jenks/python pattern matching/issues



--------


2015-2019版权所有,根据apache许可证2.0版(以下简称"许可证")授予jenks

;除非符合许可证,否则您不能使用
此文件。您可以在http://www.apache.org/licenses/license-2.0获取


明示的或暗示的。请参阅许可证,以获取控制许可证下的权限和限制的特定语言。

。_`模式匹配`:http://www.grantjenks.com/docs/pattern matching/



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

推荐PyPI第三方库


热门话题
Gson类中的java验证错误   If和elseif之间的java差异?   字典Java8地图。输入比较器   java连接到远程计算机以获得WMI支持   java如何使用改型处理JSON对象中的空值   在Java中使用Comparator时不可编译的源代码   java将Jar添加到JSP的运行时路径   带有随机对象的while循环的java大O时间复杂性   java可以在不考虑参数的情况下模拟方法吗?   java我有一个简单的代码,它不工作。无法修复错误“println”   向eclipse添加Xively java库   java是否可以启用本机代码的缓存?   全局变量如何在Java中的所有类之间共享要使用的语言环境?   Java内存游戏如何翻转单个卡?