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

Petr Viktorin pviktori at redhat.com
Tue Nov 26 12:20:39 UTC 2013


On 11/26/2013 09:57 AM, Jan Cholasta wrote:
> On 25.11.2013 14:41, Petr Viktorin wrote:
>> 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.
>>
>
> Nitpick: use iteritems() instead of items().
>
> Besides that, ACK.

Thanks! Changed and pused to master: 
76c7f24919d30fdd53e4a1cd32880b55c2437ace

-- 
Petr³
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-pviktori-0317.3-Improve-LDAPEntry.__repr__-for-freshly-created-entri.patch
Type: text/x-patch
Size: 1102 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20131126/729e40ef/attachment.bin>


More information about the Freeipa-devel mailing list