You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While trying to debug something of my own, I found your apply transforms code contains the following
# NO CLUE WHAT THIS DOES OR WHY IT'S NEEDED
for jj in range(len(myargs)):
if myargs[jj] is not None:
if myargs[jj] == '-':
myargs2 = [None]*(len(myargs)-1)
myargs2[:(jj-1)] = myargs[:(jj-1)]
myargs2[jj:(len(myargs)-1)] = myargs[(jj+1):(len(myargs))]
myargs = myargs2
It seems to be trimming hyphens from the start of each argument..?
Something like this might be simpler:
myargs = [None if s is None else s.lstrip('-') for s in myargs]
Though I note the first will remove only one hyphen and mine will remove all. Not sure what was intended.
Apologies that I have no time to test or do a pull request. Hope that helps though
The text was updated successfully, but these errors were encountered:
Thanks for flagging this. I think it's wanting to remove instances of '-' from the myargs list, but in a very weird way that won't actually do anything.
If myargs contains '-', it will cause an error because it shortens myargs within a loop while iterating over the original index length.
If myargs does not contain '-', it won't do anything.
@stnava@ntustison am I missing a use case where stripping '-' from the args list might be needed? Is there a reason to fix this rather than just remove it entirely?
While trying to debug something of my own, I found your apply transforms code contains the following
It seems to be trimming hyphens from the start of each argument..?
Something like this might be simpler:
Though I note the first will remove only one hyphen and mine will remove all. Not sure what was intended.
Apologies that I have no time to test or do a pull request. Hope that helps though
The text was updated successfully, but these errors were encountered: