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

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

Merged
merged 1 commit into from Aug 2, 2018

Conversation

Projects
None yet
2 participants
@patiences
Contributor

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.

@freakboy3742

👍

@freakboy3742 freakboy3742 merged commit d26e35d into pybee:master Aug 2, 2018

5 checks passed

beekeeper:0/beefore:javacheckstyle Java lint checks passed.
Details
beekeeper:0/beefore:pycodestyle Python lint checks passed.
Details
beekeeper:1/smoke-test Smoke build (Python 3.4) passed.
Details
beekeeper:2/full-test:py3.5 Python 3.5 tests passed.
Details
beekeeper:2/full-test:py3.6 Python 3.6 tests passed.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment