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/2012-May/119411.html below:

[Python-Dev] sys.implementation

[Python-Dev] sys.implementation [Python-Dev] sys.implementationLarry Hastings larry at hastings.org
Thu May 10 02:47:49 CEST 2012
On 05/09/2012 09:53 AM, Barry Warsaw wrote:
> On May 09, 2012, at 11:09 AM, Brett Cannon wrote:
>
>> Sure, but couldn't we define this "empty" class in C code so that you can
>> use the C API with it as well and just provide a C function to get a new
>> instance?
> +1
>
> ISTM to be a companion to collections.namedtuple.  IWBNI this new type was
> also exposed in the collections module.

I like Alex Martelli's approach, which I recall was exactly this:

    class namespace:
         def __init__(**kwargs):
             self.__dict__ = kwargs


That means all the initializers you pass in to the constructor get 
turned into members.


//arry/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20120509/53bfed25/attachment.html>
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