← 返回事件
持续讨论AI发版

trunk/117c5e7e1e419f59715c79116722433cd9fe96d3: Anchor a property descriptor's guard source at the type (#197585)

发生了什么

object_generic_getattr computes one instance-anchored source and hands it to _resolve_descriptor_get for every kind of descriptor. That anchor is wrong for a property : the descriptor lives on the type, and PropertyVariable derives its fget source from it, so the guard reads L['obj'].attr.fget -- which evaluates the getter and then asks the resulting value for .fget : AttributeError: 'int' object has no attribute 'f…

摘要按规则整理自下方来源原文

为什么在扩散

来源