Skip to content

Commit

Permalink
Do not use empty list as parameter's default value. (#4397)
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxJPRey authored Mar 22, 2024
1 parent 0c940f8 commit 47c0e18
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
6 changes: 3 additions & 3 deletions pyaedt/application/Analysis3DLayout.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ def get_next_xtalk_list(self, trlist=[], tx_prefix=""):
return next

@pyaedt_function_handler()
def get_fext_xtalk_list(self, trlist=[], reclist=[], tx_prefix="", rx_prefix="", skip_same_index_couples=True):
def get_fext_xtalk_list(self, trlist=None, reclist=None, tx_prefix="", rx_prefix="", skip_same_index_couples=True):
"""Retrieve a list of all the far end XTalks from two lists of exctitations (driver and receiver).
Parameters
Expand Down Expand Up @@ -371,9 +371,9 @@ def get_fext_xtalk_list(self, trlist=[], reclist=[], tx_prefix="", rx_prefix="",
>>> oModule.GetAllPorts
"""
fext = []
if not trlist:
if trlist is None:
trlist = [i for i in self.excitations if tx_prefix in i]
if not reclist:
if reclist is None:
reclist = [i for i in self.excitations if rx_prefix in i]
for i in trlist:
for k in reclist:
Expand Down
9 changes: 2 additions & 7 deletions pyaedt/application/AnalysisNexxim.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,15 +526,10 @@ def get_fext_xtalk_list(self, trlist=None, reclist=None, tx_prefix="", rx_prefix
>>> oEditor.GetAllPorts
"""
if trlist == None:
trlist = []
if reclist == None:
reclist = []

fext = []
if not trlist:
if trlist is None:
trlist = [i for i in list(self.excitations.keys()) if tx_prefix in i]
if not reclist:
if reclist is None:
reclist = [i for i in list(self.excitations.keys()) if rx_prefix in i]
for i in trlist:
for k in reclist:
Expand Down

0 comments on commit 47c0e18

Please sign in to comment.