File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -136,22 +136,6 @@ make sure logging in Scapy remains helpful.
136136- If you are working on Scapy's core, you may use: ` scapy.error.log_loading `
137137 only while Scapy is loading, to display import errors for instance.
138138
139-
140- ### Python 2 and 3 compatibility
141-
142- The project aims to provide code that works both on Python 2 and Python 3. Therefore, some rules need to be applied to achieve compatibility:
143-
144- - byte-string must be defined as ` b"\x00\x01\x02" `
145- - exceptions must comply with the new Python 3 format: ` except SomeError as e: `
146- - lambdas must be written using a single argument when using tuples: use ` lambda x, y: x + f(y) ` instead of ` lambda (x, y): x + f(y) ` .
147- - use int instead of long
148- - use list comprehension instead of map() and filter()
149- - ` __bool__ = __nonzero__ ` must be used when declaring ` __nonzero__ ` methods
150- - ` __next__ = next ` must be used when declaring ` next ` methods in iterators
151- - ` StopIteration ` must NOT be used in generators (but it can still be used in iterators)
152- - ` io.BytesIO ` must be used instead of ` StringIO ` when using bytes
153- - ` __cmp__ ` must not be used.
154-
155139### Code review
156140
157141Maintainers tend to be picky, and you might feel frustrated that your
You can’t perform that action at this time.
0 commit comments