pub enum PythonParameterSplat {
Positional,
Keyword,
}Expand description
The identifier node that names one parameter’s binding.
The grammar gives default_parameter and typed_default_parameter a
name field but gives typed_parameter and the two splat patterns none,
so a caller that reads only the field loses the binding name of every
annotated parameter. Every Python surface that names parameters reads them
through this function.
Which splat a Python formal parameter spells, looking through the
annotation wrapper.
*args is a list_splat_pattern and **kwargs a
dictionary_splat_pattern, but the grammar spells *args: str as a
typed_parameter that holds one, so a test on the parameter’s own node kind
misses every annotated variadic. A parameter that misses it binds like an
ordinary formal: one positional actual each, and the rest spill onto the
formals that follow.
Variants§
Positional
*args: collects every remaining positional actual.
Keyword
**kwargs: collects every remaining keyword actual.
Trait Implementations§
Source§impl Clone for PythonParameterSplat
impl Clone for PythonParameterSplat
Source§fn clone(&self) -> PythonParameterSplat
fn clone(&self) -> PythonParameterSplat
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for PythonParameterSplat
Source§impl Debug for PythonParameterSplat
impl Debug for PythonParameterSplat
impl Eq for PythonParameterSplat
Source§impl PartialEq for PythonParameterSplat
impl PartialEq for PythonParameterSplat
impl StructuralPartialEq for PythonParameterSplat
Auto Trait Implementations§
impl Freeze for PythonParameterSplat
impl RefUnwindSafe for PythonParameterSplat
impl Send for PythonParameterSplat
impl Sync for PythonParameterSplat
impl Unpin for PythonParameterSplat
impl UnsafeUnpin for PythonParameterSplat
impl UnwindSafe for PythonParameterSplat
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more