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
Release history Release notifications | RSS feed
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.1.tar.gz
(8.3 kB
view hashes)
Built Distribution
Close
Hashes for pystubber-0.1.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e72df4e71b2205f8abfddeec1e0c84bb86897d18f9aa497a425355e4a5e004d1 |
|
MD5 | ce0385b5d82c183902893925d39c1067 |
|
BLAKE2b-256 | b358d209ebd1bee990f891a5a6bf5af05e12b479ccd11de5074836de0413b111 |