Details
- Reviewers
Alphare indygreg - Group Reviewers
hg-reviewers
Diff Detail
- Repository
- rHG Mercurial
- Branch
- default
- Lint
No Linters Available - Unit
No Unit Test Coverage
Event Timeline
Nothing uses this directly, but it makes it much easier to another extension to call into this code and be able to request different diff options
hgext/phabricator.py | ||
---|---|---|
725 | I know it's not technically part of this change, but making 32767 a "constant" with an explanation or at least a good name would be nice. |
hgext/phabricator.py | ||
---|---|---|
721 | [] and {} or any dynamic value should not be used as an argument default because the initially passed value will be used on subsequent invocations if it isn't passed. See https://docs.python-guide.org/writing/gotchas/#mutable-default-arguments. For this pattern, do something like: def func(optional=None): optional = optional or {} or def func(optional=None): if optional is None: optional = {} | |
726 | It's weird to pass an options dict/argument only to use a single key. Perhaps we should do something like this instead: options = dict(options or {}) options['git'] = True diffopts = mdiff.diffopts(**options) | |
1082 | Mutable default argument. |
[] and {} or any dynamic value should not be used as an argument default because the initially passed value will be used on subsequent invocations if it isn't passed. See https://docs.python-guide.org/writing/gotchas/#mutable-default-arguments.
For this pattern, do something like:
or