What is the proper way to format a multi-line dict in Python?

后端 未结 7 1491
天命终不由人
天命终不由人 2020-11-29 16:19

In Python, I want to write a multi-line dict in my code. There are a couple of ways one could format it. Here are a few that I could think of:

  1. mydic         
    
    
            
7条回答
  •  余生分开走
    2020-11-29 16:43

    Usually, if you have big python objects it's quite hard to format them. I personally prefer using some tools for that.

    Here is python-beautifier - www.cleancss.com/python-beautify that instantly turns your data into customizable style.

提交回复
热议问题