Path: csiph.com!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail From: Newsgroups: comp.lang.python Subject: Re: Question on keyword arguments Date: Thu, 18 Feb 2016 10:57:31 -0500 Lines: 30 Message-ID: References: <62136715E19142B6B318EA3A3DF04D40@OPTIPLEX990> <7278ec3f250548b192ce2d95c6fa07c5@seaexchmbx03.olympus.F5Net.com> Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de +4835SOt9JSul+DI0jNb2wDplpVYBjFdi9RL13I10U0g== Return-Path: 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; 'subject:Question': 0.05; 'list?': 0.07; 'cc:addr:python-list': 0.09; 'collections': 0.09; 'thursday,': 0.13; 'def': 0.13; 'message-----': 0.15; '10:45': 0.16; '2016': 0.16; "format'": 0.16; 'interest,': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'subclassing': 0.16; 'tim,': 0.16; 'wrote:': 0.16; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'arguments': 0.22; 'object.': 0.22; 'cc:no real name:2**0': 0.22; 'am,': 0.23; 'help.': 0.23; 'feb': 0.23; 'import': 0.24; 'header:In-Reply-To:1': 0.24; 'chris': 0.26; 'define': 0.27; 'fri,': 0.27; 'question': 0.27; "skip:' 10": 0.28; 'dan': 0.29; 'url:mailman': 0.30; 'skip:_ 10': 0.32; 'received:10.0.0': 0.32; 'returned': 0.32; 'class': 0.33; 'url:python': 0.33; 'skip:- 10': 0.34; 'url:listinfo': 0.34; "skip:' 20": 0.34; 'received:10.0': 0.34; 'so,': 0.35; 'sent:': 0.35; 'cc:': 0.35; 'subject:': 0.35; 'url:org': 0.36; 'email addr:python.org': 0.36; 'keyword': 0.36; 'subject:: ': 0.37; 'received:10': 0.37; 'thanks': 0.37; 'why': 0.39; 'from:': 0.39; 'rather': 0.39; 'url:mail': 0.40; 'from:no real name:2**0': 0.60; 'email name:python-list': 0.67; 'received:38': 0.81; '...and': 0.84; 'chrisa': 0.84; 'received:38.111': 0.84 X-Scanner-Info: Cloudmark - http://www.cloudmark.com X-CNFS-Analysis: v=2.1 cv=U+Zvdrfu c=1 sm=1 tr=0 a=wmZXJE1MrsZYcnKSeUNejA==:117 a=wmZXJE1MrsZYcnKSeUNejA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=8nJEP1OIZ-IA:10 a=8AHkEIZyAAAA:8 a=n2LCcfabAAAA:8 a=bVvT94F8XXIL8JpusCwA:9 a=wPNLvfGTeEIA:10 X-CMAE-Score: 0.00 X-Scanned-by: CMAE X-AUTH-ID: grsmith@atlanticbb.net In-Reply-To: X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 15.4.3555.308 X-MimeOLE: Produced By Microsoft MimeOLE V15.4.3555.308 X-CMAE-Envelope: MS4wfL3LTmAsCB0hkM3/HpmVcNsiQ4D1U4Q06kMB1OANm7RhDBwcjGVNporFfVCER5b3ofFj7x8nl8ozQG2P1XBrLNWtoZZW2pMc4RD5U38l9zOj+Hdkw5XBHjhIHZXqrY7C0Ot+3CNg1M3kDLMr+LgZbcyl+TYMhIZjMF8kkCTXAtyn80+IGA0mABhhvwvnakH7zVNmloqs7+dk9sHGfxNOV4E= X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21rc2 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:103129 Thanks to all who responded, it is a big help. Tim, the 'crazy-other-result format' is the result returned by the database, nothing I can do about that :) Thanks again George -----Original Message----- From: Chris Angelico Sent: Thursday, February 18, 2016 10:45 AM Cc: python-list@python.org Subject: Re: Question on keyword arguments On Fri, Feb 19, 2016 at 2:39 AM, Dan Strohl wrote: > So, define a return object like: > > from collections import UserList > class TestResponse(UserList): > def __str__(self): > return '\0xfe%s' % '\0xfe'.join(self.data) > > ...and return that object. Out of interest, why UserList rather than simply subclassing list? ChrisA -- https://mail.python.org/mailman/listinfo/python-list