dataset as long word sequences. [...] Returns: tuple of numpy.ndarray: Int32 vectors of word IDs. """ train = _retrieve_ptb_words('train.npz', _train_url) valid = _retrieve_ptb_words('valid.npz', _valid_url) test = _retrieve_ptb_words('test.npz', _test_url) return train, valid, test docstring IDEs can't parse complicated types Effective Modern Python 2018 7 / 19
function of other libraries def load_vocab(vocabfile): [...] from typing import Dict # typed! vocab: Dict[int, str] = load_vocab(vocabfile) Effective Modern Python 2018 9 / 19
them all: $ pip freeze > requirements.txt $ pip install -r requirements.txt Need to manage virtual environment at your own responsibility Don't you have unnecessary dependency? How is version compatibility of Python and libraries? Metadata management? Effective Modern Python 2018 16 / 19
type annotations Data Classes The Ultimate Guide to Data Classes in Python 3.7 – Real Python Packaging and Dependency Management Python's New Package Landscape How to Publish an OpenSource Python Package to PyPI – Real Python Effective Modern Python 2018 19 / 19