Skip to main content

pystubber

What differs from mypy stubgen?

As mypy's stubgen -m random generates the following for the random module:

class Random(_random.Random):
    VERSION: int = ...
    gauss_next: Any = ...
    def __init__(self, x: Optional[Any] = ...) -> None: ...
    def seed(self, a: Optional[Any] = ..., version: int = ...) -> None: ...
    def getstate(self): ...
    def setstate(self, state: Any) -> None: ...
    def __reduce__(self): ...
    def randrange(self, start: Any, stop: Optional[Any] = ..., step: int = ..., _int: Any = ...): ...
    def randint(self, a: Any, b: Any): ...
    def choice(self, seq: Any): ...
...

pystubber random instead generates:

#!/usr/bin/env python  # [module random]
"""
Random variable generators.
...
"""
__all__ = ['Random', 'seed', 'random', 'uniform', 'randint', 'choice', 'sample', 'randrange', 'shuffle', 'normalvariate', 'lognormvariate', 'expovariate', 'vonmisesvariate', 'gammavariate', 'triangular', 'gauss', 'betavariate', 'paretovariate', 'weibullvariate', 'getstate', ...]

class Random(_random.Random):
    def __getstate__(self):
        """
        # Issue 17489: Since __reduce__ was defined to fix #759889 this is no
        # longer called; we leave it here because it has been here since random was
        # rewritten back in 2001 and why risk breaking something.
        """
        raise NotImplementedError()

    def __init__(self, x=None):
        """
        Initialize an instance.

        Optional argument x controls seeding, as for Random.seed().
        """
        raise NotImplementedError()

    def __reduce__(self):
        """
        helper for pickle
        """
        raise NotImplementedError()
...

Metadata

Release files for pystubber 0.1.2

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

Source distribution (sdist)

Source distribution for pystubber 0.1.2
File Size Uploaded
pystubber-0.1.2.tar.gz 8.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pystubber 0.1.2
File Interpreter ABI Platform
pystubber-0.1.2-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 32.0 kB

Release files / pystubber-0.1.2.tar.gz

Download URL pystubber-0.1.2.tar.gz
Size 8.4 kB
Tags Source
SHA-256 checksum
How to use checksums
1c024b06a26e7e22fa39abe9910cf523fc7241e59da27dc3296454df451b3343
BLAKE2b-256 checksum
How to use checksums
548f4f8d9505b110910ac5aa299976b52d932da22fc46e6344bbfcc6f7d98ff7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.19.1

Release files / pystubber-0.1.2-py2.py3-none-any.whl

Download URL pystubber-0.1.2-py2.py3-none-any.whl
Size 23.6 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
cbf3a272ea1189b39cc2888d433c205d1b31bc39cfbca13254a69fe27b8dc939
BLAKE2b-256 checksum
How to use checksums
085f6348633fc9830ecf01882fae1b4549593907fb5feff40fea3c1eeadf1ea1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.19.1

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

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