[ty] Implement the legacy PEP-484 convention for indicating positional-only parameters (#20248)

Co-authored-by: Carl Meyer <carl@astral.sh>
This commit is contained in:
Alex Waygood
2025-09-05 17:56:06 +01:00
committed by GitHub
parent eb6154f792
commit 5d52902e18
17 changed files with 376 additions and 150 deletions

View File

@@ -1,5 +1,7 @@
use ruff_python_ast::{HasNodeIndex, NodeIndex};
use crate::ast_node_ref::AstNodeRef;
/// Compact key for a node for use in a hash map.
#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash, get_size2::GetSize)]
pub(super) struct NodeKey(NodeIndex);
@@ -11,4 +13,8 @@ impl NodeKey {
{
NodeKey(node.node_index().load())
}
pub(super) fn from_node_ref<T>(node_ref: &AstNodeRef<T>) -> Self {
NodeKey(node_ref.index())
}
}