我知道Python字典键中可以有空格,但这被认为是不好的编程吗?我在百事可乐里找不到任何关于这个的东西。
编辑以进行澄清:
在我正在做的一个项目中,我正在做一些分析Apache的mod_status(见下面的示例输出)的记分板输出的工作,我只是想找出最佳实践。我最后应该这样做吗:workers = {'W': 1,
'_': 9,
...}
或者这个:workers = {'Sending Reply': 1,
'Waiting for Connection': 9,
...}
示例mod_status输出:_....___W____._.................................................
................................................................
................................................................
................................................................
Scoreboard Key:
"_" Waiting for Connection, "S" Starting up, "R" Reading Request,
"W" Sending Reply, "K" Keepalive (read), "D" DNS Lookup,
"C" Closing connection, "L" Logging, "G" Gracefully finishing,
"I" Idle cleanup of worker, "." Open slot with no current process