python_ast/datamodel/namespace.rs
1//! Rust traits used to abstract Python data objects that are namespaces and contain symbols.
2//! This includes Modules, Functions, Classes, and other objects.
3
4use crate::{Name, Object};
5use std::collections::HashMap;
6
7/*
8pub enum PyPath {
9 Name(Name),
10 SubModule(Vec<PyPath>),
11 Super,
12}*/
13
14pub trait NameSpace: Object {
15 /// Returns the name of the object
16 fn name(&self) -> Name;
17
18 /// Returns the docstring, if any.
19 fn doc(&self) -> Option<String>;
20
21 /// Returns the namespace of the Object.
22 fn dict<K, V>(&self) -> HashMap<K, V>;
23}
24
25#[cfg(test)]
26mod tests {
27 //use super::*;
28}