Skip to content

Commit c9c1ac9

Browse files
committed
Give module names for classes
1 parent 5e9df32 commit c9c1ac9

File tree

12 files changed

+19
-19
lines changed

12 files changed

+19
-19
lines changed

vm/src/stdlib/array.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ def_array_enum!(
246246
(Double, f64, 'd'),
247247
);
248248

249-
#[pyclass(name = "array")]
249+
#[pyclass(module = "array", name = "array")]
250250
#[derive(Debug)]
251251
pub struct PyArray {
252252
array: PyRwLock<ArrayContentType>,
@@ -530,7 +530,7 @@ impl PyArray {
530530
}
531531
}
532532

533-
#[pyclass(name = "array_iterator")]
533+
#[pyclass(module = "array", name = "array_iterator")]
534534
#[derive(Debug)]
535535
pub struct PyArrayIter {
536536
position: AtomicCell<usize>,

vm/src/stdlib/csv.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ impl ReadState {
124124
}
125125
}
126126

127-
#[pyclass(name = "Reader")]
127+
#[pyclass(module = "csv", name = "Reader")]
128128
struct Reader {
129129
state: PyRwLock<ReadState>,
130130
}

vm/src/stdlib/hashlib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use sha1::Sha1;
1414
use sha2::{Sha224, Sha256, Sha384, Sha512};
1515
use sha3::{Sha3_224, Sha3_256, Sha3_384, Sha3_512}; // TODO: , Shake128, Shake256};
1616

17-
#[pyclass(name = "hasher")]
17+
#[pyclass(module = "hashlib", name = "hasher")]
1818
struct PyHasher {
1919
name: String,
2020
buffer: PyRwLock<HashWrapper>,

vm/src/stdlib/io.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ mod fileio {
647647
flag as u32
648648
}
649649

650-
#[pyclass(name)]
650+
#[pyclass(module = "io", name)]
651651
#[derive(Debug)]
652652
struct FileIO {
653653
fd: AtomicCell<i64>,

vm/src/stdlib/re.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use crate::obj::objtype::PyClassRef;
1616
use crate::pyobject::{BorrowValue, PyClassImpl, PyObjectRef, PyResult, PyValue, TryFromObject};
1717
use crate::vm::VirtualMachine;
1818

19-
#[pyclass(name = "Pattern")]
19+
#[pyclass(module = "re", name = "Pattern")]
2020
#[derive(Debug)]
2121
struct PyPattern {
2222
regex: Regex,
@@ -69,7 +69,7 @@ impl PyValue for PyPattern {
6969
}
7070

7171
/// Inner data for a match object.
72-
#[pyclass(name = "Match")]
72+
#[pyclass(module = "re", name = "Match")]
7373
struct PyMatch {
7474
haystack: PyStringRef,
7575
captures: Vec<Option<Range<usize>>>,

vm/src/stdlib/socket.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ mod c {
5454
};
5555
}
5656

57-
#[pyclass(name = "socket")]
57+
#[pyclass(module = "socket", name = "socket")]
5858
#[derive(Debug)]
5959
pub struct PySocket {
6060
kind: AtomicCell<i32>,

vm/src/stdlib/ssl.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ fn ssl_rand_pseudo_bytes(n: i32, vm: &VirtualMachine) -> PyResult<(Vec<u8>, bool
228228
}
229229
}
230230

231-
#[pyclass(name = "_SSLContext")]
231+
#[pyclass(module = "ssl", name = "_SSLContext")]
232232
struct PySslContext {
233233
ctx: PyRwLock<SslContextBuilder>,
234234
check_hostname: bool,
@@ -504,7 +504,7 @@ struct LoadVerifyLocationsArgs {
504504
cadata: Option<Either<PyStringRef, PyBytesLike>>,
505505
}
506506

507-
#[pyclass(name = "_SSLSocket")]
507+
#[pyclass(module = "ssl", name = "_SSLSocket")]
508508
struct PySslSocket {
509509
ctx: PyRef<PySslContext>,
510510
stream: PyRwLock<Option<ssl::SslStreamBuilder<PySocketRef>>>,

vm/src/stdlib/thread.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ macro_rules! repr_lock_impl {
9292
}};
9393
}
9494

95-
#[pyclass(name = "lock")]
95+
#[pyclass(module = "thread", name = "lock")]
9696
struct PyLock {
9797
mu: RawMutex,
9898
}
@@ -146,7 +146,7 @@ impl PyLock {
146146
}
147147

148148
pub type RawRMutex = RawReentrantMutex<RawMutex, RawThreadId>;
149-
#[pyclass(name = "RLock")]
149+
#[pyclass(module = "thread", name = "RLock")]
150150
struct PyRLock {
151151
mu: RawRMutex,
152152
}
@@ -277,7 +277,7 @@ fn thread_count(vm: &VirtualMachine) -> usize {
277277
vm.state.thread_count.load()
278278
}
279279

280-
#[pyclass(name = "_local")]
280+
#[pyclass(module = "thread", name = "_local")]
281281
#[derive(Debug)]
282282
struct PyLocal {
283283
data: ThreadLocal<PyDictRef>,

vm/src/stdlib/unicodedata.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ pub fn make_module(vm: &VirtualMachine) -> PyObjectRef {
5454
module
5555
}
5656

57-
#[pyclass(name = "UCD")]
57+
#[pyclass(module = "unicodedata", name = "UCD")]
5858
#[derive(Debug)]
5959
struct PyUCD {
6060
unic_version: UnicodeVersion,

vm/src/stdlib/winreg.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use std::io;
1414
use winapi::shared::winerror;
1515
use winreg::{enums::RegType, RegKey, RegValue};
1616

17-
#[pyclass(name = "HKEYType")]
17+
#[pyclass(module = "winreg", name = "HKEYType")]
1818
#[derive(Debug)]
1919
struct PyHKEY {
2020
key: PyRwLock<RegKey>,

0 commit comments

Comments
 (0)