Confused about pep 318

Tor Iver Wilhelmsen tor.iver.wilhelmsen at broadpark.no
Thu Aug 5 16:23:23 EDT 2004


Peter Hansen <peter at engcorp.com> writes:

> And Java chose it based on what precedent?

It's own: It follows from their existing use in JavaDoc tags. Already,
some preprocessors (like one for DBC) used "custom" tags using this
syntax, though still inside JavaDoc comment blocks. Other extensions,
like Microsoft's J/Direct used for their deviating Java VM, also used
the syntax.

The new Java2SE 5.0 / JRE 1.5.0 annotations syntax puts them around
where their C# equivalent metadata mechanism is.

E.g. J2SE 5.0:

@ImplementsRequirement("B2")
public void adjustPrices(ArrayList<Price> prices) {
   //...
}

C# 2.0 (for the generics):

[ImplementsRequirement("B2")]
public void AdjustPrices(ArrayList<Price> prices) {
   // ...
}





More information about the Python-list mailing list