From ea7f9594dfd7e781e9ce06aabb17388071749855 Mon Sep 17 00:00:00 2001 From: Jason Gerard DeRose Date: Fri, 2 Jan 2009 00:35:42 -0700 Subject: A few docstring edits in base.NameSpace --- ipalib/base.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'ipalib/base.py') diff --git a/ipalib/base.py b/ipalib/base.py index 6fcd248f..d8394874 100644 --- a/ipalib/base.py +++ b/ipalib/base.py @@ -311,16 +311,18 @@ class NameSpace(ReadOnly): ['member0', 'member1', 'member2'] Although not a standard container feature, the `NameSpace.__call__()` method - provides a convenient (and efficient) way to iterate through the members, - like an ordered version of the ``dict.itervalues()`` method. For example: + provides a convenient (and efficient) way to iterate through the *members* + (as opposed to the member names). Think of it like an ordered version of + the ``dict.itervalues()`` method. For example: >>> list(ns[name] for name in ns) # One way to do it [Member(0), Member(1), Member(2)] - >>> list(ns()) # A more efficient, less verbose way to do it + >>> list(ns()) # A more efficient, simpler way to do it [Member(0), Member(1), Member(2)] - As another convenience, the `NameSpace.__todict__()` method will return a - copy of the ``dict`` mapping the member names to the members. For example: + Another convenience method is `NameSpace.__todict__()`, which will return + a copy of the ``dict`` mapping the member names to the members. + For example: >>> ns.__todict__() {'member1': Member(1), 'member0': Member(0), 'member2': Member(2)} -- cgit