Skip to main content

intf provides a simple base class for integers with specified default formatting. Define your own subclasses derived from BaseIntF and specify desired formatting right with the class name. Decimal, binary, octal and hexadecimal formats are supported. See BaseIntF for more details.

Example:

from intf import BaseIntF

class int_04X(BaseIntF):
    pass

x = int_04X(123)
print '{}'.format(x)  # prints 0x007B

class int_06o(BaseIntF):
    pass

y = int_06o(123)
print '{}'.format(y)  # prints 0o000173

class int_08b(BaseIntF):
    pass

z = int_08b(123)
print '{}'.format(z)  # prints 0b01111011

print '{:02x}'.format(z)  # still prints 7b

Metadata

Release files for intf 1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for intf 1.0
File Size Uploaded
intf-1.0.tar.gz 3.3 kB Details

Release files / intf-1.0.tar.gz

Download URL intf-1.0.tar.gz
Size 3.3 kB
Tags Source
SHA-256 checksum
How to use checksums
8607b85b1915a2dff83aa4e70450d3f9c1e4ba110e7a16497e65eee830a43666
BLAKE2b-256 checksum
How to use checksums
df28df843f92d6884796143808163b403fd1f4f7d45461463e5f9ac50c3e9c25
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.0 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page