0

In the code of spaCy (e.g. in the token.pyx file) the syntax property my_property: is used frequently. Specific examples in that file are property lemma: (line 353), property is_sent_start: (line 484) and property is_sent_end: (line 511).

While there is already a post discussing the difference (or rather the equality) of "@property" and "property()", I could nowhere find any description of the use of "property" as in property my_property:. I also looked at the official python documentation but couldn't find what I am looking for.

Can someone explain what property my_property: means and what it does and how it is different from @property?

Thanks

scicos88
  • 53
  • 3
  • 2
    Your problem is looking at python docs, while this is cython. https://cython.readthedocs.io/en/latest/src/userguide/extension_types.html#properties "There is also a special (deprecated) legacy syntax for defining properties in an extension class" – h4z3 Jun 21 '22 at 08:53
  • Perfect, thank you. So I understand there is no difference between ```property my_property:``` and ```@property``` except for the facts that (a) the former only exists in Cython and (b) that the former is depricated. But any overriding in subclasses etc. would all work the same between the two? – scicos88 Jun 21 '22 at 09:17

0 Answers0