[Freeipa-devel] [PATCH] 0317 Improve LDAPEntry.__repr__ for freshly created entries

Petr Viktorin pviktori at redhat.com
Mon Nov 25 13:41:58 UTC 2013


On 11/25/2013 01:05 PM, Jan Cholasta wrote:
> On 6.11.2013 13:28, Petr Viktorin wrote:
>> Hello Honza,
>> This is a simple enough patch, but I'd like you to check if it's
>> consistent with your vision of the framework.
>>
>
> I used self._raw here deliberately, so that calling repr() on an
> LDAPEntry does not change its internal state.
>
> I agree that using self._raw alone is insufficient, but I'd like to keep
> the "no changes" behavior, perhaps using something like this:
>
>      data = dict(self._raw)
>      data.update(self._nice)
>      return '%s(%r, %r)' % (type(self).__name__, self._dn, data)

That makes sense.
Newly created entries have None values in _nice so I filtered them out here.

-- 
Petr³

-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-pviktori-0317.2-Improve-LDAPEntry.__repr__-for-freshly-created-entri.patch
Type: text/x-patch
Size: 1098 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20131125/d59187c1/attachment.bin>


More information about the Freeipa-devel mailing list