Give an error if the name being assigned was declared as final.
(name: str, info: TypeInfo, msg: MessageBuilder, ctx: Context)
| 657 | |
| 658 | |
| 659 | def check_final_member(name: str, info: TypeInfo, msg: MessageBuilder, ctx: Context) -> None: |
| 660 | """Give an error if the name being assigned was declared as final.""" |
| 661 | for base in info.mro: |
| 662 | sym = base.names.get(name) |
| 663 | if sym and is_final_node(sym.node): |
| 664 | msg.cant_assign_to_final(name, attr_assign=True, ctx=ctx) |
| 665 | |
| 666 | |
| 667 | def analyze_descriptor_access(descriptor_type: Type, mx: MemberContext) -> Type: |
no test coverage detected
searching dependent graphs…