[issue34514] assertEqual doesn't use maxDiff when comparing dictionaries

2020-10-20 Thread Irit Katriel
Change by Irit Katriel : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker ___ ___

[issue34514] assertEqual doesn't use maxDiff when comparing dictionaries

2020-09-17 Thread Irit Katriel
Irit Katriel added the comment: I think this can be closed as not a bug, unless Victor can clarify with an example script why there is an issue. -- nosy: +iritkatriel ___ Python tracker

[issue34514] assertEqual doesn't use maxDiff when comparing dictionaries

2018-08-27 Thread Prudvi RajKumar Maddala
Prudvi RajKumar Maddala added the comment: I see that maxDiff is applied correctly when comparing dictionaries. I don't think that's an issue. -- ___ Python tracker <https://bugs.python.org/issue34

[issue34514] assertEqual doesn't use maxDiff when comparing dictionaries

2018-08-27 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: @victor I am little confused over the issue since you have said "`assertDictEqual()` "will be used by default to compare dictionaries in calls to assertEqual()" and "`maxDiff` doesn't apply to `assertEqual()` when comparing d

[issue34514] assertEqual doesn't use maxDiff when comparing dictionaries

2018-08-27 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: @prudvinit Reference : https://docs.python.org/3.8/library/unittest.html#unittest.TestCase.maxDiff > This attribute controls the maximum length of diffs output by assert methods > that report diffs on failure. It defaults to 80*8 characters.

[issue34514] assertEqual doesn't use maxDiff when comparing dictionaries

2018-08-26 Thread Prudvi RajKumar Maddala
Prudvi RajKumar Maddala added the comment: Hello Victor, can you tell me what is 'maxDiff'? Can you give me a simple example of expected output and actual output by taking a simple dictionary? Thanks -- nosy: +prudvinit ___ Python tracker

[issue34514] assertEqual doesn't use maxDiff when comparing dictionaries

2018-08-26 Thread Victor Engmark
comparing dictionaries. -- components: Tests messages: 324140 nosy: Victor Engmark2 priority: normal severity: normal status: open title: assertEqual doesn't use maxDiff when comparing dictionaries type: behavior versions: Python 3.6 ___ Python track

[issue9132] Documentation for comparing dictionaries is out of date

2010-07-14 Thread Senthil Kumaran
Senthil Kumaran orsent...@gmail.com added the comment: The patch was pretty good. Committed it in r82899 and r82900. Thanks Eli for the patch Terry for the review. -- nosy: +orsenthil resolution: - fixed stage: commit review - committed/rejected status: open - closed

[issue9132] Documentation for comparing dictionaries is out of date

2010-07-12 Thread Eli Bendersky
Eli Bendersky eli...@gmail.com added the comment: I agree with Terry's proposal. Here's a patch file for Doc/reference/expressions.rst that implements the change. -- Added file: http://bugs.python.org/file17967/issue9132.2.patch ___ Python tracker

[issue9132] Documentation for comparing dictionaries is out of date

2010-07-12 Thread Terry J. Reedy
Terry J. Reedy tjre...@udel.edu added the comment: Looks good to me. Thanks Eli. -- stage: needs patch - commit review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9132 ___

[issue9132] Documentation for comparing dictionaries is out of date

2010-07-09 Thread Eli Bendersky
Changes by Eli Bendersky eli...@gmail.com: -- nosy: +eli.bendersky ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9132 ___ ___ Python-bugs-list

[issue9132] Documentation for comparing dictionaries is out of date

2010-07-04 Thread Terry J. Reedy
Terry J. Reedy tjre...@udel.edu added the comment: On the 'patch' keyword: I thought the same as you (only for diff) until yesterday morning when Brett Cannon specifically told me that I should also set it for in-message text patches. This was in the context of him having not noticed for

[issue9132] Documentation for comparing dictionaries is out of date

2010-07-04 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: Thanks for the explanation of the patch keyword. Its description (click on “Keywords”) is indeed generic (“contains patch”), http://www.python.org/dev/patches/ should probably say it too. I don’t have enough knowledge to make a useful comment

[issue9132] Documentation for comparing dictionaries is out of date

2010-07-04 Thread Terry J. Reedy
Terry J. Reedy tjre...@udel.edu added the comment: I intentionally began my first post with The RefMan section is 5.9. Comparisons. Look there, particularly the definition of comp_operator. In this context, I think 'order comparison' is pretty clearly a comparison with an order operator, ''

[issue9132] Documentation for comparing dictionaries is out of date

2010-07-03 Thread Terry J. Reedy
Terry J. Reedy tjre...@udel.edu added the comment: The RefMan section is 5.9. Comparisons. The 3.x docs are by design pretty much free of 2.x references. Which is to say, they are a fresh start with 3.0 as the base. So I would also remove footnote 5. Footnote 4 is currently needed because the

[issue9132] Documentation for comparing dictionaries is out of date

2010-07-03 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: Thanks for tackling this Terry. Did you include a patch, i.e. a diff file? If not, the “patch” keyword does not apply, IIUC. Plain English suggestions are helpful but they’re reviewed in a different way than a diff. “The 3.x docs are by design

[issue9132] Documentation for comparing dictionaries is out of date

2010-06-30 Thread Daniel Stutzbach
: Documentation for comparing dictionaries is out of date versions: Python 3.1, Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9132 ___ ___ Python-bugs-list

[issue9132] Documentation for comparing dictionaries is out of date

2010-06-30 Thread Daniel Stutzbach
Changes by Daniel Stutzbach dan...@stutzbachenterprises.com: -- keywords: +easy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9132 ___ ___

[issue9132] Documentation for comparing dictionaries is out of date

2010-06-30 Thread Alexander Belopolsky
Alexander Belopolsky belopol...@users.sourceforge.net added the comment: Reference to sorted (key, value) lists is a bit misleading as well. Dicts' equality is defined even if key or values are not orderable. -- nosy: +belopolsky ___ Python tracker

Re: comparing dictionaries

2008-05-08 Thread Terry Reedy
Miki [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hello, I want to compare two dicts that should have identical info just in a different data structure. The first dict's contents look like this. It is authoritative... I know for sure it has the correct key value pairs: {'001'

comparing dictionaries

2008-05-07 Thread brad
I want to compare two dicts that should have identical info just in a different data structure. The first dict's contents look like this. It is authoritative... I know for sure it has the correct key value pairs: {'001' : '01'} The second dict's contents are like this with a tuple instead of

Re: comparing dictionaries

2008-05-07 Thread cokofreedom
On May 7, 4:08 pm, brad [EMAIL PROTECTED] wrote: I want to compare two dicts that should have identical info just in a different data structure. The first dict's contents look like this. It is authoritative... I know for sure it has the correct key value pairs: {'001' : '01'} The second

Re: comparing dictionaries

2008-05-07 Thread Carsten Haese
brad wrote: I want to compare two dicts that should have identical info just in a different data structure. The first dict's contents look like this. It is authoritative... I know for sure it has the correct key value pairs: {'001' : '01'} The second dict's contents are like this with a

Re: comparing dictionaries

2008-05-07 Thread Arnaud Delobelle
brad [EMAIL PROTECTED] writes: I want to compare two dicts that should have identical info just in a different data structure. The first dict's contents look like this. It is authoritative... I know for sure it has the correct key value pairs: {'001' : '01'} - refdict The second dict's

Re: comparing dictionaries

2008-05-07 Thread Miki
Hello, I want to compare two dicts that should have identical info just in a different data structure. The first dict's contents look like this. It is authoritative... I know for sure it has the correct key value pairs: {'001' : '01'} The second dict's contents are like this with a tuple

comparing dictionaries to find the identical keys

2007-12-28 Thread Beema shafreen
hi everybody , i need to compare two dictionary's key. I have written a script gene_symbol = {} probe_id = {} result = {} def getGene(fname): fh = open(fname , 'r') for line in fh: yield line fh.close() for line in getGene(symbol_hu133): data1=

Re: comparing dictionaries to find the identical keys

2007-12-28 Thread km
Hi On Dec 28, 2007 4:55 PM, Beema shafreen [EMAIL PROTECTED] wrote: hi everybody , i need to compare two dictionary's key. I have written a script gene_symbol = {} probe_id = {} result = {} def getGene(fname): fh = open(fname , 'r') for line in fh: yield

Re: comparing dictionaries to find the identical keys

2007-12-28 Thread Christian Heimes
Beema shafreen wrote: hi everybody , i need to compare two dictionary's key. I have written a script Use sets. Sets are easier to use and much faster: d1 = {'a': 1, 'b': 2, 'c': 3} d2 = {'b': 2, 'c': 3, 'd': 4} d1.keys() ['a', 'c', 'b'] d2.keys() ['c', 'b', 'd'] s1 = set(d1) s2 =

Re: Comparing Dictionaries

2007-07-31 Thread Alex Martelli
Kenneth Love [EMAIL PROTECTED] wrote: ... Python in a Nutshell (2nd ed.) ... I am a slow reader. So, if Doctests are mentioned in any of the above, I haven't encountered it yet. Yep, I cover doctest in the chapter on testing, debugging, profiling and optimizing. Alex --

Fwd: Re: Comparing Dictionaries

2007-07-30 Thread Kenneth Love
From: Steven D'Aprano [EMAIL PROTECTED] Newsgroups: comp.lang.python Subject: Re: Comparing Dictionaries Date: Sat, 28 Jul 2007 10:21:14 +1000 To: python-list@python.org On Fri, 27 Jul 2007 14:11:02 -0500, Kenneth Love wrote: The published recipe (based on ConfigParser) did not handle my INI

Re: Comparing Dictionaries

2007-07-30 Thread Kenneth Love
At 03:23 AM 7/28/2007, you wrote: Hi Kenneth, being new to Python i wondered if you at least considered Doctests as part of your testing solution. Other languages don't have Doctest. - Paddy. Until I read your post, I had never even heard of Doctest. I will look into it. Here is the list of

Re: Comparing Dictionaries

2007-07-30 Thread Paddy
On Jul 30, 8:30 pm, Kenneth Love [EMAIL PROTECTED] wrote: At 03:23 AM 7/28/2007, you wrote: Hi Kenneth, being new to Python i wondered if you at least considered Doctests as part of your testing solution. Other languages don't have Doctest. - Paddy. Until I read your post, I had never

Re: Comparing Dictionaries

2007-07-30 Thread Paul Rubin
Kenneth Love [EMAIL PROTECTED] writes: I will search on Google for more info on Doctest. Doctest is recent. Try: http://python.org/doc/lib/module-doctest.html Diveintopython should probably be updated to use doctest instead of unittest. unittest is Java-descended and doesn't fit into Python

Re: Fwd: Re: Comparing Dictionaries

2007-07-30 Thread Steven D'Aprano
On Mon, 30 Jul 2007 14:06:29 -0500, Kenneth Love wrote: From: Steven D'Aprano [EMAIL PROTECTED] Newsgroups: comp.lang.python Subject: Re: Comparing Dictionaries Date: Sat, 28 Jul 2007 10:21:14 +1000 To: python-list@python.org On Fri, 27 Jul 2007 14:11:02 -0500, Kenneth Love wrote

Re: Comparing Dictionaries

2007-07-28 Thread Paddy
Hi Kenneth, being new to Python i wondered if you at least considered Doctests as part of your testing solution. Other languages don't have Doctest. - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: Comparing Dictionaries

2007-07-28 Thread Martin P. Hellwig
Kenneth Love wrote: cut That should teach me not to change working code at the same time I am writing unit tests. Even so, I realize it won't be the last time I do something so silly. Yes, I know about TDD's write the test first, but I'm not comfortable with the philosophy of these new

Test-driven design (was: Comparing Dictionaries)

2007-07-28 Thread Ben Finney
Martin P. Hellwig [EMAIL PROTECTED] writes: But the funny thing that I have seen in the development scene is that writing tests first and code later is a lot easier when you have a technical specification to base it on. A technical specification is of course based on a functional design. A

Re: Comparing Dictionaries

2007-07-27 Thread Ali
On Jul 26, 10:18 pm, Kenneth Love [EMAIL PROTECTED] wrote: Hello, I am new to Python, but not programming. I would like to start my Python career by developing programs according to the best practices of the industry. Right now, that appears to be unit tests, patterns, and source code

Re: Comparing Dictionaries

2007-07-27 Thread Kenneth Love
At 09:55 PM 7/26/2007, Ben Finney wrote: Kenneth Love [EMAIL PROTECTED] writes: In other words, I consider these two dictionaries to be equivalent: { 'dog' : 'bone', 'cat' : 'fever', 'mouse' : 'mickey' } { 'mouse' : 'mickey', 'dog' : 'bone', 'cat' : 'fever' } while these two

Re: Comparing Dictionaries

2007-07-27 Thread Kenneth Love
At 04:42 AM 7/27/2007, Ali wrote: On Jul 26, 10:18 pm, Kenneth Love [EMAIL PROTECTED] wrote: Hello, I am new to Python, but not programming. I would like to start my Python career by developing programs according to the best practices of the industry. Right now, that appears to be unit

Re: Comparing Dictionaries

2007-07-27 Thread Steven D'Aprano
On Fri, 27 Jul 2007 14:11:02 -0500, Kenneth Love wrote: The published recipe (based on ConfigParser) did not handle my INI files. I have periods in both the section names and the key names. The INI files contents were developed according to an internally defined process that other non-Python

Comparing Dictionaries

2007-07-26 Thread Kenneth Love
Hello, I am new to Python, but not programming. I would like to start my Python career by developing programs according to the best practices of the industry. Right now, that appears to be unit tests, patterns, and source code control. So, I am trying to write a unit test for some code that

Re: Comparing Dictionaries

2007-07-26 Thread Ben Finney
Kenneth Love [EMAIL PROTECTED] writes: In other words, I consider these two dictionaries to be equivalent: { 'dog' : 'bone', 'cat' : 'fever', 'mouse' : 'mickey' } { 'mouse' : 'mickey', 'dog' : 'bone', 'cat' : 'fever' } while these two are not: { 'dog' : 'bone', 'cat' :

Comparing dictionaries, is this valid Python?

2005-12-13 Thread François Pinard
. Would someone know where I could find a confirmation that comparing dictionaries with `==' has the meaning one would expect (even this is debatable!), that is, same set of keys, and for each key, same values? -- François Pinard http://pinard.progiciels-bpi.ca -- http://mail.python.org/mailman

Re: Comparing dictionaries, is this valid Python?

2005-12-13 Thread Tim Peters
[François Pinard] ... Would someone know where I could find a confirmation that comparing dictionaries with `==' has the meaning one would expect (even this is debatable!), that is, same set of keys, and for each key, same values? Yes, look here wink: it has the meaning you expect, provided

Re: Comparing dictionaries, is this valid Python?

2005-12-13 Thread Peter Hansen
François Pinard wrote: As for: http://www.python.org/doc/2.3.5/lib/comparisons.html it only says Comparison operations are supported by all objects, which is a little vague, and no promise that comparisons are meaningful (for example, one might wonder what would exactly mean the

Re: Comparing dictionaries, is this valid Python?

2005-12-13 Thread François Pinard
[Peter Hansen] it only says Comparison operations are supported by all objects [...] I'm not checking the 2.3.5 version, but that latest one is fairly clear on what comparisons on mappings do: http://docs.python.org/ref/comparisons.html Yes, indeed. Thanks a lot! -- François Pinard

Re: Comparing dictionaries, is this valid Python?

2005-12-13 Thread Mike Meyer
François Pinard [EMAIL PROTECTED] writes: Would someone know where I could find a confirmation that comparing dictionaries with `==' has the meaning one would expect (even this is debatable!), that is, same set of keys, and for each key, same values? It may not exist, so you'll have to go look