Change kind identifier to fully use python terminology

This commit is contained in:
ben committed 2019-03-29 19:03:13 +13:00
1 parent b5dc5a28e7
commit ce9a909b9d
3 files changed
+8 -8

No files matched your search

+3 -3
View File
@@ -23,11 +23,11 @@ enum ParameterKind {
impl ParameterKind {
fn from_ident(ident: &Ident) -> ParameterKind {
if ident == "positional" {
if ident == "positional_only" {
ParameterKind::PositionalOnly
} else if ident == "positional_keyword" {
} else if ident == "positional_or_keyword" {
ParameterKind::PositionalOrKeyword
} else if ident == "keyword" {
} else if ident == "keyword_only" {
ParameterKind::KeywordOnly
} else {
panic!("Unrecognised attribute")
+3 -3
View File
@@ -537,11 +537,11 @@ fn builtin_pow(vm: &VirtualMachine, args: PyFuncArgs) -> PyResult {
#[derive(Debug, FromArgs)]
pub struct PrintOptions {
#[pyarg(keyword, default = "None")]
#[pyarg(keyword_only, default = "None")]
sep: Option<PyStringRef>,
#[pyarg(keyword, default = "None")]
#[pyarg(keyword_only, default = "None")]
end: Option<PyStringRef>,
#[pyarg(keyword, default = "false")]
#[pyarg(keyword_only, default = "false")]
flush: bool,
}
+2 -2
View File
@@ -374,9 +374,9 @@ impl PyIntRef {
#[derive(FromArgs)]
struct IntOptions {
#[pyarg(positional, optional = true)]
#[pyarg(positional_only, optional = true)]
val_options: OptionalArg<PyObjectRef>,
#[pyarg(positional_keyword, optional = true)]
#[pyarg(positional_or_keyword, optional = true)]
base: OptionalArg<u32>,
}