mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-04 10:49:54 +00:00
refactor(pystd): use methods declaration syntax
This commit is contained in:
parent
7e9cef9c07
commit
66ece61af2
13 changed files with 164 additions and 144 deletions
|
@ -2,13 +2,14 @@
|
|||
|
||||
.ArgumentParser!: ClassType
|
||||
.new = 'ArgumentParser': (description := Str, prog := Str) -> .ArgumentParser!
|
||||
.ArgumentParser!.add_argument!: (
|
||||
name: Str, # TODO: var-args
|
||||
action := Str or NoneType,
|
||||
default := Obj or NoneType,
|
||||
type := Type,
|
||||
required := Bool,
|
||||
help := Str or NoneType,
|
||||
choices := Obj or NoneType,
|
||||
) => ._StoreAction
|
||||
.ArgumentParser!.parse_args!: (args := Str or [Str; _] or NoneType,) => Obj # TODO: type with dependent types
|
||||
.ArgumentParser!.
|
||||
add_argument!: (
|
||||
name: Str, # TODO: var-args
|
||||
action := Str or NoneType,
|
||||
default := Obj or NoneType,
|
||||
type := Type,
|
||||
required := Bool,
|
||||
help := Str or NoneType,
|
||||
choices := Obj or NoneType,
|
||||
) => ._StoreAction
|
||||
.parse_args!: (args := Str or [Str; _] or NoneType,) => Obj # TODO: type with dependent types
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue