FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

add sys.flags and sys.int_info by youknowone · Pull Request #4568 · RustPython/RustPython · GitHub

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .rs  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
10 changes: 10 additions & 0 deletions vm/src/stdlib/sys.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,10 @@ mod sys {
dev_mode: bool,
/// -X utf8
utf8_mode: u8,
/// -X int_max_str_digits=number
int_max_str_digits: i8,
/// -P, `PYTHONSAFEPATH`
safe_path: bool,
/// -X warn_default_encoding, PYTHONWARNDEFAULTENCODING
warn_default_encoding: u8,
}
Expand All @@ -707,6 +711,8 @@ mod sys {
isolated: settings.isolated as u8,
dev_mode: settings.dev_mode,
utf8_mode: 1,
int_max_str_digits: -1,
safe_path: false,
warn_default_encoding: settings.warn_default_encoding as u8,
}
}
Expand Down Expand Up @@ -808,13 +814,17 @@ mod sys {
pub(super) struct PyIntInfo {
bits_per_digit: usize,
sizeof_digit: usize,
default_max_str_digits: usize,
str_digits_check_threshold: usize,
}

#[pyclass(with(PyStructSequence))]
impl PyIntInfo {
const INFO: Self = PyIntInfo {
bits_per_digit: 30, //?
sizeof_digit: std::mem::size_of::<u32>(),
default_max_str_digits: 4300,
str_digits_check_threshold: 640,
};
}

Expand Down

Back | FazBrowse Home | New Git URL