summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Madden <jamadden@gmail.com>2017-12-18 10:29:49 -0600
committerJason Madden <jamadden@gmail.com>2017-12-18 11:20:07 -0600
commit222fe4acfca0bd102b9cd657754477e88318c2e8 (patch)
tree245ba386ca11f3ca9203c49251602821244ed862
parent57614e7d9bf7333dd404c553c43255a89a33d44d (diff)
downloadzope-i18n-222fe4acfca0bd102b9cd657754477e88318c2e8.tar.gz
Make InheritingDictionary override values.
-rw-r--r--CHANGES.rst8
-rw-r--r--setup.py2
-rw-r--r--src/zope/i18n/locales/inheritance.py11
3 files changed, 13 insertions, 8 deletions
diff --git a/CHANGES.rst b/CHANGES.rst
index 265f7a2..6754958 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -2,7 +2,7 @@
CHANGES
=========
-4.2.1 (unreleased)
+4.3.0 (unreleased)
==================
- Ensure that all files are properly closed when compiling .mo files,
@@ -24,7 +24,11 @@
KeyError when the ``week`` mapping contained an integer for
``firstDay`` as documented.
-- Reach 100% test coverage and maintain in through tox.ini and coveralls.io.
+- Reach 100% test coverage and maintain in through tox.ini and
+ coveralls.io.
+
+- Override ``values`` in ``InheritingDictionary``. Previously it
+ implemented a separate ``value`` method by mistake.
- Fix parsing times with a timezone. Previously it could raise a
``TypeError``.
diff --git a/setup.py b/setup.py
index cd137f4..51d3d5c 100644
--- a/setup.py
+++ b/setup.py
@@ -59,7 +59,7 @@ TESTS_REQUIRE = COMPILE_REQUIRES + ZCML_REQUIRES + [
setup(
name='zope.i18n',
- version='4.2.1.dev0',
+ version='4.3.0.dev0',
author='Zope Foundation and Contributors',
author_email='zope-dev@zope.org',
description='Zope Internationalization Support',
diff --git a/src/zope/i18n/locales/inheritance.py b/src/zope/i18n/locales/inheritance.py
index 62c99dc..0075b66 100644
--- a/src/zope/i18n/locales/inheritance.py
+++ b/src/zope/i18n/locales/inheritance.py
@@ -179,10 +179,9 @@ class InheritingDictionary(Inheritance, dict):
>>> list(locale.data.items())
[(1, 'eins'), (2, 'two'), (3, 'three')]
- We currently fail to override ``values``, but instead inherited
- data can be seen in the ``value`` method::
+ We also override ``values``::
- >>> sorted(locale.data.value())
+ >>> sorted(locale.data.values())
['eins', 'three', 'two']
"""
@@ -226,6 +225,8 @@ class InheritingDictionary(Inheritance, dict):
def keys(self):
return list(self._make_reified_inherited_dict().keys())
- def value(self):
- # XXX: Was this meant to override values() and is just a typo?
+ def values(self):
return list(self._make_reified_inherited_dict().values())
+
+ # Preserve the old name for compatibility
+ value = values