Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AllPermissionsList.__iter__ returns tuple(). Should return iter(tuple())? #3073

Closed
dfee opened this issue Jun 5, 2017 · 0 comments
Closed

Comments

@dfee
Copy link

dfee commented Jun 5, 2017

My understanding is that iter should return an iterator object.

However, AllPermissionsList.__iter__ returns ().

Indeed, this raises a TypeError as expected:

In [1]: from pyramid.security import ALL_PERMISSIONS

In [2]: iter(ALL_PERMISSIONS)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-22-f8a3d5a1d337> in <module>()
----> 1 iter(ALL_PERMISSIONS)

TypeError: iter() returned non-iterator of type 'tuple'

Lastly, I don't see where this method is used in Pyramid. Should this code (the __iter__ method on AllPermissionsList) even exist?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant