Skip to content
This repository was archived by the owner on Feb 2, 2019. It is now read-only.
This repository was archived by the owner on Feb 2, 2019. It is now read-only.

Property validation in __init__ method makes conclision #23

@winkidney

Description

@winkidney

Hello bcj,
When i pass {'get': 'example'} to __init__ method, instance created, but i cant access dict key by getattr since __init__ method only add no-conflict key as instance property.

But when i user attrdict_instance.property = "example", it raise a key error.

The question is : this two place acts not the same way.(__init__ and setattr)

Dict has key get but i can't access it(if i haven't read source code , i wouldn't know how can i access it correctly.)

Would __init__ method raises a KeyError to tell user do not use reserved key-name when collision being caught be a better way?

Best wishes:)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions