Skip to content

Commit dfb307f

Browse files
author
Kevin J Walters
committed
Alternative method of shutting up pylint when instance variables are set with properties based on @tannewt feedback from adafruit#9. adafruit#3.
1 parent 4ce502c commit dfb307f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

adafruit_midi/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ def __init__(self, midi_in=usb_midi.ports[0], midi_out=usb_midi.ports[1], *,
7979
in_channel=None, out_channel=0, in_buf_size=30, debug=False):
8080
self._midi_in = midi_in
8181
self._midi_out = midi_out
82+
self._in_channel = in_channel # dealing with pylint inadequacy
8283
self.in_channel = in_channel
84+
self._out_channel = out_channel # dealing with pylint inadequacy
8385
self.out_channel = out_channel
8486
self._debug = debug
8587
# This input buffer holds what has been read from midi_in
@@ -97,7 +99,6 @@ def in_channel(self):
9799
Default is None."""
98100
return self._in_channel
99101

100-
# pylint: disable=attribute-defined-outside-init
101102
@in_channel.setter
102103
def in_channel(self, channel):
103104
if channel is None or (isinstance(channel, int) and 0 <= channel <= 15):
@@ -115,7 +116,6 @@ def out_channel(self):
115116
``out_channel = 3`` will send to MIDI channel 4. Default is 0 (MIDI channel 1)."""
116117
return self._out_channel
117118

118-
# pylint: disable=attribute-defined-outside-init
119119
@out_channel.setter
120120
def out_channel(self, channel):
121121
if not 0 <= channel <= 15:

0 commit comments

Comments
 (0)