Skip to content

Commit 8b657ab

Browse files
committed
Add documentation for sys.flags
1 parent 2ca96c8 commit 8b657ab

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

derive/src/pyclass.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,7 @@ pub fn impl_pystruct_sequence(attr: AttributeArgs, item: Item) -> Result<TokenSt
367367
};
368368
methods.push(method);
369369
let field_name_str = field_name.to_string();
370+
// TODO add doc to the generated property
370371
let method_reference = quote! {
371372
class.set_str_attr(
372373
#field_name_str,

vm/src/sysmodule.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,23 +27,41 @@ fn getframe(offset: OptionalArg<usize>, vm: &VirtualMachine) -> PyResult<FrameRe
2727
Ok(frame.clone())
2828
}
2929

30+
/// sys.flags
31+
///
32+
/// Flags provided through command line arguments or environment vars.
3033
#[pystruct_sequence(name = "flags")]
3134
#[derive(Default, Debug)]
3235
struct SysFlags {
36+
/// -d
3337
debug: bool,
38+
/// -i
3439
inspect: bool,
40+
/// -i
3541
interactive: bool,
42+
/// -O or -OO
3643
optimize: u8,
44+
/// -B
3745
dont_write_bytecode: bool,
46+
/// -s
3847
no_user_site: bool,
48+
/// -S
3949
no_site: bool,
50+
/// -E
4051
ignore_environment: bool,
52+
/// -v
4153
verbose: bool,
54+
/// -b
4255
bytes_warning: bool,
56+
/// -q
4357
quiet: bool,
58+
/// -R
4459
hash_randomization: bool,
60+
/// -I
4561
isolated: bool,
62+
/// -X dev
4663
dev_mode: bool,
64+
/// -X utf8
4765
utf8_mode: bool,
4866
}
4967

0 commit comments

Comments
 (0)