Approve functions used as default arguments (#4699) · UnixJunkie/all-algorithms-python@ef98271 · GitHub
Skip to content

Commit ef98271

Browse files
authored
Approve functions used as default arguments (TheAlgorithms#4699)
* Approve functions used as default argumenets * The default value for **seed** is the result of a function call The default value for **seed** is the result of a function call which is not normally recommended and causes flake8-bugbear to raise a B008 error. However, in this case, it is accptable because `LinearCongruentialGenerator.__init__()` will only be called once per instance and it ensures that each instance will generate a unique sequence of numbers. * The default value for **backend** is the result of a function call The default value for **backend** is the result of a function call which is not normally recommended and causes flake8-bugbear to raise a B008 error. However, in this case, it is accptable because `Aer.get_backend()` is called when the function is definition and that same backend is then reused for function calls. * Update linear_congruential_generator.py * Update ripple_adder_classic.py * Update ripple_adder_classic.py * Update ripple_adder_classic.py * Update ripple_adder_classic.py * Update ripple_adder_classic.py
1 parent 097f830 commit ef98271

2 files changed

Lines changed: 18 additions & 4 deletions

File tree

other/linear_congruential_generator.py

Lines changed: 7 additions & 1 deletion

quantum/ripple_adder_classic.py

Lines changed: 11 additions & 3 deletions

0 commit comments

Comments
 (0)