Skip to main content

pystubber - Creates a stub python file from a python module

Project description

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()
...

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pystubber-0.1.2.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pystubber-0.1.2-py2.py3-none-any.whl (23.6 kB view details)

Uploaded Python 2Python 3

File details

Details for the file pystubber-0.1.2.tar.gz.

File metadata

  • Download URL: pystubber-0.1.2.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.19.1

File hashes

Hashes for pystubber-0.1.2.tar.gz
Algorithm Hash digest
SHA256 1c024b06a26e7e22fa39abe9910cf523fc7241e59da27dc3296454df451b3343
MD5 b522ff10817ba03b989f6d7852e7fbdd
BLAKE2b-256 548f4f8d9505b110910ac5aa299976b52d932da22fc46e6344bbfcc6f7d98ff7

See more details on using hashes here.

File details

Details for the file pystubber-0.1.2-py2.py3-none-any.whl.

File metadata

  • Download URL: pystubber-0.1.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 23.6 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.19.1

File hashes

Hashes for pystubber-0.1.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 cbf3a272ea1189b39cc2888d433c205d1b31bc39cfbca13254a69fe27b8dc939
MD5 10287dfaac49fb6687a40ff1e7fcff63
BLAKE2b-256 085f6348633fc9830ecf01882fae1b4549593907fb5feff40fea3c1eeadf1ea1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page