A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2004-April/044074.html below:

[Python-Dev] Re: PEP 318: Decorators last before colon

[Python-Dev] Re: PEP 318: Decorators last before colonSkip Montanaro skip at pobox.com
Mon Apr 5 12:58:22 EDT 2004
    >> One virtue of Guido's proposal is that it is basically what C#
    >> does. Java uses a pretty different syntax but it is also a prefix
    >> syntax. If Python uses a postfix syntax it will probably be alone in
    >> making that choice.

    Guido> That's exactly Jim Hugunin's argument for this syntax.

Since both C# and Java differ significantly in their typing from Python I
suspect what works well for those languages (they already have a lot of
declarative "baggage" because of their compile-time type checks, so what's a
few more declarations?) may not work as well for Python.

Second, Python has a strong tradition of borrowing what"works well" from
other languages.  I'm skeptical that C# has been around long enough to
suggest that its syntax "works well".  It's pretty clear that Microsoft is
going to ram that down most programmers' throats, so the C# user base is no
doubt going to be very large in a year or two.  If what you're looking for
is to provide a familiar syntactic base for C# refugees, then I suppose
that's fine, but from the examples I've seen, C# decorations (annotations?
attributes?) can be sprinkled quite liberally through the code (and serve as
much to obscure as to highlight what's going on).  A C# refugee might be
disappointed to see that Python's decorators are limited to class, function
and method declarations.  With that in mind, it doesn't seem to me that
partially mimicing C#'s decorator system is necessarily a good thing.

Skip

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4