Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Unconstructible
  • Loading branch information
youknowone committed Dec 8, 2025
commit 656b825fac3975b02fe1543f34105e3241d16f56
8 changes: 5 additions & 3 deletions crates/vm/src/stdlib/os.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ pub(super) mod _os {
ospath::{IOErrorBuilder, OsPath, OsPathOrFd, OutputMode},
protocol::PyIterReturn,
recursion::ReprGuard,
types::{IterNext, Iterable, PyStructSequence, Representable, SelfIter},
types::{IterNext, Iterable, PyStructSequence, Representable, SelfIter, Unconstructible},
utils::ToCString,
vm::VirtualMachine,
};
Expand Down Expand Up @@ -474,7 +474,7 @@ pub(super) mod _os {
ino: AtomicCell<Option<u64>>,
}

#[pyclass(with(Representable))]
#[pyclass(with(Representable, Unconstructible))]
impl DirEntry {
#[pygetset]
fn name(&self, vm: &VirtualMachine) -> PyResult {
Expand Down Expand Up @@ -652,6 +652,7 @@ pub(super) mod _os {
}
}
}
impl Unconstructible for DirEntry {}

#[pyattr]
#[pyclass(name = "ScandirIter")]
Expand All @@ -661,7 +662,7 @@ pub(super) mod _os {
mode: OutputMode,
}

#[pyclass(with(IterNext, Iterable))]
#[pyclass(with(IterNext, Iterable, Unconstructible))]
impl ScandirIterator {
#[pymethod]
fn close(&self) {
Expand All @@ -679,6 +680,7 @@ pub(super) mod _os {
zelf.close()
}
}
impl Unconstructible for ScandirIterator {}
impl SelfIter for ScandirIterator {}
impl IterNext for ScandirIterator {
fn next(zelf: &crate::Py<Self>, vm: &VirtualMachine) -> PyResult<PyIterReturn> {
Expand Down