summaryrefslogtreecommitdiffstats
path: root/Lib/collections
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2013-05-18 00:14:27 (GMT)
committerRaymond Hettinger <python@rcn.com>2013-05-18 00:14:27 (GMT)
commit4e0172fd9acf7c5e8f30905fc997f904adbe562f (patch)
tree4b3d9a89af022af0b132a00e73d41fb24a63f36d /Lib/collections
parent8c03d832b33e02b575b78d53406a3f1ee2706f8d (diff)
downloadcpython-4e0172fd9acf7c5e8f30905fc997f904adbe562f.zip
cpython-4e0172fd9acf7c5e8f30905fc997f904adbe562f.tar.gz
cpython-4e0172fd9acf7c5e8f30905fc997f904adbe562f.tar.bz2
Deprecate nametuple._asdict()
Diffstat (limited to 'Lib/collections')
-rw-r--r--Lib/collections/__init__.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/collections/__init__.py b/Lib/collections/__init__.py
index 5fd54e8..24daa34 100644
--- a/Lib/collections/__init__.py
+++ b/Lib/collections/__init__.py
@@ -280,6 +280,9 @@ class {typename}(tuple):
'''Return a new OrderedDict which maps field names to their values.
This method is obsolete. Use vars(nt) or nt.__dict__ instead.
'''
+ import warnings
+ warnings.warn('_asdict() is deprecated. Use vars(nt) instead.',
+ DeprecationWarning, stacklevel=2)
return self.__dict__
def __getnewargs__(self):