| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| |
|
|
|
|
|
| |
codecs. (#1172)
These codecs were removed from the type restricted convenience methods on
`str`, `bytes`, and `bytearray` in Python 3.4 and produce inconsistent output
with their counterparts in `codecs`
|
| | |
|
| |
|
|
| |
This attribute has been removed in Python 3.
|
| |
|
|
| |
Unfortunately I forgot about this in f194bcd5b989ea03bf264572bac25326e7db1fe7
|
| |
|
|
|
|
| |
* Add a warning when declaring `__div__` or `__idiv__` in Python 2.
These methods are removed in Python 3 in favor of `__floordiv__` and `__truediv__`
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`__hash__`
I've been exploring transitioning our codebase to Python 3, and I've been using the immensely helpful `-3` flag
when running tests as described here:
https://docs.python.org/3/howto/pyporting.html#prevent-compatibility-regressions
Unfortunately, one of the most common issues I'm finding is around classes implementing `__eq__` but not
`__hash__`. The behavior around this changed in Python 3. See below:
```python
class JustEq(object):
def __init__(self, x):
self.x = x
def __eq__(self, other):
return self.x == other.x
class Neither(object):
def __init__(self, x):
self.x = x
class HashAndEq(object):
def __init__(self, x):
self.x = x
def __eq__(self, other):
return self.x == other.x
def __hash__(self):
return hash(self.x)
{Neither(1), Neither(2)} # OK
{HashAndEq(1), HashAndEq(2)} # OK
{JustEq(1), JustEq(2)} # Works in Python 2, throws in Python 3
as_set = {JustEq(1), JustEq(2)}
print(JustEq(1) in as_set) # prints False
print(JustEq(1) in list(as_set)) # prints True
```
In general this is bad practice for the reasons above, so I'd actually love to havet this warn
both as a general warning and as a Python 3 warning, but I don't see a clean way to have the same
rule apply in multiple contexts.
|
| | |
|
| |
|
|
|
| |
This was changed automatically in #894, but apparently
we need to have the copyright notice somewhere.
|
| | |
|
| |
|
|
|
|
|
|
| |
* Split words that were inadvertently glued together
* Fix typos in the documentation
* Fix typos in message descriptions
|
| |
|
|
|
|
|
|
|
|
| |
is disabled
Because the visit method was filtering the patterns it was expecting to be activated,
it didn't run when everything but one pattern was disabled, leading to spurious false
positives
Close #852
|
| |
|
|
|
|
|
|
|
| |
the latter stabilizes its API.
Currently astroid goes into a total revamp, having a couple of development branches with partially
incompatible APIs, which means that pylint can't rely on the exact location of has_known_bases
and safe_infer until astroid reaches a new major release. With this in mind, these two
functions are backported in pylint again.
|
| | |
|
| |
|
|
|
| |
Also, emit a PendingDeprecationWarning if the old names are still
used, this support being removed in pylint 2.0.
|
| |
|
|
|
|
|
| |
Also improve a couple of imports and added support for the
old visit_ names. Priority will have the old visit_ names, such
as visit_discard over visit_expr, visit_callfunc over visit_call
etc.
|
| |
|
|
| |
CallFunc.args.
|
| | |
|
| | |
|
| |
|
|
|
|
| |
This error is used when a star import is detected in another scope than the
module level, which is an error on Python 3. Using this will emit a
SyntaxWarning on Python 2.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
This warning is emitted when the `cmp` argument for the `list.sort` or `sorted builtin`
is encountered, since it was removed in Python 3. This is part of the issue #376.
|
| |
|
|
| |
This is actually used by the test, which aren't calling visit_module.
|
| | |
|
| |
|
|
|
| |
This fixes detection of missing __future__ imports when processing
multiple files.
|
| | |
|
| |
|
|
|
|
| |
dict accepts iterators, as much as set and list does.
This patch fixes this and adds tests for the other callables
for which we shouldn't emit.
|
| |
|
|
| |
caught by visit_callfunc.
|
| |
|
|
| |
implicit-map-evaluation
|
| | |
|
| |
|