Skip to content

MultiObj has unnecessary special case where a single mapping input is given. #46

Description

@andeaseme

This special case is already handled by the named kwargs and is unclear what functionality this adds.

input = {'this': [1], 'that': [1, 2]}
MultiObj(input) == MultiObj(**input)

This prevents another special case where the input is a single unnamed obj of type mapping. The following example does not enter or exit.

class Store(dict):
    def __enter__(self):
        print('enter')
        return self

    def __exit__(self, exc_type, exc_val, exc_tb):
        print('exit')

store = Store()
with ContextFanout(store):
    pass

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions