Function that knows the names of its actual parameters
Stefan Franke
spamfranke at bigfoot.de
Sun Jun 18 17:22:36 EDT 2000
More information about the Python-list mailing list
Sun Jun 18 17:22:36 EDT 2000
- Previous message (by thread): Function that knows the names of its actual parameters
- Next message (by thread): Function that knows the names of its actual parameters
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Fri, 16 Jun 2000 13:20:59 -0700, "John W. Baxter" <jwbnews at scandaroon.com> wrote: >I would think that this method should point the way (you can have some >positional arguments as well, along with named keyword ones, plus the >catchall): > >>>> def m(**args): >... print args >... >>>> m(a=5, b='ten') >{'b': 'ten', 'a': 5} > Huh? Are we talking about the same thing? Keyword arguments either overwrite existing ones or supply new ones along with the call. What I am looking for is more or less (and arguably sensible) syntactic sugar for building a subdict of locals() given non-quoted variable names: magic(a, b, ...) <-> {"a": locals("a"), "b": locals("b"), ...} This is obviously not meaningful for expressions as arguments. I don't making this look like a function call is a good thing, but I do think the functionality is quite useful sometimes (Python, HTML, SQL, etc. generation...). even-though-I-don't-know-Perl-very-much-I'm-sure-it-has-a-special-syntax-for-that-kind-of-thing-ly y'rs Stefan
- Previous message (by thread): Function that knows the names of its actual parameters
- Next message (by thread): Function that knows the names of its actual parameters
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list