There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

frezik ,

Markdown seems to put it on one line, which has its own problems, but this is what it looks like in actual docs:

Argparse documentation

This is hardly even the worst offender; it gets worse as the number of internal class members goes up, since they all get listed out. This whole section should just be dropped in favor of simply listing the class name. Further down, there’s a bulleted list of the params, which is what you actually want.

In fact, there’s plenty more in that doc that could be fixed. For example:


<span style="color:#323232;">parser.add_argument('integers', metavar='N', type=int, nargs='+',
</span><span style="color:#323232;">                    help='an integer for the accumulator')
</span>

Too many parameters on each line. Do this instead:


<span style="color:#323232;">parser.add_argument(
</span><span style="color:#323232;">    'integers',
</span><span style="color:#323232;">    metavar = 'N',
</span><span style="color:#323232;">    type = int,
</span><span style="color:#323232;">    nargs = '+',
</span><span style="color:#323232;">    help = 'an integer for the accumulator'
</span><span style="color:#323232;">)
</span>

This also puts more whitespace around the key/value pairs, which gives your eyes more resting point. In general, erring on the side of additional whitespace around non-alphanum characters tends to improve readability.

This style can come into conflict with coding rules about max function length. The solution to that is to be flexible about max function length. I would rather see 40 simple lines than 10 with everything jammed up together.

Edit: interestingly, my Lemmy instance seems to handle syntax highlighting on the second add_argument example better than the first. That might just be the implementation, though; my vim setup seems to handle highlighting both equivalently.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • random
  • lifeLocal
  • goranko
  • All magazines