Skip to main content

monty_types/
builtins.rs

1//! [`BuiltinsFunctions`] — the name-level identity of every interpreter-native
2//! Python builtin, carried by [`MontyObject::BuiltinFunction`](crate::object::MontyObject).
3
4use strum::{Display, EnumString, FromRepr, IntoStaticStr};
5/// Enumerates every interpreter-native Python builtin function.
6///
7/// Listed alphabetically per <https://docs.python.org/3/library/functions.html>
8/// Commented-out variants are not yet implemented.
9///
10/// Note: Type constructors are handled by the `Type` enum, not here.
11///
12/// Uses strum derives for automatic `Display`, `FromStr`, and `IntoStaticStr` implementations.
13/// All variants serialize to lowercase (e.g., `Print` -> "print").
14#[derive(
15    Debug,
16    Clone,
17    Copy,
18    Display,
19    EnumString,
20    FromRepr,
21    IntoStaticStr,
22    PartialEq,
23    Eq,
24    Hash,
25    serde::Serialize,
26    serde::Deserialize,
27)]
28#[strum(serialize_all = "lowercase")]
29#[serde(rename_all = "lowercase")]
30#[repr(u8)]
31pub enum BuiltinsFunctions {
32    Abs,
33    // Aiter,
34    All,
35    // Anext,
36    Any,
37    // Ascii,
38    Bin,
39    // bool - handled by Type enum
40    // Breakpoint,
41    // bytearray - handled by Type enum
42    // bytes - handled by Type enum
43    // Callable,
44    Chr,
45    // Classmethod,
46    // Compile,
47    // complex - handled by Type enum
48    // Delattr,
49    // dict - handled by Type enum
50    // Dir,
51    Divmod,
52    Enumerate,
53    // Eval,
54    // Exec,
55    Filter,
56    // float - handled by Type enum
57    // Format,
58    // frozenset - handled by Type enum
59    Getattr,
60    // Globals,
61    Hasattr,
62    Hash,
63    // Help,
64    Hex,
65    Id,
66    // Input,
67    // int - handled by Type enum
68    Isinstance,
69    // Issubclass,
70    // Iter - handled by Type enum
71    Len,
72    // list - handled by Type enum
73    // Locals,
74    Map,
75    Max,
76    // memoryview - handled by Type enum
77    Min,
78    Next,
79    // object - handled by Type enum
80    Oct,
81    Open,
82    Ord,
83    Pow,
84    Print,
85    // Property,
86    // range - handled by Type enum
87    Repr,
88    Reversed,
89    Round,
90    // set - handled by Type enum
91    Setattr,
92    // Slice,
93    Sorted,
94    // Staticmethod,
95    // str - handled by Type enum
96    Sum,
97    // Super,
98    // tuple - handled by Type enum
99    Type,
100    // Vars,
101    Zip,
102    // __import__ - not planned
103}