Antoine Pitrou added the comment:

Indeed it's easy enough to call list() or set() on the result if you need it.

On the other hand, the problem with returning a dict view is that it makes the 
return type dependent on an implementation detail. Returning a simple iterator 
would be great, except that you can't as easily test it for emptiness.

So perhaps two methods are needed:
- a keys() method returning an iterator
- a has_keys() method returning a boolean

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue19172>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to