Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #103125

Re: Question on keyword arguments

From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Subject Re: Question on keyword arguments
Date 2016-02-19 02:45 +1100
Message-ID <mailman.8.1455810339.2289.python-list@python.org> (permalink)
References <62136715E19142B6B318EA3A3DF04D40@OPTIPLEX990> <na4kut$ru8$1@ger.gmane.org> <7278ec3f250548b192ce2d95c6fa07c5@seaexchmbx03.olympus.F5Net.com>

Show all headers | View raw


On Fri, Feb 19, 2016 at 2:39 AM, Dan Strohl <D.Strohl@f5.com> 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

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Question on keyword arguments Chris Angelico <rosuav@gmail.com> - 2016-02-19 02:45 +1100

csiph-web