Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #87877
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <rosuav@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.004 |
| X-Spam-Evidence | '*H*': 0.99; '*S*': 0.00; 'assign': 0.07; 'attributes': 0.09; 'function,': 0.09; 'function:': 0.09; 'parameter': 0.09; 'subject:module': 0.09; 'cc:addr:python-list': 0.11; 'def': 0.12; '24,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'inclined': 0.16; 'lambda': 0.16; 'responses.': 0.16; 'do,': 0.16; 'wrote:': 0.18; 'all,': 0.19; 'module': 0.19; 'replacing': 0.19; 'cc:addr:python.org': 0.22; 'certainly': 0.24; 'cc:2**0': 0.24; 'possibly': 0.26; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'message- id:@mail.gmail.com': 0.30; 'are.': 0.31; 'probably': 0.32; "i'd": 0.34; 'could': 0.34; 'something': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'pm,': 0.38; 'simple': 0.61; 'first': 0.61; 'name': 0.63; 'worth': 0.66; 'mar': 0.68; '2015': 0.84; 'here)': 0.84; 'to:none': 0.92 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=RCkYeQuA3k0+GTqkIIMFY0iMGKFJKm1txReDwS1jG7w=; b=GkfKcwJ3dSQnJAYz/iFVetufmhmhZMZZbnLRUVzA2oJQPDSkYf2RYqG3Z3KCTfSsNM HzNXrUBrBhdU9FSJHYTPMeEeoOSeZMlEeAeXh8I4pOzgKTf4oExBPskSysIcrEj4qXnD KCWJ3pi71pZsSK4UTups4u8Edxlm2RcOWUNp16UjZXkwnhMC7CePqDzEyc4HwQFall0e PP95+Rq/j/1qG59NHZ0RTLj+h7POZ0z2+QZRbhInNnpiIJot6Ezu+u4XGTm8tM0ODxwl HraKX7/MUMduHw3TsYD7AgogrSGXSjUSwItBht9kZ4Qw4oTZAsklT8IJc3v84Kam1MBB UYZQ== |
| MIME-Version | 1.0 |
| X-Received | by 10.107.160.212 with SMTP id j203mr5162107ioe.43.1427192984726; Tue, 24 Mar 2015 03:29:44 -0700 (PDT) |
| In-Reply-To | <fg92halkvjecqedpogsmkov3o53f0i922b@4ax.com> |
| References | <fg92halkvjecqedpogsmkov3o53f0i922b@4ax.com> |
| Date | Tue, 24 Mar 2015 21:29:44 +1100 |
| Subject | Re: module attributes and docstrings |
| From | Chris Angelico <rosuav@gmail.com> |
| Cc | "python-list@python.org" <python-list@python.org> |
| Content-Type | text/plain; charset=UTF-8 |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.19 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.99.1427192988.10327.python-list@python.org> (permalink) |
| Lines | 21 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1427192988 news.xs4all.nl 2923 [2001:888:2000:d::a6]:43854 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:87877 |
Show key headers only | View raw
On Tue, Mar 24, 2015 at 7:55 PM, Mario Figueiredo <marfig@gmail.com> wrote:
> So things like the one below are something I got used to do, but that
> don't work after all, as I learned today:
>
> value_factory = lambda _, row: row[0]
> """Row factory. To be used with single-column queries."""
>
> There are other things I could possibly do, like turning that lambda
> into a function, or document attributes in the module docstring. They
> are fair responses.
They certainly are. Any time you assign a lambda function directly to
a simple name, it's probably worth replacing with a def function:
def value_factory(_, row):
"""Row factory. To be used with single-column queries."""
return row[0]
(Though I'd be inclined to give the first parameter a proper name here)
ChrisA
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
module attributes and docstrings Mario Figueiredo <marfig@gmail.com> - 2015-03-24 09:55 +0100
Re: module attributes and docstrings Chris Angelico <rosuav@gmail.com> - 2015-03-24 21:29 +1100
Re: module attributes and docstrings Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-03-24 22:49 +1100
Re: module attributes and docstrings Mario Figueiredo <marfig@gmail.com> - 2015-03-26 10:48 +0100
Re: module attributes and docstrings Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-03-27 18:31 +1100
Re: module attributes and docstrings Marko Rauhamaa <marko@pacujo.net> - 2015-03-27 09:49 +0200
Re: module attributes and docstrings Terry Reedy <tjreedy@udel.edu> - 2015-03-24 15:33 -0400
Re: module attributes and docstrings Mario Figueiredo <marfig@gmail.com> - 2015-03-26 10:53 +0100
Re: module attributes and docstrings Chris Angelico <rosuav@gmail.com> - 2015-03-26 21:27 +1100
csiph-web