API修改意见征集-No.2 #39
RF-Tar-Railt
announced in
Announcements
Replies: 3 comments
-
alc = Alconna("test")
alc1 = Alconna("test", override=True) |
Beta Was this translation helpful? Give feedback.
0 replies
-
将 Analyser 内的一些临时数据(如header,separators)作为上下文内容,并以此将 Analyser 作为一个单例。 提供一个方法/函数 除此之外,类似报错选项等数据也可以通过 using 注入 with using(Alconna(...)) as ana:
res = ana.parse(xxx)或 with Alconna(...).using() as ana:
res = ana.parse(xxx)或 # parse 开始时注入上下文,结束时销毁上下文
Alconna(...).parse(xxx) |
Beta Was this translation helpful? Give feedback.
0 replies
-
即允许header与command处塞入BasePattern/Type 如 Alconna("test", headers=[int]) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
对于现阶段 Alconna 的 api 有更好意见的都可以在这里提出来
以及可能的新 api:
或者是
AlcGp是作为多级结构的替代实现(即解禁subcmd禁止嵌套后的效果)
AlcGp拥有一个标识符,作为对其下命令集的等效父级命令地址
一个命令只能加入一个命令组内,并且加入时其所在命名空间自动替换为其命令组所在命名空间
AlcGp允许嵌套
即传入separator时可以接受Collection[str]
如
Beta Was this translation helpful? Give feedback.
All reactions