On Sat, 2023-09-16 at 13:16 +0100, Dima Pasechnik wrote:
> Isn't it true that the above may be simplified, removing foo=bar from
> @options() and putting this in the function definition, i.e.
> 

AFAIK it's just dictionary unpacking that happens by default. You can
already create your own options list for functions that take keyword
arguments,

  sage: def foo(x=None, y=None):
  ....:     print(x, y)
  ....: 
  sage: foo_options = {"x": "hello,", "y": "world!"}
  sage: 
  sage: foo(**foo_options)
  hello, world!

but you have to remember to pass the options yourself whenever you call
foo().

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/d2a5ce1d8edbd0b971bf048f6d5afffef5f72250.camel%40orlitzky.com.

Reply via email to