Skip to content
This repository has been archived by the owner. It is now read-only.

Fix error messages for calling __setitem__ on an immutable type #884

Merged
merged 1 commit into from Aug 2, 2018

Conversation

@patiences
Copy link
Contributor

@patiences patiences commented Jul 31, 2018

For example,

x = "abc"
x[0] = "d"

should result in a TypeError: 'str' object does not support item assignment. Currently it incorrectly throws an AttributeError. The proper behavior is already implemented in org/python/types/Tuple.java and org/python/types/Float.java (in the form of an overrided __setitem__ method that throws the right TypeError), hence why there are only tests and no code for those files.

Copy link
Member

@freakboy3742 freakboy3742 left a comment

👍

@freakboy3742 freakboy3742 merged commit d26e35d into beeware:master Aug 2, 2018
5 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants