Skip to content

Commit 5ecfd1d

Browse files
committed
ordering comment
1 parent 9e30b7a commit 5ecfd1d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

crates/ty_python_semantic/src/types/newtype.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ use ruff_python_ast as ast;
2222
/// - `typing.NewType`: `Type::ClassLiteral(ClassLiteral)` with `KnownClass::NewType`.
2323
/// - `Foo`: `Type::KnownInstance(KnownInstanceType::NewType(NewType { .. }))`
2424
/// - `x`: `Type::NewTypeInstance(NewType { .. })`
25+
///
26+
/// # Ordering
27+
/// Ordering is based on the newtype's salsa-assigned id and not on its values.
28+
/// The id may change between runs, or when the newtype was garbage collected and recreated.
2529
#[salsa::interned(debug, heap_size=ruff_memory_usage::heap_size)]
2630
#[derive(PartialOrd, Ord)]
2731
pub struct NewType<'db> {

0 commit comments

Comments
 (0)