mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-01 22:31:47 +00:00
Allow assigning ellipsis literal as parameter default value (#14982)
Resolves #14840 ## Summary Usage of ellipsis literal as default argument is allowed in stub files. ## Test Plan Added mdtest for both python files and stub files. --------- Co-authored-by: Carl Meyer <carl@oddbird.net> Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
parent
2ea63620cf
commit
b26448926a
6 changed files with 126 additions and 1 deletions
|
@ -76,6 +76,11 @@ impl<'db> UnpackValue<'db> {
|
|||
matches!(self, UnpackValue::Iterable(_))
|
||||
}
|
||||
|
||||
/// Returns `true` if the value is being assigned to a target.
|
||||
pub(crate) const fn is_assign(self) -> bool {
|
||||
matches!(self, UnpackValue::Assign(_))
|
||||
}
|
||||
|
||||
/// Returns the underlying [`Expression`] that is being unpacked.
|
||||
pub(crate) const fn expression(self) -> Expression<'db> {
|
||||
match self {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue