Re: [Tutor] dictionaries are same but returning false

2017-07-05 Thread Peter Otten
Ashfaq wrote: > Hi Peter, > The way you find the issue is really cool! Very cool! :) Thanks ;) Here's a bonus solution: >>> import unittest >>> class T(unittest.TestCase): ... def test_xy(self): ... self.maxDiff = None ... self.assertEqual(x, y) ... >>> unittest.main() F ==

Re: [Tutor] dictionaries are same but returning false

2017-07-05 Thread shubham goyal
On Jul 5, 2017 11:09 PM, "shubham goyal" wrote: > Yha that's very smart. Only experience can drive you this way. Otherwise I > was checking value by value. > > On Jul 5, 2017 10:21 PM, "Ashfaq" wrote: > > Hi Peter, > The way you find the issue is really cool! Very cool! :) > > On Wed, Jul 5, 201

Re: [Tutor] dictionaries are same but returning false

2017-07-05 Thread Danny Yoo
The difflib library (https://docs.python.org/2/library/difflib.html) can also help with some exploratory discovery of the problem. Here's an example: >>> import difflib >>> for line in difflib.context_diff(repr(x).split(','), repr(y).split(','

Re: [Tutor] dictionaries are same but returning false

2017-07-05 Thread Mats Wichmann
On 07/05/2017 11:09 AM, Marc Tompkins wrote: > On Wed, Jul 5, 2017 at 9:51 AM, Ashfaq wrote: > >> Hi Peter, >> The way you find the issue is really cool! Very cool! :) >> >> > I agree - that is very cool. But I have also made this sort of mistake a > few times, and found it by using a very quick

Re: [Tutor] dictionaries are same but returning false

2017-07-05 Thread Marc Tompkins
On Wed, Jul 5, 2017 at 9:51 AM, Ashfaq wrote: > Hi Peter, > The way you find the issue is really cool! Very cool! :) > > I agree - that is very cool. But I have also made this sort of mistake a few times, and found it by using a very quick, low-tech method... "Unfold" the lines of the two dictio

Re: [Tutor] dictionaries are same but returning false

2017-07-05 Thread Ashfaq
Hi Peter, The way you find the issue is really cool! Very cool! :) On Wed, Jul 5, 2017 at 6:10 PM, shubham goyal wrote: > Thank you Peter. > Silly mistakes 😀 > > On Jul 5, 2017 5:10 PM, "Peter Otten" <__pete...@web.de> wrote: > > > shubham goyal wrote: > > > > > null=None > > > x={'_udp_options'

Re: [Tutor] dictionaries are same but returning false

2017-07-05 Thread shubham goyal
Thank you Peter. Silly mistakes 😀 On Jul 5, 2017 5:10 PM, "Peter Otten" <__pete...@web.de> wrote: > shubham goyal wrote: > > > null=None > > x={'_udp_options': None, '_icmp_options': None, 'attribute_map': > > {'icmp_options': 'icmpOptions', 'protocol': 'protocol', 'source': > > {'source', > > 't

Re: [Tutor] dictionaries are same but returning false

2017-07-05 Thread Peter Otten
shubham goyal wrote: > null=None > x={'_udp_options': None, '_icmp_options': None, 'attribute_map': > {'icmp_options': 'icmpOptions', 'protocol': 'protocol', 'source': > {'source', > 'tcp_options': 'tcpOptions', 'is_stateless': 'isStateless', 'udp_options': > 'udpOptions'}, '_is_stateless': False,

[Tutor] dictionaries are same but returning false

2017-07-05 Thread shubham goyal
null=None x={'_udp_options': None, '_icmp_options': None, 'attribute_map': {'icmp_options': 'icmpOptions', 'protocol': 'protocol', 'source': 'source', 'tcp_options': 'tcpOptions', 'is_stateless': 'isStateless', 'udp_options': 'udpOptions'}, '_is_stateless': False, 'swagger_types': {'icmp_options':