# HG changeset patch # User Paul Boddie # Date 1476567135 -7200 # Node ID be308b898916fea05e8a167b58bf8bf761b32e58 # Parent bb12d1f303580d9edf819c82100f1e5b3086d24e Added a method providing the parent of any reference alias. diff -r bb12d1f30358 -r be308b898916 referencing.py --- a/referencing.py Fri Oct 14 23:24:51 2016 +0200 +++ b/referencing.py Sat Oct 15 23:32:15 2016 +0200 @@ -154,6 +154,15 @@ return self.get_origin().rsplit(".", 1)[0] + def name_parent(self): + + "Return the parent of this reference's aliased name." + + if not self.get_name(): + return None + + return self.get_name().rsplit(".", 1)[0] + def ancestors(self): """