aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'roverlay')
-rw-r--r--roverlay/util/dictwalk.py4
-rw-r--r--roverlay/util/objects.py8
2 files changed, 6 insertions, 6 deletions
diff --git a/roverlay/util/dictwalk.py b/roverlay/util/dictwalk.py
index 0813d11..9408623 100644
--- a/roverlay/util/dictwalk.py
+++ b/roverlay/util/dictwalk.py
@@ -30,8 +30,8 @@ def dictmerge ( iterable, dict_cls=dict, get_key=None, get_value=None ):
def dictwalk_create_parent_v ( root, path, dict_create=None, cautious=True ):
- """Creates a dict tree structure using keys the given path. The last path
- element will not be created.
+ """Creates a dict tree structure using keys from the given path.
+ The last path element will not be created.
Returns a 3-tuple
( <parent of the last path element>,
diff --git a/roverlay/util/objects.py b/roverlay/util/objects.py
index 9c73749..0f2a2da 100644
--- a/roverlay/util/objects.py
+++ b/roverlay/util/objects.py
@@ -59,13 +59,13 @@ class SafeWeakRef ( weakref.ref ):
def __repr__ ( self ):
obj = self.deref_unsafe()
- if obj:
- return "<{} at 0x{:x} to {!r} at 0x{:x}>".format (
+ if obj is not None:
+ return "<{} at {:#x} to {!r} at {:#x}>".format (
self.__class__.__name__, id ( self ),
obj.__class__.__name__, id ( obj )
)
else:
- return "<{} at 0x{:x} to None>".format (
+ return "<{} at {:#x} to None>".format (
self.__class__.__name__, id ( self )
)
# --- end of __repr__ (...) ---
@@ -109,7 +109,7 @@ class NoneRef ( object ):
__nonzero__ = __bool__
def __repr__ ( self ):
- return "<NoneRef at 0x{:x}>".format ( id ( self ) )
+ return "<NoneRef at {:#x}>".format ( id ( self ) )
# --- end of __repr__ (...) ---
# --- end of NoneRef ---