
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
mypy-nonfloat-decimal
Advanced tools
Mypy plugin to prevent passing float type to Decimal to avoid imprecisions.
Restricts passing float numbers to Decimal
The implementation of floating point numbers
can cause imprecisions in results. To avoid this problem you can use Decimal
type,
however you still need to avoid passing float
as its parameter:
>>> Decimal(1.02)
Decimal("1.020000000000000017763568394002504646778106689453125")
>>> Decimal("1.02")
Decimal("1.02")
This plugin is meant to spot occurrences where float
is passed to Decimal
in your code.
pip install mypy-nonfloat-decimal
mypy.ini
)[mypy]
plugins=mypy_nonfloat_decimal
float
passed to Decimal
and report it as an error (example.py
):from decimal import Decimal
Decimal(1.02)
$ mypy --config-file ./mypy.ini ./example.py
example.py:2: error: Invalid type passed to Decimal (expected "Union[int, str, Decimal]"), got float instead
FAQs
Mypy plugin to prevent passing float type to Decimal to avoid imprecisions.
We found that mypy-nonfloat-decimal demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.