pyint

package
v1.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2026 License: MIT Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Float

func Float(v any) (float64, error)

Python float of a decoded JSON or config value with the TypeError, ValueError or OverflowError float raises

func Instance

func Instance(v any) (*big.Int, bool)

Integer value of v when isinstance(v, int) holds in Python, bools counting as 0 and 1

func Int64

func Int64(v any) (int64, error)

Python int of a value stored in a C long field, the OverflowError past the int64 range

func Native

func Native(n *big.Int) any

Go int holding n when it fits, otherwise n itself

func Of

func Of(v any) (*big.Int, error)

Python int of a decoded JSON or config value with the TypeError, ValueError or OverflowError int raises

func Parse

func Parse(text string) (*big.Int, bool)

Python int of a string in base 10, digits of any script with single underscores between digits

func ParseBase

func ParseBase(text string, base int) (*big.Int, bool)

Python int of a string in base 2 to 36 with its prefix, underscores and Unicode decimal digits

func ParseFloat

func ParseFloat(text string) (float64, error)

Python float of a string, any script's decimal digits, underscores between digits, inf and nan spellings

func Round

func Round(x float64, ndigits int) float64

Python round of a float to ndigits decimals, exact ties going to the even digit

func Value

func Value(n *big.Int) any

Smallest Go value holding n, int64 when it fits

Types

type Error

type Error struct {
	Kind string
	Msg  string
}

Python exception class and message of a failed int conversion

func (*Error) Error

func (e *Error) Error() string

func (*Error) PyExceptionMRO

func (e *Error) PyExceptionMRO() []string

Class names of the builtin exception through BaseException as type(exc).__mro__ lists them

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL