Returns *True* if name binding introduces new namespace. If the name is used as the target of a function or class statement, this will be true. Note that a single name can be bound to multiple objects. If is_namespace() is true, the name may also be bound to
(self)
| 287 | return bool(self.__flags & DEF_LOCAL) |
| 288 | |
| 289 | def is_namespace(self): |
| 290 | """Returns *True* if name binding introduces new namespace. |
| 291 | |
| 292 | If the name is used as the target of a function or class |
| 293 | statement, this will be true. |
| 294 | |
| 295 | Note that a single name can be bound to multiple objects. If |
| 296 | is_namespace() is true, the name may also be bound to other |
| 297 | objects, like an int or list, that does not introduce a new |
| 298 | namespace. |
| 299 | """ |
| 300 | return bool(self.__namespaces) |
| 301 | |
| 302 | def get_namespaces(self): |
| 303 | """Return a list of namespaces bound to this name""" |