Return the list of magic globals for the given Python minor version.
(minor_version: u8)
| 238 | |
| 239 | /// Return the list of magic globals for the given Python minor version. |
| 240 | pub fn python_magic_globals(minor_version: u8) -> impl Iterator<Item = &'static str> { |
| 241 | let py314_magic_globals = if minor_version >= 14 { |
| 242 | Some(PY314_PLUS_MAGIC_GLOBALS) |
| 243 | } else { |
| 244 | None |
| 245 | }; |
| 246 | |
| 247 | let pre_py315_magic_globals = if minor_version < 15 { |
| 248 | Some(PRE_PY315_MAGIC_GLOBALS) |
| 249 | } else { |
| 250 | None |
| 251 | }; |
| 252 | |
| 253 | py314_magic_globals |
| 254 | .into_iter() |
| 255 | .chain(pre_py315_magic_globals) |
| 256 | .flatten() |
| 257 | .chain(MAGIC_GLOBALS) |
| 258 | .copied() |
| 259 | } |
| 260 | |
| 261 | /// Returns `true` if the given name is that of a Python builtin. |
| 262 | /// |
no test coverage detected