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-March/043691.html below:

[Python-Dev] PEP 318: Set attribs with .name = value

[Python-Dev] PEP 318: Set attribs with .name = value [Python-Dev] PEP 318: Set attribs with .name = valueAndrew Bennetts andrew-pythondev at puzzling.org
Tue Mar 30 06:39:39 EST 2004
On Tue, Mar 30, 2004 at 05:17:31AM -0600, Ka-Ping Yee wrote:
> Someone suggested the following syntax for setting function attributes:
> 
>     def func(arg, arg):
>         .author = 'Guido van Rossum'
>         .version = 42
> 
> Guido replied that he wanted to reserve ".name = value" for use in
> "with" blocks.
> 
> These two uses are not in conflict at all -- in fact, they are
> perfectly compatible and i find the syntactic consistency elegant.

Although this would not (I hope) be a common use-case, what would this code
mean:

    with foo:
        def func(arg):
            .attrib = value
            pass
            
?

I'm not entirely sure it's safe to say they don't conflict, although I don't
see this case as a serious problem.

-Andrew


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