KEMBAR78
Fix error message when assigning to read-only property by Michael0x2a · Pull Request #4863 · python/mypy · GitHub
Skip to content

Conversation

@Michael0x2a
Copy link
Collaborator

Fixes #4756

Consider the following program:

class Parent:
    @property
    def foobar(self) -> int: ...

class Child(Parent): pass

Child().foobar = 10

Previously, mypy would report that the property foobar was defined in 'Child'. Now, it correctly reports it was defined in 'Parent'.

Fixes python#4756

Consider the following program:

```python
class Parent:
    @Property
    def foobar(self) -> int: ...

class Child(Parent): pass

Child().foobar = 10
```

Previously, mypy would report that the property `foobar` was defined in
'Child'. Now, it correctly reports it was defined in 'Parent'.
@ilevkivskyi ilevkivskyi merged commit 3346cfa into python:master Apr 5, 2018
@Michael0x2a Michael0x2a deleted the fix-error-message-when-assigning-to-readonly-property branch April 11, 2018 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants