File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -164,14 +164,7 @@ def add_item(
164164 TypeError
165165 A :class:`ViewItem` was not passed.
166166 """
167- if (
168- before is not None
169- and after is not None
170- or before is not None
171- and (index is not None )
172- or after is not None
173- and (index is not None )
174- ):
167+ if sum (x is not None for x in (before , after , index )) > 1 :
175168 raise ValueError ("Can only specify one of before, after, and index." )
176169
177170 if not isinstance (item , (Select , Button )):
Original file line number Diff line number Diff line change @@ -180,14 +180,7 @@ def add_item(
180180 TypeError
181181 A :class:`ViewItem` was not passed.
182182 """
183- if (
184- before is not None
185- and after is not None
186- or before is not None
187- and (index is not None )
188- or after is not None
189- and (index is not None )
190- ):
183+ if sum (x is not None for x in (before , after , index )) > 1 :
191184 raise ValueError ("Can only specify one of before, after, and index." )
192185
193186 if not isinstance (item , ViewItem ):
Original file line number Diff line number Diff line change @@ -170,14 +170,7 @@ def add_item(
170170 ValueError
171171 Maximum number of items has been exceeded (3).
172172 """
173- if (
174- before is not None
175- and after is not None
176- or before is not None
177- and (index is not None )
178- or after is not None
179- and (index is not None )
180- ):
173+ if sum (x is not None for x in (before , after , index )) > 1 :
181174 raise ValueError ("Can only specify one of before, after, and index." )
182175
183176 if len (self .items ) >= 3 :
Original file line number Diff line number Diff line change @@ -960,14 +960,7 @@ def add_item(
960960 ValueError
961961 Maximum number of items has been exceeded (40)
962962 """
963- if (
964- before is not None
965- and after is not None
966- or before is not None
967- and (index is not None )
968- or after is not None
969- and (index is not None )
970- ):
963+ if sum (x is not None for x in (before , after , index )) > 1 :
971964 raise ValueError ("Can only specify one of before, after, and index." )
972965
973966 if len (self ) >= self .MAX_ITEMS :
You can’t perform that action at this time.
0 commit comments