A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2004-October/049476.html below:

[Python-Dev] ConfigParser shootout, preliminary entry

[Python-Dev] ConfigParser shootout, preliminary entryJosiah Carlson jcarlson at uci.edu
Tue Oct 19 00:01:23 CEST 2004
>   This breaks down for the perfectly reasonable case of:
> 
>     hostname = Value("foo")
> 
>     class First(Container):
>         port = Value(64)
>         hostname = hostname
>         username = Value("zoop")
> 
>     class Second(Container):
>         username = Value("pooz")
>         hostname = hostname
>         port = Value(24)
> 
>   ie, it breaks down as soon as you try to re-use anything, which is
> quite surprising to the unsuspecting user, and pretty unfortunate even
> once you do understand why.


So you use...

hostname = "foo"

class First(Container):
    port = Value(36)
    hostname = Value(hostname)
    username = Value("zoop")

...

As long as the documentation describes the proper semantics if one cares
about orderings (create new TypedAttrribute instance for every value),
when anyone asks, a quick "read the documentation page" would be
sufficient.

One could also explain why the hoops are to be jumped through in the
first place (dict non-ordering during class instantiation).



 - Josiah

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