X Tutup
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,12 @@ rustpython-sre_engine = { path = "crates/sre_engine", version = "0.4.0" }
rustpython-wtf8 = { path = "crates/wtf8", version = "0.4.0" }
rustpython-doc = { path = "crates/doc", version = "0.4.0" }

# Ruff tag 0.15.5 is based on commit 5e4a3d9c3b381df20f6a52caef0f56ed0ebc74be
# Ruff tag 0.15.6 is based on commit e4c7f357777a2fdd34dbe6a98b1b7d3e7488f675
# at the time of this capture. We use the commit hash to ensure reproducible builds.
ruff_python_parser = { git = "https://github.com/astral-sh/ruff.git", rev = "5e4a3d9c3b381df20f6a52caef0f56ed0ebc74be" }
ruff_python_ast = { git = "https://github.com/astral-sh/ruff.git", rev = "5e4a3d9c3b381df20f6a52caef0f56ed0ebc74be" }
ruff_text_size = { git = "https://github.com/astral-sh/ruff.git", rev = "5e4a3d9c3b381df20f6a52caef0f56ed0ebc74be" }
ruff_source_file = { git = "https://github.com/astral-sh/ruff.git", rev = "5e4a3d9c3b381df20f6a52caef0f56ed0ebc74be" }
ruff_python_parser = { git = "https://github.com/astral-sh/ruff.git", rev = "e4c7f357777a2fdd34dbe6a98b1b7d3e7488f675" }
ruff_python_ast = { git = "https://github.com/astral-sh/ruff.git", rev = "e4c7f357777a2fdd34dbe6a98b1b7d3e7488f675" }
ruff_text_size = { git = "https://github.com/astral-sh/ruff.git", rev = "e4c7f357777a2fdd34dbe6a98b1b7d3e7488f675" }
ruff_source_file = { git = "https://github.com/astral-sh/ruff.git", rev = "e4c7f357777a2fdd34dbe6a98b1b7d3e7488f675" }

phf = { version = "0.13.1", default-features = false, features = ["macros"]}
ahash = "0.8.12"
Expand Down
10 changes: 5 additions & 5 deletions Lib/test/test_unpack_ex.py
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems that astral-sh/ruff@8bc437e did great:)

Original file line number Diff line number Diff line change
Expand Up @@ -148,27 +148,27 @@
[0, 1, 2, 3, 4]

>>> l = [a, (3, 4), {5}, {6: None}, (i for i in range(7, 10))]
>>> [*item for item in l] # TODO: RUSTPYTHON # doctest:+EXPECTED_FAILURE
>>> [*item for item in l]
Traceback (most recent call last):
...
SyntaxError: iterable unpacking cannot be used in comprehension

>>> [*[0, 1] for i in range(10)] # TODO: RUSTPYTHON # doctest:+EXPECTED_FAILURE
>>> [*[0, 1] for i in range(10)]
Traceback (most recent call last):
...
SyntaxError: iterable unpacking cannot be used in comprehension

>>> [*'a' for i in range(10)] # TODO: RUSTPYTHON # doctest:+EXPECTED_FAILURE
>>> [*'a' for i in range(10)]
Traceback (most recent call last):
...
SyntaxError: iterable unpacking cannot be used in comprehension

>>> [*[] for i in range(10)] # TODO: RUSTPYTHON # doctest:+EXPECTED_FAILURE
>>> [*[] for i in range(10)]
Traceback (most recent call last):
...
SyntaxError: iterable unpacking cannot be used in comprehension

>>> {**{} for a in [1]} # TODO: RUSTPYTHON # doctest:+EXPECTED_FAILURE
>>> {**{} for a in [1]} # TODO: RUSTPYTHON # doctest: +EXPECTED_FAILURE
Traceback (most recent call last):
...
SyntaxError: dict unpacking cannot be used in dict comprehension
Expand Down
1 change: 1 addition & 0 deletions crates/stdlib/src/_tokenize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,7 @@ mod _tokenize {
TokenKind::TStringMiddle => 63,
TokenKind::TStringEnd => 64,
TokenKind::IpyEscapeCommand | TokenKind::Question | TokenKind::Unknown => 67, // ERRORTOKEN
TokenKind::Lazy => u8::MAX, // Placeholder: RustPython Doesn't support `lazy imports` yet
}
}
}
6 changes: 6 additions & 0 deletions crates/vm/src/stdlib/_ast/statement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1043,6 +1043,7 @@ impl Node for ast::StmtImport {
node_index: _,
names,
range: _range,
is_lazy: _,
} = self;
let node = NodeAst
.into_ref_with_type(_vm, pyast::NodeStmtImport::static_type().to_owned())
Expand All @@ -1053,6 +1054,7 @@ impl Node for ast::StmtImport {
node_add_location(&dict, _range, _vm, source_file);
node.into()
}

fn ast_from_object(
_vm: &VirtualMachine,
source_file: &SourceFile,
Expand All @@ -1066,6 +1068,7 @@ impl Node for ast::StmtImport {
get_node_field(_vm, &_object, "names", "Import")?,
)?,
range: range_from_object(_vm, source_file, _object, "Import")?,
is_lazy: false, // Placeholder
})
}
}
Expand All @@ -1078,6 +1081,7 @@ impl Node for ast::StmtImportFrom {
names,
level,
range,
is_lazy: _,
} = self;
let node = NodeAst
.into_ref_with_type(vm, pyast::NodeStmtImportFrom::static_type().to_owned())
Expand All @@ -1092,6 +1096,7 @@ impl Node for ast::StmtImportFrom {
node_add_location(&dict, range, vm, source_file);
node.into()
}

fn ast_from_object(
vm: &VirtualMachine,
source_file: &SourceFile,
Expand Down Expand Up @@ -1120,6 +1125,7 @@ impl Node for ast::StmtImportFrom {
.transpose()?
.unwrap_or(0),
range: range_from_object(vm, source_file, _object, "ImportFrom")?,
is_lazy: false, // Placeholder
})
}
}
Expand Down
Loading
X Tutup