gstein commented on code in PR #55:
URL: https://github.com/apache/steve/pull/55#discussion_r2479956607


##########
v3/server/pages.py:
##########
@@ -89,11 +89,22 @@ async def basic_info():
 #    async def flash_FOO(message)
 # where FOO is one of the eight Bootstrap alert classes. See:
 #    https://getbootstrap.com/docs/5.0/components/alerts/#examples
-for _cat in ('primary', 'secondary', 'success', 'danger',
-             'warning', 'info', 'light', 'dark', ):
-    globals()[f'flash_{_cat}'] = functools.partial(quart.flash, category=_cat)
-del _cat
-
+async def flash_primary(message):
+    await quart.flash(message, category='primary')

Review Comment:
   I don't think we need to mindlessly follow what a linter says, when the code 
is correct. Unrolling the loop makes things more obvious for readers, so that 
is a solid change.
   
   You suggested using "ruff" elsewhere. What does that say about the one-line 
version? Does it track properly?
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to