File: python_style_guide.md

package info (click to toggle)
hexchat 2.14.3-6%2Bdeb11u1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 12,668 kB
  • sloc: ansic: 59,251; xml: 3,988; perl: 1,144; python: 879; cs: 589; cpp: 307; sh: 130; makefile: 34
file content (26 lines) | stat: -rw-r--r-- 451 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# HexChat Python Module Style Guide

(This is a work in progress).

## General rules

- PEP8 as general fallback recommendations
- Max line length: 120
- Avoid overcomplex compound statements. i.e. dont do this: `somevar = x if x == y else z if a == b and c == b else x`

## Indentation style

### Multi-line functions

```python
foo(really_long_arg_1,
    really_long_arg_2)
```

### Mutli-line lists/dicts

```python
foo = {
    'bar': 'baz',
}
```