Skip to content

Add base command to show a number in binary, octal and hex - #159

Merged
codepiyusss merged 1 commit into
codepiyusss:mainfrom
jay23606:pr-go/92-feature-add-a-number-base-conversion-com
Nov 21, 2026
Merged

codepiyusss merged 1 commit into
codepiyusss:mainfrom
jay23606:pr-go/92-feature-add-a-number-base-conversion-com

Conversation

@jay23606

Copy link
Copy Markdown
Contributor

Closes #92

Bug / gap

Issue #92 asks for a base subcommand that shows a non-negative integer in binary, octal and hexadecimal (fixit base 255 -> 0b11111111 0o377 0xff).

Change

The feature is in fixit/bases.py (to_bases), wired into fixit/cli.py as the base subcommand. Negative input is rejected with an error.

Testing

  • python -m pytest tests/test_bases.py -q: 5 passed.
  • PYTHONPATH=<clone> pytest -q -p no:cacheprovider <clone>/tests: 129 passed (full suite).
  • Against the base commit (de5d1b6^, extracted to a scratch copy), tests/test_bases.py fails at collection with ImportError: cannot import name 'bases' from 'fixit'.

Regression test: tests/test_bases.py fails on the base commit with ImportError: cannot import name 'bases' from 'fixit'.

Fixes #92

@jay23606
jay23606 marked this pull request as ready for review November 21, 2026 00:38
@codepiyusss
codepiyusss merged commit 1c863a7 into codepiyusss:main Nov 21, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: add a number base conversion command

2 participants