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

Make dict views behave like their unrestricted versions #147

Merged
merged 1 commit into from
Mar 13, 2024

Commits on Mar 13, 2024

  1. Make dict views behave like their unrestricted versions

    unlike the restricted versions, the unrestricted versions:
     - are not iterators, they are views
     - have a len
     - are false when the mapping is empty, true otherwise
     - are instances of collections.abc.MappingView
    
    This change aligns the behavior of restricted versions with the behavior
    of unrestricted one, while keeping the "guard", which validates the
    access with the security manager.
    
    During this refactoring, also change `.items()` to validate
    ach keys and values, like `.keys()` and `.values()` do.
    
    Co-authored-by: Dieter Maurer <d-maurer@users.noreply.github.com>
    perrinjerome and d-maurer committed Mar 13, 2024
    Configuration menu
    Copy the full SHA
    6722f7e View commit details
    Browse the repository at this point in the history