CINXE.COM
Mailman 3 Re: [Python-Dev] 2.4a2, and @decorators - Python-Dev - python.org
<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="ROBOTS" content="INDEX, FOLLOW" /> <title>Mailman 3 Re: [Python-Dev] 2.4a2, and @decorators - Python-Dev - python.org </title> <meta name="author" content="" /> <meta name="dc.language" content="en" /> <link rel="shortcut icon" href="/static/hyperkitty/img/favicon.ico" /> <link rel="stylesheet" href="/static/hyperkitty/libs/jquery/smoothness/jquery-ui-1.13.1.min.css" type="text/css" media="all" /> <link rel="stylesheet" href="/static/hyperkitty/libs/fonts/font-awesome/css/font-awesome.min.css" type="text/css" media="all" /> <link rel="stylesheet" href="/static/CACHE/css/output.07067ad77a36.css" type="text/css" media="all"><link rel="stylesheet" href="/static/CACHE/css/output.e68c4908b3de.css" type="text/css"><link rel="stylesheet" href="/static/CACHE/css/output.3e1fcd906323.css" type="text/css" media="all"> </head> <body> <nav class="navbar sticky-top navbar-expand-md mb-2" id="navbar-main"> <div class="container-xxl"> <div class="navbar-header"> <!--part of navbar that's always present--> <button type="button" class="navbar-toggler collapsed" data-bs-toggle="collapse" data-bs-target=".navbar-collapse"> <span class="fa fa-bars"></span> </button> <a class="navbar-brand" href="/archives/">Mailman 3 python.org</a> </div> <!-- /navbar-header --> <div class="d-flex"> <div class="auth dropdown d-md-none"> </div> <a href="/accounts/login/?next=/archives/list/python-dev%40python.org/message/P3JD24UFFPZUUDANOAI6GZAPIGY4CVK7/" class="nav-link d-md-none"> <span class="fa fa-sign-in"></span> Sign In </a> <a href="/accounts/signup/?next=/archives/list/python-dev%40python.org/message/P3JD24UFFPZUUDANOAI6GZAPIGY4CVK7/" class="nav-link d-md-none"> <span class="fa fa-user-plus"></span> Sign Up </a> </div> <div class="navbar-collapse collapse justify-content-end"> <!--part of navbar that's collapsed on small screens--> <!-- show dropdown for smaller viewports b/c login name/email may be too long --> <!-- only show this extra button/dropdown if we're in small screen sizes --> <a href="/mailman3/lists/python-dev.python.org/" class="nav-link"> <span class="fa fa-cog"></span> Manage this list </a> <a href="/accounts/login/?next=/archives/list/python-dev%40python.org/message/P3JD24UFFPZUUDANOAI6GZAPIGY4CVK7/" class="nav-link d-none d-md-block"> <span class="fa fa-sign-in"></span> Sign In </a> <a href="/accounts/signup/?next=/archives/list/python-dev%40python.org/message/P3JD24UFFPZUUDANOAI6GZAPIGY4CVK7/" class="nav-link d-none d-md-block"> <span class="fa fa-user-plus"></span> Sign Up </a> <form name="search" method="get" action="/archives/search" class="navbar-form navbar-right my-2 my-lg-2 ms-2" role="search"> <input type="hidden" name="mlist" value="python-dev@python.org" /> <div class="input-group"> <input name="q" type="text" class="form-control rounded-4 search" placeholder="Search this list" aria-label="Search this list" /> <button class="btn search-button" aria-label="Search"><span class="fa fa-search"></span></button> </div> </form> <!-- larger viewports --> <ul class="nav navbar-nav auth d-none d-md-flex"> </ul> </div> <!--/navbar-collapse --> </div><!-- /container for navbar --> </nav> <div class="modal fade" tabindex="-1" role="dialog" id="keyboard-shortcuts"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> <h4 class="modal-title">Keyboard Shortcuts</h4> </div> <div class="modal-body"> <h3>Thread View</h3> <ul> <li><code>j</code>: Next unread message </li> <li><code>k</code>: Previous unread message </li> <li><code>j a</code>: Jump to all threads <li><code>j l</code>: Jump to MailingList overview </ul> </div> </div><!-- /.modal-content --> </div><!-- /.modal-dialog --> </div><!-- /.modal --> <div class="container-xxl" role="main"> <div class="row"> <div class="col-12 col-md-10"> <div class="message-header row"> <div class="col-tn-2 message-back"> <a href="/archives/list/python-dev@python.org/thread/KKAU7Y22V2O7LB4IMIFOL64LYRTRYQZB/#P3JD24UFFPZUUDANOAI6GZAPIGY4CVK7"> <span class="fa fa-chevron-left icon"></span> <span class="d-none d-md-inline hidden-tn hidden-xs">thread</span> </a> </div> <div class="col-10"> <h1>Re: [Python-Dev] 2.4a2, and @decorators</h1> </div> </div> <div class="row"> <div class="col-lg-9"> <section id="thread-content"> <div class="email email-first"> <div id="P3JD24UFFPZUUDANOAI6GZAPIGY4CVK7" class="email-header"> <div class="gravatar-wrapper d-flex"> <div class="gravatar circle"> <img class="gravatar" src="https://secure.gravatar.com/avatar/047f2332cde3730f1ed661eebb0c5686.jpg?s=120&d=mm&r=g" width="120" height="120" alt="" /> </div> <div class="email-author d-flex"> <h2 class="name"> <a href="/archives/users/4b924b2124224c7d8d071e487deb4fd1/" title="See the profile for Guido van Rossum" >Guido van Rossum</a> </h2> </div> </div> <div class="email-date right"> <span class="date"> Aug. 3, 2004 </span> <div class="time"> <span title="Sender's time: Aug. 3, 2004, 7:40 a.m.">2:40 p.m.</span> </div> </div> </div> <!-- /email-header: gravatar, author-info, date, peramlink, changed_subject --> <div class="email-body "> <div class="quoted-switch"><a href="#">...</a></div><blockquote class="blockquote quoted-text"><p>The only real necessary restriction on the @ operator is that its argument be callable and take a single argument. Many expressions could return a callable object. Why not let them? Is it really worth having a special case just to SyntaxError expressions that sometimes won't result in an appropriate callable?</p> <p>Things someone might want to do, ordered roughly from most reasonable to least reasonable ;) @foo().bar() @foo or bar @mydecorators['foo'] @lambda f: foo(f) or bar(f)</p> <p>Why disallow these forms? It seems quite difficult, especially, to explain why the first one does not, or should not, work.</p> </blockquote><p>I have a gut feeling about this one. I'm not sure where it comes from, but I have it. It may be that I want the compiler to be able to recognize certain decorators. So while it would be quite easy to change the syntax to @test in the future, I'd like to stick with the more restricted form unless a real use case is presented where allowing @test would increase readability. (@foo().bar() doesn't count because I don't expect you'll ever need that). --Guido van Rossum (home page: <a target="_blank" href="http://www.python.org/~guido/">http://www.python.org/~guido/</a>)</p> </div> <div class="email-info"> <div class="likeform-wrapper right"> <div class="messagelink pull-right"> <button class="toggle-font btn btn-sm" title="Display in fixed font" data-bs-toggle="tooltip" data-placement="bottom"> <i class="fa fa-font"></i> </button> <a href="/archives/list/python-dev@python.org/message/P3JD24UFFPZUUDANOAI6GZAPIGY4CVK7/" title="Permalink for this message" data-bs-toggle="tooltip" data-placement="bottom"><i class="fa fa-link"></i></a> </div> <form method="post" class="likeform" action="/archives/list/python-dev@python.org/message/P3JD24UFFPZUUDANOAI6GZAPIGY4CVK7/vote"> <input type="hidden" name="csrfmiddlewaretoken" value="JTvwXojfAr8GdGrVpwYXkvm8Sb2bnBWAo4A03NfAOOvIn5o7M438Qunm9hLbYd4L"> <a class="youlike vote disabled" title="You must be logged-in to vote." href="#like" data-vote="1" aria-label="Like thread"> <i class="fa fa-thumbs-o-up"></i> 0 </a> <a class="youdislike vote disabled" title="You must be logged-in to vote." href="#dislike" data-vote="-1" aria-label="Dislike thread"> <i class="fa fa-thumbs-o-down"></i> 0 </a> </form> </div> <!-- Reply link --> <a class="reply reply-mailto" title="Reply" href="#"> <i class="fa fa-reply"></i> Reply </a> <!-- Attachments --> <!-- Reply form --> <div class="reply-form-unauthenticated"> <a class="btn btn-sm btn-primary" href="/accounts/login/?next=/archives/list/python-dev%40python.org/message/P3JD24UFFPZUUDANOAI6GZAPIGY4CVK7/#"> Sign in to reply online </a> <a class="btn btn-sm btn-secondary reply-mailto" href="mailto:python-dev@python.org?Subject=Re%3A%20%5BPython-Dev%5D%202.4a2%2C%20and%20%40decorators&In-Reply-To=<200408031440.i73Ee6V30875%40guido.python.org>" >Use email software</a></li> </div> </div> </div> </section> </div> <div class="col-lg-3"> <!-- right column --> <section id="message-overview-info"> <p> <a href="/archives/list/python-dev@python.org/thread/KKAU7Y22V2O7LB4IMIFOL64LYRTRYQZB/#P3JD24UFFPZUUDANOAI6GZAPIGY4CVK7"> <i class="fa fa-fw fa-comments"></i> <span class="hidden-tn hidden-xs">Back to the thread</span> </a> </p> <p> <a href="/archives/list/python-dev@python.org/"> <i class="fa fa-fw fa-envelope-o"></i> Back to the list </a> </p> </section> </div> </div> </div> </div> </div> <!-- /container for content --> <footer class="footer"> <div class="container"> <p class="text-muted"> <img class="logo" alt="HyperKitty" src="/static/hyperkitty/img/logo.png" /> Powered by <a href="http://hyperkitty.readthedocs.org">HyperKitty</a> version 1.3.12. </p> </div> </footer> <script src="/static/hyperkitty/libs/jquery/jquery-3.6.0.min.js"></script> <script src="/static/hyperkitty/libs/jquery/jquery-ui-1.13.1.min.js"></script> <script src="/static/CACHE/js/output.3aaa7705d68a.js"></script> <script> // Add the .js-enabled class to the body so we can style the elements // depending on whether Javascript is enabled. $(document).ready(function(){ $("body").addClass("js-enabled"); $(".gravatar").addClass("rounded-circle"); }); </script> </body> </html>