unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH 1/1] nmbug-status: replace __values__() with values() in OrderedDict stub
@ 2014-02-18 18:34 Tomi Ollila
  2014-02-18 18:48 ` W. Trevor King
  2014-02-22  1:21 ` David Bremner
  0 siblings, 2 replies; 3+ messages in thread
From: Tomi Ollila @ 2014-02-18 18:34 UTC (permalink / raw)
  To: notmuch; +Cc: tomi.ollila

Python dict() object does not have __values__() function which
OrderedDict().values() (the stub provided in nmbug-status) could call
to provide ordered list of values. By renaming this thinko to
values() will make our stub work as expected -- dict items listed out
in order those were added to the dictionary.
---
 devel/nmbug/nmbug-status | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/devel/nmbug/nmbug-status b/devel/nmbug/nmbug-status
index ef7169a..6b2572c 100755
--- a/devel/nmbug/nmbug-status
+++ b/devel/nmbug/nmbug-status
@@ -41,7 +41,7 @@ if not hasattr(collections, 'OrderedDict'):  # Python 2.6 or earlier
             super(_OrderedDict, self).__setitem__(key, value)
             self._keys.append(key)
 
-        def __values__(self):
+        def values(self):
             for key in self._keys:
                 yield self[key]
 
-- 
1.8.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] nmbug-status: replace __values__() with values() in OrderedDict stub
  2014-02-18 18:34 [PATCH 1/1] nmbug-status: replace __values__() with values() in OrderedDict stub Tomi Ollila
@ 2014-02-18 18:48 ` W. Trevor King
  2014-02-22  1:21 ` David Bremner
  1 sibling, 0 replies; 3+ messages in thread
From: W. Trevor King @ 2014-02-18 18:48 UTC (permalink / raw)
  To: Tomi Ollila; +Cc: notmuch

[-- Attachment #1: Type: text/plain, Size: 441 bytes --]

On Tue, Feb 18, 2014 at 08:34:52PM +0200, Tomi Ollila wrote:
> -        def __values__(self):
> +        def values(self):

Looks good to me.  I'm not sure why I used __values__ in the first
place; probably just in the __ zone after __init__ and __setitem__.

Cheers,
Trevor

-- 
This email may be signed or encrypted with GnuPG (http://www.gnupg.org).
For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] nmbug-status: replace __values__() with values() in OrderedDict stub
  2014-02-18 18:34 [PATCH 1/1] nmbug-status: replace __values__() with values() in OrderedDict stub Tomi Ollila
  2014-02-18 18:48 ` W. Trevor King
@ 2014-02-22  1:21 ` David Bremner
  1 sibling, 0 replies; 3+ messages in thread
From: David Bremner @ 2014-02-22  1:21 UTC (permalink / raw)
  To: Tomi Ollila, notmuch; +Cc: tomi.ollila

Tomi Ollila <tomi.ollila@iki.fi> writes:

> Python dict() object does not have __values__() function which
> OrderedDict().values() (the stub provided in nmbug-status) could call
> to provide ordered list of values. By renaming this thinko to
> values() will make our stub work as expected -- dict items listed out
> in order those were added to the dictionary.

pushed, and it looks like it fixes the date ordering problem

d

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-02-22  1:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-18 18:34 [PATCH 1/1] nmbug-status: replace __values__() with values() in OrderedDict stub Tomi Ollila
2014-02-18 18:48 ` W. Trevor King
2014-02-22  1:21 ` David Bremner

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).