Michael Lohmann

Results 44 comments of Michael Lohmann

> So what's the status of this? As I mentioned somewhere before: I have never written any tests in python and I would rather have someone else do them since...

The casting of the items should probably be changed to `self.steps = [int(step) for step in steps]` and the check in the init should be changed to `if hasattr(step, '__iter__')`

If one inputs e.g. `step=[[1],2]` one still get's a TypeError, but from trying to cast to a single `int([[1],2])` because of the `try/except`. But I guess that isn't that important?

Do you think the code should be refactored into a method that is called in all relevant places? ```python def _setupShouldEvaluateAtStep(self, step): try: self.step = frozenset(int(i) for i in step)...

One could even think of putting the whole `step` and `iter` handling/incrementing into a decorator, so that the code is easier to maintain (#1538). It is not possible for the...

Something like this maybe? ```python from functools import wraps def call_if_should_be_evaluated(func): @wraps(func) def wrapper(self, *args, **kwargs): if self.should_evaluate_at_step(self.iter): func(self, *args, **kwargs) self.iter += 1 return wrapper ```

> always run at first iteration Is there a reason why this must be done? The rational behind my interpretations of a `list of steps` is that the user does...

Sorry for not replying, but I needed to help my grandmother for the last few weeks... Your proposal needs `assert step > 0`. What about `its = iter(sorted(list(set(its))))`? This will...

The following test will work because it circumvents the caching of the database connections. ```js const exec = (db, sql, dbnr) => new Promise((resolve, reject) => db._db.exec( [ { sql,...