Although the parameter is called 'seq', the implementation shows that it
can be anything that can be passed to map(), which takes iterables:
0f42b726c8/Lib/subprocess.py (L565).
* Annotate three previously missing `MappingProxyType` methods
* `__hash__`
* `__reversed__`
* `__class_getitem__`
* Improve 5 `MappingProxyType` methods
The assumption here is that the underlying mapping is a `dict`,
just is done for `MappingProxyType.copy`
* Make the value type of `types.MappingProxyType` covariant
Several things done:
1. Replace all occurrences of `Any` by respective concrete types.
2. Make `Shelf` and its subclassses generic. (Fixes#5815)
3. `shelve.open` should return a general `Shelf` object, not `DbfilenameShelf`. The documentation does not expose such implementation detail.
4. The argument `dict` is annotated with an abstract type `MutableMapping` rather than concrete type `Dict`.
5. Remove unnecessary methods. Some of them are inherited from `MutableMapping`, so no need to repeat them here.
6. Use builtin-in generics instead of importing from `typing`.
`reversed` is currently annotated as accepting either a `Sequence` or objects implementing the `__reversed__` protocol.
This however is too strict as, per its [docs](https://docs.python.org/3/library/functions.html#reversed), it can take any object that implements `__len__` and `__getitem__`.
A library that provides integration access to the Braintree Gateway.
I started with stubgen, then cleaned up to address missing functions. Testing plan is to keep an eye on CI and fix any issues that arise.
These were generated using stubgen, with manual fixes. I tried to remove
exported names that are clearly not part of the public interface, but in many
cases this wasn't obvious so I left the exports, just in case.
I had to do major changes to exported names in `selenium.webdriver` to
make it work as expected (this was originally implemented by @ilevkivskyi
in our internal stubs).
Selenium has been working on adding inline type annotations, but it's not clear
when these will be released. The release will be 4.x, and having stubs for 3.x
could still be valuable for users on older versions.
See https://github.com/dropbox/mypy-protobuf/issues/244 for the
inspiration for this. Repeated extensions are allowed by protobuf,
and they generate to extension values with repeated fields.
Notably map fields (ScalarMap and MessageMap) are NOT allowed to be
extension values - producing errors as such - so those are omitted.
testproto/test_extensions3.proto:19:6: Map fields are not allowed to be extensions.
I generated these using stubgen and made various manual tweaks to fix issues
reported by stubtest.
Some of the submodules with underscore prefixes are used by open source code,
so I'm including them.
Various definitions are platform-specific. I added some sys.platform checks, but
it's hard to get these right. We may need to iterate on them later.
This tool is a simple wrapper around stubgen and other tools that simplifies the
creation of "baseline" stubs with minimal annotation coverage. These stubs allow
basic type checking (e.g. number of arguments, whether X is valid as a base class),
and once we have baseline stubs, it's easy to contribute incremental changes that
add type annotations.
Here's a summary of what the tool does:
1. Check that the package is installed
2. Run stubgen
3. Copy generated stubs to the correct directory under `stubs/`
4. Run black
5. Run isort
6. Generate basic metadata with correct package version
7. Update pyright exclusions (needed since there are missing types)
8. Print suggestions about next steps needed to contribute stubs to typeshed
For example, to generate stubs for `iso8601`, you can run it like this:
```
python scripts/create_baseline_stubs.py iso8601
```
Sometimes the project name is different from the runtime package name. In
this case run the tool with `--package <runtime-package>`.
Remove the check in check_consistency that ensures that only other
type packages from typeshed are being depended on. Instead, add an
explanation to CONTRIBUTING that spells out the requirements. This
adds a higher, but reasonable burden on maintainers to check the
dependencies manually.
Part of #5768
Basic stubs made with stubgen & manual fixes. Also, reorder
pyrightconfig.stricter.json, I didn't realise it was mostly ordered
when I added to it previously.
Proto itself supports primitives, not just messages.
See https://github.com/dropbox/mypy-protobuf/issues/244 for an example
motivating this change.
Test Plan: I was able to use MYPYPATH to test an updated version of
mypy-protobuf with this change.
A library that provides convenient access to the Stripe API from applications.
It includes a pre-defined set of classes for API resources that initialize themselves
dynamically from API responses.
I started with stubgen, then cleaned up to address missing functions. Testing plan
is to keep an eye on CI and fix any issues that arise.
* run stubgen
* replace individual lexers with __getattr__ in lexers/__init__.pyi
* replace individual styles with __getattr__ in styles/__init__.pyi
* import-export each formatter into formatters/__init__.pyi
* clean up slightly with quick and dirty script
* manual fixing