Skip to content

Commit 35d82c2

Browse files
authored
Merge pull request #246 from INM-6/fix/nonetype_check
Updating check for NoneType by using "is" instead of "=="
2 parents 029534a + ad3c7ef commit 35d82c2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

neo/core/analogsignal.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -560,15 +560,15 @@ def time_slice(self, t_start, t_stop):
560560
'''
561561

562562
# checking start time and transforming to start index
563-
if t_start == None:
563+
if t_start is None:
564564
i = 0
565565
else:
566566
t_start = t_start.rescale(self.sampling_period.units)
567567
i = (t_start - self.t_start) / self.sampling_period
568568
i = int(np.rint(i.magnitude))
569569

570570
# checking stop time and transforming to stop index
571-
if t_stop == None:
571+
if t_stop is None:
572572
j = len(self)
573573
else:
574574
t_stop = t_stop.rescale(self.sampling_period.units)

0 commit comments

Comments
 (0)