View Single Post
Old 10-11-2022, 12:27 PM   #43
un_pogaz
Chalut o/
un_pogaz ought to be getting tired of karma fortunes by now.un_pogaz ought to be getting tired of karma fortunes by now.un_pogaz ought to be getting tired of karma fortunes by now.un_pogaz ought to be getting tired of karma fortunes by now.un_pogaz ought to be getting tired of karma fortunes by now.un_pogaz ought to be getting tired of karma fortunes by now.un_pogaz ought to be getting tired of karma fortunes by now.un_pogaz ought to be getting tired of karma fortunes by now.un_pogaz ought to be getting tired of karma fortunes by now.un_pogaz ought to be getting tired of karma fortunes by now.un_pogaz ought to be getting tired of karma fortunes by now.
 
un_pogaz's Avatar
 
Posts: 446
Karma: 672378
Join Date: Dec 2017
Device: Kobo
Yep. Sounds much better.

However, not sure if passing the named argument as an attribute is the best. I'd see more of a ctx.kwargs attribute to being able to process it as you wants.
Beyond the minor risk of collision in the future, using attributes means using getattr(ctx, 'name', default) which seems less elegant than ctx.kwargs as a dict, which can be used in a more dynamic way.
Unless it is usual in python to pass kwargs arguments as attributes for a class.
un_pogaz is offline   Reply With Quote