PDBList init has the default value pdb=os.getcwd() unfortunately initializing parameters with something that is mutable is bad practice. The reason for this is that the def statement only gets executed once, which is when the function is defined. Thus the initializer value only gets created once. For a reference type (as opposed to an immutable type which cannot change) like a function or a dictionary, this ends up as a visible and surprising pitfall, whereas for value types, it goes unnoticed.
In summary, we modify the call to PDBlist so it passes explicitly the value of the pdb argument.
Note, I do not modify PDBList.__init_definition because is a biopython function, that is, belongs to an external module.
PDBList init has the default value pdb=os.getcwd() unfortunately initializing parameters with something that is mutable is bad practice. The reason for this is that the def statement only gets executed once, which is when the function is defined. Thus the initializer value only gets created once. For a reference type (as opposed to an immutable type which cannot change) like a function or a dictionary, this ends up as a visible and surprising pitfall, whereas for value types, it goes unnoticed.
In summary, we modify the call to PDBlist so it passes explicitly the value of the pdb argument.
Note, I do not modify PDBList.__init_definition because is a biopython function, that is, belongs to an external module.