for i in range(10):
for i in 0 .. 9:
我如何“超载”。在
我发现range()
对象不简洁易读。pascal符号/语法(范围(包括。。inclusive)http://rigaux.org/language-study/syntax-across-languages-per-language/Pascal.html)只是更容易阅读。在
我在pathlib模块https://docs.python.org/3/library/pathlib.html中看到它重载(?)/字符。在
虽然
Python
没有..
运算符,但可以定义一个中缀运算符,如下所示:现在,选择一个有意义的名称,如
^{pr2}$until
,您就完成了:或者
不幸的不是我的主意,见this brilliant post for the original idea。在
相关问题 更多 >
编程相关推荐