Closed graingert closed 4 years ago
@benjaminp any thoughts on this?
@benjaminp any thoughts on this?
Thank you for the PR. As I said in https://github.com/benjaminp/six/pull/296#issuecomment-546179264, I don't want to complicate view*
for this, especially since there's no way to view dict proxy's on Python 2.
Thank you for the PR. As I said in #296 (comment), I don't want to complicate
view*
for this, especially since there's no way to view dict proxy's on Python 2.
But it does work for dictproxy, you just use the collections.*View
Sorry, I meant a method on the type.
I'd like you to reconsider, because it makes it much easier to use six.viewitems everywhere it would also be supported in Py3 (eg class Foo(object): ...; six.viewitems(vars(Foo))
and much easier to produce safe automated transforms when upgrading a py2 codebase to py3
I'd like you to reconsider,
I've already considered it twice.
because it makes it much easier to use six.viewitems everywhere it would also be supported in Py3 (eg
class Foo(object): ...; six.viewitems(vars(Foo))
and much easier to produce safe automated transforms when upgrading a py2 codebase to py3
What automated transform? If the Python 2 code is doing something.viewitems()
, then it already doesn't work it dict proxies. If it's doing something.iteritems()
, six.iteritems(something)
will work fine.
@benjaminp I think this fixes the issues with my previous attempt