diff options
| author | Claudiu Popa <cpopa@cloudbasesolutions.com> | 2015-01-03 23:47:16 +0200 |
|---|---|---|
| committer | Claudiu Popa <cpopa@cloudbasesolutions.com> | 2015-01-03 23:47:16 +0200 |
| commit | b23ba67c3567206beb02e6eef5337f52cf716849 (patch) | |
| tree | a7c23e71eb50e414174a1dbfc772c24049f64187 /test | |
| parent | 88ca291bcc6ebf1021699551a6a449700d70a017 (diff) | |
| download | pylint-git-b23ba67c3567206beb02e6eef5337f52cf716849.tar.gz | |
Fix a false positive with invalid-slots-objects and unicode strings. Closes issue #421.
Diffstat (limited to 'test')
| -rw-r--r-- | test/functional/assigning_non_slot.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/functional/assigning_non_slot.py b/test/functional/assigning_non_slot.py index df4777cf7..b80c32e08 100644 --- a/test/functional/assigning_non_slot.py +++ b/test/functional/assigning_non_slot.py @@ -86,3 +86,15 @@ class PropertyGood2(object): def __init__(self): self.test = 24 + +class UnicodeSlots(object): + """Using unicode objects in __slots__ is okay. + + On Python 3.3 onward, u'' is equivalent to '', + so this test should be safe for both versions. + """ + __slots__ = (u'first', u'second') + + def __init__(self): + self.first = 42 + self.second = 24 |
