[文档]classAnnotationDictionary(DictionaryObject,ABC):def__init__(self)->None:from..generic._baseimportNameObject# /Rect should not be added here as Polygon and PolyLine can automatically set itself[NameObject("/Type")]=NameObject("/Annot")# The flags were NOT added to the constructor on purpose:# We expect that most users don't want to change the default.# If they do, they can use the property. The default is 0.@propertydefflags(self)->AnnotationFlag:returnself.get(NameObject("/F"),AnnotationFlag(0))@flags.setterdefflags(self,value:AnnotationFlag)->None:self[NameObject("/F")]=NumberObject(value)