On Tue, Sep 20, 2011 at 8:01 PM, Russell Keith-Magee < russ...@keith-magee.com> wrote:
> On Tue, Sep 20, 2011 at 8:18 PM, Daniel Moisset <dmois...@machinalis.com> > wrote: > > > > > > On Tue, Sep 20, 2011 at 8:23 AM, Florian Apolloner < > f.apollo...@gmail.com> > > wrote: > >> > >> Hi, > >> > >> a) Does this matter at all? I mean what's the difference? You ask if > they > >> are equal and if not you get an error ;) > > > > Other xUnit framework actually show an error message explicit about it, > > saying "expected 'foo', actual 'bar'". Python's unittest just says "foo > != > > bar". > > > > The difference is slightly more understandable error message when an > > equality test fails: you know what the actual result was supposed to be > > > >> > >> b) I think it's the wrong mailing list for design decisions python took… > > > > Or perhaps lack of design decision in this case? (I'm not sure it was > > intentional) > > It certainly wasn't intentionally reversed from the "convention"; it's > an artefact of Python's documentation not making the ordering > distinction, reinforced by the foo != bar output format that was > referred to. > > Should the examples be changed? For my money, I don't think it makes a > whole lot of sense to adopt a convention that isn't reinforced by > Python at a language level. > > For what it's worth, I also think the "convention" is bass ackwards... > you write "if variable == value", but you write "assertEqual(value, > variable)"? Where's the consistency in that? > > Yours, > Russ Magee %-) > > -- > You received this message because you are subscribed to the Google Groups > "Django developers" group. > To post to this group, send email to django-developers@googlegroups.com. > To unsubscribe from this group, send email to > django-developers+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-developers?hl=en. > > FWIW there was a thread either on python-dev, or maybe python-idea, or it might have been the Python ticket tracker, about officially stating a convention for (expected, actual) vs (actual, expected), the conclusion (IIRC) was that they weren't documenting a preference, but if there was one, it was (actual, expected). Alex -- "I disapprove of what you say, but I will defend to the death your right to say it." -- Evelyn Beatrice Hall (summarizing Voltaire) "The people's good is the highest law." -- Cicero -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com. To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.