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:
Shaygan Hooshyari 2025-01-05 20:11:32 +01:00 committed by GitHub
parent 2ea63620cf
commit b26448926a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 126 additions and 1 deletions

View file

@ -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 {