forked from goodboy/tractor
				
			Add `NamespacePath._ns` todo for `self:<ns.meth>` support
							parent
							
								
									27b750e907
								
							
						
					
					
						commit
						5fa040c7db
					
				|  | @ -58,6 +58,11 @@ class NamespacePath(str): | |||
|     ''' | ||||
|     _ref: object | type | None = None | ||||
| 
 | ||||
|     # TODO: support providing the ns instance in | ||||
|     # order to support 'self.<meth>` style to make | ||||
|     # `Portal.run_from_ns()` work! | ||||
|     # _ns: ModuleType|type|None = None | ||||
| 
 | ||||
|     def load_ref(self) -> object | type: | ||||
|         if self._ref is None: | ||||
|             self._ref = resolve_name(self) | ||||
|  | @ -100,5 +105,13 @@ class NamespacePath(str): | |||
|         fqnp: tuple[str, str] = cls._mk_fqnp(ref) | ||||
|         return cls(':'.join(fqnp)) | ||||
| 
 | ||||
|     def to_tuple(self) -> tuple[str, str]: | ||||
|         return self._mk_fqnp(self.load_ref()) | ||||
|     def to_tuple( | ||||
|         self, | ||||
| 
 | ||||
|         # TODO: could this work re `self:<meth>` case from above? | ||||
|         # load_ref: bool = True, | ||||
| 
 | ||||
|     ) -> tuple[str, str]: | ||||
|         return self._mk_fqnp( | ||||
|             self.load_ref() | ||||
|         ) | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue