From ef6750f1dc66fa2da16245cfcaf2d54afb86d285 Mon Sep 17 00:00:00 2001 From: Oscar Campos Date: Fri, 11 Feb 2022 00:08:49 +0000 Subject: [PATCH 1/5] fix: fix anaconda to work with Python 3.10 * Update Parso to latest version * Update Jedi to latest version * Update PyFlakes to latest version * Update PyCodestyle to latest version * Update McCabe to latest version * Added support for Pylint >= 2.5.0 * Dropped support for Python < 3.6 --- .travis.yml | 19 +- README.md | 6 +- anaconda_lib/jedi/__init__.py | 5 +- anaconda_lib/jedi/__main__.py | 0 anaconda_lib/jedi/_compatibility.py | 605 +--- anaconda_lib/jedi/api/__init__.py | 253 +- anaconda_lib/jedi/api/classes.py | 184 +- anaconda_lib/jedi/api/completion.py | 58 +- anaconda_lib/jedi/api/completion_cache.py | 14 +- anaconda_lib/jedi/api/environment.py | 119 +- anaconda_lib/jedi/api/errors.py | 5 +- anaconda_lib/jedi/api/exceptions.py | 0 anaconda_lib/jedi/api/file_name.py | 9 +- anaconda_lib/jedi/api/helpers.py | 41 +- anaconda_lib/jedi/api/interpreter.py | 55 +- anaconda_lib/jedi/api/keywords.py | 25 +- anaconda_lib/jedi/api/project.py | 176 +- anaconda_lib/jedi/api/refactoring/__init__.py | 59 +- anaconda_lib/jedi/api/refactoring/extract.py | 8 +- anaconda_lib/jedi/api/replstartup.py | 2 +- anaconda_lib/jedi/api/strings.py | 5 +- anaconda_lib/jedi/cache.py | 5 +- anaconda_lib/jedi/common.py | 12 - anaconda_lib/jedi/debug.py | 33 +- anaconda_lib/jedi/file_io.py | 8 +- anaconda_lib/jedi/inference/__init__.py | 19 +- anaconda_lib/jedi/inference/analysis.py | 10 +- anaconda_lib/jedi/inference/arguments.py | 22 +- anaconda_lib/jedi/inference/base_value.py | 71 +- anaconda_lib/jedi/inference/cache.py | 4 +- .../jedi/inference/compiled/__init__.py | 10 +- .../jedi/inference/compiled/access.py | 132 +- .../jedi/inference/compiled/getattr_static.py | 71 +- anaconda_lib/jedi/inference/compiled/mixed.py | 47 +- .../inference/compiled/subprocess/__init__.py | 105 +- .../inference/compiled/subprocess/__main__.py | 55 +- .../compiled/subprocess/functions.py | 174 +- anaconda_lib/jedi/inference/compiled/value.py | 85 +- anaconda_lib/jedi/inference/context.py | 45 +- .../jedi/inference/docstring_utils.py | 21 + anaconda_lib/jedi/inference/docstrings.py | 67 +- anaconda_lib/jedi/inference/dynamic_params.py | 4 +- anaconda_lib/jedi/inference/filters.py | 120 +- anaconda_lib/jedi/inference/finder.py | 0 anaconda_lib/jedi/inference/flow_analysis.py | 8 +- .../jedi/inference/gradual/__init__.py | 0 .../jedi/inference/gradual/annotation.py | 54 +- anaconda_lib/jedi/inference/gradual/base.py | 75 +- .../jedi/inference/gradual/conversion.py | 7 +- .../jedi/inference/gradual/generics.py | 2 +- .../jedi/inference/gradual/stub_value.py | 27 +- .../jedi/inference/gradual/type_var.py | 38 +- .../jedi/inference/gradual/typeshed.py | 86 +- anaconda_lib/jedi/inference/gradual/typing.py | 86 +- anaconda_lib/jedi/inference/gradual/utils.py | 27 +- anaconda_lib/jedi/inference/helpers.py | 17 +- anaconda_lib/jedi/inference/imports.py | 93 +- anaconda_lib/jedi/inference/lazy_value.py | 6 +- anaconda_lib/jedi/inference/names.py | 57 +- anaconda_lib/jedi/inference/param.py | 5 +- anaconda_lib/jedi/inference/parser_cache.py | 0 anaconda_lib/jedi/inference/recursion.py | 6 +- anaconda_lib/jedi/inference/references.py | 57 +- anaconda_lib/jedi/inference/signature.py | 13 +- anaconda_lib/jedi/inference/star_args.py | 17 +- anaconda_lib/jedi/inference/syntax_tree.py | 95 +- anaconda_lib/jedi/inference/sys_path.py | 59 +- anaconda_lib/jedi/inference/utils.py | 31 +- anaconda_lib/jedi/inference/value/__init__.py | 3 + .../jedi/inference/value/decorator.py | 23 +- .../jedi/inference/value/dynamic_arrays.py | 14 +- anaconda_lib/jedi/inference/value/function.py | 53 +- anaconda_lib/jedi/inference/value/instance.py | 174 +- anaconda_lib/jedi/inference/value/iterable.py | 161 +- anaconda_lib/jedi/inference/value/klass.py | 155 +- anaconda_lib/jedi/inference/value/module.py | 41 +- .../jedi/inference/value/namespace.py | 14 +- anaconda_lib/jedi/parser_utils.py | 64 +- anaconda_lib/jedi/plugins/__init__.py | 2 +- anaconda_lib/jedi/plugins/django.py | 216 +- anaconda_lib/jedi/plugins/flask.py | 6 +- anaconda_lib/jedi/plugins/pytest.py | 55 +- anaconda_lib/jedi/plugins/registry.py | 0 anaconda_lib/jedi/plugins/stdlib.py | 115 +- anaconda_lib/jedi/settings.py | 9 +- .../jedi/third_party/README_typeshed.md | 0 .../third_party/django-stubs/CONTRIBUTING.md | 111 + .../jedi/third_party/django-stubs/LICENSE.txt | 8 + .../jedi/third_party/django-stubs/README.md | 120 + .../django-stubs/dev-requirements.txt | 8 + .../{ => django-stubs}/__init__.pyi | 0 .../{ => django-stubs}/apps/__init__.pyi | 0 .../{ => django-stubs}/apps/config.pyi | 0 .../{ => django-stubs}/apps/registry.pyi | 0 .../{ => django-stubs}/conf/__init__.pyi | 0 .../conf/global_settings.pyi | 0 .../conf/locale/__init__.pyi | 0 .../{ => django-stubs}/conf/urls/__init__.pyi | 0 .../{ => django-stubs}/conf/urls/i18n.pyi | 0 .../{ => django-stubs}/conf/urls/static.pyi | 0 .../{ => django-stubs}/contrib/__init__.pyi | 0 .../contrib/admin/__init__.pyi | 0 .../contrib/admin/actions.pyi | 0 .../{ => django-stubs}/contrib/admin/apps.pyi | 0 .../contrib/admin/checks.pyi | 0 .../contrib/admin/decorators.pyi | 0 .../contrib/admin/filters.pyi | 0 .../contrib/admin/forms.pyi | 0 .../contrib/admin/helpers.pyi | 0 .../contrib/admin/models.pyi | 0 .../contrib/admin/options.pyi | 86 +- .../contrib/admin/sites.pyi | 0 .../contrib/admin/templatetags/__init__.pyi | 0 .../contrib/admin/templatetags/admin_list.pyi | 0 .../admin/templatetags/admin_modify.pyi | 0 .../admin/templatetags/admin_static.pyi | 0 .../contrib/admin/templatetags/admin_urls.pyi | 0 .../contrib/admin/templatetags/base.pyi | 0 .../contrib/admin/templatetags/log.pyi | 0 .../contrib/admin/tests.pyi | 0 .../contrib/admin/utils.pyi | 0 .../contrib/admin/views/__init__.pyi | 0 .../contrib/admin/views/autocomplete.pyi | 0 .../contrib/admin/views/decorators.pyi | 0 .../contrib/admin/views/main.pyi | 0 .../contrib/admin/widgets.pyi | 0 .../contrib/admindocs/__init__.pyi | 0 .../contrib/admindocs/middleware.pyi | 0 .../contrib/admindocs/urls.pyi | 0 .../contrib/admindocs/utils.pyi | 0 .../contrib/admindocs/views.pyi | 0 .../contrib/auth/__init__.pyi | 0 .../{ => django-stubs}/contrib/auth/admin.pyi | 0 .../{ => django-stubs}/contrib/auth/apps.pyi | 0 .../contrib/auth/backends.pyi | 0 .../contrib/auth/base_user.pyi | 10 +- .../contrib/auth/checks.pyi | 0 .../contrib/auth/context_processors.pyi | 0 .../contrib/auth/decorators.pyi | 0 .../{ => django-stubs}/contrib/auth/forms.pyi | 0 .../contrib/auth/handlers/__init__.pyi | 0 .../contrib/auth/handlers/modwsgi.pyi | 0 .../contrib/auth/hashers.pyi | 0 .../contrib/auth/management/__init__.pyi | 0 .../auth/management/commands/__init__.pyi | 0 .../management/commands/changepassword.pyi | 0 .../management/commands/createsuperuser.pyi | 0 .../contrib/auth/middleware.pyi | 0 .../contrib/auth/mixins.pyi | 0 .../contrib/auth/models.pyi | 10 +- .../contrib/auth/password_validation.pyi | 0 .../contrib/auth/signals.pyi | 0 .../contrib/auth/tokens.pyi | 0 .../{ => django-stubs}/contrib/auth/urls.pyi | 0 .../contrib/auth/validators.pyi | 0 .../{ => django-stubs}/contrib/auth/views.pyi | 0 .../contrib/contenttypes/__init__.pyi | 0 .../contrib/contenttypes/admin.pyi | 0 .../contrib/contenttypes/apps.pyi | 0 .../contrib/contenttypes/checks.pyi | 0 .../contrib/contenttypes/fields.pyi | 0 .../contrib/contenttypes/forms.pyi | 0 .../contenttypes/management/__init__.pyi | 0 .../management/commands/__init__.pyi | 0 .../commands/remove_stale_contenttypes.pyi | 0 .../contrib/contenttypes/models.pyi | 0 .../contrib/contenttypes/views.pyi | 0 .../contrib/flatpages/__init__.pyi | 0 .../contrib/flatpages/forms.pyi | 0 .../contrib/flatpages/middleware.pyi | 0 .../contrib/flatpages/models.pyi | 0 .../contrib/flatpages/sitemaps.pyi | 0 .../flatpages/templatetags/__init__.pyi | 0 .../flatpages/templatetags/flatpages.pyi | 0 .../contrib/flatpages/urls.pyi | 0 .../contrib/flatpages/views.pyi | 0 .../contrib/gis/__init__.pyi | 0 .../contrib/gis/db/__init__.pyi | 0 .../contrib/gis/db/models/__init__.pyi | 0 .../contrib/gis/db/models/fields.pyi | 0 .../contrib/humanize/__init__.pyi | 0 .../humanize/templatetags/__init__.pyi | 0 .../humanize/templatetags/humanize.pyi | 0 .../contrib/messages/__init__.pyi | 0 .../contrib/messages/api.pyi | 0 .../contrib/messages/constants.pyi | 0 .../contrib/messages/context_processors.pyi | 0 .../contrib/messages/middleware.pyi | 0 .../contrib/messages/storage/__init__.pyi | 0 .../contrib/messages/storage/base.pyi | 0 .../contrib/messages/storage/cookie.pyi | 0 .../contrib/messages/storage/fallback.pyi | 0 .../contrib/messages/storage/session.pyi | 0 .../contrib/messages/utils.pyi | 0 .../contrib/messages/views.pyi | 0 .../contrib/postgres/__init__.pyi | 0 .../contrib/postgres/aggregates/__init__.pyi | 0 .../contrib/postgres/aggregates/general.pyi | 0 .../contrib/postgres/aggregates/mixins.pyi | 0 .../postgres/aggregates/statistics.pyi | 0 .../contrib/postgres/constraints.pyi | 0 .../contrib/postgres/fields/__init__.pyi | 0 .../contrib/postgres/fields/array.pyi | 0 .../contrib/postgres/fields/citext.pyi | 0 .../contrib/postgres/fields/hstore.pyi | 0 .../contrib/postgres/fields/jsonb.pyi | 0 .../contrib/postgres/fields/mixins.pyi | 0 .../contrib/postgres/fields/ranges.pyi | 0 .../contrib/postgres/functions.pyi | 0 .../contrib/postgres/indexes.pyi | 0 .../contrib/postgres/lookups.pyi | 0 .../contrib/postgres/operations.pyi | 0 .../contrib/postgres/search.pyi | 0 .../contrib/postgres/signals.pyi | 0 .../contrib/postgres/validators.pyi | 0 .../contrib/redirects/__init__.pyi | 0 .../contrib/redirects/middleware.pyi | 0 .../contrib/redirects/models.pyi | 0 .../contrib/sessions/__init__.pyi | 0 .../contrib/sessions/backends/__init__.pyi | 0 .../contrib/sessions/backends/base.pyi | 0 .../contrib/sessions/backends/cache.pyi | 0 .../contrib/sessions/backends/cached_db.pyi | 0 .../contrib/sessions/backends/db.pyi | 0 .../contrib/sessions/backends/file.pyi | 0 .../sessions/backends/signed_cookies.pyi | 0 .../contrib/sessions/base_session.pyi | 0 .../contrib/sessions/exceptions.pyi | 0 .../contrib/sessions/management/__init__.pyi | 0 .../sessions/management/commands/__init__.pyi | 0 .../management/commands/clearsessions.pyi | 0 .../contrib/sessions/middleware.pyi | 0 .../contrib/sessions/models.pyi | 0 .../contrib/sessions/serializers.pyi | 0 .../contrib/sitemaps/__init__.pyi | 13 +- .../contrib/sitemaps/management/__init__.pyi | 0 .../sitemaps/management/commands/__init__.pyi | 0 .../management/commands/ping_google.pyi | 0 .../contrib/sitemaps/views.pyi | 0 .../contrib/sites/__init__.pyi | 0 .../{ => django-stubs}/contrib/sites/apps.pyi | 0 .../contrib/sites/management.pyi | 0 .../contrib/sites/managers.pyi | 0 .../contrib/sites/middleware.pyi | 0 .../contrib/sites/models.pyi | 0 .../contrib/sites/requests.pyi | 0 .../contrib/sites/shortcuts.pyi | 0 .../contrib/staticfiles/__init__.pyi | 0 .../contrib/staticfiles/apps.pyi | 0 .../contrib/staticfiles/checks.pyi | 0 .../contrib/staticfiles/finders.pyi | 0 .../contrib/staticfiles/handlers.pyi | 0 .../staticfiles/management/__init__.pyi | 0 .../management/commands/__init__.pyi | 0 .../management/commands/collectstatic.pyi | 0 .../management/commands/findstatic.pyi | 0 .../management/commands/runserver.pyi | 0 .../contrib/staticfiles/storage.pyi | 0 .../staticfiles/templatetags/__init__.pyi | 0 .../staticfiles/templatetags/staticfiles.pyi | 0 .../contrib/staticfiles/testing.pyi | 0 .../contrib/staticfiles/urls.pyi | 0 .../contrib/staticfiles/utils.pyi | 0 .../contrib/staticfiles/views.pyi | 0 .../contrib/syndication/__init__.pyi | 0 .../contrib/syndication/views.pyi | 0 .../{ => django-stubs}/core/__init__.pyi | 0 .../core/cache/__init__.pyi | 0 .../core/cache/backends/__init__.pyi | 0 .../core/cache/backends/base.pyi | 0 .../core/cache/backends/db.pyi | 0 .../core/cache/backends/dummy.pyi | 0 .../core/cache/backends/filebased.pyi | 0 .../core/cache/backends/locmem.pyi | 0 .../core/cache/backends/memcached.pyi | 0 .../{ => django-stubs}/core/cache/utils.pyi | 0 .../core/checks/__init__.pyi | 0 .../{ => django-stubs}/core/checks/caches.pyi | 0 .../core/checks/database.pyi | 0 .../core/checks/messages.pyi | 0 .../core/checks/model_checks.pyi | 0 .../core/checks/registry.pyi | 0 .../core/checks/security/__init__.pyi | 0 .../core/checks/security/base.pyi | 0 .../core/checks/security/csrf.pyi | 0 .../core/checks/security/sessions.pyi | 0 .../core/checks/templates.pyi | 0 .../core/checks/translation.pyi | 0 .../{ => django-stubs}/core/checks/urls.pyi | 0 .../{ => django-stubs}/core/exceptions.pyi | 0 .../core/files/__init__.pyi | 0 .../{ => django-stubs}/core/files/base.pyi | 0 .../{ => django-stubs}/core/files/images.pyi | 0 .../{ => django-stubs}/core/files/locks.pyi | 0 .../{ => django-stubs}/core/files/move.pyi | 0 .../{ => django-stubs}/core/files/storage.pyi | 0 .../{ => django-stubs}/core/files/temp.pyi | 0 .../core/files/uploadedfile.pyi | 0 .../core/files/uploadhandler.pyi | 0 .../{ => django-stubs}/core/files/utils.pyi | 0 .../core/handlers/__init__.pyi | 0 .../{ => django-stubs}/core/handlers/base.pyi | 0 .../core/handlers/exception.pyi | 0 .../{ => django-stubs}/core/handlers/wsgi.pyi | 5 +- .../{ => django-stubs}/core/mail/__init__.pyi | 0 .../core/mail/backends/__init__.pyi | 0 .../core/mail/backends/base.pyi | 0 .../core/mail/backends/console.pyi | 0 .../core/mail/backends/dummy.pyi | 0 .../core/mail/backends/filebased.pyi | 0 .../core/mail/backends/locmem.pyi | 0 .../core/mail/backends/smtp.pyi | 0 .../{ => django-stubs}/core/mail/message.pyi | 0 .../{ => django-stubs}/core/mail/utils.pyi | 0 .../core/management/__init__.pyi | 0 .../core/management/base.pyi | 0 .../core/management/color.pyi | 0 .../core/management/commands/__init__.pyi | 0 .../core/management/commands/dumpdata.pyi | 0 .../core/management/commands/loaddata.pyi | 0 .../core/management/commands/makemessages.pyi | 0 .../core/management/commands/runserver.pyi | 0 .../core/management/commands/testserver.pyi | 0 .../core/management/sql.pyi | 0 .../core/management/templates.pyi | 0 .../core/management/utils.pyi | 0 .../{ => django-stubs}/core/paginator.pyi | 8 +- .../core/serializers/__init__.pyi | 0 .../core/serializers/base.pyi | 0 .../core/serializers/json.pyi | 0 .../core/serializers/python.pyi | 0 .../core/servers/__init__.pyi | 0 .../core/servers/basehttp.pyi | 0 .../{ => django-stubs}/core/signals.pyi | 0 .../{ => django-stubs}/core/signing.pyi | 0 .../{ => django-stubs}/core/validators.pyi | 0 .../{ => django-stubs}/core/wsgi.pyi | 0 .../{ => django-stubs}/db/__init__.pyi | 0 .../db/backends/__init__.pyi | 0 .../db/backends/base/__init__.pyi | 0 .../db/backends/base/base.pyi | 0 .../db/backends/base/client.pyi | 0 .../db/backends/base/creation.pyi | 0 .../db/backends/base/features.pyi | 0 .../db/backends/base/introspection.pyi | 0 .../db/backends/base/operations.pyi | 0 .../db/backends/base/schema.pyi | 0 .../db/backends/base/validation.pyi | 0 .../db/backends/ddl_references.pyi | 0 .../db/backends/dummy/__init__.pyi | 0 .../db/backends/dummy/base.pyi | 0 .../db/backends/mysql/__init__.pyi | 0 .../db/backends/mysql/client.pyi | 0 .../db/backends/postgresql/__init__.pyi | 0 .../db/backends/postgresql/base.pyi | 0 .../db/backends/postgresql/client.pyi | 0 .../db/backends/postgresql/creation.pyi | 0 .../db/backends/postgresql/operations.pyi | 0 .../db/backends/signals.pyi | 0 .../db/backends/sqlite3/__init__.pyi | 0 .../db/backends/sqlite3/base.pyi | 0 .../db/backends/sqlite3/creation.pyi | 0 .../db/backends/sqlite3/features.pyi | 0 .../db/backends/sqlite3/introspection.pyi | 0 .../db/backends/sqlite3/operations.pyi | 0 .../db/backends/sqlite3/schema.pyi | 0 .../{ => django-stubs}/db/backends/utils.pyi | 0 .../db/migrations/__init__.pyi | 0 .../db/migrations/autodetector.pyi | 0 .../db/migrations/exceptions.pyi | 0 .../db/migrations/executor.pyi | 0 .../db/migrations/graph.pyi | 0 .../db/migrations/loader.pyi | 0 .../db/migrations/migration.pyi | 0 .../db/migrations/operations/__init__.pyi | 0 .../db/migrations/operations/base.pyi | 0 .../db/migrations/operations/fields.pyi | 0 .../db/migrations/operations/models.pyi | 0 .../db/migrations/operations/special.pyi | 0 .../db/migrations/operations/utils.pyi | 0 .../db/migrations/optimizer.pyi | 0 .../db/migrations/questioner.pyi | 0 .../db/migrations/recorder.pyi | 0 .../db/migrations/serializer.pyi | 0 .../db/migrations/state.pyi | 0 .../db/migrations/topological_sort.pyi | 0 .../db/migrations/utils.pyi | 0 .../db/migrations/writer.pyi | 0 .../{ => django-stubs}/db/models/__init__.pyi | 0 .../db/models/aggregates.pyi | 0 .../{ => django-stubs}/db/models/base.pyi | 4 +- .../db/models/constraints.pyi | 0 .../{ => django-stubs}/db/models/deletion.pyi | 0 .../{ => django-stubs}/db/models/enums.pyi | 0 .../db/models/expressions.pyi | 0 .../db/models/fields/__init__.pyi | 0 .../db/models/fields/files.pyi | 0 .../db/models/fields/mixins.pyi | 0 .../db/models/fields/proxy.pyi | 0 .../db/models/fields/related.pyi | 0 .../db/models/fields/related_descriptors.pyi | 0 .../db/models/fields/related_lookups.pyi | 0 .../db/models/fields/reverse_related.pyi | 0 .../db/models/functions/__init__.pyi | 0 .../db/models/functions/comparison.pyi | 0 .../db/models/functions/datetime.pyi | 0 .../db/models/functions/math.pyi | 0 .../db/models/functions/mixins.pyi | 0 .../db/models/functions/text.pyi | 0 .../db/models/functions/window.pyi | 0 .../{ => django-stubs}/db/models/indexes.pyi | 0 .../{ => django-stubs}/db/models/lookups.pyi | 0 .../{ => django-stubs}/db/models/manager.pyi | 0 .../{ => django-stubs}/db/models/options.pyi | 0 .../{ => django-stubs}/db/models/query.pyi | 0 .../db/models/query_utils.pyi | 0 .../{ => django-stubs}/db/models/signals.pyi | 0 .../db/models/sql/__init__.pyi | 0 .../db/models/sql/compiler.pyi | 0 .../db/models/sql/constants.pyi | 0 .../db/models/sql/datastructures.pyi | 0 .../db/models/sql/query.pyi | 0 .../db/models/sql/subqueries.pyi | 0 .../db/models/sql/where.pyi | 0 .../{ => django-stubs}/db/models/utils.pyi | 0 .../{ => django-stubs}/db/transaction.pyi | 0 .../{ => django-stubs}/db/utils.pyi | 0 .../{ => django-stubs}/dispatch/__init__.pyi | 0 .../dispatch/dispatcher.pyi | 0 .../{ => django-stubs}/forms/__init__.pyi | 0 .../{ => django-stubs}/forms/boundfield.pyi | 0 .../{ => django-stubs}/forms/fields.pyi | 0 .../{ => django-stubs}/forms/forms.pyi | 5 +- .../{ => django-stubs}/forms/formsets.pyi | 0 .../{ => django-stubs}/forms/models.pyi | 0 .../{ => django-stubs}/forms/renderers.pyi | 0 .../{ => django-stubs}/forms/utils.pyi | 0 .../{ => django-stubs}/forms/widgets.pyi | 0 .../{ => django-stubs}/http/__init__.pyi | 0 .../{ => django-stubs}/http/cookie.pyi | 0 .../http/multipartparser.pyi | 0 .../{ => django-stubs}/http/request.pyi | 3 +- .../{ => django-stubs}/http/response.pyi | 0 .../middleware/__init__.pyi | 0 .../{ => django-stubs}/middleware/cache.pyi | 0 .../middleware/clickjacking.pyi | 0 .../{ => django-stubs}/middleware/common.pyi | 0 .../{ => django-stubs}/middleware/csrf.pyi | 0 .../{ => django-stubs}/middleware/gzip.pyi | 0 .../{ => django-stubs}/middleware/http.pyi | 0 .../{ => django-stubs}/middleware/locale.pyi | 0 .../middleware/security.pyi | 0 .../{ => django-stubs}/shortcuts.pyi | 21 +- .../{ => django-stubs}/template/__init__.pyi | 0 .../template/backends/__init__.pyi | 0 .../template/backends/base.pyi | 0 .../template/backends/django.pyi | 0 .../template/backends/dummy.pyi | 0 .../template/backends/jinja2.pyi | 0 .../template/backends/utils.pyi | 0 .../{ => django-stubs}/template/base.pyi | 0 .../{ => django-stubs}/template/context.pyi | 0 .../template/context_processors.pyi | 0 .../template/defaultfilters.pyi | 0 .../template/defaulttags.pyi | 0 .../{ => django-stubs}/template/engine.pyi | 0 .../template/exceptions.pyi | 0 .../{ => django-stubs}/template/library.pyi | 0 .../{ => django-stubs}/template/loader.pyi | 0 .../template/loader_tags.pyi | 0 .../template/loaders/__init__.pyi | 0 .../template/loaders/app_directories.pyi | 0 .../template/loaders/base.pyi | 0 .../template/loaders/cached.pyi | 0 .../template/loaders/filesystem.pyi | 0 .../template/loaders/locmem.pyi | 0 .../{ => django-stubs}/template/response.pyi | 0 .../{ => django-stubs}/template/smartif.pyi | 0 .../{ => django-stubs}/template/utils.pyi | 0 .../templatetags/__init__.pyi | 0 .../{ => django-stubs}/templatetags/cache.pyi | 0 .../{ => django-stubs}/templatetags/i18n.pyi | 0 .../{ => django-stubs}/templatetags/l10n.pyi | 0 .../templatetags/static.pyi | 0 .../{ => django-stubs}/templatetags/tz.pyi | 0 .../{ => django-stubs}/test/__init__.pyi | 0 .../{ => django-stubs}/test/client.pyi | 0 .../{ => django-stubs}/test/html.pyi | 0 .../{ => django-stubs}/test/runner.pyi | 0 .../{ => django-stubs}/test/selenium.pyi | 0 .../{ => django-stubs}/test/signals.pyi | 0 .../{ => django-stubs}/test/testcases.pyi | 12 +- .../{ => django-stubs}/test/utils.pyi | 0 .../{ => django-stubs}/urls/__init__.pyi | 0 .../{ => django-stubs}/urls/base.pyi | 0 .../{ => django-stubs}/urls/conf.pyi | 0 .../{ => django-stubs}/urls/converters.pyi | 0 .../{ => django-stubs}/urls/exceptions.pyi | 0 .../{ => django-stubs}/urls/resolvers.pyi | 0 .../{ => django-stubs}/urls/utils.pyi | 0 .../{ => django-stubs}/utils/__init__.pyi | 0 .../{ => django-stubs}/utils/_os.pyi | 0 .../{ => django-stubs}/utils/archive.pyi | 0 .../{ => django-stubs}/utils/autoreload.pyi | 0 .../{ => django-stubs}/utils/baseconv.pyi | 0 .../{ => django-stubs}/utils/cache.pyi | 0 .../{ => django-stubs}/utils/crypto.pyi | 0 .../utils/datastructures.pyi | 1 + .../{ => django-stubs}/utils/dateformat.pyi | 0 .../{ => django-stubs}/utils/dateparse.pyi | 0 .../{ => django-stubs}/utils/dates.pyi | 0 .../utils/datetime_safe.pyi | 0 .../{ => django-stubs}/utils/deconstruct.pyi | 0 .../{ => django-stubs}/utils/decorators.pyi | 0 .../{ => django-stubs}/utils/deprecation.pyi | 0 .../{ => django-stubs}/utils/duration.pyi | 0 .../{ => django-stubs}/utils/encoding.pyi | 0 .../utils/feedgenerator.pyi | 0 .../{ => django-stubs}/utils/formats.pyi | 0 .../{ => django-stubs}/utils/functional.pyi | 0 .../{ => django-stubs}/utils/hashable.pyi | 0 .../{ => django-stubs}/utils/html.pyi | 0 .../{ => django-stubs}/utils/http.pyi | 0 .../{ => django-stubs}/utils/inspect.pyi | 0 .../{ => django-stubs}/utils/ipv6.pyi | 0 .../{ => django-stubs}/utils/itercompat.pyi | 0 .../{ => django-stubs}/utils/jslex.pyi | 0 .../{ => django-stubs}/utils/log.pyi | 0 .../{ => django-stubs}/utils/lorem_ipsum.pyi | 0 .../utils/module_loading.pyi | 0 .../{ => django-stubs}/utils/numberformat.pyi | 0 .../{ => django-stubs}/utils/regex_helper.pyi | 0 .../{ => django-stubs}/utils/safestring.pyi | 0 .../{ => django-stubs}/utils/six.pyi | 0 .../{ => django-stubs}/utils/termcolors.pyi | 0 .../{ => django-stubs}/utils/text.pyi | 0 .../{ => django-stubs}/utils/timesince.pyi | 0 .../{ => django-stubs}/utils/timezone.pyi | 0 .../utils/topological_sort.pyi | 0 .../utils/translation/__init__.pyi | 1 + .../utils/translation/reloader.pyi | 0 .../utils/translation/template.pyi | 0 .../utils/translation/trans_null.pyi | 0 .../utils/translation/trans_real.pyi | 0 .../{ => django-stubs}/utils/tree.pyi | 0 .../{ => django-stubs}/utils/version.pyi | 0 .../{ => django-stubs}/utils/xmlutils.pyi | 0 .../{ => django-stubs}/views/__init__.pyi | 0 .../{ => django-stubs}/views/csrf.pyi | 0 .../{ => django-stubs}/views/debug.pyi | 0 .../views/decorators/__init__.pyi | 0 .../views/decorators/cache.pyi | 0 .../views/decorators/clickjacking.pyi | 0 .../views/decorators/csrf.pyi | 0 .../views/decorators/debug.pyi | 0 .../views/decorators/gzip.pyi | 0 .../views/decorators/http.pyi | 0 .../views/decorators/vary.pyi | 0 .../{ => django-stubs}/views/defaults.pyi | 0 .../views/generic/__init__.pyi | 0 .../{ => django-stubs}/views/generic/base.pyi | 0 .../views/generic/dates.pyi | 0 .../views/generic/detail.pyi | 0 .../{ => django-stubs}/views/generic/edit.pyi | 0 .../{ => django-stubs}/views/generic/list.pyi | 0 .../{ => django-stubs}/views/i18n.pyi | 0 .../{ => django-stubs}/views/static.pyi | 0 .../third_party/django-stubs/flake8-pyi.ini | 14 + .../jedi/third_party/django-stubs/mypy.ini | 2 + .../mypy_django_plugin/__init__.py} | 0 .../mypy_django_plugin/django/__init__.py} | 0 .../mypy_django_plugin/django/context.py | 383 +++ .../mypy_django_plugin/lib/__init__.py} | 0 .../mypy_django_plugin/lib/fullnames.py | 39 + .../mypy_django_plugin/lib/helpers.py | 375 +++ .../django-stubs/mypy_django_plugin/main.py | 259 ++ .../transformers/__init__.py} | 0 .../mypy_django_plugin/transformers/fields.py | 157 + .../mypy_django_plugin/transformers/forms.py | 52 + .../transformers/init_create.py | 75 + .../transformers/managers.py | 77 + .../mypy_django_plugin/transformers/meta.py | 52 + .../mypy_django_plugin/transformers/models.py | 360 ++ .../transformers/orm_lookups.py | 51 + .../transformers/querysets.py | 192 ++ .../transformers/request.py | 26 + .../transformers/settings.py | 50 + .../jedi/third_party/django-stubs/pytest.ini | 9 + .../third_party/django-stubs/reformat.xsh | 3 + .../jedi/third_party/django-stubs/release.xsh | 11 + .../scripts/__init__.py} | 0 .../scripts/build_import_all_test.py | 28 + .../scripts/catch_non_abstract_annotation.py | 88 + .../scripts/django_tests_settings.py | 233 ++ .../scripts/enabled_test_modules.py | 508 +++ .../third_party/django-stubs/scripts/mypy.ini | 14 + .../scripts/tests_extension_hook.py | 30 + .../django-stubs/scripts/typecheck_tests.py | 162 + .../jedi/third_party/django-stubs/setup.cfg | 19 + .../jedi/third_party/django-stubs/setup.py | 54 + .../django-stubs/test-data/plugins.ini | 5 + .../typecheck/contrib/admin/test_options.yml | 126 + .../contrib/auth/test_decorators.yml | 43 + .../typecheck/db/test_transaction.yml | 28 + .../test-data/typecheck/fields/test_base.yml | 153 + .../fields/test_generic_foreign_key.yml | 21 + .../typecheck/fields/test_nullable.yml | 70 + .../typecheck/fields/test_postgres_fields.yml | 35 + .../typecheck/fields/test_related.yml | 674 ++++ .../managers/querysets/test_basic_methods.yml | 47 + .../managers/querysets/test_filter.yml | 256 ++ .../managers/querysets/test_from_queryset.yml | 181 + .../managers/querysets/test_values.yml | 126 + .../managers/querysets/test_values_list.yml | 243 ++ .../typecheck/managers/test_managers.yml | 337 ++ .../typecheck/models/test_contrib_models.yml | 28 + .../typecheck/models/test_create.yml | 113 + .../typecheck/models/test_extra_methods.yml | 56 + .../typecheck/models/test_inheritance.yml | 115 + .../test-data/typecheck/models/test_init.yml | 257 ++ .../typecheck/models/test_meta_options.yml | 58 + .../typecheck/models/test_proxy_models.yml | 21 + .../test-data/typecheck/models/test_state.yml | 14 + .../typecheck/test/test_testcase.yml | 12 + .../test-data/typecheck/test_config.yml | 40 + .../test-data/typecheck/test_forms.yml | 58 + .../test-data/typecheck/test_helpers.yml | 62 + .../test-data/typecheck/test_import_all.yml | 442 +++ .../test-data/typecheck/test_request.yml | 29 + .../test-data/typecheck/test_settings.yml | 50 + .../test-data/typecheck/test_shortcuts.yml | 59 + .../typecheck/utils/test_decorators.yml | 20 + .../typecheck/utils/test_functional.yml | 18 + .../jedi/third_party/typeshed/CONTRIBUTING.md | 404 +++ .../jedi/third_party/typeshed/LICENSE | 238 ++ .../jedi/third_party/typeshed/README.md | 204 ++ .../jedi/third_party/typeshed/pre-commit | 28 + .../typeshed/requirements-tests-py3.txt | 8 + .../typeshed/scripts/generate_proto_stubs.sh | 68 + .../typeshed/scripts/migrate_script.py | 337 ++ .../scripts/update-stubtest-whitelist.py | 59 + .../typeshed/stdlib/2/BaseHTTPServer.pyi | 18 +- .../typeshed/stdlib/2/CGIHTTPServer.pyi | 4 +- .../typeshed/stdlib/2/ConfigParser.pyi | 10 +- .../third_party/typeshed/stdlib/2/Cookie.pyi | 0 .../typeshed/stdlib/2/HTMLParser.pyi | 7 +- .../third_party/typeshed/stdlib/2/Queue.pyi | 6 +- .../typeshed/stdlib/2/SimpleHTTPServer.pyi | 4 +- .../typeshed/stdlib/2/SocketServer.pyi | 104 +- .../typeshed/stdlib/2/StringIO.pyi | 4 +- .../typeshed/stdlib/2/UserDict.pyi | 33 +- .../typeshed/stdlib/2/UserList.pyi | 2 +- .../typeshed/stdlib/2/UserString.pyi | 2 +- .../typeshed/stdlib/2/__builtin__.pyi | 1669 ++++------ .../third_party/typeshed/stdlib/2/_ast.pyi | 43 +- .../typeshed/stdlib/2/_collections.pyi | 8 +- .../typeshed/stdlib/2/_functools.pyi | 11 +- .../typeshed/stdlib/2/_hotshot.pyi | 7 +- .../third_party/typeshed/stdlib/2/_io.pyi | 42 +- .../third_party/typeshed/stdlib/2/_json.pyi | 2 +- .../third_party/typeshed/stdlib/2/_md5.pyi | 0 .../third_party/typeshed/stdlib/2/_sha.pyi | 0 .../third_party/typeshed/stdlib/2/_sha256.pyi | 0 .../third_party/typeshed/stdlib/2/_sha512.pyi | 0 .../third_party/typeshed/stdlib/2/_socket.pyi | 6 +- .../third_party/typeshed/stdlib/2/_sre.pyi | 6 +- .../third_party/typeshed/stdlib/2/_struct.pyi | 3 - .../typeshed/stdlib/2/_symtable.pyi | 6 +- .../typeshed/stdlib/2/_threading_local.pyi | 1 - .../third_party/typeshed/stdlib/2/_winreg.pyi | 97 + .../third_party/typeshed/stdlib/2/abc.pyi | 4 +- .../third_party/typeshed/stdlib/2/ast.pyi | 2 +- .../third_party/typeshed/stdlib/2/atexit.pyi | 4 +- .../typeshed/stdlib/2/builtins.pyi | 1195 +++++++ .../third_party/typeshed/stdlib/2/cPickle.pyi | 8 +- .../typeshed/stdlib/2/cStringIO.pyi | 8 +- .../typeshed/stdlib/2/collections.pyi | 55 +- .../typeshed/stdlib/2/commands.pyi | 4 +- .../typeshed/stdlib/2/compileall.pyi | 13 +- .../typeshed/stdlib/2/cookielib.pyi | 42 +- .../typeshed/stdlib/2/copy_reg.pyi | 10 +- .../typeshed/stdlib/2/dircache.pyi | 2 - .../typeshed/stdlib/2/distutils/__init__.pyi | 0 .../stdlib/2/distutils/archive_util.pyi | 12 + .../{2and3 => 2}/distutils/bcppcompiler.pyi | 3 - .../typeshed/stdlib/2/distutils/ccompiler.pyi | 150 + .../stdlib/{2and3 => 2}/distutils/cmd.pyi | 53 +- .../2/distutils/command}/__init__.pyi | 0 .../distutils/command/bdist.pyi} | 0 .../distutils/command/bdist_dumb.pyi} | 0 .../distutils/command/bdist_msi.pyi | 0 .../distutils/command/bdist_packager.pyi} | 0 .../distutils/command/bdist_rpm.pyi} | 0 .../distutils/command/bdist_wininst.pyi} | 0 .../distutils/command/build.pyi} | 0 .../distutils/command/build_clib.pyi} | 0 .../distutils/command/build_ext.pyi} | 0 .../stdlib/2/distutils/command/build_py.pyi | 6 + .../distutils/command/build_scripts.pyi} | 0 .../distutils/command/check.pyi} | 0 .../distutils/command/clean.pyi} | 0 .../stdlib/2/distutils/command/config.pyi | 87 + .../distutils/command/install.pyi | 2 - .../distutils/command/install_data.pyi} | 0 .../2/distutils/command/install_egg_info.pyi | 10 + .../distutils/command/install_headers.pyi} | 0 .../distutils/command/install_lib.pyi} | 0 .../distutils/command/install_scripts.pyi} | 0 .../stdlib/2/distutils/command/register.pyi | 0 .../stdlib/2/distutils/command/sdist.pyi | 0 .../stdlib/2/distutils/command/upload.pyi | 8 + .../typeshed/stdlib/2/distutils/config.pyi | 17 + .../typeshed/stdlib/2/distutils/core.pyi | 48 + .../distutils/cygwinccompiler.pyi | 3 - .../typeshed/stdlib/2/distutils/debug.pyi | 1 + .../{2and3 => 2}/distutils/dep_util.pyi | 5 +- .../typeshed/stdlib/2/distutils/dir_util.pyi | 15 + .../stdlib/{2and3 => 2}/distutils/dist.pyi | 6 +- .../stdlib/2/distutils/emxccompiler.pyi | 2 - .../stdlib/{2and3 => 2}/distutils/errors.pyi | 0 .../typeshed/stdlib/2/distutils/extension.pyi | 21 + .../{2and3 => 2}/distutils/fancy_getopt.pyi | 14 +- .../typeshed/stdlib/2/distutils/file_util.pyi | 14 + .../typeshed/stdlib/2/distutils/filelist.pyi | 1 + .../stdlib/{2and3 => 2}/distutils/log.pyi | 17 +- .../{2and3 => 2}/distutils/msvccompiler.pyi | 3 - .../typeshed/stdlib/2/distutils/spawn.pyi | 4 + .../{2and3 => 2}/distutils/sysconfig.pyi | 11 +- .../typeshed/stdlib/2/distutils/text_file.pyi | 21 + .../{2and3 => 2}/distutils/unixccompiler.pyi | 3 - .../typeshed/stdlib/2/distutils/util.pyi | 23 + .../typeshed/stdlib/2/distutils/version.pyi | 33 + .../typeshed/stdlib/2/dummy_thread.pyi | 0 .../typeshed/stdlib/2/email/MIMEText.pyi | 0 .../typeshed/stdlib/2/email/__init__.pyi | 0 .../typeshed/stdlib/2/email/_parseaddr.pyi | 0 .../typeshed/stdlib/2/email/base64mime.pyi | 3 + .../typeshed/stdlib/2/email/charset.pyi | 0 .../typeshed/stdlib/2/email/encoders.pyi | 0 .../typeshed/stdlib/2/email/feedparser.pyi | 1 - .../typeshed/stdlib/2/email/generator.pyi | 1 - .../typeshed/stdlib/2/email/header.pyi | 3 +- .../typeshed/stdlib/2/email/iterators.pyi | 0 .../typeshed/stdlib/2/email/message.pyi | 0 .../typeshed/stdlib/2/email/mime/__init__.pyi | 0 .../stdlib/2/email/mime/application.pyi | 10 +- .../typeshed/stdlib/2/email/mime/audio.pyi | 1 - .../typeshed/stdlib/2/email/mime/base.pyi | 0 .../typeshed/stdlib/2/email/mime/image.pyi | 1 - .../typeshed/stdlib/2/email/mime/message.pyi | 1 - .../stdlib/2/email/mime/multipart.pyi | 0 .../stdlib/2/email/mime/nonmultipart.pyi | 0 .../typeshed/stdlib/2/email/mime/text.pyi | 0 .../typeshed/stdlib/2/email/parser.pyi | 0 .../typeshed/stdlib/2/email/quoprimime.pyi | 0 .../typeshed/stdlib/2/email/utils.pyi | 12 +- .../typeshed/stdlib/2/encodings/__init__.pyi | 7 +- .../typeshed/stdlib/2/encodings/utf_8.pyi | 0 .../typeshed/stdlib/2/exceptions.pyi | 98 +- .../third_party/typeshed/stdlib/2/fcntl.pyi | 17 +- .../third_party/typeshed/stdlib/2/fnmatch.pyi | 0 .../typeshed/stdlib/2/functools.pyi | 23 +- .../typeshed/stdlib/2/future_builtins.pyi | 12 +- .../jedi/third_party/typeshed/stdlib/2/gc.pyi | 6 +- .../third_party/typeshed/stdlib/2/getopt.pyi | 0 .../third_party/typeshed/stdlib/2/getpass.pyi | 4 +- .../third_party/typeshed/stdlib/2/gettext.pyi | 23 +- .../third_party/typeshed/stdlib/2/glob.pyi | 2 +- .../third_party/typeshed/stdlib/2/gzip.pyi | 7 +- .../third_party/typeshed/stdlib/2/hashlib.pyi | 3 - .../third_party/typeshed/stdlib/2/heapq.pyi | 15 +- .../typeshed/stdlib/2/htmlentitydefs.pyi | 0 .../third_party/typeshed/stdlib/2/httplib.pyi | 41 +- .../third_party/typeshed/stdlib/2/imp.pyi | 4 +- .../typeshed/stdlib/2/importlib.pyi | 0 .../third_party/typeshed/stdlib/2/inspect.pyi | 44 +- .../jedi/third_party/typeshed/stdlib/2/io.pyi | 54 +- .../typeshed/stdlib/2/itertools.pyi | 257 +- .../third_party/typeshed/stdlib/2/json.pyi | 153 +- .../typeshed/stdlib/2/markupbase.pyi | 1 - .../third_party/typeshed/stdlib/2/md5.pyi | 5 +- .../typeshed/stdlib/2/mimetools.pyi | 2 +- .../stdlib/2/multiprocessing/__init__.pyi | 18 +- .../2/multiprocessing/dummy/__init__.pyi | 15 +- .../2/multiprocessing/dummy/connection.pyi | 1 - .../stdlib/2/multiprocessing/pool.pyi | 77 +- .../stdlib/2/multiprocessing/process.pyi | 5 +- .../stdlib/2/multiprocessing/util.pyi | 2 +- .../third_party/typeshed/stdlib/2/mutex.pyi | 4 +- .../third_party/typeshed/stdlib/2/ntpath.pyi | 85 + .../typeshed/stdlib/2/nturl2path.pyi | 0 .../typeshed/stdlib/2/os/__init__.pyi | 217 +- .../third_party/typeshed/stdlib/2/os/path.pyi | 196 +- .../typeshed/stdlib/2/os2emxpath.pyi | 196 +- .../third_party/typeshed/stdlib/2/pipes.pyi | 4 +- .../typeshed/stdlib/2/platform.pyi | 4 - .../third_party/typeshed/stdlib/2/popen2.pyi | 5 +- .../third_party/typeshed/stdlib/2/posix.pyi | 16 +- .../typeshed/stdlib/2/posixpath.pyi | 85 + .../third_party/typeshed/stdlib/2/random.pyi | 22 +- .../jedi/third_party/typeshed/stdlib/2/re.pyi | 92 +- .../third_party/typeshed/stdlib/2/repr.pyi | 1 + .../typeshed/stdlib/2/resource.pyi | 3 +- .../third_party/typeshed/stdlib/2/rfc822.pyi | 4 - .../typeshed/stdlib/2/robotparser.pyi | 0 .../third_party/typeshed/stdlib/2/runpy.pyi | 0 .../third_party/typeshed/stdlib/2/sets.pyi | 5 +- .../third_party/typeshed/stdlib/2/sha.pyi | 3 +- .../third_party/typeshed/stdlib/2/shelve.pyi | 11 +- .../third_party/typeshed/stdlib/2/shlex.pyi | 7 +- .../third_party/typeshed/stdlib/2/signal.pyi | 2 +- .../third_party/typeshed/stdlib/2/smtplib.pyi | 0 .../third_party/typeshed/stdlib/2/spwd.pyi | 0 .../typeshed/stdlib/2/sre_constants.pyi | 5 +- .../typeshed/stdlib/2/sre_parse.pyi | 5 +- .../third_party/typeshed/stdlib/2/stat.pyi | 1 - .../third_party/typeshed/stdlib/2/string.pyi | 17 +- .../typeshed/stdlib/2/stringold.pyi | 2 - .../third_party/typeshed/stdlib/2/strop.pyi | 2 - .../typeshed/stdlib/2/subprocess.pyi | 141 +- .../third_party/typeshed/stdlib/2/symbol.pyi | 2 - .../third_party/typeshed/stdlib/2/sys.pyi | 16 +- .../typeshed/stdlib/2/tempfile.pyi | 33 +- .../typeshed/stdlib/2/textwrap.pyi | 72 +- .../third_party/typeshed/stdlib/2/thread.pyi | 3 +- .../third_party/typeshed/stdlib/2/toaiff.pyi | 3 - .../typeshed/stdlib/2/tokenize.pyi | 5 +- .../third_party/typeshed/stdlib/2/types.pyi | 34 +- .../third_party/typeshed/stdlib/2/typing.pyi | 163 +- .../typeshed/stdlib/2/unittest.pyi | 268 +- .../third_party/typeshed/stdlib/2/urllib.pyi | 3 +- .../third_party/typeshed/stdlib/2/urllib2.pyi | 44 +- .../typeshed/stdlib/2/urlparse.pyi | 33 +- .../third_party/typeshed/stdlib/2/user.pyi | 5 +- .../third_party/typeshed/stdlib/2/whichdb.pyi | 2 - .../typeshed/stdlib/2/xmlrpclib.pyi | 39 +- .../typeshed/stdlib/2and3/__future__.pyi | 0 .../typeshed/stdlib/2and3/_bisect.pyi | 15 +- .../typeshed/stdlib/2and3/_codecs.pyi | 109 +- .../typeshed/stdlib/2and3/_csv.pyi | 16 +- .../typeshed/stdlib/2and3/_curses.pyi | 119 +- .../stdlib/2and3/_dummy_threading.pyi | 187 ++ .../typeshed/stdlib/2and3/_heapq.pyi | 19 +- .../typeshed/stdlib/2and3/_msi.pyi | 49 + .../typeshed/stdlib/2and3/_random.pyi | 8 +- .../stdlib/2and3/_typeshed/__init__.pyi | 183 + .../typeshed/stdlib/2and3/_typeshed/wsgi.pyi | 35 + .../typeshed/stdlib/2and3/_typeshed/xml.pyi | 10 + .../typeshed/stdlib/2and3/_warnings.pyi | 81 +- .../typeshed/stdlib/2and3/_weakref.pyi | 12 +- .../typeshed/stdlib/2and3/_weakrefset.pyi | 16 +- .../typeshed/stdlib/2and3/aifc.pyi | 33 +- .../typeshed/stdlib/2and3/antigravity.pyi | 4 + .../typeshed/stdlib/2and3/argparse.pyi | 411 ++- .../typeshed/stdlib/2and3/array.pyi | 60 +- .../typeshed/stdlib/2and3/asynchat.pyi | 4 +- .../typeshed/stdlib/2and3/asyncore.pyi | 100 +- .../typeshed/stdlib/2and3/audioop.pyi | 68 +- .../typeshed/stdlib/2and3/base64.pyi | 31 +- .../third_party/typeshed/stdlib/2and3/bdb.pyi | 34 +- .../typeshed/stdlib/2and3/binascii.pyi | 56 +- .../typeshed/stdlib/2and3/binhex.pyi | 8 +- .../typeshed/stdlib/2and3/bisect.pyi | 15 +- .../typeshed/stdlib/2and3/builtins.pyi | 1650 --------- .../third_party/typeshed/stdlib/2and3/bz2.pyi | 62 +- .../typeshed/stdlib/2and3/cProfile.pyi | 25 +- .../typeshed/stdlib/2and3/calendar.pyi | 3 +- .../third_party/typeshed/stdlib/2and3/cgi.pyi | 94 +- .../typeshed/stdlib/2and3/cgitb.pyi | 34 +- .../typeshed/stdlib/2and3/chunk.pyi | 3 - .../typeshed/stdlib/2and3/cmath.pyi | 48 +- .../third_party/typeshed/stdlib/2and3/cmd.pyi | 6 +- .../typeshed/stdlib/2and3/code.pyi | 34 +- .../typeshed/stdlib/2and3/codecs.pyi | 93 +- .../typeshed/stdlib/2and3/codeop.pyi | 3 - .../typeshed/stdlib/2and3/colorsys.pyi | 2 - .../typeshed/stdlib/2and3/contextlib.pyi | 91 +- .../typeshed/stdlib/2and3/copy.pyi | 10 +- .../typeshed/stdlib/2and3/crypt.pyi | 2 +- .../third_party/typeshed/stdlib/2and3/csv.pyi | 34 +- .../typeshed/stdlib/2and3/ctypes/__init__.pyi | 149 +- .../typeshed/stdlib/2and3/ctypes/util.pyi | 7 +- .../typeshed/stdlib/2and3/ctypes/wintypes.pyi | 29 +- .../typeshed/stdlib/2and3/curses/__init__.pyi | 6 +- .../typeshed/stdlib/2and3/curses/ascii.pyi | 4 +- .../typeshed/stdlib/2and3/curses/panel.pyi | 2 +- .../typeshed/stdlib/2and3/curses/textpad.pyi | 6 +- .../typeshed/stdlib/2and3/datetime.pyi | 142 +- .../typeshed/stdlib/2and3/decimal.pyi | 272 +- .../typeshed/stdlib/2and3/difflib.pyi | 145 +- .../third_party/typeshed/stdlib/2and3/dis.pyi | 46 +- .../stdlib/2and3/distutils/archive_util.pyi | 12 - .../stdlib/2and3/distutils/ccompiler.pyi | 119 - .../2and3/distutils/command/build_py.pyi | 10 - .../typeshed/stdlib/2and3/distutils/core.pyi | 50 - .../typeshed/stdlib/2and3/distutils/debug.pyi | 3 - .../stdlib/2and3/distutils/dir_util.pyi | 15 - .../stdlib/2and3/distutils/extension.pyi | 39 - .../stdlib/2and3/distutils/file_util.pyi | 12 - .../stdlib/2and3/distutils/filelist.pyi | 3 - .../typeshed/stdlib/2and3/distutils/spawn.pyi | 8 - .../stdlib/2and3/distutils/text_file.pyi | 18 - .../typeshed/stdlib/2and3/distutils/util.pyi | 20 - .../stdlib/2and3/distutils/version.pyi | 54 - .../typeshed/stdlib/2and3/doctest.pyi | 128 +- .../typeshed/stdlib/2and3/dummy_threading.pyi | 2 + .../stdlib/2and3/ensurepip/__init__.pyi | 25 +- .../typeshed/stdlib/2and3/errno.pyi | 3 - .../typeshed/stdlib/2and3/filecmp.pyi | 49 +- .../typeshed/stdlib/2and3/fileinput.pyi | 36 +- .../typeshed/stdlib/2and3/formatter.pyi | 24 +- .../typeshed/stdlib/2and3/fractions.pyi | 169 +- .../typeshed/stdlib/2and3/ftplib.pyi | 49 +- .../typeshed/stdlib/2and3/genericpath.pyi | 12 +- .../third_party/typeshed/stdlib/2and3/grp.pyi | 0 .../typeshed/stdlib/2and3/hmac.pyi | 36 +- .../typeshed/stdlib/2and3/imaplib.pyi | 148 +- .../typeshed/stdlib/2and3/imghdr.pyi | 18 +- .../typeshed/stdlib/2and3/keyword.pyi | 10 +- .../stdlib/2and3/lib2to3/__init__.pyi | 1 - .../stdlib/2and3/lib2to3/pgen2/__init__.pyi | 10 - .../stdlib/2and3/lib2to3/pgen2/driver.pyi | 20 +- .../stdlib/2and3/lib2to3/pgen2/grammar.pyi | 13 +- .../stdlib/2and3/lib2to3/pgen2/literals.pyi | 2 - .../stdlib/2and3/lib2to3/pgen2/parse.pyi | 7 +- .../stdlib/2and3/lib2to3/pgen2/pgen.pyi | 16 +- .../stdlib/2and3/lib2to3/pgen2/token.pyi | 2 - .../stdlib/2and3/lib2to3/pgen2/tokenize.pyi | 11 +- .../typeshed/stdlib/2and3/lib2to3/pygram.pyi | 3 - .../typeshed/stdlib/2and3/lib2to3/pytree.pyi | 25 +- .../typeshed/stdlib/2and3/linecache.pyi | 1 + .../typeshed/stdlib/2and3/locale.pyi | 32 +- .../stdlib/2and3/logging/__init__.pyi | 934 ++++-- .../typeshed/stdlib/2and3/logging/config.pyi | 37 +- .../stdlib/2and3/logging/handlers.pyi | 241 +- .../typeshed/stdlib/2and3/macpath.pyi | 139 +- .../typeshed/stdlib/2and3/mailbox.pyi | 104 +- .../typeshed/stdlib/2and3/mailcap.pyi | 7 +- .../typeshed/stdlib/2and3/marshal.pyi | 10 +- .../typeshed/stdlib/2and3/math.pyi | 140 +- .../typeshed/stdlib/2and3/mimetypes.pyi | 28 +- .../typeshed/stdlib/2and3/mmap.pyi | 39 +- .../typeshed/stdlib/2and3/modulefinder.pyi | 42 +- .../typeshed/stdlib/2and3/msilib/__init__.pyi | 196 ++ .../typeshed/stdlib/2and3/msilib/schema.pyi | 97 + .../typeshed/stdlib/2and3/msilib/sequence.pyi | 14 + .../typeshed/stdlib/2and3/msilib/text.pyi | 9 + .../typeshed/stdlib/2and3/msvcrt.pyi | 24 + .../typeshed/stdlib/2and3/netrc.pyi | 6 +- .../third_party/typeshed/stdlib/2and3/nis.pyi | 3 +- .../typeshed/stdlib/2and3/ntpath.pyi | 177 - .../typeshed/stdlib/2and3/numbers.pyi | 94 +- .../typeshed/stdlib/2and3/opcode.pyi | 10 +- .../typeshed/stdlib/2and3/operator.pyi | 213 +- .../typeshed/stdlib/2and3/optparse.pyi | 74 +- .../typeshed/stdlib/2and3/parser.pyi | 22 + .../third_party/typeshed/stdlib/2and3/pdb.pyi | 232 +- .../typeshed/stdlib/2and3/pickle.pyi | 105 +- .../typeshed/stdlib/2and3/pickletools.pyi | 48 +- .../typeshed/stdlib/2and3/pkgutil.pyi | 32 +- .../typeshed/stdlib/2and3/plistlib.pyi | 79 +- .../typeshed/stdlib/2and3/poplib.pyi | 30 +- .../typeshed/stdlib/2and3/posixpath.pyi | 177 - .../typeshed/stdlib/2and3/pprint.pyi | 117 +- .../typeshed/stdlib/2and3/profile.pyi | 22 +- .../typeshed/stdlib/2and3/pstats.pyi | 39 +- .../third_party/typeshed/stdlib/2and3/pty.pyi | 3 +- .../third_party/typeshed/stdlib/2and3/pwd.pyi | 0 .../typeshed/stdlib/2and3/py_compile.pyi | 36 +- .../typeshed/stdlib/2and3/pyclbr.pyi | 43 +- .../typeshed/stdlib/2and3/pydoc.pyi | 153 +- .../stdlib/2and3/pydoc_data/__init__.pyi | 0 .../stdlib/2and3/pydoc_data/topics.pyi | 3 + .../stdlib/2and3/pyexpat/__init__.pyi | 38 +- .../typeshed/stdlib/2and3/pyexpat/errors.pyi | 0 .../typeshed/stdlib/2and3/pyexpat/model.pyi | 0 .../typeshed/stdlib/2and3/quopri.pyi | 2 - .../typeshed/stdlib/2and3/readline.pyi | 14 +- .../typeshed/stdlib/2and3/rlcompleter.pyi | 5 +- .../typeshed/stdlib/2and3/sched.pyi | 19 +- .../typeshed/stdlib/2and3/select.pyi | 258 +- .../typeshed/stdlib/2and3/shutil.pyi | 186 +- .../typeshed/stdlib/2and3/site.pyi | 8 +- .../typeshed/stdlib/2and3/smtpd.pyi | 38 +- .../typeshed/stdlib/2and3/sndhdr.pyi | 15 +- .../typeshed/stdlib/2and3/socket.pyi | 268 +- .../stdlib/2and3/sqlite3/__init__.pyi | 0 .../typeshed/stdlib/2and3/sqlite3/dbapi2.pyi | 265 +- .../typeshed/stdlib/2and3/sre_compile.pyi | 21 +- .../third_party/typeshed/stdlib/2and3/ssl.pyi | 286 +- .../typeshed/stdlib/2and3/stringprep.pyi | 2 - .../typeshed/stdlib/2and3/struct.pyi | 22 +- .../typeshed/stdlib/2and3/sunau.pyi | 8 +- .../typeshed/stdlib/2and3/symtable.pyi | 2 +- .../typeshed/stdlib/2and3/sysconfig.pyi | 6 +- .../typeshed/stdlib/2and3/syslog.pyi | 1 - .../typeshed/stdlib/2and3/tabnanny.pyi | 14 +- .../typeshed/stdlib/2and3/tarfile.pyi | 242 +- .../typeshed/stdlib/2and3/telnetlib.pyi | 9 +- .../typeshed/stdlib/2and3/termios.pyi | 20 +- .../typeshed/stdlib/2and3/this.pyi | 4 + .../typeshed/stdlib/2and3/threading.pyi | 125 +- .../typeshed/stdlib/2and3/time.pyi | 71 +- .../typeshed/stdlib/2and3/timeit.pyi | 34 +- .../typeshed/stdlib/2and3/token.pyi | 10 + .../typeshed/stdlib/2and3/trace.pyi | 42 +- .../typeshed/stdlib/2and3/traceback.pyi | 144 +- .../third_party/typeshed/stdlib/2and3/tty.pyi | 2 - .../typeshed/stdlib/2and3/turtle.pyi | 157 +- .../typeshed/stdlib/2and3/unicodedata.pyi | 4 +- .../third_party/typeshed/stdlib/2and3/uu.pyi | 9 +- .../typeshed/stdlib/2and3/uuid.pyi | 43 +- .../typeshed/stdlib/2and3/warnings.pyi | 46 +- .../typeshed/stdlib/2and3/wave.pyi | 12 +- .../typeshed/stdlib/2and3/weakref.pyi | 51 +- .../typeshed/stdlib/2and3/webbrowser.pyi | 35 +- .../typeshed/stdlib/2and3/winsound.pyi | 27 + .../stdlib/2and3/wsgiref/__init__.pyi | 0 .../stdlib/2and3/wsgiref/handlers.pyi | 28 +- .../typeshed/stdlib/2and3/wsgiref/headers.pyi | 2 +- .../stdlib/2and3/wsgiref/simple_server.pyi | 11 +- .../typeshed/stdlib/2and3/wsgiref/types.pyi | 45 +- .../typeshed/stdlib/2and3/wsgiref/util.pyi | 6 +- .../stdlib/2and3/wsgiref/validate.pyi | 5 +- .../typeshed/stdlib/2and3/xdrlib.pyi | 3 +- .../typeshed/stdlib/2and3/xml/__init__.pyi | 0 .../stdlib/2and3/xml/dom/NodeFilter.pyi | 19 + .../stdlib/2and3/xml/dom/__init__.pyi | 68 + .../typeshed/stdlib/2and3/xml/dom/domreg.pyi | 10 + .../stdlib/2and3/xml/dom/expatbuilder.pyi | 3 + .../stdlib/2and3/xml/dom/minicompat.pyi | 3 + .../typeshed/stdlib/2and3/xml/dom/minidom.pyi | 6 + .../typeshed/stdlib/2and3/xml/dom/pulldom.pyi | 3 + .../stdlib/2and3/xml/dom/xmlbuilder.pyi | 3 + .../stdlib/2and3/xml/etree/ElementInclude.pyi | 16 +- .../stdlib/2and3/xml/etree/ElementPath.pyi | 10 +- .../stdlib/2and3/xml/etree/ElementTree.pyi | 241 +- .../stdlib/2and3/xml/etree/__init__.pyi | 0 .../stdlib/2and3/xml/etree/cElementTree.pyi | 2 - .../stdlib/2and3/xml/parsers/__init__.pyi | 0 .../2and3/xml/parsers/expat/__init__.pyi | 0 .../stdlib/2and3/xml/parsers/expat/errors.pyi | 0 .../stdlib/2and3/xml/parsers/expat/model.pyi | 0 .../stdlib/2and3/xml/sax/__init__.pyi | 21 +- .../typeshed/stdlib/2and3/xml/sax/handler.pyi | 0 .../stdlib/2and3/xml/sax/saxutils.pyi | 24 +- .../stdlib/2and3/xml/sax/xmlreader.pyi | 10 +- .../typeshed/stdlib/2and3/zipfile.pyi | 140 +- .../typeshed/stdlib/2and3/zipimport.pyi | 22 +- .../typeshed/stdlib/2and3/zlib.pyi | 28 +- .../typeshed/stdlib/3.7/_py_abc.pyi | 10 + .../typeshed/stdlib/3.7/contextvars.pyi | 18 +- .../typeshed/stdlib/3.7/dataclasses.pyi | 88 +- .../typeshed/stdlib/3.9/graphlib.pyi | 16 + .../typeshed/stdlib/3.9/zoneinfo/__init__.pyi | 32 + .../third_party/typeshed/stdlib/3/_ast.pyi | 161 +- .../typeshed/stdlib/3/_bootlocale.pyi | 1 + .../typeshed/stdlib/3/_compat_pickle.pyi | 10 + .../typeshed/stdlib/3/_compression.pyi | 31 +- .../typeshed/stdlib/3/_decimal.pyi | 1 + .../typeshed/stdlib/3/_dummy_thread.pyi | 0 .../third_party/typeshed/stdlib/3/_imp.pyi | 23 +- .../stdlib/3/_importlib_modulespec.pyi | 12 +- .../third_party/typeshed/stdlib/3/_json.pyi | 20 +- .../typeshed/stdlib/3/_markupbase.pyi | 1 - .../typeshed/stdlib/3/_operator.pyi | 95 +- .../typeshed/stdlib/3/_osx_support.pyi | 33 + .../typeshed/stdlib/3/_posixsubprocess.pyi | 30 +- .../typeshed/stdlib/3/_pydecimal.pyi | 3 + .../typeshed/stdlib/3/_sitebuiltins.pyi | 16 + .../third_party/typeshed/stdlib/3/_stat.pyi | 4 - .../typeshed/stdlib/3/_subprocess.pyi | 38 - .../third_party/typeshed/stdlib/3/_thread.pyi | 29 +- .../typeshed/stdlib/3/_threading_local.pyi | 1 - .../typeshed/stdlib/3/_tkinter.pyi | 93 + .../typeshed/stdlib/3/_tracemalloc.pyi | 23 +- .../third_party/typeshed/stdlib/3/_winapi.pyi | 109 +- .../third_party/typeshed/stdlib/3/abc.pyi | 9 +- .../third_party/typeshed/stdlib/3/ast.pyi | 166 +- .../typeshed/stdlib/3/asyncio/__init__.pyi | 181 +- .../typeshed/stdlib/3/asyncio/base_events.pyi | 306 +- .../stdlib/3/asyncio/base_futures.pyi | 22 + .../stdlib/3/asyncio/base_subprocess.pyi | 72 + .../typeshed/stdlib/3/asyncio/base_tasks.pyi | 9 + .../typeshed/stdlib/3/asyncio/compat.pyi | 8 + .../typeshed/stdlib/3/asyncio/constants.pyi | 7 +- .../typeshed/stdlib/3/asyncio/coroutines.pyi | 2 +- .../typeshed/stdlib/3/asyncio/events.pyi | 396 ++- .../typeshed/stdlib/3/asyncio/exceptions.pyi | 0 .../stdlib/3/asyncio/format_helpers.pyi | 20 + .../typeshed/stdlib/3/asyncio/futures.pyi | 53 +- .../typeshed/stdlib/3/asyncio/locks.pyi | 43 +- .../typeshed/stdlib/3/asyncio/log.pyi | 3 + .../stdlib/3/asyncio/proactor_events.pyi | 101 +- .../typeshed/stdlib/3/asyncio/protocols.pyi | 14 +- .../typeshed/stdlib/3/asyncio/queues.pyi | 17 +- .../typeshed/stdlib/3/asyncio/runners.pyi | 11 +- .../stdlib/3/asyncio/selector_events.pyi | 43 +- .../typeshed/stdlib/3/asyncio/sslproto.pyi | 133 + .../typeshed/stdlib/3/asyncio/staggered.pyi | 12 + .../typeshed/stdlib/3/asyncio/streams.pyi | 60 +- .../typeshed/stdlib/3/asyncio/subprocess.pyi | 46 +- .../typeshed/stdlib/3/asyncio/tasks.pyi | 218 +- .../typeshed/stdlib/3/asyncio/threads.pyi | 7 + .../typeshed/stdlib/3/asyncio/transports.pyi | 22 +- .../typeshed/stdlib/3/asyncio/trsock.pyi | 86 + .../typeshed/stdlib/3/asyncio/unix_events.pyi | 57 + .../stdlib/3/asyncio/windows_events.pyi | 62 +- .../stdlib/3/asyncio/windows_utils.pyi | 13 +- .../third_party/typeshed/stdlib/3/atexit.pyi | 2 - .../typeshed/stdlib/3/builtins.pyi | 1387 ++++++++ .../stdlib/3/collections/__init__.pyi | 133 +- .../typeshed/stdlib/3/collections/abc.pyi | 29 +- .../typeshed/stdlib/3/compileall.pyi | 87 +- .../typeshed/stdlib/3/concurrent/__init__.pyi | 0 .../stdlib/3/concurrent/futures/__init__.pyi | 23 +- .../stdlib/3/concurrent/futures/_base.pyi | 85 +- .../stdlib/3/concurrent/futures/process.pyi | 22 +- .../stdlib/3/concurrent/futures/thread.pyi | 34 +- .../typeshed/stdlib/3/configparser.pyi | 267 +- .../third_party/typeshed/stdlib/3/copyreg.pyi | 10 +- .../typeshed/stdlib/3/dbm/__init__.pyi | 24 + .../typeshed/stdlib/3/dbm/dumb.pyi | 25 + .../third_party/typeshed/stdlib/3/dbm/gnu.pyi | 35 + .../typeshed/stdlib/3/dbm/ndbm.pyi | 34 + .../typeshed/stdlib/3/distutils/__init__.pyi | 0 .../stdlib/3/distutils/archive_util.pyi | 12 + .../stdlib/3/distutils/bcppcompiler.pyi | 3 + .../typeshed/stdlib/3/distutils/ccompiler.pyi | 150 + .../typeshed/stdlib/3/distutils/cmd.pyi | 67 + .../stdlib/3/distutils/command/__init__.pyi | 0 .../stdlib/3/distutils/command/bdist.pyi | 0 .../stdlib/3/distutils/command/bdist_dumb.pyi | 0 .../stdlib/3/distutils/command/bdist_msi.pyi | 6 + .../3/distutils/command/bdist_packager.pyi | 0 .../stdlib/3/distutils/command/bdist_rpm.pyi | 0 .../3/distutils/command/bdist_wininst.pyi | 0 .../stdlib/3/distutils/command/build.pyi | 0 .../stdlib/3/distutils/command/build_clib.pyi | 0 .../stdlib/3/distutils/command/build_ext.pyi | 0 .../stdlib/3/distutils/command/build_py.pyi | 8 + .../3/distutils/command/build_scripts.pyi | 0 .../stdlib/3/distutils/command/check.pyi | 0 .../stdlib/3/distutils/command/clean.pyi | 0 .../stdlib/3/distutils/command/config.pyi | 87 + .../stdlib/3/distutils/command/install.pyi | 14 + .../3/distutils/command/install_data.pyi | 0 .../3/distutils/command/install_egg_info.pyi | 10 + .../3/distutils/command/install_headers.pyi | 0 .../3/distutils/command/install_lib.pyi | 0 .../3/distutils/command/install_scripts.pyi | 0 .../stdlib/3/distutils/command/register.pyi | 0 .../stdlib/3/distutils/command/sdist.pyi | 0 .../stdlib/3/distutils/command/upload.pyi | 8 + .../typeshed/stdlib/3/distutils/config.pyi | 17 + .../typeshed/stdlib/3/distutils/core.pyi | 48 + .../stdlib/3/distutils/cygwinccompiler.pyi | 4 + .../typeshed/stdlib/3/distutils/debug.pyi | 1 + .../typeshed/stdlib/3/distutils/dep_util.pyi | 5 + .../typeshed/stdlib/3/distutils/dir_util.pyi | 15 + .../typeshed/stdlib/3/distutils/dist.pyi | 58 + .../typeshed/stdlib/3/distutils/errors.pyi | 19 + .../typeshed/stdlib/3/distutils/extension.pyi | 22 + .../stdlib/3/distutils/fancy_getopt.pyi | 21 + .../typeshed/stdlib/3/distutils/file_util.pyi | 14 + .../typeshed/stdlib/3/distutils/filelist.pyi | 1 + .../typeshed/stdlib/3/distutils/log.pyi | 25 + .../stdlib/3/distutils/msvccompiler.pyi | 3 + .../typeshed/stdlib/3/distutils/spawn.pyi | 4 + .../typeshed/stdlib/3/distutils/sysconfig.pyi | 14 + .../typeshed/stdlib/3/distutils/text_file.pyi | 21 + .../stdlib/3/distutils/unixccompiler.pyi | 3 + .../typeshed/stdlib/3/distutils/util.pyi | 23 + .../typeshed/stdlib/3/distutils/version.pyi | 38 + .../typeshed/stdlib/3/email/__init__.pyi | 4 +- .../typeshed/stdlib/3/email/charset.pyi | 13 +- .../stdlib/3/email/contentmanager.pyi | 10 +- .../typeshed/stdlib/3/email/encoders.pyi | 2 - .../typeshed/stdlib/3/email/errors.pyi | 6 +- .../typeshed/stdlib/3/email/feedparser.pyi | 28 +- .../typeshed/stdlib/3/email/generator.pyi | 21 +- .../typeshed/stdlib/3/email/header.pyi | 35 +- .../stdlib/3/email/headerregistry.pyi | 21 +- .../typeshed/stdlib/3/email/iterators.pyi | 7 +- .../typeshed/stdlib/3/email/message.pyi | 68 +- .../typeshed/stdlib/3/email/mime/__init__.pyi | 0 .../stdlib/3/email/mime/application.pyi | 17 +- .../typeshed/stdlib/3/email/mime/audio.pyi | 17 +- .../typeshed/stdlib/3/email/mime/base.pyi | 8 +- .../typeshed/stdlib/3/email/mime/image.pyi | 17 +- .../typeshed/stdlib/3/email/mime/message.pyi | 6 +- .../stdlib/3/email/mime/multipart.pyi | 17 +- .../stdlib/3/email/mime/nonmultipart.pyi | 2 - .../typeshed/stdlib/3/email/mime/text.pyi | 10 +- .../typeshed/stdlib/3/email/parser.pyi | 14 +- .../typeshed/stdlib/3/email/policy.pyi | 32 +- .../typeshed/stdlib/3/email/utils.pyi | 43 +- .../typeshed/stdlib/3/encodings/__init__.pyi | 4 + .../typeshed/stdlib/3/encodings/utf_8.pyi | 10 +- .../third_party/typeshed/stdlib/3/enum.pyi | 60 +- .../typeshed/stdlib/3/faulthandler.pyi | 16 +- .../third_party/typeshed/stdlib/3/fcntl.pyi | 47 +- .../third_party/typeshed/stdlib/3/fnmatch.pyi | 7 +- .../typeshed/stdlib/3/functools.pyi | 76 +- .../jedi/third_party/typeshed/stdlib/3/gc.pyi | 24 +- .../third_party/typeshed/stdlib/3/getopt.pyi | 4 - .../third_party/typeshed/stdlib/3/getpass.pyi | 6 - .../third_party/typeshed/stdlib/3/gettext.pyi | 84 +- .../third_party/typeshed/stdlib/3/glob.pyi | 15 +- .../third_party/typeshed/stdlib/3/gzip.pyi | 57 +- .../third_party/typeshed/stdlib/3/hashlib.pyi | 156 +- .../third_party/typeshed/stdlib/3/heapq.pyi | 32 +- .../typeshed/stdlib/3/html/__init__.pyi | 0 .../typeshed/stdlib/3/html/entities.pyi | 0 .../typeshed/stdlib/3/html/parser.pyi | 9 +- .../typeshed/stdlib/3/http/__init__.pyi | 7 + .../typeshed/stdlib/3/http/client.pyi | 115 +- .../typeshed/stdlib/3/http/cookiejar.pyi | 93 +- .../typeshed/stdlib/3/http/cookies.pyi | 18 +- .../typeshed/stdlib/3/http/server.pyi | 42 +- .../third_party/typeshed/stdlib/3/imp.pyi | 64 +- .../typeshed/stdlib/3/importlib/__init__.pyi | 17 +- .../typeshed/stdlib/3/importlib/abc.pyi | 63 +- .../typeshed/stdlib/3/importlib/machinery.pyi | 73 +- .../typeshed/stdlib/3/importlib/metadata.pyi | 1 + .../typeshed/stdlib/3/importlib/resources.pyi | 19 +- .../typeshed/stdlib/3/importlib/util.pyi | 45 +- .../third_party/typeshed/stdlib/3/inspect.pyi | 202 +- .../jedi/third_party/typeshed/stdlib/3/io.pyi | 215 +- .../typeshed/stdlib/3/ipaddress.pyi | 27 +- .../typeshed/stdlib/3/itertools.pyi | 150 +- .../typeshed/stdlib/3/json/__init__.pyi | 108 +- .../typeshed/stdlib/3/json/decoder.pyi | 21 +- .../typeshed/stdlib/3/json/encoder.pyi | 18 +- .../typeshed/stdlib/3/json/tool.pyi | 1 + .../third_party/typeshed/stdlib/3/lzma.pyi | 134 +- .../typeshed/stdlib/3/macurl2path.pyi | 7 + .../third_party/typeshed/stdlib/3/msvcrt.pyi | 6 - .../stdlib/3/multiprocessing/__init__.pyi | 89 +- .../stdlib/3/multiprocessing/connection.pyi | 30 +- .../stdlib/3/multiprocessing/context.pyi | 83 +- .../3/multiprocessing/dummy/__init__.pyi | 30 +- .../3/multiprocessing/dummy/connection.pyi | 24 +- .../stdlib/3/multiprocessing/managers.pyi | 91 +- .../stdlib/3/multiprocessing/pool.pyi | 103 +- .../stdlib/3/multiprocessing/process.pyi | 1 + .../stdlib/3/multiprocessing/queues.pyi | 9 +- .../3/multiprocessing/shared_memory.pyi | 8 +- .../stdlib/3/multiprocessing/sharedctypes.pyi | 43 + .../stdlib/3/multiprocessing/spawn.pyi | 5 +- .../stdlib/3/multiprocessing/synchronize.pyi | 38 +- .../third_party/typeshed/stdlib/3/nntplib.pyi | 59 +- .../third_party/typeshed/stdlib/3/ntpath.pyi | 144 + .../typeshed/stdlib/3/nturl2path.pyi | 0 .../typeshed/stdlib/3/os/__init__.pyi | 785 +++-- .../third_party/typeshed/stdlib/3/os/path.pyi | 137 +- .../third_party/typeshed/stdlib/3/pathlib.pyi | 185 +- .../third_party/typeshed/stdlib/3/pipes.pyi | 4 - .../typeshed/stdlib/3/platform.pyi | 47 +- .../third_party/typeshed/stdlib/3/posix.pyi | 109 +- .../typeshed/stdlib/3/posixpath.pyi | 144 + .../third_party/typeshed/stdlib/3/queue.pyi | 20 +- .../third_party/typeshed/stdlib/3/random.pyi | 70 +- .../jedi/third_party/typeshed/stdlib/3/re.pyi | 143 +- .../third_party/typeshed/stdlib/3/reprlib.pyi | 3 +- .../typeshed/stdlib/3/resource.pyi | 38 +- .../third_party/typeshed/stdlib/3/runpy.pyi | 27 +- .../typeshed/stdlib/{3.6 => 3}/secrets.pyi | 6 +- .../typeshed/stdlib/3/selectors.pyi | 85 +- .../third_party/typeshed/stdlib/3/shelve.pyi | 11 +- .../third_party/typeshed/stdlib/3/shlex.pyi | 26 +- .../third_party/typeshed/stdlib/3/signal.pyi | 272 +- .../third_party/typeshed/stdlib/3/smtplib.pyi | 77 +- .../typeshed/stdlib/3/socketserver.pyi | 118 +- .../third_party/typeshed/stdlib/3/spwd.pyi | 0 .../typeshed/stdlib/3/sre_constants.pyi | 5 +- .../typeshed/stdlib/3/sre_parse.pyi | 48 +- .../third_party/typeshed/stdlib/3/stat.pyi | 10 +- .../typeshed/stdlib/3/statistics.pyi | 34 +- .../third_party/typeshed/stdlib/3/string.pyi | 25 +- .../typeshed/stdlib/3/subprocess.pyi | 1348 ++++---- .../third_party/typeshed/stdlib/3/symbol.pyi | 6 +- .../third_party/typeshed/stdlib/3/sys.pyi | 138 +- .../typeshed/stdlib/3/tempfile.pyi | 342 +- .../typeshed/stdlib/3/textwrap.pyi | 141 +- .../typeshed/stdlib/3/tkinter/__init__.pyi | 2956 ++++++++++++++++- .../stdlib/3/tkinter/commondialog.pyi | 0 .../typeshed/stdlib/3/tkinter/constants.pyi | 157 +- .../typeshed/stdlib/3/tkinter/dialog.pyi | 2 +- .../typeshed/stdlib/3/tkinter/filedialog.pyi | 6 +- .../typeshed/stdlib/3/tkinter/font.pyi | 96 + .../typeshed/stdlib/3/tkinter/messagebox.pyi | 0 .../typeshed/stdlib/3/tkinter/ttk.pyi | 1129 ++++++- .../typeshed/stdlib/3/tokenize.pyi | 148 +- .../typeshed/stdlib/3/tracemalloc.pyi | 86 +- .../third_party/typeshed/stdlib/3/types.pyi | 136 +- .../third_party/typeshed/stdlib/3/typing.pyi | 416 +-- .../typeshed/stdlib/3/unittest/__init__.pyi | 29 +- .../typeshed/stdlib/3/unittest/async_case.pyi | 1 + .../typeshed/stdlib/3/unittest/case.pyi | 351 +- .../typeshed/stdlib/3/unittest/loader.pyi | 53 +- .../typeshed/stdlib/3/unittest/main.pyi | 49 + .../typeshed/stdlib/3/unittest/mock.pyi | 391 ++- .../typeshed/stdlib/3/unittest/result.pyi | 23 +- .../typeshed/stdlib/3/unittest/runner.pyi | 20 +- .../typeshed/stdlib/3/unittest/signals.pyi | 10 +- .../typeshed/stdlib/3/unittest/suite.pyi | 8 +- .../typeshed/stdlib/3/unittest/util.pyi | 3 +- .../typeshed/stdlib/3/urllib/__init__.pyi | 0 .../typeshed/stdlib/3/urllib/error.pyi | 6 +- .../typeshed/stdlib/3/urllib/parse.pyi | 70 +- .../typeshed/stdlib/3/urllib/request.pyi | 303 +- .../typeshed/stdlib/3/urllib/response.pyi | 17 +- .../typeshed/stdlib/3/urllib/robotparser.pyi | 11 +- .../third_party/typeshed/stdlib/3/winreg.pyi | 100 + .../typeshed/stdlib/3/xmlrpc/__init__.pyi | 0 .../typeshed/stdlib/3/xmlrpc/client.pyi | 308 ++ .../typeshed/stdlib/3/xmlrpc/server.pyi | 160 + .../typeshed/stdlib/3/xxlimited.pyi | 13 + .../third_party/typeshed/stdlib/3/zipapp.pyi | 22 +- .../typeshed/tests/check_consistent.py | 38 + .../typeshed/tests/mypy_exclude_list.txt | 0 .../typeshed/tests/mypy_self_check.py | 39 + .../third_party/typeshed/tests/mypy_test.py | 162 + .../typeshed/tests/mypy_test_suite.py | 28 + .../typeshed/tests/pytype_exclude_list.txt | 48 + .../third_party/typeshed/tests/pytype_test.py | 202 ++ .../typeshed/tests/stubtest_test.py | 77 + .../typeshed/tests/stubtest_unused.py | 52 + .../tests/stubtest_whitelists/linux-py36.txt | 5 + .../tests/stubtest_whitelists/linux-py37.txt | 4 + .../tests/stubtest_whitelists/linux-py38.txt | 5 + .../tests/stubtest_whitelists/linux.txt | 55 + .../tests/stubtest_whitelists/py36.txt | 84 + .../tests/stubtest_whitelists/py37.txt | 82 + .../tests/stubtest_whitelists/py38.txt | 112 + .../tests/stubtest_whitelists/py39.txt | 192 ++ .../tests/stubtest_whitelists/py3_common.txt | 463 +++ .../tests/stubtest_whitelists/win32-py36.txt | 3 + .../tests/stubtest_whitelists/win32-py37.txt | 1 + .../tests/stubtest_whitelists/win32-py38.txt | 1 + .../tests/stubtest_whitelists/win32.txt | 41 + .../third_party/2/OpenSSL/__init__.pyi | 0 .../typeshed/third_party/2/OpenSSL/crypto.pyi | 14 +- .../third_party/2/concurrent/__init__.pyi | 0 .../2/concurrent/futures/__init__.pyi | 16 +- .../2/concurrent/futures/_base.pyi | 46 +- .../2/concurrent/futures/process.pyi | 20 +- .../2/concurrent/futures/thread.pyi | 22 +- .../typeshed/third_party/2/enum.pyi | 60 +- .../third_party/2/fb303/FacebookService.pyi | 3 +- .../typeshed/third_party/2/fb303/__init__.pyi | 0 .../typeshed/third_party/2/ipaddress.pyi | 5 +- .../typeshed/third_party/2/kazoo/__init__.pyi | 0 .../typeshed/third_party/2/kazoo/client.pyi | 20 +- .../third_party/2/kazoo/exceptions.pyi | 0 .../third_party/2/kazoo/recipe/__init__.pyi | 0 .../third_party/2/kazoo/recipe/watchers.pyi | 0 .../typeshed/third_party/2/pathlib2.pyi | 110 +- .../typeshed/third_party/2/pymssql.pyi | 46 +- .../third_party/2/routes/__init__.pyi | 3 +- .../typeshed/third_party/2/routes/mapper.pyi | 14 +- .../typeshed/third_party/2/routes/util.pyi | 0 .../third_party/2/scribe/__init__.pyi | 0 .../typeshed/third_party/2/scribe/scribe.pyi | 5 +- .../typeshed/third_party/2/scribe/ttypes.pyi | 0 .../typeshed/third_party/2/six/__init__.pyi | 82 +- .../2/six/moves/BaseHTTPServer.pyi | 0 .../third_party/2/six/moves/CGIHTTPServer.pyi | 0 .../2/six/moves/SimpleHTTPServer.pyi | 0 .../third_party/2/six/moves/__init__.pyi | 96 +- .../third_party/2/six/moves/_dummy_thread.pyi | 0 .../third_party/2/six/moves/_thread.pyi | 0 .../third_party/2/six/moves/cPickle.pyi | 0 .../2/six/moves/collections_abc.pyi | 1 + .../third_party/2/six/moves/configparser.pyi | 0 .../2/six/moves/email_mime_base.pyi | 0 .../2/six/moves/email_mime_multipart.pyi | 0 .../2/six/moves/email_mime_nonmultipart.pyi | 0 .../2/six/moves/email_mime_text.pyi | 0 .../third_party/2/six/moves/html_entities.pyi | 0 .../third_party/2/six/moves/html_parser.pyi | 0 .../third_party/2/six/moves/http_client.pyi | 0 .../2/six/moves/http_cookiejar.pyi | 0 .../third_party/2/six/moves/http_cookies.pyi | 0 .../third_party/2/six/moves/queue.pyi | 0 .../third_party/2/six/moves/reprlib.pyi | 0 .../third_party/2/six/moves/socketserver.pyi | 0 .../2/six/moves/urllib/__init__.pyi | 0 .../third_party/2/six/moves/urllib/error.pyi | 3 +- .../third_party/2/six/moves/urllib/parse.pyi | 53 +- .../2/six/moves/urllib/request.pyi | 75 +- .../2/six/moves/urllib/response.pyi | 6 +- .../2/six/moves/urllib/robotparser.pyi | 0 .../third_party/2/six/moves/urllib_error.pyi | 0 .../third_party/2/six/moves/urllib_parse.pyi | 0 .../2/six/moves/urllib_request.pyi | 0 .../2/six/moves/urllib_response.pyi | 0 .../2/six/moves/urllib_robotparser.pyi | 0 .../third_party/2/six/moves/xmlrpc_client.pyi | 0 .../third_party/2/tornado/__init__.pyi | 0 .../third_party/2/tornado/concurrent.pyi | 0 .../typeshed/third_party/2/tornado/gen.pyi | 0 .../third_party/2/tornado/httpclient.pyi | 49 +- .../third_party/2/tornado/httpserver.pyi | 20 +- .../third_party/2/tornado/httputil.pyi | 31 +- .../typeshed/third_party/2/tornado/ioloop.pyi | 1 + .../typeshed/third_party/2/tornado/locks.pyi | 0 .../third_party/2/tornado/netutil.pyi | 1 + .../third_party/2/tornado/process.pyi | 0 .../third_party/2/tornado/tcpserver.pyi | 0 .../third_party/2/tornado/testing.pyi | 4 +- .../typeshed/third_party/2/tornado/util.pyi | 0 .../typeshed/third_party/2/tornado/web.pyi | 35 +- .../third_party/2and3/Crypto/Cipher/AES.pyi | 19 - .../third_party/2and3/Crypto/Cipher/ARC2.pyi | 19 - .../third_party/2and3/Crypto/Cipher/ARC4.pyi | 15 - .../2and3/Crypto/Cipher/Blowfish.pyi | 19 - .../third_party/2and3/Crypto/Cipher/CAST.pyi | 19 - .../third_party/2and3/Crypto/Cipher/DES.pyi | 19 - .../third_party/2and3/Crypto/Cipher/DES3.pyi | 20 - .../2and3/Crypto/Cipher/PKCS1_OAEP.pyi | 13 - .../2and3/Crypto/Cipher/PKCS1_v1_5.pyi | 13 - .../third_party/2and3/Crypto/Cipher/XOR.pyi | 16 - .../2and3/Crypto/Cipher/__init__.pyi | 11 - .../2and3/Crypto/Cipher/blockalgo.pyi | 17 - .../third_party/2and3/Crypto/Hash/HMAC.pyi | 16 - .../third_party/2and3/Crypto/Hash/MD2.pyi | 13 - .../third_party/2and3/Crypto/Hash/MD4.pyi | 13 - .../third_party/2and3/Crypto/Hash/MD5.pyi | 13 - .../third_party/2and3/Crypto/Hash/RIPEMD.pyi | 13 - .../third_party/2and3/Crypto/Hash/SHA.pyi | 13 - .../third_party/2and3/Crypto/Hash/SHA224.pyi | 13 - .../third_party/2and3/Crypto/Hash/SHA256.pyi | 13 - .../third_party/2and3/Crypto/Hash/SHA384.pyi | 13 - .../third_party/2and3/Crypto/Hash/SHA512.pyi | 13 - .../2and3/Crypto/Hash/__init__.pyi | 11 - .../2and3/Crypto/Hash/hashalgo.pyi | 11 - .../2and3/Crypto/Protocol/AllOrNothing.pyi | 10 - .../2and3/Crypto/Protocol/Chaffing.pyi | 5 - .../third_party/2and3/Crypto/Protocol/KDF.pyi | 7 - .../2and3/Crypto/Protocol/__init__.pyi | 4 - .../2and3/Crypto/PublicKey/DSA.pyi | 27 - .../2and3/Crypto/PublicKey/ElGamal.pyi | 19 - .../2and3/Crypto/PublicKey/RSA.pyi | 32 - .../2and3/Crypto/PublicKey/__init__.pyi | 4 - .../2and3/Crypto/PublicKey/pubkey.pyi | 21 - .../Random/Fortuna/FortunaAccumulator.pyi | 25 - .../Random/Fortuna/FortunaGenerator.pyi | 16 - .../2and3/Crypto/Random/Fortuna/SHAd256.pyi | 13 - .../2and3/Crypto/Random/OSRNG/__init__.pyi | 1 - .../2and3/Crypto/Random/OSRNG/fallback.pyi | 5 - .../2and3/Crypto/Random/OSRNG/posix.pyi | 6 - .../2and3/Crypto/Random/OSRNG/rng_base.pyi | 11 - .../2and3/Crypto/Random/__init__.pyi | 1 - .../2and3/Crypto/Random/random.pyi | 17 - .../2and3/Crypto/Signature/PKCS1_PSS.pyi | 9 - .../2and3/Crypto/Signature/PKCS1_v1_5.pyi | 7 - .../2and3/Crypto/Signature/__init__.pyi | 3 - .../third_party/2and3/Crypto/Util/Counter.pyi | 3 - .../third_party/2and3/Crypto/Util/RFC1751.pyi | 9 - .../2and3/Crypto/Util/__init__.pyi | 6 - .../third_party/2and3/Crypto/Util/asn1.pyi | 45 - .../third_party/2and3/Crypto/Util/number.pyi | 22 - .../2and3/Crypto/Util/randpool.pyi | 16 - .../third_party/2and3/Crypto/Util/strxor.pyi | 2 - .../third_party/2and3/Crypto/__init__.pyi | 7 - .../third_party/2and3/Crypto/pct_warnings.pyi | 7 - .../2and3/atomicwrites/__init__.pyi | 13 +- .../third_party/2and3/attr/__init__.pyi | 88 +- .../third_party/2and3/attr/_version_info.pyi | 9 + .../third_party/2and3/attr/converters.pyi | 7 +- .../third_party/2and3/attr/exceptions.pyi | 8 + .../third_party/2and3/attr/filters.pyi | 3 +- .../third_party/2and3/attr/validators.pyi | 58 +- .../third_party/2and3/backports/__init__.pyi | 4 + .../2and3/backports/ssl_match_hostname.pyi | 0 .../third_party/2and3/backports_abc.pyi | 0 .../third_party/2and3/bleach/__init__.pyi | 9 +- .../third_party/2and3/bleach/callbacks.pyi | 2 +- .../third_party/2and3/bleach/linkifier.pyi | 0 .../third_party/2and3/bleach/sanitizer.pyi | 2 +- .../third_party/2and3/bleach/utils.pyi | 4 +- .../third_party/2and3/boto/__init__.pyi | 47 +- .../typeshed/third_party/2and3/boto/auth.pyi | 1 + .../third_party/2and3/boto/auth_handler.pyi | 1 + .../third_party/2and3/boto/compat.pyi | 9 +- .../third_party/2and3/boto/connection.pyi | 69 +- .../third_party/2and3/boto/ec2/__init__.pyi | 3 + .../third_party/2and3/boto/elb/__init__.pyi | 24 +- .../third_party/2and3/boto/exception.pyi | 1 + .../third_party/2and3/boto/kms/__init__.pyi | 1 + .../third_party/2and3/boto/kms/exceptions.pyi | 0 .../third_party/2and3/boto/kms/layer1.pyi | 61 +- .../third_party/2and3/boto/plugin.pyi | 0 .../third_party/2and3/boto/regioninfo.pyi | 8 +- .../third_party/2and3/boto/s3/__init__.pyi | 14 +- .../third_party/2and3/boto/s3/acl.pyi | 13 +- .../third_party/2and3/boto/s3/bucket.pyi | 135 +- .../2and3/boto/s3/bucketlistresultset.pyi | 58 +- .../2and3/boto/s3/bucketlogging.pyi | 0 .../third_party/2and3/boto/s3/connection.pyi | 75 +- .../third_party/2and3/boto/s3/cors.pyi | 20 +- .../2and3/boto/s3/deletemarker.pyi | 0 .../third_party/2and3/boto/s3/key.pyi | 3 +- .../third_party/2and3/boto/s3/keyfile.pyi | 0 .../third_party/2and3/boto/s3/lifecycle.pyi | 18 +- .../third_party/2and3/boto/s3/multidelete.pyi | 12 +- .../third_party/2and3/boto/s3/multipart.pyi | 27 +- .../third_party/2and3/boto/s3/prefix.pyi | 0 .../third_party/2and3/boto/s3/tagging.pyi | 0 .../third_party/2and3/boto/s3/user.pyi | 0 .../third_party/2and3/boto/s3/website.pyi | 26 +- .../typeshed/third_party/2and3/boto/utils.pyi | 112 +- .../third_party/2and3/cachetools/__init__.pyi | 6 + .../third_party/2and3/cachetools/abc.pyi | 7 + .../third_party/2and3/cachetools/cache.pyi | 20 + .../2and3/cachetools/decorators.pyi | 16 + .../third_party/2and3/cachetools/func.pyi | 11 + .../third_party/2and3/cachetools/lfu.pyi | 14 + .../third_party/2and3/cachetools/lru.pyi | 13 + .../third_party/2and3/cachetools/rr.pyi | 21 + .../third_party/2and3/cachetools/ttl.pyi | 23 + .../typeshed/third_party/2and3/certifi.pyi | 0 .../2and3/characteristic/__init__.pyi | 11 +- .../third_party/2and3/chardet/__init__.pyi | 26 + .../third_party/2and3/chardet/enums.pyi | 39 + .../2and3/chardet/langbulgarianmodel.pyi | 9 + .../2and3/chardet/langcyrillicmodel.pyi | 17 + .../2and3/chardet/langgreekmodel.pyi | 9 + .../2and3/chardet/langhebrewmodel.pyi | 7 + .../2and3/chardet/langhungarianmodel.pyi | 9 + .../2and3/chardet/langthaimodel.pyi | 7 + .../2and3/chardet/langturkishmodel.pyi | 7 + .../2and3/chardet/universaldetector.pyi | 29 + .../third_party/2and3/chardet/version.pyi | 4 + .../third_party/2and3/click/README.md | 0 .../third_party/2and3/click/__init__.pyi | 140 +- .../third_party/2and3/click/_termui_impl.pyi | 4 +- .../typeshed/third_party/2and3/click/core.pyi | 365 +- .../third_party/2and3/click/decorators.pyi | 91 +- .../third_party/2and3/click/exceptions.pyi | 63 +- .../third_party/2and3/click/formatting.pyi | 88 +- .../third_party/2and3/click/globals.pyi | 20 +- .../third_party/2and3/click/parser.pyi | 71 +- .../third_party/2and3/click/termui.pyi | 117 +- .../third_party/2and3/click/testing.pyi | 15 +- .../third_party/2and3/click/types.pyi | 240 +- .../third_party/2and3/click/utils.pyi | 75 +- .../typeshed/third_party/2and3/croniter.pyi | 6 +- .../2and3/cryptography/__init__.pyi | 0 .../2and3/cryptography/exceptions.pyi | 0 .../third_party/2and3/cryptography/fernet.pyi | 12 +- .../2and3/cryptography/hazmat/__init__.pyi | 0 .../cryptography/hazmat/backends/__init__.pyi | 3 + .../hazmat/backends/interfaces.pyi | 0 .../cryptography/hazmat/bindings/__init__.pyi | 0 .../hazmat/bindings/openssl/__init__.pyi | 0 .../hazmat/bindings/openssl/binding.pyi | 0 .../hazmat/primitives/__init__.pyi | 0 .../hazmat/primitives/asymmetric/__init__.pyi | 0 .../hazmat/primitives/asymmetric/dh.pyi | 8 +- .../hazmat/primitives/asymmetric/dsa.pyi | 14 +- .../hazmat/primitives/asymmetric/ec.pyi | 134 +- .../hazmat/primitives/asymmetric/ed25519.pyi | 0 .../hazmat/primitives/asymmetric/ed448.pyi | 0 .../hazmat/primitives/asymmetric/padding.pyi | 0 .../hazmat/primitives/asymmetric/rsa.pyi | 24 +- .../hazmat/primitives/asymmetric/utils.pyi | 8 +- .../hazmat/primitives/asymmetric/x25519.pyi | 0 .../hazmat/primitives/asymmetric/x448.pyi | 0 .../hazmat/primitives/ciphers/__init__.pyi | 5 +- .../hazmat/primitives/ciphers/aead.pyi | 0 .../hazmat/primitives/ciphers/algorithms.pyi | 59 +- .../hazmat/primitives/ciphers/modes.pyi | 0 .../cryptography/hazmat/primitives/cmac.pyi | 4 +- .../hazmat/primitives/constant_time.pyi | 0 .../cryptography/hazmat/primitives/hashes.pyi | 3 +- .../cryptography/hazmat/primitives/hmac.pyi | 4 +- .../hazmat/primitives/kdf/__init__.pyi | 0 .../hazmat/primitives/kdf/concatkdf.pyi | 11 +- .../hazmat/primitives/kdf/hkdf.pyi | 9 +- .../hazmat/primitives/kdf/kbkdf.pyi | 2 +- .../hazmat/primitives/kdf/pbkdf2.pyi | 6 +- .../hazmat/primitives/kdf/scrypt.pyi | 4 +- .../hazmat/primitives/kdf/x963kdf.pyi | 4 +- .../hazmat/primitives/keywrap.pyi | 10 +- .../hazmat/primitives/padding.pyi | 0 .../hazmat/primitives/poly1305.pyi | 3 - .../primitives/serialization/__init__.pyi | 37 +- .../primitives/serialization/pkcs12.pyi | 19 +- .../hazmat/primitives/twofactor/__init__.pyi | 0 .../hazmat/primitives/twofactor/hotp.pyi | 0 .../hazmat/primitives/twofactor/totp.pyi | 0 .../{x509.pyi => x509/__init__.pyi} | 179 +- .../2and3/cryptography/x509/extensions.pyi | 22 + .../2and3/cryptography/x509/oid.pyi | 106 + .../typeshed/third_party/2and3/dateparser.pyi | 14 + .../2and3/datetimerange/__init__.pyi | 47 + .../third_party/2and3/dateutil/__init__.pyi | 0 .../third_party/2and3/dateutil/_common.pyi | 5 - .../third_party/2and3/dateutil/easter.pyi | 8 + .../third_party/2and3/dateutil/parser.pyi | 19 +- .../2and3/dateutil/relativedelta.pyi | 48 +- .../third_party/2and3/dateutil/rrule.pyi | 46 +- .../2and3/dateutil/tz/__init__.pyi | 16 +- .../third_party/2and3/dateutil/tz/_common.pyi | 2 +- .../third_party/2and3/dateutil/tz/tz.pyi | 19 +- .../third_party/2and3/dateutil/utils.pyi | 3 +- .../typeshed/third_party/2and3/decorator.pyi | 17 +- .../third_party/2and3/deprecated/__init__.pyi | 1 + .../third_party/2and3/deprecated/classic.pyi | 21 + .../third_party/2and3/deprecated/sphinx.pyi | 31 + .../typeshed/third_party/2and3/emoji.pyi | 18 - .../third_party/2and3/emoji/__init__.pyi | 13 + .../typeshed/third_party/2and3/emoji/core.pyi | 9 + .../third_party/2and3/emoji/unicode_codes.pyi | 6 + .../typeshed/third_party/2and3/first.pyi | 7 +- .../third_party/2and3/flask/__init__.pyi | 76 +- .../typeshed/third_party/2and3/flask/app.pyi | 93 +- .../third_party/2and3/flask/blueprints.pyi | 32 +- .../typeshed/third_party/2and3/flask/cli.pyi | 20 +- .../third_party/2and3/flask/config.pyi | 6 +- .../typeshed/third_party/2and3/flask/ctx.pyi | 6 - .../third_party/2and3/flask/debughelpers.pyi | 7 - .../third_party/2and3/flask/globals.pyi | 8 +- .../third_party/2and3/flask/helpers.pyi | 29 +- .../third_party/2and3/flask/json/__init__.pyi | 2 +- .../third_party/2and3/flask/json/tag.pyi | 4 - .../third_party/2and3/flask/logging.pyi | 5 - .../third_party/2and3/flask/sessions.pyi | 5 +- .../third_party/2and3/flask/signals.pyi | 4 - .../third_party/2and3/flask/templating.pyi | 12 +- .../third_party/2and3/flask/testing.pyi | 38 +- .../third_party/2and3/flask/views.pyi | 5 - .../third_party/2and3/flask/wrappers.pyi | 7 +- .../third_party/2and3/geoip2/__init__.pyi | 0 .../third_party/2and3/geoip2/database.pyi | 9 +- .../third_party/2and3/geoip2/errors.pyi | 4 - .../third_party/2and3/geoip2/mixins.pyi | 0 .../third_party/2and3/geoip2/models.pyi | 3 - .../third_party/2and3/geoip2/records.pyi | 0 .../third_party/{2 => 2and3}/gflags.pyi | 152 +- .../third_party/2and3/google/__init__.pyi | 0 .../2and3/google/protobuf/__init__.pyi | 0 .../2and3/google/protobuf/any_pb2.pyi | 52 +- .../2and3/google/protobuf/any_test_pb2.pyi | 14 - .../2and3/google/protobuf/api_pb2.pyi | 157 +- .../google/protobuf/compiler/__init__.pyi | 0 .../google/protobuf/compiler/plugin_pb2.pyi | 169 +- .../2and3/google/protobuf/descriptor.pyi | 62 +- .../2and3/google/protobuf/descriptor_pb2.pyi | 1193 ++++--- .../2and3/google/protobuf/descriptor_pool.pyi | 0 .../2and3/google/protobuf/duration_pb2.pyi | 51 +- .../2and3/google/protobuf/empty_pb2.pyi | 24 +- .../2and3/google/protobuf/field_mask_pb2.pyi | 55 +- .../google/protobuf/internal/__init__.pyi | 0 .../google/protobuf/internal/containers.pyi | 52 +- .../google/protobuf/internal/decoder.pyi | 0 .../google/protobuf/internal/encoder.pyi | 0 .../protobuf/internal/enum_type_wrapper.pyi | 28 +- .../protobuf/internal/extension_dict.pyi | 36 + .../protobuf/internal/message_listener.pyi | 0 .../protobuf/internal/python_message.pyi | 1 + .../protobuf/internal/well_known_types.pyi | 120 +- .../google/protobuf/internal/wire_format.pyi | 0 .../2and3/google/protobuf/json_format.pyi | 2 +- .../protobuf/map_proto2_unittest_pb2.pyi | 198 -- .../google/protobuf/map_unittest_pb2.pyi | 375 --- .../2and3/google/protobuf/message.pyi | 38 +- .../2and3/google/protobuf/message_factory.pyi | 11 +- .../2and3/google/protobuf/reflection.pyi | 0 .../2and3/google/protobuf/service.pyi | 0 .../google/protobuf/source_context_pb2.pyi | 45 +- .../2and3/google/protobuf/struct_pb2.pyi | 171 +- .../2and3/google/protobuf/symbol_database.pyi | 20 +- .../protobuf/test_messages_proto2_pb2.pyi | 345 -- .../protobuf/test_messages_proto3_pb2.pyi | 435 --- .../2and3/google/protobuf/timestamp_pb2.pyi | 51 +- .../2and3/google/protobuf/type_pb2.pyi | 361 +- .../google/protobuf/unittest_arena_pb2.pyi | 19 - .../protobuf/unittest_custom_options_pb2.pyi | 226 -- .../google/protobuf/unittest_import_pb2.pyi | 38 - .../protobuf/unittest_import_public_pb2.pyi | 6 - .../google/protobuf/unittest_mset_pb2.pyi | 27 - .../unittest_mset_wire_format_pb2.pyi | 10 - .../protobuf/unittest_no_arena_import_pb2.pyi | 6 - .../google/protobuf/unittest_no_arena_pb2.pyi | 225 -- .../unittest_no_generic_services_pb2.pyi | 20 - .../2and3/google/protobuf/unittest_pb2.pyi | 1083 ------ .../protobuf/unittest_proto3_arena_pb2.pyi | 248 -- .../2and3/google/protobuf/util/__init__.pyi | 0 .../protobuf/util/json_format_proto3_pb2.pyi | 341 -- .../2and3/google/protobuf/wrappers_pb2.pyi | 149 +- .../third_party/2and3/itsdangerous.pyi | 107 +- .../third_party/2and3/jinja2/__init__.pyi | 50 +- .../third_party/2and3/jinja2/_compat.pyi | 14 +- .../third_party/2and3/jinja2/_stringdefs.pyi | 0 .../third_party/2and3/jinja2/bccache.pyi | 0 .../third_party/2and3/jinja2/compiler.pyi | 3 +- .../third_party/2and3/jinja2/constants.pyi | 0 .../third_party/2and3/jinja2/debug.pyi | 0 .../third_party/2and3/jinja2/defaults.pyi | 21 +- .../third_party/2and3/jinja2/environment.pyi | 91 +- .../third_party/2and3/jinja2/exceptions.pyi | 0 .../typeshed/third_party/2and3/jinja2/ext.pyi | 10 +- .../third_party/2and3/jinja2/filters.pyi | 0 .../third_party/2and3/jinja2/lexer.pyi | 0 .../third_party/2and3/jinja2/loaders.pyi | 14 +- .../third_party/2and3/jinja2/meta.pyi | 1 + .../third_party/2and3/jinja2/nodes.pyi | 5 + .../third_party/2and3/jinja2/optimizer.pyi | 1 + .../third_party/2and3/jinja2/parser.pyi | 12 +- .../third_party/2and3/jinja2/runtime.pyi | 8 +- .../third_party/2and3/jinja2/sandbox.pyi | 1 + .../third_party/2and3/jinja2/tests.pyi | 0 .../third_party/2and3/jinja2/utils.pyi | 58 +- .../third_party/2and3/jinja2/visitor.pyi | 0 .../third_party/2and3/markdown/__init__.pyi | 2 + .../third_party/2and3/markdown/__meta__.pyi | 3 + .../2and3/markdown/blockparser.pyi | 18 + .../2and3/markdown/blockprocessors.pyi | 59 + .../third_party/2and3/markdown/core.pyi | 63 + .../2and3/markdown/extensions/__init__.pyi | 13 + .../2and3/markdown/extensions/abbr.pyi | 16 + .../2and3/markdown/extensions/admonition.pyi | 15 + .../2and3/markdown/extensions/attr_list.pyi | 20 + .../2and3/markdown/extensions/codehilite.pyi | 42 + .../2and3/markdown/extensions/def_list.pyi | 13 + .../2and3/markdown/extensions/extra.pyi | 10 + .../2and3/markdown/extensions/fenced_code.pyi | 16 + .../2and3/markdown/extensions/footnotes.pyi | 57 + .../markdown/extensions/legacy_attrs.pyi | 13 + .../2and3/markdown/extensions/legacy_em.pyi | 13 + .../2and3/markdown/extensions/md_in_html.pyi | 9 + .../2and3/markdown/extensions/meta.pyi | 18 + .../2and3/markdown/extensions/nl2br.pyi | 9 + .../2and3/markdown/extensions/sane_lists.pyi | 14 + .../2and3/markdown/extensions/smarty.pyi | 39 + .../2and3/markdown/extensions/tables.pyi | 19 + .../2and3/markdown/extensions/toc.pyi | 44 + .../2and3/markdown/extensions/wikilinks.pyi | 16 + .../2and3/markdown/inlinepatterns.pyi | 103 + .../third_party/2and3/markdown/pep562.pyi | 9 + .../2and3/markdown/postprocessors.pyi | 17 + .../2and3/markdown/preprocessors.pyi | 23 + .../2and3/markdown/serializers.pyi | 4 + .../2and3/markdown/treeprocessors.pyi | 19 + .../third_party/2and3/markdown/util.pyi | 56 + .../third_party/2and3/markupsafe/__init__.pyi | 14 +- .../third_party/2and3/markupsafe/_compat.pyi | 14 +- .../2and3/markupsafe/_constants.pyi | 2 +- .../third_party/2and3/markupsafe/_native.pyi | 5 +- .../2and3/markupsafe/_speedups.pyi | 5 +- .../third_party/2and3/maxminddb/__init__.pyi | 1 - .../third_party/2and3/maxminddb/compat.pyi | 2 - .../third_party/2and3/maxminddb/const.pyi | 0 .../third_party/2and3/maxminddb/decoder.pyi | 0 .../third_party/2and3/maxminddb/errors.pyi | 0 .../third_party/2and3/maxminddb/extension.pyi | 0 .../third_party/2and3/maxminddb/reader.pyi | 8 +- .../typeshed/third_party/2and3/mock.pyi | 391 ++- .../third_party/2and3/mypy_extensions.pyi | 15 +- .../third_party/2and3/nmap/__init__.pyi | 1 + .../typeshed/third_party/2and3/nmap/nmap.pyi | 122 + .../third_party/2and3/paramiko/__init__.pyi | 41 + .../third_party/2and3/paramiko/_version.pyi | 3 + .../third_party/2and3/paramiko/_winapi.pyi | 97 + .../third_party/2and3/paramiko/agent.pyi | 67 + .../2and3/paramiko/auth_handler.pyi | 49 + .../third_party/2and3/paramiko/ber.pyi | 17 + .../2and3/paramiko/buffered_pipe.pyi | 16 + .../third_party/2and3/paramiko/channel.pyi | 99 + .../third_party/2and3/paramiko/client.pyi | 74 + .../third_party/2and3/paramiko/common.pyi | 139 + .../third_party/2and3/paramiko/compress.pyi | 11 + .../third_party/2and3/paramiko/config.pyi | 31 + .../third_party/2and3/paramiko/dsskey.pyi | 34 + .../third_party/2and3/paramiko/ecdsakey.pyi | 53 + .../third_party/2and3/paramiko/ed25519key.pyi | 22 + .../third_party/2and3/paramiko/file.pyi | 38 + .../third_party/2and3/paramiko/hostkeys.pyi | 47 + .../2and3/paramiko/kex_curve25519.pyi | 25 + .../2and3/paramiko/kex_ecdh_nist.pyi | 37 + .../third_party/2and3/paramiko/kex_gex.pyi | 39 + .../third_party/2and3/paramiko/kex_group1.pyi | 29 + .../2and3/paramiko/kex_group14.pyi | 20 + .../2and3/paramiko/kex_group16.pyi | 16 + .../third_party/2and3/paramiko/kex_gss.pyi | 66 + .../third_party/2and3/paramiko/message.pyi | 42 + .../third_party/2and3/paramiko/packet.pyi | 60 + .../third_party/2and3/paramiko/pipe.pyi | 35 + .../third_party/2and3/paramiko/pkey.pyi | 44 + .../third_party/2and3/paramiko/primes.pyi | 8 + .../third_party/2and3/paramiko/proxy.pyi | 16 + .../third_party/2and3/paramiko/py3compat.pyi | 41 + .../third_party/2and3/paramiko/rsakey.pyi | 33 + .../third_party/2and3/paramiko/server.pyi | 51 + .../third_party/2and3/paramiko/sftp.pyi | 61 + .../third_party/2and3/paramiko/sftp_attr.pyi | 22 + .../2and3/paramiko/sftp_client.pyi | 67 + .../third_party/2and3/paramiko/sftp_file.pyi | 29 + .../2and3/paramiko/sftp_handle.pyi | 13 + .../2and3/paramiko/sftp_server.pyi | 28 + .../third_party/2and3/paramiko/sftp_si.pyi | 23 + .../2and3/paramiko/ssh_exception.pyi | 41 + .../third_party/2and3/paramiko/ssh_gss.pyi | 54 + .../third_party/2and3/paramiko/transport.pyi | 194 ++ .../third_party/2and3/paramiko/util.pyi | 52 + .../2and3/paramiko/win_pageant.pyi | 16 + .../typeshed/third_party/2and3/polib.pyi | 156 + .../third_party/2and3/pyVmomi/__init__.pyi | 0 .../2and3/pyVmomi/vim/__init__.pyi | 69 + .../third_party/2and3/pyVmomi/vim/event.pyi | 16 + .../third_party/2and3/pyVmomi/vim/fault.pyi | 7 + .../third_party/2and3/pyVmomi/vim/option.pyi | 9 + .../third_party/2and3/pyVmomi/vim/view.pyi | 15 + .../2and3/pyVmomi/vmodl/__init__.pyi | 5 + .../third_party/2and3/pyVmomi/vmodl/fault.pyi | 5 + .../third_party/2and3/pyVmomi/vmodl/query.pyi | 38 + .../typeshed/third_party/2and3/pycurl.pyi | 50 +- .../third_party/2and3/pymysql/__init__.pyi | 20 +- .../third_party/2and3/pymysql/charset.pyi | 0 .../third_party/2and3/pymysql/connections.pyi | 157 +- .../2and3/pymysql/constants/CLIENT.pyi | 0 .../2and3/pymysql/constants/COMMAND.pyi | 0 .../2and3/pymysql/constants/ER.pyi | 0 .../2and3/pymysql/constants/FIELD_TYPE.pyi | 0 .../2and3/pymysql/constants/FLAG.pyi | 0 .../2and3/pymysql/constants/SERVER_STATUS.pyi | 0 .../2and3/pymysql/constants/__init__.pyi | 0 .../third_party/2and3/pymysql/converters.pyi | 3 +- .../third_party/2and3/pymysql/cursors.pyi | 44 +- .../third_party/2and3/pymysql/err.pyi | 4 +- .../third_party/2and3/pymysql/times.pyi | 0 .../third_party/2and3/pymysql/util.pyi | 0 .../third_party/2and3/pynamodb/__init__.pyi | 0 .../third_party/2and3/pynamodb/attributes.pyi | 44 +- .../2and3/pynamodb/connection/__init__.pyi | 0 .../2and3/pynamodb/connection/base.pyi | 148 +- .../2and3/pynamodb/connection/table.pyi | 112 +- .../2and3/pynamodb/connection/util.pyi | 0 .../third_party/2and3/pynamodb/constants.pyi | 0 .../third_party/2and3/pynamodb/exceptions.pyi | 0 .../third_party/2and3/pynamodb/indexes.pyi | 11 +- .../third_party/2and3/pynamodb/models.pyi | 76 +- .../third_party/2and3/pynamodb/settings.pyi | 0 .../third_party/2and3/pynamodb/throttle.pyi | 0 .../third_party/2and3/pynamodb/types.pyi | 0 .../third_party/2and3/pyre_extensions.pyi | 0 .../third_party/2and3/pytz/__init__.pyi | 3 +- .../third_party/2and3/redis/__init__.pyi | 5 +- .../third_party/2and3/redis/client.pyi | 432 ++- .../third_party/2and3/redis/connection.pyi | 81 +- .../third_party/2and3/redis/exceptions.pyi | 0 .../third_party/2and3/redis/utils.pyi | 0 .../third_party/2and3/requests/__init__.pyi | 56 +- .../third_party/2and3/requests/adapters.pyi | 50 +- .../third_party/2and3/requests/api.pyi | 18 +- .../third_party/2and3/requests/auth.pyi | 11 +- .../third_party/2and3/requests/compat.pyi | 3 - .../third_party/2and3/requests/cookies.pyi | 5 +- .../third_party/2and3/requests/exceptions.pyi | 9 +- .../third_party/2and3/requests/hooks.pyi | 2 - .../third_party/2and3/requests/models.pyi | 65 +- .../2and3/requests/packages/__init__.pyi | 0 .../requests/packages/urllib3/__init__.pyi | 13 +- .../packages/urllib3/_collections.pyi | 2 +- .../requests/packages/urllib3/connection.pyi | 18 +- .../packages/urllib3/connectionpool.pyi | 70 +- .../packages/urllib3/contrib/__init__.pyi | 0 .../requests/packages/urllib3/exceptions.pyi | 0 .../requests/packages/urllib3/fields.pyi | 3 - .../requests/packages/urllib3/filepost.pyi | 5 +- .../packages/urllib3/packages/__init__.pyi | 0 .../packages/ssl_match_hostname/__init__.pyi | 0 .../ssl_match_hostname/_implementation.pyi | 0 .../requests/packages/urllib3/poolmanager.pyi | 1 + .../requests/packages/urllib3/request.pyi | 4 +- .../requests/packages/urllib3/response.pyi | 23 +- .../packages/urllib3/util/__init__.pyi | 9 +- .../packages/urllib3/util/connection.pyi | 0 .../packages/urllib3/util/request.pyi | 5 +- .../packages/urllib3/util/response.pyi | 0 .../requests/packages/urllib3/util/retry.pyi | 15 +- .../requests/packages/urllib3/util/ssl_.pyi | 16 +- .../packages/urllib3/util/timeout.pyi | 1 + .../requests/packages/urllib3/util/url.pyi | 1 + .../third_party/2and3/requests/sessions.pyi | 62 +- .../2and3/requests/status_codes.pyi | 1 - .../third_party/2and3/requests/structures.pyi | 4 +- .../third_party/2and3/requests/utils.pyi | 19 +- .../third_party/2and3/retry/__init__.pyi | 1 + .../typeshed/third_party/2and3/retry/api.pyi | 28 + .../third_party/2and3/simplejson/__init__.pyi | 5 +- .../third_party/2and3/simplejson/decoder.pyi | 2 +- .../third_party/2and3/simplejson/encoder.pyi | 2 +- .../third_party/2and3/simplejson/scanner.pyi | 0 .../third_party/2and3/singledispatch.pyi | 4 +- .../third_party/2and3/slugify/__init__.pyi | 2 + .../third_party/2and3/slugify/slugify.pyi | 19 + .../third_party/2and3/slugify/special.pyi | 8 + .../typeshed/third_party/2and3/tabulate.pyi | 5 +- .../typeshed/third_party/2and3/termcolor.pyi | 21 +- .../typeshed/third_party/2and3/toml.pyi | 23 +- .../third_party/2and3/typing_extensions.pyi | 93 +- .../third_party/2and3/tzlocal/__init__.pyi | 4 + .../typeshed/third_party/2and3/ujson.pyi | 24 +- .../third_party/2and3/werkzeug/__init__.pyi | 35 +- .../third_party/2and3/werkzeug/_compat.pyi | 13 +- .../third_party/2and3/werkzeug/_internal.pyi | 11 +- .../third_party/2and3/werkzeug/_reloader.pyi | 0 .../2and3/werkzeug/contrib/__init__.pyi | 0 .../2and3/werkzeug/contrib/atom.pyi | 0 .../2and3/werkzeug/contrib/cache.pyi | 12 +- .../2and3/werkzeug/contrib/fixers.pyi | 6 +- .../2and3/werkzeug/contrib/iterio.pyi | 0 .../2and3/werkzeug/contrib/jsrouting.pyi | 0 .../2and3/werkzeug/contrib/limiter.pyi | 0 .../2and3/werkzeug/contrib/lint.pyi | 0 .../2and3/werkzeug/contrib/profiler.pyi | 17 +- .../2and3/werkzeug/contrib/securecookie.pyi | 21 +- .../2and3/werkzeug/contrib/sessions.pyi | 27 +- .../2and3/werkzeug/contrib/testtools.pyi | 1 - .../2and3/werkzeug/contrib/wrappers.pyi | 0 .../2and3/werkzeug/datastructures.pyi | 17 +- .../2and3/werkzeug/debug/__init__.pyi | 16 +- .../2and3/werkzeug/debug/console.pyi | 2 +- .../third_party/2and3/werkzeug/debug/repr.pyi | 0 .../2and3/werkzeug/debug/tbtools.pyi | 0 .../third_party/2and3/werkzeug/exceptions.pyi | 21 +- .../third_party/2and3/werkzeug/filesystem.pyi | 0 .../third_party/2and3/werkzeug/formparser.pyi | 29 +- .../third_party/2and3/werkzeug/http.pyi | 97 +- .../third_party/2and3/werkzeug/local.pyi | 0 .../2and3/werkzeug/middleware/__init__.pyi | 0 .../2and3/werkzeug/middleware/dispatcher.pyi | 4 +- .../2and3/werkzeug/middleware/http_proxy.pyi | 8 +- .../2and3/werkzeug/middleware/lint.pyi | 21 +- .../2and3/werkzeug/middleware/profiler.pyi | 2 +- .../2and3/werkzeug/middleware/proxy_fix.pyi | 2 +- .../2and3/werkzeug/middleware/shared_data.pyi | 4 +- .../2and3/werkzeug/posixemulation.pyi | 1 + .../third_party/2and3/werkzeug/routing.pyi | 81 +- .../third_party/2and3/werkzeug/script.pyi | 16 +- .../third_party/2and3/werkzeug/security.pyi | 0 .../third_party/2and3/werkzeug/serving.pyi | 77 +- .../third_party/2and3/werkzeug/test.pyi | 81 +- .../third_party/2and3/werkzeug/testapp.pyi | 1 + .../third_party/2and3/werkzeug/urls.pyi | 41 +- .../third_party/2and3/werkzeug/useragents.pyi | 6 +- .../third_party/2and3/werkzeug/utils.pyi | 6 +- .../third_party/2and3/werkzeug/wrappers.pyi | 81 +- .../third_party/2and3/werkzeug/wsgi.pyi | 24 +- .../third_party/2and3/yaml/__init__.pyi | 253 +- .../third_party/2and3/yaml/composer.pyi | 4 +- .../third_party/2and3/yaml/constructor.pyi | 9 +- .../typeshed/third_party/2and3/yaml/cyaml.pyi | 50 +- .../third_party/2and3/yaml/dumper.pyi | 56 +- .../third_party/2and3/yaml/emitter.pyi | 5 +- .../typeshed/third_party/2and3/yaml/error.pyi | 0 .../third_party/2and3/yaml/events.pyi | 0 .../third_party/2and3/yaml/loader.pyi | 8 +- .../typeshed/third_party/2and3/yaml/nodes.pyi | 0 .../third_party/2and3/yaml/parser.pyi | 1 + .../third_party/2and3/yaml/reader.pyi | 1 + .../third_party/2and3/yaml/representer.pyi | 17 +- .../third_party/2and3/yaml/resolver.pyi | 1 + .../third_party/2and3/yaml/scanner.pyi | 1 + .../third_party/2and3/yaml/serializer.pyi | 1 + .../third_party/2and3/yaml/tokens.pyi | 0 .../third_party/3/aiofiles/__init__.pyi | 1 + .../typeshed/third_party/3/aiofiles/base.pyi | 35 + .../typeshed/third_party/3/aiofiles/os.pyi | 26 + .../3/aiofiles/threadpool/__init__.pyi | 91 + .../3/aiofiles/threadpool/binary.pyi | 41 + .../3/aiofiles/threadpool/text.pyi | 38 + .../typeshed/third_party/3/contextvars.pyi | 10 +- .../typeshed/third_party/3/dataclasses.pyi | 88 +- .../third_party/3/docutils/__init__.pyi | 2 +- .../third_party/3/docutils/examples.pyi | 2 +- .../typeshed/third_party/3/docutils/nodes.pyi | 8 +- .../3/docutils/parsers/__init__.pyi | 2 +- .../3/docutils/parsers/rst/__init__.pyi | 2 +- .../3/docutils/parsers/rst/nodes.pyi | 2 +- .../3/docutils/parsers/rst/roles.pyi | 5 +- .../3/docutils/parsers/rst/states.pyi | 6 +- .../third_party/3/filelock/__init__.pyi | 54 + .../third_party/3/freezegun/__init__.pyi | 1 + .../typeshed/third_party/3/freezegun/api.pyi | 56 + .../typeshed/third_party/3/frozendict.pyi | 27 + .../typeshed/third_party/3/jwt/__init__.pyi | 28 +- .../typeshed/third_party/3/jwt/algorithms.pyi | 89 +- .../third_party/3/jwt/contrib/__init__.pyi | 0 .../3/jwt/contrib/algorithms/__init__.pyi | 1 - .../3/jwt/contrib/algorithms/py_ecdsa.pyi | 12 +- .../3/jwt/contrib/algorithms/pycrypto.pyi | 12 +- .../typeshed/third_party/3/orjson.pyi | 22 +- .../third_party/3/pkg_resources/__init__.pyi | 38 +- .../3/pkg_resources/py31compat.pyi | 2 - .../third_party/3/pyrfc3339/__init__.pyi | 2 + .../third_party/3/pyrfc3339/generator.pyi | 3 + .../third_party/3/pyrfc3339/parser.pyi | 3 + .../third_party/3/pyrfc3339/utils.pyi | 11 + .../typeshed/third_party/3/six/__init__.pyi | 75 +- .../3/six/moves/BaseHTTPServer.pyi | 0 .../third_party/3/six/moves/CGIHTTPServer.pyi | 0 .../3/six/moves/SimpleHTTPServer.pyi | 0 .../third_party/3/six/moves/__init__.pyi | 110 +- .../third_party/3/six/moves/_dummy_thread.pyi | 0 .../third_party/3/six/moves/_thread.pyi | 0 .../third_party/3/six/moves/builtins.pyi | 0 .../third_party/3/six/moves/cPickle.pyi | 0 .../3/six/moves/collections_abc.pyi | 1 + .../third_party/3/six/moves/configparser.pyi | 0 .../3/six/moves/email_mime_base.pyi | 0 .../3/six/moves/email_mime_multipart.pyi | 0 .../3/six/moves/email_mime_nonmultipart.pyi | 0 .../3/six/moves/email_mime_text.pyi | 0 .../third_party/3/six/moves/html_entities.pyi | 0 .../third_party/3/six/moves/html_parser.pyi | 0 .../third_party/3/six/moves/http_client.pyi | 0 .../3/six/moves/http_cookiejar.pyi | 0 .../third_party/3/six/moves/http_cookies.pyi | 0 .../third_party/3/six/moves/queue.pyi | 0 .../third_party/3/six/moves/reprlib.pyi | 0 .../third_party/3/six/moves/socketserver.pyi | 0 .../third_party/3/six/moves/tkinter.pyi | 0 .../3/six/moves/tkinter_commondialog.pyi | 0 .../3/six/moves/tkinter_constants.pyi | 0 .../3/six/moves/tkinter_dialog.pyi | 0 .../3/six/moves/tkinter_filedialog.pyi | 0 .../3/six/moves/tkinter_tkfiledialog.pyi | 0 .../third_party/3/six/moves/tkinter_ttk.pyi | 0 .../3/six/moves/urllib/__init__.pyi | 0 .../third_party/3/six/moves/urllib/error.pyi | 4 +- .../third_party/3/six/moves/urllib/parse.pyi | 44 +- .../3/six/moves/urllib/request.pyi | 70 +- .../3/six/moves/urllib/response.pyi | 0 .../3/six/moves/urllib/robotparser.pyi | 0 .../third_party/3/six/moves/urllib_error.pyi | 0 .../third_party/3/six/moves/urllib_parse.pyi | 0 .../3/six/moves/urllib_request.pyi | 0 .../3/six/moves/urllib_response.pyi | 0 .../3/six/moves/urllib_robotparser.pyi | 0 .../third_party/3/typed_ast/__init__.pyi | 2 - .../third_party/3/typed_ast/ast27.pyi | 48 +- .../typeshed/third_party/3/typed_ast/ast3.pyi | 53 +- .../third_party/3/typed_ast/conversions.pyi | 3 +- .../third_party/3/waitress/__init__.pyi | 7 + .../third_party/3/waitress/adjustments.pyi | 61 + .../third_party/3/waitress/buffers.pyi | 57 + .../third_party/3/waitress/channel.pyi | 49 + .../third_party/3/waitress/compat.pyi | 39 + .../third_party/3/waitress/parser.pyi | 43 + .../third_party/3/waitress/proxy_headers.pyi | 32 + .../third_party/3/waitress/receiver.pyi | 32 + .../third_party/3/waitress/rfc7230.pyi | 16 + .../third_party/3/waitress/runner.pyi | 11 + .../third_party/3/waitress/server.pyi | 103 + .../typeshed/third_party/3/waitress/task.pyi | 69 + .../third_party/3/waitress/trigger.pyi | 31 + .../third_party/3/waitress/utilities.pyi | 76 + .../third_party/3/waitress/wasyncore.pyi | 94 + anaconda_lib/jedi/utils.py | 5 +- anaconda_lib/linting/anaconda_pylint.py | 51 +- anaconda_lib/linting/mccabe.py | 136 +- anaconda_lib/linting/pycodestyle.py | 346 +- anaconda_lib/linting/pyflakes/__init__.py | 2 +- anaconda_lib/linting/pyflakes/__main__.py | 5 + anaconda_lib/linting/pyflakes/api.py | 211 ++ anaconda_lib/linting/pyflakes/checker.py | 241 +- anaconda_lib/linting/pyflakes/messages.py | 0 anaconda_lib/linting/pyflakes/reporter.py | 82 + .../linting/pyflakes/scripts/__init__.py | 0 .../linting/pyflakes/scripts/pyflakes.py | 8 + .../linting/pyflakes/test/__init__.py | 0 anaconda_lib/linting/pyflakes/test/harness.py | 72 + .../linting/pyflakes/test/test_api.py | 845 +++++ .../linting/pyflakes/test/test_builtin.py | 41 + .../linting/pyflakes/test/test_checker.py | 186 ++ .../pyflakes/test/test_code_segment.py | 132 + .../linting/pyflakes/test/test_dict.py | 213 ++ .../linting/pyflakes/test/test_doctests.py | 465 +++ .../linting/pyflakes/test/test_imports.py | 1230 +++++++ .../linting/pyflakes/test/test_is_literal.py | 222 ++ .../linting/pyflakes/test/test_match.py | 83 + .../linting/pyflakes/test/test_other.py | 2126 ++++++++++++ ..._return_with_arguments_inside_generator.py | 34 + .../pyflakes/test/test_type_annotations.py | 763 +++++ .../pyflakes/test/test_undefined_names.py | 871 +++++ anaconda_lib/parso/__init__.py | 4 +- anaconda_lib/parso/_compatibility.py | 66 - anaconda_lib/parso/cache.py | 137 +- anaconda_lib/parso/file_io.py | 13 +- anaconda_lib/parso/grammar.py | 144 +- anaconda_lib/parso/normalizer.py | 33 +- anaconda_lib/parso/parser.py | 15 +- anaconda_lib/parso/pgen2/generator.py | 49 +- anaconda_lib/parso/pgen2/grammar_parser.py | 55 +- anaconda_lib/parso/py.typed | 0 anaconda_lib/parso/python/diff.py | 6 +- anaconda_lib/parso/python/errors.py | 493 ++- anaconda_lib/parso/python/grammar27.txt | 143 - .../python/{grammar35.txt => grammar310.txt} | 84 +- .../python/{grammar34.txt => grammar311.txt} | 115 +- .../python/{grammar33.txt => grammar312.txt} | 117 +- anaconda_lib/parso/python/grammar36.txt | 2 +- anaconda_lib/parso/python/grammar37.txt | 2 +- anaconda_lib/parso/python/grammar38.txt | 4 +- anaconda_lib/parso/python/grammar39.txt | 14 +- anaconda_lib/parso/python/issue_list.txt | 168 + anaconda_lib/parso/python/parser.py | 21 +- anaconda_lib/parso/python/pep8.py | 132 +- anaconda_lib/parso/python/prefix.py | 25 +- anaconda_lib/parso/python/token.py | 38 +- anaconda_lib/parso/python/tokenize.py | 205 +- anaconda_lib/parso/python/tree.py | 112 +- anaconda_lib/parso/tree.py | 179 +- anaconda_lib/parso/utils.py | 120 +- anaconda_server/commands/autocomplete.py | 25 +- .../commands/complete_parameters.py | 27 +- anaconda_server/commands/doc.py | 43 +- anaconda_server/commands/find_usages.py | 57 +- anaconda_server/commands/goto.py | 30 +- anaconda_server/handlers/jedi_handler.py | 109 +- .../handlers/python_lint_handler.py | 135 +- anaconda_server/jsonserver.py | 10 +- 2128 files changed, 60797 insertions(+), 27494 deletions(-) mode change 100755 => 100644 anaconda_lib/jedi/__init__.py mode change 100755 => 100644 anaconda_lib/jedi/__main__.py mode change 100755 => 100644 anaconda_lib/jedi/_compatibility.py mode change 100755 => 100644 anaconda_lib/jedi/api/__init__.py mode change 100755 => 100644 anaconda_lib/jedi/api/classes.py mode change 100755 => 100644 anaconda_lib/jedi/api/completion.py mode change 100755 => 100644 anaconda_lib/jedi/api/completion_cache.py mode change 100755 => 100644 anaconda_lib/jedi/api/environment.py mode change 100755 => 100644 anaconda_lib/jedi/api/errors.py mode change 100755 => 100644 anaconda_lib/jedi/api/exceptions.py mode change 100755 => 100644 anaconda_lib/jedi/api/file_name.py mode change 100755 => 100644 anaconda_lib/jedi/api/helpers.py mode change 100755 => 100644 anaconda_lib/jedi/api/interpreter.py mode change 100755 => 100644 anaconda_lib/jedi/api/keywords.py mode change 100755 => 100644 anaconda_lib/jedi/api/project.py mode change 100755 => 100644 anaconda_lib/jedi/api/refactoring/__init__.py mode change 100755 => 100644 anaconda_lib/jedi/api/refactoring/extract.py mode change 100755 => 100644 anaconda_lib/jedi/api/replstartup.py mode change 100755 => 100644 anaconda_lib/jedi/api/strings.py mode change 100755 => 100644 anaconda_lib/jedi/cache.py mode change 100755 => 100644 anaconda_lib/jedi/common.py mode change 100755 => 100644 anaconda_lib/jedi/debug.py mode change 100755 => 100644 anaconda_lib/jedi/file_io.py mode change 100755 => 100644 anaconda_lib/jedi/inference/__init__.py mode change 100755 => 100644 anaconda_lib/jedi/inference/analysis.py mode change 100755 => 100644 anaconda_lib/jedi/inference/arguments.py mode change 100755 => 100644 anaconda_lib/jedi/inference/base_value.py mode change 100755 => 100644 anaconda_lib/jedi/inference/cache.py mode change 100755 => 100644 anaconda_lib/jedi/inference/compiled/__init__.py mode change 100755 => 100644 anaconda_lib/jedi/inference/compiled/access.py mode change 100755 => 100644 anaconda_lib/jedi/inference/compiled/getattr_static.py mode change 100755 => 100644 anaconda_lib/jedi/inference/compiled/mixed.py mode change 100755 => 100644 anaconda_lib/jedi/inference/compiled/subprocess/__init__.py mode change 100755 => 100644 anaconda_lib/jedi/inference/compiled/subprocess/__main__.py mode change 100755 => 100644 anaconda_lib/jedi/inference/compiled/subprocess/functions.py mode change 100755 => 100644 anaconda_lib/jedi/inference/compiled/value.py mode change 100755 => 100644 anaconda_lib/jedi/inference/context.py create mode 100644 anaconda_lib/jedi/inference/docstring_utils.py mode change 100755 => 100644 anaconda_lib/jedi/inference/docstrings.py mode change 100755 => 100644 anaconda_lib/jedi/inference/dynamic_params.py mode change 100755 => 100644 anaconda_lib/jedi/inference/filters.py mode change 100755 => 100644 anaconda_lib/jedi/inference/finder.py mode change 100755 => 100644 anaconda_lib/jedi/inference/flow_analysis.py mode change 100755 => 100644 anaconda_lib/jedi/inference/gradual/__init__.py mode change 100755 => 100644 anaconda_lib/jedi/inference/gradual/annotation.py mode change 100755 => 100644 anaconda_lib/jedi/inference/gradual/base.py mode change 100755 => 100644 anaconda_lib/jedi/inference/gradual/conversion.py mode change 100755 => 100644 anaconda_lib/jedi/inference/gradual/generics.py mode change 100755 => 100644 anaconda_lib/jedi/inference/gradual/stub_value.py mode change 100755 => 100644 anaconda_lib/jedi/inference/gradual/type_var.py mode change 100755 => 100644 anaconda_lib/jedi/inference/gradual/typeshed.py mode change 100755 => 100644 anaconda_lib/jedi/inference/gradual/typing.py mode change 100755 => 100644 anaconda_lib/jedi/inference/gradual/utils.py mode change 100755 => 100644 anaconda_lib/jedi/inference/helpers.py mode change 100755 => 100644 anaconda_lib/jedi/inference/imports.py mode change 100755 => 100644 anaconda_lib/jedi/inference/lazy_value.py mode change 100755 => 100644 anaconda_lib/jedi/inference/names.py mode change 100755 => 100644 anaconda_lib/jedi/inference/param.py mode change 100755 => 100644 anaconda_lib/jedi/inference/parser_cache.py mode change 100755 => 100644 anaconda_lib/jedi/inference/recursion.py mode change 100755 => 100644 anaconda_lib/jedi/inference/references.py mode change 100755 => 100644 anaconda_lib/jedi/inference/signature.py mode change 100755 => 100644 anaconda_lib/jedi/inference/star_args.py mode change 100755 => 100644 anaconda_lib/jedi/inference/syntax_tree.py mode change 100755 => 100644 anaconda_lib/jedi/inference/sys_path.py mode change 100755 => 100644 anaconda_lib/jedi/inference/utils.py mode change 100755 => 100644 anaconda_lib/jedi/inference/value/__init__.py mode change 100755 => 100644 anaconda_lib/jedi/inference/value/decorator.py mode change 100755 => 100644 anaconda_lib/jedi/inference/value/dynamic_arrays.py mode change 100755 => 100644 anaconda_lib/jedi/inference/value/function.py mode change 100755 => 100644 anaconda_lib/jedi/inference/value/instance.py mode change 100755 => 100644 anaconda_lib/jedi/inference/value/iterable.py mode change 100755 => 100644 anaconda_lib/jedi/inference/value/klass.py mode change 100755 => 100644 anaconda_lib/jedi/inference/value/module.py mode change 100755 => 100644 anaconda_lib/jedi/inference/value/namespace.py mode change 100755 => 100644 anaconda_lib/jedi/parser_utils.py mode change 100755 => 100644 anaconda_lib/jedi/plugins/__init__.py mode change 100755 => 100644 anaconda_lib/jedi/plugins/django.py mode change 100755 => 100644 anaconda_lib/jedi/plugins/flask.py mode change 100755 => 100644 anaconda_lib/jedi/plugins/pytest.py mode change 100755 => 100644 anaconda_lib/jedi/plugins/registry.py mode change 100755 => 100644 anaconda_lib/jedi/plugins/stdlib.py mode change 100755 => 100644 anaconda_lib/jedi/settings.py mode change 100755 => 100644 anaconda_lib/jedi/third_party/README_typeshed.md create mode 100644 anaconda_lib/jedi/third_party/django-stubs/CONTRIBUTING.md create mode 100644 anaconda_lib/jedi/third_party/django-stubs/LICENSE.txt create mode 100644 anaconda_lib/jedi/third_party/django-stubs/README.md create mode 100644 anaconda_lib/jedi/third_party/django-stubs/dev-requirements.txt rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/apps/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/apps/config.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/apps/registry.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/conf/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/conf/global_settings.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/conf/locale/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/conf/urls/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/conf/urls/i18n.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/conf/urls/static.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/admin/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/admin/actions.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/admin/apps.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/admin/checks.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/admin/decorators.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/admin/filters.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/admin/forms.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/admin/helpers.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/admin/models.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/admin/options.pyi (84%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/admin/sites.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/admin/templatetags/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/admin/templatetags/admin_list.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/admin/templatetags/admin_modify.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/admin/templatetags/admin_static.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/admin/templatetags/admin_urls.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/admin/templatetags/base.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/admin/templatetags/log.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/admin/tests.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/admin/utils.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/admin/views/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/admin/views/autocomplete.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/admin/views/decorators.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/admin/views/main.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/admin/widgets.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/admindocs/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/admindocs/middleware.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/admindocs/urls.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/admindocs/utils.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/admindocs/views.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/auth/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/auth/admin.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/auth/apps.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/auth/backends.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/auth/base_user.pyi (84%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/auth/checks.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/auth/context_processors.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/auth/decorators.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/auth/forms.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/auth/handlers/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/auth/handlers/modwsgi.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/auth/hashers.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/auth/management/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/auth/management/commands/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/auth/management/commands/changepassword.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/auth/management/commands/createsuperuser.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/auth/middleware.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/auth/mixins.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/auth/models.pyi (95%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/auth/password_validation.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/auth/signals.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/auth/tokens.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/auth/urls.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/auth/validators.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/auth/views.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/contenttypes/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/contenttypes/admin.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/contenttypes/apps.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/contenttypes/checks.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/contenttypes/fields.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/contenttypes/forms.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/contenttypes/management/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/contenttypes/management/commands/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/contenttypes/management/commands/remove_stale_contenttypes.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/contenttypes/models.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/contenttypes/views.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/flatpages/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/flatpages/forms.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/flatpages/middleware.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/flatpages/models.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/flatpages/sitemaps.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/flatpages/templatetags/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/flatpages/templatetags/flatpages.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/flatpages/urls.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/flatpages/views.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/gis/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/gis/db/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/gis/db/models/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/gis/db/models/fields.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/humanize/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/humanize/templatetags/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/humanize/templatetags/humanize.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/messages/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/messages/api.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/messages/constants.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/messages/context_processors.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/messages/middleware.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/messages/storage/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/messages/storage/base.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/messages/storage/cookie.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/messages/storage/fallback.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/messages/storage/session.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/messages/utils.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/messages/views.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/postgres/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/postgres/aggregates/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/postgres/aggregates/general.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/postgres/aggregates/mixins.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/postgres/aggregates/statistics.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/postgres/constraints.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/postgres/fields/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/postgres/fields/array.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/postgres/fields/citext.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/postgres/fields/hstore.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/postgres/fields/jsonb.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/postgres/fields/mixins.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/postgres/fields/ranges.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/postgres/functions.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/postgres/indexes.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/postgres/lookups.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/postgres/operations.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/postgres/search.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/postgres/signals.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/postgres/validators.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/redirects/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/redirects/middleware.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/redirects/models.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/sessions/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/sessions/backends/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/sessions/backends/base.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/sessions/backends/cache.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/sessions/backends/cached_db.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/sessions/backends/db.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/sessions/backends/file.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/sessions/backends/signed_cookies.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/sessions/base_session.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/sessions/exceptions.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/sessions/management/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/sessions/management/commands/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/sessions/management/commands/clearsessions.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/sessions/middleware.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/sessions/models.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/sessions/serializers.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/sitemaps/__init__.pyi (78%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/sitemaps/management/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/sitemaps/management/commands/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/sitemaps/management/commands/ping_google.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/sitemaps/views.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/sites/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/sites/apps.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/sites/management.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/sites/managers.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/sites/middleware.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/sites/models.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/sites/requests.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/sites/shortcuts.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/staticfiles/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/staticfiles/apps.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/staticfiles/checks.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/staticfiles/finders.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/staticfiles/handlers.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/staticfiles/management/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/staticfiles/management/commands/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/staticfiles/management/commands/collectstatic.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/staticfiles/management/commands/findstatic.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/staticfiles/management/commands/runserver.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/staticfiles/storage.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/staticfiles/templatetags/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/staticfiles/templatetags/staticfiles.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/staticfiles/testing.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/staticfiles/urls.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/staticfiles/utils.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/staticfiles/views.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/syndication/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/contrib/syndication/views.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/cache/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/cache/backends/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/cache/backends/base.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/cache/backends/db.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/cache/backends/dummy.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/cache/backends/filebased.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/cache/backends/locmem.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/cache/backends/memcached.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/cache/utils.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/checks/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/checks/caches.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/checks/database.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/checks/messages.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/checks/model_checks.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/checks/registry.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/checks/security/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/checks/security/base.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/checks/security/csrf.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/checks/security/sessions.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/checks/templates.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/checks/translation.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/checks/urls.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/exceptions.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/files/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/files/base.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/files/images.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/files/locks.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/files/move.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/files/storage.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/files/temp.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/files/uploadedfile.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/files/uploadhandler.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/files/utils.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/handlers/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/handlers/base.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/handlers/exception.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/handlers/wsgi.pyi (94%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/mail/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/mail/backends/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/mail/backends/base.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/mail/backends/console.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/mail/backends/dummy.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/mail/backends/filebased.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/mail/backends/locmem.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/mail/backends/smtp.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/mail/message.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/mail/utils.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/management/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/management/base.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/management/color.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/management/commands/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/management/commands/dumpdata.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/management/commands/loaddata.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/management/commands/makemessages.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/management/commands/runserver.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/management/commands/testserver.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/management/sql.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/management/templates.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/management/utils.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/paginator.pyi (90%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/serializers/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/serializers/base.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/serializers/json.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/serializers/python.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/servers/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/servers/basehttp.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/signals.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/signing.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/validators.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/core/wsgi.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/backends/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/backends/base/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/backends/base/base.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/backends/base/client.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/backends/base/creation.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/backends/base/features.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/backends/base/introspection.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/backends/base/operations.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/backends/base/schema.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/backends/base/validation.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/backends/ddl_references.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/backends/dummy/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/backends/dummy/base.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/backends/mysql/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/backends/mysql/client.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/backends/postgresql/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/backends/postgresql/base.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/backends/postgresql/client.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/backends/postgresql/creation.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/backends/postgresql/operations.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/backends/signals.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/backends/sqlite3/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/backends/sqlite3/base.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/backends/sqlite3/creation.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/backends/sqlite3/features.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/backends/sqlite3/introspection.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/backends/sqlite3/operations.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/backends/sqlite3/schema.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/backends/utils.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/migrations/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/migrations/autodetector.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/migrations/exceptions.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/migrations/executor.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/migrations/graph.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/migrations/loader.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/migrations/migration.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/migrations/operations/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/migrations/operations/base.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/migrations/operations/fields.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/migrations/operations/models.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/migrations/operations/special.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/migrations/operations/utils.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/migrations/optimizer.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/migrations/questioner.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/migrations/recorder.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/migrations/serializer.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/migrations/state.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/migrations/topological_sort.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/migrations/utils.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/migrations/writer.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/models/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/models/aggregates.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/models/base.pyi (95%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/models/constraints.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/models/deletion.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/models/enums.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/models/expressions.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/models/fields/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/models/fields/files.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/models/fields/mixins.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/models/fields/proxy.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/models/fields/related.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/models/fields/related_descriptors.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/models/fields/related_lookups.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/models/fields/reverse_related.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/models/functions/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/models/functions/comparison.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/models/functions/datetime.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/models/functions/math.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/models/functions/mixins.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/models/functions/text.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/models/functions/window.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/models/indexes.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/models/lookups.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/models/manager.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/models/options.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/models/query.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/models/query_utils.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/models/signals.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/models/sql/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/models/sql/compiler.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/models/sql/constants.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/models/sql/datastructures.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/models/sql/query.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/models/sql/subqueries.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/models/sql/where.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/models/utils.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/transaction.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/db/utils.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/dispatch/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/dispatch/dispatcher.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/forms/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/forms/boundfield.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/forms/fields.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/forms/forms.pyi (93%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/forms/formsets.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/forms/models.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/forms/renderers.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/forms/utils.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/forms/widgets.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/http/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/http/cookie.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/http/multipartparser.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/http/request.pyi (97%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/http/response.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/middleware/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/middleware/cache.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/middleware/clickjacking.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/middleware/common.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/middleware/csrf.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/middleware/gzip.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/middleware/http.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/middleware/locale.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/middleware/security.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/shortcuts.pyi (66%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/template/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/template/backends/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/template/backends/base.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/template/backends/django.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/template/backends/dummy.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/template/backends/jinja2.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/template/backends/utils.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/template/base.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/template/context.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/template/context_processors.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/template/defaultfilters.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/template/defaulttags.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/template/engine.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/template/exceptions.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/template/library.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/template/loader.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/template/loader_tags.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/template/loaders/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/template/loaders/app_directories.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/template/loaders/base.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/template/loaders/cached.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/template/loaders/filesystem.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/template/loaders/locmem.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/template/response.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/template/smartif.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/template/utils.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/templatetags/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/templatetags/cache.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/templatetags/i18n.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/templatetags/l10n.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/templatetags/static.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/templatetags/tz.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/test/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/test/client.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/test/html.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/test/runner.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/test/selenium.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/test/signals.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/test/testcases.pyi (95%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/test/utils.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/urls/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/urls/base.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/urls/conf.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/urls/converters.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/urls/exceptions.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/urls/resolvers.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/urls/utils.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/utils/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/utils/_os.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/utils/archive.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/utils/autoreload.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/utils/baseconv.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/utils/cache.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/utils/crypto.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/utils/datastructures.pyi (97%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/utils/dateformat.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/utils/dateparse.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/utils/dates.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/utils/datetime_safe.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/utils/deconstruct.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/utils/decorators.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/utils/deprecation.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/utils/duration.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/utils/encoding.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/utils/feedgenerator.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/utils/formats.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/utils/functional.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/utils/hashable.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/utils/html.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/utils/http.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/utils/inspect.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/utils/ipv6.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/utils/itercompat.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/utils/jslex.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/utils/log.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/utils/lorem_ipsum.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/utils/module_loading.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/utils/numberformat.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/utils/regex_helper.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/utils/safestring.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/utils/six.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/utils/termcolors.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/utils/text.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/utils/timesince.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/utils/timezone.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/utils/topological_sort.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/utils/translation/__init__.pyi (96%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/utils/translation/reloader.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/utils/translation/template.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/utils/translation/trans_null.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/utils/translation/trans_real.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/utils/tree.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/utils/version.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/utils/xmlutils.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/views/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/views/csrf.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/views/debug.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/views/decorators/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/views/decorators/cache.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/views/decorators/clickjacking.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/views/decorators/csrf.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/views/decorators/debug.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/views/decorators/gzip.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/views/decorators/http.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/views/decorators/vary.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/views/defaults.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/views/generic/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/views/generic/base.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/views/generic/dates.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/views/generic/detail.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/views/generic/edit.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/views/generic/list.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/views/i18n.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/django-stubs/{ => django-stubs}/views/static.pyi (100%) mode change 100755 => 100644 create mode 100644 anaconda_lib/jedi/third_party/django-stubs/flake8-pyi.ini create mode 100644 anaconda_lib/jedi/third_party/django-stubs/mypy.ini rename anaconda_lib/jedi/third_party/{typeshed/stdlib/2and3/distutils/__init__.pyi => django-stubs/mypy_django_plugin/__init__.py} (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/{typeshed/stdlib/2and3/distutils/command/__init__.pyi => django-stubs/mypy_django_plugin/django/__init__.py} (100%) mode change 100755 => 100644 create mode 100644 anaconda_lib/jedi/third_party/django-stubs/mypy_django_plugin/django/context.py rename anaconda_lib/jedi/third_party/{typeshed/stdlib/2and3/distutils/command/bdist.pyi => django-stubs/mypy_django_plugin/lib/__init__.py} (100%) mode change 100755 => 100644 create mode 100644 anaconda_lib/jedi/third_party/django-stubs/mypy_django_plugin/lib/fullnames.py create mode 100644 anaconda_lib/jedi/third_party/django-stubs/mypy_django_plugin/lib/helpers.py create mode 100644 anaconda_lib/jedi/third_party/django-stubs/mypy_django_plugin/main.py rename anaconda_lib/jedi/third_party/{typeshed/stdlib/2and3/distutils/command/bdist_dumb.pyi => django-stubs/mypy_django_plugin/transformers/__init__.py} (100%) mode change 100755 => 100644 create mode 100644 anaconda_lib/jedi/third_party/django-stubs/mypy_django_plugin/transformers/fields.py create mode 100644 anaconda_lib/jedi/third_party/django-stubs/mypy_django_plugin/transformers/forms.py create mode 100644 anaconda_lib/jedi/third_party/django-stubs/mypy_django_plugin/transformers/init_create.py create mode 100644 anaconda_lib/jedi/third_party/django-stubs/mypy_django_plugin/transformers/managers.py create mode 100644 anaconda_lib/jedi/third_party/django-stubs/mypy_django_plugin/transformers/meta.py create mode 100644 anaconda_lib/jedi/third_party/django-stubs/mypy_django_plugin/transformers/models.py create mode 100644 anaconda_lib/jedi/third_party/django-stubs/mypy_django_plugin/transformers/orm_lookups.py create mode 100644 anaconda_lib/jedi/third_party/django-stubs/mypy_django_plugin/transformers/querysets.py create mode 100644 anaconda_lib/jedi/third_party/django-stubs/mypy_django_plugin/transformers/request.py create mode 100644 anaconda_lib/jedi/third_party/django-stubs/mypy_django_plugin/transformers/settings.py create mode 100644 anaconda_lib/jedi/third_party/django-stubs/pytest.ini create mode 100755 anaconda_lib/jedi/third_party/django-stubs/reformat.xsh create mode 100755 anaconda_lib/jedi/third_party/django-stubs/release.xsh rename anaconda_lib/jedi/third_party/{typeshed/stdlib/2and3/distutils/command/bdist_packager.pyi => django-stubs/scripts/__init__.py} (100%) mode change 100755 => 100644 create mode 100644 anaconda_lib/jedi/third_party/django-stubs/scripts/build_import_all_test.py create mode 100644 anaconda_lib/jedi/third_party/django-stubs/scripts/catch_non_abstract_annotation.py create mode 100644 anaconda_lib/jedi/third_party/django-stubs/scripts/django_tests_settings.py create mode 100644 anaconda_lib/jedi/third_party/django-stubs/scripts/enabled_test_modules.py create mode 100644 anaconda_lib/jedi/third_party/django-stubs/scripts/mypy.ini create mode 100644 anaconda_lib/jedi/third_party/django-stubs/scripts/tests_extension_hook.py create mode 100644 anaconda_lib/jedi/third_party/django-stubs/scripts/typecheck_tests.py create mode 100644 anaconda_lib/jedi/third_party/django-stubs/setup.cfg create mode 100644 anaconda_lib/jedi/third_party/django-stubs/setup.py create mode 100644 anaconda_lib/jedi/third_party/django-stubs/test-data/plugins.ini create mode 100644 anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/contrib/admin/test_options.yml create mode 100644 anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/contrib/auth/test_decorators.yml create mode 100644 anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/db/test_transaction.yml create mode 100644 anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/fields/test_base.yml create mode 100644 anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/fields/test_generic_foreign_key.yml create mode 100644 anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/fields/test_nullable.yml create mode 100644 anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/fields/test_postgres_fields.yml create mode 100644 anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/fields/test_related.yml create mode 100644 anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/managers/querysets/test_basic_methods.yml create mode 100644 anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/managers/querysets/test_filter.yml create mode 100644 anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/managers/querysets/test_from_queryset.yml create mode 100644 anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/managers/querysets/test_values.yml create mode 100644 anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/managers/querysets/test_values_list.yml create mode 100644 anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/managers/test_managers.yml create mode 100644 anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/models/test_contrib_models.yml create mode 100644 anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/models/test_create.yml create mode 100644 anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/models/test_extra_methods.yml create mode 100644 anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/models/test_inheritance.yml create mode 100644 anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/models/test_init.yml create mode 100644 anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/models/test_meta_options.yml create mode 100644 anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/models/test_proxy_models.yml create mode 100644 anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/models/test_state.yml create mode 100644 anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/test/test_testcase.yml create mode 100644 anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/test_config.yml create mode 100644 anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/test_forms.yml create mode 100644 anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/test_helpers.yml create mode 100644 anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/test_import_all.yml create mode 100644 anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/test_request.yml create mode 100644 anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/test_settings.yml create mode 100644 anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/test_shortcuts.yml create mode 100644 anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/utils/test_decorators.yml create mode 100644 anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/utils/test_functional.yml create mode 100644 anaconda_lib/jedi/third_party/typeshed/CONTRIBUTING.md create mode 100644 anaconda_lib/jedi/third_party/typeshed/LICENSE create mode 100644 anaconda_lib/jedi/third_party/typeshed/README.md create mode 100755 anaconda_lib/jedi/third_party/typeshed/pre-commit create mode 100644 anaconda_lib/jedi/third_party/typeshed/requirements-tests-py3.txt create mode 100755 anaconda_lib/jedi/third_party/typeshed/scripts/generate_proto_stubs.sh create mode 100644 anaconda_lib/jedi/third_party/typeshed/scripts/migrate_script.py create mode 100755 anaconda_lib/jedi/third_party/typeshed/scripts/update-stubtest-whitelist.py mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/BaseHTTPServer.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/CGIHTTPServer.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/ConfigParser.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/Cookie.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/HTMLParser.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/Queue.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/SimpleHTTPServer.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/SocketServer.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/StringIO.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/UserDict.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/UserList.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/UserString.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/__builtin__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/_ast.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/_collections.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/_functools.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/_hotshot.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/_io.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/_json.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/_md5.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/_sha.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/_sha256.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/_sha512.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/_socket.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/_sre.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/_struct.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/_symtable.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/_threading_local.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/_winreg.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/abc.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/ast.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/atexit.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/builtins.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/cPickle.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/cStringIO.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/collections.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/commands.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/compileall.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/cookielib.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/copy_reg.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/dircache.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/__init__.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/archive_util.pyi rename anaconda_lib/jedi/third_party/typeshed/stdlib/{2and3 => 2}/distutils/bcppcompiler.pyi (67%) mode change 100755 => 100644 create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/ccompiler.pyi rename anaconda_lib/jedi/third_party/typeshed/stdlib/{2and3 => 2}/distutils/cmd.pyi (53%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/typeshed/{third_party/2and3/Crypto/Random/Fortuna => stdlib/2/distutils/command}/__init__.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/typeshed/stdlib/{2and3/distutils/command/bdist_rpm.pyi => 2/distutils/command/bdist.pyi} (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/typeshed/stdlib/{2and3/distutils/command/bdist_wininst.pyi => 2/distutils/command/bdist_dumb.pyi} (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/typeshed/stdlib/{2and3 => 2}/distutils/command/bdist_msi.pyi (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/typeshed/stdlib/{2and3/distutils/command/build.pyi => 2/distutils/command/bdist_packager.pyi} (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/typeshed/stdlib/{2and3/distutils/command/build_clib.pyi => 2/distutils/command/bdist_rpm.pyi} (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/typeshed/stdlib/{2and3/distutils/command/build_ext.pyi => 2/distutils/command/bdist_wininst.pyi} (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/typeshed/stdlib/{2and3/distutils/command/build_scripts.pyi => 2/distutils/command/build.pyi} (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/typeshed/stdlib/{2and3/distutils/command/check.pyi => 2/distutils/command/build_clib.pyi} (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/typeshed/stdlib/{2and3/distutils/command/clean.pyi => 2/distutils/command/build_ext.pyi} (100%) mode change 100755 => 100644 create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/command/build_py.pyi rename anaconda_lib/jedi/third_party/typeshed/stdlib/{2and3/distutils/command/config.pyi => 2/distutils/command/build_scripts.pyi} (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/typeshed/stdlib/{2and3/distutils/command/install_data.pyi => 2/distutils/command/check.pyi} (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/typeshed/stdlib/{2and3/distutils/command/install_headers.pyi => 2/distutils/command/clean.pyi} (100%) mode change 100755 => 100644 create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/command/config.pyi rename anaconda_lib/jedi/third_party/typeshed/stdlib/{2and3 => 2}/distutils/command/install.pyi (99%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/typeshed/stdlib/{2and3/distutils/command/install_lib.pyi => 2/distutils/command/install_data.pyi} (100%) mode change 100755 => 100644 create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/command/install_egg_info.pyi rename anaconda_lib/jedi/third_party/typeshed/stdlib/{2and3/distutils/command/install_scripts.pyi => 2/distutils/command/install_headers.pyi} (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/typeshed/stdlib/{2and3/distutils/command/register.pyi => 2/distutils/command/install_lib.pyi} (100%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/typeshed/stdlib/{2and3/distutils/command/sdist.pyi => 2/distutils/command/install_scripts.pyi} (100%) mode change 100755 => 100644 create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/command/register.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/command/sdist.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/command/upload.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/config.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/core.pyi rename anaconda_lib/jedi/third_party/typeshed/stdlib/{2and3 => 2}/distutils/cygwinccompiler.pyi (77%) mode change 100755 => 100644 create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/debug.pyi rename anaconda_lib/jedi/third_party/typeshed/stdlib/{2and3 => 2}/distutils/dep_util.pyi (53%) mode change 100755 => 100644 create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/dir_util.pyi rename anaconda_lib/jedi/third_party/typeshed/stdlib/{2and3 => 2}/distutils/dist.pyi (77%) mode change 100755 => 100644 mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/emxccompiler.pyi rename anaconda_lib/jedi/third_party/typeshed/stdlib/{2and3 => 2}/distutils/errors.pyi (100%) mode change 100755 => 100644 create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/extension.pyi rename anaconda_lib/jedi/third_party/typeshed/stdlib/{2and3 => 2}/distutils/fancy_getopt.pyi (65%) mode change 100755 => 100644 create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/file_util.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/filelist.pyi rename anaconda_lib/jedi/third_party/typeshed/stdlib/{2and3 => 2}/distutils/log.pyi (63%) mode change 100755 => 100644 rename anaconda_lib/jedi/third_party/typeshed/stdlib/{2and3 => 2}/distutils/msvccompiler.pyi (67%) mode change 100755 => 100644 create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/spawn.pyi rename anaconda_lib/jedi/third_party/typeshed/stdlib/{2and3 => 2}/distutils/sysconfig.pyi (69%) mode change 100755 => 100644 create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/text_file.pyi rename anaconda_lib/jedi/third_party/typeshed/stdlib/{2and3 => 2}/distutils/unixccompiler.pyi (67%) mode change 100755 => 100644 create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/util.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/version.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/dummy_thread.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/MIMEText.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/_parseaddr.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/base64mime.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/charset.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/encoders.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/feedparser.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/generator.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/header.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/iterators.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/message.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/mime/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/mime/application.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/mime/audio.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/mime/base.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/mime/image.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/mime/message.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/mime/multipart.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/mime/nonmultipart.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/mime/text.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/parser.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/quoprimime.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/utils.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/encodings/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/encodings/utf_8.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/exceptions.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/fcntl.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/fnmatch.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/functools.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/future_builtins.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/gc.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/getopt.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/getpass.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/gettext.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/glob.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/gzip.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/hashlib.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/heapq.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/htmlentitydefs.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/httplib.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/imp.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/importlib.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/inspect.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/io.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/itertools.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/json.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/markupbase.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/md5.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/mimetools.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/multiprocessing/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/multiprocessing/dummy/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/multiprocessing/dummy/connection.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/multiprocessing/pool.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/multiprocessing/process.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/multiprocessing/util.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/mutex.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/ntpath.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/nturl2path.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/os/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/os/path.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/os2emxpath.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/pipes.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/platform.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/popen2.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/posix.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/posixpath.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/random.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/re.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/repr.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/resource.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/rfc822.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/robotparser.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/runpy.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/sets.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/sha.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/shelve.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/shlex.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/signal.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/smtplib.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/spwd.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/sre_constants.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/sre_parse.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/stat.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/string.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/stringold.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/strop.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/subprocess.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/symbol.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/sys.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/tempfile.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/textwrap.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/thread.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/toaiff.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/tokenize.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/types.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/typing.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/unittest.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/urllib.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/urllib2.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/urlparse.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/user.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/whichdb.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2/xmlrpclib.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/__future__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/_bisect.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/_codecs.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/_csv.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/_curses.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/_dummy_threading.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/_heapq.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/_msi.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/_random.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/_typeshed/__init__.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/_typeshed/wsgi.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/_typeshed/xml.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/_warnings.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/_weakref.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/_weakrefset.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/aifc.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/antigravity.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/argparse.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/array.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/asynchat.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/asyncore.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/audioop.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/base64.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/bdb.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/binascii.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/binhex.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/bisect.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/builtins.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/bz2.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/cProfile.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/calendar.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/cgi.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/cgitb.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/chunk.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/cmath.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/cmd.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/code.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/codecs.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/codeop.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/colorsys.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/contextlib.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/copy.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/crypt.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/csv.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/ctypes/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/ctypes/util.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/ctypes/wintypes.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/curses/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/curses/ascii.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/curses/panel.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/curses/textpad.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/datetime.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/decimal.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/difflib.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/dis.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/archive_util.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/ccompiler.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/build_py.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/core.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/debug.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/dir_util.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/extension.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/file_util.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/filelist.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/spawn.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/text_file.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/util.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/version.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/doctest.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/dummy_threading.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/ensurepip/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/errno.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/filecmp.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/fileinput.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/formatter.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/fractions.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/ftplib.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/genericpath.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/grp.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/hmac.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/imaplib.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/imghdr.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/keyword.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/driver.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/grammar.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/literals.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/parse.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/pgen.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/token.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/tokenize.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pygram.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pytree.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/linecache.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/locale.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/logging/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/logging/config.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/logging/handlers.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/macpath.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/mailbox.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/mailcap.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/marshal.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/math.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/mimetypes.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/mmap.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/modulefinder.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/msilib/__init__.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/msilib/schema.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/msilib/sequence.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/msilib/text.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/msvcrt.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/netrc.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/nis.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/ntpath.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/numbers.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/opcode.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/operator.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/optparse.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/parser.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/pdb.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/pickle.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/pickletools.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/pkgutil.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/plistlib.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/poplib.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/posixpath.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/pprint.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/profile.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/pstats.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/pty.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/pwd.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/py_compile.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/pyclbr.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/pydoc.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/pydoc_data/__init__.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/pydoc_data/topics.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/pyexpat/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/pyexpat/errors.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/pyexpat/model.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/quopri.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/readline.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/rlcompleter.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/sched.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/select.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/shutil.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/site.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/smtpd.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/sndhdr.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/socket.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/sqlite3/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/sqlite3/dbapi2.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/sre_compile.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/ssl.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/stringprep.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/struct.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/sunau.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/symtable.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/sysconfig.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/syslog.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/tabnanny.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/tarfile.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/telnetlib.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/termios.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/this.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/threading.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/time.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/timeit.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/token.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/trace.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/traceback.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/tty.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/turtle.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/unicodedata.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/uu.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/uuid.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/warnings.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/wave.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/weakref.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/webbrowser.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/winsound.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/wsgiref/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/wsgiref/handlers.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/wsgiref/headers.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/wsgiref/simple_server.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/wsgiref/types.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/wsgiref/util.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/wsgiref/validate.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xdrlib.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/__init__.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/dom/NodeFilter.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/dom/__init__.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/dom/domreg.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/dom/expatbuilder.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/dom/minicompat.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/dom/minidom.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/dom/pulldom.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/dom/xmlbuilder.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/etree/ElementInclude.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/etree/ElementPath.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/etree/ElementTree.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/etree/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/etree/cElementTree.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/parsers/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/parsers/expat/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/parsers/expat/errors.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/parsers/expat/model.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/sax/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/sax/handler.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/sax/saxutils.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/sax/xmlreader.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/zipfile.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/zipimport.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/zlib.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3.7/_py_abc.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3.7/contextvars.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3.7/dataclasses.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3.9/graphlib.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3.9/zoneinfo/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/_ast.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/_bootlocale.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/_compat_pickle.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/_compression.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/_decimal.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/_dummy_thread.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/_imp.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/_importlib_modulespec.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/_json.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/_markupbase.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/_operator.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/_osx_support.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/_posixsubprocess.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/_pydecimal.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/_sitebuiltins.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/_stat.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/stdlib/3/_subprocess.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/_thread.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/_threading_local.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/_tkinter.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/_tracemalloc.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/_winapi.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/abc.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/ast.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/base_events.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/base_futures.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/base_subprocess.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/base_tasks.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/compat.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/constants.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/coroutines.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/events.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/exceptions.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/format_helpers.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/futures.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/locks.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/log.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/proactor_events.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/protocols.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/queues.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/runners.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/selector_events.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/sslproto.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/staggered.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/streams.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/subprocess.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/tasks.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/threads.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/transports.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/trsock.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/unix_events.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/windows_events.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/windows_utils.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/atexit.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/builtins.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/collections/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/collections/abc.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/compileall.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/concurrent/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/concurrent/futures/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/concurrent/futures/_base.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/concurrent/futures/process.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/concurrent/futures/thread.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/configparser.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/copyreg.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/dbm/__init__.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/dbm/dumb.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/dbm/gnu.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/dbm/ndbm.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/__init__.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/archive_util.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/bcppcompiler.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/ccompiler.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/cmd.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/__init__.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/bdist.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/bdist_dumb.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/bdist_msi.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/bdist_packager.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/bdist_rpm.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/bdist_wininst.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/build.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/build_clib.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/build_ext.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/build_py.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/build_scripts.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/check.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/clean.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/config.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/install.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/install_data.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/install_egg_info.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/install_headers.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/install_lib.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/install_scripts.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/register.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/sdist.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/upload.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/config.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/core.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/cygwinccompiler.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/debug.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/dep_util.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/dir_util.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/dist.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/errors.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/extension.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/fancy_getopt.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/file_util.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/filelist.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/log.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/msvccompiler.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/spawn.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/sysconfig.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/text_file.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/unixccompiler.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/util.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/version.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/charset.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/contentmanager.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/encoders.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/errors.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/feedparser.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/generator.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/header.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/headerregistry.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/iterators.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/message.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/mime/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/mime/application.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/mime/audio.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/mime/base.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/mime/image.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/mime/message.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/mime/multipart.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/mime/nonmultipart.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/mime/text.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/parser.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/policy.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/utils.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/encodings/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/encodings/utf_8.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/enum.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/faulthandler.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/fcntl.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/fnmatch.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/functools.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/gc.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/getopt.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/getpass.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/gettext.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/glob.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/gzip.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/hashlib.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/heapq.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/html/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/html/entities.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/html/parser.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/http/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/http/client.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/http/cookiejar.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/http/cookies.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/http/server.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/imp.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/importlib/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/importlib/abc.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/importlib/machinery.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/importlib/metadata.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/importlib/resources.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/importlib/util.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/inspect.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/io.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/ipaddress.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/itertools.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/json/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/json/decoder.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/json/encoder.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/json/tool.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/lzma.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/macurl2path.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/stdlib/3/msvcrt.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/connection.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/context.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/dummy/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/dummy/connection.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/managers.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/pool.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/process.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/queues.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/shared_memory.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/sharedctypes.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/spawn.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/synchronize.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/nntplib.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/ntpath.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/nturl2path.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/os/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/os/path.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/pathlib.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/pipes.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/platform.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/posix.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/posixpath.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/queue.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/random.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/re.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/reprlib.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/resource.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/runpy.pyi rename anaconda_lib/jedi/third_party/typeshed/stdlib/{3.6 => 3}/secrets.pyi (89%) mode change 100755 => 100644 mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/selectors.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/shelve.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/shlex.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/signal.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/smtplib.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/socketserver.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/spwd.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/sre_constants.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/sre_parse.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/stat.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/statistics.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/string.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/subprocess.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/symbol.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/sys.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/tempfile.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/textwrap.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/tkinter/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/tkinter/commondialog.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/tkinter/constants.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/tkinter/dialog.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/tkinter/filedialog.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/tkinter/font.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/tkinter/messagebox.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/tkinter/ttk.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/tokenize.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/tracemalloc.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/types.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/typing.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/unittest/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/unittest/async_case.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/unittest/case.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/unittest/loader.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/unittest/main.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/unittest/mock.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/unittest/result.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/unittest/runner.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/unittest/signals.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/unittest/suite.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/unittest/util.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/urllib/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/urllib/error.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/urllib/parse.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/urllib/request.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/urllib/response.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/urllib/robotparser.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/winreg.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/xmlrpc/__init__.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/xmlrpc/client.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/xmlrpc/server.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/xxlimited.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/stdlib/3/zipapp.pyi create mode 100755 anaconda_lib/jedi/third_party/typeshed/tests/check_consistent.py create mode 100644 anaconda_lib/jedi/third_party/typeshed/tests/mypy_exclude_list.txt create mode 100755 anaconda_lib/jedi/third_party/typeshed/tests/mypy_self_check.py create mode 100755 anaconda_lib/jedi/third_party/typeshed/tests/mypy_test.py create mode 100755 anaconda_lib/jedi/third_party/typeshed/tests/mypy_test_suite.py create mode 100644 anaconda_lib/jedi/third_party/typeshed/tests/pytype_exclude_list.txt create mode 100755 anaconda_lib/jedi/third_party/typeshed/tests/pytype_test.py create mode 100755 anaconda_lib/jedi/third_party/typeshed/tests/stubtest_test.py create mode 100755 anaconda_lib/jedi/third_party/typeshed/tests/stubtest_unused.py create mode 100644 anaconda_lib/jedi/third_party/typeshed/tests/stubtest_whitelists/linux-py36.txt create mode 100644 anaconda_lib/jedi/third_party/typeshed/tests/stubtest_whitelists/linux-py37.txt create mode 100644 anaconda_lib/jedi/third_party/typeshed/tests/stubtest_whitelists/linux-py38.txt create mode 100644 anaconda_lib/jedi/third_party/typeshed/tests/stubtest_whitelists/linux.txt create mode 100644 anaconda_lib/jedi/third_party/typeshed/tests/stubtest_whitelists/py36.txt create mode 100644 anaconda_lib/jedi/third_party/typeshed/tests/stubtest_whitelists/py37.txt create mode 100644 anaconda_lib/jedi/third_party/typeshed/tests/stubtest_whitelists/py38.txt create mode 100644 anaconda_lib/jedi/third_party/typeshed/tests/stubtest_whitelists/py39.txt create mode 100644 anaconda_lib/jedi/third_party/typeshed/tests/stubtest_whitelists/py3_common.txt create mode 100644 anaconda_lib/jedi/third_party/typeshed/tests/stubtest_whitelists/win32-py36.txt create mode 100644 anaconda_lib/jedi/third_party/typeshed/tests/stubtest_whitelists/win32-py37.txt create mode 100644 anaconda_lib/jedi/third_party/typeshed/tests/stubtest_whitelists/win32-py38.txt create mode 100644 anaconda_lib/jedi/third_party/typeshed/tests/stubtest_whitelists/win32.txt mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/OpenSSL/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/OpenSSL/crypto.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/concurrent/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/concurrent/futures/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/concurrent/futures/_base.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/concurrent/futures/process.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/concurrent/futures/thread.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/enum.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/fb303/FacebookService.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/fb303/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/ipaddress.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/kazoo/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/kazoo/client.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/kazoo/exceptions.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/kazoo/recipe/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/kazoo/recipe/watchers.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/pathlib2.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/pymssql.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/routes/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/routes/mapper.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/routes/util.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/scribe/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/scribe/scribe.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/scribe/ttypes.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/six/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/BaseHTTPServer.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/CGIHTTPServer.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/SimpleHTTPServer.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/_dummy_thread.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/_thread.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/cPickle.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/collections_abc.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/configparser.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/email_mime_base.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/email_mime_multipart.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/email_mime_nonmultipart.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/email_mime_text.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/html_entities.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/html_parser.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/http_client.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/http_cookiejar.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/http_cookies.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/queue.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/reprlib.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/socketserver.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib/error.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib/parse.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib/request.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib/response.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib/robotparser.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib_error.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib_parse.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib_request.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib_response.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib_robotparser.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/xmlrpc_client.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/tornado/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/tornado/concurrent.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/tornado/gen.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/tornado/httpclient.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/tornado/httpserver.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/tornado/httputil.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/tornado/ioloop.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/tornado/locks.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/tornado/netutil.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/tornado/process.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/tornado/tcpserver.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/tornado/testing.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/tornado/util.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2/tornado/web.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/AES.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/ARC2.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/ARC4.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/Blowfish.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/CAST.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/DES.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/DES3.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/PKCS1_OAEP.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/PKCS1_v1_5.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/XOR.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/__init__.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/blockalgo.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/HMAC.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/MD2.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/MD4.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/MD5.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/RIPEMD.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA224.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA256.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA384.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA512.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/__init__.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/hashalgo.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Protocol/AllOrNothing.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Protocol/Chaffing.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Protocol/KDF.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Protocol/__init__.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/DSA.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/ElGamal.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/RSA.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/__init__.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/pubkey.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/Fortuna/FortunaAccumulator.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/Fortuna/FortunaGenerator.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/Fortuna/SHAd256.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/OSRNG/__init__.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/OSRNG/fallback.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/OSRNG/posix.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/OSRNG/rng_base.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/__init__.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/random.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Signature/PKCS1_PSS.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Signature/PKCS1_v1_5.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Signature/__init__.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/Counter.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/RFC1751.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/__init__.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/asn1.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/number.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/randpool.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/strxor.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/__init__.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/pct_warnings.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/atomicwrites/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/attr/__init__.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/attr/_version_info.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/attr/converters.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/attr/exceptions.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/attr/filters.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/attr/validators.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/backports/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/backports/ssl_match_hostname.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/backports_abc.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/bleach/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/bleach/callbacks.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/bleach/linkifier.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/bleach/sanitizer.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/bleach/utils.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/auth.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/auth_handler.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/compat.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/connection.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/ec2/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/elb/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/exception.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/kms/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/kms/exceptions.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/kms/layer1.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/plugin.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/regioninfo.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/acl.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/bucket.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/bucketlistresultset.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/bucketlogging.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/connection.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/cors.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/deletemarker.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/key.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/keyfile.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/lifecycle.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/multidelete.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/multipart.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/prefix.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/tagging.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/user.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/website.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/utils.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cachetools/__init__.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cachetools/abc.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cachetools/cache.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cachetools/decorators.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cachetools/func.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cachetools/lfu.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cachetools/lru.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cachetools/rr.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cachetools/ttl.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/certifi.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/characteristic/__init__.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/chardet/__init__.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/chardet/enums.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/chardet/langbulgarianmodel.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/chardet/langcyrillicmodel.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/chardet/langgreekmodel.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/chardet/langhebrewmodel.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/chardet/langhungarianmodel.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/chardet/langthaimodel.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/chardet/langturkishmodel.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/chardet/universaldetector.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/chardet/version.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/click/README.md mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/click/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/click/_termui_impl.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/click/core.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/click/decorators.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/click/exceptions.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/click/formatting.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/click/globals.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/click/parser.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/click/termui.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/click/testing.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/click/types.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/click/utils.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/croniter.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/exceptions.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/fernet.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/backends/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/backends/interfaces.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/bindings/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/bindings/openssl/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/bindings/openssl/binding.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/dh.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/dsa.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/ec.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/ed25519.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/ed448.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/padding.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/rsa.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/utils.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/x25519.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/x448.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/ciphers/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/ciphers/aead.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/ciphers/algorithms.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/ciphers/modes.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/cmac.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/constant_time.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/hashes.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/hmac.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/kdf/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/kdf/concatkdf.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/kdf/hkdf.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/kdf/kbkdf.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/kdf/pbkdf2.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/kdf/scrypt.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/kdf/x963kdf.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/keywrap.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/padding.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/poly1305.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/serialization/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/serialization/pkcs12.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/twofactor/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/twofactor/hotp.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/twofactor/totp.pyi rename anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/{x509.pyi => x509/__init__.pyi} (65%) mode change 100755 => 100644 create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/x509/extensions.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/x509/oid.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/dateparser.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/datetimerange/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/dateutil/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/dateutil/_common.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/dateutil/easter.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/dateutil/parser.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/dateutil/relativedelta.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/dateutil/rrule.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/dateutil/tz/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/dateutil/tz/_common.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/dateutil/tz/tz.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/dateutil/utils.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/decorator.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/deprecated/__init__.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/deprecated/classic.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/deprecated/sphinx.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/emoji.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/emoji/__init__.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/emoji/core.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/emoji/unicode_codes.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/first.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/app.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/blueprints.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/cli.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/config.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/ctx.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/debughelpers.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/globals.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/helpers.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/json/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/json/tag.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/logging.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/sessions.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/signals.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/templating.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/testing.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/views.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/wrappers.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/geoip2/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/geoip2/database.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/geoip2/errors.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/geoip2/mixins.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/geoip2/models.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/geoip2/records.pyi rename anaconda_lib/jedi/third_party/typeshed/third_party/{2 => 2and3}/gflags.pyi (71%) mode change 100755 => 100644 mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/any_pb2.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/any_test_pb2.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/api_pb2.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/compiler/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/compiler/plugin_pb2.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/descriptor.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/descriptor_pb2.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/descriptor_pool.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/duration_pb2.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/empty_pb2.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/field_mask_pb2.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/containers.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/decoder.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/encoder.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/enum_type_wrapper.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/extension_dict.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/message_listener.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/python_message.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/well_known_types.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/wire_format.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/json_format.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/map_proto2_unittest_pb2.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/map_unittest_pb2.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/message.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/message_factory.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/reflection.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/service.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/source_context_pb2.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/struct_pb2.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/symbol_database.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/test_messages_proto2_pb2.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/test_messages_proto3_pb2.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/timestamp_pb2.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/type_pb2.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_arena_pb2.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_custom_options_pb2.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_import_pb2.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_import_public_pb2.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_mset_pb2.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_mset_wire_format_pb2.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_no_arena_import_pb2.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_no_arena_pb2.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_no_generic_services_pb2.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_pb2.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_proto3_arena_pb2.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/util/__init__.pyi delete mode 100755 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/util/json_format_proto3_pb2.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/wrappers_pb2.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/itsdangerous.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/_compat.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/_stringdefs.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/bccache.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/compiler.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/constants.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/debug.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/defaults.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/environment.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/exceptions.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/ext.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/filters.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/lexer.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/loaders.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/meta.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/nodes.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/optimizer.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/parser.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/runtime.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/sandbox.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/tests.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/utils.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/visitor.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/__init__.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/__meta__.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/blockparser.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/blockprocessors.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/core.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/__init__.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/abbr.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/admonition.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/attr_list.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/codehilite.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/def_list.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/extra.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/fenced_code.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/footnotes.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/legacy_attrs.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/legacy_em.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/md_in_html.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/meta.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/nl2br.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/sane_lists.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/smarty.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/tables.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/toc.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/wikilinks.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/inlinepatterns.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/pep562.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/postprocessors.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/preprocessors.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/serializers.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/treeprocessors.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/util.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markupsafe/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markupsafe/_compat.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markupsafe/_constants.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markupsafe/_native.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markupsafe/_speedups.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/maxminddb/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/maxminddb/compat.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/maxminddb/const.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/maxminddb/decoder.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/maxminddb/errors.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/maxminddb/extension.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/maxminddb/reader.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/mock.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/mypy_extensions.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/nmap/__init__.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/nmap/nmap.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/__init__.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/_version.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/_winapi.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/agent.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/auth_handler.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/ber.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/buffered_pipe.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/channel.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/client.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/common.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/compress.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/config.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/dsskey.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/ecdsakey.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/ed25519key.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/file.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/hostkeys.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/kex_curve25519.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/kex_ecdh_nist.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/kex_gex.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/kex_group1.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/kex_group14.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/kex_group16.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/kex_gss.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/message.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/packet.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/pipe.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/pkey.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/primes.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/proxy.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/py3compat.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/rsakey.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/server.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/sftp.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/sftp_attr.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/sftp_client.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/sftp_file.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/sftp_handle.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/sftp_server.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/sftp_si.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/ssh_exception.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/ssh_gss.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/transport.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/util.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/win_pageant.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/polib.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pyVmomi/__init__.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pyVmomi/vim/__init__.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pyVmomi/vim/event.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pyVmomi/vim/fault.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pyVmomi/vim/option.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pyVmomi/vim/view.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pyVmomi/vmodl/__init__.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pyVmomi/vmodl/fault.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pyVmomi/vmodl/query.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pycurl.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pymysql/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pymysql/charset.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pymysql/connections.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/CLIENT.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/COMMAND.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/ER.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/FIELD_TYPE.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/FLAG.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/SERVER_STATUS.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pymysql/converters.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pymysql/cursors.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pymysql/err.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pymysql/times.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pymysql/util.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/attributes.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/connection/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/connection/base.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/connection/table.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/connection/util.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/constants.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/exceptions.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/indexes.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/models.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/settings.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/throttle.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/types.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pyre_extensions.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pytz/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/redis/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/redis/client.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/redis/connection.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/redis/exceptions.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/redis/utils.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/adapters.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/api.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/auth.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/compat.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/cookies.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/exceptions.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/hooks.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/models.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/_collections.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/connection.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/connectionpool.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/contrib/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/exceptions.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/fields.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/filepost.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/packages/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/packages/ssl_match_hostname/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/poolmanager.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/request.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/response.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/connection.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/request.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/response.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/retry.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/ssl_.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/timeout.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/url.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/sessions.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/status_codes.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/structures.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/utils.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/retry/__init__.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/retry/api.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/simplejson/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/simplejson/decoder.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/simplejson/encoder.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/simplejson/scanner.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/singledispatch.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/slugify/__init__.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/slugify/slugify.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/slugify/special.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/tabulate.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/termcolor.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/toml.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/typing_extensions.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/tzlocal/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/ujson.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/_compat.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/_internal.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/_reloader.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/atom.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/cache.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/fixers.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/iterio.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/jsrouting.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/limiter.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/lint.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/profiler.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/securecookie.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/sessions.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/testtools.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/wrappers.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/datastructures.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/debug/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/debug/console.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/debug/repr.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/debug/tbtools.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/exceptions.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/filesystem.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/formparser.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/http.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/local.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/middleware/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/middleware/dispatcher.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/middleware/http_proxy.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/middleware/lint.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/middleware/profiler.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/middleware/proxy_fix.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/middleware/shared_data.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/posixemulation.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/routing.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/script.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/security.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/serving.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/test.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/testapp.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/urls.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/useragents.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/utils.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/wrappers.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/wsgi.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/composer.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/constructor.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/cyaml.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/dumper.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/emitter.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/error.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/events.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/loader.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/nodes.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/parser.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/reader.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/representer.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/resolver.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/scanner.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/serializer.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/tokens.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/aiofiles/__init__.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/aiofiles/base.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/aiofiles/os.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/aiofiles/threadpool/__init__.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/aiofiles/threadpool/binary.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/aiofiles/threadpool/text.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/contextvars.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/dataclasses.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/docutils/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/docutils/examples.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/docutils/nodes.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/docutils/parsers/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/docutils/parsers/rst/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/docutils/parsers/rst/nodes.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/docutils/parsers/rst/roles.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/docutils/parsers/rst/states.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/filelock/__init__.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/freezegun/__init__.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/freezegun/api.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/frozendict.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/jwt/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/jwt/algorithms.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/jwt/contrib/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/jwt/contrib/algorithms/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/jwt/contrib/algorithms/py_ecdsa.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/jwt/contrib/algorithms/pycrypto.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/orjson.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/pkg_resources/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/pkg_resources/py31compat.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/pyrfc3339/__init__.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/pyrfc3339/generator.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/pyrfc3339/parser.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/pyrfc3339/utils.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/six/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/BaseHTTPServer.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/CGIHTTPServer.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/SimpleHTTPServer.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/_dummy_thread.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/_thread.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/builtins.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/cPickle.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/collections_abc.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/configparser.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/email_mime_base.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/email_mime_multipart.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/email_mime_nonmultipart.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/email_mime_text.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/html_entities.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/html_parser.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/http_client.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/http_cookiejar.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/http_cookies.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/queue.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/reprlib.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/socketserver.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/tkinter.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_commondialog.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_constants.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_dialog.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_filedialog.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_tkfiledialog.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_ttk.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib/error.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib/parse.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib/request.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib/response.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib/robotparser.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib_error.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib_parse.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib_request.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib_response.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib_robotparser.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/typed_ast/__init__.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/typed_ast/ast27.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/typed_ast/ast3.pyi mode change 100755 => 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/typed_ast/conversions.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/waitress/__init__.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/waitress/adjustments.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/waitress/buffers.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/waitress/channel.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/waitress/compat.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/waitress/parser.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/waitress/proxy_headers.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/waitress/receiver.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/waitress/rfc7230.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/waitress/runner.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/waitress/server.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/waitress/task.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/waitress/trigger.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/waitress/utilities.pyi create mode 100644 anaconda_lib/jedi/third_party/typeshed/third_party/3/waitress/wasyncore.pyi mode change 100755 => 100644 anaconda_lib/jedi/utils.py mode change 100755 => 100644 anaconda_lib/linting/pyflakes/__init__.py create mode 100644 anaconda_lib/linting/pyflakes/__main__.py create mode 100644 anaconda_lib/linting/pyflakes/api.py mode change 100755 => 100644 anaconda_lib/linting/pyflakes/checker.py mode change 100755 => 100644 anaconda_lib/linting/pyflakes/messages.py create mode 100644 anaconda_lib/linting/pyflakes/reporter.py create mode 100644 anaconda_lib/linting/pyflakes/scripts/__init__.py create mode 100644 anaconda_lib/linting/pyflakes/scripts/pyflakes.py create mode 100644 anaconda_lib/linting/pyflakes/test/__init__.py create mode 100644 anaconda_lib/linting/pyflakes/test/harness.py create mode 100644 anaconda_lib/linting/pyflakes/test/test_api.py create mode 100644 anaconda_lib/linting/pyflakes/test/test_builtin.py create mode 100644 anaconda_lib/linting/pyflakes/test/test_checker.py create mode 100644 anaconda_lib/linting/pyflakes/test/test_code_segment.py create mode 100644 anaconda_lib/linting/pyflakes/test/test_dict.py create mode 100644 anaconda_lib/linting/pyflakes/test/test_doctests.py create mode 100644 anaconda_lib/linting/pyflakes/test/test_imports.py create mode 100644 anaconda_lib/linting/pyflakes/test/test_is_literal.py create mode 100644 anaconda_lib/linting/pyflakes/test/test_match.py create mode 100644 anaconda_lib/linting/pyflakes/test/test_other.py create mode 100644 anaconda_lib/linting/pyflakes/test/test_return_with_arguments_inside_generator.py create mode 100644 anaconda_lib/linting/pyflakes/test/test_type_annotations.py create mode 100644 anaconda_lib/linting/pyflakes/test/test_undefined_names.py create mode 100644 anaconda_lib/parso/py.typed delete mode 100644 anaconda_lib/parso/python/grammar27.txt rename anaconda_lib/parso/python/{grammar35.txt => grammar310.txt} (66%) rename anaconda_lib/parso/python/{grammar34.txt => grammar311.txt} (51%) rename anaconda_lib/parso/python/{grammar33.txt => grammar312.txt} (50%) create mode 100644 anaconda_lib/parso/python/issue_list.txt diff --git a/.travis.yml b/.travis.yml index 23a292c0..9d6ac778 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,17 +1,16 @@ language: python python: - - "2.7" - - "3.6" - - "3.7" - - "3.8" - - "pypy" - # - "pypy3" + - "3.6" + - "3.7" + - "3.8" + - "pypy" + # - "pypy3" matrix: - allow_failures: - - python: pypy + allow_failures: + - python: pypy install: | - export PYTHON_VERSION=$(pip --version | grep -oP 'python \d.\d' | cut -d' ' -f2 | cut -d'.' -f1) - if [ ${PYTHON_VERSION} -eq 3 ]; then pip install -r requirements.py3.txt; fi + export PYTHON_VERSION=$(pip --version | grep -oP 'python \d.\d' | cut -d' ' -f2 | cut -d'.' -f1) + if [ ${PYTHON_VERSION} -eq 3 ]; then pip install -r requirements.py3.txt; fi notifications: webhooks: urls: diff --git a/README.md b/README.md index 208889d6..5af09473 100644 --- a/README.md +++ b/README.md @@ -91,9 +91,9 @@ anaconda capabilities to other languages, the complete list of them can be shown | Language | Web Site | Package Control | Status | | --- | --- | --- | --- | -| **Go** | https://github.com/DamnWidget/anaconda_go | Yes | Active | -| **Rust** | https://github.com/DamnWidget/anaconda_rust | Yes | Active | -| **PHP** | https://github.com/DamnWidget/anaconda_php | Yes | Active | +| **Go** | https://github.com/DamnWidget/anaconda_go | Yes | Unmaintained | +| **Rust** | https://github.com/DamnWidget/anaconda_rust | Yes | Unmaintained | +| **PHP** | https://github.com/DamnWidget/anaconda_php | Yes | Unmaintained | Would you like to see your language empowered by anaconda? Use `anaconda_rust` or `anaconda_php` as templates and bring your language to life with anaconda's plugable architecture. diff --git a/anaconda_lib/jedi/__init__.py b/anaconda_lib/jedi/__init__.py old mode 100755 new mode 100644 index f15ac9f5..e5ed6f26 --- a/anaconda_lib/jedi/__init__.py +++ b/anaconda_lib/jedi/__init__.py @@ -27,10 +27,9 @@ load """ -__version__ = '0.17.1' +__version__ = '0.18.1' -from jedi.api import Script, Interpreter, set_debug_function, \ - preload_module, names +from jedi.api import Script, Interpreter, set_debug_function, preload_module from jedi import settings from jedi.api.environment import find_virtualenvs, find_system_environments, \ get_default_environment, InvalidPythonEnvironment, create_environment, \ diff --git a/anaconda_lib/jedi/__main__.py b/anaconda_lib/jedi/__main__.py old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/_compatibility.py b/anaconda_lib/jedi/_compatibility.py old mode 100755 new mode 100644 index 13c1975c..13a74b7b --- a/anaconda_lib/jedi/_compatibility.py +++ b/anaconda_lib/jedi/_compatibility.py @@ -1,399 +1,14 @@ """ -To ensure compatibility from Python ``2.7`` - ``3.x``, a module has been -created. Clearly there is huge need to use conforming syntax. +This module is here to ensure compatibility of Windows/Linux/MacOS and +different Python versions. """ -from __future__ import print_function -import atexit import errno -import functools import sys -import os -import re -import pkgutil -import warnings -import subprocess -import weakref -try: - import importlib -except ImportError: - pass -from zipimport import zipimporter - -from jedi.file_io import KnownContentFileIO, ZipFileIO - -is_py3 = sys.version_info[0] >= 3 -is_py35 = is_py3 and sys.version_info[1] >= 5 -py_version = int(str(sys.version_info[0]) + str(sys.version_info[1])) - - -if sys.version_info[:2] < (3, 5): - """ - A super-minimal shim around listdir that behave like - scandir for the information we need. - """ - class _DirEntry: - - def __init__(self, name, basepath): - self.name = name - self.basepath = basepath - - def is_dir(self): - path_for_name = os.path.join(self.basepath, self.name) - return os.path.isdir(path_for_name) - - def scandir(dir): - return [_DirEntry(name, dir) for name in os.listdir(dir)] -else: - from os import scandir - - -class DummyFile(object): - def __init__(self, loader, string): - self.loader = loader - self.string = string - - def read(self): - return self.loader.get_source(self.string) - - def close(self): - del self.loader - - -def find_module_py34(string, path=None, full_name=None, is_global_search=True): - spec = None - loader = None - - for finder in sys.meta_path: - if is_global_search and finder != importlib.machinery.PathFinder: - p = None - else: - p = path - try: - find_spec = finder.find_spec - except AttributeError: - # These are old-school clases that still have a different API, just - # ignore those. - continue - - spec = find_spec(string, p) - if spec is not None: - loader = spec.loader - if loader is None and not spec.has_location: - # This is a namespace package. - full_name = string if not path else full_name - implicit_ns_info = ImplicitNSInfo(full_name, spec.submodule_search_locations._path) - return implicit_ns_info, True - break - - return find_module_py33(string, path, loader) - - -def find_module_py33(string, path=None, loader=None, full_name=None, is_global_search=True): - loader = loader or importlib.machinery.PathFinder.find_module(string, path) - - if loader is None and path is None: # Fallback to find builtins - try: - with warnings.catch_warnings(record=True): - # Mute "DeprecationWarning: Use importlib.util.find_spec() - # instead." While we should replace that in the future, it's - # probably good to wait until we deprecate Python 3.3, since - # it was added in Python 3.4 and find_loader hasn't been - # removed in 3.6. - loader = importlib.find_loader(string) - except ValueError as e: - # See #491. Importlib might raise a ValueError, to avoid this, we - # just raise an ImportError to fix the issue. - raise ImportError("Originally " + repr(e)) - - if loader is None: - raise ImportError("Couldn't find a loader for {}".format(string)) - - return _from_loader(loader, string) - - -def _from_loader(loader, string): - try: - is_package_method = loader.is_package - except AttributeError: - is_package = False - else: - is_package = is_package_method(string) - try: - get_filename = loader.get_filename - except AttributeError: - return None, is_package - else: - module_path = cast_path(get_filename(string)) - - # To avoid unicode and read bytes, "overwrite" loader.get_source if - # possible. - try: - f = type(loader).get_source - except AttributeError: - raise ImportError("get_source was not defined on loader") - - if is_py3 and f is not importlib.machinery.SourceFileLoader.get_source: - # Unfortunately we are reading unicode here, not bytes. - # It seems hard to get bytes, because the zip importer - # logic just unpacks the zip file and returns a file descriptor - # that we cannot as easily access. Therefore we just read it as - # a string in the cases where get_source was overwritten. - code = loader.get_source(string) - else: - code = _get_source(loader, string) - - if code is None: - return None, is_package - if isinstance(loader, zipimporter): - return ZipFileIO(module_path, code, cast_path(loader.archive)), is_package - - return KnownContentFileIO(module_path, code), is_package - - -def _get_source(loader, fullname): - """ - This method is here as a replacement for SourceLoader.get_source. That - method returns unicode, but we prefer bytes. - """ - path = loader.get_filename(fullname) - try: - return loader.get_data(path) - except OSError: - raise ImportError('source not available through get_data()', - name=fullname) - - -def find_module_pre_py3(string, path=None, full_name=None, is_global_search=True): - # This import is here, because in other places it will raise a - # DeprecationWarning. - import imp - try: - module_file, module_path, description = imp.find_module(string, path) - module_type = description[2] - is_package = module_type is imp.PKG_DIRECTORY - if is_package: - # In Python 2 directory package imports are returned as folder - # paths, not __init__.py paths. - p = os.path.join(module_path, '__init__.py') - try: - module_file = open(p) - module_path = p - except FileNotFoundError: - pass - elif module_type != imp.PY_SOURCE: - if module_file is not None: - module_file.close() - module_file = None - - if module_file is None: - return None, is_package - - with module_file: - code = module_file.read() - return KnownContentFileIO(cast_path(module_path), code), is_package - except ImportError: - pass - - if path is None: - path = sys.path - for item in path: - loader = pkgutil.get_importer(item) - if loader: - loader = loader.find_module(string) - if loader is not None: - return _from_loader(loader, string) - raise ImportError("No module named {}".format(string)) - - -find_module = find_module_py34 if is_py3 else find_module_pre_py3 -find_module.__doc__ = """ -Provides information about a module. - -This function isolates the differences in importing libraries introduced with -python 3.3 on; it gets a module name and optionally a path. It will return a -tuple containin an open file for the module (if not builtin), the filename -or the name of the module if it is a builtin one and a boolean indicating -if the module is contained in a package. -""" - - -class ImplicitNSInfo(object): - """Stores information returned from an implicit namespace spec""" - def __init__(self, name, paths): - self.name = name - self.paths = paths - - -if is_py3: - all_suffixes = importlib.machinery.all_suffixes -else: - def all_suffixes(): - # Is deprecated and raises a warning in Python 3.6. - import imp - return [suffix for suffix, _, _ in imp.get_suffixes()] - - -# unicode function -try: - unicode = unicode -except NameError: - unicode = str - - -# re-raise function -if is_py3: - def reraise(exception, traceback): - raise exception.with_traceback(traceback) -else: - eval(compile(""" -def reraise(exception, traceback): - raise exception, None, traceback -""", 'blub', 'exec')) - -reraise.__doc__ = """ -Re-raise `exception` with a `traceback` object. - -Usage:: - - reraise(Exception, sys.exc_info()[2]) - -""" - - -def use_metaclass(meta, *bases): - """ Create a class with a metaclass. """ - if not bases: - bases = (object,) - return meta("Py2CompatibilityMetaClass", bases, {}) - - -try: - encoding = sys.stdout.encoding - if encoding is None: - encoding = 'utf-8' -except AttributeError: - encoding = 'ascii' - - -def u(string, errors='strict'): - """Cast to unicode DAMMIT! - Written because Python2 repr always implicitly casts to a string, so we - have to cast back to a unicode (and we now that we always deal with valid - unicode, because we check that in the beginning). - """ - if isinstance(string, bytes): - return unicode(string, encoding='UTF-8', errors=errors) - return string - - -def cast_path(obj): - """ - Take a bytes or str path and cast it to unicode. - - Apparently it is perfectly fine to pass both byte and unicode objects into - the sys.path. This probably means that byte paths are normal at other - places as well. - - Since this just really complicates everything and Python 2.7 will be EOL - soon anyway, just go with always strings. - """ - return u(obj, errors='replace') - - -def force_unicode(obj): - # Intentionally don't mix those two up, because those two code paths might - # be different in the future (maybe windows?). - return cast_path(obj) - - -try: - import builtins # module name in python 3 -except ImportError: - import __builtin__ as builtins # noqa: F401 - - -import ast # noqa: F401 - - -def literal_eval(string): - return ast.literal_eval(string) - - -try: - from itertools import zip_longest -except ImportError: - from itertools import izip_longest as zip_longest # Python 2 # noqa: F401 - -try: - FileNotFoundError = FileNotFoundError -except NameError: - FileNotFoundError = IOError - -try: - IsADirectoryError = IsADirectoryError -except NameError: - IsADirectoryError = IOError - -try: - PermissionError = PermissionError -except NameError: - PermissionError = IOError - -try: - NotADirectoryError = NotADirectoryError -except NameError: - class NotADirectoryError(Exception): - # Don't implement this for Python 2 anymore. - pass - - -def no_unicode_pprint(dct): - """ - Python 2/3 dict __repr__ may be different, because of unicode differens - (with or without a `u` prefix). Normally in doctests we could use `pprint` - to sort dicts and check for equality, but here we have to write a separate - function to do that. - """ - import pprint - s = pprint.pformat(dct) - print(re.sub("u'", "'", s)) - - -def utf8_repr(func): - """ - ``__repr__`` methods in Python 2 don't allow unicode objects to be - returned. Therefore cast them to utf-8 bytes in this decorator. - """ - def wrapper(self): - result = func(self) - if isinstance(result, unicode): - return result.encode('utf-8') - else: - return result - - if is_py3: - return func - else: - return wrapper - - -if is_py3: - import queue -else: - import Queue as queue # noqa: F401 - -try: - # Attempt to load the C implementation of pickle on Python 2 as it is way - # faster. - import cPickle as pickle -except ImportError: - import pickle +import pickle def pickle_load(file): try: - if is_py3: - return pickle.load(file, encoding='bytes') return pickle.load(file) # Python on Windows don't throw EOF errors for pipes. So reraise them with # the correct type, which is caught upwards. @@ -403,24 +18,8 @@ def pickle_load(file): raise -def _python2_dct_keys_to_unicode(data): - """ - Python 2 stores object __dict__ entries as bytes, not unicode, correct it - here. Python 2 can deal with both, Python 3 expects unicode. - """ - if isinstance(data, tuple): - return tuple(_python2_dct_keys_to_unicode(x) for x in data) - elif isinstance(data, list): - return list(_python2_dct_keys_to_unicode(x) for x in data) - elif hasattr(data, '__dict__') and type(data.__dict__) == dict: - data.__dict__ = {unicode(k): v for k, v in data.__dict__.items()} - return data - - def pickle_dump(data, file, protocol): try: - if not is_py3: - data = _python2_dct_keys_to_unicode(data) pickle.dump(data, file, protocol) # On Python 3.3 flush throws sometimes an error even though the writing # operation should be completed. @@ -431,201 +30,3 @@ def pickle_dump(data, file, protocol): if sys.platform == 'win32': raise IOError(errno.EPIPE, "Broken pipe") raise - - -# Determine the highest protocol version compatible for a given list of Python -# versions. -def highest_pickle_protocol(python_versions): - protocol = 4 - for version in python_versions: - if version[0] == 2: - # The minimum protocol version for the versions of Python that we - # support (2.7 and 3.3+) is 2. - return 2 - if version[1] < 4: - protocol = 3 - return protocol - - -try: - from inspect import Parameter -except ImportError: - class Parameter(object): - POSITIONAL_ONLY = object() - POSITIONAL_OR_KEYWORD = object() - VAR_POSITIONAL = object() - KEYWORD_ONLY = object() - VAR_KEYWORD = object() - - -class GeneralizedPopen(subprocess.Popen): - def __init__(self, *args, **kwargs): - if os.name == 'nt': - try: - # Was introduced in Python 3.7. - CREATE_NO_WINDOW = subprocess.CREATE_NO_WINDOW - except AttributeError: - CREATE_NO_WINDOW = 0x08000000 - kwargs['creationflags'] = CREATE_NO_WINDOW - # The child process doesn't need file descriptors except 0, 1, 2. - # This is unix only. - kwargs['close_fds'] = 'posix' in sys.builtin_module_names - super(GeneralizedPopen, self).__init__(*args, **kwargs) - - -# shutil.which is not available on Python 2.7. -def which(cmd, mode=os.F_OK | os.X_OK, path=None): - """Given a command, mode, and a PATH string, return the path which - conforms to the given mode on the PATH, or None if there is no such - file. - - `mode` defaults to os.F_OK | os.X_OK. `path` defaults to the result - of os.environ.get("PATH"), or can be overridden with a custom search - path. - - """ - # Check that a given file can be accessed with the correct mode. - # Additionally check that `file` is not a directory, as on Windows - # directories pass the os.access check. - def _access_check(fn, mode): - return (os.path.exists(fn) and os.access(fn, mode) - and not os.path.isdir(fn)) - - # If we're given a path with a directory part, look it up directly rather - # than referring to PATH directories. This includes checking relative to the - # current directory, e.g. ./script - if os.path.dirname(cmd): - if _access_check(cmd, mode): - return cmd - return None - - if path is None: - path = os.environ.get("PATH", os.defpath) - if not path: - return None - path = path.split(os.pathsep) - - if sys.platform == "win32": - # The current directory takes precedence on Windows. - if os.curdir not in path: - path.insert(0, os.curdir) - - # PATHEXT is necessary to check on Windows. - pathext = os.environ.get("PATHEXT", "").split(os.pathsep) - # See if the given file matches any of the expected path extensions. - # This will allow us to short circuit when given "python.exe". - # If it does match, only test that one, otherwise we have to try - # others. - if any(cmd.lower().endswith(ext.lower()) for ext in pathext): - files = [cmd] - else: - files = [cmd + ext for ext in pathext] - else: - # On other platforms you don't have things like PATHEXT to tell you - # what file suffixes are executable, so just pass on cmd as-is. - files = [cmd] - - seen = set() - for dir in path: - normdir = os.path.normcase(dir) - if normdir not in seen: - seen.add(normdir) - for thefile in files: - name = os.path.join(dir, thefile) - if _access_check(name, mode): - return name - return None - - -if not is_py3: - # Simplified backport of Python 3 weakref.finalize: - # https://github.com/python/cpython/blob/ded4737989316653469763230036b04513cb62b3/Lib/weakref.py#L502-L662 - class finalize(object): - """Class for finalization of weakrefable objects. - - finalize(obj, func, *args, **kwargs) returns a callable finalizer - object which will be called when obj is garbage collected. The - first time the finalizer is called it evaluates func(*arg, **kwargs) - and returns the result. After this the finalizer is dead, and - calling it just returns None. - - When the program exits any remaining finalizers will be run. - """ - - # Finalizer objects don't have any state of their own. - # This ensures that they cannot be part of a ref-cycle. - __slots__ = () - _registry = {} - - def __init__(self, obj, func, *args, **kwargs): - info = functools.partial(func, *args, **kwargs) - info.weakref = weakref.ref(obj, self) - self._registry[self] = info - - # To me it's an absolute mystery why in Python 2 we need _=None. It - # makes really no sense since it's never really called. Then again it - # might be called by Python 2.7 itself, but weakref.finalize is not - # documented in Python 2 and therefore shouldn't be randomly called. - # We never call this stuff with a parameter and therefore this - # parameter should not be needed. But it is. ~dave - def __call__(self, _=None): - """Return func(*args, **kwargs) if alive.""" - info = self._registry.pop(self, None) - if info: - return info() - - @classmethod - def _exitfunc(cls): - if not cls._registry: - return - for finalizer in list(cls._registry): - try: - finalizer() - except Exception: - sys.excepthook(*sys.exc_info()) - assert finalizer not in cls._registry - - atexit.register(finalize._exitfunc) - weakref.finalize = finalize - - -if is_py3 and sys.version_info[1] > 5: - from inspect import unwrap -else: - # Only Python >=3.6 does properly limit the amount of unwraps. This is very - # relevant in the case of unittest.mock.patch. - # Below is the implementation of Python 3.7. - def unwrap(func, stop=None): - """Get the object wrapped by *func*. - - Follows the chain of :attr:`__wrapped__` attributes returning the last - object in the chain. - - *stop* is an optional callback accepting an object in the wrapper chain - as its sole argument that allows the unwrapping to be terminated early if - the callback returns a true value. If the callback never returns a true - value, the last object in the chain is returned as usual. For example, - :func:`signature` uses this to stop unwrapping if any object in the - chain has a ``__signature__`` attribute defined. - - :exc:`ValueError` is raised if a cycle is encountered. - - """ - if stop is None: - def _is_wrapper(f): - return hasattr(f, '__wrapped__') - else: - def _is_wrapper(f): - return hasattr(f, '__wrapped__') and not stop(f) - f = func # remember the original func for error reporting - # Memoise by id to tolerate non-hashable objects, but store objects to - # ensure they aren't destroyed, which would allow their IDs to be reused. - memo = {id(f): f} - recursion_limit = sys.getrecursionlimit() - while _is_wrapper(func): - func = func.__wrapped__ - id_func = id(func) - if (id_func in memo) or (len(memo) >= recursion_limit): - raise ValueError('wrapper loop when unwrapping {!r}'.format(f)) - memo[id_func] = func - return func diff --git a/anaconda_lib/jedi/api/__init__.py b/anaconda_lib/jedi/api/__init__.py old mode 100755 new mode 100644 index 7531598a..a243c531 --- a/anaconda_lib/jedi/api/__init__.py +++ b/anaconda_lib/jedi/api/__init__.py @@ -7,15 +7,12 @@ debug messages to stdout, simply call :func:`set_debug_function` without arguments. """ -import os import sys -import warnings -from functools import wraps +from pathlib import Path import parso from parso.python import tree -from jedi._compatibility import force_unicode, cast_path, is_py3 from jedi.parser_utils import get_executable_nodes from jedi import debug from jedi import settings @@ -51,19 +48,7 @@ sys.setrecursionlimit(3000) -def _no_python2_support(func): - # TODO remove when removing Python 2/3.5 - @wraps(func) - def wrapper(self, *args, **kwargs): - if self._inference_state.grammar.version_info < (3, 6) or sys.version_info < (3, 6): - raise NotImplementedError( - "No support for refactorings/search on Python 2/3.5" - ) - return func(self, *args, **kwargs) - return wrapper - - -class Script(object): +class Script: """ A Script is the base for completions, goto or whatever you want to do with Jedi. The counter part of this class is :class:`Interpreter`, which works @@ -97,89 +82,39 @@ class Script(object): an issue for people that do more complex stuff with Jedi. This is purely a performance optimization and works pretty well for all - typical usages, however consider to turn the setting of if it causes + typical usages, however consider to turn the setting off if it causes you problems. See also `this discussion `_. :param code: The source code of the current file, separated by newlines. :type code: str - :param line: Deprecated, please use it directly on e.g. ``.complete`` - :type line: int - :param column: Deprecated, please use it directly on e.g. ``.complete`` - :type column: int :param path: The path of the file in the file system, or ``''`` if it hasn't been saved yet. - :type path: str or None - :param encoding: Deprecated, cast to unicode yourself. The encoding of - ``code``, if it is not a ``unicode`` object (default ``'utf-8'``). - :type encoding: str - :param sys_path: Deprecated, use the project parameter. - :type sys_path: typing.List[str] + :type path: str or pathlib.Path or None :param Environment environment: Provide a predefined :ref:`Environment ` to work with a specific Python version or virtualenv. :param Project project: Provide a :class:`.Project` to make sure finding references works well, because the right folder is searched. There are also ways to modify the sys path and other things. """ - def __init__(self, code=None, line=None, column=None, path=None, - encoding=None, sys_path=None, environment=None, - project=None, source=None): + def __init__(self, code=None, *, path=None, environment=None, project=None): self._orig_path = path - # An empty path (also empty string) should always result in no path. - self.path = os.path.abspath(path) if path else None + if isinstance(path, str): + path = Path(path) + + self.path = path.absolute() if path else None - if encoding is None: - encoding = 'utf-8' - else: - warnings.warn( - "Deprecated since version 0.17.0. You should cast to valid " - "unicode yourself, especially if you are not using utf-8.", - DeprecationWarning, - stacklevel=2 - ) - if line is not None: - warnings.warn( - "Providing the line is now done in the functions themselves " - "like `Script(...).complete(line, column)`", - DeprecationWarning, - stacklevel=2 - ) - if column is not None: - warnings.warn( - "Providing the column is now done in the functions themselves " - "like `Script(...).complete(line, column)`", - DeprecationWarning, - stacklevel=2 - ) - if source is not None: - code = source - warnings.warn( - "Use the code keyword argument instead.", - DeprecationWarning, - stacklevel=2 - ) if code is None: + if path is None: + raise ValueError("Must provide at least one of code or path") + # TODO add a better warning than the traceback! with open(path, 'rb') as f: code = f.read() - if sys_path is not None and not is_py3: - sys_path = list(map(force_unicode, sys_path)) - if project is None: # Load the Python grammar of the current interpreter. - project = get_default_project( - os.path.dirname(self.path) if path else None - ) - # TODO deprecate and remove sys_path from the Script API. - if sys_path is not None: - project._sys_path = sys_path - warnings.warn( - "Deprecated since version 0.17.0. Use the project API instead, " - "which means Script(project=Project(dir, sys_path=sys_path)) instead.", - DeprecationWarning, - stacklevel=2 - ) + project = get_default_project(None if self.path is None else self.path.parent) self._inference_state = InferenceState( project, environment=environment, script_path=self.path @@ -188,8 +123,7 @@ def __init__(self, code=None, line=None, column=None, path=None, self._module_node, code = self._inference_state.parse_and_get_code( code=code, path=self.path, - encoding=encoding, - use_latest_grammar=path and path.endswith('.pyi'), + use_latest_grammar=path and path.suffix == '.pyi', cache=False, # No disk cache, because the current script often changes. diff_cache=settings.fast_parser, cache_path=settings.cache_directory, @@ -197,7 +131,6 @@ def __init__(self, code=None, line=None, column=None, path=None, debug.speed('parsed') self._code_lines = parso.split_lines(code, keepends=True) self._code = code - self._pos = line, column cache.clear_time_caches() debug.reset_time() @@ -220,11 +153,12 @@ def _get_module(self): if self.path is None: file_io = None else: - file_io = KnownContentFileIO(cast_path(self.path), self._code) - if self.path is not None and self.path.endswith('.pyi'): + file_io = KnownContentFileIO(self.path, self._code) + if self.path is not None and self.path.suffix == '.pyi': # We are in a stub file. Try to load the stub properly. stub_module = load_proper_stub_module( self._inference_state, + self._inference_state.latest_grammar, file_io, names, self._module_node @@ -242,7 +176,7 @@ def _get_module(self): code_lines=self._code_lines, is_package=is_package, ) - if names[0] not in ('builtins', '__builtin__', 'typing'): + if names[0] not in ('builtins', 'typing'): # These modules are essential for Jedi, so don't overwrite them. self._inference_state.module_cache.add(names, ValueSet([module])) return module @@ -258,7 +192,7 @@ def __repr__(self): ) @validate_line_column - def complete(self, line=None, column=None, **kwargs): + def complete(self, line=None, column=None, *, fuzzy=False): """ Completes objects under the cursor. @@ -272,9 +206,6 @@ def complete(self, line=None, column=None, **kwargs): before magic methods and name mangled names that start with ``__``. :rtype: list of :class:`.Completion` """ - return self._complete(line, column, **kwargs) - - def _complete(self, line, column, fuzzy=False): # Python 2... with debug.increase_indent_cm('complete'): completion = Completion( self._inference_state, self._get_module_context(), self._code_lines, @@ -282,16 +213,8 @@ def _complete(self, line, column, fuzzy=False): # Python 2... ) return completion.complete() - def completions(self, fuzzy=False): - warnings.warn( - "Deprecated since version 0.16.0. Use Script(...).complete instead.", - DeprecationWarning, - stacklevel=2 - ) - return self.complete(*self._pos, fuzzy=fuzzy) - @validate_line_column - def infer(self, line=None, column=None, **kwargs): + def infer(self, line=None, column=None, *, only_stubs=False, prefer_stubs=False): """ Return the definitions of under the cursor. It is basically a wrapper around Jedi's type inference. @@ -307,24 +230,17 @@ def infer(self, line=None, column=None, **kwargs): :param prefer_stubs: Prefer stubs to Python objects for this method. :rtype: list of :class:`.Name` """ - with debug.increase_indent_cm('infer'): - return self._infer(line, column, **kwargs) - - def goto_definitions(self, **kwargs): - warnings.warn( - "Deprecated since version 0.16.0. Use Script(...).infer instead.", - DeprecationWarning, - stacklevel=2 - ) - return self.infer(*self._pos, **kwargs) - - def _infer(self, line, column, only_stubs=False, prefer_stubs=False): pos = line, column leaf = self._module_node.get_name_of_position(pos) if leaf is None: leaf = self._module_node.get_leaf_for_position(pos) if leaf is None or leaf.type == 'string': return [] + if leaf.end_pos == (line, column) and leaf.type == 'operator': + next_ = leaf.get_next_leaf() + if next_.start_pos == leaf.end_pos \ + and next_.type in ('number', 'string', 'keyword'): + leaf = next_ context = self._get_module_context().create_context(leaf) @@ -341,19 +257,9 @@ def _infer(self, line, column, only_stubs=False, prefer_stubs=False): # the API. return helpers.sorted_definitions(set(defs)) - def goto_assignments(self, follow_imports=False, follow_builtin_imports=False, **kwargs): - warnings.warn( - "Deprecated since version 0.16.0. Use Script(...).goto instead.", - DeprecationWarning, - stacklevel=2 - ) - return self.goto(*self._pos, - follow_imports=follow_imports, - follow_builtin_imports=follow_builtin_imports, - **kwargs) - @validate_line_column - def goto(self, line=None, column=None, **kwargs): + def goto(self, line=None, column=None, *, follow_imports=False, follow_builtin_imports=False, + only_stubs=False, prefer_stubs=False): """ Goes to the name that defined the object under the cursor. Optionally you can follow imports. @@ -367,11 +273,6 @@ def goto(self, line=None, column=None, **kwargs): :param prefer_stubs: Prefer stubs to Python objects for this method. :rtype: list of :class:`.Name` """ - with debug.increase_indent_cm('goto'): - return self._goto(line, column, **kwargs) - - def _goto(self, line, column, follow_imports=False, follow_builtin_imports=False, - only_stubs=False, prefer_stubs=False): tree_name = self._module_node.get_name_of_position((line, column)) if tree_name is None: # Without a name we really just want to jump to the result e.g. @@ -407,8 +308,7 @@ def _goto(self, line, column, follow_imports=False, follow_builtin_imports=False # Avoid duplicates return list(set(helpers.sorted_definitions(defs))) - @_no_python2_support - def search(self, string, **kwargs): + def search(self, string, *, all_scopes=False): """ Searches a name in the current file. For a description of how the search string should look like, please have a look at @@ -419,9 +319,6 @@ def search(self, string, **kwargs): functions and classes. :yields: :class:`.Name` """ - return self._search(string, **kwargs) # Python 2 ... - - def _search(self, string, all_scopes=False): return self._search_func(string, all_scopes=all_scopes) @to_list @@ -490,14 +387,6 @@ def need_pydoc(): return [classes.Name(self._inference_state, name)] return [] - def usages(self, **kwargs): - warnings.warn( - "Deprecated since version 0.16.0. Use Script(...).get_references instead.", - DeprecationWarning, - stacklevel=2 - ) - return self.get_references(*self._pos, **kwargs) - @validate_line_column def get_references(self, line=None, column=None, **kwargs): """ @@ -505,33 +394,29 @@ def get_references(self, line=None, column=None, **kwargs): quite hard to do for Jedi, if it is too complicated, Jedi will stop searching. - :param include_builtins: Default True, checks if a reference is a - builtin (e.g. ``sys``) and in that case does not return it. + :param include_builtins: Default ``True``. If ``False``, checks if a definition + is a builtin (e.g. ``sys``) and in that case does not return it. + :param scope: Default ``'project'``. If ``'file'``, include references in + the current module only. :rtype: list of :class:`.Name` """ - def _references(include_builtins=True): + def _references(include_builtins=True, scope='project'): + if scope not in ('project', 'file'): + raise ValueError('Only the scopes "file" and "project" are allowed') tree_name = self._module_node.get_name_of_position((line, column)) if tree_name is None: # Must be syntax return [] - names = find_references(self._get_module_context(), tree_name) + names = find_references(self._get_module_context(), tree_name, scope == 'file') definitions = [classes.Name(self._inference_state, n) for n in names] - if not include_builtins: + if not include_builtins or scope == 'file': definitions = [d for d in definitions if not d.in_builtin_module()] return helpers.sorted_definitions(definitions) return _references(**kwargs) - def call_signatures(self): - warnings.warn( - "Deprecated since version 0.16.0. Use Script(...).get_signatures instead.", - DeprecationWarning, - stacklevel=2 - ) - return self.get_signatures(*self._pos) - @validate_line_column def get_signatures(self, line=None, column=None): """ @@ -681,8 +566,7 @@ def _names(self, all_scopes=False, definitions=True, references=False): ] return sorted(defs, key=lambda x: x.start_pos) - @_no_python2_support - def rename(self, line=None, column=None, **kwargs): + def rename(self, line=None, column=None, *, new_name): """ Renames all references of the variable under the cursor. @@ -691,16 +575,13 @@ def rename(self, line=None, column=None, **kwargs): :raises: :exc:`.RefactoringError` :rtype: :class:`.Refactoring` """ - return self._rename(line, column, **kwargs) - - def _rename(self, line, column, new_name): # Python 2... definitions = self.get_references(line, column, include_builtins=False) return refactoring.rename(self._inference_state, definitions, new_name) - @_no_python2_support - def extract_variable(self, line, column, **kwargs): + @validate_line_column + def extract_variable(self, line, column, *, new_name, until_line=None, until_column=None): """ - Moves an expression to a new statemenet. + Moves an expression to a new statement. For example if you have the cursor on ``foo`` and provide a ``new_name`` called ``bar``:: @@ -723,10 +604,6 @@ def extract_variable(self, line, column, **kwargs): :raises: :exc:`.RefactoringError` :rtype: :class:`.Refactoring` """ - return self._extract_variable(line, column, **kwargs) # Python 2... - - @validate_line_column - def _extract_variable(self, line, column, new_name, until_line=None, until_column=None): if until_line is None and until_column is None: until_pos = None else: @@ -740,8 +617,8 @@ def _extract_variable(self, line, column, new_name, until_line=None, until_colum new_name, (line, column), until_pos ) - @_no_python2_support - def extract_function(self, line, column, **kwargs): + @validate_line_column + def extract_function(self, line, column, *, new_name, until_line=None, until_column=None): """ Moves an expression to a new function. @@ -759,10 +636,11 @@ def x(): global_var = 3 def bar(foo): - return foo + 1 + global_var + return int(foo + 1 + global_var) - def x(foo): - x = int(bar(foo)) + def x(): + foo = 3.1 + x = bar(foo) :param new_name: The expression under the cursor will be replaced with a function with this name. @@ -773,10 +651,6 @@ def x(foo): :raises: :exc:`.RefactoringError` :rtype: :class:`.Refactoring` """ - return self._extract_function(line, column, **kwargs) # Python 2... - - @validate_line_column - def _extract_function(self, line, column, new_name, until_line=None, until_column=None): if until_line is None and until_column is None: until_pos = None else: @@ -790,7 +664,6 @@ def _extract_function(self, line, column, new_name, until_line=None, until_colum new_name, (line, column), until_pos ) - @_no_python2_support def inline(self, line=None, column=None): """ Inlines a variable under the cursor. This is basically the opposite of @@ -837,7 +710,7 @@ class Interpreter(Script): """ _allow_descriptor_getattr_default = True - def __init__(self, code, namespaces, **kwds): + def __init__(self, code, namespaces, *, project=None, **kwds): try: namespaces = [dict(n) for n in namespaces] except Exception: @@ -850,16 +723,23 @@ def __init__(self, code, namespaces, **kwds): if not isinstance(environment, InterpreterEnvironment): raise TypeError("The environment needs to be an InterpreterEnvironment subclass.") - super(Interpreter, self).__init__(code, environment=environment, - project=Project(os.getcwd()), **kwds) + if project is None: + project = Project(Path.cwd()) + + super().__init__(code, environment=environment, project=project, **kwds) + self.namespaces = namespaces self._inference_state.allow_descriptor_getattr = self._allow_descriptor_getattr_default @cache.memoize_method def _get_module_context(self): + if self.path is None: + file_io = None + else: + file_io = KnownContentFileIO(self.path, self._code) tree_module_value = ModuleValue( self._inference_state, self._module_node, - file_io=KnownContentFileIO(self.path, self._code), + file_io=file_io, string_names=('__main__',), code_lines=self._code_lines, ) @@ -869,21 +749,6 @@ def _get_module_context(self): ) -def names(source=None, path=None, encoding='utf-8', all_scopes=False, - definitions=True, references=False, environment=None): - warnings.warn( - "Deprecated since version 0.16.0. Use Script(...).get_names instead.", - DeprecationWarning, - stacklevel=2 - ) - - return Script(source, path=path, encoding=encoding).get_names( - all_scopes=all_scopes, - definitions=definitions, - references=references, - ) - - def preload_module(*modules): """ Preloading modules tells Jedi to load a module now, instead of lazy parsing @@ -894,7 +759,7 @@ def preload_module(*modules): """ for m in modules: s = "import %s as x; x." % m - Script(s, path=None).complete(1, len(s)) + Script(s).complete(1, len(s)) def set_debug_function(func_cb=debug.print_to_stdout, warnings=True, diff --git a/anaconda_lib/jedi/api/classes.py b/anaconda_lib/jedi/api/classes.py old mode 100755 new mode 100644 index b521cc90..ee741c33 --- a/anaconda_lib/jedi/api/classes.py +++ b/anaconda_lib/jedi/api/classes.py @@ -14,21 +14,20 @@ the interesting information about all operations. """ import re -import sys -import warnings +from pathlib import Path +from typing import Optional -from parso.python.tree import search_ancestor +from parso.tree import search_ancestor from jedi import settings from jedi import debug from jedi.inference.utils import unite from jedi.cache import memoize_method -from jedi.inference import imports -from jedi.inference.imports import ImportName from jedi.inference.compiled.mixed import MixedName -from jedi.inference.gradual.typeshed import StubModuleValue +from jedi.inference.names import ImportName, SubModuleName +from jedi.inference.gradual.stub_value import StubModuleValue from jedi.inference.gradual.conversion import convert_names, convert_values -from jedi.inference.base_value import ValueSet +from jedi.inference.base_value import ValueSet, HasNoContext from jedi.api.keywords import KeywordName from jedi.api import completion_cache from jedi.api.helpers import filter_follow_imports @@ -38,13 +37,17 @@ def _sort_names_by_start_pos(names): return sorted(names, key=lambda s: s.start_pos or (0, 0)) -def defined_names(inference_state, context): +def defined_names(inference_state, value): """ List sub-definitions (e.g., methods in class). :type scope: Scope :rtype: list of Name """ + try: + context = value.as_context() + except HasNoContext: + return [] filter = next(context.get_filters()) names = [name for name in filter.values()] return [Name(inference_state, n) for n in _sort_names_by_start_pos(names)] @@ -54,7 +57,7 @@ def _values_to_definitions(values): return [Name(c.inference_state, c.name) for c in values] -class BaseName(object): +class BaseName: """ The base class for all definitions, completions and signatures. """ @@ -71,7 +74,6 @@ class BaseName(object): '_collections': 'collections', '_socket': 'socket', '_sqlite3': 'sqlite3', - '__builtin__': 'builtins', } _tuple_mapping = dict((tuple(k.split('.')), v) for (k, v) in { @@ -94,17 +96,17 @@ def _get_module_context(self): return self._name.get_root_context() @property - def module_path(self): + def module_path(self) -> Optional[Path]: """ - Shows the file path of a module. e.g. ``/usr/lib/python2.7/os.py`` - - :rtype: str or None + Shows the file path of a module. e.g. ``/usr/lib/python3.9/os.py`` """ module = self._get_module_context() if module.is_stub() or not module.is_compiled(): # Compiled modules should not return a module path even if they # have one. - return self._get_module_context().py__file__() + path: Optional[Path] = self._get_module_context().py__file__() + if path is not None: + return path return None @@ -129,7 +131,6 @@ def type(self): to Jedi, :meth:`jedi.Script.infer` should return a list of definition for ``sys``, ``f``, ``C`` and ``x``. - >>> from jedi._compatibility import no_unicode_pprint >>> from jedi import Script >>> source = ''' ... import keyword @@ -155,7 +156,7 @@ def type(self): so that it is easy to relate the result to the source code. >>> defs = sorted(defs, key=lambda d: d.line) - >>> no_unicode_pprint(defs) # doctest: +NORMALIZE_WHITESPACE + >>> print(defs) # doctest: +NORMALIZE_WHITESPACE [, , , @@ -163,7 +164,7 @@ def type(self): Finally, here is what you can get from :attr:`type`: - >>> defs = [str(d.type) for d in defs] # It's unicode and in Py2 has u before it. + >>> defs = [d.type for d in defs] >>> defs[0] 'module' >>> defs[1] @@ -174,7 +175,7 @@ def type(self): 'function' Valid values for type are ``module``, ``class``, ``instance``, ``function``, - ``param``, ``path``, ``keyword`` and ``statement``. + ``param``, ``path``, ``keyword``, ``property`` and ``statement``. """ tree_name = self._name.tree_name @@ -186,7 +187,7 @@ def type(self): tree_name.is_definition(): resolve = True - if isinstance(self._name, imports.SubModuleName) or resolve: + if isinstance(self._name, SubModuleName) or resolve: for value in self._name.infer(): return value.api_type return self._name.api_type @@ -231,6 +232,39 @@ def column(self): return None return start_pos[1] + def get_definition_start_position(self): + """ + The (row, column) of the start of the definition range. Rows start with + 1, columns start with 0. + + :rtype: Optional[Tuple[int, int]] + """ + if self._name.tree_name is None: + return None + definition = self._name.tree_name.get_definition() + if definition is None: + return self._name.start_pos + return definition.start_pos + + def get_definition_end_position(self): + """ + The (row, column) of the end of the definition range. Rows start with + 1, columns start with 0. + + :rtype: Optional[Tuple[int, int]] + """ + if self._name.tree_name is None: + return None + definition = self._name.tree_name.get_definition() + if definition is None: + return self._name.tree_name.end_pos + if self.type in ("function", "class"): + last_leaf = definition.get_last_leaf() + if last_leaf.type == "newline": + return last_leaf.get_previous_leaf().end_pos + return last_leaf.end_pos + return definition.end_pos + def docstring(self, raw=False, fast=True): r""" Return a document string for this completion object. @@ -291,7 +325,6 @@ def description(self): Example: - >>> from jedi._compatibility import no_unicode_pprint >>> from jedi import Script >>> source = ''' ... def f(): @@ -304,10 +337,10 @@ def description(self): >>> script = Script(source) # line is maximum by default >>> defs = script.infer(column=3) >>> defs = sorted(defs, key=lambda d: d.line) - >>> no_unicode_pprint(defs) # doctest: +NORMALIZE_WHITESPACE + >>> print(defs) # doctest: +NORMALIZE_WHITESPACE [, ] - >>> str(defs[0].description) # strip literals in python2 + >>> str(defs[0].description) 'def f' >>> str(defs[1].description) 'class C' @@ -391,7 +424,10 @@ def is_side_effect(self): return False return tree_name.is_definition() and tree_name.parent.type == 'trailer' - def goto(self, **kwargs): + @debug.increase_indent_cm('goto on name') + def goto(self, *, follow_imports=False, follow_builtin_imports=False, + only_stubs=False, prefer_stubs=False): + """ Like :meth:`.Script.goto` (also supports the same params), but does it for the current name. This is typically useful if you are using @@ -404,20 +440,6 @@ def goto(self, **kwargs): :param prefer_stubs: Prefer stubs to Python objects for this goto call. :rtype: list of :class:`Name` """ - with debug.increase_indent_cm('goto for %s' % self._name): - return self._goto(**kwargs) - - def goto_assignments(self, **kwargs): # Python 2... - warnings.warn( - "Deprecated since version 0.16.0. Use .goto.", - DeprecationWarning, - stacklevel=2 - ) - return self.goto(**kwargs) - - def _goto(self, follow_imports=False, follow_builtin_imports=False, - only_stubs=False, prefer_stubs=False): - if not self._name.is_value_name: return [] @@ -432,7 +454,8 @@ def _goto(self, follow_imports=False, follow_builtin_imports=False, return [self if n == self._name else Name(self._inference_state, n) for n in names] - def infer(self, **kwargs): # Python 2... + @debug.increase_indent_cm('infer on name') + def infer(self, *, only_stubs=False, prefer_stubs=False): """ Like :meth:`.Script.infer`, it can be useful to understand which type the current name has. @@ -449,10 +472,6 @@ def infer(self, **kwargs): # Python 2... inference call. :rtype: list of :class:`Name` """ - with debug.increase_indent_cm('infer for %s' % self._name): - return self._infer(**kwargs) - - def _infer(self, only_stubs=False, prefer_stubs=False): assert not (only_stubs and prefer_stubs) if not self._name.is_value_name: @@ -471,28 +490,6 @@ def _infer(self, only_stubs=False, prefer_stubs=False): return [self if n == self._name else Name(self._inference_state, n) for n in resulting_names] - @property - @memoize_method - def params(self): - warnings.warn( - "Deprecated since version 0.16.0. Use get_signatures()[...].params", - DeprecationWarning, - stacklevel=2 - ) - # Only return the first one. There might be multiple one, especially - # with overloading. - for signature in self._get_signatures(): - return [ - Name(self._inference_state, n) - for n in signature.get_param_names(resolve_stars=True) - ] - - if self.type == 'function' or self.type == 'class': - # Fallback, if no signatures were defined (which is probably by - # itself a bug). - return [] - raise AttributeError('There are no params defined on this.') - def parent(self): """ Returns the parent scope of this identifier. @@ -557,6 +554,8 @@ def get_line_code(self, before=0, after=0): return ''.join(lines[start_index:index + after + 1]) def _get_signatures(self, for_docstring=False): + if self._name.api_type == 'property': + return [] if for_docstring and self._name.api_type == 'statement' and not self.is_stub(): # For docstrings we don't resolve signatures if they are simple # statements and not stubs. This is a speed optimization. @@ -612,7 +611,7 @@ class Completion(BaseName): """ def __init__(self, inference_state, name, stack, like_name_length, is_fuzzy, cached_name=None): - super(Completion, self).__init__(inference_state, name) + super().__init__(inference_state, name) self._like_name_length = like_name_length self._stack = stack @@ -683,7 +682,7 @@ def docstring(self, raw=False, fast=True): # wouldn't load like > 100 Python modules anymore. fast = False - return super(Completion, self).docstring(raw=raw, fast=fast) + return super().docstring(raw=raw, fast=fast) def _get_docstring(self): if self._cached_name is not None: @@ -692,7 +691,7 @@ def _get_docstring(self): self._name.get_public_name(), lambda: self._get_cache() ) - return super(Completion, self)._get_docstring() + return super()._get_docstring() def _get_docstring_signature(self): if self._cached_name is not None: @@ -701,13 +700,13 @@ def _get_docstring_signature(self): self._name.get_public_name(), lambda: self._get_cache() ) - return super(Completion, self)._get_docstring_signature() + return super()._get_docstring_signature() def _get_cache(self): return ( - super(Completion, self).type, - super(Completion, self)._get_docstring_signature(), - super(Completion, self)._get_docstring(), + super().type, + super()._get_docstring_signature(), + super()._get_docstring(), ) @property @@ -723,7 +722,25 @@ def type(self): lambda: self._get_cache() ) - return super(Completion, self).type + return super().type + + def get_completion_prefix_length(self): + """ + Returns the length of the prefix being completed. + For example, completing ``isinstance``:: + + isinstan# <-- Cursor is here + + would return 8, because len('isinstan') == 8. + + Assuming the following function definition:: + + def foo(param=0): + pass + + completing ``foo(par`` would return 3. + """ + return self._like_name_length def __repr__(self): return '<%s: %s>' % (type(self).__name__, self._name.get_public_name()) @@ -735,16 +752,7 @@ class Name(BaseName): :meth:`.Script.goto` or :meth:`.Script.infer`. """ def __init__(self, inference_state, definition): - super(Name, self).__init__(inference_state, definition) - - @property - def desc_with_module(self): - warnings.warn( - "Deprecated since version 0.17.0. No replacement for now, maybe .full_name helps", - DeprecationWarning, - stacklevel=2 - ) - return "%s:%s" % (self.module_name, self.description) + super().__init__(inference_state, definition) @memoize_method def defined_names(self): @@ -755,7 +763,7 @@ def defined_names(self): """ defs = self._name.infer() return sorted( - unite(defined_names(self._inference_state, d.as_context()) for d in defs), + unite(defined_names(self._inference_state, d) for d in defs), key=lambda s: s._name.start_pos or (0, 0) ) @@ -788,7 +796,7 @@ class BaseSignature(Name): calls. """ def __init__(self, inference_state, signature): - super(BaseSignature, self).__init__(inference_state, signature.name) + super().__init__(inference_state, signature.name) self._signature = signature @property @@ -818,7 +826,7 @@ class Signature(BaseSignature): :meth:`.Script.get_signatures`. """ def __init__(self, inference_state, signature, call_details): - super(Signature, self).__init__(inference_state, signature) + super().__init__(inference_state, signature) self._call_details = call_details self._signature = signature @@ -885,8 +893,4 @@ def kind(self): :rtype: :py:attr:`inspect.Parameter.kind` """ - if sys.version_info < (3, 5): - raise NotImplementedError( - 'Python 2 is end-of-life, the new feature is not available for it' - ) return self._name.get_kind() diff --git a/anaconda_lib/jedi/api/completion.py b/anaconda_lib/jedi/api/completion.py old mode 100755 new mode 100644 index 840347e0..342f7506 --- a/anaconda_lib/jedi/api/completion.py +++ b/anaconda_lib/jedi/api/completion.py @@ -1,12 +1,12 @@ import re from textwrap import dedent +from inspect import Parameter from parso.python.token import PythonTokenTypes from parso.python import tree from parso.tree import search_ancestor, Leaf from parso import split_lines -from jedi._compatibility import Parameter from jedi import debug from jedi import settings from jedi.api import classes @@ -18,7 +18,8 @@ from jedi.inference.base_value import ValueSet from jedi.inference.helpers import infer_call_of_leaf, parse_dotted_names from jedi.inference.context import get_global_filters -from jedi.inference.value import TreeInstance, ModuleValue +from jedi.inference.value import TreeInstance +from jedi.inference.docstring_utils import DocstringModule from jedi.inference.names import ParamNameWrapper, SubModuleName from jedi.inference.gradual.conversion import convert_values, convert_names from jedi.parser_utils import cut_value_at_position @@ -34,9 +35,7 @@ def _get_signature_param_names(signatures, positional_count, used_kwargs): # Add named params for call_sig in signatures: for i, p in enumerate(call_sig.params): - # Allow protected access, because it's a public API. - # TODO reconsider with Python 2 drop - kind = p._name.get_kind() + kind = p.kind if i < positional_count and kind == Parameter.POSITIONAL_OR_KEYWORD: continue if kind in (Parameter.POSITIONAL_OR_KEYWORD, Parameter.KEYWORD_ONLY) \ @@ -51,8 +50,7 @@ def _must_be_kwarg(signatures, positional_count, used_kwargs): must_be_kwarg = True for signature in signatures: for i, p in enumerate(signature.params): - # TODO reconsider with Python 2 drop - kind = p._name.get_kind() + kind = p.kind if kind is Parameter.VAR_POSITIONAL: # In case there were not already kwargs, the next param can # always be a normal argument. @@ -197,7 +195,6 @@ def _complete_python(self, leaf): - In args: */**: no completion - In params (also lambda): no completion before = """ - grammar = self._inference_state.grammar self.stack = stack = None self._position = ( @@ -256,7 +253,6 @@ def _complete_python(self, leaf): allowed_transitions.append('else') completion_names = [] - current_line = self._code_lines[self._position[0] - 1][:self._position[1]] kwargs_only = False if any(t in allowed_transitions for t in (PythonTokenTypes.NAME, @@ -281,6 +277,10 @@ def _complete_python(self, leaf): ) elif nonterminals[-1] in ('trailer', 'dotted_name') and nodes[-1] == '.': dot = self._module_node.get_leaf_for_position(self._position) + if dot.type == "endmarker": + # This is a bit of a weird edge case, maybe we can somehow + # generalize this. + dot = leaf.get_previous_leaf() cached_name, n = self._complete_trailer(dot.get_previous_leaf()) completion_names += n elif self._is_parameter_completion(): @@ -315,6 +315,7 @@ def _complete_python(self, leaf): completion_names += self._complete_inherited(is_function=False) if not kwargs_only: + current_line = self._code_lines[self._position[0] - 1][:self._position[1]] completion_names += self._complete_keywords( allowed_transitions, only_values=not (not current_line or current_line[-1] in ' \t.;' @@ -343,19 +344,20 @@ def _complete_params(self, leaf): if stack_node.nonterminal == 'funcdef': context = get_user_context(self._module_context, self._position) node = search_ancestor(leaf, 'error_node', 'funcdef') - if node.type == 'error_node': - n = node.children[0] - if n.type == 'decorators': - decorators = n.children - elif n.type == 'decorator': - decorators = [n] + if node is not None: + if node.type == 'error_node': + n = node.children[0] + if n.type == 'decorators': + decorators = n.children + elif n.type == 'decorator': + decorators = [n] + else: + decorators = [] else: - decorators = [] - else: - decorators = node.get_decorators() - function_name = stack_node.nodes[1] + decorators = node.get_decorators() + function_name = stack_node.nodes[1] - return complete_param_names(context, function_name.value, decorators) + return complete_param_names(context, function_name.value, decorators) return [] def _complete_keywords(self, allowed_transitions, only_values): @@ -455,7 +457,7 @@ def iter_relevant_lines(lines): relevant_code_lines = list(iter_relevant_lines(code_lines)) if relevant_code_lines[-1] is not None: # Some code lines might be None, therefore get rid of that. - relevant_code_lines = [c or '\n' for c in relevant_code_lines] + relevant_code_lines = ['\n' if c is None else c for c in relevant_code_lines] return self._complete_code_lines(relevant_code_lines) match = re.search(r'`([^`\s]+)', code_lines[-1]) if match: @@ -464,12 +466,12 @@ def iter_relevant_lines(lines): def _complete_code_lines(self, code_lines): module_node = self._inference_state.grammar.parse(''.join(code_lines)) - module_value = ModuleValue( - self._inference_state, - module_node, + module_value = DocstringModule( + in_module_context=self._module_context, + inference_state=self._inference_state, + module_node=module_node, code_lines=code_lines, ) - module_value.parent_context = self._module_context return Completion( self._inference_state, module_value.as_context(), @@ -578,8 +580,8 @@ def __getattr__(self, name): will write it like this anyway and the other ones, well they are just out of luck I guess :) ~dave. """ - names = (instance.get_function_slot_names(u'__getattr__') - or instance.get_function_slot_names(u'__getattribute__')) + names = (instance.get_function_slot_names('__getattr__') + or instance.get_function_slot_names('__getattribute__')) functions = ValueSet.from_sets( name.infer() for name in names @@ -629,7 +631,7 @@ def search_in_module(inference_state, module_context, names, wanted_names, new_names = [] for n in names: if s == n.string_name: - if n.tree_name is not None and n.api_type == 'module' \ + if n.tree_name is not None and n.api_type in ('module', 'namespace') \ and ignore_imports: continue new_names += complete_trailer( diff --git a/anaconda_lib/jedi/api/completion_cache.py b/anaconda_lib/jedi/api/completion_cache.py old mode 100755 new mode 100644 index 6dac6a4e..46e9bead --- a/anaconda_lib/jedi/api/completion_cache.py +++ b/anaconda_lib/jedi/api/completion_cache.py @@ -1,7 +1,13 @@ -_cache = {} +from typing import Dict, Tuple, Callable +CacheValues = Tuple[str, str, str] +CacheValuesCallback = Callable[[], CacheValues] -def save_entry(module_name, name, cache): + +_cache: Dict[str, Dict[str, CacheValues]] = {} + + +def save_entry(module_name: str, name: str, cache: CacheValues) -> None: try: module_cache = _cache[module_name] except KeyError: @@ -9,8 +15,8 @@ def save_entry(module_name, name, cache): module_cache[name] = cache -def _create_get_from_cache(number): - def _get_from_cache(module_name, name, get_cache_values): +def _create_get_from_cache(number: int) -> Callable[[str, str, CacheValuesCallback], str]: + def _get_from_cache(module_name: str, name: str, get_cache_values: CacheValuesCallback) -> str: try: return _cache[module_name][name][number] except KeyError: diff --git a/anaconda_lib/jedi/api/environment.py b/anaconda_lib/jedi/api/environment.py old mode 100755 new mode 100644 index 3c0339b5..aea96c47 --- a/anaconda_lib/jedi/api/environment.py +++ b/anaconda_lib/jedi/api/environment.py @@ -7,8 +7,8 @@ import hashlib import filecmp from collections import namedtuple +from shutil import which -from jedi._compatibility import highest_pickle_protocol, which from jedi.cache import memoize_method, time_cache from jedi.inference.compiled.subprocess import CompiledSubprocess, \ InferenceStateSameProcess, InferenceStateSubprocess @@ -17,7 +17,7 @@ _VersionInfo = namedtuple('VersionInfo', 'major minor micro') -_SUPPORTED_PYTHONS = ['3.8', '3.7', '3.6', '3.5', '2.7'] +_SUPPORTED_PYTHONS = ['3.10', '3.9', '3.8', '3.7', '3.6'] _SAFE_PATHS = ['/usr/bin', '/usr/local/bin'] _CONDA_VAR = 'CONDA_PREFIX' _CURRENT_VERSION = '%s.%s' % (sys.version_info.major, sys.version_info.minor) @@ -30,7 +30,7 @@ class InvalidPythonEnvironment(Exception): """ -class _BaseEnvironment(object): +class _BaseEnvironment: @memoize_method def get_grammar(self): version_string = '%s.%s' % (self.version_info.major, self.version_info.minor) @@ -61,8 +61,9 @@ class Environment(_BaseEnvironment): """ _subprocess = None - def __init__(self, executable): + def __init__(self, executable, env_vars=None): self._start_executable = executable + self._env_vars = env_vars # Initialize the environment self._get_subprocess() @@ -71,7 +72,8 @@ def _get_subprocess(self): return self._subprocess try: - self._subprocess = CompiledSubprocess(self._start_executable) + self._subprocess = CompiledSubprocess(self._start_executable, + env_vars=self._env_vars) info = self._subprocess._send(None, _get_info) except Exception as exc: raise InvalidPythonEnvironment( @@ -94,16 +96,6 @@ def _get_subprocess(self): Like :data:`sys.version_info`: a tuple to show the current Environment's Python version. """ - - # py2 sends bytes via pickle apparently?! - if self.version_info.major == 2: - self.executable = self.executable.decode() - self.path = self.path.decode() - - # Adjust pickle protocol according to host and client version. - self._subprocess._pickle_protocol = highest_pickle_protocol([ - sys.version_info, self.version_info]) - return self._subprocess def __repr__(self): @@ -129,11 +121,12 @@ def get_sys_path(self): return self._get_subprocess().get_sys_path() -class _SameEnvironmentMixin(object): +class _SameEnvironmentMixin: def __init__(self): self._start_executable = self.executable = sys.executable self.path = sys.prefix self.version_info = _VersionInfo(*sys.version_info[:3]) + self._env_vars = None class SameEnvironment(_SameEnvironmentMixin, Environment): @@ -264,7 +257,7 @@ def _get_cached_default_environment(): return InterpreterEnvironment() -def find_virtualenvs(paths=None, **kwargs): +def find_virtualenvs(paths=None, *, safe=True, use_environment_vars=True): """ :param paths: A list of paths in your file system to be scanned for Virtualenvs. It will search in these paths and potentially execute the @@ -281,47 +274,44 @@ def find_virtualenvs(paths=None, **kwargs): :yields: :class:`.Environment` """ - def py27_comp(paths=None, safe=True, use_environment_vars=True): - if paths is None: - paths = [] - - _used_paths = set() - - if use_environment_vars: - # Using this variable should be safe, because attackers might be - # able to drop files (via git) but not environment variables. - virtual_env = _get_virtual_env_from_var() - if virtual_env is not None: - yield virtual_env - _used_paths.add(virtual_env.path) - - conda_env = _get_virtual_env_from_var(_CONDA_VAR) - if conda_env is not None: - yield conda_env - _used_paths.add(conda_env.path) - - for directory in paths: - if not os.path.isdir(directory): + if paths is None: + paths = [] + + _used_paths = set() + + if use_environment_vars: + # Using this variable should be safe, because attackers might be + # able to drop files (via git) but not environment variables. + virtual_env = _get_virtual_env_from_var() + if virtual_env is not None: + yield virtual_env + _used_paths.add(virtual_env.path) + + conda_env = _get_virtual_env_from_var(_CONDA_VAR) + if conda_env is not None: + yield conda_env + _used_paths.add(conda_env.path) + + for directory in paths: + if not os.path.isdir(directory): + continue + + directory = os.path.abspath(directory) + for path in os.listdir(directory): + path = os.path.join(directory, path) + if path in _used_paths: + # A path shouldn't be inferred twice. continue + _used_paths.add(path) - directory = os.path.abspath(directory) - for path in os.listdir(directory): - path = os.path.join(directory, path) - if path in _used_paths: - # A path shouldn't be inferred twice. - continue - _used_paths.add(path) - - try: - executable = _get_executable_path(path, safe=safe) - yield Environment(executable) - except InvalidPythonEnvironment: - pass - - return py27_comp(paths, **kwargs) + try: + executable = _get_executable_path(path, safe=safe) + yield Environment(executable) + except InvalidPythonEnvironment: + pass -def find_system_environments(): +def find_system_environments(*, env_vars=None): """ Ignores virtualenvs and returns the Python versions that were installed on your system. This might return nothing, if you're running Python e.g. from @@ -333,14 +323,14 @@ def find_system_environments(): """ for version_string in _SUPPORTED_PYTHONS: try: - yield get_system_environment(version_string) + yield get_system_environment(version_string, env_vars=env_vars) except InvalidPythonEnvironment: pass # TODO: this function should probably return a list of environments since # multiple Python installations can be found on a system for the same version. -def get_system_environment(version): +def get_system_environment(version, *, env_vars=None): """ Return the first Python environment found for a string of the form 'X.Y' where X and Y are the major and minor versions of Python. @@ -357,24 +347,24 @@ def get_system_environment(version): if os.name == 'nt': for exe in _get_executables_from_windows_registry(version): try: - return Environment(exe) + return Environment(exe, env_vars=env_vars) except InvalidPythonEnvironment: pass raise InvalidPythonEnvironment("Cannot find executable python%s." % version) -def create_environment(path, safe=True): +def create_environment(path, *, safe=True, env_vars=None): """ Make it possible to manually create an Environment object by specifying a - Virtualenv path or an executable path. + Virtualenv path or an executable path and optional environment variables. :raises: :exc:`.InvalidPythonEnvironment` :returns: :class:`.Environment` """ if os.path.isfile(path): _assert_safe(path, safe) - return Environment(path) - return Environment(_get_executable_path(path, safe=safe)) + return Environment(path, env_vars=env_vars) + return Environment(_get_executable_path(path, safe=safe), env_vars=env_vars) def _get_executable_path(path, safe=True): @@ -394,11 +384,8 @@ def _get_executable_path(path, safe=True): def _get_executables_from_windows_registry(version): - # The winreg module is named _winreg on Python 2. - try: - import winreg - except ImportError: - import _winreg as winreg + # https://github.com/python/typeshed/pull/3794 adds winreg + import winreg # type: ignore[import] # TODO: support Python Anaconda. sub_keys = [ diff --git a/anaconda_lib/jedi/api/errors.py b/anaconda_lib/jedi/api/errors.py old mode 100755 new mode 100644 index ea104b6f..10cb62af --- a/anaconda_lib/jedi/api/errors.py +++ b/anaconda_lib/jedi/api/errors.py @@ -8,7 +8,7 @@ def parso_to_jedi_errors(grammar, module_node): return [SyntaxError(e) for e in grammar.iter_errors(module_node)] -class SyntaxError(object): +class SyntaxError: """ Syntax errors are generated by :meth:`.Script.get_syntax_errors`. """ @@ -35,6 +35,9 @@ def until_column(self): """The column where the error ends (starting with 0).""" return self._parso_error.end_pos[1] + def get_message(self): + return self._parso_error.message + def __repr__(self): return '<%s from=%s to=%s>' % ( self.__class__.__name__, diff --git a/anaconda_lib/jedi/api/exceptions.py b/anaconda_lib/jedi/api/exceptions.py old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/api/file_name.py b/anaconda_lib/jedi/api/file_name.py old mode 100755 new mode 100644 index 0a2161a3..277f3220 --- a/anaconda_lib/jedi/api/file_name.py +++ b/anaconda_lib/jedi/api/file_name.py @@ -1,6 +1,5 @@ import os -from jedi._compatibility import FileNotFoundError, force_unicode, scandir from jedi.api import classes from jedi.api.strings import StringName, get_quote_ending from jedi.api.helpers import match @@ -8,7 +7,7 @@ class PathName(StringName): - api_type = u'path' + api_type = 'path' def complete_file_name(inference_state, module_context, start_leaf, quote, string, @@ -36,9 +35,9 @@ def complete_file_name(inference_state, module_context, start_leaf, quote, strin is_in_os_path_join = False else: string = to_be_added + string - base_path = os.path.join(inference_state.project._path, string) + base_path = os.path.join(inference_state.project.path, string) try: - listed = sorted(scandir(base_path), key=lambda e: e.name) + listed = sorted(os.scandir(base_path), key=lambda e: e.name) # OSError: [Errno 36] File name too long: '...' except (FileNotFoundError, OSError): return @@ -94,7 +93,7 @@ def _add_strings(context, nodes, add_slash=False): return None if not first and add_slash: string += os.path.sep - string += force_unicode(s) + string += s first = False return string diff --git a/anaconda_lib/jedi/api/helpers.py b/anaconda_lib/jedi/api/helpers.py old mode 100755 new mode 100644 index 91ec2806..e8ce3881 --- a/anaconda_lib/jedi/api/helpers.py +++ b/anaconda_lib/jedi/api/helpers.py @@ -6,11 +6,11 @@ from textwrap import dedent from itertools import chain from functools import wraps +from inspect import Parameter from parso.python.parser import Parser from parso.python import tree -from jedi._compatibility import u, Parameter from jedi.inference.base_value import NO_VALUES from jedi.inference.syntax_tree import infer_atom from jedi.inference.helpers import infer_call_of_leaf @@ -44,7 +44,10 @@ def match(string, like_name, fuzzy=False): def sorted_definitions(defs): # Note: `or ''` below is required because `module_path` could be - return sorted(defs, key=lambda x: (x.module_path or '', x.line or 0, x.column or 0, x.name)) + return sorted(defs, key=lambda x: (str(x.module_path or ''), + x.line or 0, + x.column or 0, + x.name)) def get_on_completion_name(module_node, lines, position): @@ -84,18 +87,18 @@ def _get_code_for_stack(code_lines, leaf, position): # If we're not on a comment simply get the previous leaf and proceed. leaf = leaf.get_previous_leaf() if leaf is None: - return u('') # At the beginning of the file. + return '' # At the beginning of the file. is_after_newline = leaf.type == 'newline' while leaf.type == 'newline': leaf = leaf.get_previous_leaf() if leaf is None: - return u('') + return '' if leaf.type == 'error_leaf' or leaf.type == 'string': if leaf.start_pos[0] < position[0]: # On a different line, we just begin anew. - return u('') + return '' # Error leafs cannot be parsed, completion in strings is also # impossible. @@ -111,7 +114,7 @@ def _get_code_for_stack(code_lines, leaf, position): if user_stmt.start_pos[1] > position[1]: # This means that it's actually a dedent and that means that we # start without value (part of a suite). - return u('') + return '' # This is basically getting the relevant lines. return _get_code(code_lines, user_stmt.get_start_pos_of_prefix(), position) @@ -195,15 +198,13 @@ def filter_follow_imports(names, follow_builtin_imports=False): if found_builtin: yield name else: - for new_name in new_names: - yield new_name + yield from new_names else: yield name -class CallDetails(object): +class CallDetails: def __init__(self, bracket_leaf, children, position): - ['bracket_leaf', 'call_index', 'keyword_name_str'] self.bracket_leaf = bracket_leaf self._children = children self._position = position @@ -294,8 +295,7 @@ def remove_after_pos(name): # Returns Generator[Tuple[star_count, Optional[key_start: str], had_equal]] nodes_before = [c for c in nodes if c.start_pos < position] if nodes_before[-1].type == 'arglist': - for x in _iter_arguments(nodes_before[-1].children, position): - yield x # Python 2 :( + yield from _iter_arguments(nodes_before[-1].children, position) return previous_node_yielded = False @@ -320,7 +320,7 @@ def remove_after_pos(name): else: yield 0, None, False stars_seen = 0 - elif node.type in ('testlist', 'testlist_star_expr'): # testlist is Python 2 + elif node.type == 'testlist_star_expr': for n in node.children[::2]: if n.type == 'star_expr': stars_seen = 1 @@ -402,7 +402,7 @@ def get_signature_details(module, position): # parents for possible function definitions. node = leaf.parent while node is not None: - if node.type in ('funcdef', 'classdef'): + if node.type in ('funcdef', 'classdef', 'decorated', 'async_stmt'): # Don't show signatures if there's stuff before it that just # makes it feel strange to have a signature. return None @@ -422,7 +422,8 @@ def get_signature_details(module, position): additional_children.insert(0, n) # Find a valid trailer - if node.type == 'trailer' and node.children[0] == '(': + if node.type == 'trailer' and node.children[0] == '(' \ + or node.type == 'decorator' and node.children[2] == '(': # Additionally we have to check that an ending parenthesis isn't # interpreted wrong. There are two cases: # 1. Cursor before paren -> The current signature is good @@ -431,7 +432,11 @@ def get_signature_details(module, position): leaf = node.get_previous_leaf() if leaf is None: return None - return CallDetails(node.children[0], node.children, position) + return CallDetails( + node.children[0] if node.type == 'trailer' else node.children[2], + node.children, + position + ) node = node.parent @@ -470,8 +475,8 @@ def wrapper(self, line=None, column=None, *args, **kwargs): line_string = self._code_lines[line - 1] line_len = len(line_string) if line_string.endswith('\r\n'): - line_len -= 1 - if line_string.endswith('\n'): + line_len -= 2 + elif line_string.endswith('\n'): line_len -= 1 column = line_len if column is None else column diff --git a/anaconda_lib/jedi/api/interpreter.py b/anaconda_lib/jedi/api/interpreter.py old mode 100755 new mode 100644 index bb7268a7..befafe5a --- a/anaconda_lib/jedi/api/interpreter.py +++ b/anaconda_lib/jedi/api/interpreter.py @@ -3,6 +3,9 @@ """ from jedi.inference import compiled +from jedi.inference.base_value import ValueSet +from jedi.inference.filters import ParserTreeFilter, MergedFilter +from jedi.inference.names import TreeNameDefinition from jedi.inference.compiled import mixed from jedi.inference.compiled.access import create_access_path from jedi.inference.context import ModuleContext @@ -14,15 +17,42 @@ def _create(inference_state, obj): ) -class NamespaceObject(object): +class NamespaceObject: def __init__(self, dct): self.__dict__ = dct +class MixedTreeName(TreeNameDefinition): + def infer(self): + """ + In IPython notebook it is typical that some parts of the code that is + provided was already executed. In that case if something is not properly + inferred, it should still infer from the variables it already knows. + """ + inferred = super().infer() + if not inferred: + for compiled_value in self.parent_context.mixed_values: + for f in compiled_value.get_filters(): + values = ValueSet.from_sets( + n.infer() for n in f.get(self.string_name) + ) + if values: + return values + return inferred + + +class MixedParserTreeFilter(ParserTreeFilter): + name_class = MixedTreeName + + class MixedModuleContext(ModuleContext): def __init__(self, tree_module_value, namespaces): - super(MixedModuleContext, self).__init__(tree_module_value) - self._namespace_objects = [NamespaceObject(n) for n in namespaces] + super().__init__(tree_module_value) + self.mixed_values = [ + self._get_mixed_object( + _create(self.inference_state, NamespaceObject(n)) + ) for n in namespaces + ] def _get_mixed_object(self, compiled_value): return mixed.MixedObject( @@ -30,12 +60,15 @@ def _get_mixed_object(self, compiled_value): tree_value=self._value ) - def get_filters(self, *args, **kwargs): - for filter in self._value.as_context().get_filters(*args, **kwargs): - yield filter + def get_filters(self, until_position=None, origin_scope=None): + yield MergedFilter( + MixedParserTreeFilter( + parent_context=self, + until_position=until_position, + origin_scope=origin_scope + ), + self.get_global_filter(), + ) - for namespace_obj in self._namespace_objects: - compiled_value = _create(self.inference_state, namespace_obj) - mixed_object = self._get_mixed_object(compiled_value) - for filter in mixed_object.get_filters(*args, **kwargs): - yield filter + for mixed_object in self.mixed_values: + yield from mixed_object.get_filters(until_position, origin_scope) diff --git a/anaconda_lib/jedi/api/keywords.py b/anaconda_lib/jedi/api/keywords.py old mode 100755 new mode 100644 index dd57bb85..95c49227 --- a/anaconda_lib/jedi/api/keywords.py +++ b/anaconda_lib/jedi/api/keywords.py @@ -1,22 +1,20 @@ import pydoc +from contextlib import suppress +from typing import Dict, Optional -from jedi.inference.utils import ignored from jedi.inference.names import AbstractArbitraryName try: - from pydoc_data import topics as pydoc_topics + # https://github.com/python/typeshed/pull/4351 adds pydoc_data + from pydoc_data import topics # type: ignore[import] + pydoc_topics: Optional[Dict[str, str]] = topics.topics except ImportError: - # Python 2 - try: - import pydoc_topics - except ImportError: - # This is for Python 3 embeddable version, which dont have - # pydoc_data module in its file python3x.zip. - pydoc_topics = None + # Python 3.6.8 embeddable does not have pydoc_data. + pydoc_topics = None class KeywordName(AbstractArbitraryName): - api_type = u'keyword' + api_type = 'keyword' def py__doc__(self): return imitate_pydoc(self.string_name) @@ -30,11 +28,8 @@ def imitate_pydoc(string): if pydoc_topics is None: return '' - # str needed because of possible unicode stuff in py2k (pydoc doesn't work - # with unicode strings) - string = str(string) h = pydoc.help - with ignored(KeyError): + with suppress(KeyError): # try to access symbols string = h.symbols[string] string, _, related = string.partition(' ') @@ -52,6 +47,6 @@ def get_target(s): return '' try: - return pydoc_topics.topics[label].strip() if pydoc_topics else '' + return pydoc_topics[label].strip() if pydoc_topics else '' except KeyError: return '' diff --git a/anaconda_lib/jedi/api/project.py b/anaconda_lib/jedi/api/project.py old mode 100755 new mode 100644 index a2b7c4c1..da0f31d7 --- a/anaconda_lib/jedi/api/project.py +++ b/anaconda_lib/jedi/api/project.py @@ -7,26 +7,21 @@ Projects can be saved to disk and loaded again, to allow project definitions to be used across repositories. """ -import os -import errno import json -import sys +from pathlib import Path +from itertools import chain -from jedi._compatibility import FileNotFoundError, PermissionError, \ - IsADirectoryError, NotADirectoryError from jedi import debug from jedi.api.environment import get_cached_default_environment, create_environment from jedi.api.exceptions import WrongVersion from jedi.api.completion import search_in_module from jedi.api.helpers import split_search_string, get_module_names -from jedi._compatibility import force_unicode from jedi.inference.imports import load_module_from_path, \ load_namespace_from_path, iter_module_names from jedi.inference.sys_path import discover_buildout_paths from jedi.inference.cache import inference_state_as_method_param_cache from jedi.inference.references import recurse_find_python_folders_and_files, search_in_file_ios from jedi.file_io import FolderIO -from jedi.common import traverse_parents _CONFIG_FOLDER = '.jedi' _CONTAINS_POTENTIAL_PROJECT = \ @@ -61,11 +56,7 @@ def _remove_duplicates_from_path(path): yield p -def _force_unicode_list(lst): - return list(map(force_unicode, lst)) - - -class Project(object): +class Project: """ Projects are a simple way to manage Python folders and define how Jedi does import resolution. It is mostly used as a parameter to :class:`.Script`. @@ -75,11 +66,11 @@ class Project(object): @staticmethod def _get_config_folder_path(base_path): - return os.path.join(base_path, _CONFIG_FOLDER) + return base_path.joinpath(_CONFIG_FOLDER) @staticmethod def _get_json_path(base_path): - return os.path.join(Project._get_config_folder_path(base_path), 'project.json') + return Project._get_config_folder_path(base_path).joinpath('project.json') @classmethod def load(cls, path): @@ -89,6 +80,8 @@ def load(cls, path): :param path: The path of the directory you want to use as a project. """ + if isinstance(path, str): + path = Path(path) with open(cls._get_json_path(path)) as f: version, data = json.load(f) @@ -107,17 +100,22 @@ def save(self): data.pop('_environment', None) data.pop('_django', None) # TODO make django setting public? data = {k.lstrip('_'): v for k, v in data.items()} + data['path'] = str(data['path']) - # TODO when dropping Python 2 use pathlib.Path.mkdir(parents=True, exist_ok=True) - try: - os.makedirs(self._get_config_folder_path(self._path)) - except OSError as e: - if e.errno != errno.EEXIST: - raise + self._get_config_folder_path(self._path).mkdir(parents=True, exist_ok=True) with open(self._get_json_path(self._path), 'w') as f: return json.dump((_SERIALIZER_VERSION, data), f) - def __init__(self, path, **kwargs): + def __init__( + self, + path, + *, + environment_path=None, + load_unsafe_extensions=False, + sys_path=None, + added_sys_path=(), + smart_sys_path=True, + ) -> None: """ :param path: The base path for this project. :param environment_path: The Python executable path, typically the path @@ -136,19 +134,52 @@ def __init__(self, path, **kwargs): local directories. Otherwise you will have to rely on your packages being properly configured on the ``sys.path``. """ - def py2_comp(path, environment_path=None, load_unsafe_extensions=False, - sys_path=None, added_sys_path=(), smart_sys_path=True): - self._path = os.path.abspath(path) - self._environment_path = environment_path - self._sys_path = sys_path - self._smart_sys_path = smart_sys_path - self._load_unsafe_extensions = load_unsafe_extensions - self._django = False - self.added_sys_path = list(added_sys_path) - """The sys path that is going to be added at the end of the """ + if isinstance(path, str): + path = Path(path).absolute() + self._path = path + + self._environment_path = environment_path + if sys_path is not None: + # Remap potential pathlib.Path entries + sys_path = list(map(str, sys_path)) + self._sys_path = sys_path + self._smart_sys_path = smart_sys_path + self._load_unsafe_extensions = load_unsafe_extensions + self._django = False + # Remap potential pathlib.Path entries + self.added_sys_path = list(map(str, added_sys_path)) + """The sys path that is going to be added at the end of the """ + + @property + def path(self): + """ + The base path for this project. + """ + return self._path + + @property + def sys_path(self): + """ + The sys path provided to this project. This can be None and in that + case will be auto generated. + """ + return self._sys_path + + @property + def smart_sys_path(self): + """ + If the sys path is going to be calculated in a smart way, where + additional paths are added. + """ + return self._smart_sys_path - py2_comp(path, **kwargs) + @property + def load_unsafe_extensions(self): + """ + Wheter the project loads unsafe extensions. + """ + return self._load_unsafe_extensions @inference_state_as_method_param_cache() def _get_base_sys_path(self, inference_state): @@ -175,23 +206,27 @@ def _get_sys_path(self, inference_state, add_parent_paths=True, add_init_paths=F sys_path = list(self._sys_path) if self._smart_sys_path: - prefixed.append(self._path) + prefixed.append(str(self._path)) if inference_state.script_path is not None: - suffixed += discover_buildout_paths(inference_state, inference_state.script_path) + suffixed += map(str, discover_buildout_paths( + inference_state, + inference_state.script_path + )) if add_parent_paths: # Collect directories in upward search by: # 1. Skipping directories with __init__.py # 2. Stopping immediately when above self._path traversed = [] - for parent_path in traverse_parents(inference_state.script_path): - if parent_path == self._path or not parent_path.startswith(self._path): + for parent_path in inference_state.script_path.parents: + if parent_path == self._path \ + or self._path not in parent_path.parents: break if not add_init_paths \ - and os.path.isfile(os.path.join(parent_path, "__init__.py")): + and parent_path.joinpath("__init__.py").is_file(): continue - traversed.append(parent_path) + traversed.append(str(parent_path)) # AFAIK some libraries have imports like `foo.foo.bar`, which # leads to the conclusion to by default prefer longer paths @@ -199,10 +234,10 @@ def _get_sys_path(self, inference_state, add_parent_paths=True, add_init_paths=F suffixed += reversed(traversed) if self._django: - prefixed.append(self._path) + prefixed.append(str(self._path)) path = prefixed + sys_path + suffixed - return list(_force_unicode_list(_remove_duplicates_from_path(path))) + return list(_remove_duplicates_from_path(path)) def get_environment(self): if self._environment is None: @@ -212,7 +247,7 @@ def get_environment(self): self._environment = get_cached_default_environment() return self._environment - def search(self, string, **kwargs): + def search(self, string, *, all_scopes=False): """ Searches a name in the whole project. If the project is very big, at some point Jedi will stop searching. However it's also very much @@ -233,7 +268,7 @@ def search(self, string, **kwargs): functions and classes. :yields: :class:`.Name` """ - return self._search(string, **kwargs) + return self._search_func(string, all_scopes=all_scopes) def complete_search(self, string, **kwargs): """ @@ -247,9 +282,6 @@ def complete_search(self, string, **kwargs): """ return self._search_func(string, complete=True, **kwargs) - def _search(self, string, all_scopes=False): # Python 2.. - return self._search_func(string, all_scopes=all_scopes) - @_try_to_skip_duplicates def _search_func(self, string, complete=False, all_scopes=False): # Using a Script is they easiest way to get an empty module context. @@ -258,16 +290,12 @@ def _search_func(self, string, complete=False, all_scopes=False): inference_state = s._inference_state empty_module_context = s._get_module_context() - if inference_state.grammar.version_info < (3, 6) or sys.version_info < (3, 6): - raise NotImplementedError( - "No support for refactorings/search on Python 2/3.5" - ) debug.dbg('Search for string %s, complete=%s', string, complete) wanted_type, wanted_names = split_search_string(string) name = wanted_names[0] stub_folder_name = name + '-stubs' - ios = recurse_find_python_folders_and_files(FolderIO(self._path)) + ios = recurse_find_python_folders_and_files(FolderIO(str(self._path))) file_ios = [] # 1. Search for modules in the current project @@ -288,14 +316,13 @@ def _search_func(self, string, complete=False, all_scopes=False): continue else: file_ios.append(file_io) - file_name = os.path.basename(file_io.path) - if file_name in (name + '.py', name + '.pyi'): + if Path(file_io.path).name in (name + '.py', name + '.pyi'): m = load_module_from_path(inference_state, file_io).as_context() else: continue debug.dbg('Search of a specific module %s', m) - for x in search_in_module( + yield from search_in_module( inference_state, m, names=[m.name], @@ -304,15 +331,15 @@ def _search_func(self, string, complete=False, all_scopes=False): complete=complete, convert=True, ignore_imports=True, - ): - yield x # Python 2... + ) # 2. Search for identifiers in the project. - for module_context in search_in_file_ios(inference_state, file_ios, name): + for module_context in search_in_file_ios(inference_state, file_ios, + name, complete=complete): names = get_module_names(module_context.tree_node, all_scopes=all_scopes) names = [module_context.create_name(n) for n in names] names = _remove_imports(names) - for x in search_in_module( + yield from search_in_module( inference_state, module_context, names=names, @@ -320,18 +347,17 @@ def _search_func(self, string, complete=False, all_scopes=False): wanted_names=wanted_names, complete=complete, ignore_imports=True, - ): - yield x # Python 2... + ) # 3. Search for modules on sys.path sys_path = [ p for p in self._get_sys_path(inference_state) # Exclude folders that are handled by recursing of the Python # folders. - if not p.startswith(self._path) + if not p.startswith(str(self._path)) ] names = list(iter_module_names(inference_state, empty_module_context, sys_path)) - for x in search_in_module( + yield from search_in_module( inference_state, empty_module_context, names=names, @@ -339,8 +365,7 @@ def _search_func(self, string, complete=False, all_scopes=False): wanted_names=wanted_names, complete=complete, convert=True, - ): - yield x # Python 2... + ) def __repr__(self): return '<%s: %s>' % (self.__class__.__name__, self._path) @@ -348,15 +373,18 @@ def __repr__(self): def _is_potential_project(path): for name in _CONTAINS_POTENTIAL_PROJECT: - if os.path.exists(os.path.join(path, name)): - return True + try: + if path.joinpath(name).exists(): + return True + except OSError: + continue return False def _is_django_path(directory): """ Detects the path of the very well known Django library (if used) """ try: - with open(os.path.join(directory, 'manage.py'), 'rb') as f: + with open(directory.joinpath('manage.py'), 'rb') as f: return b"DJANGO_SETTINGS_MODULE" in f.read() except (FileNotFoundError, IsADirectoryError, PermissionError): return False @@ -373,12 +401,14 @@ def get_default_project(path=None): ``requirements.txt`` and ``MANIFEST.in``. """ if path is None: - path = os.getcwd() + path = Path.cwd() + elif isinstance(path, str): + path = Path(path) - check = os.path.realpath(path) + check = path.absolute() probable_path = None first_no_init_file = None - for dir in traverse_parents(check, include_current=True): + for dir in chain([check], check.parents): try: return Project.load(dir) except (FileNotFoundError, IsADirectoryError, PermissionError): @@ -387,11 +417,11 @@ def get_default_project(path=None): continue if first_no_init_file is None: - if os.path.exists(os.path.join(dir, '__init__.py')): + if dir.joinpath('__init__.py').exists(): # In the case that a __init__.py exists, it's in 99% just a # Python package and the project sits at least one level above. continue - else: + elif not dir.is_file(): first_no_init_file = dir if _is_django_path(dir): @@ -409,12 +439,12 @@ def get_default_project(path=None): if first_no_init_file is not None: return Project(first_no_init_file) - curdir = path if os.path.isdir(path) else os.path.dirname(path) + curdir = path if path.is_dir() else path.parent return Project(curdir) def _remove_imports(names): return [ n for n in names - if n.tree_name is None or n.api_type != 'module' + if n.tree_name is None or n.api_type not in ('module', 'namespace') ] diff --git a/anaconda_lib/jedi/api/refactoring/__init__.py b/anaconda_lib/jedi/api/refactoring/__init__.py old mode 100755 new mode 100644 index f05517d2..84513da0 --- a/anaconda_lib/jedi/api/refactoring/__init__.py +++ b/anaconda_lib/jedi/api/refactoring/__init__.py @@ -1,7 +1,6 @@ -from os.path import dirname, basename, join, relpath -import os -import re import difflib +from pathlib import Path +from typing import Dict, Iterable, Tuple from parso import split_lines @@ -13,7 +12,7 @@ ).split() -class ChangedFile(object): +class ChangedFile: def __init__(self, inference_state, from_path, to_path, module_node, node_to_str_map): self._inference_state = inference_state @@ -39,19 +38,19 @@ def get_diff(self): if new_lines[-1] != '': new_lines[-1] += '\n' - project_path = self._inference_state.project._path + project_path = self._inference_state.project.path if self._from_path is None: from_p = '' else: - from_p = relpath(self._from_path, project_path) + from_p = self._from_path.relative_to(project_path) if self._to_path is None: to_p = '' else: - to_p = relpath(self._to_path, project_path) + to_p = self._to_path.relative_to(project_path) diff = difflib.unified_diff( old_lines, new_lines, - fromfile=from_p, - tofile=to_p, + fromfile=str(from_p), + tofile=str(to_p), ) # Apparently there's a space at the end of the diff - for whatever # reason. @@ -73,23 +72,21 @@ def __repr__(self): return '<%s: %s>' % (self.__class__.__name__, self._from_path) -class Refactoring(object): +class Refactoring: def __init__(self, inference_state, file_to_node_changes, renames=()): self._inference_state = inference_state self._renames = renames self._file_to_node_changes = file_to_node_changes - def get_changed_files(self): - """ - Returns a path to ``ChangedFile`` map. - """ + def get_changed_files(self) -> Dict[Path, ChangedFile]: def calculate_to_path(p): if p is None: return p + p = str(p) for from_, to in renames: - if p.startswith(from_): - p = to + p[len(from_):] - return p + if p.startswith(str(from_)): + p = str(to) + p[len(str(from_)):] + return Path(p) renames = self.get_renames() return { @@ -102,20 +99,18 @@ def calculate_to_path(p): ) for path, map_ in sorted(self._file_to_node_changes.items()) } - def get_renames(self): + def get_renames(self) -> Iterable[Tuple[Path, Path]]: """ Files can be renamed in a refactoring. - - Returns ``Iterable[Tuple[str, str]]``. """ return sorted(self._renames) def get_diff(self): text = '' - project_path = self._inference_state.project._path + project_path = self._inference_state.project.path for from_, to in self.get_renames(): text += 'rename from %s\nrename to %s\n' \ - % (relpath(from_, project_path), relpath(to, project_path)) + % (from_.relative_to(project_path), to.relative_to(project_path)) return text + ''.join(f.get_diff() for f in self.get_changed_files().values()) @@ -127,17 +122,14 @@ def apply(self): f.apply() for old, new in self.get_renames(): - os.rename(old, new) + old.rename(new) def _calculate_rename(path, new_name): - name = basename(path) - dir_ = dirname(path) - if name in ('__init__.py', '__init__.pyi'): - parent_dir = dirname(dir_) - return dir_, join(parent_dir, new_name) - ending = re.search(r'\.pyi?$', name).group(0) - return path, join(dir_, new_name + ending) + dir_ = path.parent + if path.name in ('__init__.py', '__init__.pyi'): + return dir_, dir_.parent.joinpath(new_name) + return path, dir_.joinpath(new_name + path.suffix) def rename(inference_state, definitions, new_name): @@ -150,7 +142,8 @@ def rename(inference_state, definitions, new_name): for d in definitions: tree_name = d._name.tree_name if d.type == 'module' and tree_name is None: - file_renames.add(_calculate_rename(d.module_path, new_name)) + p = None if d.module_path is None else Path(d.module_path) + file_renames.add(_calculate_rename(p, new_name)) else: # This private access is ok in a way. It's not public to # protect Jedi users from seeing it. @@ -163,8 +156,8 @@ def rename(inference_state, definitions, new_name): def inline(inference_state, names): if not names: raise RefactoringError("There is no name under the cursor") - if any(n.api_type == 'module' for n in names): - raise RefactoringError("Cannot inline imports or modules") + if any(n.api_type in ('module', 'namespace') for n in names): + raise RefactoringError("Cannot inline imports, modules or namespaces") if any(n.tree_name is None for n in names): raise RefactoringError("Cannot inline builtins/extensions") diff --git a/anaconda_lib/jedi/api/refactoring/extract.py b/anaconda_lib/jedi/api/refactoring/extract.py old mode 100755 new mode 100644 index 15bc6527..6e7df7e1 --- a/anaconda_lib/jedi/api/refactoring/extract.py +++ b/anaconda_lib/jedi/api/refactoring/extract.py @@ -9,7 +9,6 @@ from jedi.parser_utils import function_is_classmethod, function_is_staticmethod -_EXTRACT_USE_PARENT = EXPRESSION_PARTS + ['trailer'] _DEFINITION_SCOPES = ('suite', 'file_input') _VARIABLE_EXCTRACTABLE = EXPRESSION_PARTS + \ ('atom testlist_star_expr testlist test lambdef lambdef_nocond ' @@ -57,7 +56,9 @@ def _find_nodes(module_node, pos, until_pos): if _is_not_extractable_syntax(start_node): start_node = start_node.parent - while start_node.parent.type in _EXTRACT_USE_PARENT: + if start_node.parent.type == 'trailer': + start_node = start_node.parent.parent + while start_node.parent.type in EXPRESSION_PARTS: start_node = start_node.parent nodes = [start_node] @@ -349,8 +350,7 @@ def _find_non_global_names(nodes): if node.type == 'trailer' and node.children[0] == '.': continue - for x in _find_non_global_names(children): # Python 2... - yield x + yield from _find_non_global_names(children) def _get_code_insertion_node(node, is_bound_method): diff --git a/anaconda_lib/jedi/api/replstartup.py b/anaconda_lib/jedi/api/replstartup.py old mode 100755 new mode 100644 index 38aa8e6f..e0f23d19 --- a/anaconda_lib/jedi/api/replstartup.py +++ b/anaconda_lib/jedi/api/replstartup.py @@ -9,7 +9,7 @@ Then you will be able to use Jedi completer in your Python interpreter:: $ python - Python 2.7.2+ (default, Jul 20 2012, 22:15:08) + Python 3.9.2+ (default, Jul 20 2020, 22:15:08) [GCC 4.6.1] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import os diff --git a/anaconda_lib/jedi/api/strings.py b/anaconda_lib/jedi/api/strings.py old mode 100755 new mode 100644 index 6653671e..f91da25b --- a/anaconda_lib/jedi/api/strings.py +++ b/anaconda_lib/jedi/api/strings.py @@ -9,7 +9,6 @@ """ import re -from jedi._compatibility import unicode from jedi.inference.names import AbstractArbitraryName from jedi.inference.helpers import infer_call_of_leaf from jedi.api.classes import Completion @@ -19,7 +18,7 @@ class StringName(AbstractArbitraryName): - api_type = u'string' + api_type = 'string' is_value_name = False @@ -65,7 +64,7 @@ def _completions_for_dicts(inference_state, dicts, literal_string, cut_end_quote def _create_repr_string(literal_string, dict_key): - if not isinstance(dict_key, (unicode, bytes)) or not literal_string: + if not isinstance(dict_key, (str, bytes)) or not literal_string: return repr(dict_key) r = repr(dict_key) diff --git a/anaconda_lib/jedi/cache.py b/anaconda_lib/jedi/cache.py old mode 100755 new mode 100644 index 29ed979f..1ff45201 --- a/anaconda_lib/jedi/cache.py +++ b/anaconda_lib/jedi/cache.py @@ -13,14 +13,15 @@ """ import time from functools import wraps +from typing import Any, Dict, Tuple from jedi import settings from parso.cache import parser_cache -_time_caches = {} +_time_caches: Dict[str, Dict[Any, Tuple[float, Any]]] = {} -def clear_time_caches(delete_all=False): +def clear_time_caches(delete_all: bool = False) -> None: """ Jedi caches many things, that should be completed after each completion finishes. diff --git a/anaconda_lib/jedi/common.py b/anaconda_lib/jedi/common.py old mode 100755 new mode 100644 index 75b69299..eb4b4996 --- a/anaconda_lib/jedi/common.py +++ b/anaconda_lib/jedi/common.py @@ -1,18 +1,6 @@ -import os from contextlib import contextmanager -def traverse_parents(path, include_current=False): - if not include_current: - path = os.path.dirname(path) - - previous = None - while previous != path: - yield path - previous = path - path = os.path.dirname(path) - - @contextmanager def monkeypatch(obj, attribute_name, new_value): """ diff --git a/anaconda_lib/jedi/debug.py b/anaconda_lib/jedi/debug.py old mode 100755 new mode 100644 index 4136acf4..99a90601 --- a/anaconda_lib/jedi/debug.py +++ b/anaconda_lib/jedi/debug.py @@ -1,8 +1,7 @@ import os import time from contextlib import contextmanager - -from jedi._compatibility import encoding, is_py3, u +from typing import Callable, Optional _inited = False @@ -22,7 +21,7 @@ def _lazy_colorama_init(): raise ImportError else: # Use colorama for nicer console output. - from colorama import Fore, init + from colorama import Fore, init # type: ignore[import] from colorama import initialise def _lazy_colorama_init(): # noqa: F811 @@ -47,7 +46,7 @@ def _lazy_colorama_init(): # noqa: F811 _inited = True except ImportError: - class Fore(object): + class Fore: # type: ignore[no-redef] RED = '' GREEN = '' YELLOW = '' @@ -64,7 +63,7 @@ class Fore(object): enable_notice = False # callback, interface: level, str -debug_function = None +debug_function: Optional[Callable[[str, str], None]] = None _debug_indent = 0 _start_time = time.time() @@ -84,39 +83,34 @@ def wrapper(*args, **kwargs): @contextmanager -def increase_indent_cm(title=None): +def increase_indent_cm(title=None, color='MAGENTA'): global _debug_indent if title: - dbg('Start: ' + title, color='MAGENTA') + dbg('Start: ' + title, color=color) _debug_indent += 1 try: yield finally: _debug_indent -= 1 if title: - dbg('End: ' + title, color='MAGENTA') + dbg('End: ' + title, color=color) -def dbg(message, *args, **kwargs): +def dbg(message, *args, color='GREEN'): """ Looks at the stack, to see if a debug message should be printed. """ - # Python 2 compatibility, because it doesn't understand default args - color = kwargs.pop('color', 'GREEN') assert color if debug_function and enable_notice: i = ' ' * _debug_indent _lazy_colorama_init() - debug_function(color, i + 'dbg: ' + message % tuple(u(repr(a)) for a in args)) - + debug_function(color, i + 'dbg: ' + message % tuple(repr(a) for a in args)) -def warning(message, *args, **kwargs): - format = kwargs.pop('format', True) - assert not kwargs +def warning(message, *args, format=True): if debug_function and enable_warning: i = ' ' * _debug_indent if format: - message = message % tuple(u(repr(a)) for a in args) + message = message % tuple(repr(a) for a in args) debug_function('RED', i + 'warning: ' + message) @@ -135,9 +129,4 @@ def print_to_stdout(color, str_out): """ col = getattr(Fore, color) _lazy_colorama_init() - if not is_py3: - str_out = str_out.encode(encoding, 'replace') print(col + str_out + Fore.RESET) - - -# debug_function = print_to_stdout diff --git a/anaconda_lib/jedi/file_io.py b/anaconda_lib/jedi/file_io.py old mode 100755 new mode 100644 index c4a5d24a..ead17335 --- a/anaconda_lib/jedi/file_io.py +++ b/anaconda_lib/jedi/file_io.py @@ -3,7 +3,7 @@ from parso import file_io -class AbstractFolderIO(object): +class AbstractFolderIO: def __init__(self, path): self.path = path @@ -57,7 +57,7 @@ def walk(self): del dirs[i] -class FileIOFolderMixin(object): +class FileIOFolderMixin: def get_parent_folder(self): return FolderIO(os.path.dirname(self.path)) @@ -65,13 +65,13 @@ def get_parent_folder(self): class ZipFileIO(file_io.KnownContentFileIO, FileIOFolderMixin): """For .zip and .egg archives""" def __init__(self, path, code, zip_path): - super(ZipFileIO, self).__init__(path, code) + super().__init__(path, code) self._zip_path = zip_path def get_last_modified(self): try: return os.path.getmtime(self._zip_path) - except OSError: # Python 3 would probably only need FileNotFoundError + except (FileNotFoundError, PermissionError, NotADirectoryError): return None diff --git a/anaconda_lib/jedi/inference/__init__.py b/anaconda_lib/jedi/inference/__init__.py old mode 100755 new mode 100644 index dbefc52a..f4bf9a9c --- a/anaconda_lib/jedi/inference/__init__.py +++ b/anaconda_lib/jedi/inference/__init__.py @@ -81,7 +81,7 @@ from jedi.plugins import plugin_manager -class InferenceState(object): +class InferenceState: def __init__(self, project, environment=None, script_path=None): if environment is None: environment = project.get_environment() @@ -120,19 +120,18 @@ def execute(value, arguments): debug.dbg('execute result: %s in %s', value_set, value) return value_set - @property + # mypy doesn't suppport decorated propeties (https://github.com/python/mypy/issues/1362) + @property # type: ignore[misc] @inference_state_function_cache() def builtins_module(self): - module_name = u'builtins' - if self.environment.version_info.major == 2: - module_name = u'__builtin__' + module_name = 'builtins' builtins_module, = self.import_module((module_name,), sys_path=()) return builtins_module - @property + @property # type: ignore[misc] @inference_state_function_cache() def typing_module(self): - typing_module, = self.import_module((u'typing',)) + typing_module, = self.import_module(('typing',)) return typing_module def reset_recursion_limitations(self): @@ -171,6 +170,8 @@ def infer(self, context, name): return tree_name_to_values(self, context, name) elif type_ == 'param': return context.py__getattribute__(name.value, position=name.end_pos) + elif type_ == 'namedexpr_test': + return context.infer_node(def_) else: result = follow_error_node_imports_if_possible(context, name) if result is not None: @@ -178,14 +179,14 @@ def infer(self, context, name): return helpers.infer_call_of_leaf(context, name) - def parse_and_get_code(self, code=None, path=None, encoding='utf-8', + def parse_and_get_code(self, code=None, path=None, use_latest_grammar=False, file_io=None, **kwargs): if code is None: if file_io is None: file_io = FileIO(path) code = file_io.read() # We cannot just use parso, because it doesn't use errors='replace'. - code = parso.python_bytes_to_unicode(code, encoding=encoding, errors='replace') + code = parso.python_bytes_to_unicode(code, encoding='utf-8', errors='replace') if len(code) > settings._cropped_file_size: code = code[:settings._cropped_file_size] diff --git a/anaconda_lib/jedi/inference/analysis.py b/anaconda_lib/jedi/inference/analysis.py old mode 100755 new mode 100644 index 9ce56370..c272a9cb --- a/anaconda_lib/jedi/inference/analysis.py +++ b/anaconda_lib/jedi/inference/analysis.py @@ -3,7 +3,6 @@ """ from parso.python import tree -from jedi._compatibility import force_unicode from jedi import debug from jedi.inference.helpers import is_string @@ -27,7 +26,7 @@ } -class Error(object): +class Error: def __init__(self, name, module_path, start_pos, message=None): self.path = module_path self._start_pos = start_pos @@ -50,13 +49,10 @@ def code(self): first = self.__class__.__name__[0] return first + str(CODES[self.name][0]) - def __unicode__(self): + def __str__(self): return '%s:%s:%s: %s %s' % (self.path, self.line, self.column, self.code, self.message) - def __str__(self): - return self.__unicode__() - def __eq__(self, other): return (self.path == other.path and self.name == other.name and self._start_pos == other._start_pos) @@ -193,7 +189,7 @@ def check_hasattr(node, suite): key, lazy_value = unpacked_args[1] names = list(lazy_value.infer()) assert len(names) == 1 and is_string(names[0]) - assert force_unicode(names[0].get_safe_value()) == payload[1].value + assert names[0].get_safe_value() == payload[1].value # Check objects key, lazy_value = unpacked_args[0] diff --git a/anaconda_lib/jedi/inference/arguments.py b/anaconda_lib/jedi/inference/arguments.py old mode 100755 new mode 100644 index aa200fdb..8602f494 --- a/anaconda_lib/jedi/inference/arguments.py +++ b/anaconda_lib/jedi/inference/arguments.py @@ -1,8 +1,8 @@ import re +from itertools import zip_longest from parso.python import tree -from jedi._compatibility import zip_longest from jedi import debug from jedi.inference.utils import PushBackIterator from jedi.inference import analysis @@ -124,7 +124,7 @@ def _parse_argument_clinic(string): allow_kwargs = True -class _AbstractArgumentsMixin(object): +class _AbstractArgumentsMixin: def unpack(self, funcdef=None): raise NotImplementedError @@ -142,11 +142,8 @@ def unpack_arglist(arglist): if arglist is None: return - # Allow testlist here as well for Python2's class inheritance - # definitions. - if not (arglist.type in ('arglist', 'testlist') or ( - # in python 3.5 **arg is an argument, not arglist - arglist.type == 'argument' and arglist.children[0] in ('*', '**'))): + if arglist.type != 'arglist' and not ( + arglist.type == 'argument' and arglist.children[0] in ('*', '**')): yield 0, arglist return @@ -189,16 +186,13 @@ def unpack(self, funcdef=None): iterators = [_iterate_star_args(self.context, a, el, funcdef) for a in arrays] for values in list(zip_longest(*iterators)): - # TODO zip_longest yields None, that means this would raise - # an exception? yield None, get_merged_lazy_value( [v for v in values if v is not None] ) elif star_count == 2: arrays = self.context.infer_node(el) for dct in arrays: - for key, values in _star_star_dict(self.context, dct, el, funcdef): - yield key, values + yield from _star_star_dict(self.context, dct, el, funcdef) else: if el.type == 'argument': c = el.children @@ -221,8 +215,7 @@ def unpack(self, funcdef=None): # Reordering arguments is necessary, because star args sometimes appear # after named argument, but in the actual order it's prepended. - for named_arg in named_args: - yield named_arg + yield from named_args def _as_tree_tuple_objects(self): for star_count, argument in unpack_arglist(self.argument_node): @@ -323,8 +316,7 @@ def _iterate_star_args(context, array, input_node, funcdef=None): except AttributeError: pass else: - for lazy_value in iter_(): - yield lazy_value + yield from iter_() def _star_star_dict(context, array, input_node, funcdef): diff --git a/anaconda_lib/jedi/inference/base_value.py b/anaconda_lib/jedi/inference/base_value.py old mode 100755 new mode 100644 index e7ac4baa..31b72937 --- a/anaconda_lib/jedi/inference/base_value.py +++ b/anaconda_lib/jedi/inference/base_value.py @@ -8,10 +8,11 @@ """ from functools import reduce from operator import add +from itertools import zip_longest + from parso.python.tree import Name from jedi import debug -from jedi._compatibility import zip_longest, unicode from jedi.parser_utils import clean_scope_docstring from jedi.inference.helpers import SimpleGetItemNotFound from jedi.inference.utils import safe_property @@ -21,7 +22,11 @@ sentinel = object() -class HelperValueMixin(object): +class HasNoContext(Exception): + pass + + +class HelperValueMixin: def get_root_context(self): value = self if value.parent_context is None: @@ -32,11 +37,6 @@ def get_root_context(self): return value value = value.parent_context - @classmethod - @inference_state_as_method_param_cache() - def create_cached(cls, *args, **kwargs): - return cls(*args, **kwargs) - def execute(self, arguments): return self.inference_state.execute(self, arguments=arguments) @@ -59,14 +59,12 @@ def merge_types_of_iterate(self, contextualized_node=None, is_async=False): def _get_value_filters(self, name_or_str): origin_scope = name_or_str if isinstance(name_or_str, Name) else None - for f in self.get_filters(origin_scope=origin_scope): - yield f + yield from self.get_filters(origin_scope=origin_scope) # This covers the case where a stub files are incomplete. if self.is_stub(): from jedi.inference.gradual.conversion import convert_values for c in convert_values(ValueSet({self})): - for f in c.get_filters(): - yield f + yield from c.get_filters() def goto(self, name_or_str, name_context=None, analysis_errors=True): from jedi.inference import finder @@ -97,11 +95,14 @@ def py__getattribute__(self, name_or_str, name_context=None, position=None, return values def py__await__(self): - await_value_set = self.py__getattribute__(u"__await__") + await_value_set = self.py__getattribute__("__await__") if not await_value_set: debug.warning('Tried to run __await__ on value %s', self) return await_value_set.execute_with_values() + def py__name__(self): + return self.name.string_name + def iterate(self, contextualized_node=None, is_async=False): debug.dbg('iterate %s', self) if is_async: @@ -114,15 +115,19 @@ def iterate(self, contextualized_node=None, is_async=False): .py__getattribute__('__anext__').execute_with_values() .py__getattribute__('__await__').execute_with_values() .py__stop_iteration_returns() - ) # noqa + ) # noqa: E124 ]) return self.py__iter__(contextualized_node) def is_sub_class_of(self, class_value): - for cls in self.py__mro__(): - if cls.is_same_class(class_value): - return True - return False + with debug.increase_indent_cm('subclass matching of %s <=> %s' % (self, class_value), + color='BLUE'): + for cls in self.py__mro__(): + if cls.is_same_class(class_value): + debug.dbg('matched subclass True', color='BLUE') + return True + debug.dbg('matched subclass False', color='BLUE') + return False def is_same_class(self, class2): # Class matching should prefer comparisons that are not this function. @@ -143,17 +148,12 @@ class Value(HelperValueMixin): # Possible values: None, tuple, list, dict and set. Here to deal with these # very important containers. array_type = None + api_type = 'not_defined_please_report_bug' def __init__(self, inference_state, parent_context=None): self.inference_state = inference_state self.parent_context = parent_context - @property - def api_type(self): - # By default just lower name of the class. Can and should be - # overwritten. - return self.__class__.__name__.lower() - def py__getitem__(self, index_value_set, contextualized_node): from jedi.inference import analysis # TODO this value is probably not right. @@ -178,12 +178,18 @@ def py__iter__(self, contextualized_node=None): message="TypeError: '%s' object is not iterable" % self) return iter([]) + def py__next__(self, contextualized_node=None): + return self.py__iter__(contextualized_node) + def get_signatures(self): return [] def is_class(self): return False + def is_class_mixin(self): + return False + def is_instance(self): return False @@ -247,6 +253,9 @@ def py__get__(self, instance, class_value): debug.warning("No __get__ defined on %s", self) return ValueSet([self]) + def py__get__on_class(self, calling_instance, instance, class_value): + return NotImplemented + def get_qualified_names(self): # Returns Optional[Tuple[str, ...]] return None @@ -256,15 +265,12 @@ def is_stub(self): return self.parent_context.is_stub() def _as_context(self): - raise NotImplementedError('Not all values need to be converted to contexts: %s', self) + raise HasNoContext @property def name(self): raise NotImplementedError - def py__name__(self): - return self.name.string_name - def get_type_hint(self, add_class_info=True): return None @@ -354,14 +360,14 @@ def __repr__(self): class TreeValue(Value): def __init__(self, inference_state, parent_context, tree_node): - super(TreeValue, self).__init__(inference_state, parent_context) + super().__init__(inference_state, parent_context) self.tree_node = tree_node def __repr__(self): return '<%s: %s>' % (self.__class__.__name__, self.tree_node) -class ContextualizedNode(object): +class ContextualizedNode: def __init__(self, context, node): self.context = context self.node = node @@ -382,7 +388,7 @@ def _getitem(value, index_values, contextualized_node): unused_values = set() for index_value in index_values: index = index_value.get_safe_value(default=None) - if type(index) in (float, int, str, unicode, slice, bytes): + if type(index) in (float, int, str, slice, bytes): try: result |= value.py__simple_getitem__(index) continue @@ -403,7 +409,7 @@ def _getitem(value, index_values, contextualized_node): return result -class ValueSet(object): +class ValueSet: def __init__(self, iterable): self._set = frozenset(iterable) for value in iterable: @@ -435,8 +441,7 @@ def __and__(self, other): return self._from_frozen_set(self._set & other._set) def __iter__(self): - for element in self._set: - yield element + return iter(self._set) def __bool__(self): return bool(self._set) diff --git a/anaconda_lib/jedi/inference/cache.py b/anaconda_lib/jedi/inference/cache.py old mode 100755 new mode 100644 index bbb9a32b..8360a42a --- a/anaconda_lib/jedi/inference/cache.py +++ b/anaconda_lib/jedi/inference/cache.py @@ -3,6 +3,7 @@ default otherwise. - ``CachedMetaClass`` uses ``_memoize_default`` to do the same with classes. """ +from functools import wraps from jedi import debug @@ -77,7 +78,7 @@ class initializations. Either you do it this way or with decorators, but """ @inference_state_as_method_param_cache() def __call__(self, *args, **kwargs): - return super(CachedMetaClass, self).__call__(*args, **kwargs) + return super().__call__(*args, **kwargs) def inference_state_method_generator_cache(): @@ -86,6 +87,7 @@ def inference_state_method_generator_cache(): recursion errors and returns no further iterator elemends in that case. """ def func(function): + @wraps(function) def wrapper(obj, *args, **kwargs): cache = obj.inference_state.memoize_cache try: diff --git a/anaconda_lib/jedi/inference/compiled/__init__.py b/anaconda_lib/jedi/inference/compiled/__init__.py old mode 100755 new mode 100644 index b5d435fc..09ac19f9 --- a/anaconda_lib/jedi/inference/compiled/__init__.py +++ b/anaconda_lib/jedi/inference/compiled/__init__.py @@ -1,4 +1,6 @@ -from jedi._compatibility import unicode +# This file also re-exports symbols for wider use. We configure mypy and flake8 +# to be aware that this file does this. + from jedi.inference.compiled.value import CompiledValue, CompiledName, \ CompiledValueFilter, CompiledValueName, create_from_access_path from jedi.inference.base_value import LazyValueWrapper @@ -29,7 +31,7 @@ def __getattribute__(self, name): if name in ('get_safe_value', 'execute_operation', 'access_handle', 'negate', 'py__bool__', 'is_compiled'): return getattr(self._compiled_value, name) - return super(ExactValue, self).__getattribute__(name) + return super().__getattribute__(name) def _get_wrapped_value(self): instance, = builtin_from_name( @@ -45,7 +47,7 @@ def create_simple_object(inference_state, obj): Only allows creations of objects that are easily picklable across Python versions. """ - assert type(obj) in (int, float, str, bytes, unicode, slice, complex, bool), obj + assert type(obj) in (int, float, str, bytes, slice, complex, bool), repr(obj) compiled_value = create_from_access_path( inference_state, inference_state.compiled_subprocess.create_simple_object(obj) @@ -54,7 +56,7 @@ def create_simple_object(inference_state, obj): def get_string_value_set(inference_state): - return builtin_from_name(inference_state, u'str').execute_with_values() + return builtin_from_name(inference_state, 'str').execute_with_values() def load_module(inference_state, dotted_name, **kwargs): diff --git a/anaconda_lib/jedi/inference/compiled/access.py b/anaconda_lib/jedi/inference/compiled/access.py old mode 100755 new mode 100644 index a02b548b..91f2da08 --- a/anaconda_lib/jedi/inference/compiled/access.py +++ b/anaconda_lib/jedi/inference/compiled/access.py @@ -1,17 +1,19 @@ -from __future__ import print_function import inspect import types +import traceback import sys import operator as op from collections import namedtuple import warnings import re +import builtins +import typing +from pathlib import Path +from typing import Optional -from jedi._compatibility import unicode, is_py3, builtins, \ - py_version, force_unicode from jedi.inference.compiled.getattr_static import getattr_static -ALLOWED_GETITEM_TYPES = (str, list, tuple, unicode, bytes, bytearray, dict) +ALLOWED_GETITEM_TYPES = (str, list, tuple, bytes, bytearray, dict) MethodDescriptorType = type(str.replace) # These are not considered classes and access is granted even though they have @@ -28,17 +30,12 @@ types.MethodType, types.ModuleType, types.TracebackType, - MethodDescriptorType + MethodDescriptorType, + types.MappingProxyType, + types.SimpleNamespace, + types.DynamicClassAttribute, ) -if is_py3: - NOT_CLASS_TYPES += ( - types.MappingProxyType, - types.SimpleNamespace, - types.DynamicClassAttribute, - ) - - # Those types don't exist in typing. MethodDescriptorType = type(str.replace) WrapperDescriptorType = type(set.__iter__) @@ -123,13 +120,18 @@ def load_module(inference_state, dotted_name, sys_path): __import__(dotted_name) except ImportError: # If a module is "corrupt" or not really a Python module or whatever. - print('Module %s not importable in path %s.' % (dotted_name, sys_path), file=sys.stderr) + warnings.warn( + "Module %s not importable in path %s." % (dotted_name, sys_path), + UserWarning, + stacklevel=2, + ) return None except Exception: # Since __import__ pretty much makes code execution possible, just # catch any error here and print it. - import traceback - print("Cannot import:\n%s" % traceback.format_exc(), file=sys.stderr) + warnings.warn( + "Cannot import:\n%s" % traceback.format_exc(), UserWarning, stacklevel=2 + ) return None finally: sys.path = temp @@ -140,42 +142,29 @@ def load_module(inference_state, dotted_name, sys_path): return create_access_path(inference_state, module) -class AccessPath(object): +class AccessPath: def __init__(self, accesses): self.accesses = accesses - # Writing both of these methods here looks a bit ridiculous. However with - # the differences of Python 2/3 it's actually necessary, because we will - # otherwise have a accesses attribute that is bytes instead of unicode. - def __getstate__(self): - return self.accesses - - def __setstate__(self, value): - self.accesses = value - def create_access_path(inference_state, obj): access = create_access(inference_state, obj) return AccessPath(access.get_access_path_tuples()) -def _force_unicode_decorator(func): - return lambda *args, **kwargs: force_unicode(func(*args, **kwargs)) - - def get_api_type(obj): if inspect.isclass(obj): - return u'class' + return 'class' elif inspect.ismodule(obj): - return u'module' + return 'module' elif inspect.isbuiltin(obj) or inspect.ismethod(obj) \ or inspect.ismethoddescriptor(obj) or inspect.isfunction(obj): - return u'function' + return 'function' # Everything else... - return u'instance' + return 'instance' -class DirectObjectAccess(object): +class DirectObjectAccess: def __init__(self, inference_state, obj): self._inference_state = inference_state self._obj = obj @@ -192,14 +181,14 @@ def _create_access_path(self, obj): def py__bool__(self): return bool(self._obj) - def py__file__(self): + def py__file__(self) -> Optional[Path]: try: - return self._obj.__file__ + return Path(self._obj.__file__) except AttributeError: return None def py__doc__(self): - return force_unicode(inspect.getdoc(self._obj)) or u'' + return inspect.getdoc(self._obj) or '' def py__name__(self): if not _is_class_instance(self._obj) or \ @@ -214,7 +203,7 @@ def py__name__(self): return None try: - return force_unicode(cls.__name__) + return cls.__name__ except AttributeError: return None @@ -224,7 +213,22 @@ def py__mro__accesses(self): def py__getitem__all_values(self): if isinstance(self._obj, dict): return [self._create_access_path(v) for v in self._obj.values()] - return self.py__iter__list() + if isinstance(self._obj, (list, tuple)): + return [self._create_access_path(v) for v in self._obj] + + if self.is_instance(): + cls = DirectObjectAccess(self._inference_state, self._obj.__class__) + return cls.py__getitem__all_values() + + try: + getitem = self._obj.__getitem__ + except AttributeError: + pass + else: + annotation = DirectObjectAccess(self._inference_state, getitem).get_return_annotation() + if annotation is not None: + return [annotation] + return None def py__simple_getitem__(self, index): if type(self._obj) not in ALLOWED_GETITEM_TYPES: @@ -234,8 +238,14 @@ def py__simple_getitem__(self, index): return self._create_access_path(self._obj[index]) def py__iter__list(self): - if not hasattr(self._obj, '__getitem__'): + try: + iter_method = self._obj.__iter__ + except AttributeError: return None + else: + p = DirectObjectAccess(self._inference_state, iter_method).get_return_annotation() + if p is not None: + return [p] if type(self._obj) not in ALLOWED_GETITEM_TYPES: # Get rid of side effects, we won't call custom `__getitem__`s. @@ -260,26 +270,23 @@ def py__path__(self): # Avoid some weird hacks that would just fail, because they cannot be # used by pickle. if not isinstance(paths, list) \ - or not all(isinstance(p, (bytes, unicode)) for p in paths): + or not all(isinstance(p, str) for p in paths): return None return paths - @_force_unicode_decorator @shorten_repr def get_repr(self): - builtins = 'builtins', '__builtin__' - if inspect.ismodule(self._obj): return repr(self._obj) # Try to avoid execution of the property. - if safe_getattr(self._obj, '__module__', default='') in builtins: + if safe_getattr(self._obj, '__module__', default='') == 'builtins': return repr(self._obj) type_ = type(self._obj) if type_ == type: return type.__repr__(self._obj) - if safe_getattr(type_, '__module__', default='') in builtins: + if safe_getattr(type_, '__module__', default='') == 'builtins': # Allow direct execution of repr for builtins. return repr(self._obj) return object.__repr__(self._obj) @@ -310,10 +317,10 @@ def try_to_get_name(obj): name = try_to_get_name(type(self._obj)) if name is None: return () - return tuple(force_unicode(n) for n in name.split('.')) + return tuple(name.split('.')) def dir(self): - return list(map(force_unicode, dir(self._obj))) + return dir(self._obj) def has_iter(self): try: @@ -322,9 +329,9 @@ def has_iter(self): except TypeError: return False - def is_allowed_getattr(self, name, unsafe=False): + def is_allowed_getattr(self, name, safe=True): # TODO this API is ugly. - if unsafe: + if not safe: # Unsafe is mostly used to check for __getattr__/__getattribute__. # getattr_static works for properties, but the underscore methods # are just ignored (because it's safer and avoids more code @@ -377,7 +384,7 @@ def getattr_paths(self, name, default=_sentinel): except AttributeError: pass else: - if module is not None: + if module is not None and isinstance(module, str): try: __import__(module) # For some modules like _sqlite3, the __module__ for classes is @@ -396,7 +403,7 @@ def getattr_paths(self, name, default=_sentinel): return [self._create_access(module), access] def get_safe_value(self): - if type(self._obj) in (bool, bytes, float, int, str, unicode, slice) or self._obj is None: + if type(self._obj) in (bool, bytes, float, int, str, slice) or self._obj is None: return self._obj raise ValueError("Object is type %s and not simple" % type(self._obj)) @@ -464,9 +471,6 @@ def get_annotation_name_and_args(self): """ Returns Tuple[Optional[str], Tuple[AccessPath, ...]] """ - if sys.version_info < (3, 5): - return None, () - name = None args = () if safe_getattr(self._obj, '__module__', default='') == 'typing': @@ -485,8 +489,6 @@ def needs_type_completions(self): return inspect.isclass(self._obj) and self._obj != type def _annotation_to_str(self, annotation): - if py_version < 30: - return '' return inspect.formatannotation(annotation) def get_signature_params(self): @@ -505,8 +507,6 @@ def get_signature_params(self): def _get_signature(self): obj = self._obj - if py_version < 33: - raise ValueError("inspect.signature was introduced in 3.3") try: return inspect.signature(obj) except (RuntimeError, TypeError): @@ -525,15 +525,9 @@ def get_return_annotation(self): return None try: - # Python 2 doesn't have typing. - import typing - except ImportError: + o = typing.get_type_hints(self._obj).get('return') + except Exception: pass - else: - try: - o = typing.get_type_hints(self._obj).get('return') - except Exception: - pass return self._create_access_path(o) @@ -546,7 +540,7 @@ def get_dir_infos(self): objects of an objects """ tuples = dict( - (force_unicode(name), self.is_allowed_getattr(name)) + (name, self.is_allowed_getattr(name)) for name in self.dir() ) return self.needs_type_completions(), tuples diff --git a/anaconda_lib/jedi/inference/compiled/getattr_static.py b/anaconda_lib/jedi/inference/compiled/getattr_static.py old mode 100755 new mode 100644 index 7225aabd..03c199ef --- a/anaconda_lib/jedi/inference/compiled/getattr_static.py +++ b/anaconda_lib/jedi/inference/compiled/getattr_static.py @@ -7,7 +7,6 @@ import types from jedi import debug -from jedi._compatibility import py_version _sentinel = object() @@ -39,7 +38,7 @@ def _is_type(obj): return True -def _shadowed_dict_newstyle(klass): +def _shadowed_dict(klass): dict_attr = type.__dict__["__dict__"] for entry in _static_getmro(klass): try: @@ -54,7 +53,7 @@ def _shadowed_dict_newstyle(klass): return _sentinel -def _static_getmro_newstyle(klass): +def _static_getmro(klass): mro = type.__dict__['__mro__'].__get__(klass) if not isinstance(mro, (tuple, list)): # There are unfortunately no tests for this, I was not able to @@ -65,70 +64,8 @@ def _static_getmro_newstyle(klass): return mro -if py_version >= 30: - _shadowed_dict = _shadowed_dict_newstyle - _get_type = type - _static_getmro = _static_getmro_newstyle -else: - def _shadowed_dict(klass): - """ - In Python 2 __dict__ is not overwritable: - - class Foo(object): pass - setattr(Foo, '__dict__', 4) - - Traceback (most recent call last): - File "", line 1, in - TypeError: __dict__ must be a dictionary object - - It applies to both newstyle and oldstyle classes: - - class Foo(object): pass - setattr(Foo, '__dict__', 4) - Traceback (most recent call last): - File "", line 1, in - AttributeError: attribute '__dict__' of 'type' objects is not writable - - It also applies to instances of those objects. However to keep things - straight forward, newstyle classes always use the complicated way of - accessing it while oldstyle classes just use getattr. - """ - if type(klass) is _oldstyle_class_type: - return getattr(klass, '__dict__', _sentinel) - return _shadowed_dict_newstyle(klass) - - class _OldStyleClass: - pass - - _oldstyle_instance_type = type(_OldStyleClass()) - _oldstyle_class_type = type(_OldStyleClass) - - def _get_type(obj): - type_ = object.__getattribute__(obj, '__class__') - if type_ is _oldstyle_instance_type: - # Somehow for old style classes we need to access it directly. - return obj.__class__ - return type_ - - def _static_getmro(klass): - if type(klass) is _oldstyle_class_type: - def oldstyle_mro(klass): - """ - Oldstyle mro is a really simplistic way of look up mro: - https://stackoverflow.com/questions/54867/what-is-the-difference-between-old-style-and-new-style-classes-in-python - """ - yield klass - for base in klass.__bases__: - for yield_from in oldstyle_mro(base): - yield yield_from - - return oldstyle_mro(klass) - - return _static_getmro_newstyle(klass) - - def _safe_hasattr(obj, name): - return _check_class(_get_type(obj), name) is not _sentinel + return _check_class(type(obj), name) is not _sentinel def _safe_is_data_descriptor(obj): @@ -151,7 +88,7 @@ def getattr_static(obj, attr, default=_sentinel): """ instance_result = _sentinel if not _is_type(obj): - klass = _get_type(obj) + klass = type(obj) dict_attr = _shadowed_dict(klass) if (dict_attr is _sentinel or type(dict_attr) is types.MemberDescriptorType): instance_result = _check_instance(obj, attr) diff --git a/anaconda_lib/jedi/inference/compiled/mixed.py b/anaconda_lib/jedi/inference/compiled/mixed.py old mode 100755 new mode 100644 index 98959fd8..b323d70e --- a/anaconda_lib/jedi/inference/compiled/mixed.py +++ b/anaconda_lib/jedi/inference/compiled/mixed.py @@ -3,12 +3,10 @@ """ import inspect -import os -import sys +from pathlib import Path from jedi.parser_utils import get_cached_code_lines -from jedi._compatibility import unwrap from jedi import settings from jedi.cache import memoize_method from jedi.inference import compiled @@ -44,7 +42,7 @@ class MixedObject(ValueWrapper): to modify the runtime. """ def __init__(self, compiled_value, tree_value): - super(MixedObject, self).__init__(tree_value) + super().__init__(tree_value) self.compiled_value = compiled_value self.access_handle = compiled_value.access_handle @@ -71,12 +69,22 @@ def get_safe_value(self, default=_sentinel): else: return self.compiled_value.get_safe_value(default) + @property + def array_type(self): + return self.compiled_value.array_type + + def get_key_values(self): + return self.compiled_value.get_key_values() + def py__simple_getitem__(self, index): python_object = self.compiled_value.access_handle.access._obj if type(python_object) in ALLOWED_GETITEM_TYPES: return self.compiled_value.py__simple_getitem__(index) return self._wrapped_value.py__simple_getitem__(index) + def negate(self): + return self.compiled_value.negate() + def _as_context(self): if self.parent_context is None: return MixedModuleContext(self) @@ -105,7 +113,7 @@ class MixedName(NameWrapper): The ``CompiledName._compiled_value`` is our MixedObject. """ def __init__(self, wrapped_name, parent_tree_value): - super(MixedName, self).__init__(wrapped_name) + super().__init__(wrapped_name) self._parent_tree_value = parent_tree_value @property @@ -131,12 +139,12 @@ def infer(self): class MixedObjectFilter(compiled.CompiledValueFilter): def __init__(self, inference_state, compiled_value, tree_value): - super(MixedObjectFilter, self).__init__(inference_state, compiled_value) + super().__init__(inference_state, compiled_value) self._tree_value = tree_value def _create_name(self, name): return MixedName( - super(MixedObjectFilter, self)._create_name(name), + super()._create_name(name), self._tree_value, ) @@ -153,12 +161,11 @@ def _load_module(inference_state, path): def _get_object_to_check(python_object): """Check if inspect.getfile has a chance to find the source.""" - if sys.version_info[0] > 2: - try: - python_object = unwrap(python_object) - except ValueError: - # Can return a ValueError when it wraps around - pass + try: + python_object = inspect.unwrap(python_object) + except ValueError: + # Can return a ValueError when it wraps around + pass if (inspect.ismodule(python_object) or inspect.isclass(python_object) @@ -180,11 +187,19 @@ def _find_syntax_node_name(inference_state, python_object): try: python_object = _get_object_to_check(python_object) path = inspect.getsourcefile(python_object) - except TypeError: + except (OSError, TypeError): # The type might not be known (e.g. class_with_dict.__weakref__) return None - if path is None or not os.path.exists(path): - # The path might not exist or be e.g. . + path = None if path is None else Path(path) + try: + if path is None or not path.exists(): + # The path might not exist or be e.g. . + return None + except OSError: + # Might raise an OSError on Windows: + # + # [WinError 123] The filename, directory name, or volume label + # syntax is incorrect: '' return None file_io = FileIO(path) diff --git a/anaconda_lib/jedi/inference/compiled/subprocess/__init__.py b/anaconda_lib/jedi/inference/compiled/subprocess/__init__.py old mode 100755 new mode 100644 index d921e1bd..cd5fe74c --- a/anaconda_lib/jedi/inference/compiled/subprocess/__init__.py +++ b/anaconda_lib/jedi/inference/compiled/subprocess/__init__.py @@ -7,21 +7,17 @@ 2. Make it possible to handle different Python versions as well as virtualenvs. """ +import collections import os import sys +import queue import subprocess -import socket -import errno import traceback +import weakref from functools import partial from threading import Thread -try: - from queue import Queue, Empty -except ImportError: - from Queue import Queue, Empty # python 2.7 -from jedi._compatibility import queue, is_py3, force_unicode, \ - pickle_dump, pickle_load, GeneralizedPopen, weakref +from jedi._compatibility import pickle_dump, pickle_load from jedi import debug from jedi.cache import memoize_method from jedi.inference.compiled.subprocess import functions @@ -31,11 +27,27 @@ _MAIN_PATH = os.path.join(os.path.dirname(__file__), '__main__.py') +PICKLE_PROTOCOL = 4 -def _enqueue_output(out, queue): +def _GeneralizedPopen(*args, **kwargs): + if os.name == 'nt': + try: + # Was introduced in Python 3.7. + CREATE_NO_WINDOW = subprocess.CREATE_NO_WINDOW + except AttributeError: + CREATE_NO_WINDOW = 0x08000000 + kwargs['creationflags'] = CREATE_NO_WINDOW + # The child process doesn't need file descriptors except 0, 1, 2. + # This is unix only. + kwargs['close_fds'] = 'posix' in sys.builtin_module_names + + return subprocess.Popen(*args, **kwargs) + + +def _enqueue_output(out, queue_): for line in iter(out.readline, b''): - queue.put(line) + queue_.put(line) def _add_stderr_to_debug(stderr_queue): @@ -46,7 +58,7 @@ def _add_stderr_to_debug(stderr_queue): line = stderr_queue.get_nowait() line = line.decode('utf-8', 'replace') debug.warning('stderr output: %s' % line.rstrip('\n')) - except Empty: + except queue.Empty: break @@ -70,7 +82,7 @@ def _cleanup_process(process, thread): pass -class _InferenceStateProcess(object): +class _InferenceStateProcess: def __init__(self, inference_state): self._inference_state_weakref = weakref.ref(inference_state) self._inference_state_id = id(inference_state) @@ -105,7 +117,7 @@ def __getattr__(self, name): class InferenceStateSubprocess(_InferenceStateProcess): def __init__(self, inference_state, compiled_subprocess): - super(InferenceStateSubprocess, self).__init__(inference_state) + super().__init__(inference_state) self._used = False self._compiled_subprocess = compiled_subprocess @@ -151,22 +163,20 @@ def __del__(self): self._compiled_subprocess.delete_inference_state(self._inference_state_id) -class CompiledSubprocess(object): +class CompiledSubprocess: is_crashed = False - # Start with 2, gets set after _get_info. - _pickle_protocol = 2 - def __init__(self, executable): + def __init__(self, executable, env_vars=None): self._executable = executable - self._inference_state_deletion_queue = queue.deque() + self._env_vars = env_vars + self._inference_state_deletion_queue = collections.deque() self._cleanup_callable = lambda: None def __repr__(self): pid = os.getpid() - return '<%s _executable=%r, _pickle_protocol=%r, is_crashed=%r, pid=%r>' % ( + return '<%s _executable=%r, is_crashed=%r, pid=%r>' % ( self.__class__.__name__, self._executable, - self._pickle_protocol, self.is_crashed, pid, ) @@ -181,26 +191,14 @@ def _get_process(self): os.path.dirname(os.path.dirname(parso_path)), '.'.join(str(x) for x in sys.version_info[:3]), ) - # Use explicit envionment to ensure reliable results (#1540) - env = {} - if os.name == 'nt': - # if SYSTEMROOT (or case variant) exists in environment, - # ensure it goes to subprocess - for k, v in os.environ.items(): - if 'SYSTEMROOT' == k.upper(): - env.update({k: os.environ[k]}) - break # don't risk multiple entries - process = GeneralizedPopen( + process = _GeneralizedPopen( args, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, - # Use system default buffering on Python 2 to improve performance - # (this is already the case on Python 3). - bufsize=-1, - env=env + env=self._env_vars ) - self._stderr_queue = Queue() + self._stderr_queue = queue.Queue() self._stderr_thread = t = Thread( target=_enqueue_output, args=(process.stderr, self._stderr_queue) @@ -239,20 +237,10 @@ def _send(self, inference_state_id, function, args=(), kwargs={}): if self.is_crashed: raise InternalError("The subprocess %s has crashed." % self._executable) - if not is_py3: - # Python 2 compatibility - kwargs = {force_unicode(key): value for key, value in kwargs.items()} - data = inference_state_id, function, args, kwargs try: - pickle_dump(data, self._get_process().stdin, self._pickle_protocol) - except (socket.error, IOError) as e: - # Once Python2 will be removed we can just use `BrokenPipeError`. - # Also, somehow in windows it returns EINVAL instead of EPIPE if - # the subprocess dies. - if e.errno not in (errno.EPIPE, errno.EINVAL): - # Not a broken pipe - raise + pickle_dump(data, self._get_process().stdin, PICKLE_PROTOCOL) + except BrokenPipeError: self._kill() raise InternalError("The subprocess %s was killed. Maybe out of memory?" % self._executable) @@ -293,13 +281,12 @@ def delete_inference_state(self, inference_state_id): self._inference_state_deletion_queue.append(inference_state_id) -class Listener(object): - def __init__(self, pickle_protocol): +class Listener: + def __init__(self): self._inference_states = {} # TODO refactor so we don't need to process anymore just handle # controlling. self._process = _InferenceStateProcess(Listener) - self._pickle_protocol = pickle_protocol def _get_inference_state(self, function, inference_state_id): from jedi.inference import InferenceState @@ -342,15 +329,8 @@ def listen(self): # because stdout is used for IPC. sys.stdout = open(os.devnull, 'w') stdin = sys.stdin - if sys.version_info[0] > 2: - stdout = stdout.buffer - stdin = stdin.buffer - # Python 2 opens streams in text mode on Windows. Set stdout and stdin - # to binary mode. - elif sys.platform == 'win32': - import msvcrt - msvcrt.setmode(stdout.fileno(), os.O_BINARY) - msvcrt.setmode(stdin.fileno(), os.O_BINARY) + stdout = stdout.buffer + stdin = stdin.buffer while True: try: @@ -364,10 +344,10 @@ def listen(self): except Exception as e: result = True, traceback.format_exc(), e - pickle_dump(result, stdout, self._pickle_protocol) + pickle_dump(result, stdout, PICKLE_PROTOCOL) -class AccessHandle(object): +class AccessHandle: def __init__(self, subprocess, access, id_): self.access = access self._subprocess = subprocess @@ -393,9 +373,8 @@ def __getattr__(self, name): if name in ('id', 'access') or name.startswith('_'): raise AttributeError("Something went wrong with unpickling") - # if not is_py3: print >> sys.stderr, name # print('getattr', name, file=sys.stderr) - return partial(self._workaround, force_unicode(name)) + return partial(self._workaround, name) def _workaround(self, name, *args, **kwargs): """ diff --git a/anaconda_lib/jedi/inference/compiled/subprocess/__main__.py b/anaconda_lib/jedi/inference/compiled/subprocess/__main__.py old mode 100755 new mode 100644 index 5e92229f..e1554334 --- a/anaconda_lib/jedi/inference/compiled/subprocess/__main__.py +++ b/anaconda_lib/jedi/inference/compiled/subprocess/__main__.py @@ -1,5 +1,11 @@ import os import sys +from importlib.abc import MetaPathFinder +from importlib.machinery import PathFinder + +# Remove the first entry, because it's simply a directory entry that equals +# this directory. +del sys.path[0] def _get_paths(): @@ -11,45 +17,24 @@ def _get_paths(): return {'jedi': _jedi_path, 'parso': _parso_path} -# Remove the first entry, because it's simply a directory entry that equals -# this directory. -del sys.path[0] - -if sys.version_info > (3, 4): - from importlib.machinery import PathFinder - - class _ExactImporter(object): - def __init__(self, path_dct): - self._path_dct = path_dct - - def find_module(self, fullname, path=None): - if path is None and fullname in self._path_dct: - p = self._path_dct[fullname] - loader = PathFinder.find_module(fullname, path=[p]) - return loader - return None - - # Try to import jedi/parso. - sys.meta_path.insert(0, _ExactImporter(_get_paths())) - from jedi.inference.compiled import subprocess # NOQA - sys.meta_path.pop(0) -else: - import imp - - def load(name): - paths = list(_get_paths().values()) - fp, pathname, description = imp.find_module(name, paths) - return imp.load_module(name, fp, pathname, description) +class _ExactImporter(MetaPathFinder): + def __init__(self, path_dct): + self._path_dct = path_dct - load('parso') - load('jedi') - from jedi.inference.compiled import subprocess # NOQA + def find_module(self, fullname, path=None): + if path is None and fullname in self._path_dct: + p = self._path_dct[fullname] + loader = PathFinder.find_module(fullname, path=[p]) + return loader + return None -from jedi._compatibility import highest_pickle_protocol # noqa: E402 +# Try to import jedi/parso. +sys.meta_path.insert(0, _ExactImporter(_get_paths())) +from jedi.inference.compiled import subprocess # noqa: E402 +sys.meta_path.pop(0) # Retrieve the pickle protocol. host_sys_version = [int(x) for x in sys.argv[2].split('.')] -pickle_protocol = highest_pickle_protocol([sys.version_info, host_sys_version]) # And finally start the client. -subprocess.Listener(pickle_protocol=pickle_protocol).listen() +subprocess.Listener().listen() diff --git a/anaconda_lib/jedi/inference/compiled/subprocess/functions.py b/anaconda_lib/jedi/inference/compiled/subprocess/functions.py old mode 100755 new mode 100644 index 86b5287b..5070c664 --- a/anaconda_lib/jedi/inference/compiled/subprocess/functions.py +++ b/anaconda_lib/jedi/inference/compiled/subprocess/functions.py @@ -1,18 +1,21 @@ -from __future__ import print_function import sys import os -import re import inspect +import importlib +import warnings +from pathlib import Path +from zipfile import ZipFile +from zipimport import zipimporter, ZipImportError +from importlib.machinery import all_suffixes -from jedi._compatibility import find_module, cast_path, force_unicode, \ - all_suffixes, scandir from jedi.inference.compiled import access from jedi import debug from jedi import parser_utils +from jedi.file_io import KnownContentFileIO, ZipFileIO def get_sys_path(): - return list(map(cast_path, sys.path)) + return sys.path def load_module(inference_state, **kwargs): @@ -35,7 +38,7 @@ def get_module_info(inference_state, sys_path=None, full_name=None, **kwargs): if sys_path is not None: sys.path, temp = sys_path, sys.path try: - return find_module(full_name=full_name, **kwargs) + return _find_module(full_name=full_name, **kwargs) except ImportError: return None, None finally: @@ -44,7 +47,7 @@ def get_module_info(inference_state, sys_path=None, full_name=None, **kwargs): def get_builtin_module_names(inference_state): - return list(map(force_unicode, sys.builtin_module_names)) + return sys.builtin_module_names def _test_raise_error(inference_state, exception_type): @@ -90,19 +93,25 @@ def _iter_module_names(inference_state, paths): # Python modules/packages for path in paths: try: - dirs = scandir(path) + dir_entries = ((entry.name, entry.is_dir()) for entry in os.scandir(path)) except OSError: - # The file might not exist or reading it might lead to an error. - debug.warning("Not possible to list directory: %s", path) - continue - for dir_entry in dirs: - name = dir_entry.name + try: + zip_import_info = zipimporter(path) + # Unfortunately, there is no public way to access zipimporter's + # private _files member. We therefore have to use a + # custom function to iterate over the files. + dir_entries = _zip_list_subdirectory( + zip_import_info.archive, zip_import_info.prefix) + except ZipImportError: + # The file might not exist or reading it might lead to an error. + debug.warning("Not possible to list directory: %s", path) + continue + for name, is_dir in dir_entries: # First Namespaces then modules/stubs - if dir_entry.is_dir(): - # pycache is obviously not an interestin namespace. Also the + if is_dir: + # pycache is obviously not an interesting namespace. Also the # name must be a valid identifier. - # TODO use str.isidentifier, once Python 2 is removed - if name != '__pycache__' and not re.search(r'\W|^\d', name): + if name != '__pycache__' and name.isidentifier(): yield name else: if name.endswith('.pyi'): # Stub files @@ -113,3 +122,134 @@ def _iter_module_names(inference_state, paths): if modname and '.' not in modname: if modname != '__init__': yield modname + + +def _find_module(string, path=None, full_name=None, is_global_search=True): + """ + Provides information about a module. + + This function isolates the differences in importing libraries introduced with + python 3.3 on; it gets a module name and optionally a path. It will return a + tuple containin an open file for the module (if not builtin), the filename + or the name of the module if it is a builtin one and a boolean indicating + if the module is contained in a package. + """ + spec = None + loader = None + + for finder in sys.meta_path: + if is_global_search and finder != importlib.machinery.PathFinder: + p = None + else: + p = path + try: + find_spec = finder.find_spec + except AttributeError: + # These are old-school clases that still have a different API, just + # ignore those. + continue + + spec = find_spec(string, p) + if spec is not None: + loader = spec.loader + if loader is None and not spec.has_location: + # This is a namespace package. + full_name = string if not path else full_name + implicit_ns_info = ImplicitNSInfo(full_name, spec.submodule_search_locations._path) + return implicit_ns_info, True + break + + return _find_module_py33(string, path, loader) + + +def _find_module_py33(string, path=None, loader=None, full_name=None, is_global_search=True): + loader = loader or importlib.machinery.PathFinder.find_module(string, path) + + if loader is None and path is None: # Fallback to find builtins + try: + with warnings.catch_warnings(record=True): + # Mute "DeprecationWarning: Use importlib.util.find_spec() + # instead." While we should replace that in the future, it's + # probably good to wait until we deprecate Python 3.3, since + # it was added in Python 3.4 and find_loader hasn't been + # removed in 3.6. + loader = importlib.find_loader(string) + except ValueError as e: + # See #491. Importlib might raise a ValueError, to avoid this, we + # just raise an ImportError to fix the issue. + raise ImportError("Originally " + repr(e)) + + if loader is None: + raise ImportError("Couldn't find a loader for {}".format(string)) + + return _from_loader(loader, string) + + +def _from_loader(loader, string): + try: + is_package_method = loader.is_package + except AttributeError: + is_package = False + else: + is_package = is_package_method(string) + try: + get_filename = loader.get_filename + except AttributeError: + return None, is_package + else: + module_path = get_filename(string) + + # To avoid unicode and read bytes, "overwrite" loader.get_source if + # possible. + try: + f = type(loader).get_source + except AttributeError: + raise ImportError("get_source was not defined on loader") + + if f is not importlib.machinery.SourceFileLoader.get_source: + # Unfortunately we are reading unicode here, not bytes. + # It seems hard to get bytes, because the zip importer + # logic just unpacks the zip file and returns a file descriptor + # that we cannot as easily access. Therefore we just read it as + # a string in the cases where get_source was overwritten. + code = loader.get_source(string) + else: + code = _get_source(loader, string) + + if code is None: + return None, is_package + if isinstance(loader, zipimporter): + return ZipFileIO(module_path, code, Path(loader.archive)), is_package + + return KnownContentFileIO(module_path, code), is_package + + +def _get_source(loader, fullname): + """ + This method is here as a replacement for SourceLoader.get_source. That + method returns unicode, but we prefer bytes. + """ + path = loader.get_filename(fullname) + try: + return loader.get_data(path) + except OSError: + raise ImportError('source not available through get_data()', + name=fullname) + + +def _zip_list_subdirectory(zip_path, zip_subdir_path): + zip_file = ZipFile(zip_path) + zip_subdir_path = Path(zip_subdir_path) + zip_content_file_paths = zip_file.namelist() + for raw_file_name in zip_content_file_paths: + file_path = Path(raw_file_name) + if file_path.parent == zip_subdir_path: + file_path = file_path.relative_to(zip_subdir_path) + yield file_path.name, raw_file_name.endswith("/") + + +class ImplicitNSInfo: + """Stores information returned from an implicit namespace spec""" + def __init__(self, name, paths): + self.name = name + self.paths = paths diff --git a/anaconda_lib/jedi/inference/compiled/value.py b/anaconda_lib/jedi/inference/compiled/value.py old mode 100755 new mode 100644 index 61b134ad..baad4d63 --- a/anaconda_lib/jedi/inference/compiled/value.py +++ b/anaconda_lib/jedi/inference/compiled/value.py @@ -3,10 +3,12 @@ """ import re from functools import partial +from inspect import Parameter +from pathlib import Path +from typing import Optional from jedi import debug from jedi.inference.utils import to_list -from jedi._compatibility import force_unicode, Parameter, cast_path from jedi.cache import memoize_method from jedi.inference.filters import AbstractFilter from jedi.inference.names import AbstractNameDefinition, ValueNameMixin, \ @@ -20,7 +22,7 @@ from jedi.inference.context import CompiledContext, CompiledModuleContext -class CheckAttribute(object): +class CheckAttribute: """Raises :exc:`AttributeError` if the attribute X is not available.""" def __init__(self, check_name=None): # Remove the py in front of e.g. py__call__. @@ -29,7 +31,7 @@ def __init__(self, check_name=None): def __call__(self, func): self.func = func if self.check_name is None: - self.check_name = force_unicode(func.__name__[2:]) + self.check_name = func.__name__[2:] return self def __get__(self, instance, owner): @@ -43,7 +45,7 @@ def __get__(self, instance, owner): class CompiledValue(Value): def __init__(self, inference_state, access_handle, parent_context=None): - super(CompiledValue, self).__init__(inference_state, parent_context) + super().__init__(inference_state, parent_context) self.access_handle = access_handle def py__call__(self, arguments): @@ -56,9 +58,9 @@ def py__call__(self, arguments): ).execute_annotation() try: - self.access_handle.getattr_paths(u'__call__') + self.access_handle.getattr_paths('__call__') except AttributeError: - return super(CompiledValue, self).py__call__(arguments) + return super().py__call__(arguments) else: if self.access_handle.is_class(): from jedi.inference.value import CompiledInstance @@ -163,9 +165,9 @@ def py__simple_getitem__(self, index): try: access = self.access_handle.py__simple_getitem__(index) except AttributeError: - return super(CompiledValue, self).py__simple_getitem__(index) + return super().py__simple_getitem__(index) if access is None: - return NO_VALUES + return super().py__simple_getitem__(index) return ValueSet([create_from_access_path(self.inference_state, access)]) @@ -174,20 +176,15 @@ def py__getitem__(self, index_value_set, contextualized_node): if all_access_paths is None: # This means basically that no __getitem__ has been defined on this # object. - return super(CompiledValue, self).py__getitem__(index_value_set, contextualized_node) + return super().py__getitem__(index_value_set, contextualized_node) return ValueSet( create_from_access_path(self.inference_state, access) for access in all_access_paths ) def py__iter__(self, contextualized_node=None): - # Python iterators are a bit strange, because there's no need for - # the __iter__ function as long as __getitem__ is defined (it will - # just start with __getitem__(0). This is especially true for - # Python 2 strings, where `str.__iter__` is not even defined. if not self.access_handle.has_iter(): - for x in super(CompiledValue, self).py__iter__(contextualized_node): - yield x + yield from super().py__iter__(contextualized_node) access_path_list = self.access_handle.py__iter__list() if access_path_list is None: @@ -222,10 +219,8 @@ def _execute_function(self, params): continue else: bltn_obj = builtin_from_name(self.inference_state, name) - for result in self.inference_state.execute(bltn_obj, params): - yield result - for type_ in docstrings.infer_return_types(self): - yield type_ + yield from self.inference_state.execute(bltn_obj, params) + yield from docstrings.infer_return_types(self) def get_safe_value(self, default=_sentinel): try: @@ -264,7 +259,7 @@ def execute_annotation(self): v.with_generics(arguments) for v in self.inference_state.typing_module.py__getattribute__(name) ]).execute_annotation() - return super(CompiledValue, self).execute_annotation() + return super().execute_annotation() def negate(self): return create_from_access_path(self.inference_state, self.access_handle.negate()) @@ -298,10 +293,7 @@ def _as_context(self): return CompiledModuleContext(self) def py__path__(self): - paths = self.access_handle.py__path__() - if paths is None: - return None - return map(cast_path, paths) + return self.access_handle.py__path__() def is_package(self): return self.py__path__() is not None @@ -314,8 +306,8 @@ def string_names(self): return () return tuple(name.split('.')) - def py__file__(self): - return cast_path(self.access_handle.py__file__()) + def py__file__(self) -> Optional[Path]: + return self.access_handle.py__file__() # type: ignore[no-any-return] class CompiledName(AbstractNameDefinition): @@ -326,8 +318,7 @@ def __init__(self, inference_state, parent_value, name): self.string_name = name def py__doc__(self): - value, = self.infer() - return value.py__doc__() + return self.infer_compiled_value().py__doc__() def _get_qualified_names(self): parent_qualified_names = self.parent_context.get_qualified_names() @@ -351,16 +342,12 @@ def __repr__(self): @property def api_type(self): - api = self.infer() - # If we can't find the type, assume it is an instance variable - if not api: - return "instance" - return next(iter(api)).api_type + return self.infer_compiled_value().api_type - @memoize_method def infer(self): return ValueSet([self.infer_compiled_value()]) + @memoize_method def infer_compiled_value(self): return create_from_name(self._inference_state, self._parent_value, self.string_name) @@ -447,7 +434,7 @@ def get(self, name): access_handle = self.compiled_value.access_handle return self._get( name, - lambda name, unsafe: access_handle.is_allowed_getattr(name, unsafe), + lambda name, safe: access_handle.is_allowed_getattr(name, safe=safe), lambda name: name in access_handle.dir(), check_has_attribute=True ) @@ -456,15 +443,12 @@ def _get(self, name, allowed_getattr_callback, in_dir_callback, check_has_attrib """ To remove quite a few access calls we introduced the callback here. """ - # Always use unicode objects in Python 2 from here. - name = force_unicode(name) - if self._inference_state.allow_descriptor_getattr: pass has_attribute, is_descriptor = allowed_getattr_callback( name, - unsafe=self._inference_state.allow_descriptor_getattr + safe=not self._inference_state.allow_descriptor_getattr ) if check_has_attribute and not has_attribute: return [] @@ -488,7 +472,7 @@ def values(self): from jedi.inference.compiled import builtin_from_name names = [] needs_type_completions, dir_infos = self.compiled_value.access_handle.get_dir_infos() - # We could use `unsafe` here as well, especially as a parameter to + # We could use `safe=False` here as well, especially as a parameter to # get_dir_infos. But this would lead to a lot of property executions # that are probably not wanted. The drawback for this is that we # have a different name for `get` and `values`. For `get` we always @@ -496,13 +480,13 @@ def values(self): for name in dir_infos: names += self._get( name, - lambda name, unsafe: dir_infos[name], + lambda name, safe: dir_infos[name], lambda name: name in dir_infos, ) # ``dir`` doesn't include the type names. if not self.is_instance and needs_type_completions: - for filter in builtin_from_name(self._inference_state, u'type').get_filters(): + for filter in builtin_from_name(self._inference_state, 'type').get_filters(): names += filter.values() return names @@ -518,11 +502,11 @@ def __repr__(self): docstr_defaults = { - 'floating point number': u'float', - 'character': u'str', - 'integer': u'int', - 'dictionary': u'dict', - 'string': u'str', + 'floating point number': 'float', + 'character': 'str', + 'integer': 'int', + 'dictionary': 'dict', + 'string': 'str', } @@ -534,7 +518,6 @@ def _parse_function_doc(doc): TODO docstrings like utime(path, (atime, mtime)) and a(b [, b]) -> None TODO docstrings like 'tuple of integers' """ - doc = force_unicode(doc) # parse round parentheses: def func(a, (b,c)) try: count = 0 @@ -553,7 +536,7 @@ def _parse_function_doc(doc): # UnboundLocalError for undefined end in last line debug.dbg('no brackets found - no param') end = 0 - param_str = u'' + param_str = '' else: # remove square brackets, that show an optional param ( = None) def change_options(m): @@ -571,9 +554,9 @@ def change_options(m): param_str = param_str.replace('-', '_') # see: isinstance.__doc__ # parse return value - r = re.search(u'-[>-]* ', doc[end:end + 7]) + r = re.search('-[>-]* ', doc[end:end + 7]) if r is None: - ret = u'' + ret = '' else: index = end + r.end() # get result type, which can contain newlines diff --git a/anaconda_lib/jedi/inference/context.py b/anaconda_lib/jedi/inference/context.py old mode 100755 new mode 100644 index 60034db6..5bc6b994 --- a/anaconda_lib/jedi/inference/context.py +++ b/anaconda_lib/jedi/inference/context.py @@ -1,5 +1,7 @@ from abc import abstractmethod from contextlib import contextmanager +from pathlib import Path +from typing import Optional from parso.tree import search_ancestor from parso.python.tree import Name @@ -13,7 +15,7 @@ from jedi import parser_utils -class AbstractContext(object): +class AbstractContext: # Must be defined: inference_state and tree_node and parent_context as an attribute/property def __init__(self, inference_state): @@ -164,7 +166,7 @@ class ValueContext(AbstractContext): Should be defined, otherwise the API returns empty types. """ def __init__(self, value): - super(ValueContext, self).__init__(value.inference_state) + super().__init__(value.inference_state) self._value = value @property @@ -216,7 +218,7 @@ def __repr__(self): return '%s(%s)' % (self.__class__.__name__, self._value) -class TreeContextMixin(object): +class TreeContextMixin: def infer_node(self, node): from jedi.inference.syntax_tree import infer_node return infer_node(self, node) @@ -255,8 +257,7 @@ def from_scope_node(scope_node, is_nested=True): if scope_node.type in ('funcdef', 'lambdef', 'classdef'): return self.create_value(scope_node).as_context() elif scope_node.type in ('comp_for', 'sync_comp_for'): - parent_scope = parser_utils.get_parent_scope(scope_node) - parent_context = from_scope_node(parent_scope) + parent_context = from_scope_node(parent_scope(scope_node.parent)) if node.start_pos >= scope_node.children[-1].start_pos: return parent_context return CompForContext(parent_context, scope_node) @@ -308,8 +309,8 @@ def get_filters(self, until_position=None, origin_scope=None): class ModuleContext(TreeContextMixin, ValueContext): - def py__file__(self): - return self._value.py__file__() + def py__file__(self) -> Optional[Path]: + return self._value.py__file__() # type: ignore[no-any-return] def get_filters(self, until_position=None, origin_scope=None): filters = self._value.get_filters(origin_scope) @@ -323,11 +324,10 @@ def get_filters(self, until_position=None, origin_scope=None): ), self.get_global_filter(), ) - for f in filters: # Python 2... - yield f + yield from filters def get_global_filter(self): - return GlobalNameFilter(self, self.tree_node) + return GlobalNameFilter(self) @property def string_names(self): @@ -357,8 +357,8 @@ def get_value(self): def string_names(self): return self._value.string_names - def py__file__(self): - return self._value.py__file__() + def py__file__(self) -> Optional[Path]: + return self._value.py__file__() # type: ignore[no-any-return] class ClassContext(TreeContextMixin, ValueContext): @@ -375,7 +375,7 @@ def get_global_filter(self, until_position=None, origin_scope=None): class CompForContext(TreeContextMixin, AbstractContext): def __init__(self, parent_context, comp_for): - super(CompForContext, self).__init__(parent_context.inference_state) + super().__init__(parent_context.inference_state) self.tree_node = comp_for self.parent_context = parent_context @@ -407,8 +407,8 @@ def get_value(self): def string_names(self): return self._value.string_names - def py__file__(self): - return self._value.py__file__() + def py__file__(self) -> Optional[Path]: + return self._value.py__file__() # type: ignore[no-any-return] def _get_global_filters_for_name(context, name_or_none, position): @@ -439,13 +439,12 @@ def get_global_filters(context, until_position, origin_scope): For global name lookups. The filters will handle name resolution themselves, but here we gather possible filters downwards. - >>> from jedi._compatibility import u, no_unicode_pprint >>> from jedi import Script - >>> script = Script(u(''' + >>> script = Script(''' ... x = ['a', 'b', 'c'] ... def func(): ... y = None - ... ''')) + ... ''') >>> module_node = script._module_node >>> scope = next(module_node.iter_funcdefs()) >>> scope @@ -455,7 +454,7 @@ def get_global_filters(context, until_position, origin_scope): First we get the names from the function scope. - >>> no_unicode_pprint(filters[0]) # doctest: +ELLIPSIS + >>> print(filters[0]) # doctest: +ELLIPSIS MergedFilter(, ) >>> sorted(str(n) for n in filters[0].values()) # doctest: +NORMALIZE_WHITESPACE ['', @@ -484,10 +483,10 @@ def get_global_filters(context, until_position, origin_scope): from jedi.inference.value.function import BaseFunctionExecutionContext while context is not None: # Names in methods cannot be resolved within the class. - for filter in context.get_filters( - until_position=until_position, - origin_scope=origin_scope): - yield filter + yield from context.get_filters( + until_position=until_position, + origin_scope=origin_scope + ) if isinstance(context, (BaseFunctionExecutionContext, ModuleContext)): # The position should be reset if the current scope is a function. until_position = None diff --git a/anaconda_lib/jedi/inference/docstring_utils.py b/anaconda_lib/jedi/inference/docstring_utils.py new file mode 100644 index 00000000..bee0d75e --- /dev/null +++ b/anaconda_lib/jedi/inference/docstring_utils.py @@ -0,0 +1,21 @@ +from jedi.inference.value import ModuleValue +from jedi.inference.context import ModuleContext + + +class DocstringModule(ModuleValue): + def __init__(self, in_module_context, **kwargs): + super().__init__(**kwargs) + self._in_module_context = in_module_context + + def _as_context(self): + return DocstringModuleContext(self, self._in_module_context) + + +class DocstringModuleContext(ModuleContext): + def __init__(self, module_value, in_module_context): + super().__init__(module_value) + self._in_module_context = in_module_context + + def get_filters(self, origin_scope=None, until_position=None): + yield from super().get_filters(until_position=until_position) + yield from self._in_module_context.get_filters() diff --git a/anaconda_lib/jedi/inference/docstrings.py b/anaconda_lib/jedi/inference/docstrings.py old mode 100755 new mode 100644 index ab34cf93..809974f3 --- a/anaconda_lib/jedi/inference/docstrings.py +++ b/anaconda_lib/jedi/inference/docstrings.py @@ -17,13 +17,10 @@ import re import warnings -from textwrap import dedent from parso import parse, ParserSyntaxError -from jedi._compatibility import u from jedi import debug -from jedi.common import indent_block from jedi.inference.cache import inference_state_method_cache from jedi.inference.base_value import iterator_to_value_set, ValueSet, \ NO_VALUES @@ -51,7 +48,7 @@ def _get_numpy_doc_string_cls(): global _numpy_doc_string_cache if isinstance(_numpy_doc_string_cache, (ImportError, SyntaxError)): raise _numpy_doc_string_cache - from numpydoc.docscrape import NumpyDocString + from numpydoc.docscrape import NumpyDocString # type: ignore[import] _numpy_doc_string_cache = NumpyDocString return _numpy_doc_string_cache @@ -96,8 +93,7 @@ def _search_return_in_numpydocstr(docstr): # Return names are optional and if so the type is in the name if not r_type: r_type = r_name - for type_ in _expand_typestr(r_type): - yield type_ + yield from _expand_typestr(r_type) def _expand_typestr(type_str): @@ -115,7 +111,7 @@ def _expand_typestr(type_str): elif type_str.startswith('{'): node = parse(type_str, version='3.7').children[0] if node.type == 'atom': - for leaf in node.children[1].children: + for leaf in getattr(node.children[1], "children", []): if leaf.type == 'number': if '.' in leaf.value: yield 'float' @@ -184,55 +180,40 @@ def _strip_rst_role(type_str): def _infer_for_statement_string(module_context, string): - code = dedent(u(""" - def pseudo_docstring_stuff(): - ''' - Create a pseudo function for docstring statements. - Need this docstring so that if the below part is not valid Python this - is still a function. - ''' - {} - """)) if string is None: return [] - for element in re.findall(r'((?:\w+\.)*\w+)\.', string): - # Try to import module part in dotted name. - # (e.g., 'threading' in 'threading.Thread'). - string = 'import %s\n' % element + string + potential_imports = re.findall(r'((?:\w+\.)*\w+)\.', string) + # Try to import module part in dotted name. + # (e.g., 'threading' in 'threading.Thread'). + imports = "\n".join(f"import {p}" for p in potential_imports) + string = f'{imports}\n{string}' - # Take the default grammar here, if we load the Python 2.7 grammar here, it - # will be impossible to use `...` (Ellipsis) as a token. Docstring types - # don't need to conform with the current grammar. debug.dbg('Parse docstring code %s', string, color='BLUE') - grammar = module_context.inference_state.latest_grammar + grammar = module_context.inference_state.grammar try: - module = grammar.parse(code.format(indent_block(string)), error_recovery=False) + module = grammar.parse(string, error_recovery=False) except ParserSyntaxError: return [] try: - funcdef = next(module.iter_funcdefs()) - # First pick suite, then simple_stmt and then the node, - # which is also not the last item, because there's a newline. - stmt = funcdef.children[-1].children[-1].children[-2] + # It's not the last item, because that's an end marker. + stmt = module.children[-2] except (AttributeError, IndexError): return [] if stmt.type not in ('name', 'atom', 'atom_expr'): return [] - from jedi.inference.value import FunctionValue - function_value = FunctionValue( - module_context.inference_state, - module_context, - funcdef + # Here we basically use a fake module that also uses the filters in + # the actual module. + from jedi.inference.docstring_utils import DocstringModule + m = DocstringModule( + in_module_context=module_context, + inference_state=module_context.inference_state, + module_node=module, + code_lines=[], ) - func_execution_context = function_value.as_context() - # Use the module of the param. - # TODO this module is not the module of the param in case of a function - # call. In that case it's the module of the function call. - # stuffed with content from a function call. - return list(_execute_types_in_stmt(func_execution_context, stmt)) + return list(_execute_types_in_stmt(m.as_context(), stmt)) def _execute_types_in_stmt(module_context, stmt): @@ -299,9 +280,7 @@ def search_return_in_docstr(code): if match: yield _strip_rst_role(match.group(1)) # Check for numpy style return hint - for type_ in _search_return_in_numpydocstr(code): - yield type_ + yield from _search_return_in_numpydocstr(code) for type_str in search_return_in_docstr(function_value.py__doc__()): - for value in _infer_for_statement_string(function_value.get_root_context(), type_str): - yield value + yield from _infer_for_statement_string(function_value.get_root_context(), type_str) diff --git a/anaconda_lib/jedi/inference/dynamic_params.py b/anaconda_lib/jedi/inference/dynamic_params.py old mode 100755 new mode 100644 index 0a79bac2..c47d4dae --- a/anaconda_lib/jedi/inference/dynamic_params.py +++ b/anaconda_lib/jedi/inference/dynamic_params.py @@ -215,12 +215,10 @@ def create_args(value): for name, trailer in potential_nodes: if value_node.start_pos < name.start_pos < value_node.end_pos: random_context = execution_context.create_context(name) - iterator = _check_name_for_execution( + yield from _check_name_for_execution( inference_state, random_context, compare_node, name, trailer ) - for arguments in iterator: - yield arguments diff --git a/anaconda_lib/jedi/inference/filters.py b/anaconda_lib/jedi/inference/filters.py old mode 100755 new mode 100644 index e7dc3849..62782334 --- a/anaconda_lib/jedi/inference/filters.py +++ b/anaconda_lib/jedi/inference/filters.py @@ -3,23 +3,25 @@ are needed for name resolution. """ from abc import abstractmethod +from typing import List, MutableMapping, Type import weakref from parso.tree import search_ancestor +from parso.python.tree import Name, UsedNamesMapping -from jedi._compatibility import use_metaclass from jedi.inference import flow_analysis from jedi.inference.base_value import ValueSet, ValueWrapper, \ LazyValueWrapper -from jedi.parser_utils import get_cached_parent_scope +from jedi.parser_utils import get_cached_parent_scope, get_parso_cache_node from jedi.inference.utils import to_list from jedi.inference.names import TreeNameDefinition, ParamName, \ - AnonymousParamName, AbstractNameDefinition + AnonymousParamName, AbstractNameDefinition, NameWrapper +_definition_name_cache: MutableMapping[UsedNamesMapping, List[Name]] _definition_name_cache = weakref.WeakKeyDictionary() -class AbstractFilter(object): +class AbstractFilter: _until_position = None def _filter(self, names): @@ -36,8 +38,8 @@ def values(self): raise NotImplementedError -class FilterWrapper(object): - name_wrapper_class = None +class FilterWrapper: + name_wrapper_class: Type[NameWrapper] def __init__(self, wrapped_filter): self._wrapped_filter = wrapped_filter @@ -52,11 +54,15 @@ def values(self): return self.wrap_names(self._wrapped_filter.values()) -def _get_definition_names(used_names, name_key): +def _get_definition_names(parso_cache_node, used_names, name_key): + if parso_cache_node is None: + names = used_names.get(name_key, ()) + return tuple(name for name in names if name.is_definition(include_setitem=True)) + try: - for_module = _definition_name_cache[used_names] + for_module = _definition_name_cache[parso_cache_node] except KeyError: - for_module = _definition_name_cache[used_names] = {} + for_module = _definition_name_cache[parso_cache_node] = {} try: return for_module[name_key] @@ -68,18 +74,40 @@ def _get_definition_names(used_names, name_key): return result -class AbstractUsedNamesFilter(AbstractFilter): +class _AbstractUsedNamesFilter(AbstractFilter): name_class = TreeNameDefinition - def __init__(self, parent_context, parser_scope): - self._parser_scope = parser_scope - self._module_node = self._parser_scope.get_root_node() - self._used_names = self._module_node.get_used_names() + def __init__(self, parent_context, node_context=None): + if node_context is None: + node_context = parent_context + self._node_context = node_context + self._parser_scope = node_context.tree_node + module_context = node_context.get_root_context() + # It is quite hacky that we have to use that. This is for caching + # certain things with a WeakKeyDictionary. However, parso intentionally + # uses slots (to save memory) and therefore we end up with having to + # have a weak reference to the object that caches the tree. + # + # Previously we have tried to solve this by using a weak reference onto + # used_names. However that also does not work, because it has a + # reference from the module, which itself is referenced by any node + # through parents. + path = module_context.py__file__() + if path is None: + # If the path is None, there is no guarantee that parso caches it. + self._parso_cache_node = None + else: + self._parso_cache_node = get_parso_cache_node( + module_context.inference_state.latest_grammar + if module_context.is_stub() else module_context.inference_state.grammar, + path + ) + self._used_names = module_context.tree_node.get_used_names() self.parent_context = parent_context def get(self, name): return self._convert_names(self._filter( - _get_definition_names(self._used_names, name), + _get_definition_names(self._parso_cache_node, self._used_names, name), )) def _convert_names(self, names): @@ -90,7 +118,7 @@ def values(self): name for name_key in self._used_names for name in self._filter( - _get_definition_names(self._used_names, name_key), + _get_definition_names(self._parso_cache_node, self._used_names, name_key), ) ) @@ -98,7 +126,7 @@ def __repr__(self): return '<%s: %s>' % (self.__class__.__name__, self.parent_context) -class ParserTreeFilter(AbstractUsedNamesFilter): +class ParserTreeFilter(_AbstractUsedNamesFilter): def __init__(self, parent_context, node_context=None, until_position=None, origin_scope=None): """ @@ -107,15 +135,12 @@ def __init__(self, parent_context, node_context=None, until_position=None, value, but for some type inference it's important to have a local value of the other classes. """ - if node_context is None: - node_context = parent_context - super(ParserTreeFilter, self).__init__(parent_context, node_context.tree_node) - self._node_context = node_context + super().__init__(parent_context, node_context) self._origin_scope = origin_scope self._until_position = until_position def _filter(self, names): - names = super(ParserTreeFilter, self)._filter(names) + names = super()._filter(names) names = [n for n in names if self._is_name_reachable(n)] return list(self._check_flows(names)) @@ -124,7 +149,7 @@ def _is_name_reachable(self, name): if parent.type == 'trailer': return False base_node = parent if parent.type in ('classdef', 'funcdef') else name - return get_cached_parent_scope(self._used_names, base_node) == self._parser_scope + return get_cached_parent_scope(self._parso_cache_node, base_node) == self._parser_scope def _check_flows(self, names): for name in sorted(names, key=lambda name: name.start_pos, reverse=True): @@ -143,7 +168,7 @@ def _check_flows(self, names): class _FunctionExecutionFilter(ParserTreeFilter): def __init__(self, parent_context, function_value, until_position, origin_scope): - super(_FunctionExecutionFilter, self).__init__( + super().__init__( parent_context, until_position=until_position, origin_scope=origin_scope, @@ -167,9 +192,9 @@ def _convert_names(self, names): class FunctionExecutionFilter(_FunctionExecutionFilter): - def __init__(self, *args, **kwargs): - self._arguments = kwargs.pop('arguments') # Python 2 - super(FunctionExecutionFilter, self).__init__(*args, **kwargs) + def __init__(self, *args, arguments, **kwargs): + super().__init__(*args, **kwargs) + self._arguments = arguments def _convert_param(self, param, name): return ParamName(self._function_value, name, self._arguments) @@ -180,7 +205,7 @@ def _convert_param(self, param, name): return AnonymousParamName(self._function_value, name) -class GlobalNameFilter(AbstractUsedNamesFilter): +class GlobalNameFilter(_AbstractUsedNamesFilter): def get(self, name): try: names = self._used_names[name] @@ -230,7 +255,7 @@ def __repr__(self): return '<%s: for {%s}>' % (self.__class__.__name__, keys) -class MergedFilter(object): +class MergedFilter: def __init__(self, *filters): self._filters = filters @@ -246,16 +271,16 @@ def __repr__(self): class _BuiltinMappedMethod(ValueWrapper): """``Generator.__next__`` ``dict.values`` methods and so on.""" - api_type = u'function' + api_type = 'function' def __init__(self, value, method, builtin_func): - super(_BuiltinMappedMethod, self).__init__(builtin_func) + super().__init__(builtin_func) self._value = value self._method = method def py__call__(self, arguments): # TODO add TypeError if params are given/or not correct. - return self._method(self._value) + return self._method(self._value, arguments) class SpecialMethodFilter(DictFilter): @@ -264,14 +289,9 @@ class SpecialMethodFilter(DictFilter): classes like Generator (for __next__, etc). """ class SpecialMethodName(AbstractNameDefinition): - api_type = u'function' - - def __init__(self, parent_context, string_name, value, builtin_value): - callable_, python_version = value - if python_version is not None and \ - python_version != parent_context.inference_state.environment.version_info.major: - raise KeyError + api_type = 'function' + def __init__(self, parent_context, string_name, callable_, builtin_value): self.parent_context = parent_context self.string_name = string_name self._callable = callable_ @@ -293,7 +313,7 @@ def infer(self): ]) def __init__(self, value, dct, builtin_value): - super(SpecialMethodFilter, self).__init__(dct) + super().__init__(dct) self.value = value self._builtin_value = builtin_value """ @@ -309,7 +329,7 @@ def _convert(self, name, value): class _OverwriteMeta(type): def __init__(cls, name, bases, dct): - super(_OverwriteMeta, cls).__init__(name, bases, dct) + super().__init__(name, bases, dct) base_dct = {} for base_cls in reversed(cls.__bases__): @@ -326,28 +346,26 @@ def __init__(cls, name, bases, dct): cls.overwritten_methods = base_dct -class _AttributeOverwriteMixin(object): +class _AttributeOverwriteMixin: def get_filters(self, *args, **kwargs): yield SpecialMethodFilter(self, self.overwritten_methods, self._wrapped_value) - - for filter in self._wrapped_value.get_filters(): - yield filter + yield from self._wrapped_value.get_filters(*args, **kwargs) -class LazyAttributeOverwrite(use_metaclass(_OverwriteMeta, _AttributeOverwriteMixin, - LazyValueWrapper)): +class LazyAttributeOverwrite(_AttributeOverwriteMixin, LazyValueWrapper, + metaclass=_OverwriteMeta): def __init__(self, inference_state): self.inference_state = inference_state -class AttributeOverwrite(use_metaclass(_OverwriteMeta, _AttributeOverwriteMixin, - ValueWrapper)): +class AttributeOverwrite(_AttributeOverwriteMixin, ValueWrapper, + metaclass=_OverwriteMeta): pass -def publish_method(method_name, python_version_match=None): +def publish_method(method_name): def decorator(func): dct = func.__dict__.setdefault('registered_overwritten_methods', {}) - dct[method_name] = func, python_version_match + dct[method_name] = func return func return decorator diff --git a/anaconda_lib/jedi/inference/finder.py b/anaconda_lib/jedi/inference/finder.py old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/inference/flow_analysis.py b/anaconda_lib/jedi/inference/flow_analysis.py old mode 100755 new mode 100644 index 184f367f..89bfe578 --- a/anaconda_lib/jedi/inference/flow_analysis.py +++ b/anaconda_lib/jedi/inference/flow_analysis.py @@ -1,12 +1,14 @@ +from typing import Dict, Optional + from jedi.parser_utils import get_flow_branch_keyword, is_scope, get_parent_scope from jedi.inference.recursion import execution_allowed from jedi.inference.helpers import is_big_annoying_library -class Status(object): - lookup_table = {} +class Status: + lookup_table: Dict[Optional[bool], 'Status'] = {} - def __init__(self, value, name): + def __init__(self, value: Optional[bool], name: str) -> None: self._value = value self._name = name Status.lookup_table[value] = self diff --git a/anaconda_lib/jedi/inference/gradual/__init__.py b/anaconda_lib/jedi/inference/gradual/__init__.py old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/inference/gradual/annotation.py b/anaconda_lib/jedi/inference/gradual/annotation.py old mode 100755 new mode 100644 index 7311bfb5..81780010 --- a/anaconda_lib/jedi/inference/gradual/annotation.py +++ b/anaconda_lib/jedi/inference/gradual/annotation.py @@ -6,10 +6,10 @@ """ import re +from inspect import Parameter from parso import ParserSyntaxError, parse -from jedi._compatibility import force_unicode, Parameter from jedi.inference.cache import inference_state_method_cache from jedi.inference.base_value import ValueSet, NO_VALUES from jedi.inference.gradual.base import DefineGenericBaseClass, GenericClass @@ -53,8 +53,10 @@ def _infer_annotation_string(context, string, index=None): value_set = context.infer_node(node) if index is not None: value_set = value_set.filter( - lambda value: value.array_type == u'tuple' # noqa - and len(list(value.py__iter__())) >= index + lambda value: ( + value.array_type == 'tuple' + and len(list(value.py__iter__())) >= index + ) ).py__simple_getitem__(index) return value_set @@ -62,7 +64,7 @@ def _infer_annotation_string(context, string, index=None): def _get_forward_reference_node(context, string): try: new_node = context.inference_state.grammar.parse( - force_unicode(string), + string, start_symbol='eval_input', error_recovery=False ) @@ -138,8 +140,7 @@ def _infer_param(function_value, param): """ annotation = param.annotation if annotation is None: - # If no Python 3-style annotation, look for a Python 2-style comment - # annotation. + # If no Python 3-style annotation, look for a comment annotation. # Identify parameters to function in the same sequence as they would # appear in a type comment. all_params = [child for child in param.parent.children @@ -195,16 +196,47 @@ def py__annotations__(funcdef): return dct +def resolve_forward_references(context, all_annotations): + def resolve(node): + if node is None or node.type != 'string': + return node + + node = _get_forward_reference_node( + context, + context.inference_state.compiled_subprocess.safe_literal_eval( + node.value, + ), + ) + + if node is None: + # There was a string, but it's not a valid annotation + return None + + # The forward reference tree has an additional root node ('eval_input') + # that we don't want. Extract the node we do want, that is equivalent to + # the nodes returned by `py__annotations__` for a non-quoted node. + node = node.children[0] + + return node + + return {name: resolve(node) for name, node in all_annotations.items()} + + @inference_state_method_cache() def infer_return_types(function, arguments): """ Infers the type of a function's return value, according to type annotations. """ - all_annotations = py__annotations__(function.tree_node) + context = function.get_default_param_context() + all_annotations = resolve_forward_references( + context, + py__annotations__(function.tree_node), + ) annotation = all_annotations.get("return", None) if annotation is None: - # If there is no Python 3-type annotation, look for a Python 2-type annotation + # If there is no Python 3-type annotation, look for an annotation + # comment. node = function.tree_node comment = parser_utils.get_following_comment_same_line(node) if comment is None: @@ -215,11 +247,10 @@ def infer_return_types(function, arguments): return NO_VALUES return _infer_annotation_string( - function.get_default_param_context(), + context, match.group(1).strip() ).execute_annotation() - context = function.get_default_param_context() unknown_type_vars = find_unknown_type_vars(context, annotation) annotation_values = infer_annotation(context, annotation) if not unknown_type_vars: @@ -281,7 +312,8 @@ def infer_return_for_callable(arguments, param_values, result_values): return ValueSet.from_sets( v.define_generics(all_type_vars) - if isinstance(v, (DefineGenericBaseClass, TypeVar)) else ValueSet({v}) + if isinstance(v, (DefineGenericBaseClass, TypeVar)) + else ValueSet({v}) for v in result_values ).execute_annotation() diff --git a/anaconda_lib/jedi/inference/gradual/base.py b/anaconda_lib/jedi/inference/gradual/base.py old mode 100755 new mode 100644 index e7940800..ce574297 --- a/anaconda_lib/jedi/inference/gradual/base.py +++ b/anaconda_lib/jedi/inference/gradual/base.py @@ -25,8 +25,7 @@ def iter_(): # Replace any with the constraints if they are there. from jedi.inference.gradual.typing import AnyClass if isinstance(value, AnyClass): - for constraint in self._type_var.constraints: - yield constraint + yield from self._type_var.constraints else: yield value return ValueSet(iter_()) @@ -38,7 +37,7 @@ def __repr__(self): return '<%s %s -> %s>' % (self.__class__.__name__, self.py__name__(), self._value_set) -class _TypeVarFilter(object): +class _TypeVarFilter: """ A filter for all given variables in a class. @@ -70,11 +69,10 @@ def values(self): class _AnnotatedClassContext(ClassContext): def get_filters(self, *args, **kwargs): - filters = super(_AnnotatedClassContext, self).get_filters( + filters = super().get_filters( *args, **kwargs ) - for f in filters: - yield f + yield from filters # The type vars can only be looked up if it's a global search and # not a direct lookup on the class. @@ -138,11 +136,19 @@ def is_same_class(self, other): any( # TODO why is this ordering the correct one? cls2.is_same_class(cls1) - for cls1 in class_set1 - for cls2 in class_set2 + # TODO I'm still not sure gather_annotation_classes is a good + # idea. They are essentially here to avoid comparing Tuple <=> + # tuple and instead compare tuple <=> tuple, but at the moment + # the whole `is_same_class` and `is_sub_class` matching is just + # not in the best shape. + for cls1 in class_set1.gather_annotation_classes() + for cls2 in class_set2.gather_annotation_classes() ) for class_set1, class_set2 in zip(given_params1, given_params2) ) + def get_signatures(self): + return [] + def __repr__(self): return '<%s: %s%s>' % ( self.__class__.__name__, @@ -151,7 +157,7 @@ def __repr__(self): ) -class GenericClass(ClassMixin, DefineGenericBaseClass): +class GenericClass(DefineGenericBaseClass, ClassMixin): """ A class that is defined with generics, might be something simple like: @@ -159,7 +165,7 @@ class Foo(Generic[T]): ... my_foo_int_cls = Foo[int] """ def __init__(self, class_value, generics_manager): - super(GenericClass, self).__init__(generics_manager) + super().__init__(generics_manager) self._class_value = class_value def _get_wrapped_value(self): @@ -181,7 +187,7 @@ def get_type_var_filter(self): return _TypeVarFilter(self.get_generics(), self.list_type_vars()) def py__call__(self, arguments): - instance, = super(GenericClass, self).py__call__(arguments) + instance, = super().py__call__(arguments) return ValueSet([_GenericInstanceWrapper(instance)]) def _as_context(self): @@ -190,16 +196,19 @@ def _as_context(self): @to_list def py__bases__(self): for base in self._wrapped_value.py__bases__(): - yield _LazyGenericBaseClass(self, base) + yield _LazyGenericBaseClass(self, base, self._generics_manager) def _create_instance_with_generics(self, generics_manager): return GenericClass(self._class_value, generics_manager) def is_sub_class_of(self, class_value): - if super(GenericClass, self).is_sub_class_of(class_value): + if super().is_sub_class_of(class_value): return True return self._class_value.is_sub_class_of(class_value) + def with_generics(self, generics_tuple): + return self._class_value.with_generics(generics_tuple) + def infer_type_vars(self, value_set): # Circular from jedi.inference.gradual.annotation import merge_pairwise_generics, merge_type_var_dicts @@ -222,7 +231,7 @@ def infer_type_vars(self, value_set): else: continue - if py_class.api_type != u'class': + if py_class.api_type != 'class': # Functions & modules don't have an MRO and we're not # expecting a Callable (those are handled separately within # TypingClassValueWithIndex). @@ -240,10 +249,11 @@ def infer_type_vars(self, value_set): return type_var_dict -class _LazyGenericBaseClass(object): - def __init__(self, class_value, lazy_base_class): +class _LazyGenericBaseClass: + def __init__(self, class_value, lazy_base_class, generics_manager): self._class_value = class_value self._lazy_base_class = lazy_base_class + self._generics_manager = generics_manager @iterator_to_value_set def infer(self): @@ -256,7 +266,17 @@ def infer(self): TupleGenericManager(tuple(self._remap_type_vars(base))), ) else: - yield base + if base.is_class_mixin(): + # This case basically allows classes like `class Foo(List)` + # to be used like `Foo[int]`. The generics are not + # necessary and can be used later. + yield GenericClass.create_cached( + base.inference_state, + base, + self._generics_manager, + ) + else: + yield base def _remap_type_vars(self, base): from jedi.inference.gradual.type_var import TypeVar @@ -276,6 +296,9 @@ def _remap_type_vars(self, base): new |= ValueSet([type_var]) yield new + def __repr__(self): + return '<%s: %s>' % (self.__class__.__name__, self._lazy_base_class) + class _GenericInstanceWrapper(ValueWrapper): def py__stop_iteration_returns(self): @@ -287,7 +310,7 @@ def py__stop_iteration_returns(self): except IndexError: pass elif cls.py__name__() == 'Iterator': - return ValueSet([builtin_from_name(self.inference_state, u'None')]) + return ValueSet([builtin_from_name(self.inference_state, 'None')]) return self._wrapped_value.py__stop_iteration_returns() def get_type_hint(self, add_class_info=True): @@ -304,10 +327,10 @@ class _PseudoTreeNameClass(Value): this class. Essentially this class makes it possible to goto that `Tuple` name, without affecting anything else negatively. """ - api_type = u'class' + api_type = 'class' def __init__(self, parent_context, tree_name): - super(_PseudoTreeNameClass, self).__init__( + super().__init__( parent_context.inference_state, parent_context ) @@ -334,7 +357,7 @@ def values(self, **kwargs): def py__class__(self): # This might not be 100% correct, but it is good enough. The details of # the typing library are not really an issue for Jedi. - return builtin_from_name(self.inference_state, u'type') + return builtin_from_name(self.inference_state, 'type') @property def name(self): @@ -360,13 +383,16 @@ def name(self): def _get_wrapped_value(self): return _PseudoTreeNameClass(self.parent_context, self._tree_name) + def get_signatures(self): + return self._wrapped_value.get_signatures() + def __repr__(self): return '%s(%s)' % (self.__class__.__name__, self._tree_name.value) class BaseTypingClassWithGenerics(DefineGenericBaseClass): def __init__(self, parent_context, tree_name, generics_manager): - super(BaseTypingClassWithGenerics, self).__init__(generics_manager) + super().__init__(generics_manager) self.inference_state = parent_context.inference_state self.parent_context = parent_context self._tree_name = tree_name @@ -393,12 +419,15 @@ def py__class__(self): def get_annotated_class_object(self): return self._class_value + def get_qualified_names(self): + return (self.py__name__(),) + @property def name(self): return ValueName(self, self._tree_name) def _get_wrapped_value(self): - object_, = builtin_from_name(self.inference_state, u'object').execute_annotation() + object_, = builtin_from_name(self.inference_state, 'object').execute_annotation() return object_ def __repr__(self): diff --git a/anaconda_lib/jedi/inference/gradual/conversion.py b/anaconda_lib/jedi/inference/gradual/conversion.py old mode 100755 new mode 100644 index 0700716d..9b36a2e1 --- a/anaconda_lib/jedi/inference/gradual/conversion.py +++ b/anaconda_lib/jedi/inference/gradual/conversion.py @@ -18,6 +18,7 @@ def _stub_to_python_value_set(stub_value, ignore_compiled=False): was_instance = stub_value.is_instance() if was_instance: + arguments = getattr(stub_value, '_arguments', None) stub_value = stub_value.py__class__() qualified_names = stub_value.get_qualified_names() @@ -30,11 +31,12 @@ def _stub_to_python_value_set(stub_value, ignore_compiled=False): method_name = qualified_names[-1] qualified_names = qualified_names[:-1] was_instance = True + arguments = None values = _infer_from_stub(stub_module_context, qualified_names, ignore_compiled) if was_instance: values = ValueSet.from_sets( - c.execute_with_values() + c.execute_with_values() if arguments is None else c.execute(arguments) for c in values if c.is_class() ) @@ -133,8 +135,7 @@ def _python_to_stub_names(names, fallback_to_python=False): if converted: converted_names = converted.goto(name.get_public_name()) if converted_names: - for n in converted_names: - yield n + yield from converted_names continue if fallback_to_python: # This is the part where if we haven't found anything, just return diff --git a/anaconda_lib/jedi/inference/gradual/generics.py b/anaconda_lib/jedi/inference/gradual/generics.py old mode 100755 new mode 100644 index 6bd6aa63..f4a5ae9c --- a/anaconda_lib/jedi/inference/gradual/generics.py +++ b/anaconda_lib/jedi/inference/gradual/generics.py @@ -23,7 +23,7 @@ def _resolve_forward_references(context, value_set): yield value -class _AbstractGenericManager(object): +class _AbstractGenericManager: def get_index_and_execute(self, index): try: return self[index].execute_annotation() diff --git a/anaconda_lib/jedi/inference/gradual/stub_value.py b/anaconda_lib/jedi/inference/gradual/stub_value.py old mode 100755 new mode 100644 index badfff35..c2e2bc4e --- a/anaconda_lib/jedi/inference/gradual/stub_value.py +++ b/anaconda_lib/jedi/inference/gradual/stub_value.py @@ -10,7 +10,7 @@ class StubModuleValue(ModuleValue): _module_name_class = StubModuleName def __init__(self, non_stub_value_set, *args, **kwargs): - super(StubModuleValue, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) self.non_stub_value_set = non_stub_value_set def is_stub(self): @@ -30,7 +30,7 @@ def sub_modules_dict(self): pass else: names.update(method()) - names.update(super(StubModuleValue, self).sub_modules_dict()) + names.update(super().sub_modules_dict()) return names def _get_stub_filters(self, origin_scope): @@ -40,14 +40,11 @@ def _get_stub_filters(self, origin_scope): )] + list(self.iter_star_filters()) def get_filters(self, origin_scope=None): - filters = super(StubModuleValue, self).get_filters(origin_scope) + filters = super().get_filters(origin_scope) next(filters, None) # Ignore the first filter and replace it with our own stub_filters = self._get_stub_filters(origin_scope=origin_scope) - for f in stub_filters: - yield f - - for f in filters: - yield f + yield from stub_filters + yield from filters def _as_context(self): return StubModuleContext(self) @@ -57,17 +54,16 @@ class StubModuleContext(ModuleContext): def get_filters(self, until_position=None, origin_scope=None): # Make sure to ignore the position, because positions are not relevant # for stubs. - return super(StubModuleContext, self).get_filters(origin_scope=origin_scope) + return super().get_filters(origin_scope=origin_scope) class TypingModuleWrapper(StubModuleValue): def get_filters(self, *args, **kwargs): - filters = super(TypingModuleWrapper, self).get_filters(*args, **kwargs) + filters = super().get_filters(*args, **kwargs) f = next(filters, None) assert f is not None yield TypingModuleFilterWrapper(f) - for f in filters: - yield f + yield from filters def _as_context(self): return TypingModuleContext(self) @@ -75,17 +71,16 @@ def _as_context(self): class TypingModuleContext(ModuleContext): def get_filters(self, *args, **kwargs): - filters = super(TypingModuleContext, self).get_filters(*args, **kwargs) + filters = super().get_filters(*args, **kwargs) yield TypingModuleFilterWrapper(next(filters, None)) - for f in filters: - yield f + yield from filters class StubFilter(ParserTreeFilter): name_class = StubName def _is_name_reachable(self, name): - if not super(StubFilter, self)._is_name_reachable(name): + if not super()._is_name_reachable(name): return False # Imports in stub files are only public if they have an "as" diff --git a/anaconda_lib/jedi/inference/gradual/type_var.py b/anaconda_lib/jedi/inference/gradual/type_var.py old mode 100755 new mode 100644 index 9b041df0..c09773f1 --- a/anaconda_lib/jedi/inference/gradual/type_var.py +++ b/anaconda_lib/jedi/inference/gradual/type_var.py @@ -1,10 +1,9 @@ -from jedi._compatibility import unicode, force_unicode from jedi import debug -from jedi.inference.base_value import ValueSet, NO_VALUES +from jedi.inference.base_value import ValueSet, NO_VALUES, ValueWrapper from jedi.inference.gradual.base import BaseTypingValue -class TypeVarClass(BaseTypingValue): +class TypeVarClass(ValueWrapper): def py__call__(self, arguments): unpacked = arguments.unpack() @@ -18,9 +17,9 @@ def py__call__(self, arguments): return ValueSet([TypeVar.create_cached( self.inference_state, self.parent_context, - self._tree_name, - var_name, - unpacked + tree_name=self.tree_node.name, + var_name=var_name, + unpacked_args=unpacked, )]) def _find_string_name(self, lazy_value): @@ -40,17 +39,14 @@ def _find_string_name(self, lazy_value): return None else: safe_value = method(default=None) - if self.inference_state.environment.version_info.major == 2: - if isinstance(safe_value, bytes): - return force_unicode(safe_value) - if isinstance(safe_value, (str, unicode)): + if isinstance(safe_value, str): return safe_value return None class TypeVar(BaseTypingValue): def __init__(self, parent_context, tree_name, var_name, unpacked_args): - super(TypeVar, self).__init__(parent_context, tree_name) + super().__init__(parent_context, tree_name) self._var_name = var_name self._constraints_lazy_values = [] @@ -102,14 +98,30 @@ def define_generics(self, type_var_dict): else: if found: return found - return self._get_classes() or ValueSet({self}) + return ValueSet({self}) def execute_annotation(self): return self._get_classes().execute_annotation() def infer_type_vars(self, value_set): + def iterate(): + for v in value_set: + cls = v.py__class__() + if v.is_function() or v.is_class(): + cls = TypeWrapper(cls, v) + yield cls + annotation_name = self.py__name__() - return {annotation_name: value_set.py__class__()} + return {annotation_name: ValueSet(iterate())} def __repr__(self): return '<%s: %s>' % (self.__class__.__name__, self.py__name__()) + + +class TypeWrapper(ValueWrapper): + def __init__(self, wrapped_value, original_value): + super().__init__(wrapped_value) + self._original_value = original_value + + def execute_annotation(self): + return ValueSet({self._original_value}) diff --git a/anaconda_lib/jedi/inference/gradual/typeshed.py b/anaconda_lib/jedi/inference/gradual/typeshed.py old mode 100755 new mode 100644 index bcf839a0..50217cd3 --- a/anaconda_lib/jedi/inference/gradual/typeshed.py +++ b/anaconda_lib/jedi/inference/gradual/typeshed.py @@ -1,77 +1,79 @@ import os import re from functools import wraps +from collections import namedtuple +from typing import Dict, Mapping, Tuple +from pathlib import Path from jedi import settings from jedi.file_io import FileIO -from jedi._compatibility import FileNotFoundError, cast_path from jedi.parser_utils import get_cached_code_lines from jedi.inference.base_value import ValueSet, NO_VALUES from jedi.inference.gradual.stub_value import TypingModuleWrapper, StubModuleValue from jedi.inference.value import ModuleValue -_jedi_path = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) -TYPESHED_PATH = os.path.join(_jedi_path, 'third_party', 'typeshed') -DJANGO_INIT_PATH = os.path.join(_jedi_path, 'third_party', 'django-stubs', - 'django-stubs', '__init__.pyi') +_jedi_path = Path(__file__).parent.parent.parent +TYPESHED_PATH = _jedi_path.joinpath('third_party', 'typeshed') +DJANGO_INIT_PATH = _jedi_path.joinpath('third_party', 'django-stubs', + 'django-stubs', '__init__.pyi') _IMPORT_MAP = dict( _collections='collections', _socket='socket', ) +PathInfo = namedtuple('PathInfo', 'path is_third_party') -def _merge_create_stub_map(directories): + +def _merge_create_stub_map(path_infos): map_ = {} - for directory in directories: - map_.update(_create_stub_map(directory)) + for directory_path_info in path_infos: + map_.update(_create_stub_map(directory_path_info)) return map_ -def _create_stub_map(directory): +def _create_stub_map(directory_path_info): """ Create a mapping of an importable name in Python to a stub file. """ def generate(): try: - listed = os.listdir(directory) - except (FileNotFoundError, OSError): - # OSError is Python 2 + listed = os.listdir(directory_path_info.path) + except (FileNotFoundError, NotADirectoryError): return for entry in listed: - entry = cast_path(entry) - path = os.path.join(directory, entry) + path = os.path.join(directory_path_info.path, entry) if os.path.isdir(path): init = os.path.join(path, '__init__.pyi') if os.path.isfile(init): - yield entry, init + yield entry, PathInfo(init, directory_path_info.is_third_party) elif entry.endswith('.pyi') and os.path.isfile(path): name = entry[:-4] if name != '__init__': - yield name, path + yield name, PathInfo(path, directory_path_info.is_third_party) # Create a dictionary from the tuple generator. return dict(generate()) def _get_typeshed_directories(version_info): - check_version_list = ['2and3', str(version_info.major)] + check_version_list = ['2and3', '3'] for base in ['stdlib', 'third_party']: - base = os.path.join(TYPESHED_PATH, base) - base_list = os.listdir(base) + base_path = TYPESHED_PATH.joinpath(base) + base_list = os.listdir(base_path) for base_list_entry in base_list: match = re.match(r'(\d+)\.(\d+)$', base_list_entry) if match is not None: - if int(match.group(1)) == version_info.major \ - and int(match.group(2)) <= version_info.minor: + if match.group(1) == '3' and int(match.group(2)) <= version_info.minor: check_version_list.append(base_list_entry) for check_version in check_version_list: - yield os.path.join(base, check_version) + is_third_party = base != 'stdlib' + yield PathInfo(str(base_path.joinpath(check_version)), is_third_party) -_version_cache = {} +_version_cache: Dict[Tuple[int, int], Mapping[str, PathInfo]] = {} def _cache_stub_file_map(version_info): @@ -107,7 +109,7 @@ def wrapper(inference_state, import_names, parent_module_value, sys_path, prefer # ``os``. python_value_set = ValueSet.from_sets( func(inference_state, (n,), None, sys_path,) - for n in [u'posixpath', u'ntpath', u'macpath', u'os2emxpath'] + for n in ['posixpath', 'ntpath', 'macpath', 'os2emxpath'] ) else: python_value_set = ValueSet.from_sets( @@ -116,7 +118,7 @@ def wrapper(inference_state, import_names, parent_module_value, sys_path, prefer ) inference_state.module_cache.add(import_names, python_value_set) - if not prefer_stubs: + if not prefer_stubs or import_names[0] in settings.auto_import_modules: return python_value_set stub = try_to_load_stub_cached(inference_state, import_names, python_value_set, @@ -165,7 +167,6 @@ def _try_to_load_stub(inference_state, import_names, python_value_set, if len(import_names) == 1: # foo-stubs for p in sys_path: - p = cast_path(p) init = os.path.join(p, *import_names) + '-stubs' + os.path.sep + '__init__.pyi' m = _try_to_load_stub_from_file( inference_state, @@ -175,11 +176,11 @@ def _try_to_load_stub(inference_state, import_names, python_value_set, ) if m is not None: return m - if import_names[0] == 'django': + if import_names[0] == 'django' and python_value_set: return _try_to_load_stub_from_file( inference_state, python_value_set, - file_io=FileIO(DJANGO_INIT_PATH), + file_io=FileIO(str(DJANGO_INIT_PATH)), import_names=import_names, ) @@ -194,8 +195,8 @@ def _try_to_load_stub(inference_state, import_names, python_value_set, file_paths = [] if c.is_namespace(): file_paths = [os.path.join(p, '__init__.pyi') for p in c.py__path__()] - elif file_path is not None and file_path.endswith('.py'): - file_paths = [file_path + 'i'] + elif file_path is not None and file_path.suffix == '.py': + file_paths = [str(file_path) + 'i'] for file_path in file_paths: m = _try_to_load_stub_from_file( @@ -249,16 +250,20 @@ def _load_from_typeshed(inference_state, python_value_set, parent_module_value, # Only if it's a package (= a folder) something can be # imported. return None - path = parent_module_value.py__path__() - map_ = _merge_create_stub_map(path) + paths = parent_module_value.py__path__() + # Once the initial package has been loaded, the sub packages will + # always be loaded, regardless if they are there or not. This makes + # sense, IMO, because stubs take preference, even if the original + # library doesn't provide a module (it could be dynamic). ~dave + map_ = _merge_create_stub_map([PathInfo(p, is_third_party=False) for p in paths]) if map_ is not None: - path = map_.get(import_name) - if path is not None: + path_info = map_.get(import_name) + if path_info is not None and (not path_info.is_third_party or python_value_set): return _try_to_load_stub_from_file( inference_state, python_value_set, - file_io=FileIO(path), + file_io=FileIO(path_info.path), import_names=import_names, ) @@ -266,13 +271,13 @@ def _load_from_typeshed(inference_state, python_value_set, parent_module_value, def _try_to_load_stub_from_file(inference_state, python_value_set, file_io, import_names): try: stub_module_node = parse_stub_module(inference_state, file_io) - except (OSError, IOError): # IOError is Python 2 only + except OSError: # The file that you're looking for doesn't exist (anymore). return None else: return create_stub_module( - inference_state, python_value_set, stub_module_node, file_io, - import_names + inference_state, inference_state.latest_grammar, python_value_set, + stub_module_node, file_io, import_names ) @@ -286,7 +291,8 @@ def parse_stub_module(inference_state, file_io): ) -def create_stub_module(inference_state, python_value_set, stub_module_node, file_io, import_names): +def create_stub_module(inference_state, grammar, python_value_set, + stub_module_node, file_io, import_names): if import_names == ('typing',): module_cls = TypingModuleWrapper else: @@ -298,7 +304,7 @@ def create_stub_module(inference_state, python_value_set, stub_module_node, file string_names=import_names, # The code was loaded with latest_grammar, so use # that. - code_lines=get_cached_code_lines(inference_state.latest_grammar, file_io.path), + code_lines=get_cached_code_lines(grammar, file_io.path), is_package=file_name == '__init__.pyi', ) return stub_module_value diff --git a/anaconda_lib/jedi/inference/gradual/typing.py b/anaconda_lib/jedi/inference/gradual/typing.py old mode 100755 new mode 100644 index add28177..188d3270 --- a/anaconda_lib/jedi/inference/gradual/typing.py +++ b/anaconda_lib/jedi/inference/gradual/typing.py @@ -7,11 +7,10 @@ """ import itertools -from jedi._compatibility import unicode from jedi import debug from jedi.inference.compiled import builtin_from_name, create_simple_object from jedi.inference.base_value import ValueSet, NO_VALUES, Value, \ - LazyValueWrapper + LazyValueWrapper, ValueWrapper from jedi.inference.lazy_value import LazyKnownValues from jedi.inference.arguments import repack_with_argument_clinic from jedi.inference.filters import FilterWrapper @@ -64,44 +63,41 @@ def _remap(self): # have any effects there (because it's never executed). return elif name == 'TypeVar': - yield TypeVarClass.create_cached( - inference_state, self.parent_context, self.tree_name) + cls, = self._wrapped_name.infer() + yield TypeVarClass.create_cached(inference_state, cls) elif name == 'Any': yield AnyClass.create_cached( inference_state, self.parent_context, self.tree_name) elif name == 'TYPE_CHECKING': # This is needed for e.g. imports that are only available for type # checking or are in cycles. The user can then check this variable. - yield builtin_from_name(inference_state, u'True') + yield builtin_from_name(inference_state, 'True') elif name == 'overload': yield OverloadFunction.create_cached( inference_state, self.parent_context, self.tree_name) elif name == 'NewType': - yield NewTypeFunction.create_cached( - inference_state, self.parent_context, self.tree_name) + v, = self._wrapped_name.infer() + yield NewTypeFunction.create_cached(inference_state, v) elif name == 'cast': - yield CastFunction.create_cached( - inference_state, self.parent_context, self.tree_name) + cast_fn, = self._wrapped_name.infer() + yield CastFunction.create_cached(inference_state, cast_fn) elif name == 'TypedDict': # TODO doesn't even exist in typeshed/typing.py, yet. But will be # added soon. yield TypedDictClass.create_cached( inference_state, self.parent_context, self.tree_name) - elif name in ('no_type_check', 'no_type_check_decorator'): - # This is not necessary, as long as we are not doing type checking. - for c in self._wrapped_name.infer(): # Fuck my life Python 2 - yield c else: - # Everything else shouldn't be relevant for type checking. - for c in self._wrapped_name.infer(): # Fuck my life Python 2 - yield c + # Not necessary, as long as we are not doing type checking: + # no_type_check & no_type_check_decorator + # Everything else shouldn't be relevant... + yield from self._wrapped_name.infer() class TypingModuleFilterWrapper(FilterWrapper): name_wrapper_class = TypingModuleName -class TypingClassWithIndex(BaseTypingClassWithGenerics): +class ProxyWithGenerics(BaseTypingClassWithGenerics): def execute_annotation(self): string_name = self._tree_name.value @@ -113,7 +109,7 @@ def execute_annotation(self): # Optional is basically just saying it's either None or the actual # type. return self.gather_annotation_classes().execute_annotation() \ - | ValueSet([builtin_from_name(self.inference_state, u'None')]) + | ValueSet([builtin_from_name(self.inference_state, 'None')]) elif string_name == 'Type': # The type is actually already given in the index_value return self._generics_manager[0] @@ -139,15 +135,33 @@ def gather_annotation_classes(self): return ValueSet.from_sets(self._generics_manager.to_tuple()) def _create_instance_with_generics(self, generics_manager): - return TypingClassWithIndex( + return ProxyWithGenerics( self.parent_context, self._tree_name, generics_manager ) + def infer_type_vars(self, value_set): + annotation_generics = self.get_generics() + + if not annotation_generics: + return {} + + annotation_name = self.py__name__() + if annotation_name == 'Optional': + # Optional[T] is equivalent to Union[T, None]. In Jedi unions + # are represented by members within a ValueSet, so we extract + # the T from the Optional[T] by removing the None value. + none = builtin_from_name(self.inference_state, 'None') + return annotation_generics[0].infer_type_vars( + value_set.filter(lambda x: x != none), + ) + + return {} + class ProxyTypingValue(BaseTypingValue): - index_class = TypingClassWithIndex + index_class = ProxyWithGenerics def with_generics(self, generics_tuple): return self.index_class.create_cached( @@ -185,7 +199,7 @@ def name(self): return ValueName(self, self._tree_name) -class TypingClassValueWithIndex(_TypingClassMixin, TypingClassWithIndex): +class TypingClassWithGenerics(ProxyWithGenerics, _TypingClassMixin): def infer_type_vars(self, value_set): type_var_dict = {} annotation_generics = self.get_generics() @@ -214,9 +228,16 @@ def infer_type_vars(self, value_set): return type_var_dict + def _create_instance_with_generics(self, generics_manager): + return TypingClassWithGenerics( + self.parent_context, + self._tree_name, + generics_manager + ) -class ProxyTypingClassValue(_TypingClassMixin, ProxyTypingValue): - index_class = TypingClassValueWithIndex + +class ProxyTypingClassValue(ProxyTypingValue, _TypingClassMixin): + index_class = TypingClassWithGenerics class TypeAlias(LazyValueWrapper): @@ -238,8 +259,6 @@ def __repr__(self): def _get_wrapped_value(self): module_name, class_name = self._actual.split('.') - if self.inference_state.environment.version_info.major == 2 and module_name == 'builtins': - module_name = '__builtin__' # TODO use inference_state.import_module? from jedi.inference.imports import Importer @@ -255,6 +274,9 @@ def _get_wrapped_value(self): def gather_annotation_classes(self): return ValueSet([self._get_wrapped_value()]) + def get_signatures(self): + return [] + class Callable(BaseTypingInstance): def py__call__(self, arguments): @@ -272,6 +294,9 @@ def x() -> Callable[[Callable[..., _T]], _T]: ... from jedi.inference.gradual.annotation import infer_return_for_callable return infer_return_for_callable(arguments, param_values, result_values) + def py__get__(self, instance, class_value): + return ValueSet([self]) + class Tuple(BaseTypingInstance): def _is_homogenous(self): @@ -375,7 +400,7 @@ def py__call__(self, func_value_set): return func_value_set -class NewTypeFunction(BaseTypingValue): +class NewTypeFunction(ValueWrapper): def py__call__(self, arguments): ordered_args = arguments.unpack() next(ordered_args, (None, None)) @@ -393,7 +418,7 @@ def py__call__(self, arguments): class NewType(Value): def __init__(self, inference_state, parent_context, tree_node, type_value_set): - super(NewType, self).__init__(inference_state, parent_context) + super().__init__(inference_state, parent_context) self._type_value_set = type_value_set self.tree_node = tree_node @@ -409,8 +434,11 @@ def name(self): from jedi.inference.compiled.value import CompiledValueName return CompiledValueName(self, 'NewType') + def __repr__(self) -> str: + return '%s' % (self.tree_node, self._type_value_set) + -class CastFunction(BaseTypingValue): +class CastFunction(ValueWrapper): @repack_with_argument_clinic('type, object, /') def py__call__(self, type_value_set, object_value_set): return type_value_set.execute_annotation() @@ -436,7 +464,7 @@ def name(self): return ValueName(self, self.tree_node.name) def py__simple_getitem__(self, index): - if isinstance(index, unicode): + if isinstance(index, str): return ValueSet.from_sets( name.infer() for filter in self._definition_class.get_filters(is_instance=True) diff --git a/anaconda_lib/jedi/inference/gradual/utils.py b/anaconda_lib/jedi/inference/gradual/utils.py old mode 100755 new mode 100644 index f77b5d77..af3703c7 --- a/anaconda_lib/jedi/inference/gradual/utils.py +++ b/anaconda_lib/jedi/inference/gradual/utils.py @@ -1,29 +1,34 @@ -import os +from pathlib import Path from jedi.inference.gradual.typeshed import TYPESHED_PATH, create_stub_module -def load_proper_stub_module(inference_state, file_io, import_names, module_node): +def load_proper_stub_module(inference_state, grammar, file_io, import_names, module_node): """ This function is given a random .pyi file and should return the proper module. """ path = file_io.path - assert path.endswith('.pyi') - if path.startswith(TYPESHED_PATH): - # /foo/stdlib/3/os/__init__.pyi -> stdlib/3/os/__init__ - rest = path[len(TYPESHED_PATH) + 1: -4] - split_paths = tuple(rest.split(os.path.sep)) - # Remove the stdlib/3 or third_party/3.5 part - import_names = split_paths[2:] - if import_names[-1] == '__init__': + path = Path(path) + assert path.suffix == '.pyi' + try: + relative_path = path.relative_to(TYPESHED_PATH) + except ValueError: + pass + else: + # /[...]/stdlib/3/os/__init__.pyi -> stdlib/3/os/__init__ + rest = relative_path.with_suffix('') + # Remove the stdlib/3 or third_party/3.6 part + import_names = rest.parts[2:] + if rest.name == '__init__': import_names = import_names[:-1] if import_names is not None: actual_value_set = inference_state.import_module(import_names, prefer_stubs=False) stub = create_stub_module( - inference_state, actual_value_set, module_node, file_io, import_names + inference_state, grammar, actual_value_set, + module_node, file_io, import_names ) inference_state.stub_module_cache[import_names] = stub return stub diff --git a/anaconda_lib/jedi/inference/helpers.py b/anaconda_lib/jedi/inference/helpers.py old mode 100755 new mode 100644 index 3e4d3952..0e344c24 --- a/anaconda_lib/jedi/inference/helpers.py +++ b/anaconda_lib/jedi/inference/helpers.py @@ -7,18 +7,17 @@ from parso.python import tree -from jedi._compatibility import unicode - def is_stdlib_path(path): # Python standard library paths look like this: - # /usr/lib/python3.5/... + # /usr/lib/python3.9/... # TODO The implementation below is probably incorrect and not complete. - if 'dist-packages' in path or 'site-packages' in path: + parts = path.parts + if 'dist-packages' in parts or 'site-packages' in parts: return False base_path = os.path.join(sys.prefix, 'lib', 'python') - return bool(re.match(re.escape(base_path) + r'\d.\d', path)) + return bool(re.match(re.escape(base_path) + r'\d.\d', str(path))) def deep_ast_copy(obj): @@ -122,11 +121,7 @@ def get_names_of_node(node): def is_string(value): - if value.inference_state.environment.version_info.major == 2: - str_classes = (unicode, bytes) - else: - str_classes = (unicode,) - return value.is_compiled() and isinstance(value.get_safe_value(default=None), str_classes) + return value.is_compiled() and isinstance(value.get_safe_value(default=None), str) def is_literal(value): @@ -144,7 +139,7 @@ def get_int_or_none(value): def get_str_or_none(value): - return _get_safe_value_or_none(value, (bytes, unicode)) + return _get_safe_value_or_none(value, str) def is_number(value): diff --git a/anaconda_lib/jedi/inference/imports.py b/anaconda_lib/jedi/inference/imports.py old mode 100755 new mode 100644 index 926d05ef..c1a4953f --- a/anaconda_lib/jedi/inference/imports.py +++ b/anaconda_lib/jedi/inference/imports.py @@ -5,18 +5,15 @@ filesystem. This can be quite tricky sometimes, because Python imports are not always that simple. -This module uses imp for python up to 3.2 and importlib for python 3.3 on; the -correct implementation is delegated to _compatibility. - This module also supports import autocompletion, which means to complete statements like ``from datetim`` (cursor at the end would return ``datetime``). """ import os +from pathlib import Path from parso.python import tree from parso.tree import search_ancestor -from jedi._compatibility import ImplicitNSInfo, force_unicode, FileNotFoundError from jedi import debug from jedi import settings from jedi.file_io import FolderIO @@ -31,10 +28,11 @@ from jedi.inference.base_value import ValueSet, NO_VALUES from jedi.inference.gradual.typeshed import import_module_decorator, \ create_stub_module, parse_stub_module +from jedi.inference.compiled.subprocess.functions import ImplicitNSInfo from jedi.plugins import plugin_manager -class ModuleCache(object): +class ModuleCache: def __init__(self): self._name_cache = {} @@ -152,7 +150,7 @@ def _level_to_base_import_path(project_path, directory, level): return None, directory -class Importer(object): +class Importer: def __init__(self, inference_state, import_path, module_context, level=0): """ An implementation similar to ``__import__``. Use `follow` @@ -192,7 +190,7 @@ def __init__(self, inference_state, import_path, module_context, level=0): import_path = base + tuple(import_path) else: path = module_context.py__file__() - project_path = self._inference_state.project._path + project_path = self._inference_state.project.path import_path = list(import_path) if path is None: # If no path is defined, our best guess is that the current @@ -211,7 +209,7 @@ def __init__(self, inference_state, import_path, module_context, level=0): # somewhere out of the filesystem. self._infer_possible = False else: - self._fixed_sys_path = [force_unicode(base_directory)] + self._fixed_sys_path = [base_directory] if base_import_path is None: if import_path: @@ -240,11 +238,49 @@ def _sys_path_with_modifications(self, is_completion): # inference we want to show the user as much as possible. # See GH #1446. self._inference_state.get_sys_path(add_init_paths=not is_completion) - + sys_path.check_sys_path_modifications(self._module_context) + + [ + str(p) for p + in sys_path.check_sys_path_modifications(self._module_context) + ] ) def follow(self): - if not self.import_path or not self._infer_possible: + if not self.import_path: + if self._fixed_sys_path: + # This is a bit of a special case, that maybe should be + # revisited. If the project path is wrong or the user uses + # relative imports the wrong way, we might end up here, where + # the `fixed_sys_path == project.path` in that case we kind of + # use the project.path.parent directory as our path. This is + # usually not a problem, except if imports in other places are + # using the same names. Example: + # + # foo/ < #1 + # - setup.py + # - foo/ < #2 + # - __init__.py + # - foo.py < #3 + # + # If the top foo is our project folder and somebody uses + # `from . import foo` in `setup.py`, it will resolve to foo #2, + # which means that the import for foo.foo is cached as + # `__init__.py` (#2) and not as `foo.py` (#3). This is usually + # not an issue, because this case is probably pretty rare, but + # might be an issue for some people. + # + # However for most normal cases where we work with different + # file names, this code path hits where we basically change the + # project path to an ancestor of project path. + from jedi.inference.value.namespace import ImplicitNamespaceValue + import_path = (os.path.basename(self._fixed_sys_path[0]),) + ns = ImplicitNamespaceValue( + self._inference_state, + string_names=import_path, + paths=self._fixed_sys_path, + ) + return ValueSet({ns}) + return NO_VALUES + if not self._infer_possible: return NO_VALUES # Check caches first @@ -303,7 +339,7 @@ def completion_names(self, inference_state, only_modules=False): values = self.follow() for value in values: # Non-modules are not completable. - if value.api_type != 'module': # not a module + if value.api_type not in ('module', 'namespace'): # not a module continue if not value.is_compiled(): # sub_modules_dict is not implemented for compiled modules. @@ -332,7 +368,7 @@ def import_module_by_names(inference_state, import_names, sys_path=None, sys_path = inference_state.get_sys_path() str_import_names = tuple( - force_unicode(i.value if isinstance(i, tree.Name) else i) + i.value if isinstance(i, tree.Name) else i for i in import_names ) value_set = [None] @@ -386,20 +422,13 @@ def import_module(inference_state, import_names, parent_module_value, sys_path): # The module might not be a package. return NO_VALUES - for path in paths: - # At the moment we are only using one path. So this is - # not important to be correct. - if not isinstance(path, list): - path = [path] - file_io_or_ns, is_pkg = inference_state.compiled_subprocess.get_module_info( - string=import_names[-1], - path=path, - full_name=module_name, - is_global_search=False, - ) - if is_pkg is not None: - break - else: + file_io_or_ns, is_pkg = inference_state.compiled_subprocess.get_module_info( + string=import_names[-1], + path=paths, + full_name=module_name, + is_global_search=False, + ) + if is_pkg is None: return NO_VALUES if isinstance(file_io_or_ns, ImplicitNSInfo): @@ -470,19 +499,19 @@ def load_module_from_path(inference_state, file_io, import_names=None, is_packag here to ensure that a random path is still properly loaded into the Jedi module structure. """ - path = file_io.path + path = Path(file_io.path) if import_names is None: e_sys_path = inference_state.get_sys_path() import_names, is_package = sys_path.transform_path_to_dotted(e_sys_path, path) else: assert isinstance(is_package, bool) - is_stub = file_io.path.endswith('.pyi') + is_stub = path.suffix == '.pyi' if is_stub: folder_io = file_io.get_parent_folder() if folder_io.path.endswith('-stubs'): folder_io = FolderIO(folder_io.path[:-6]) - if file_io.path.endswith('__init__.pyi'): + if path.name == '__init__.pyi': python_file_io = folder_io.get_file_io('__init__.py') else: python_file_io = folder_io.get_file_io(import_names[-1] + '.py') @@ -497,8 +526,8 @@ def load_module_from_path(inference_state, file_io, import_names=None, is_packag values = NO_VALUES return create_stub_module( - inference_state, values, parse_stub_module(inference_state, file_io), - file_io, import_names + inference_state, inference_state.latest_grammar, values, + parse_stub_module(inference_state, file_io), file_io, import_names ) else: module = _load_python_module( @@ -513,7 +542,7 @@ def load_module_from_path(inference_state, file_io, import_names=None, is_packag def load_namespace_from_path(inference_state, folder_io): import_names, is_package = sys_path.transform_path_to_dotted( inference_state.get_sys_path(), - folder_io.path + Path(folder_io.path) ) from jedi.inference.value.namespace import ImplicitNamespaceValue return ImplicitNamespaceValue(inference_state, import_names, [folder_io.path]) diff --git a/anaconda_lib/jedi/inference/lazy_value.py b/anaconda_lib/jedi/inference/lazy_value.py old mode 100755 new mode 100644 index c7c22a91..b149f21e --- a/anaconda_lib/jedi/inference/lazy_value.py +++ b/anaconda_lib/jedi/inference/lazy_value.py @@ -2,7 +2,7 @@ from jedi.common import monkeypatch -class AbstractLazyValue(object): +class AbstractLazyValue: def __init__(self, data, min=1, max=1): self.data = data self.min = min @@ -29,7 +29,7 @@ def infer(self): class LazyUnknownValue(AbstractLazyValue): def __init__(self, min=1, max=1): - super(LazyUnknownValue, self).__init__(None, min, max) + super().__init__(None, min, max) def infer(self): return NO_VALUES @@ -37,7 +37,7 @@ def infer(self): class LazyTreeValue(AbstractLazyValue): def __init__(self, context, node, min=1, max=1): - super(LazyTreeValue, self).__init__(node, min, max) + super().__init__(node, min, max) self.context = context # We need to save the predefined names. It's an unfortunate side effect # that needs to be tracked otherwise results will be wrong. diff --git a/anaconda_lib/jedi/inference/names.py b/anaconda_lib/jedi/inference/names.py old mode 100755 new mode 100644 index ccf42d4c..f446deb9 --- a/anaconda_lib/jedi/inference/names.py +++ b/anaconda_lib/jedi/inference/names.py @@ -1,11 +1,13 @@ from abc import abstractmethod +from inspect import Parameter +from typing import Optional, Tuple from parso.tree import search_ancestor -from jedi._compatibility import Parameter from jedi.parser_utils import find_statement_documentation, clean_scope_docstring from jedi.inference.utils import unite from jedi.inference.base_value import ValueSet, NO_VALUES +from jedi.inference.cache import inference_state_method_cache from jedi.inference import docstrings from jedi.cache import memoize_method from jedi.inference.helpers import deep_ast_copy, infer_call_of_leaf @@ -23,9 +25,9 @@ def _merge_name_docs(names): return doc -class AbstractNameDefinition(object): - start_pos = None - string_name = None +class AbstractNameDefinition: + start_pos: Optional[Tuple[int, int]] = None + string_name: str parent_context = None tree_name = None is_value_name = True @@ -123,7 +125,7 @@ def get_qualified_names(self, include_module_names=False): else: return None - return super(AbstractTreeName, self).get_qualified_names(include_module_names) + return super().get_qualified_names(include_module_names) def _get_qualified_names(self): parent_names = self.parent_context.get_qualified_names() @@ -223,7 +225,7 @@ def start_pos(self): return self.tree_name.start_pos -class ValueNameMixin(object): +class ValueNameMixin: def infer(self): return ValueSet([self._value]) @@ -242,7 +244,7 @@ def _get_qualified_names(self): def get_root_context(self): if self.parent_context is None: # A module return self._value.as_context() - return super(ValueNameMixin, self).get_root_context() + return super().get_root_context() def get_defining_qualified_value(self): context = self.parent_context @@ -257,7 +259,7 @@ def api_type(self): class ValueName(ValueNameMixin, AbstractTreeName): def __init__(self, value, tree_name): - super(ValueName, self).__init__(value.parent_context, tree_name) + super().__init__(value.parent_context, tree_name) self._value = value def goto(self): @@ -330,9 +332,21 @@ def assignment_indexes(self): node = node.parent return indexes + @property + def inference_state(self): + # Used by the cache function below + return self.parent_context.inference_state + + @inference_state_method_cache(default='') def py__doc__(self): api_type = self.api_type - if api_type in ('function', 'class'): + if api_type in ('function', 'class', 'property'): + if self.parent_context.get_root_context().is_stub(): + from jedi.inference.gradual.conversion import convert_names + names = convert_names([self], prefer_stub_to_compiled=False) + if self not in names: + return _merge_name_docs(names) + # Make sure the names are not TreeNameDefinitions anymore. return clean_scope_docstring(self.tree_name.get_definition()) @@ -346,7 +360,7 @@ def py__doc__(self): return '' -class _ParamMixin(object): +class _ParamMixin: def maybe_positional_argument(self, include_star=True): options = [Parameter.POSITIONAL_ONLY, Parameter.POSITIONAL_OR_KEYWORD] if include_star: @@ -372,7 +386,7 @@ def get_qualified_names(self, include_module_names=False): class ParamNameInterface(_ParamMixin): - api_type = u'param' + api_type = 'param' def get_kind(self): raise NotImplementedError @@ -400,6 +414,9 @@ def star_count(self): return 2 return 0 + def infer_default(self): + return NO_VALUES + class BaseTreeParamName(ParamNameInterface, AbstractTreeName): annotation_node = None @@ -429,7 +446,7 @@ def goto(self, **kwargs): class _ActualTreeParamName(BaseTreeParamName): def __init__(self, function_value, tree_name): - super(_ActualTreeParamName, self).__init__( + super().__init__( function_value.get_default_param_context(), tree_name) self.function_value = function_value @@ -499,11 +516,11 @@ def infer(self): class AnonymousParamName(_ActualTreeParamName): @plugin_manager.decorate(name='goto_anonymous_param') def goto(self): - return super(AnonymousParamName, self).goto() + return super().goto() @plugin_manager.decorate(name='infer_anonymous_param') def infer(self): - values = super(AnonymousParamName, self).infer() + values = super().infer() if values: return values from jedi.inference.dynamic_params import dynamic_param_lookup @@ -527,11 +544,11 @@ def infer(self): class ParamName(_ActualTreeParamName): def __init__(self, function_value, tree_name, arguments): - super(ParamName, self).__init__(function_value, tree_name) + super().__init__(function_value, tree_name) self.arguments = arguments def infer(self): - values = super(ParamName, self).infer() + values = super().infer() if values: return values @@ -604,7 +621,7 @@ class SubModuleName(ImportName): _level = 1 -class NameWrapper(object): +class NameWrapper: def __init__(self, wrapped_name): self._wrapped_name = wrapped_name @@ -615,7 +632,7 @@ def __repr__(self): return '%s(%s)' % (self.__class__.__name__, self._wrapped_name) -class StubNameMixin(object): +class StubNameMixin: def py__doc__(self): from jedi.inference.gradual.conversion import convert_names # Stubs are not complicated and we can just follow simple statements @@ -627,7 +644,7 @@ def py__doc__(self): names = convert_names(names, prefer_stub_to_compiled=False) if self in names: - return super(StubNameMixin, self).py__doc__() + return super().py__doc__() else: # We have signatures ourselves in stubs, so don't use signatures # from the implementation. @@ -637,7 +654,7 @@ def py__doc__(self): # From here on down we make looking up the sys.version_info fast. class StubName(StubNameMixin, TreeNameDefinition): def infer(self): - inferred = super(StubName, self).infer() + inferred = super().infer() if self.string_name == 'version_info' and self.get_root_context().py__name__() == 'sys': from jedi.inference.gradual.stub_value import VersionInfo return ValueSet(VersionInfo(c) for c in inferred) diff --git a/anaconda_lib/jedi/inference/param.py b/anaconda_lib/jedi/inference/param.py old mode 100755 new mode 100644 index c1ce541a..1f296215 --- a/anaconda_lib/jedi/inference/param.py +++ b/anaconda_lib/jedi/inference/param.py @@ -1,4 +1,5 @@ from collections import defaultdict +from inspect import Parameter from jedi import debug from jedi.inference.utils import PushBackIterator @@ -6,7 +7,6 @@ from jedi.inference.lazy_value import LazyKnownValue, \ LazyTreeValue, LazyUnknownValue from jedi.inference.value import iterable -from jedi._compatibility import Parameter from jedi.inference.names import ParamName @@ -20,8 +20,7 @@ def _add_argument_issue(error_name, lazy_value, message): class ExecutedParamName(ParamName): def __init__(self, function_value, arguments, param_node, lazy_value, is_default=False): - super(ExecutedParamName, self).__init__( - function_value, param_node.name, arguments=arguments) + super().__init__(function_value, param_node.name, arguments=arguments) self._lazy_value = lazy_value self._is_default = is_default diff --git a/anaconda_lib/jedi/inference/parser_cache.py b/anaconda_lib/jedi/inference/parser_cache.py old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/inference/recursion.py b/anaconda_lib/jedi/inference/recursion.py old mode 100755 new mode 100644 index a0897fa8..cc241873 --- a/anaconda_lib/jedi/inference/recursion.py +++ b/anaconda_lib/jedi/inference/recursion.py @@ -12,7 +12,7 @@ Settings ~~~~~~~~~~ -Recursion settings are important if you don't want extremly +Recursion settings are important if you don't want extremely recursive python code to go absolutely crazy. The default values are based on experiments while completing the |jedi| library @@ -50,7 +50,7 @@ """ -class RecursionDetector(object): +class RecursionDetector: def __init__(self): self.pushed_nodes = [] @@ -92,7 +92,7 @@ def wrapper(self, **kwargs): return decorator -class ExecutionRecursionDetector(object): +class ExecutionRecursionDetector: """ Catches recursions of executions. """ diff --git a/anaconda_lib/jedi/inference/references.py b/anaconda_lib/jedi/inference/references.py old mode 100755 new mode 100644 index 23ce5c63..6ffa160e --- a/anaconda_lib/jedi/inference/references.py +++ b/anaconda_lib/jedi/inference/references.py @@ -4,12 +4,13 @@ from parso import python_bytes_to_unicode from jedi.debug import dbg -from jedi.file_io import KnownContentFileIO -from jedi.inference.imports import SubModuleName, load_module_from_path +from jedi.file_io import KnownContentFileIO, FolderIO +from jedi.inference.names import SubModuleName +from jedi.inference.imports import load_module_from_path from jedi.inference.filters import ParserTreeFilter from jedi.inference.gradual.conversion import convert_names -_IGNORE_FOLDERS = ('.tox', '.venv', 'venv', '__pycache__') +_IGNORE_FOLDERS = ('.tox', '.venv', '.mypy_cache', 'venv', '__pycache__') _OPENED_FILE_LIMIT = 2000 """ @@ -38,8 +39,7 @@ def _resolve_names(definition_names, avoid_names=()): yield name if name.api_type == 'module': - for n in _resolve_names(name.goto(), definition_names): - yield n + yield from _resolve_names(name.goto(), definition_names) def _dictionarize(names): @@ -90,8 +90,7 @@ def _add_names_in_same_context(context, string_name): names = set(filter_.get(string_name)) if not names: break - for name in names: - yield name + yield from names ordered = sorted(names, key=lambda x: x.start_pos) until_position = ordered[0].start_pos @@ -109,11 +108,10 @@ def _find_global_variables(names, search_name): for global_name in method().get(search_name): yield global_name c = module_context.create_context(global_name.tree_name) - for n in _add_names_in_same_context(c, global_name.string_name): - yield n + yield from _add_names_in_same_context(c, global_name.string_name) -def find_references(module_context, tree_name): +def find_references(module_context, tree_name, only_in_module=False): inf = module_context.inference_state search_name = tree_name.value @@ -127,10 +125,14 @@ def find_references(module_context, tree_name): found_names_dct = _dictionarize(found_names) - module_contexts = set(d.get_root_context() for d in found_names) - module_contexts = [module_context] + [m for m in module_contexts if m != module_context] + module_contexts = [module_context] + if not only_in_module: + for m in set(d.get_root_context() for d in found_names): + if m != module_context and m.tree_node is not None \ + and inf.project.path in m.py__file__().parents: + module_contexts.append(m) # For param no search for other modules is necessary. - if any(n.api_type == 'param' for n in found_names): + if only_in_module or any(n.api_type == 'param' for n in found_names): potential_modules = module_contexts else: potential_modules = get_module_contexts_containing_name( @@ -157,7 +159,10 @@ def find_references(module_context, tree_name): else: for name in new: non_matching_reference_maps.setdefault(name, []).append(new) - return found_names_dct.values() + result = found_names_dct.values() + if only_in_module: + return [n for n in result if n.get_root_context() == module_context] + return result def _check_fs(inference_state, file_io, regex): @@ -199,11 +204,11 @@ def recurse_find_python_folders_and_files(folder_io, except_paths=()): # Delete folders that we don't want to iterate over. for file_io in file_ios: path = file_io.path - if path.endswith('.py') or path.endswith('.pyi'): + if path.suffix in ('.py', '.pyi'): if path not in except_paths: yield None, file_io - if path.endswith('.gitignore'): + if path.name == '.gitignore': ignored_paths, ignored_names = \ gitignored_lines(root_folder_io, file_io) except_paths |= ignored_paths @@ -245,6 +250,11 @@ def _find_python_files_in_sys_path(inference_state, module_contexts): folder_io = folder_io.get_parent_folder() +def _find_project_modules(inference_state, module_contexts): + except_ = [m.py__file__() for m in module_contexts] + yield from recurse_find_python_files(FolderIO(inference_state.project.path), except_) + + def get_module_contexts_containing_name(inference_state, module_contexts, name, limit_reduction=1): """ @@ -264,18 +274,21 @@ def get_module_contexts_containing_name(inference_state, module_contexts, name, if len(name) <= 2: return - file_io_iterator = _find_python_files_in_sys_path(inference_state, module_contexts) - for x in search_in_file_ios(inference_state, file_io_iterator, name, - limit_reduction=limit_reduction): - yield x # Python 2... + # Currently not used, because there's only `scope=project` and `scope=file` + # At the moment there is no such thing as `scope=sys.path`. + # file_io_iterator = _find_python_files_in_sys_path(inference_state, module_contexts) + file_io_iterator = _find_project_modules(inference_state, module_contexts) + yield from search_in_file_ios(inference_state, file_io_iterator, name, + limit_reduction=limit_reduction) -def search_in_file_ios(inference_state, file_io_iterator, name, limit_reduction=1): +def search_in_file_ios(inference_state, file_io_iterator, name, + limit_reduction=1, complete=False): parse_limit = _PARSED_FILE_LIMIT / limit_reduction open_limit = _OPENED_FILE_LIMIT / limit_reduction file_io_count = 0 parsed_file_count = 0 - regex = re.compile(r'\b' + re.escape(name) + r'\b') + regex = re.compile(r'\b' + re.escape(name) + (r'' if complete else r'\b')) for file_io in file_io_iterator: file_io_count += 1 m = _check_fs(inference_state, file_io, regex) diff --git a/anaconda_lib/jedi/inference/signature.py b/anaconda_lib/jedi/inference/signature.py old mode 100755 new mode 100644 index c6aa75e6..565a269b --- a/anaconda_lib/jedi/inference/signature.py +++ b/anaconda_lib/jedi/inference/signature.py @@ -1,10 +1,11 @@ -from jedi._compatibility import Parameter +from inspect import Parameter + from jedi.cache import memoize_method from jedi import debug from jedi import parser_utils -class _SignatureMixin(object): +class _SignatureMixin: def to_string(self): def param_strings(): is_positional = False @@ -67,7 +68,7 @@ def __repr__(self): class TreeSignature(AbstractSignature): def __init__(self, value, function_value=None, is_bound=False): - super(TreeSignature, self).__init__(value, is_bound) + super().__init__(value, is_bound) self._function_value = function_value or value def bind(self, value): @@ -90,10 +91,12 @@ def annotation_string(self): @memoize_method def get_param_names(self, resolve_stars=False): - params = super(TreeSignature, self).get_param_names(resolve_stars=False) + params = self._function_value.get_param_names() if resolve_stars: from jedi.inference.star_args import process_params params = process_params(params) + if self.is_bound: + return params[1:] return params def matches_signature(self, arguments): @@ -119,7 +122,7 @@ def matches_signature(self, arguments): class BuiltinSignature(AbstractSignature): def __init__(self, value, return_string, function_value=None, is_bound=False): - super(BuiltinSignature, self).__init__(value, is_bound) + super().__init__(value, is_bound) self._return_string = return_string self.__function_value = function_value diff --git a/anaconda_lib/jedi/inference/star_args.py b/anaconda_lib/jedi/inference/star_args.py old mode 100755 new mode 100644 index 0cda3839..71ea7093 --- a/anaconda_lib/jedi/inference/star_args.py +++ b/anaconda_lib/jedi/inference/star_args.py @@ -10,8 +10,10 @@ def bar(*args): The signature here for bar should be `bar(b, c)` instead of bar(*args). """ +from inspect import Parameter + +from parso import tree -from jedi._compatibility import Parameter from jedi.inference.utils import to_list from jedi.inference.names import ParamNameWrapper from jedi.inference.helpers import is_big_annoying_library @@ -22,7 +24,11 @@ def _iter_nodes_for_param(param_name): from jedi.inference.arguments import TreeArguments execution_context = param_name.parent_context - function_node = execution_context.tree_node + # Walk up the parso tree to get the FunctionNode we want. We use the parso + # tree rather than going via the execution context so that we're agnostic of + # the specific scope we're evaluating within (i.e: module or function, + # etc.). + function_node = tree.search_ancestor(param_name.tree_name, 'funcdef', 'lambdef') module_node = function_node.get_root_node() start = function_node.children[-1].start_pos end = function_node.children[-1].end_pos @@ -32,8 +38,6 @@ def _iter_nodes_for_param(param_name): argument = name.parent if argument.type == 'argument' \ and argument.children[0] == '*' * param_name.star_count: - # No support for Python 2.7 here, but they are end-of-life - # anyway trailer = search_ancestor(argument, 'trailer') if trailer is not None: # Make sure we're in a function context = execution_context.create_context(trailer) @@ -98,8 +102,7 @@ def process_params(param_names, star_count=3): # default means both * and ** if is_big_annoying_library(param_names[0].parent_context): # At first this feature can look innocent, but it does a lot of # type inference in some cases, so we just ditch it. - for p in param_names: - yield p + yield from param_names return used_names = set() @@ -210,7 +213,7 @@ def process_params(param_names, star_count=3): # default means both * and ** class ParamNameFixedKind(ParamNameWrapper): def __init__(self, param_name, new_kind): - super(ParamNameFixedKind, self).__init__(param_name) + super().__init__(param_name) self._new_kind = new_kind def get_kind(self): diff --git a/anaconda_lib/jedi/inference/syntax_tree.py b/anaconda_lib/jedi/inference/syntax_tree.py old mode 100755 new mode 100644 index 7983bef3..f55ab56b --- a/anaconda_lib/jedi/inference/syntax_tree.py +++ b/anaconda_lib/jedi/inference/syntax_tree.py @@ -5,7 +5,6 @@ from parso.python import tree -from jedi._compatibility import force_unicode, unicode from jedi import debug from jedi import parser_utils from jedi.inference.base_value import ValueSet, NO_VALUES, ContextualizedNode, \ @@ -31,6 +30,26 @@ from jedi.inference.value.decorator import Decoratee from jedi.plugins import plugin_manager +operator_to_magic_method = { + '+': '__add__', + '-': '__sub__', + '*': '__mul__', + '@': '__matmul__', + '/': '__truediv__', + '//': '__floordiv__', + '%': '__mod__', + '**': '__pow__', + '<<': '__lshift__', + '>>': '__rshift__', + '&': '__and__', + '|': '__or__', + '^': '__xor__', +} + +reverse_operator_to_magic_method = { + k: '__r' + v[2:] for k, v in operator_to_magic_method.items() +} + def _limit_value_infers(func): """ @@ -205,12 +224,10 @@ def _infer_node(context, element): | context.infer_node(element.children[-1])) elif typ == 'operator': # Must be an ellipsis, other operators are not inferred. - # In Python 2 ellipsis is coded as three single dot tokens, not - # as one token 3 dot token. - if element.value not in ('.', '...'): + if element.value != '...': origin = element.parent raise AssertionError("unhandled operator %s in %s " % (repr(element.value), origin)) - return ValueSet([compiled.builtin_from_name(inference_state, u'Ellipsis')]) + return ValueSet([compiled.builtin_from_name(inference_state, 'Ellipsis')]) elif typ == 'dotted_name': value_set = infer_atom(context, element.children[0]) for next_name in element.children[2::2]: @@ -269,15 +286,12 @@ def infer_atom(context, atom): """ state = context.inference_state if atom.type == 'name': - if atom.value in ('True', 'False', 'None'): - # Python 2... - return ValueSet([compiled.builtin_from_name(state, atom.value)]) - # This is the first global lookup. - stmt = tree.search_ancestor( - atom, 'expr_stmt', 'lambdef' - ) or atom - if stmt.type == 'lambdef': + stmt = tree.search_ancestor(atom, 'expr_stmt', 'lambdef', 'if_stmt') or atom + if stmt.type == 'if_stmt': + if not any(n.start_pos <= atom.start_pos < n.end_pos for n in stmt.get_test_nodes()): + stmt = atom + elif stmt.type == 'lambdef': stmt = atom position = stmt.start_pos if _is_annotation_name(atom): @@ -292,9 +306,6 @@ def infer_atom(context, atom): # For False/True/None if atom.value in ('False', 'True', 'None'): return ValueSet([compiled.builtin_from_name(state, atom.value)]) - elif atom.value == 'print': - # print e.g. could be inferred like this in Python 2.7 - return NO_VALUES elif atom.value == 'yield': # Contrary to yield from, yield can just appear alone to return a # value when used with `.send()`. @@ -309,7 +320,7 @@ def infer_atom(context, atom): value_set = infer_atom(context, atom.children[0]) for string in atom.children[1:]: right = infer_atom(context, string) - value_set = _infer_comparison(context, value_set, u'+', right) + value_set = _infer_comparison(context, value_set, '+', right) return value_set elif atom.type == 'fstring': return compiled.get_string_value_set(state) @@ -538,16 +549,16 @@ def _is_annotation_name(name): return False -def _is_tuple(value): - return isinstance(value, iterable.Sequence) and value.array_type == 'tuple' +def _is_list(value): + return value.array_type == 'list' -def _is_list(value): - return isinstance(value, iterable.Sequence) and value.array_type == 'list' +def _is_tuple(value): + return value.array_type == 'tuple' def _bool_to_value(inference_state, bool_): - return compiled.builtin_from_name(inference_state, force_unicode(str(bool_))) + return compiled.builtin_from_name(inference_state, str(bool_)) def _get_tuple_ints(value): @@ -570,10 +581,10 @@ def _get_tuple_ints(value): def _infer_comparison_part(inference_state, context, left, operator, right): l_is_num = is_number(left) r_is_num = is_number(right) - if isinstance(operator, unicode): + if isinstance(operator, str): str_operator = operator else: - str_operator = force_unicode(str(operator.value)) + str_operator = str(operator.value) if str_operator == '*': # for iterables, ignore * operations @@ -584,7 +595,7 @@ def _infer_comparison_part(inference_state, context, left, operator, right): elif str_operator == '+': if l_is_num and r_is_num or is_string(left) and is_string(right): return left.execute_operation(right, str_operator) - elif _is_tuple(left) and _is_tuple(right) or _is_list(left) and _is_list(right): + elif _is_list(left) and _is_list(right) or _is_tuple(left) and _is_tuple(right): return ValueSet([iterable.MergedArray(inference_state, (left, right))]) elif str_operator == '-': if l_is_num and r_is_num: @@ -622,7 +633,7 @@ def _infer_comparison_part(inference_state, context, left, operator, right): _bool_to_value(inference_state, True), _bool_to_value(inference_state, False) ]) - elif str_operator == 'in': + elif str_operator in ('in', 'not in'): return NO_VALUES def check(obj): @@ -637,6 +648,24 @@ def check(obj): analysis.add(context, 'type-error-operation', operator, message % (left, right)) + if left.is_class() or right.is_class(): + return NO_VALUES + + method_name = operator_to_magic_method[str_operator] + magic_methods = left.py__getattribute__(method_name) + if magic_methods: + result = magic_methods.execute_with_values(right) + if result: + return result + + if not magic_methods: + reverse_method_name = reverse_operator_to_magic_method[str_operator] + magic_methods = right.py__getattribute__(reverse_method_name) + + result = magic_methods.execute_with_values(left) + if result: + return result + result = ValueSet([left, right]) debug.dbg('Used operator %s resulting in %s', operator, result) return result @@ -709,7 +738,14 @@ def tree_name_to_values(inference_state, context, tree_name): types = infer_expr_stmt(context, node, tree_name) elif typ == 'with_stmt': value_managers = context.infer_node(node.get_test_node_from_name(tree_name)) - enter_methods = value_managers.py__getattribute__(u'__enter__') + if node.parent.type == 'async_stmt': + # In the case of `async with` statements, we need to + # first get the coroutine from the `__aenter__` method, + # then "unwrap" via the `__await__` method + enter_methods = value_managers.py__getattribute__('__aenter__') + coro = enter_methods.execute_with_values() + return coro.py__await__().py__stop_iteration_returns() + enter_methods = value_managers.py__getattribute__('__enter__') return enter_methods.execute_with_values() elif typ in ('import_from', 'import_name'): types = imports.infer_import(context, tree_name) @@ -725,6 +761,8 @@ def tree_name_to_values(inference_state, context, tree_name): types = NO_VALUES elif typ == 'del_stmt': types = NO_VALUES + elif typ == 'namedexpr_test': + types = infer_node(context, node) else: raise ValueError("Should not happen. type: %s" % typ) return types @@ -823,8 +861,7 @@ def _infer_subscript_list(context, index): return ValueSet([iterable.Slice(context, None, None, None)]) elif index.type == 'subscript' and not index.children[0] == '.': - # subscript basically implies a slice operation, except for Python 2's - # Ellipsis. + # subscript basically implies a slice operation # e.g. array[:3] result = [] for el in index.children: diff --git a/anaconda_lib/jedi/inference/sys_path.py b/anaconda_lib/jedi/inference/sys_path.py old mode 100755 new mode 100644 index 5b82ec15..062a0aa3 --- a/anaconda_lib/jedi/inference/sys_path.py +++ b/anaconda_lib/jedi/inference/sys_path.py @@ -1,11 +1,11 @@ import os import re +from pathlib import Path +from importlib.machinery import all_suffixes -from jedi._compatibility import unicode, force_unicode, all_suffixes from jedi.inference.cache import inference_state_method_cache from jedi.inference.base_value import ContextualizedNode from jedi.inference.helpers import is_string, get_str_or_none -from jedi.common import traverse_parents from jedi.parser_utils import get_cached_code_lines from jedi.file_io import FileIO from jedi import settings @@ -14,8 +14,9 @@ _BUILDOUT_PATH_INSERTION_LIMIT = 10 -def _abs_path(module_context, path): - if os.path.isabs(path): +def _abs_path(module_context, str_path: str): + path = Path(str_path) + if path.is_absolute(): return path module_path = module_context.py__file__() @@ -24,9 +25,8 @@ def _abs_path(module_context, path): # system. return None - base_dir = os.path.dirname(module_path) - path = force_unicode(path) - return os.path.abspath(os.path.join(base_dir, path)) + base_dir = module_path.parent + return base_dir.joinpath(path).absolute() def _paths_from_assignment(module_context, expr_stmt): @@ -148,7 +148,7 @@ def discover_buildout_paths(inference_state, script_path): def _get_paths_from_buildout_script(inference_state, buildout_script_path): - file_io = FileIO(buildout_script_path) + file_io = FileIO(str(buildout_script_path)) try: module_node = inference_state.parse( file_io=file_io, @@ -166,36 +166,37 @@ def _get_paths_from_buildout_script(inference_state, buildout_script_path): string_names=None, code_lines=get_cached_code_lines(inference_state.grammar, buildout_script_path), ).as_context() - for path in check_sys_path_modifications(module_context): - yield path + yield from check_sys_path_modifications(module_context) -def _get_parent_dir_with_file(path, filename): - for parent in traverse_parents(path): - if os.path.isfile(os.path.join(parent, filename)): - return parent +def _get_parent_dir_with_file(path: Path, filename): + for parent in path.parents: + try: + if parent.joinpath(filename).is_file(): + return parent + except OSError: + continue return None -def _get_buildout_script_paths(search_path): +def _get_buildout_script_paths(search_path: Path): """ if there is a 'buildout.cfg' file in one of the parent directories of the given module it will return a list of all files in the buildout bin directory that look like python files. :param search_path: absolute path to the module. - :type search_path: str """ project_root = _get_parent_dir_with_file(search_path, 'buildout.cfg') if not project_root: return - bin_path = os.path.join(project_root, 'bin') - if not os.path.exists(bin_path): + bin_path = project_root.joinpath('bin') + if not bin_path.exists(): return for filename in os.listdir(bin_path): try: - filepath = os.path.join(bin_path, filename) + filepath = bin_path.joinpath(filename) with open(filepath, 'r') as f: firstline = f.readline() if firstline.startswith('#!') and 'python' in firstline: @@ -203,14 +204,14 @@ def _get_buildout_script_paths(search_path): except (UnicodeDecodeError, IOError) as e: # Probably a binary file; permission error or race cond. because # file got deleted. Ignore it. - debug.warning(unicode(e)) + debug.warning(str(e)) continue def remove_python_path_suffix(path): for suffix in all_suffixes() + ['.pyi']: - if path.endswith(suffix): - path = path[:-len(suffix)] + if path.suffix == suffix: + path = path.with_name(path.stem) break return path @@ -219,8 +220,7 @@ def transform_path_to_dotted(sys_path, module_path): """ Returns the dotted path inside a sys.path as a list of names. e.g. - >>> from os.path import abspath - >>> transform_path_to_dotted([abspath("/foo")], abspath('/foo/bar/baz.py')) + >>> transform_path_to_dotted([str(Path("/foo").absolute())], Path('/foo/bar/baz.py').absolute()) (('bar', 'baz'), False) Returns (None, False) if the path doesn't really resolve to anything. @@ -228,21 +228,22 @@ def transform_path_to_dotted(sys_path, module_path): """ # First remove the suffix. module_path = remove_python_path_suffix(module_path) + if module_path.name.startswith('.'): + return None, False # Once the suffix was removed we are using the files as we know them. This # means that if someone uses an ending like .vim for a Python file, .vim # will be part of the returned dotted part. - is_package = module_path.endswith(os.path.sep + '__init__') + is_package = module_path.name == '__init__' if is_package: - # -1 to remove the separator - module_path = module_path[:-len('__init__') - 1] + module_path = module_path.parent def iter_potential_solutions(): for p in sys_path: - if module_path.startswith(p): + if str(module_path).startswith(p): # Strip the trailing slash/backslash - rest = module_path[len(p):] + rest = str(module_path)[len(p):] # On Windows a path can also use a slash. if rest.startswith(os.path.sep) or rest.startswith('/'): # Remove a slash in cases it's still there. diff --git a/anaconda_lib/jedi/inference/utils.py b/anaconda_lib/jedi/inference/utils.py old mode 100755 new mode 100644 index 422e17e7..ab10bcd9 --- a/anaconda_lib/jedi/inference/utils.py +++ b/anaconda_lib/jedi/inference/utils.py @@ -1,12 +1,8 @@ """ A universal module with functions / classes without dependencies. """ -import sys -import contextlib import functools import re import os -from jedi._compatibility import reraise - _sep = os.path.sep if os.path.altsep is not None: @@ -36,7 +32,6 @@ class UncaughtAttributeError(Exception): """ Important, because `__getattr__` and `hasattr` catch AttributeErrors implicitly. This is really evil (mainly because of `__getattr__`). - `hasattr` in Python 2 is even more evil, because it catches ALL exceptions. Therefore this class originally had to be derived from `BaseException` instead of `Exception`. But because I removed relevant `hasattr` from the code base, we can now switch back to `Exception`. @@ -65,21 +60,17 @@ def reraise_uncaught(func): difficult. This decorator is to help us getting there by changing `AttributeError` to `UncaughtAttributeError` to avoid unexpected catch. This helps us noticing bugs earlier and facilitates debugging. - - .. note:: Treating StopIteration here is easy. - Add that feature when needed. """ @functools.wraps(func) def wrapper(*args, **kwds): try: return func(*args, **kwds) - except AttributeError: - exc_info = sys.exc_info() - reraise(UncaughtAttributeError(exc_info[1]), exc_info[2]) + except AttributeError as e: + raise UncaughtAttributeError(e) from e return wrapper -class PushBackIterator(object): +class PushBackIterator: def __init__(self, iterator): self.pushes = [] self.iterator = iterator @@ -91,25 +82,9 @@ def push_back(self, value): def __iter__(self): return self - def next(self): - """ Python 2 Compatibility """ - return self.__next__() - def __next__(self): if self.pushes: self.current = self.pushes.pop() else: self.current = next(self.iterator) return self.current - - -@contextlib.contextmanager -def ignored(*exceptions): - """ - Value manager that ignores all of the specified exceptions. This will - be in the standard library starting with Python 3.5. - """ - try: - yield - except exceptions: - pass diff --git a/anaconda_lib/jedi/inference/value/__init__.py b/anaconda_lib/jedi/inference/value/__init__.py old mode 100755 new mode 100644 index 2e17ba26..62164215 --- a/anaconda_lib/jedi/inference/value/__init__.py +++ b/anaconda_lib/jedi/inference/value/__init__.py @@ -1,3 +1,6 @@ +# Re-export symbols for wider use. We configure mypy and flake8 to be aware that +# this file does this. + from jedi.inference.value.module import ModuleValue from jedi.inference.value.klass import ClassValue from jedi.inference.value.function import FunctionValue, \ diff --git a/anaconda_lib/jedi/inference/value/decorator.py b/anaconda_lib/jedi/inference/value/decorator.py old mode 100755 new mode 100644 index 3fe4be40..69c4cb6a --- a/anaconda_lib/jedi/inference/value/decorator.py +++ b/anaconda_lib/jedi/inference/value/decorator.py @@ -3,13 +3,32 @@ docstrings and other things around decorators. ''' -from jedi.inference.base_value import ValueWrapper +from jedi.inference.base_value import ValueWrapper, ValueSet class Decoratee(ValueWrapper): def __init__(self, wrapped_value, original_value): - super(Decoratee, self).__init__(wrapped_value) + super().__init__(wrapped_value) self._original_value = original_value def py__doc__(self): return self._original_value.py__doc__() + + def py__get__(self, instance, class_value): + return ValueSet( + Decoratee(v, self._original_value) + for v in self._wrapped_value.py__get__(instance, class_value) + ) + + def get_signatures(self): + signatures = self._wrapped_value.get_signatures() + if signatures: + return signatures + # Fallback to signatures of the original function/class if the + # decorator has no signature or it is not inferrable. + # + # __get__ means that it's a descriptor. In that case we don't return + # signatures, because they are usually properties. + if not self._wrapped_value.py__getattribute__('__get__'): + return self._original_value.get_signatures() + return [] diff --git a/anaconda_lib/jedi/inference/value/dynamic_arrays.py b/anaconda_lib/jedi/inference/value/dynamic_arrays.py old mode 100755 new mode 100644 index e0b38f54..4353a488 --- a/anaconda_lib/jedi/inference/value/dynamic_arrays.py +++ b/anaconda_lib/jedi/inference/value/dynamic_arrays.py @@ -155,14 +155,12 @@ def py__iter__(self, contextualized_node=None): except StopIteration: pass else: - for lazy in lazy_value.infer().iterate(): - yield lazy + yield from lazy_value.infer().iterate() from jedi.inference.arguments import TreeArguments if isinstance(arguments, TreeArguments): additions = _internal_check_array_additions(arguments.context, self._instance) - for addition in additions: - yield addition + yield from additions def iterate(self, contextualized_node=None, is_async=False): return self.py__iter__(contextualized_node) @@ -170,7 +168,7 @@ def iterate(self, contextualized_node=None, is_async=False): class _Modification(ValueWrapper): def __init__(self, wrapped_value, assigned_values, contextualized_key): - super(_Modification, self).__init__(wrapped_value) + super().__init__(wrapped_value) self._assigned_values = assigned_values self._contextualized_key = contextualized_key @@ -189,8 +187,7 @@ def py__simple_getitem__(self, index): class DictModification(_Modification): def py__iter__(self, contextualized_node=None): - for lazy_context in self._wrapped_value.py__iter__(contextualized_node): - yield lazy_context + yield from self._wrapped_value.py__iter__(contextualized_node) yield self._contextualized_key def get_key_values(self): @@ -199,6 +196,5 @@ def get_key_values(self): class ListModification(_Modification): def py__iter__(self, contextualized_node=None): - for lazy_context in self._wrapped_value.py__iter__(contextualized_node): - yield lazy_context + yield from self._wrapped_value.py__iter__(contextualized_node) yield LazyKnownValues(self._assigned_values) diff --git a/anaconda_lib/jedi/inference/value/function.py b/anaconda_lib/jedi/inference/value/function.py old mode 100755 new mode 100644 index 7513c6a9..a89e9c88 --- a/anaconda_lib/jedi/inference/value/function.py +++ b/anaconda_lib/jedi/inference/value/function.py @@ -1,6 +1,5 @@ from parso.python import tree -from jedi._compatibility import use_metaclass from jedi import debug from jedi.inference.cache import inference_state_method_cache, CachedMetaClass from jedi.inference import compiled @@ -26,7 +25,7 @@ class LambdaName(AbstractNameDefinition): string_name = '' - api_type = u'function' + api_type = 'function' def __init__(self, lambda_value): self._lambda_value = lambda_value @@ -54,14 +53,13 @@ def get_qualified_names(self): return None -class FunctionMixin(object): - api_type = u'function' +class FunctionMixin: + api_type = 'function' def get_filters(self, origin_scope=None): cls = self.py__class__() for instance in cls.execute_with_values(): - for filter in instance.get_filters(origin_scope=origin_scope): - yield filter + yield from instance.get_filters(origin_scope=origin_scope) def py__get__(self, instance, class_value): from jedi.inference.value.instance import BoundMethod @@ -126,7 +124,7 @@ def get_signatures(self): return [TreeSignature(f) for f in self.get_signature_functions()] -class FunctionValue(use_metaclass(CachedMetaClass, FunctionMixin, FunctionAndClassBase)): +class FunctionValue(FunctionMixin, FunctionAndClassBase, metaclass=CachedMetaClass): @classmethod def from_context(cls, context, tree_node): def create(tree_node): @@ -161,7 +159,7 @@ def create(tree_node): return function def py__class__(self): - c, = values_from_qualified_names(self.inference_state, u'types', u'FunctionType') + c, = values_from_qualified_names(self.inference_state, 'types', 'FunctionType') return c def get_default_param_context(self): @@ -173,7 +171,7 @@ def get_signature_functions(self): class FunctionNameInClass(NameWrapper): def __init__(self, class_context, name): - super(FunctionNameInClass, self).__init__(name) + super().__init__(name) self._class_context = class_context def get_defining_qualified_value(self): @@ -182,7 +180,7 @@ def get_defining_qualified_value(self): class MethodValue(FunctionValue): def __init__(self, inference_state, class_context, *args, **kwargs): - super(MethodValue, self).__init__(inference_state, *args, **kwargs) + super().__init__(inference_state, *args, **kwargs) self.class_context = class_context def get_default_param_context(self): @@ -198,11 +196,11 @@ def get_qualified_names(self): @property def name(self): - return FunctionNameInClass(self.class_context, super(MethodValue, self).name) + return FunctionNameInClass(self.class_context, super().name) class BaseFunctionExecutionContext(ValueContext, TreeContextMixin): - def _infer_annotations(self): + def infer_annotations(self): raise NotImplementedError @inference_state_method_cache(default=NO_VALUES) @@ -216,7 +214,7 @@ def get_return_values(self, check_yields=False): value_set = NO_VALUES returns = get_yield_exprs(self.inference_state, funcdef) else: - value_set = self._infer_annotations() + value_set = self.infer_annotations() if value_set: # If there are annotations, prefer them over anything else. # This will make it faster. @@ -238,7 +236,7 @@ def get_return_values(self, check_yields=False): try: children = r.children except AttributeError: - ctx = compiled.builtin_from_name(self.inference_state, u'None') + ctx = compiled.builtin_from_name(self.inference_state, 'None') value_set |= ValueSet([ctx]) else: value_set |= self.infer_node(children[1]) @@ -250,15 +248,14 @@ def get_return_values(self, check_yields=False): def _get_yield_lazy_value(self, yield_expr): if yield_expr.type == 'keyword': # `yield` just yields None. - ctx = compiled.builtin_from_name(self.inference_state, u'None') + ctx = compiled.builtin_from_name(self.inference_state, 'None') yield LazyKnownValue(ctx) return node = yield_expr.children[1] if node.type == 'yield_arg': # It must be a yield from. cn = ContextualizedNode(self, node.children[1]) - for lazy_value in cn.infer().iterate(cn): - yield lazy_value + yield from cn.infer().iterate(cn) else: yield LazyTreeValue(self, node) @@ -297,8 +294,7 @@ def get_yield_lazy_values(self, is_async=False): if for_stmt is None: # No for_stmt, just normal yields. for yield_ in yields: - for result in self._get_yield_lazy_value(yield_): - yield result + yield from self._get_yield_lazy_value(yield_) else: input_node = for_stmt.get_testlist() cn = ContextualizedNode(self, input_node) @@ -308,8 +304,7 @@ def get_yield_lazy_values(self, is_async=False): dct = {str(for_stmt.children[1].value): lazy_value.infer()} with self.predefine_names(for_stmt, dct): for yield_in_same_for_stmt in yields: - for result in self._get_yield_lazy_value(yield_in_same_for_stmt): - yield result + yield from self._get_yield_lazy_value(yield_in_same_for_stmt) def merge_yield_values(self, is_async=False): return ValueSet.from_sets( @@ -330,8 +325,6 @@ def infer(self): if is_coroutine: if self.is_generator(): - if inference_state.environment.version_info < (3, 6): - return NO_VALUES async_generator_classes = inference_state.typing_module \ .py__getattribute__('AsyncGenerator') @@ -339,13 +332,10 @@ def infer(self): # The contravariant doesn't seem to be defined. generics = (yield_values.py__class__(), NO_VALUES) return ValueSet( - # In Python 3.6 AsyncGenerator is still a class. GenericClass(c, TupleGenericManager(generics)) for c in async_generator_classes ).execute_annotation() else: - if inference_state.environment.version_info < (3, 5): - return NO_VALUES async_classes = inference_state.typing_module.py__getattribute__('Coroutine') return_values = self.get_return_values() # Only the first generic is relevant. @@ -354,7 +344,8 @@ def infer(self): GenericClass(c, TupleGenericManager(generics)) for c in async_classes ).execute_annotation() else: - if self.is_generator(): + # If there are annotations, prefer them over anything else. + if self.is_generator() and not self.infer_annotations(): return ValueSet([iterable.Generator(inference_state, self)]) else: return self.get_return_values() @@ -362,7 +353,7 @@ def infer(self): class FunctionExecutionContext(BaseFunctionExecutionContext): def __init__(self, function_value, arguments): - super(FunctionExecutionContext, self).__init__(function_value) + super().__init__(function_value) self._arguments = arguments def get_filters(self, until_position=None, origin_scope=None): @@ -373,7 +364,7 @@ def get_filters(self, until_position=None, origin_scope=None): arguments=self._arguments ) - def _infer_annotations(self): + def infer_annotations(self): from jedi.inference.gradual.annotation import infer_return_types return infer_return_types(self._value, self._arguments) @@ -385,7 +376,7 @@ def get_param_names(self): class AnonymousFunctionExecution(BaseFunctionExecutionContext): - def _infer_annotations(self): + def infer_annotations(self): # I don't think inferring anonymous executions is a big thing. # Anonymous contexts are mostly there for the user to work in. ~ dave return NO_VALUES @@ -403,7 +394,7 @@ def get_param_names(self): class OverloadedFunctionValue(FunctionMixin, ValueWrapper): def __init__(self, function, overloaded_functions): - super(OverloadedFunctionValue, self).__init__(function) + super().__init__(function) self._overloaded_functions = overloaded_functions def py__call__(self, arguments): diff --git a/anaconda_lib/jedi/inference/value/instance.py b/anaconda_lib/jedi/inference/value/instance.py old mode 100755 new mode 100644 index bc06cfd4..63f220e0 --- a/anaconda_lib/jedi/inference/value/instance.py +++ b/anaconda_lib/jedi/inference/value/instance.py @@ -1,6 +1,6 @@ from abc import abstractproperty -from parso.python.tree import search_ancestor +from parso.tree import search_ancestor from jedi import debug from jedi import settings @@ -25,7 +25,7 @@ class InstanceExecutedParamName(ParamName): def __init__(self, instance, function_value, tree_name): - super(InstanceExecutedParamName, self).__init__( + super().__init__( function_value, tree_name, arguments=None) self._instance = instance @@ -38,7 +38,7 @@ def matches_signature(self): class AnonymousMethodExecutionFilter(AnonymousFunctionExecutionFilter): def __init__(self, instance, *args, **kwargs): - super(AnonymousMethodExecutionFilter, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) self._instance = instance def _convert_param(self, param, name): @@ -55,12 +55,12 @@ def _convert_param(self, param, name): self._function_value, name ) - return super(AnonymousMethodExecutionFilter, self)._convert_param(param, name) + return super()._convert_param(param, name) class AnonymousMethodExecutionContext(BaseFunctionExecutionContext): def __init__(self, instance, value): - super(AnonymousMethodExecutionContext, self).__init__(value) + super().__init__(value) self.instance = instance def get_filters(self, until_position=None, origin_scope=None): @@ -83,15 +83,15 @@ def get_param_names(self): class MethodExecutionContext(FunctionExecutionContext): def __init__(self, instance, *args, **kwargs): - super(MethodExecutionContext, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) self.instance = instance class AbstractInstanceValue(Value): - api_type = u'instance' + api_type = 'instance' def __init__(self, inference_state, parent_context, class_value): - super(AbstractInstanceValue, self).__init__(inference_state, parent_context) + super().__init__(inference_state, parent_context) # Generated instances are classes that are just generated by self # (No arguments) used. self.class_value = class_value @@ -121,7 +121,13 @@ def get_signatures(self): return [s.bind(self) for s in call_funcs.get_signatures()] def get_function_slot_names(self, name): - # Searches for Python functions in classes. + # Python classes don't look at the dictionary of the instance when + # looking up `__call__`. This is something that has to do with Python's + # internal slot system (note: not __slots__, but C slots). + for filter in self.get_filters(include_self_names=False): + names = filter.get(name) + if names: + return names return [] def execute_function_slots(self, names, *inferred_args): @@ -133,6 +139,27 @@ def execute_function_slots(self, names, *inferred_args): def get_type_hint(self, add_class_info=True): return self.py__name__() + def py__getitem__(self, index_value_set, contextualized_node): + names = self.get_function_slot_names('__getitem__') + if not names: + return super().py__getitem__( + index_value_set, + contextualized_node, + ) + + args = ValuesArguments([index_value_set]) + return ValueSet.from_sets(name.infer().execute(args) for name in names) + + def py__iter__(self, contextualized_node=None): + iter_slot_names = self.get_function_slot_names('__iter__') + if not iter_slot_names: + return super().py__iter__(contextualized_node) + + def iterate(): + for generator in self.execute_function_slots(iter_slot_names): + yield from generator.py__next__(contextualized_node) + return iterate() + def __repr__(self): return "<%s of %s>" % (self.__class__.__name__, self.class_value) @@ -141,8 +168,7 @@ class CompiledInstance(AbstractInstanceValue): # This is not really a compiled class, it's just an instance from a # compiled class. def __init__(self, inference_state, parent_context, class_value, arguments): - super(CompiledInstance, self).__init__(inference_state, parent_context, - class_value) + super().__init__(inference_state, parent_context, class_value) self._arguments = arguments def get_filters(self, origin_scope=None, include_self_names=True): @@ -234,51 +260,25 @@ def py__getattribute__alternatives(self, string_name): # other way around. if is_big_annoying_library(self.parent_context): return NO_VALUES - names = (self.get_function_slot_names(u'__getattr__') - or self.get_function_slot_names(u'__getattribute__')) + names = (self.get_function_slot_names('__getattr__') + or self.get_function_slot_names('__getattribute__')) return self.execute_function_slots(names, name) - def py__getitem__(self, index_value_set, contextualized_node): - names = self.get_function_slot_names(u'__getitem__') - if not names: - return super(_BaseTreeInstance, self).py__getitem__( - index_value_set, - contextualized_node, + def py__next__(self, contextualized_node=None): + name = u'__next__' + next_slot_names = self.get_function_slot_names(name) + if next_slot_names: + yield LazyKnownValues( + self.execute_function_slots(next_slot_names) ) - - args = ValuesArguments([index_value_set]) - return ValueSet.from_sets(name.infer().execute(args) for name in names) - - def py__iter__(self, contextualized_node=None): - iter_slot_names = self.get_function_slot_names(u'__iter__') - if not iter_slot_names: - return super(_BaseTreeInstance, self).py__iter__(contextualized_node) - - def iterate(): - for generator in self.execute_function_slots(iter_slot_names): - if generator.is_instance() and not generator.is_compiled(): - # `__next__` logic. - if self.inference_state.environment.version_info.major == 2: - name = u'next' - else: - name = u'__next__' - next_slot_names = generator.get_function_slot_names(name) - if next_slot_names: - yield LazyKnownValues( - generator.execute_function_slots(next_slot_names) - ) - else: - debug.warning('Instance has no __next__ function in %s.', generator) - else: - for lazy_value in generator.py__iter__(): - yield lazy_value - return iterate() + else: + debug.warning('Instance has no __next__ function in %s.', self) def py__call__(self, arguments): - names = self.get_function_slot_names(u'__call__') + names = self.get_function_slot_names('__call__') if not names: # Means the Instance is not callable. - return super(_BaseTreeInstance, self).py__call__(arguments) + return super().py__call__(arguments) return ValueSet.from_sets(name.infer().execute(arguments) for name in names) @@ -288,24 +288,19 @@ def py__get__(self, instance, class_value): """ # Arguments in __get__ descriptors are obj, class. # `method` is the new parent of the array, don't know if that's good. - names = self.get_function_slot_names(u'__get__') + for cls in self.class_value.py__mro__(): + result = cls.py__get__on_class(self, instance, class_value) + if result is not NotImplemented: + return result + + names = self.get_function_slot_names('__get__') if names: if instance is None: - instance = compiled.builtin_from_name(self.inference_state, u'None') + instance = compiled.builtin_from_name(self.inference_state, 'None') return self.execute_function_slots(names, instance, class_value) else: return ValueSet([self]) - def get_function_slot_names(self, name): - # Python classes don't look at the dictionary of the instance when - # looking up `__call__`. This is something that has to do with Python's - # internal slot system (note: not __slots__, but C slots). - for filter in self.get_filters(include_self_names=False): - names = filter.get(name) - if names: - return names - return [] - class TreeInstance(_BaseTreeInstance): def __init__(self, inference_state, parent_context, class_value, arguments): @@ -317,7 +312,7 @@ def __init__(self, inference_state, parent_context, class_value, arguments): if settings.dynamic_array_additions: arguments = get_dynamic_array_instance(self, arguments) - super(TreeInstance, self).__init__(inference_state, parent_context, class_value) + super().__init__(inference_state, parent_context, class_value) self._arguments = arguments self.tree_node = class_value.tree_node @@ -391,7 +386,7 @@ def py__simple_getitem__(self, index): else: if key == index: return lazy_context.infer() - return super(TreeInstance, self).py__simple_getitem__(index) + return super().py__simple_getitem__(index) def __repr__(self): return "<%s of %s(%s)>" % (self.__class__.__name__, self.class_value, @@ -402,21 +397,10 @@ class AnonymousInstance(_BaseTreeInstance): _arguments = None -class CompiledInstanceName(compiled.CompiledName): - def __init__(self, inference_state, instance, klass, name): - parent_value = klass.parent_context.get_value() - assert parent_value is not None, "How? Please reproduce and report" - super(CompiledInstanceName, self).__init__( - inference_state, - parent_value, - name.string_name - ) - self._instance = instance - self._class_member_name = name - +class CompiledInstanceName(NameWrapper): @iterator_to_value_set def infer(self): - for result_value in self._class_member_name.infer(): + for result_value in self._wrapped_name.infer(): if result_value.api_type == 'function': yield CompiledBoundMethod(result_value) else: @@ -435,16 +419,12 @@ def values(self): return self._convert(self._class_filter.values()) def _convert(self, names): - klass = self._class_filter.compiled_value - return [ - CompiledInstanceName(self._instance.inference_state, self._instance, klass, n) - for n in names - ] + return [CompiledInstanceName(n) for n in names] class BoundMethod(FunctionMixin, ValueWrapper): def __init__(self, instance, class_context, function): - super(BoundMethod, self).__init__(function) + super().__init__(function) self.instance = instance self._class_context = class_context @@ -455,11 +435,11 @@ def is_bound_method(self): def name(self): return FunctionNameInClass( self._class_context, - super(BoundMethod, self).name + super().name ) def py__class__(self): - c, = values_from_qualified_names(self.inference_state, u'types', u'MethodType') + c, = values_from_qualified_names(self.inference_state, 'types', 'MethodType') return c def _get_arguments(self, arguments): @@ -487,7 +467,7 @@ def get_signature_functions(self): ] def get_signatures(self): - return [sig.bind(self) for sig in super(BoundMethod, self).get_signatures()] + return [sig.bind(self) for sig in super().get_signatures()] def __repr__(self): return '<%s: %s>' % (self.__class__.__name__, self._wrapped_value) @@ -517,17 +497,28 @@ def parent_context(self): def get_defining_qualified_value(self): return self._instance + def infer(self): + stmt = search_ancestor(self.tree_name, 'expr_stmt') + if stmt is not None: + if stmt.children[1].type == "annassign": + from jedi.inference.gradual.annotation import infer_annotation + values = infer_annotation( + self.parent_context, stmt.children[1].children[1] + ).execute_annotation() + if values: + return values + return super().infer() + class LazyInstanceClassName(NameWrapper): def __init__(self, instance, class_member_name): - super(LazyInstanceClassName, self).__init__(class_member_name) + super().__init__(class_member_name) self._instance = instance @iterator_to_value_set def infer(self): for result_value in self._wrapped_name.infer(): - for c in result_value.py__get__(self._instance, self._instance.py__class__()): - yield c + yield from result_value.py__get__(self._instance, self._instance.py__class__()) def get_signatures(self): return self.infer().get_signatures() @@ -567,7 +558,7 @@ class SelfAttributeFilter(ClassFilter): This class basically filters all the use cases where `self.*` was assigned. """ def __init__(self, instance, instance_class, node_context, origin_scope): - super(SelfAttributeFilter, self).__init__( + super().__init__( class_value=instance_class, node_context=node_context, origin_scope=origin_scope, @@ -611,10 +602,9 @@ def _check_flows(self, names): class InstanceArguments(TreeArgumentsWrapper): def __init__(self, instance, arguments): - super(InstanceArguments, self).__init__(arguments) + super().__init__(arguments) self.instance = instance def unpack(self, func=None): yield None, LazyKnownValue(self.instance) - for values in self._wrapped_arguments.unpack(func): - yield values + yield from self._wrapped_arguments.unpack(func) diff --git a/anaconda_lib/jedi/inference/value/iterable.py b/anaconda_lib/jedi/inference/value/iterable.py old mode 100755 new mode 100644 index d23ca13e..7cc37173 --- a/anaconda_lib/jedi/inference/value/iterable.py +++ b/anaconda_lib/jedi/inference/value/iterable.py @@ -2,9 +2,6 @@ Contains all classes and functions to deal with lists, dicts, generators and iterators in general. """ -import sys - -from jedi._compatibility import force_unicode, is_py3 from jedi.inference import compiled from jedi.inference import analysis from jedi.inference.lazy_value import LazyKnownValue, LazyKnownValues, \ @@ -22,9 +19,12 @@ from jedi.inference.value.dynamic_arrays import check_array_additions -class IterableMixin(object): +class IterableMixin: + def py__next__(self, contextualized_node=None): + return self.py__iter__(contextualized_node) + def py__stop_iteration_returns(self): - return ValueSet([compiled.builtin_from_name(self.inference_state, u'None')]) + return ValueSet([compiled.builtin_from_name(self.inference_state, 'None')]) # At the moment, safe values are simple values like "foo", 1 and not # lists/dicts. Therefore as a small speed optimization we can just do the @@ -32,56 +32,56 @@ def py__stop_iteration_returns(self): # doing this in the end as well. # This mostly speeds up patterns like `sys.version_info >= (3, 0)` in # typeshed. - if sys.version_info[0] == 2: - # Python 2........... - def get_safe_value(self, default=sentinel): - if default is sentinel: - raise ValueError("There exists no safe value for value %s" % self) - return default - else: - get_safe_value = Value.get_safe_value + get_safe_value = Value.get_safe_value class GeneratorBase(LazyAttributeOverwrite, IterableMixin): array_type = None def _get_wrapped_value(self): - generator, = self.inference_state.typing_module \ - .py__getattribute__('Generator') \ - .execute_annotation() - return generator + instance, = self._get_cls().execute_annotation() + return instance - def is_instance(self): - return False + def _get_cls(self): + generator, = self.inference_state.typing_module.py__getattribute__('Generator') + return generator def py__bool__(self): return True @publish_method('__iter__') - def py__iter__(self, contextualized_node=None): + def _iter(self, arguments): return ValueSet([self]) @publish_method('send') - @publish_method('next', python_version_match=2) - @publish_method('__next__', python_version_match=3) - def py__next__(self): + @publish_method('__next__') + def _next(self, arguments): return ValueSet.from_sets(lazy_value.infer() for lazy_value in self.py__iter__()) def py__stop_iteration_returns(self): - return ValueSet([compiled.builtin_from_name(self.inference_state, u'None')]) + return ValueSet([compiled.builtin_from_name(self.inference_state, 'None')]) @property def name(self): return compiled.CompiledValueName(self, 'Generator') + def get_annotated_class_object(self): + from jedi.inference.gradual.generics import TupleGenericManager + gen_values = self.merge_types_of_iterate().py__class__() + gm = TupleGenericManager((gen_values, NO_VALUES, NO_VALUES)) + return self._get_cls().with_generics(gm) + class Generator(GeneratorBase): """Handling of `yield` functions.""" def __init__(self, inference_state, func_execution_context): - super(Generator, self).__init__(inference_state) + super().__init__(inference_state) self._func_execution_context = func_execution_context def py__iter__(self, contextualized_node=None): + iterators = self._func_execution_context.infer_annotations() + if iterators: + return iterators.iterate(contextualized_node) return self._func_execution_context.get_yield_lazy_values() def py__stop_iteration_returns(self): @@ -127,7 +127,7 @@ def comprehension_from_atom(inference_state, value, atom): ) -class ComprehensionMixin(object): +class ComprehensionMixin: @inference_state_method_cache() def _get_comp_for_context(self, parent_context, comp_for): return CompForContext(parent_context, comp_for) @@ -153,8 +153,7 @@ def _nested(self, comp_fors, parent_context=None): ) with context.predefine_names(comp_for, dct): try: - for result in self._nested(comp_fors[1:], context): - yield result + yield from self._nested(comp_fors[1:], context) except IndexError: iterated = context.infer_node(self._entry_node) if self.array_type == 'dict': @@ -166,8 +165,7 @@ def _nested(self, comp_fors, parent_context=None): @to_list def _iterate(self): comp_fors = tuple(get_sync_comp_fors(self._sync_comp_for_node)) - for result in self._nested(comp_fors): - yield result + yield from self._nested(comp_fors) def py__iter__(self, contextualized_node=None): for set_ in self._iterate(): @@ -177,13 +175,13 @@ def __repr__(self): return "<%s of %s>" % (type(self).__name__, self._sync_comp_for_node) -class _DictMixin(object): +class _DictMixin: def _get_generics(self): return tuple(c_set.py__class__() for c_set in self.get_mapping_item_values()) class Sequence(LazyAttributeOverwrite, IterableMixin): - api_type = u'instance' + api_type = 'instance' @property def name(self): @@ -222,14 +220,14 @@ def py__getitem__(self, index_value_set, contextualized_node): class _BaseComprehension(ComprehensionMixin): def __init__(self, inference_state, defining_context, sync_comp_for_node, entry_node): assert sync_comp_for_node.type == 'sync_comp_for' - super(_BaseComprehension, self).__init__(inference_state) + super().__init__(inference_state) self._defining_context = defining_context self._sync_comp_for_node = sync_comp_for_node self._entry_node = entry_node class ListComprehension(_BaseComprehension, Sequence): - array_type = u'list' + array_type = 'list' def py__simple_getitem__(self, index): if isinstance(index, slice): @@ -242,14 +240,14 @@ def py__simple_getitem__(self, index): class SetComprehension(_BaseComprehension, Sequence): - array_type = u'set' + array_type = 'set' class GeneratorComprehension(_BaseComprehension, GeneratorBase): pass -class _DictKeyMixin(object): +class _DictKeyMixin: # TODO merge with _DictMixin? def get_mapping_item_values(self): return self._dict_keys(), self._dict_values() @@ -260,11 +258,11 @@ def get_key_values(self): class DictComprehension(ComprehensionMixin, Sequence, _DictKeyMixin): - array_type = u'dict' + array_type = 'dict' def __init__(self, inference_state, defining_context, sync_comp_for_node, key_node, value_node): assert sync_comp_for_node.type == 'sync_comp_for' - super(DictComprehension, self).__init__(inference_state) + super().__init__(inference_state) self._defining_context = defining_context self._sync_comp_for_node = sync_comp_for_node self._entry_node = key_node @@ -290,12 +288,12 @@ def _dict_values(self): return ValueSet.from_sets(values for keys, values in self._iterate()) @publish_method('values') - def _imitate_values(self): + def _imitate_values(self, arguments): lazy_value = LazyKnownValues(self._dict_values()) return ValueSet([FakeList(self.inference_state, [lazy_value])]) @publish_method('items') - def _imitate_items(self): + def _imitate_items(self, arguments): lazy_values = [ LazyKnownValue( FakeTuple( @@ -317,25 +315,25 @@ def exact_key_items(self): class SequenceLiteralValue(Sequence): _TUPLE_LIKE = 'testlist_star_expr', 'testlist', 'subscriptlist' - mapping = {'(': u'tuple', - '[': u'list', - '{': u'set'} + mapping = {'(': 'tuple', + '[': 'list', + '{': 'set'} def __init__(self, inference_state, defining_context, atom): - super(SequenceLiteralValue, self).__init__(inference_state) + super().__init__(inference_state) self.atom = atom self._defining_context = defining_context if self.atom.type in self._TUPLE_LIKE: - self.array_type = u'tuple' + self.array_type = 'tuple' else: self.array_type = SequenceLiteralValue.mapping[atom.children[0]] """The builtin name of the array (list, set, tuple or dict).""" def _get_generics(self): - if self.array_type == u'tuple': + if self.array_type == 'tuple': return tuple(x.infer().py__class__() for x in self.py__iter__()) - return super(SequenceLiteralValue, self)._get_generics() + return super()._get_generics() def py__simple_getitem__(self, index): """Here the index is an int/str. Raises IndexError/KeyError.""" @@ -344,6 +342,8 @@ def py__simple_getitem__(self, index): else: with reraise_getitem_errors(TypeError, KeyError, IndexError): node = self.get_tree_entries()[index] + if node == ':' or node.type == 'subscript': + return NO_VALUES return self._defining_context.infer_node(node) def py__iter__(self, contextualized_node=None): @@ -358,8 +358,7 @@ def py__iter__(self, contextualized_node=None): yield LazyKnownValue(Slice(self._defining_context, None, None, None)) else: yield LazyTreeValue(self._defining_context, node) - for addition in check_array_additions(self._defining_context, self): - yield addition + yield from check_array_additions(self._defining_context, self) def py__len__(self): # This function is not really used often. It's more of a try. @@ -410,25 +409,17 @@ def get_tree_entries(self): else: return [array_node] - def exact_key_items(self): - """ - Returns a generator of tuples like dict.items(), where the key is - resolved (as a string) and the values are still lazy values. - """ - for key_node, value in self.get_tree_entries(): - for key in self._defining_context.infer_node(key_node): - if is_string(key): - yield key.get_safe_value(), LazyTreeValue(self._defining_context, value) - def __repr__(self): return "<%s of %s>" % (self.__class__.__name__, self.atom) class DictLiteralValue(_DictMixin, SequenceLiteralValue, _DictKeyMixin): - array_type = u'dict' + array_type = 'dict' def __init__(self, inference_state, defining_context, atom): - super(SequenceLiteralValue, self).__init__(inference_state) + # Intentionally don't call the super class. This is definitely a sign + # that the architecture is bad and we should refactor. + Sequence.__init__(self, inference_state) self._defining_context = defining_context self.atom = atom @@ -437,7 +428,7 @@ def py__simple_getitem__(self, index): compiled_value_index = compiled.create_simple_object(self.inference_state, index) for key, value in self.get_tree_entries(): for k in self._defining_context.infer_node(key): - for key_v in k.execute_operation(compiled_value_index, u'=='): + for key_v in k.execute_operation(compiled_value_index, '=='): if key_v.get_safe_value(): return self._defining_context.infer_node(value) raise SimpleGetItemNotFound('No key found in dictionary %s.' % self) @@ -457,12 +448,12 @@ def py__iter__(self, contextualized_node=None): yield LazyKnownValues(types) @publish_method('values') - def _imitate_values(self): + def _imitate_values(self, arguments): lazy_value = LazyKnownValues(self._dict_values()) return ValueSet([FakeList(self.inference_state, [lazy_value])]) @publish_method('items') - def _imitate_items(self): + def _imitate_items(self, arguments): lazy_values = [ LazyKnownValue(FakeTuple( self.inference_state, @@ -473,6 +464,16 @@ def _imitate_items(self): return ValueSet([FakeList(self.inference_state, lazy_values)]) + def exact_key_items(self): + """ + Returns a generator of tuples like dict.items(), where the key is + resolved (as a string) and the values are still lazy values. + """ + for key_node, value in self.get_tree_entries(): + for key in self._defining_context.infer_node(key_node): + if is_string(key): + yield key.get_safe_value(), LazyTreeValue(self._defining_context, value) + def _dict_values(self): return ValueSet.from_sets( self._defining_context.infer_node(v) @@ -491,7 +492,7 @@ def __init__(self, inference_state, lazy_value_list): """ type should be one of "tuple", "list" """ - super(_FakeSequence, self).__init__(inference_state) + super().__init__(inference_state) self._lazy_value_list = lazy_value_list def py__simple_getitem__(self, index): @@ -513,18 +514,18 @@ def __repr__(self): class FakeTuple(_FakeSequence): - array_type = u'tuple' + array_type = 'tuple' class FakeList(_FakeSequence): - array_type = u'tuple' + array_type = 'tuple' class FakeDict(_DictMixin, Sequence, _DictKeyMixin): - array_type = u'dict' + array_type = 'dict' def __init__(self, inference_state, dct): - super(FakeDict, self).__init__(inference_state) + super().__init__(inference_state) self._dct = dct def py__iter__(self, contextualized_node=None): @@ -532,27 +533,12 @@ def py__iter__(self, contextualized_node=None): yield LazyKnownValue(compiled.create_simple_object(self.inference_state, key)) def py__simple_getitem__(self, index): - if is_py3 and self.inference_state.environment.version_info.major == 2: - # In Python 2 bytes and unicode compare. - if isinstance(index, bytes): - index_unicode = force_unicode(index) - try: - return self._dct[index_unicode].infer() - except KeyError: - pass - elif isinstance(index, str): - index_bytes = index.encode('utf-8') - try: - return self._dct[index_bytes].infer() - except KeyError: - pass - with reraise_getitem_errors(KeyError, TypeError): lazy_value = self._dct[index] return lazy_value.infer() @publish_method('values') - def _values(self): + def _values(self, arguments): return ValueSet([FakeTuple( self.inference_state, [LazyKnownValues(self._dict_values())] @@ -573,14 +559,13 @@ def __repr__(self): class MergedArray(Sequence): def __init__(self, inference_state, arrays): - super(MergedArray, self).__init__(inference_state) + super().__init__(inference_state) self.array_type = arrays[-1].array_type self._arrays = arrays def py__iter__(self, contextualized_node=None): for array in self._arrays: - for lazy_value in array.py__iter__(): - yield lazy_value + yield from array.py__iter__() def py__simple_getitem__(self, index): return ValueSet.from_sets(lazy_value.infer() for lazy_value in self.py__iter__()) diff --git a/anaconda_lib/jedi/inference/value/klass.py b/anaconda_lib/jedi/inference/value/klass.py old mode 100755 new mode 100644 index ec51b24a..ee8d4e85 --- a/anaconda_lib/jedi/inference/value/klass.py +++ b/anaconda_lib/jedi/inference/value/klass.py @@ -37,8 +37,8 @@ """ from jedi import debug -from jedi._compatibility import use_metaclass -from jedi.parser_utils import get_cached_parent_scope, expr_is_dotted +from jedi.parser_utils import get_cached_parent_scope, expr_is_dotted, \ + function_is_property from jedi.inference.cache import inference_state_method_cache, CachedMetaClass, \ inference_state_method_generator_cache from jedi.inference import compiled @@ -56,7 +56,7 @@ class ClassName(TreeNameDefinition): def __init__(self, class_value, tree_name, name_context, apply_decorators): - super(ClassName, self).__init__(name_context, tree_name) + super().__init__(name_context, tree_name) self._apply_decorators = apply_decorators self._class_value = class_value @@ -69,16 +69,29 @@ def infer(self): for result_value in inferred: if self._apply_decorators: - for c in result_value.py__get__(instance=None, class_value=self._class_value): - yield c + yield from result_value.py__get__(instance=None, class_value=self._class_value) else: yield result_value + @property + def api_type(self): + type_ = super().api_type + if type_ == 'function': + definition = self.tree_name.get_definition() + if function_is_property(definition): + # This essentially checks if there is an @property before + # the function. @property could be something different, but + # any programmer that redefines property as something that + # is not really a property anymore, should be shot. (i.e. + # this is a heuristic). + return 'property' + return type_ + class ClassFilter(ParserTreeFilter): def __init__(self, class_value, node_context=None, until_position=None, origin_scope=None, is_instance=False): - super(ClassFilter, self).__init__( + super().__init__( class_value.as_context(), node_context, until_position=until_position, origin_scope=origin_scope, @@ -101,7 +114,7 @@ def _equals_origin_scope(self): while node is not None: if node == self._parser_scope or node == self.parent_context: return True - node = get_cached_parent_scope(self._used_names, node) + node = get_cached_parent_scope(self._parso_cache_node, node) return False def _access_possible(self, name): @@ -114,8 +127,6 @@ def _access_possible(self, name): if expr_stmt is not None and expr_stmt.type == 'expr_stmt': annassign = expr_stmt.children[1] if annassign.type == 'annassign': - # TODO this is not proper matching - # If there is an =, the variable is obviously also # defined on the class. if 'ClassVar' not in annassign.children[1].get_code() \ @@ -127,15 +138,18 @@ def _access_possible(self, name): or self._equals_origin_scope() def _filter(self, names): - names = super(ClassFilter, self)._filter(names) + names = super()._filter(names) return [name for name in names if self._access_possible(name)] -class ClassMixin(object): +class ClassMixin: def is_class(self): return True - def py__call__(self, arguments=None): + def is_class_mixin(self): + return True + + def py__call__(self, arguments): from jedi.inference.value import TreeInstance from jedi.inference.gradual.typing import TypedDict @@ -144,7 +158,7 @@ def py__call__(self, arguments=None): return ValueSet([TreeInstance(self.inference_state, self.parent_context, self, arguments)]) def py__class__(self): - return compiled.builtin_from_name(self.inference_state, u'type') + return compiled.builtin_from_name(self.inference_state, 'type') @property def name(self): @@ -186,26 +200,25 @@ def py__mro__(self): mro.append(cls_new) yield cls_new - def get_filters(self, origin_scope=None, is_instance=False, include_metaclasses=True): + def get_filters(self, origin_scope=None, is_instance=False, + include_metaclasses=True, include_type_when_class=True): if include_metaclasses: metaclasses = self.get_metaclasses() if metaclasses: - for f in self.get_metaclass_filters(metaclasses): - yield f + yield from self.get_metaclass_filters(metaclasses, is_instance) for cls in self.py__mro__(): if cls.is_compiled(): - for filter in cls.get_filters(is_instance=is_instance): - yield filter + yield from cls.get_filters(is_instance=is_instance) else: yield ClassFilter( self, node_context=cls.as_context(), origin_scope=origin_scope, is_instance=is_instance ) - if not is_instance: + if not is_instance and include_type_when_class: from jedi.inference.compiled import builtin_from_name - type_ = builtin_from_name(self.inference_state, u'type') + type_ = builtin_from_name(self.inference_state, 'type') assert isinstance(type_, ClassValue) if type_ != self: # We are not using execute_with_values here, because the @@ -225,6 +238,11 @@ def get_signatures(self): # Since calling staticmethod without a function is illegal, the Jedi # plugin doesn't return anything. Therefore call directly and get what # we want: An instance of staticmethod. + metaclasses = self.get_metaclasses() + if metaclasses: + sigs = self.get_metaclass_signatures(metaclasses) + if sigs: + return sigs args = ValuesArguments([]) init_funcs = self.py__call__(args).py__getattribute__('__init__') return [sig.bind(self) for sig in init_funcs.get_signatures()] @@ -267,53 +285,10 @@ def is_typeddict(self): return True return False - -class ClassValue(use_metaclass(CachedMetaClass, ClassMixin, FunctionAndClassBase)): - api_type = u'class' - - @inference_state_method_cache() - def list_type_vars(self): - found = [] - arglist = self.tree_node.get_super_arglist() - if arglist is None: - return [] - - for stars, node in unpack_arglist(arglist): - if stars: - continue # These are not relevant for this search. - - from jedi.inference.gradual.annotation import find_unknown_type_vars - for type_var in find_unknown_type_vars(self.parent_context, node): - if type_var not in found: - # The order matters and it's therefore a list. - found.append(type_var) - return found - - def _get_bases_arguments(self): - arglist = self.tree_node.get_super_arglist() - if arglist: - from jedi.inference import arguments - return arguments.TreeArguments(self.inference_state, self.parent_context, arglist) - return None - - @inference_state_method_cache(default=()) - def py__bases__(self): - args = self._get_bases_arguments() - if args is not None: - lst = [value for key, value in args.unpack() if key is None] - if lst: - return lst - - if self.py__name__() == 'object' \ - and self.parent_context.is_builtins_module(): - return [] - return [LazyKnownValues( - self.inference_state.builtins_module.py__getattribute__('object') - )] - def py__getitem__(self, index_value_set, contextualized_node): from jedi.inference.gradual.base import GenericClass if not index_value_set: + debug.warning('Class indexes inferred to nothing. Returning class instead') return ValueSet([self]) return ValueSet( GenericClass( @@ -356,9 +331,53 @@ def iter(iterable: Iterable[_T]) -> Iterator[_T]: ... )]) return ValueSet({self}) + +class ClassValue(ClassMixin, FunctionAndClassBase, metaclass=CachedMetaClass): + api_type = 'class' + + @inference_state_method_cache() + def list_type_vars(self): + found = [] + arglist = self.tree_node.get_super_arglist() + if arglist is None: + return [] + + for stars, node in unpack_arglist(arglist): + if stars: + continue # These are not relevant for this search. + + from jedi.inference.gradual.annotation import find_unknown_type_vars + for type_var in find_unknown_type_vars(self.parent_context, node): + if type_var not in found: + # The order matters and it's therefore a list. + found.append(type_var) + return found + + def _get_bases_arguments(self): + arglist = self.tree_node.get_super_arglist() + if arglist: + from jedi.inference import arguments + return arguments.TreeArguments(self.inference_state, self.parent_context, arglist) + return None + + @inference_state_method_cache(default=()) + def py__bases__(self): + args = self._get_bases_arguments() + if args is not None: + lst = [value for key, value in args.unpack() if key is None] + if lst: + return lst + + if self.py__name__() == 'object' \ + and self.parent_context.is_builtins_module(): + return [] + return [LazyKnownValues( + self.inference_state.builtins_module.py__getattribute__('object') + )] + @plugin_manager.decorate() - def get_metaclass_filters(self, metaclass): - debug.dbg('Unprocessed metaclass %s', metaclass) + def get_metaclass_filters(self, metaclasses, is_instance): + debug.warning('Unprocessed metaclass %s', metaclasses) return [] @inference_state_method_cache(default=NO_VALUES) @@ -378,3 +397,7 @@ def get_metaclasses(self): if values: return values return NO_VALUES + + @plugin_manager.decorate() + def get_metaclass_signatures(self, metaclasses): + return [] diff --git a/anaconda_lib/jedi/inference/value/module.py b/anaconda_lib/jedi/inference/value/module.py old mode 100755 new mode 100644 index 12d2bfcf..6461cb4b --- a/anaconda_lib/jedi/inference/value/module.py +++ b/anaconda_lib/jedi/inference/value/module.py @@ -1,4 +1,6 @@ import os +from pathlib import Path +from typing import Optional from jedi.inference.cache import inference_state_method_cache from jedi.inference.names import AbstractNameDefinition, ModuleName @@ -16,7 +18,7 @@ class _ModuleAttributeName(AbstractNameDefinition): """ For module attributes like __file__, __str__ and so on. """ - api_type = u'instance' + api_type = 'instance' def __init__(self, parent_module, string_name, string_value=None): self.parent_context = parent_module @@ -26,16 +28,13 @@ def __init__(self, parent_module, string_name, string_value=None): def infer(self): if self._string_value is not None: s = self._string_value - if self.parent_context.inference_state.environment.version_info.major == 2 \ - and not isinstance(s, bytes): - s = s.encode('utf-8') return ValueSet([ create_simple_object(self.parent_context.inference_state, s) ]) return compiled.get_string_value_set(self.parent_context.inference_state) -class SubModuleDictMixin(object): +class SubModuleDictMixin: @inference_state_method_cache() def sub_modules_dict(self): """ @@ -65,15 +64,14 @@ def get_filters(self, origin_scope=None): parent_context=self.as_context(), origin_scope=origin_scope ), - GlobalNameFilter(self.as_context(), self.tree_node), + GlobalNameFilter(self.as_context()), ) yield DictFilter(self.sub_modules_dict()) yield DictFilter(self._module_attributes_dict()) - for star_filter in self.iter_star_filters(): - yield star_filter + yield from self.iter_star_filters() def py__class__(self): - c, = values_from_qualified_names(self.inference_state, u'types', u'ModuleType') + c, = values_from_qualified_names(self.inference_state, 'types', 'ModuleType') return c def is_module(self): @@ -82,7 +80,7 @@ def is_module(self): def is_stub(self): return False - @property + @property # type: ignore[misc] @inference_state_method_cache() def name(self): return self._module_name_class(self, self.string_names[-1]) @@ -92,9 +90,9 @@ def _module_attributes_dict(self): names = ['__package__', '__doc__', '__name__'] # All the additional module attributes are strings. dct = dict((n, _ModuleAttributeName(self, n)) for n in names) - file = self.py__file__() - if file is not None: - dct['__file__'] = _ModuleAttributeName(self, '__file__', file) + path = self.py__file__() + if path is not None: + dct['__file__'] = _ModuleAttributeName(self, '__file__', str(path)) return dct def iter_star_filters(self): @@ -137,18 +135,18 @@ def get_qualified_names(self): class ModuleValue(ModuleMixin, TreeValue): - api_type = u'module' + api_type = 'module' def __init__(self, inference_state, module_node, code_lines, file_io=None, string_names=None, is_package=False): - super(ModuleValue, self).__init__( + super().__init__( inference_state, parent_context=None, tree_node=module_node ) self.file_io = file_io if file_io is None: - self._path = None + self._path: Optional[Path] = None else: self._path = file_io.path self.string_names = string_names # Optional[Tuple[str, ...]] @@ -156,31 +154,34 @@ def __init__(self, inference_state, module_node, code_lines, file_io=None, self._is_package = is_package def is_stub(self): - if self._path is not None and self._path.endswith('.pyi'): + if self._path is not None and self._path.suffix == '.pyi': # Currently this is the way how we identify stubs when e.g. goto is # used in them. This could be changed if stubs would be identified # sooner and used as StubModuleValue. return True - return super(ModuleValue, self).is_stub() + return super().is_stub() def py__name__(self): if self.string_names is None: return None return '.'.join(self.string_names) - def py__file__(self): + def py__file__(self) -> Optional[Path]: """ In contrast to Python's __file__ can be None. """ if self._path is None: return None - return os.path.abspath(self._path) + return self._path.absolute() def is_package(self): return self._is_package def py__package__(self): + if self.string_names is None: + return [] + if self._is_package: return self.string_names return self.string_names[:-1] diff --git a/anaconda_lib/jedi/inference/value/namespace.py b/anaconda_lib/jedi/inference/value/namespace.py old mode 100755 new mode 100644 index 48a09e4a..11737cc9 --- a/anaconda_lib/jedi/inference/value/namespace.py +++ b/anaconda_lib/jedi/inference/value/namespace.py @@ -1,3 +1,6 @@ +from pathlib import Path +from typing import Optional + from jedi.inference.cache import inference_state_method_cache from jedi.inference.filters import DictFilter from jedi.inference.names import ValueNameMixin, AbstractNameDefinition @@ -20,14 +23,11 @@ class ImplicitNamespaceValue(Value, SubModuleDictMixin): """ Provides support for implicit namespace packages """ - # Is a module like every other module, because if you import an empty - # folder foobar it will be available as an object: - # . - api_type = u'module' + api_type = 'namespace' parent_context = None def __init__(self, inference_state, string_names, paths): - super(ImplicitNamespaceValue, self).__init__(inference_state, parent_context=None) + super().__init__(inference_state, parent_context=None) self.inference_state = inference_state self.string_names = string_names self._paths = paths @@ -38,13 +38,13 @@ def get_filters(self, origin_scope=None): def get_qualified_names(self): return () - @property + @property # type: ignore[misc] @inference_state_method_cache() def name(self): string_name = self.py__package__()[-1] return ImplicitNSName(self, string_name) - def py__file__(self): + def py__file__(self) -> Optional[Path]: return None def py__package__(self): diff --git a/anaconda_lib/jedi/parser_utils.py b/anaconda_lib/jedi/parser_utils.py old mode 100755 new mode 100644 index 67e39521..3c7fa151 --- a/anaconda_lib/jedi/parser_utils.py +++ b/anaconda_lib/jedi/parser_utils.py @@ -1,5 +1,6 @@ import re import textwrap +from ast import literal_eval from inspect import cleandoc from weakref import WeakKeyDictionary @@ -7,8 +8,6 @@ from parso.cache import parser_cache from parso import split_lines -from jedi._compatibility import literal_eval, force_unicode - _EXECUTE_NODES = {'funcdef', 'classdef', 'import_from', 'import_name', 'test', 'or_test', 'and_test', 'not_test', 'comparison', 'expr', 'xor_expr', 'and_expr', 'shift_expr', 'arith_expr', @@ -91,7 +90,7 @@ def get_flow_branch_keyword(flow_node, node): first_leaf = child.get_first_leaf() if first_leaf in _FLOW_KEYWORDS: keyword = first_leaf - return 0 + return None def clean_scope_docstring(scope_node): @@ -102,10 +101,7 @@ def clean_scope_docstring(scope_node): # leaves anymore that might be part of the docstring. A # docstring can also look like this: ``'foo' 'bar' # Returns a literal cleaned version of the ``Token``. - cleaned = cleandoc(safe_literal_eval(node.value)) - # Since we want the docstr output to be always unicode, just - # force it. - return force_unicode(cleaned) + return cleandoc(safe_literal_eval(node.value)) return '' @@ -117,10 +113,7 @@ def find_statement_documentation(tree_node): if maybe_string.type == 'simple_stmt': maybe_string = maybe_string.children[0] if maybe_string.type == 'string': - cleaned = cleandoc(safe_literal_eval(maybe_string.value)) - # Since we want the docstr output to be always unicode, just - # force it. - return force_unicode(cleaned) + return cleandoc(safe_literal_eval(maybe_string.value)) return '' @@ -131,15 +124,7 @@ def safe_literal_eval(value): # manually, but that's right now not implemented. return '' - try: - return literal_eval(value) - except SyntaxError: - # It's possible to create syntax errors with literals like rb'' in - # Python 2. This should not be possible and in that case just return an - # empty string. - # Before Python 3.3 there was a more strict definition in which order - # you could define literals. - return '' + return literal_eval(value) def get_signature(funcdef, width=72, call_string=None, @@ -231,11 +216,14 @@ def is_scope(node): def _get_parent_scope_cache(func): cache = WeakKeyDictionary() - def wrapper(used_names, node, include_flows=False): + def wrapper(parso_cache_node, node, include_flows=False): + if parso_cache_node is None: + return func(node, include_flows) + try: - for_module = cache[used_names] + for_module = cache[parso_cache_node] except KeyError: - for_module = cache[used_names] = {} + for_module = cache[parso_cache_node] = {} try: return for_module[node] @@ -254,7 +242,7 @@ def get_parent_scope(node, include_flows=False): return None # It's a module already. while True: - if is_scope(scope) or include_flows and isinstance(scope, tree.Flow): + if is_scope(scope): if scope.type in ('classdef', 'funcdef', 'lambdef'): index = scope.children.index(':') if scope.children[index].start_pos >= node.start_pos: @@ -266,6 +254,14 @@ def get_parent_scope(node, include_flows=False): scope = scope.parent continue return scope + elif include_flows and isinstance(scope, tree.Flow): + # The cursor might be on `if foo`, so the parent scope will not be + # the if, but the parent of the if. + if not (scope.type == 'if_stmt' + and any(n.start_pos <= node.start_pos < n.end_pos + for n in scope.get_test_nodes())): + return scope + scope = scope.parent @@ -277,7 +273,18 @@ def get_cached_code_lines(grammar, path): Basically access the cached code lines in parso. This is not the nicest way to do this, but we avoid splitting all the lines again. """ - return parser_cache[grammar._hashed][path].lines + return get_parso_cache_node(grammar, path).lines + + +def get_parso_cache_node(grammar, path): + """ + This is of course not public. But as long as I control parso, this + shouldn't be a problem. ~ Dave + + The reason for this is mostly caching. This is obviously also a sign of a + broken caching architecture. + """ + return parser_cache[grammar._hashed][path] def cut_value_at_position(leaf, position): @@ -288,6 +295,8 @@ def cut_value_at_position(leaf, position): column = position[1] if leaf.line == position[0]: column -= leaf.column + if not lines: + return '' lines[-1] = lines[-1][:column] return ''.join(lines) @@ -311,7 +320,7 @@ def expr_is_dotted(node): return node.type == 'name' -def _function_is_x_method(method_name): +def _function_is_x_method(*method_names): def wrapper(function_node): """ This is a heuristic. It will not hold ALL the times, but it will be @@ -321,7 +330,7 @@ def wrapper(function_node): """ for decorator in function_node.get_decorators(): dotted_name = decorator.children[1] - if dotted_name.get_code() == method_name: + if dotted_name.get_code() in method_names: return True return False return wrapper @@ -329,3 +338,4 @@ def wrapper(function_node): function_is_staticmethod = _function_is_x_method('staticmethod') function_is_classmethod = _function_is_x_method('classmethod') +function_is_property = _function_is_x_method('property', 'cached_property') diff --git a/anaconda_lib/jedi/plugins/__init__.py b/anaconda_lib/jedi/plugins/__init__.py old mode 100755 new mode 100644 index 23588bd4..8067676d --- a/anaconda_lib/jedi/plugins/__init__.py +++ b/anaconda_lib/jedi/plugins/__init__.py @@ -1,7 +1,7 @@ from functools import wraps -class _PluginManager(object): +class _PluginManager: def __init__(self): self._registered_plugins = [] self._cached_base_callbacks = {} diff --git a/anaconda_lib/jedi/plugins/django.py b/anaconda_lib/jedi/plugins/django.py old mode 100755 new mode 100644 index 6d50153c..cd443bbd --- a/anaconda_lib/jedi/plugins/django.py +++ b/anaconda_lib/jedi/plugins/django.py @@ -1,13 +1,19 @@ """ Module is used to infer Django model fields. """ +from inspect import Parameter + from jedi import debug -from jedi.inference.base_value import ValueSet, iterator_to_value_set -from jedi.inference.filters import ParserTreeFilter, DictFilter -from jedi.inference.names import NameWrapper +from jedi.inference.cache import inference_state_function_cache +from jedi.inference.base_value import ValueSet, iterator_to_value_set, ValueWrapper +from jedi.inference.filters import DictFilter, AttributeOverwrite +from jedi.inference.names import NameWrapper, BaseTreeParamName +from jedi.inference.compiled.value import EmptyCompiledName from jedi.inference.value.instance import TreeInstance +from jedi.inference.value.klass import ClassMixin from jedi.inference.gradual.base import GenericClass from jedi.inference.gradual.generics import TupleGenericManager +from jedi.inference.signature import AbstractSignature mapping = { @@ -18,6 +24,8 @@ 'CharField': (None, 'str'), 'TextField': (None, 'str'), 'EmailField': (None, 'str'), + 'GenericIPAddressField': (None, 'str'), + 'URLField': (None, 'str'), 'FloatField': (None, 'float'), 'BinaryField': (None, 'bytes'), 'BooleanField': (None, 'bool'), @@ -26,15 +34,29 @@ 'DurationField': ('datetime', 'timedelta'), 'DateField': ('datetime', 'date'), 'DateTimeField': ('datetime', 'datetime'), + 'UUIDField': ('uuid', 'UUID'), } +_FILTER_LIKE_METHODS = ('create', 'filter', 'exclude', 'update', 'get', + 'get_or_create', 'update_or_create') + + +@inference_state_function_cache() +def _get_deferred_attributes(inference_state): + return inference_state.import_module( + ('django', 'db', 'models', 'query_utils') + ).py__getattribute__('DeferredAttribute').execute_annotation() -def _infer_scalar_field(inference_state, field_name, field_tree_instance): + +def _infer_scalar_field(inference_state, field_name, field_tree_instance, is_instance): try: module_name, attribute_name = mapping[field_tree_instance.py__name__()] except KeyError: return None + if not is_instance: + return _get_deferred_attributes(inference_state) + if module_name is None: module = inference_state.builtins_module else: @@ -62,16 +84,21 @@ def _get_foreign_key_values(cls, field_tree_instance): yield value -def _infer_field(cls, field_name): +def _infer_field(cls, field_name, is_instance): inference_state = cls.inference_state - for field_tree_instance in field_name.infer(): - scalar_field = _infer_scalar_field(inference_state, field_name, field_tree_instance) + result = field_name.infer() + for field_tree_instance in result: + scalar_field = _infer_scalar_field( + inference_state, field_name, field_tree_instance, is_instance) if scalar_field is not None: return scalar_field name = field_tree_instance.py__name__() is_many_to_many = name == 'ManyToManyField' - if name == 'ForeignKey' or is_many_to_many: + if name in ('ForeignKey', 'OneToOneField') or is_many_to_many: + if not is_instance: + return _get_deferred_attributes(inference_state) + values = _get_foreign_key_values(cls, field_tree_instance) if is_many_to_many: return ValueSet(filter(None, [ @@ -82,16 +109,17 @@ def _infer_field(cls, field_name): debug.dbg('django plugin: fail to infer `%s` from class `%s`', field_name.string_name, cls.py__name__()) - return field_name.infer() + return result class DjangoModelName(NameWrapper): - def __init__(self, cls, name): - super(DjangoModelName, self).__init__(name) + def __init__(self, cls, name, is_instance): + super().__init__(name) self._cls = cls + self._is_instance = is_instance def infer(self): - return _infer_field(self._cls, self._wrapped_name) + return _infer_field(self._cls, self._wrapped_name, self._is_instance) def _create_manager_for(cls, manager_cls='BaseManager'): @@ -99,32 +127,170 @@ def _create_manager_for(cls, manager_cls='BaseManager'): ('django', 'db', 'models', 'manager') ).py__getattribute__(manager_cls) for m in managers: - if m.is_class() and not m.is_compiled(): + if m.is_class_mixin(): generics_manager = TupleGenericManager((ValueSet([cls]),)) for c in GenericClass(m, generics_manager).execute_annotation(): return c return None -def _new_dict_filter(cls): - filters = cls.get_filters(is_instance=True, include_metaclasses=False) +def _new_dict_filter(cls, is_instance): + filters = list(cls.get_filters( + is_instance=is_instance, + include_metaclasses=False, + include_type_when_class=False) + ) dct = { - name.string_name: DjangoModelName(cls, name) - for filter_ in reversed(list(filters)) + name.string_name: DjangoModelName(cls, name, is_instance) + for filter_ in reversed(filters) for name in filter_.values() } - manager = _create_manager_for(cls) - if manager: - dct['objects'] = manager.name + if is_instance: + # Replace the objects with a name that amounts to nothing when accessed + # in an instance. This is not perfect and still completes "objects" in + # that case, but it at least not inferes stuff like `.objects.filter`. + # It would be nicer to do that in a better way, so that it also doesn't + # show up in completions, but it's probably just not worth doing that + # for the extra amount of work. + dct['objects'] = EmptyCompiledName(cls.inference_state, 'objects') + return DictFilter(dct) +def is_django_model_base(value): + return value.py__name__() == 'ModelBase' \ + and value.get_root_context().py__name__() == 'django.db.models.base' + + def get_metaclass_filters(func): - def wrapper(cls, metaclasses): + def wrapper(cls, metaclasses, is_instance): for metaclass in metaclasses: - if metaclass.py__name__() == 'ModelBase' \ - and metaclass.get_root_context().py__name__() == 'django.db.models.base': - return [_new_dict_filter(cls)] + if is_django_model_base(metaclass): + return [_new_dict_filter(cls, is_instance)] + + return func(cls, metaclasses, is_instance) + return wrapper - return func(cls, metaclasses) + +def tree_name_to_values(func): + def wrapper(inference_state, context, tree_name): + result = func(inference_state, context, tree_name) + if tree_name.value in _FILTER_LIKE_METHODS: + # Here we try to overwrite stuff like User.objects.filter. We need + # this to make sure that keyword param completion works on these + # kind of methods. + for v in result: + if v.get_qualified_names() == ('_BaseQuerySet', tree_name.value) \ + and v.parent_context.is_module() \ + and v.parent_context.py__name__() == 'django.db.models.query': + qs = context.get_value() + generics = qs.get_generics() + if len(generics) >= 1: + return ValueSet(QuerySetMethodWrapper(v, model) + for model in generics[0]) + + elif tree_name.value == 'BaseManager' and context.is_module() \ + and context.py__name__() == 'django.db.models.manager': + return ValueSet(ManagerWrapper(r) for r in result) + + elif tree_name.value == 'Field' and context.is_module() \ + and context.py__name__() == 'django.db.models.fields': + return ValueSet(FieldWrapper(r) for r in result) + return result + return wrapper + + +def _find_fields(cls): + for name in _new_dict_filter(cls, is_instance=False).values(): + for value in name.infer(): + if value.name.get_qualified_names(include_module_names=True) \ + == ('django', 'db', 'models', 'query_utils', 'DeferredAttribute'): + yield name + + +def _get_signatures(cls): + return [DjangoModelSignature(cls, field_names=list(_find_fields(cls)))] + + +def get_metaclass_signatures(func): + def wrapper(cls, metaclasses): + for metaclass in metaclasses: + if is_django_model_base(metaclass): + return _get_signatures(cls) + return func(cls, metaclass) return wrapper + + +class ManagerWrapper(ValueWrapper): + def py__getitem__(self, index_value_set, contextualized_node): + return ValueSet( + GenericManagerWrapper(generic) + for generic in self._wrapped_value.py__getitem__( + index_value_set, contextualized_node) + ) + + +class GenericManagerWrapper(AttributeOverwrite, ClassMixin): + def py__get__on_class(self, calling_instance, instance, class_value): + return calling_instance.class_value.with_generics( + (ValueSet({class_value}),) + ).py__call__(calling_instance._arguments) + + def with_generics(self, generics_tuple): + return self._wrapped_value.with_generics(generics_tuple) + + +class FieldWrapper(ValueWrapper): + def py__getitem__(self, index_value_set, contextualized_node): + return ValueSet( + GenericFieldWrapper(generic) + for generic in self._wrapped_value.py__getitem__( + index_value_set, contextualized_node) + ) + + +class GenericFieldWrapper(AttributeOverwrite, ClassMixin): + def py__get__on_class(self, calling_instance, instance, class_value): + # This is mostly an optimization to avoid Jedi aborting inference, + # because of too many function executions of Field.__get__. + return ValueSet({calling_instance}) + + +class DjangoModelSignature(AbstractSignature): + def __init__(self, value, field_names): + super().__init__(value) + self._field_names = field_names + + def get_param_names(self, resolve_stars=False): + return [DjangoParamName(name) for name in self._field_names] + + +class DjangoParamName(BaseTreeParamName): + def __init__(self, field_name): + super().__init__(field_name.parent_context, field_name.tree_name) + self._field_name = field_name + + def get_kind(self): + return Parameter.KEYWORD_ONLY + + def infer(self): + return self._field_name.infer() + + +class QuerySetMethodWrapper(ValueWrapper): + def __init__(self, method, model_cls): + super().__init__(method) + self._model_cls = model_cls + + def py__get__(self, instance, class_value): + return ValueSet({QuerySetBoundMethodWrapper(v, self._model_cls) + for v in self._wrapped_value.py__get__(instance, class_value)}) + + +class QuerySetBoundMethodWrapper(ValueWrapper): + def __init__(self, method, model_cls): + super().__init__(method) + self._model_cls = model_cls + + def get_signatures(self): + return _get_signatures(self._model_cls) diff --git a/anaconda_lib/jedi/plugins/flask.py b/anaconda_lib/jedi/plugins/flask.py old mode 100755 new mode 100644 index 693c3ae7..8d67b839 --- a/anaconda_lib/jedi/plugins/flask.py +++ b/anaconda_lib/jedi/plugins/flask.py @@ -6,14 +6,14 @@ def import_module(callback): def wrapper(inference_state, import_names, module_context, *args, **kwargs): if len(import_names) == 3 and import_names[:2] == ('flask', 'ext'): # New style. - ipath = (u'flask_' + import_names[2]), + ipath = ('flask_' + import_names[2]), value_set = callback(inference_state, ipath, None, *args, **kwargs) if value_set: return value_set - value_set = callback(inference_state, (u'flaskext',), None, *args, **kwargs) + value_set = callback(inference_state, ('flaskext',), None, *args, **kwargs) return callback( inference_state, - (u'flaskext', import_names[2]), + ('flaskext', import_names[2]), next(iter(value_set)), *args, **kwargs ) diff --git a/anaconda_lib/jedi/plugins/pytest.py b/anaconda_lib/jedi/plugins/pytest.py old mode 100755 new mode 100644 index f9b04284..c78bdb4f --- a/anaconda_lib/jedi/plugins/pytest.py +++ b/anaconda_lib/jedi/plugins/pytest.py @@ -1,9 +1,11 @@ -from parso.python.tree import search_ancestor -from jedi._compatibility import FileNotFoundError +from pathlib import Path + +from parso.tree import search_ancestor from jedi.inference.cache import inference_state_method_cache from jedi.inference.imports import load_module_from_path from jedi.inference.filters import ParserTreeFilter from jedi.inference.base_value import NO_VALUES, ValueSet +from jedi.inference.helpers import infer_call_of_leaf _PYTEST_FIXTURE_MODULES = [ ('_pytest', 'monkeypatch'), @@ -29,7 +31,15 @@ def wrapper(value, arguments): def infer_anonymous_param(func): def get_returns(value): if value.tree_node.annotation is not None: - return value.execute_with_values() + result = value.execute_with_values() + if any(v.name.get_qualified_names(include_module_names=True) + == ('typing', 'Generator') + for v in result): + return ValueSet.from_sets( + v.py__getattribute__('__next__').execute_annotation() + for v in result + ) + return result # In pytest we need to differentiate between generators and normal # returns. @@ -41,6 +51,9 @@ def get_returns(value): return function_context.get_return_values() def wrapper(param_name): + # parameters with an annotation do not need special handling + if param_name.annotation_node: + return func(param_name) is_pytest_param, param_name_is_function_name = \ _is_a_pytest_param_and_inherited(param_name) if is_pytest_param: @@ -127,9 +140,13 @@ def _iter_pytest_modules(module_context, skip_own_module=False): if file_io is not None: folder = file_io.get_parent_folder() sys_path = module_context.inference_state.get_sys_path() + + # prevent an infinite loop when reaching the root of the current drive + last_folder = None + while any(folder.path.startswith(p) for p in sys_path): file_io = folder.get_file_io('conftest.py') - if file_io.path != module_context.py__file__(): + if Path(file_io.path) != module_context.py__file__(): try: m = load_module_from_path(module_context.inference_state, file_io) yield m.as_context() @@ -137,6 +154,11 @@ def _iter_pytest_modules(module_context, skip_own_module=False): pass folder = folder.get_parent_folder() + # prevent an infinite for loop if the same parent folder is return twice + if last_folder is not None and folder.path == last_folder.path: + break + last_folder = folder # keep track of the last found parent name + for names in _PYTEST_FIXTURE_MODULES: for module_value in module_context.inference_state.import_module(names): yield module_value.as_context() @@ -144,20 +166,37 @@ def _iter_pytest_modules(module_context, skip_own_module=False): class FixtureFilter(ParserTreeFilter): def _filter(self, names): - for name in super(FixtureFilter, self)._filter(names): + for name in super()._filter(names): funcdef = name.parent + # Class fixtures are not supported if funcdef.type == 'funcdef': - # Class fixtures are not supported decorated = funcdef.parent if decorated.type == 'decorated' and self._is_fixture(decorated): yield name def _is_fixture(self, decorated): - for decorator in decorated.children: + decorators = decorated.children[0] + if decorators.type == 'decorators': + decorators = decorators.children + else: + decorators = [decorators] + for decorator in decorators: dotted_name = decorator.children[1] # A heuristic, this makes it faster. if 'fixture' in dotted_name.get_code(): - for value in self.parent_context.infer_node(dotted_name): + if dotted_name.type == 'atom_expr': + # Since Python3.9 a decorator does not have dotted names + # anymore. + last_trailer = dotted_name.children[-1] + last_leaf = last_trailer.get_last_leaf() + if last_leaf == ')': + values = infer_call_of_leaf( + self.parent_context, last_leaf, cut_own_trailer=True) + else: + values = self.parent_context.infer_node(dotted_name) + else: + values = self.parent_context.infer_node(dotted_name) + for value in values: if value.name.get_qualified_names(include_module_names=True) \ == ('_pytest', 'fixtures', 'fixture'): return True diff --git a/anaconda_lib/jedi/plugins/registry.py b/anaconda_lib/jedi/plugins/registry.py old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/plugins/stdlib.py b/anaconda_lib/jedi/plugins/stdlib.py old mode 100755 new mode 100644 index be6a2eae..17f1df3b --- a/anaconda_lib/jedi/plugins/stdlib.py +++ b/anaconda_lib/jedi/plugins/stdlib.py @@ -11,8 +11,8 @@ """ import parso import os +from inspect import Parameter -from jedi._compatibility import force_unicode, Parameter from jedi import debug from jedi.inference.utils import safe_property from jedi.inference.helpers import get_str_or_none @@ -119,7 +119,9 @@ def call(): else: return call() - if value.is_bound_method(): + if value.is_bound_method() or value.is_instance(): + # value can be an instance for example if it is a partial + # object. return call() # for now we just support builtin functions. @@ -180,14 +182,9 @@ def wrapper(value, arguments, callback): @argument_clinic('iterator[, default], /', want_inference_state=True) def builtins_next(iterators, defaults, inference_state): - if inference_state.environment.version_info.major == 2: - name = 'next' - else: - name = '__next__' - # TODO theoretically we have to check here if something is an iterator. # That is probably done by checking if it's not a class. - return defaults | iterators.py__getattribute__(name).execute_with_values() + return defaults | iterators.py__getattribute__('__next__').execute_with_values() @argument_clinic('iterator[, default], /') @@ -206,7 +203,7 @@ def builtins_getattr(objects, names, defaults=None): debug.warning('getattr called without str') continue else: - return value.py__getattribute__(force_unicode(string)) + return value.py__getattribute__(string) return NO_VALUES @@ -257,16 +254,14 @@ def builtins_super(types, objects, context): class ReversedObject(AttributeOverwrite): def __init__(self, reversed_obj, iter_list): - super(ReversedObject, self).__init__(reversed_obj) + super().__init__(reversed_obj) self._iter_list = iter_list - @publish_method('__iter__') def py__iter__(self, contextualized_node=None): return self._iter_list - @publish_method('next', python_version_match=2) - @publish_method('__next__', python_version_match=3) - def py__next__(self): + @publish_method('__next__') + def _next(self, arguments): return ValueSet.from_sets( lazy_value.infer() for lazy_value in self._iter_list ) @@ -328,7 +323,7 @@ def builtins_isinstance(objects, types, arguments, inference_state): analysis.add(lazy_value.context, 'type-error-isinstance', node, message) return ValueSet( - compiled.builtin_from_name(inference_state, force_unicode(str(b))) + compiled.builtin_from_name(inference_state, str(b)) for b in bool_results ) @@ -345,7 +340,7 @@ def builtins_staticmethod(functions): class ClassMethodObject(ValueWrapper): def __init__(self, class_method_obj, function): - super(ClassMethodObject, self).__init__(class_method_obj) + super().__init__(class_method_obj) self._function = function def py__get__(self, instance, class_value): @@ -357,7 +352,7 @@ def py__get__(self, instance, class_value): class ClassMethodGet(ValueWrapper): def __init__(self, get_method, klass, function): - super(ClassMethodGet, self).__init__(get_method) + super().__init__(get_method) self._class = klass self._function = function @@ -370,7 +365,7 @@ def py__call__(self, arguments): class ClassMethodArguments(TreeArgumentsWrapper): def __init__(self, klass, arguments): - super(ClassMethodArguments, self).__init__(arguments) + super().__init__(arguments) self._class = klass def unpack(self, func=None): @@ -389,19 +384,21 @@ def builtins_classmethod(functions, value, arguments): class PropertyObject(AttributeOverwrite, ValueWrapper): + api_type = 'property' + def __init__(self, property_obj, function): - super(PropertyObject, self).__init__(property_obj) + super().__init__(property_obj) self._function = function def py__get__(self, instance, class_value): if instance is None: - return NO_VALUES + return ValueSet([self]) return self._function.execute_with_values(instance) @publish_method('deleter') @publish_method('getter') @publish_method('setter') - def _return_self(self): + def _return_self(self, arguments): return ValueSet({self}) @@ -425,11 +422,11 @@ def collections_namedtuple(value, arguments, callback): inference_state = value.inference_state # Process arguments - name = u'jedi_unknown_namedtuple' + name = 'jedi_unknown_namedtuple' for c in _follow_param(inference_state, arguments, 0): x = get_str_or_none(c) if x is not None: - name = force_unicode(x) + name = x break # TODO here we only use one of the types, we should use all. @@ -439,10 +436,10 @@ def collections_namedtuple(value, arguments, callback): _fields = list(param_values)[0] string = get_str_or_none(_fields) if string is not None: - fields = force_unicode(string).replace(',', ' ').split() + fields = string.replace(',', ' ').split() elif isinstance(_fields, iterable.Sequence): fields = [ - force_unicode(get_str_or_none(v)) + get_str_or_none(v) for lazy_value in _fields.py__iter__() for v in lazy_value.infer() ] @@ -455,7 +452,7 @@ def collections_namedtuple(value, arguments, callback): typename=name, field_names=tuple(fields), num_fields=len(fields), - arg_list=repr(tuple(fields)).replace("u'", "").replace("'", "")[1:-1], + arg_list=repr(tuple(fields)).replace("'", "")[1:-1], repr_fmt='', field_defs='\n'.join(_NAMEDTUPLE_FIELD_TEMPLATE.format(index=index, name=name) for index, name in enumerate(fields)) @@ -474,12 +471,11 @@ def collections_namedtuple(value, arguments, callback): class PartialObject(ValueWrapper): def __init__(self, actual_value, arguments, instance=None): - super(PartialObject, self).__init__(actual_value) - self._actual_value = actual_value + super().__init__(actual_value) self._arguments = arguments self._instance = instance - def _get_function(self, unpacked_arguments): + def _get_functions(self, unpacked_arguments): key, lazy_value = next(unpacked_arguments, (None, None)) if key is not None or lazy_value is None: debug.warning("Partial should have a proper function %s", self._arguments) @@ -488,8 +484,8 @@ def _get_function(self, unpacked_arguments): def get_signatures(self): unpacked_arguments = self._arguments.unpack() - func = self._get_function(unpacked_arguments) - if func is None: + funcs = self._get_functions(unpacked_arguments) + if funcs is None: return [] arg_count = 0 @@ -501,29 +497,44 @@ def get_signatures(self): arg_count += 1 else: keys.add(key) - return [PartialSignature(s, arg_count, keys) for s in func.get_signatures()] + return [PartialSignature(s, arg_count, keys) for s in funcs.get_signatures()] def py__call__(self, arguments): - func = self._get_function(self._arguments.unpack()) - if func is None: + funcs = self._get_functions(self._arguments.unpack()) + if funcs is None: return NO_VALUES - return func.execute( + return funcs.execute( MergedPartialArguments(self._arguments, arguments, self._instance) ) + def py__doc__(self): + """ + In CPython partial does not replace the docstring. However we are still + imitating it here, because we want this docstring to be worth something + for the user. + """ + callables = self._get_functions(self._arguments.unpack()) + if callables is None: + return '' + for callable_ in callables: + return callable_.py__doc__() + return '' + def py__get__(self, instance, class_value): return ValueSet([self]) class PartialMethodObject(PartialObject): def py__get__(self, instance, class_value): - return ValueSet([PartialObject(self._actual_value, self._arguments, instance)]) + if instance is None: + return ValueSet([self]) + return ValueSet([PartialObject(self._wrapped_value, self._arguments, instance)]) class PartialSignature(SignatureWrapper): def __init__(self, wrapped_signature, skipped_arg_count, skipped_arg_set): - super(PartialSignature, self).__init__(wrapped_signature) + super().__init__(wrapped_signature) self._skipped_arg_count = skipped_arg_count self._skipped_arg_set = skipped_arg_set @@ -616,7 +627,7 @@ def get_signatures(self): class DataclassSignature(AbstractSignature): def __init__(self, value, param_names): - super(DataclassSignature, self).__init__(value) + super().__init__(value) self._param_names = param_names def get_param_names(self, resolve_stars=False): @@ -625,7 +636,7 @@ def get_param_names(self, resolve_stars=False): class DataclassParamName(BaseTreeParamName): def __init__(self, parent_context, tree_name, annotation_node, default_node): - super(DataclassParamName, self).__init__(parent_context, tree_name) + super().__init__(parent_context, tree_name) self.annotation_node = annotation_node self.default_node = default_node @@ -641,7 +652,7 @@ def infer(self): class ItemGetterCallable(ValueWrapper): def __init__(self, instance, args_value_set): - super(ItemGetterCallable, self).__init__(instance) + super().__init__(instance) self._args_value_set = args_value_set @repack_with_argument_clinic('item, /') @@ -679,7 +690,7 @@ def py__call__(self, funcs): class Wrapped(ValueWrapper, FunctionMixin): def __init__(self, func, original_function): - super(Wrapped, self).__init__(func) + super().__init__(func) self._original_function = original_function @property @@ -717,7 +728,7 @@ def iterate(): @argument_clinic('*args, /', want_callback=True) def _os_path_join(args_set, callback): if len(args_set) == 1: - string = u'' + string = '' sequence, = args_set is_first = True for lazy_value in sequence.py__iter__(): @@ -729,7 +740,7 @@ def _os_path_join(args_set, callback): break if not is_first: string += os.path.sep - string += force_unicode(s) + string += s is_first = False else: return ValueSet([compiled.create_simple_object(sequence.inference_state, string)]) @@ -784,6 +795,9 @@ def _os_path_join(args_set, callback): # Therefore, just make it return nothing, which leads to the stubs # being used instead. This only matters for 3.7+. '_alias': lambda value, arguments, callback: NO_VALUES, + # runtime_checkable doesn't really change anything and is just + # adding logs for infering stuff, so we can safely ignore it. + 'runtime_checkable': lambda value, arguments, callback: NO_VALUES, }, 'dataclasses': { # For now this works at least better than Jedi trying to understand it. @@ -799,15 +813,16 @@ def _os_path_join(args_set, callback): def get_metaclass_filters(func): - def wrapper(cls, metaclasses): + def wrapper(cls, metaclasses, is_instance): for metaclass in metaclasses: if metaclass.py__name__() == 'EnumMeta' \ and metaclass.get_root_context().py__name__() == 'enum': filter_ = ParserTreeFilter(parent_context=cls.as_context()) return [DictFilter({ - name.string_name: EnumInstance(cls, name).name for name in filter_.values() + name.string_name: EnumInstance(cls, name).name + for name in filter_.values() })] - return func(cls, metaclasses) + return func(cls, metaclasses, is_instance) return wrapper @@ -823,6 +838,14 @@ def name(self): return ValueName(self, self._name.tree_name) def _get_wrapped_value(self): + n = self._name.string_name + if n.startswith('__') and n.endswith('__') or self._name.api_type == 'function': + inferred = self._name.infer() + if inferred: + return next(iter(inferred)) + o, = self.inference_state.builtins_module.py__getattribute__('object') + return o + value, = self._cls.execute_with_values() return value diff --git a/anaconda_lib/jedi/settings.py b/anaconda_lib/jedi/settings.py old mode 100755 new mode 100644 index 6764a3e5..c31a474a --- a/anaconda_lib/jedi/settings.py +++ b/anaconda_lib/jedi/settings.py @@ -69,8 +69,11 @@ # ---------------- if platform.system().lower() == 'windows': - _cache_directory = os.path.join(os.getenv('LOCALAPPDATA') or - os.path.expanduser('~'), 'Jedi', 'Jedi') + _cache_directory = os.path.join( + os.getenv('LOCALAPPDATA') or os.path.expanduser('~'), + 'Jedi', + 'Jedi', + ) elif platform.system().lower() == 'darwin': _cache_directory = os.path.join('~', 'Library', 'Caches', 'Jedi') else: @@ -98,7 +101,7 @@ tree. """ -_cropped_file_size = 10e6 # 1 Megabyte +_cropped_file_size = int(10e6) # 1 Megabyte """ Jedi gets extremely slow if the file size exceed a few thousand lines. To avoid getting stuck completely Jedi crops the file at some point. diff --git a/anaconda_lib/jedi/third_party/README_typeshed.md b/anaconda_lib/jedi/third_party/README_typeshed.md old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/django-stubs/CONTRIBUTING.md b/anaconda_lib/jedi/third_party/django-stubs/CONTRIBUTING.md new file mode 100644 index 00000000..bf99f533 --- /dev/null +++ b/anaconda_lib/jedi/third_party/django-stubs/CONTRIBUTING.md @@ -0,0 +1,111 @@ +# How to contribute + +## Tutorials + +If you want to start working on this project, +you will need to get familiar with these projects: + +- [Django docs](https://docs.djangoproject.com/en/dev/) +- [Typing in Python](https://inventwithpython.com/blog/2019/11/24/type-hints-for-busy-python-programmers/) +- [How to write custom mypy plugins](https://mypy.readthedocs.io/en/stable/extending_mypy.html) +- [Typechecking Django and DRF](https://sobolevn.me/2019/08/typechecking-django-and-drf) guide +- [Testing mypy stubs, plugins, and types](https://sobolevn.me/2019/08/testing-mypy-types) guide + +It is also recommended to take a look at these resources: + +- [Awesome Python Typing](https://github.com/typeddjango/awesome-python-typing) + + +## Dev documentation + +TODO + + +## Dependencies + +We use `pip` to manage the dependencies. + +To install them you would need to activate your `virtualenv` and run `install` command: + +```bash +pip install -r ./dev-requirements.txt +``` + + +## Tests and linters + +We use `mypy`, `pytest`, `flake8`, and `black` for quality control. +Here's [how we run our CI](https://github.com/typeddjango/django-stubs/blob/master/.travis.yml). + +### Typechecking + +To run typechecking use: + +```bash +mypy ./mypy_django_plugin +``` + +### Testing + +There are unit tests and type-related tests. + +To run unit tests: + +```bash +pytest +``` + +Type-related tests ensure that different Django versions do work correctly. +To run type-related tests: + +```bash +python ./scripts/typecheck_tests.py --django_version=2.2 +python ./scripts/typecheck_tests.py --django_version=3.0 +``` + +Currently we only support two Django versions. + +### Linting + +To run auto-formatting: + +```bash +isort -rc . +black django-stubs/ +``` + +To run linting: + +```bash +flake8 +flake8 --config flake8-pyi.ini +``` + + +## Submitting your code + +We use [trunk based](https://trunkbaseddevelopment.com/) +development (we also sometimes call it `wemake-git-flow`). + +What the point of this method? + +1. We use protected `master` branch, + so the only way to push your code is via pull request +2. We use issue branches: to implement a new feature or to fix a bug + create a new branch named `issue-$TASKNUMBER` +3. Then create a pull request to `master` branch +4. We use `git tag`s to make releases, so we can track what has changed + since the latest release + +So, this way we achieve an easy and scalable development process +which frees us from merging hell and long-living branches. + +In this method, the latest version of the app is always in the `master` branch. + + +## Other help + +You can contribute by spreading a word about this library. +It would also be a huge contribution to write +a short article on how you are using this project. +You can also share your best practices with us. diff --git a/anaconda_lib/jedi/third_party/django-stubs/LICENSE.txt b/anaconda_lib/jedi/third_party/django-stubs/LICENSE.txt new file mode 100644 index 00000000..3ebfb517 --- /dev/null +++ b/anaconda_lib/jedi/third_party/django-stubs/LICENSE.txt @@ -0,0 +1,8 @@ +Copyright (c) Maxim Kurnikov. +All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/anaconda_lib/jedi/third_party/django-stubs/README.md b/anaconda_lib/jedi/third_party/django-stubs/README.md new file mode 100644 index 00000000..b9d25f7f --- /dev/null +++ b/anaconda_lib/jedi/third_party/django-stubs/README.md @@ -0,0 +1,120 @@ +mypy logo + +# Typesafe Django Framework + +[![Build Status](https://travis-ci.com/typeddjango/django-stubs.svg?branch=master)](https://travis-ci.com/typeddjango/django-stubs) +[![Checked with mypy](http://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/) +[![Gitter](https://badges.gitter.im/mypy-django/Lobby.svg)](https://gitter.im/mypy-django/Lobby) + +This package contains [type stubs](https://www.python.org/dev/peps/pep-0561/) and a custom mypy plugin to provide more precise static types and type inference for Django framework. Django uses some Python "magic" that makes having precise types for some code patterns problematic. This is why we need this project. The final goal is to be able to get precise types for most common patterns. + + +## Installation + +```bash +pip install django-stubs +``` + +See [Configuration](#configuration) section to get started. + + +## Configuration + +To make `mypy` happy, you will need to add: + +```ini +[mypy] +plugins = + mypy_django_plugin.main + +[mypy.plugins.django-stubs] +django_settings_module = "myproject.settings" +``` + +in your `mypy.ini` or `setup.cfg` [file](https://mypy.readthedocs.io/en/latest/config_file.html). + +Two things happeining here: + +1. We need to explicitly list our plugin to be loaded by `mypy` +2. Our plugin also requires `django` settings module (what you put into `DJANGO_SETTINGS_MODULE` variable) to be specified + +This fully working [typed boilerplate](https://github.com/wemake-services/wemake-django-template) can serve you as an example. + + +## Version compatibility + +We rely on different `django` and `mypy` versions: + +| django-stubs | mypy version | django version | python version +| ------------ | ---- | ---- | ---- | +| 1.5.0 | 0.780 | 2.2.x \|\| 3.x | ^3.6 +| 1.4.0 | 0.770 | 2.2.x \|\| 3.x | ^3.6 +| 1.3.0 | 0.750 | 2.2.x \|\| 3.x | ^3.6 +| 1.2.0 | 0.730 | 2.2.x | ^3.6 +| 1.1.0 | 0.720 | 2.2.x | ^3.6 +| 0.12.x | old semantic analyzer (<0.711), dmypy support | 2.1.x | ^3.6 + + +## FAQ + +### Is this an official Django project? + +No, it is not. We are indendepent from Django at the moment. +There's a [proposal](https://github.com/django/deps/pull/65) to merge our project into the Django itself. +You show your support by linking the PR. + +### Is it safe to use this in production? + +Yes, it is! This project does not affect your runtime at all. +It only affects `mypy` type checking process. + +But, it does not make any sense to use this project without `mypy`. + +### mypy crashes when I run it with this plugin installed + +Current implementation uses Django runtime to extract models information, so it will crash, if your installed apps or `models.py` is not correct. For this same reason, you cannot use `reveal_type` inside global scope of any Python file that will be executed for `django.setup()`. + +In other words, if your `manage.py runserver` crashes, mypy will crash too. +You can also run `mypy` with [`--tb`](https://mypy.readthedocs.io/en/stable/command_line.html#cmdoption-mypy-show-traceback) +option to get extra information about the error. + +### I cannot use QuerySet or Manager with type annotations + +You can get a `TypeError: 'type' object is not subscriptable` +when you will try to use `QuerySet[MyModel]` or `Manager[MyModel]`. + +This happens because Django classes do not support [`__class_getitem__`](https://www.python.org/dev/peps/pep-0560/#class-getitem) magic method. + +You can use strings instead: `'QuerySet[MyModel]'` and `'Manager[MyModel]'`, this way it will work as a type for `mypy` and as a regular `str` in runtime. + +Currently we [are working](https://github.com/django/django/pull/12405) on providing `__class_getitem__` to the classes where we need them. + +### How can I use HttpRequest with custom user model? + +You can subclass standard request like so: + +```python +from django.http import HttpRequest +from my_user_app.models import MyUser + +class MyRequest(HttpRequest): + user: MyUser +``` + +And then use `MyRequest` instead of standard `HttpRequest` inside your project. + + +## Related projects + +- [`awesome-python-typing`](https://github.com/typeddjango/awesome-python-typing) - Awesome list of all typing-related things in Python. +- [`djangorestframework-stubs`](https://github.com/typeddjango/djangorestframework-stubs) - Stubs for Django REST Framework. +- [`pytest-mypy-plugins`](https://github.com/typeddjango/pytest-mypy-plugins) - `pytest` plugin that we use for testing `mypy` stubs and plugins. +- [`wemake-django-template`](https://github.com/wemake-services/wemake-django-template) - Create new typed Django projects in seconds. + + + +## To get help + +We have Gitter here: + +If you think you have more generic typing issue, please refer to and their Gitter. diff --git a/anaconda_lib/jedi/third_party/django-stubs/dev-requirements.txt b/anaconda_lib/jedi/third_party/django-stubs/dev-requirements.txt new file mode 100644 index 00000000..a845f69c --- /dev/null +++ b/anaconda_lib/jedi/third_party/django-stubs/dev-requirements.txt @@ -0,0 +1,8 @@ +black +pytest-mypy-plugins==1.3.0 +psycopg2 +flake8==3.7.9 +flake8-pyi==19.3.0 +isort==4.3.21 +gitpython==3.1.0 +-e . diff --git a/anaconda_lib/jedi/third_party/django-stubs/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/apps/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/apps/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/apps/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/apps/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/apps/config.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/apps/config.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/apps/config.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/apps/config.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/apps/registry.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/apps/registry.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/apps/registry.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/apps/registry.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/conf/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/conf/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/conf/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/conf/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/conf/global_settings.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/conf/global_settings.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/conf/global_settings.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/conf/global_settings.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/conf/locale/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/conf/locale/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/conf/locale/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/conf/locale/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/conf/urls/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/conf/urls/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/conf/urls/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/conf/urls/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/conf/urls/i18n.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/conf/urls/i18n.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/conf/urls/i18n.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/conf/urls/i18n.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/conf/urls/static.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/conf/urls/static.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/conf/urls/static.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/conf/urls/static.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/admin/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/admin/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/admin/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/admin/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/admin/actions.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/admin/actions.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/admin/actions.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/admin/actions.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/admin/apps.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/admin/apps.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/admin/apps.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/admin/apps.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/admin/checks.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/admin/checks.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/admin/checks.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/admin/checks.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/admin/decorators.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/admin/decorators.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/admin/decorators.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/admin/decorators.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/admin/filters.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/admin/filters.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/admin/filters.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/admin/filters.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/admin/forms.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/admin/forms.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/admin/forms.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/admin/forms.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/admin/helpers.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/admin/helpers.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/admin/helpers.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/admin/helpers.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/admin/models.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/admin/models.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/admin/models.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/admin/models.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/admin/options.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/admin/options.pyi old mode 100755 new mode 100644 similarity index 84% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/admin/options.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/admin/options.pyi index 879e8e28..63928972 --- a/anaconda_lib/jedi/third_party/django-stubs/contrib/admin/options.pyi +++ b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/admin/options.pyi @@ -1,5 +1,9 @@ from collections import OrderedDict -from typing import Any, Callable, Dict, Iterator, List, Optional, Sequence, Set, Tuple, Type, Union +from typing import Any, Callable, Dict, Iterator, List, Optional, Sequence, Set, Tuple, Type, Union, Mapping, TypeVar + +from django.forms.forms import BaseForm +from django.forms.formsets import BaseFormSet +from typing_extensions import Literal, TypedDict from django.contrib.admin.filters import ListFilter from django.contrib.admin.models import LogEntry @@ -26,8 +30,10 @@ from django.db.models.fields import Field IS_POPUP_VAR: str TO_FIELD_VAR: str -HORIZONTAL: Any -VERTICAL: Any +HORIZONTAL: Literal[1] = ... +VERTICAL: Literal[2] = ... + +_Direction = Union[Literal[1], Literal[2]] def get_content_type_for_model(obj: Union[Type[Model], Model]) -> ContentType: ... def get_ul_class(radio_style: int) -> str: ... @@ -37,21 +43,35 @@ class IncorrectLookupParameters(Exception): ... FORMFIELD_FOR_DBFIELD_DEFAULTS: Any csrf_protect_m: Any +class _OptionalFieldOpts(TypedDict, total=False): + classes: Sequence[str] + description: str + +class _FieldOpts(_OptionalFieldOpts, total=True): + fields: Sequence[Union[str, Sequence[str]]] + +# Workaround for mypy issue, a Sequence type should be preferred here. +# https://github.com/python/mypy/issues/8921 +# _FieldsetSpec = Sequence[Tuple[Optional[str], _FieldOpts]] +_T = TypeVar("_T") +_ListOrTuple = Union[Tuple[_T, ...], List[_T]] +_FieldsetSpec = _ListOrTuple[Tuple[Optional[str], _FieldOpts]] + class BaseModelAdmin: - autocomplete_fields: Any = ... - raw_id_fields: Any = ... - fields: Any = ... - exclude: Any = ... - fieldsets: Any = ... - form: Any = ... - filter_vertical: Any = ... - filter_horizontal: Any = ... - radio_fields: Any = ... - prepopulated_fields: Any = ... - formfield_overrides: Any = ... - readonly_fields: Any = ... - ordering: Any = ... - sortable_by: Any = ... + autocomplete_fields: Sequence[str] = ... + raw_id_fields: Sequence[str] = ... + fields: Sequence[Union[str, Sequence[str]]] = ... + exclude: Sequence[str] = ... + fieldsets: _FieldsetSpec = ... + form: Type[BaseForm] = ... + filter_vertical: Sequence[str] = ... + filter_horizontal: Sequence[str] = ... + radio_fields: Mapping[str, _Direction] = ... + prepopulated_fields: Mapping[str, Sequence[str]] = ... + formfield_overrides: Mapping[Type[Field], Mapping[str, Any]] = ... + readonly_fields: Sequence[Union[str, Callable[[Model], Any]]] = ... + ordering: Sequence[str] = ... + sortable_by: Sequence[str] = ... view_on_site: bool = ... show_full_result_count: bool = ... checks_class: Any = ... @@ -93,7 +113,7 @@ class BaseModelAdmin: def has_module_permission(self, request: HttpRequest) -> bool: ... class ModelAdmin(BaseModelAdmin): - list_display: Sequence[Union[str, Callable]] = ... + list_display: Sequence[Union[str, Callable[[Model], Any]]] = ... list_display_links: Optional[Sequence[Union[str, Callable]]] = ... list_filter: Sequence[Union[str, Type[ListFilter], Tuple[str, Type[ListFilter]]]] = ... list_select_related: Union[bool, Sequence[str]] = ... @@ -101,21 +121,21 @@ class ModelAdmin(BaseModelAdmin): list_max_show_all: int = ... list_editable: Sequence[str] = ... search_fields: Sequence[str] = ... - date_hierarchy: Optional[Any] = ... + date_hierarchy: Optional[str] = ... save_as: bool = ... save_as_continue: bool = ... save_on_top: bool = ... - paginator: Any = ... + paginator: Type = ... preserve_filters: bool = ... inlines: Sequence[Type[InlineModelAdmin]] = ... - add_form_template: Any = ... - change_form_template: Any = ... - change_list_template: Any = ... - delete_confirmation_template: Any = ... - delete_selected_confirmation_template: Any = ... - object_history_template: Any = ... - popup_response_template: Any = ... - actions: Any = ... + add_form_template: str = ... + change_form_template: str = ... + change_list_template: str = ... + delete_confirmation_template: str = ... + delete_selected_confirmation_template: str = ... + object_history_template: str = ... + popup_response_template: str = ... + actions: Sequence[Callable[[ModelAdmin, HttpRequest, QuerySet], None]] = ... action_form: Any = ... actions_on_top: bool = ... actions_on_bottom: bool = ... @@ -227,9 +247,9 @@ class ModelAdmin(BaseModelAdmin): def history_view(self, request: HttpRequest, object_id: str, extra_context: None = ...) -> HttpResponse: ... class InlineModelAdmin(BaseModelAdmin): - model: Any = ... - fk_name: Any = ... - formset: Any = ... + model: Type[Model] = ... + fk_name: str = ... + formset: BaseFormSet = ... extra: int = ... min_num: Optional[int] = ... max_num: Optional[int] = ... @@ -238,8 +258,8 @@ class InlineModelAdmin(BaseModelAdmin): verbose_name_plural: Optional[str] = ... can_delete: bool = ... show_change_link: bool = ... - classes: Any = ... - admin_site: Any = ... + classes: Optional[Sequence[str]] = ... + admin_site: AdminSite = ... parent_model: Any = ... opts: Any = ... has_registered_model: Any = ... diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/admin/sites.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/admin/sites.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/admin/sites.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/admin/sites.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/admin/templatetags/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/admin/templatetags/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/admin/templatetags/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/admin/templatetags/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/admin/templatetags/admin_list.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/admin/templatetags/admin_list.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/admin/templatetags/admin_list.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/admin/templatetags/admin_list.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/admin/templatetags/admin_modify.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/admin/templatetags/admin_modify.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/admin/templatetags/admin_modify.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/admin/templatetags/admin_modify.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/admin/templatetags/admin_static.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/admin/templatetags/admin_static.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/admin/templatetags/admin_static.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/admin/templatetags/admin_static.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/admin/templatetags/admin_urls.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/admin/templatetags/admin_urls.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/admin/templatetags/admin_urls.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/admin/templatetags/admin_urls.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/admin/templatetags/base.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/admin/templatetags/base.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/admin/templatetags/base.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/admin/templatetags/base.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/admin/templatetags/log.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/admin/templatetags/log.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/admin/templatetags/log.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/admin/templatetags/log.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/admin/tests.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/admin/tests.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/admin/tests.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/admin/tests.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/admin/utils.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/admin/utils.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/admin/utils.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/admin/utils.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/admin/views/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/admin/views/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/admin/views/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/admin/views/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/admin/views/autocomplete.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/admin/views/autocomplete.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/admin/views/autocomplete.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/admin/views/autocomplete.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/admin/views/decorators.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/admin/views/decorators.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/admin/views/decorators.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/admin/views/decorators.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/admin/views/main.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/admin/views/main.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/admin/views/main.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/admin/views/main.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/admin/widgets.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/admin/widgets.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/admin/widgets.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/admin/widgets.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/admindocs/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/admindocs/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/admindocs/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/admindocs/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/admindocs/middleware.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/admindocs/middleware.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/admindocs/middleware.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/admindocs/middleware.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/admindocs/urls.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/admindocs/urls.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/admindocs/urls.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/admindocs/urls.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/admindocs/utils.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/admindocs/utils.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/admindocs/utils.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/admindocs/utils.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/admindocs/views.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/admindocs/views.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/admindocs/views.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/admindocs/views.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/auth/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/auth/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/auth/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/auth/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/auth/admin.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/auth/admin.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/auth/admin.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/auth/admin.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/auth/apps.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/auth/apps.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/auth/apps.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/auth/apps.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/auth/backends.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/auth/backends.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/auth/backends.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/auth/backends.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/auth/base_user.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/auth/base_user.pyi old mode 100755 new mode 100644 similarity index 84% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/auth/base_user.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/auth/base_user.pyi index c6739386..1cbcac16 --- a/anaconda_lib/jedi/third_party/django-stubs/contrib/auth/base_user.pyi +++ b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/auth/base_user.pyi @@ -1,9 +1,15 @@ +import sys from typing import Any, Optional, Tuple, List, overload, TypeVar from django.db.models.base import Model from django.db import models +if sys.version_info < (3, 8): + from typing_extensions import Literal +else: + from typing import Literal + _T = TypeVar("_T", bound=Model) class BaseUserManager(models.Manager[_T]): @@ -20,9 +26,9 @@ class AbstractBaseUser(models.Model): def get_username(self) -> str: ... def natural_key(self) -> Tuple[str]: ... @property - def is_anonymous(self) -> bool: ... + def is_anonymous(self) -> Literal[False]: ... @property - def is_authenticated(self) -> bool: ... + def is_authenticated(self) -> Literal[True]: ... def set_password(self, raw_password: Optional[str]) -> None: ... def check_password(self, raw_password: str) -> bool: ... def set_unusable_password(self) -> None: ... diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/auth/checks.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/auth/checks.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/auth/checks.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/auth/checks.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/auth/context_processors.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/auth/context_processors.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/auth/context_processors.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/auth/context_processors.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/auth/decorators.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/auth/decorators.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/auth/decorators.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/auth/decorators.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/auth/forms.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/auth/forms.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/auth/forms.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/auth/forms.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/auth/handlers/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/auth/handlers/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/auth/handlers/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/auth/handlers/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/auth/handlers/modwsgi.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/auth/handlers/modwsgi.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/auth/handlers/modwsgi.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/auth/handlers/modwsgi.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/auth/hashers.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/auth/hashers.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/auth/hashers.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/auth/hashers.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/auth/management/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/auth/management/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/auth/management/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/auth/management/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/auth/management/commands/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/auth/management/commands/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/auth/management/commands/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/auth/management/commands/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/auth/management/commands/changepassword.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/auth/management/commands/changepassword.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/auth/management/commands/changepassword.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/auth/management/commands/changepassword.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/auth/management/commands/createsuperuser.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/auth/management/commands/createsuperuser.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/auth/management/commands/createsuperuser.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/auth/management/commands/createsuperuser.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/auth/middleware.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/auth/middleware.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/auth/middleware.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/auth/middleware.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/auth/mixins.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/auth/mixins.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/auth/mixins.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/auth/mixins.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/auth/models.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/auth/models.pyi old mode 100755 new mode 100644 similarity index 95% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/auth/models.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/auth/models.pyi index 2068c8a7..921841ea --- a/anaconda_lib/jedi/third_party/django-stubs/contrib/auth/models.pyi +++ b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/auth/models.pyi @@ -1,3 +1,4 @@ +import sys from typing import Any, Collection, Optional, Set, Tuple, Type, TypeVar, Union from django.contrib.auth.backends import ModelBackend @@ -9,6 +10,11 @@ from django.db.models.manager import EmptyManager from django.db import models +if sys.version_info < (3, 8): + from typing_extensions import Literal +else: + from typing import Literal + _AnyUser = Union[Model, "AnonymousUser"] def update_last_login(sender: Type[AbstractBaseUser], user: AbstractBaseUser, **kwargs: Any) -> None: ... @@ -105,7 +111,7 @@ class AnonymousUser: def has_perms(self, perm_list: Collection[str], obj: Optional[_AnyUser] = ...) -> bool: ... def has_module_perms(self, module: str) -> bool: ... @property - def is_anonymous(self) -> bool: ... + def is_anonymous(self) -> Literal[True]: ... @property - def is_authenticated(self) -> bool: ... + def is_authenticated(self) -> Literal[False]: ... def get_username(self) -> str: ... diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/auth/password_validation.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/auth/password_validation.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/auth/password_validation.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/auth/password_validation.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/auth/signals.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/auth/signals.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/auth/signals.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/auth/signals.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/auth/tokens.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/auth/tokens.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/auth/tokens.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/auth/tokens.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/auth/urls.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/auth/urls.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/auth/urls.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/auth/urls.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/auth/validators.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/auth/validators.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/auth/validators.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/auth/validators.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/auth/views.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/auth/views.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/auth/views.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/auth/views.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/contenttypes/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/contenttypes/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/contenttypes/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/contenttypes/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/contenttypes/admin.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/contenttypes/admin.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/contenttypes/admin.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/contenttypes/admin.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/contenttypes/apps.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/contenttypes/apps.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/contenttypes/apps.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/contenttypes/apps.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/contenttypes/checks.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/contenttypes/checks.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/contenttypes/checks.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/contenttypes/checks.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/contenttypes/fields.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/contenttypes/fields.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/contenttypes/fields.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/contenttypes/fields.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/contenttypes/forms.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/contenttypes/forms.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/contenttypes/forms.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/contenttypes/forms.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/contenttypes/management/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/contenttypes/management/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/contenttypes/management/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/contenttypes/management/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/contenttypes/management/commands/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/contenttypes/management/commands/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/contenttypes/management/commands/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/contenttypes/management/commands/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/contenttypes/management/commands/remove_stale_contenttypes.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/contenttypes/management/commands/remove_stale_contenttypes.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/contenttypes/management/commands/remove_stale_contenttypes.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/contenttypes/management/commands/remove_stale_contenttypes.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/contenttypes/models.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/contenttypes/models.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/contenttypes/models.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/contenttypes/models.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/contenttypes/views.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/contenttypes/views.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/contenttypes/views.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/contenttypes/views.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/flatpages/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/flatpages/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/flatpages/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/flatpages/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/flatpages/forms.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/flatpages/forms.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/flatpages/forms.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/flatpages/forms.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/flatpages/middleware.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/flatpages/middleware.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/flatpages/middleware.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/flatpages/middleware.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/flatpages/models.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/flatpages/models.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/flatpages/models.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/flatpages/models.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/flatpages/sitemaps.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/flatpages/sitemaps.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/flatpages/sitemaps.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/flatpages/sitemaps.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/flatpages/templatetags/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/flatpages/templatetags/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/flatpages/templatetags/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/flatpages/templatetags/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/flatpages/templatetags/flatpages.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/flatpages/templatetags/flatpages.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/flatpages/templatetags/flatpages.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/flatpages/templatetags/flatpages.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/flatpages/urls.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/flatpages/urls.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/flatpages/urls.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/flatpages/urls.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/flatpages/views.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/flatpages/views.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/flatpages/views.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/flatpages/views.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/gis/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/gis/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/gis/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/gis/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/gis/db/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/gis/db/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/gis/db/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/gis/db/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/gis/db/models/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/gis/db/models/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/gis/db/models/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/gis/db/models/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/gis/db/models/fields.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/gis/db/models/fields.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/gis/db/models/fields.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/gis/db/models/fields.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/humanize/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/humanize/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/humanize/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/humanize/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/humanize/templatetags/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/humanize/templatetags/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/humanize/templatetags/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/humanize/templatetags/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/humanize/templatetags/humanize.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/humanize/templatetags/humanize.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/humanize/templatetags/humanize.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/humanize/templatetags/humanize.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/messages/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/messages/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/messages/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/messages/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/messages/api.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/messages/api.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/messages/api.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/messages/api.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/messages/constants.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/messages/constants.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/messages/constants.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/messages/constants.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/messages/context_processors.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/messages/context_processors.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/messages/context_processors.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/messages/context_processors.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/messages/middleware.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/messages/middleware.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/messages/middleware.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/messages/middleware.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/messages/storage/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/messages/storage/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/messages/storage/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/messages/storage/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/messages/storage/base.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/messages/storage/base.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/messages/storage/base.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/messages/storage/base.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/messages/storage/cookie.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/messages/storage/cookie.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/messages/storage/cookie.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/messages/storage/cookie.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/messages/storage/fallback.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/messages/storage/fallback.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/messages/storage/fallback.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/messages/storage/fallback.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/messages/storage/session.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/messages/storage/session.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/messages/storage/session.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/messages/storage/session.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/messages/utils.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/messages/utils.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/messages/utils.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/messages/utils.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/messages/views.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/messages/views.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/messages/views.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/messages/views.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/postgres/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/postgres/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/postgres/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/postgres/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/postgres/aggregates/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/postgres/aggregates/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/postgres/aggregates/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/postgres/aggregates/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/postgres/aggregates/general.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/postgres/aggregates/general.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/postgres/aggregates/general.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/postgres/aggregates/general.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/postgres/aggregates/mixins.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/postgres/aggregates/mixins.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/postgres/aggregates/mixins.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/postgres/aggregates/mixins.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/postgres/aggregates/statistics.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/postgres/aggregates/statistics.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/postgres/aggregates/statistics.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/postgres/aggregates/statistics.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/postgres/constraints.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/postgres/constraints.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/postgres/constraints.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/postgres/constraints.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/postgres/fields/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/postgres/fields/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/postgres/fields/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/postgres/fields/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/postgres/fields/array.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/postgres/fields/array.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/postgres/fields/array.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/postgres/fields/array.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/postgres/fields/citext.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/postgres/fields/citext.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/postgres/fields/citext.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/postgres/fields/citext.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/postgres/fields/hstore.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/postgres/fields/hstore.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/postgres/fields/hstore.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/postgres/fields/hstore.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/postgres/fields/jsonb.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/postgres/fields/jsonb.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/postgres/fields/jsonb.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/postgres/fields/jsonb.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/postgres/fields/mixins.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/postgres/fields/mixins.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/postgres/fields/mixins.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/postgres/fields/mixins.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/postgres/fields/ranges.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/postgres/fields/ranges.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/postgres/fields/ranges.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/postgres/fields/ranges.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/postgres/functions.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/postgres/functions.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/postgres/functions.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/postgres/functions.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/postgres/indexes.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/postgres/indexes.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/postgres/indexes.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/postgres/indexes.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/postgres/lookups.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/postgres/lookups.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/postgres/lookups.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/postgres/lookups.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/postgres/operations.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/postgres/operations.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/postgres/operations.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/postgres/operations.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/postgres/search.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/postgres/search.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/postgres/search.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/postgres/search.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/postgres/signals.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/postgres/signals.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/postgres/signals.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/postgres/signals.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/postgres/validators.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/postgres/validators.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/postgres/validators.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/postgres/validators.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/redirects/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/redirects/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/redirects/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/redirects/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/redirects/middleware.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/redirects/middleware.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/redirects/middleware.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/redirects/middleware.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/redirects/models.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/redirects/models.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/redirects/models.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/redirects/models.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/sessions/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/sessions/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/sessions/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/sessions/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/sessions/backends/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/sessions/backends/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/sessions/backends/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/sessions/backends/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/sessions/backends/base.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/sessions/backends/base.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/sessions/backends/base.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/sessions/backends/base.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/sessions/backends/cache.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/sessions/backends/cache.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/sessions/backends/cache.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/sessions/backends/cache.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/sessions/backends/cached_db.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/sessions/backends/cached_db.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/sessions/backends/cached_db.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/sessions/backends/cached_db.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/sessions/backends/db.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/sessions/backends/db.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/sessions/backends/db.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/sessions/backends/db.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/sessions/backends/file.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/sessions/backends/file.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/sessions/backends/file.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/sessions/backends/file.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/sessions/backends/signed_cookies.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/sessions/backends/signed_cookies.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/sessions/backends/signed_cookies.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/sessions/backends/signed_cookies.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/sessions/base_session.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/sessions/base_session.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/sessions/base_session.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/sessions/base_session.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/sessions/exceptions.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/sessions/exceptions.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/sessions/exceptions.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/sessions/exceptions.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/sessions/management/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/sessions/management/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/sessions/management/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/sessions/management/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/sessions/management/commands/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/sessions/management/commands/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/sessions/management/commands/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/sessions/management/commands/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/sessions/management/commands/clearsessions.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/sessions/management/commands/clearsessions.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/sessions/management/commands/clearsessions.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/sessions/management/commands/clearsessions.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/sessions/middleware.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/sessions/middleware.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/sessions/middleware.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/sessions/middleware.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/sessions/models.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/sessions/models.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/sessions/models.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/sessions/models.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/sessions/serializers.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/sessions/serializers.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/sessions/serializers.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/sessions/serializers.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/sitemaps/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/sitemaps/__init__.pyi old mode 100755 new mode 100644 similarity index 78% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/sitemaps/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/sitemaps/__init__.pyi index 31897e20..3ffc9533 --- a/anaconda_lib/jedi/third_party/django-stubs/contrib/sitemaps/__init__.pyi +++ b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/sitemaps/__init__.pyi @@ -1,5 +1,5 @@ from datetime import datetime -from typing import Any, Dict, List, Optional, Union +from typing import Any, Dict, List, Optional, Union, Protocol from django.contrib.sites.models import Site from django.contrib.sites.requests import RequestSite @@ -13,10 +13,19 @@ class SitemapNotFound(Exception): ... def ping_google(sitemap_url: Optional[str] = ..., ping_url: str = ...) -> None: ... +class _SupportsLen(Protocol): + def __len__(self) -> int: ... + +class _SupportsCount(Protocol): + def count(self) -> int: ... + +class _SupportsOrdered(Protocol): + ordered: bool = ... + class Sitemap: limit: int = ... protocol: Optional[str] = ... - def items(self) -> List[Any]: ... + def items(self) -> Union[_SupportsLen, _SupportsCount, _SupportsOrdered]: ... def location(self, obj: Model) -> str: ... @property def paginator(self) -> Paginator: ... diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/sitemaps/management/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/sitemaps/management/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/sitemaps/management/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/sitemaps/management/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/sitemaps/management/commands/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/sitemaps/management/commands/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/sitemaps/management/commands/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/sitemaps/management/commands/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/sitemaps/management/commands/ping_google.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/sitemaps/management/commands/ping_google.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/sitemaps/management/commands/ping_google.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/sitemaps/management/commands/ping_google.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/sitemaps/views.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/sitemaps/views.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/sitemaps/views.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/sitemaps/views.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/sites/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/sites/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/sites/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/sites/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/sites/apps.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/sites/apps.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/sites/apps.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/sites/apps.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/sites/management.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/sites/management.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/sites/management.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/sites/management.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/sites/managers.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/sites/managers.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/sites/managers.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/sites/managers.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/sites/middleware.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/sites/middleware.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/sites/middleware.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/sites/middleware.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/sites/models.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/sites/models.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/sites/models.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/sites/models.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/sites/requests.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/sites/requests.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/sites/requests.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/sites/requests.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/sites/shortcuts.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/sites/shortcuts.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/sites/shortcuts.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/sites/shortcuts.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/staticfiles/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/staticfiles/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/staticfiles/apps.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/apps.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/staticfiles/apps.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/apps.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/staticfiles/checks.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/checks.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/staticfiles/checks.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/checks.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/staticfiles/finders.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/finders.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/staticfiles/finders.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/finders.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/staticfiles/handlers.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/handlers.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/staticfiles/handlers.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/handlers.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/staticfiles/management/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/management/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/staticfiles/management/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/management/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/staticfiles/management/commands/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/management/commands/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/staticfiles/management/commands/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/management/commands/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/staticfiles/management/commands/collectstatic.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/management/commands/collectstatic.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/staticfiles/management/commands/collectstatic.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/management/commands/collectstatic.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/staticfiles/management/commands/findstatic.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/management/commands/findstatic.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/staticfiles/management/commands/findstatic.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/management/commands/findstatic.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/staticfiles/management/commands/runserver.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/management/commands/runserver.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/staticfiles/management/commands/runserver.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/management/commands/runserver.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/staticfiles/storage.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/storage.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/staticfiles/storage.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/storage.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/staticfiles/templatetags/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/templatetags/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/staticfiles/templatetags/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/templatetags/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/staticfiles/templatetags/staticfiles.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/templatetags/staticfiles.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/staticfiles/templatetags/staticfiles.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/templatetags/staticfiles.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/staticfiles/testing.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/testing.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/staticfiles/testing.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/testing.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/staticfiles/urls.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/urls.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/staticfiles/urls.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/urls.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/staticfiles/utils.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/utils.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/staticfiles/utils.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/utils.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/staticfiles/views.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/views.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/staticfiles/views.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/views.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/syndication/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/syndication/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/syndication/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/syndication/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/contrib/syndication/views.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/syndication/views.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/contrib/syndication/views.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/contrib/syndication/views.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/core/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/cache/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/cache/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/core/cache/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/cache/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/cache/backends/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/cache/backends/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/core/cache/backends/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/cache/backends/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/cache/backends/base.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/cache/backends/base.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/core/cache/backends/base.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/cache/backends/base.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/cache/backends/db.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/cache/backends/db.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/core/cache/backends/db.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/cache/backends/db.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/cache/backends/dummy.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/cache/backends/dummy.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/core/cache/backends/dummy.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/cache/backends/dummy.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/cache/backends/filebased.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/cache/backends/filebased.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/core/cache/backends/filebased.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/cache/backends/filebased.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/cache/backends/locmem.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/cache/backends/locmem.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/core/cache/backends/locmem.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/cache/backends/locmem.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/cache/backends/memcached.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/cache/backends/memcached.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/core/cache/backends/memcached.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/cache/backends/memcached.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/cache/utils.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/cache/utils.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/core/cache/utils.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/cache/utils.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/checks/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/checks/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/core/checks/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/checks/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/checks/caches.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/checks/caches.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/core/checks/caches.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/checks/caches.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/checks/database.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/checks/database.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/core/checks/database.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/checks/database.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/checks/messages.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/checks/messages.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/core/checks/messages.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/checks/messages.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/checks/model_checks.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/checks/model_checks.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/core/checks/model_checks.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/checks/model_checks.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/checks/registry.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/checks/registry.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/core/checks/registry.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/checks/registry.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/checks/security/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/checks/security/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/core/checks/security/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/checks/security/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/checks/security/base.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/checks/security/base.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/core/checks/security/base.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/checks/security/base.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/checks/security/csrf.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/checks/security/csrf.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/core/checks/security/csrf.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/checks/security/csrf.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/checks/security/sessions.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/checks/security/sessions.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/core/checks/security/sessions.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/checks/security/sessions.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/checks/templates.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/checks/templates.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/core/checks/templates.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/checks/templates.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/checks/translation.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/checks/translation.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/core/checks/translation.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/checks/translation.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/checks/urls.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/checks/urls.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/core/checks/urls.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/checks/urls.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/exceptions.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/exceptions.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/core/exceptions.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/exceptions.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/files/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/files/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/core/files/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/files/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/files/base.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/files/base.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/core/files/base.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/files/base.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/files/images.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/files/images.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/core/files/images.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/files/images.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/files/locks.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/files/locks.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/core/files/locks.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/files/locks.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/files/move.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/files/move.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/core/files/move.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/files/move.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/files/storage.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/files/storage.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/core/files/storage.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/files/storage.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/files/temp.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/files/temp.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/core/files/temp.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/files/temp.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/files/uploadedfile.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/files/uploadedfile.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/core/files/uploadedfile.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/files/uploadedfile.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/files/uploadhandler.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/files/uploadhandler.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/core/files/uploadhandler.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/files/uploadhandler.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/files/utils.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/files/utils.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/core/files/utils.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/files/utils.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/handlers/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/handlers/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/core/handlers/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/handlers/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/handlers/base.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/handlers/base.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/core/handlers/base.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/handlers/base.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/handlers/exception.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/handlers/exception.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/core/handlers/exception.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/handlers/exception.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/handlers/wsgi.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/handlers/wsgi.pyi old mode 100755 new mode 100644 similarity index 94% rename from anaconda_lib/jedi/third_party/django-stubs/core/handlers/wsgi.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/handlers/wsgi.pyi index c0c0a69d..4ea28d98 --- a/anaconda_lib/jedi/third_party/django-stubs/core/handlers/wsgi.pyi +++ b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/handlers/wsgi.pyi @@ -1,12 +1,10 @@ from io import BytesIO from typing import Any, Callable, Dict, Optional, Union -from django.contrib.auth.models import AbstractUser from django.contrib.sessions.backends.base import SessionBase -from django.http.response import HttpResponse - from django.core.handlers import base from django.http import HttpRequest +from django.http.response import HttpResponse _Stream = Union[BytesIO, str] _WSGIEnviron = Dict[str, Any] @@ -22,7 +20,6 @@ class LimitedStream: class WSGIRequest(HttpRequest): environ: _WSGIEnviron = ... - user: AbstractUser session: SessionBase encoding: Any = ... def __init__(self, environ: _WSGIEnviron) -> None: ... diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/mail/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/mail/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/core/mail/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/mail/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/mail/backends/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/mail/backends/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/core/mail/backends/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/mail/backends/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/mail/backends/base.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/mail/backends/base.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/core/mail/backends/base.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/mail/backends/base.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/mail/backends/console.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/mail/backends/console.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/core/mail/backends/console.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/mail/backends/console.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/mail/backends/dummy.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/mail/backends/dummy.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/core/mail/backends/dummy.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/mail/backends/dummy.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/mail/backends/filebased.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/mail/backends/filebased.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/core/mail/backends/filebased.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/mail/backends/filebased.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/mail/backends/locmem.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/mail/backends/locmem.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/core/mail/backends/locmem.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/mail/backends/locmem.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/mail/backends/smtp.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/mail/backends/smtp.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/core/mail/backends/smtp.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/mail/backends/smtp.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/mail/message.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/mail/message.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/core/mail/message.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/mail/message.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/mail/utils.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/mail/utils.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/core/mail/utils.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/mail/utils.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/management/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/management/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/core/management/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/management/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/management/base.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/management/base.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/core/management/base.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/management/base.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/management/color.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/management/color.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/core/management/color.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/management/color.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/management/commands/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/management/commands/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/core/management/commands/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/management/commands/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/management/commands/dumpdata.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/management/commands/dumpdata.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/core/management/commands/dumpdata.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/management/commands/dumpdata.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/management/commands/loaddata.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/management/commands/loaddata.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/core/management/commands/loaddata.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/management/commands/loaddata.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/management/commands/makemessages.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/management/commands/makemessages.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/core/management/commands/makemessages.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/management/commands/makemessages.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/management/commands/runserver.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/management/commands/runserver.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/core/management/commands/runserver.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/management/commands/runserver.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/management/commands/testserver.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/management/commands/testserver.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/core/management/commands/testserver.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/management/commands/testserver.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/management/sql.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/management/sql.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/core/management/sql.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/management/sql.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/management/templates.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/management/templates.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/core/management/templates.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/management/templates.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/management/utils.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/management/utils.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/core/management/utils.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/management/utils.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/paginator.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/paginator.pyi old mode 100755 new mode 100644 similarity index 90% rename from anaconda_lib/jedi/third_party/django-stubs/core/paginator.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/paginator.pyi index 1bb8d5fc..d838cb47 --- a/anaconda_lib/jedi/third_party/django-stubs/core/paginator.pyi +++ b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/paginator.pyi @@ -8,13 +8,13 @@ class InvalidPage(Exception): ... class PageNotAnInteger(InvalidPage): ... class EmptyPage(InvalidPage): ... -class SupportsLen(Protocol): +class _SupportsLen(Protocol): def __len__(self) -> int: ... -class SupportsCount(Protocol): +class _SupportsCount(Protocol): def count(self) -> int: ... -class SupportsOrdered(Protocol): +class _SupportsOrdered(Protocol): ordered: bool = ... class Paginator: @@ -24,7 +24,7 @@ class Paginator: allow_empty_first_page: bool = ... def __init__( self, - object_list: Union[SupportsLen, SupportsCount, SupportsOrdered], + object_list: Union[_SupportsLen, _SupportsCount, _SupportsOrdered], per_page: Union[int, str], orphans: int = ..., allow_empty_first_page: bool = ..., diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/serializers/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/serializers/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/core/serializers/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/serializers/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/serializers/base.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/serializers/base.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/core/serializers/base.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/serializers/base.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/serializers/json.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/serializers/json.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/core/serializers/json.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/serializers/json.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/serializers/python.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/serializers/python.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/core/serializers/python.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/serializers/python.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/servers/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/servers/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/core/servers/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/servers/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/servers/basehttp.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/servers/basehttp.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/core/servers/basehttp.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/servers/basehttp.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/signals.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/signals.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/core/signals.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/signals.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/signing.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/signing.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/core/signing.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/signing.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/validators.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/validators.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/core/validators.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/validators.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/core/wsgi.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/wsgi.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/core/wsgi.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/core/wsgi.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/backends/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/backends/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/backends/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/backends/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/backends/base/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/backends/base/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/backends/base/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/backends/base/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/backends/base/base.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/backends/base/base.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/backends/base/base.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/backends/base/base.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/backends/base/client.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/backends/base/client.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/backends/base/client.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/backends/base/client.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/backends/base/creation.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/backends/base/creation.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/backends/base/creation.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/backends/base/creation.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/backends/base/features.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/backends/base/features.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/backends/base/features.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/backends/base/features.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/backends/base/introspection.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/backends/base/introspection.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/backends/base/introspection.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/backends/base/introspection.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/backends/base/operations.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/backends/base/operations.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/backends/base/operations.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/backends/base/operations.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/backends/base/schema.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/backends/base/schema.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/backends/base/schema.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/backends/base/schema.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/backends/base/validation.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/backends/base/validation.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/backends/base/validation.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/backends/base/validation.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/backends/ddl_references.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/backends/ddl_references.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/backends/ddl_references.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/backends/ddl_references.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/backends/dummy/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/backends/dummy/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/backends/dummy/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/backends/dummy/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/backends/dummy/base.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/backends/dummy/base.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/backends/dummy/base.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/backends/dummy/base.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/backends/mysql/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/backends/mysql/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/backends/mysql/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/backends/mysql/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/backends/mysql/client.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/backends/mysql/client.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/backends/mysql/client.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/backends/mysql/client.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/backends/postgresql/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/backends/postgresql/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/backends/postgresql/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/backends/postgresql/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/backends/postgresql/base.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/backends/postgresql/base.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/backends/postgresql/base.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/backends/postgresql/base.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/backends/postgresql/client.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/backends/postgresql/client.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/backends/postgresql/client.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/backends/postgresql/client.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/backends/postgresql/creation.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/backends/postgresql/creation.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/backends/postgresql/creation.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/backends/postgresql/creation.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/backends/postgresql/operations.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/backends/postgresql/operations.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/backends/postgresql/operations.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/backends/postgresql/operations.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/backends/signals.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/backends/signals.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/backends/signals.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/backends/signals.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/backends/sqlite3/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/backends/sqlite3/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/backends/sqlite3/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/backends/sqlite3/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/backends/sqlite3/base.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/backends/sqlite3/base.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/backends/sqlite3/base.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/backends/sqlite3/base.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/backends/sqlite3/creation.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/backends/sqlite3/creation.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/backends/sqlite3/creation.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/backends/sqlite3/creation.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/backends/sqlite3/features.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/backends/sqlite3/features.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/backends/sqlite3/features.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/backends/sqlite3/features.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/backends/sqlite3/introspection.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/backends/sqlite3/introspection.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/backends/sqlite3/introspection.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/backends/sqlite3/introspection.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/backends/sqlite3/operations.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/backends/sqlite3/operations.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/backends/sqlite3/operations.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/backends/sqlite3/operations.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/backends/sqlite3/schema.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/backends/sqlite3/schema.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/backends/sqlite3/schema.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/backends/sqlite3/schema.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/backends/utils.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/backends/utils.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/backends/utils.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/backends/utils.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/migrations/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/migrations/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/migrations/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/migrations/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/migrations/autodetector.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/migrations/autodetector.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/migrations/autodetector.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/migrations/autodetector.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/migrations/exceptions.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/migrations/exceptions.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/migrations/exceptions.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/migrations/exceptions.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/migrations/executor.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/migrations/executor.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/migrations/executor.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/migrations/executor.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/migrations/graph.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/migrations/graph.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/migrations/graph.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/migrations/graph.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/migrations/loader.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/migrations/loader.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/migrations/loader.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/migrations/loader.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/migrations/migration.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/migrations/migration.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/migrations/migration.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/migrations/migration.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/migrations/operations/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/migrations/operations/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/migrations/operations/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/migrations/operations/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/migrations/operations/base.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/migrations/operations/base.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/migrations/operations/base.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/migrations/operations/base.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/migrations/operations/fields.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/migrations/operations/fields.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/migrations/operations/fields.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/migrations/operations/fields.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/migrations/operations/models.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/migrations/operations/models.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/migrations/operations/models.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/migrations/operations/models.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/migrations/operations/special.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/migrations/operations/special.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/migrations/operations/special.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/migrations/operations/special.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/migrations/operations/utils.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/migrations/operations/utils.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/migrations/operations/utils.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/migrations/operations/utils.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/migrations/optimizer.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/migrations/optimizer.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/migrations/optimizer.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/migrations/optimizer.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/migrations/questioner.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/migrations/questioner.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/migrations/questioner.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/migrations/questioner.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/migrations/recorder.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/migrations/recorder.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/migrations/recorder.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/migrations/recorder.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/migrations/serializer.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/migrations/serializer.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/migrations/serializer.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/migrations/serializer.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/migrations/state.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/migrations/state.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/migrations/state.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/migrations/state.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/migrations/topological_sort.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/migrations/topological_sort.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/migrations/topological_sort.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/migrations/topological_sort.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/migrations/utils.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/migrations/utils.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/migrations/utils.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/migrations/utils.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/migrations/writer.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/migrations/writer.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/migrations/writer.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/migrations/writer.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/models/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/models/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/models/aggregates.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/aggregates.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/models/aggregates.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/aggregates.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/models/base.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/base.pyi old mode 100755 new mode 100644 similarity index 95% rename from anaconda_lib/jedi/third_party/django-stubs/db/models/base.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/base.pyi index ba33a029..5851803a --- a/anaconda_lib/jedi/third_party/django-stubs/db/models/base.pyi +++ b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/base.pyi @@ -1,4 +1,4 @@ -from typing import Any, Callable, Dict, List, Optional, Sequence, Set, Tuple, Type, TypeVar, Union, Collection +from typing import Any, Callable, Dict, List, Optional, Sequence, Set, Tuple, Type, TypeVar, Union, Collection, ClassVar from django.core.checks.messages import CheckMessage from django.core.exceptions import ValidationError @@ -22,7 +22,7 @@ class Model(metaclass=ModelBase): class Meta: ... _meta: Options[Any] _default_manager: BaseManager[Model] - objects: BaseManager[Any] + objects: ClassVar[BaseManager[Any]] pk: Any = ... _state: ModelState def __init__(self: _Self, *args, **kwargs) -> None: ... diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/models/constraints.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/constraints.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/models/constraints.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/constraints.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/models/deletion.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/deletion.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/models/deletion.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/deletion.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/models/enums.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/enums.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/models/enums.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/enums.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/models/expressions.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/expressions.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/models/expressions.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/expressions.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/models/fields/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/fields/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/models/fields/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/fields/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/models/fields/files.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/fields/files.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/models/fields/files.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/fields/files.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/models/fields/mixins.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/fields/mixins.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/models/fields/mixins.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/fields/mixins.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/models/fields/proxy.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/fields/proxy.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/models/fields/proxy.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/fields/proxy.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/models/fields/related.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/fields/related.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/models/fields/related.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/fields/related.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/models/fields/related_descriptors.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/fields/related_descriptors.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/models/fields/related_descriptors.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/fields/related_descriptors.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/models/fields/related_lookups.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/fields/related_lookups.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/models/fields/related_lookups.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/fields/related_lookups.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/models/fields/reverse_related.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/fields/reverse_related.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/models/fields/reverse_related.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/fields/reverse_related.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/models/functions/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/functions/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/models/functions/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/functions/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/models/functions/comparison.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/functions/comparison.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/models/functions/comparison.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/functions/comparison.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/models/functions/datetime.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/functions/datetime.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/models/functions/datetime.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/functions/datetime.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/models/functions/math.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/functions/math.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/models/functions/math.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/functions/math.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/models/functions/mixins.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/functions/mixins.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/models/functions/mixins.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/functions/mixins.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/models/functions/text.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/functions/text.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/models/functions/text.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/functions/text.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/models/functions/window.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/functions/window.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/models/functions/window.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/functions/window.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/models/indexes.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/indexes.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/models/indexes.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/indexes.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/models/lookups.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/lookups.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/models/lookups.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/lookups.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/models/manager.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/manager.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/models/manager.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/manager.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/models/options.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/options.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/models/options.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/options.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/models/query.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/query.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/models/query.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/query.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/models/query_utils.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/query_utils.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/models/query_utils.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/query_utils.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/models/signals.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/signals.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/models/signals.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/signals.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/models/sql/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/sql/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/models/sql/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/sql/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/models/sql/compiler.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/sql/compiler.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/models/sql/compiler.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/sql/compiler.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/models/sql/constants.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/sql/constants.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/models/sql/constants.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/sql/constants.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/models/sql/datastructures.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/sql/datastructures.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/models/sql/datastructures.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/sql/datastructures.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/models/sql/query.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/sql/query.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/models/sql/query.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/sql/query.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/models/sql/subqueries.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/sql/subqueries.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/models/sql/subqueries.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/sql/subqueries.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/models/sql/where.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/sql/where.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/models/sql/where.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/sql/where.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/models/utils.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/utils.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/models/utils.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/models/utils.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/transaction.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/transaction.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/transaction.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/transaction.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/db/utils.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/utils.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/db/utils.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/db/utils.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/dispatch/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/dispatch/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/dispatch/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/dispatch/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/dispatch/dispatcher.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/dispatch/dispatcher.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/dispatch/dispatcher.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/dispatch/dispatcher.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/forms/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/forms/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/forms/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/forms/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/forms/boundfield.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/forms/boundfield.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/forms/boundfield.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/forms/boundfield.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/forms/fields.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/forms/fields.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/forms/fields.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/forms/fields.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/forms/forms.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/forms/forms.pyi old mode 100755 new mode 100644 similarity index 93% rename from anaconda_lib/jedi/third_party/django-stubs/forms/forms.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/forms/forms.pyi index 4a1c71fb..bb7be6ba --- a/anaconda_lib/jedi/third_party/django-stubs/forms/forms.pyi +++ b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/forms/forms.pyi @@ -24,7 +24,7 @@ class BaseForm: auto_id: Union[bool, str] = ... initial: Dict[str, Any] = ... error_class: Type[ErrorList] = ... - prefix: str = ... + prefix: Optional[str] = ... label_suffix: str = ... empty_permitted: bool = ... fields: Dict[str, Any] = ... @@ -69,6 +69,9 @@ class BaseForm: def hidden_fields(self): ... def visible_fields(self): ... def get_initial_for_field(self, field: Field, field_name: str) -> Any: ... + def _html_output( + self, normal_row: str, error_row: str, row_ender: str, help_text_html: str, errors_on_separate_row: bool, + ) -> SafeText: ... class Form(BaseForm): base_fields: Dict[str, Field] diff --git a/anaconda_lib/jedi/third_party/django-stubs/forms/formsets.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/forms/formsets.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/forms/formsets.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/forms/formsets.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/forms/models.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/forms/models.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/forms/models.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/forms/models.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/forms/renderers.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/forms/renderers.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/forms/renderers.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/forms/renderers.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/forms/utils.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/forms/utils.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/forms/utils.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/forms/utils.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/forms/widgets.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/forms/widgets.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/forms/widgets.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/forms/widgets.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/http/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/http/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/http/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/http/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/http/cookie.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/http/cookie.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/http/cookie.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/http/cookie.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/http/multipartparser.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/http/multipartparser.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/http/multipartparser.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/http/multipartparser.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/http/request.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/http/request.pyi old mode 100755 new mode 100644 similarity index 97% rename from anaconda_lib/jedi/third_party/django-stubs/http/request.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/http/request.pyi index c2c00bf6..821e6900 --- a/anaconda_lib/jedi/third_party/django-stubs/http/request.pyi +++ b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/http/request.pyi @@ -17,6 +17,7 @@ from typing import ( ) from django.contrib.auth.base_user import AbstractBaseUser +from django.contrib.auth.models import AnonymousUser from django.contrib.sessions.backends.base import SessionBase from django.contrib.sites.models import Site from django.utils.datastructures import CaseInsensitiveMapping, ImmutableList, MultiValueDict @@ -51,7 +52,7 @@ class HttpRequest(BytesIO): resolver_match: ResolverMatch = ... content_type: Optional[str] = ... content_params: Optional[Dict[str, str]] = ... - user: AbstractBaseUser + user: Union[AbstractBaseUser, AnonymousUser] site: Site session: SessionBase encoding: Optional[str] = ... diff --git a/anaconda_lib/jedi/third_party/django-stubs/http/response.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/http/response.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/http/response.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/http/response.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/middleware/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/middleware/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/middleware/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/middleware/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/middleware/cache.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/middleware/cache.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/middleware/cache.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/middleware/cache.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/middleware/clickjacking.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/middleware/clickjacking.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/middleware/clickjacking.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/middleware/clickjacking.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/middleware/common.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/middleware/common.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/middleware/common.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/middleware/common.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/middleware/csrf.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/middleware/csrf.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/middleware/csrf.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/middleware/csrf.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/middleware/gzip.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/middleware/gzip.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/middleware/gzip.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/middleware/gzip.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/middleware/http.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/middleware/http.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/middleware/http.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/middleware/http.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/middleware/locale.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/middleware/locale.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/middleware/locale.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/middleware/locale.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/middleware/security.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/middleware/security.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/middleware/security.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/middleware/security.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/shortcuts.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/shortcuts.pyi old mode 100755 new mode 100644 similarity index 66% rename from anaconda_lib/jedi/third_party/django-stubs/shortcuts.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/shortcuts.pyi index 8ac4501e..736ee26b --- a/anaconda_lib/jedi/third_party/django-stubs/shortcuts.pyi +++ b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/shortcuts.pyi @@ -1,4 +1,5 @@ -from typing import Any, Callable, Dict, List, Optional, Protocol, Sequence, Type, TypeVar, Union +import sys +from typing import Any, Callable, List, Mapping, Optional, overload, Protocol, Sequence, Type, TypeVar, Union from django.db.models.base import Model from django.http.response import ( @@ -10,9 +11,14 @@ from django.http.response import ( from django.db.models import Manager, QuerySet from django.http import HttpRequest +if sys.version_info < (3, 8): + from typing_extensions import Literal +else: + from typing import Literal + def render_to_response( template_name: Union[str, Sequence[str]], - context: Optional[Dict[str, Any]] = ..., + context: Optional[Mapping[str, Any]] = ..., content_type: Optional[str] = ..., status: Optional[int] = ..., using: Optional[str] = ..., @@ -20,7 +26,7 @@ def render_to_response( def render( request: HttpRequest, template_name: Union[str, Sequence[str]], - context: Optional[Dict[str, Any]] = ..., + context: Optional[Mapping[str, Any]] = ..., content_type: Optional[str] = ..., status: Optional[int] = ..., using: Optional[str] = ..., @@ -28,6 +34,15 @@ def render( class SupportsGetAbsoluteUrl(Protocol): ... +@overload +def redirect( + to: Union[Callable, str, SupportsGetAbsoluteUrl], *args: Any, permanent: Literal[True], **kwargs: Any +) -> HttpResponsePermanentRedirect: ... +@overload +def redirect( + to: Union[Callable, str, SupportsGetAbsoluteUrl], *args: Any, permanent: Literal[False], **kwargs: Any +) -> HttpResponseRedirect: ... +@overload def redirect( to: Union[Callable, str, SupportsGetAbsoluteUrl], *args: Any, permanent: bool = ..., **kwargs: Any ) -> Union[HttpResponseRedirect, HttpResponsePermanentRedirect]: ... diff --git a/anaconda_lib/jedi/third_party/django-stubs/template/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/template/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/template/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/template/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/template/backends/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/template/backends/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/template/backends/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/template/backends/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/template/backends/base.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/template/backends/base.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/template/backends/base.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/template/backends/base.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/template/backends/django.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/template/backends/django.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/template/backends/django.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/template/backends/django.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/template/backends/dummy.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/template/backends/dummy.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/template/backends/dummy.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/template/backends/dummy.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/template/backends/jinja2.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/template/backends/jinja2.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/template/backends/jinja2.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/template/backends/jinja2.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/template/backends/utils.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/template/backends/utils.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/template/backends/utils.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/template/backends/utils.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/template/base.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/template/base.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/template/base.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/template/base.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/template/context.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/template/context.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/template/context.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/template/context.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/template/context_processors.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/template/context_processors.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/template/context_processors.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/template/context_processors.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/template/defaultfilters.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/template/defaultfilters.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/template/defaultfilters.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/template/defaultfilters.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/template/defaulttags.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/template/defaulttags.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/template/defaulttags.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/template/defaulttags.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/template/engine.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/template/engine.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/template/engine.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/template/engine.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/template/exceptions.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/template/exceptions.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/template/exceptions.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/template/exceptions.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/template/library.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/template/library.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/template/library.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/template/library.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/template/loader.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/template/loader.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/template/loader.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/template/loader.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/template/loader_tags.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/template/loader_tags.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/template/loader_tags.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/template/loader_tags.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/template/loaders/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/template/loaders/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/template/loaders/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/template/loaders/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/template/loaders/app_directories.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/template/loaders/app_directories.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/template/loaders/app_directories.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/template/loaders/app_directories.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/template/loaders/base.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/template/loaders/base.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/template/loaders/base.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/template/loaders/base.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/template/loaders/cached.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/template/loaders/cached.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/template/loaders/cached.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/template/loaders/cached.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/template/loaders/filesystem.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/template/loaders/filesystem.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/template/loaders/filesystem.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/template/loaders/filesystem.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/template/loaders/locmem.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/template/loaders/locmem.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/template/loaders/locmem.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/template/loaders/locmem.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/template/response.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/template/response.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/template/response.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/template/response.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/template/smartif.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/template/smartif.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/template/smartif.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/template/smartif.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/template/utils.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/template/utils.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/template/utils.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/template/utils.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/templatetags/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/templatetags/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/templatetags/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/templatetags/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/templatetags/cache.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/templatetags/cache.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/templatetags/cache.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/templatetags/cache.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/templatetags/i18n.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/templatetags/i18n.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/templatetags/i18n.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/templatetags/i18n.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/templatetags/l10n.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/templatetags/l10n.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/templatetags/l10n.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/templatetags/l10n.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/templatetags/static.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/templatetags/static.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/templatetags/static.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/templatetags/static.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/templatetags/tz.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/templatetags/tz.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/templatetags/tz.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/templatetags/tz.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/test/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/test/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/test/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/test/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/test/client.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/test/client.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/test/client.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/test/client.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/test/html.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/test/html.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/test/html.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/test/html.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/test/runner.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/test/runner.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/test/runner.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/test/runner.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/test/selenium.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/test/selenium.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/test/selenium.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/test/selenium.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/test/signals.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/test/signals.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/test/signals.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/test/signals.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/test/testcases.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/test/testcases.pyi old mode 100755 new mode 100644 similarity index 95% rename from anaconda_lib/jedi/third_party/django-stubs/test/testcases.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/test/testcases.pyi index 5d9b3ff4..67a565cf --- a/anaconda_lib/jedi/third_party/django-stubs/test/testcases.pyi +++ b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/test/testcases.pyi @@ -126,9 +126,17 @@ class SimpleTestCase(unittest.TestCase): self, needle: str, haystack: SafeText, count: Optional[int] = ..., msg_prefix: str = ... ) -> None: ... def assertJSONEqual( - self, raw: str, expected_data: Union[Dict[str, str], bool, str], msg: Optional[str] = ... + self, + raw: str, + expected_data: Union[Dict[str, Any], List[Any], str, int, float, bool, None], + msg: Optional[str] = ..., + ) -> None: ... + def assertJSONNotEqual( + self, + raw: str, + expected_data: Union[Dict[str, Any], List[Any], str, int, float, bool, None], + msg: Optional[str] = ..., ) -> None: ... - def assertJSONNotEqual(self, raw: str, expected_data: str, msg: Optional[str] = ...) -> None: ... def assertXMLEqual(self, xml1: str, xml2: str, msg: Optional[str] = ...) -> None: ... def assertXMLNotEqual(self, xml1: str, xml2: str, msg: Optional[str] = ...) -> None: ... diff --git a/anaconda_lib/jedi/third_party/django-stubs/test/utils.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/test/utils.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/test/utils.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/test/utils.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/urls/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/urls/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/urls/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/urls/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/urls/base.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/urls/base.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/urls/base.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/urls/base.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/urls/conf.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/urls/conf.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/urls/conf.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/urls/conf.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/urls/converters.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/urls/converters.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/urls/converters.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/urls/converters.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/urls/exceptions.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/urls/exceptions.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/urls/exceptions.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/urls/exceptions.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/urls/resolvers.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/urls/resolvers.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/urls/resolvers.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/urls/resolvers.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/urls/utils.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/urls/utils.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/urls/utils.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/urls/utils.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/utils/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/utils/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/utils/_os.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/_os.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/utils/_os.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/_os.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/utils/archive.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/archive.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/utils/archive.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/archive.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/utils/autoreload.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/autoreload.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/utils/autoreload.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/autoreload.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/utils/baseconv.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/baseconv.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/utils/baseconv.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/baseconv.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/utils/cache.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/cache.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/utils/cache.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/cache.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/utils/crypto.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/crypto.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/utils/crypto.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/crypto.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/utils/datastructures.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/datastructures.pyi old mode 100755 new mode 100644 similarity index 97% rename from anaconda_lib/jedi/third_party/django-stubs/utils/datastructures.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/datastructures.pyi index e9778cf3..7b5f7b2d --- a/anaconda_lib/jedi/third_party/django-stubs/utils/datastructures.pyi +++ b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/datastructures.pyi @@ -22,6 +22,7 @@ _V = TypeVar("_V") class OrderedSet(MutableSet[_K]): dict: Dict[_K, None] = ... + def __init__(self, iterable: Optional[Iterable[_K]] = ...) -> None: ... def __contains__(self, item: object) -> bool: ... def __iter__(self) -> Iterator[_K]: ... def __len__(self) -> int: ... diff --git a/anaconda_lib/jedi/third_party/django-stubs/utils/dateformat.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/dateformat.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/utils/dateformat.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/dateformat.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/utils/dateparse.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/dateparse.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/utils/dateparse.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/dateparse.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/utils/dates.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/dates.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/utils/dates.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/dates.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/utils/datetime_safe.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/datetime_safe.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/utils/datetime_safe.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/datetime_safe.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/utils/deconstruct.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/deconstruct.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/utils/deconstruct.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/deconstruct.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/utils/decorators.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/decorators.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/utils/decorators.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/decorators.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/utils/deprecation.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/deprecation.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/utils/deprecation.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/deprecation.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/utils/duration.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/duration.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/utils/duration.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/duration.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/utils/encoding.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/encoding.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/utils/encoding.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/encoding.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/utils/feedgenerator.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/feedgenerator.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/utils/feedgenerator.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/feedgenerator.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/utils/formats.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/formats.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/utils/formats.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/formats.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/utils/functional.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/functional.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/utils/functional.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/functional.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/utils/hashable.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/hashable.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/utils/hashable.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/hashable.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/utils/html.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/html.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/utils/html.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/html.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/utils/http.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/http.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/utils/http.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/http.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/utils/inspect.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/inspect.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/utils/inspect.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/inspect.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/utils/ipv6.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/ipv6.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/utils/ipv6.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/ipv6.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/utils/itercompat.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/itercompat.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/utils/itercompat.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/itercompat.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/utils/jslex.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/jslex.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/utils/jslex.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/jslex.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/utils/log.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/log.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/utils/log.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/log.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/utils/lorem_ipsum.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/lorem_ipsum.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/utils/lorem_ipsum.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/lorem_ipsum.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/utils/module_loading.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/module_loading.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/utils/module_loading.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/module_loading.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/utils/numberformat.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/numberformat.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/utils/numberformat.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/numberformat.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/utils/regex_helper.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/regex_helper.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/utils/regex_helper.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/regex_helper.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/utils/safestring.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/safestring.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/utils/safestring.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/safestring.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/utils/six.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/six.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/utils/six.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/six.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/utils/termcolors.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/termcolors.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/utils/termcolors.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/termcolors.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/utils/text.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/text.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/utils/text.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/text.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/utils/timesince.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/timesince.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/utils/timesince.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/timesince.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/utils/timezone.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/timezone.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/utils/timezone.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/timezone.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/utils/topological_sort.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/topological_sort.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/utils/topological_sort.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/topological_sort.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/utils/translation/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/translation/__init__.pyi old mode 100755 new mode 100644 similarity index 96% rename from anaconda_lib/jedi/third_party/django-stubs/utils/translation/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/translation/__init__.pyi index edcd7f79..9aec2123 --- a/anaconda_lib/jedi/third_party/django-stubs/utils/translation/__init__.pyi +++ b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/translation/__init__.pyi @@ -66,6 +66,7 @@ def to_locale(language: str) -> str: ... def get_language_from_request(request: WSGIRequest, check_path: bool = ...) -> str: ... def templatize(src: str, **kwargs: Any) -> str: ... def deactivate_all() -> None: ... +def get_supported_language_variant(lang_code: str, strict: bool = ...) -> str: ... def get_language_info(lang_code: str) -> Any: ... from . import trans_real as trans_real diff --git a/anaconda_lib/jedi/third_party/django-stubs/utils/translation/reloader.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/translation/reloader.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/utils/translation/reloader.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/translation/reloader.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/utils/translation/template.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/translation/template.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/utils/translation/template.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/translation/template.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/utils/translation/trans_null.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/translation/trans_null.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/utils/translation/trans_null.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/translation/trans_null.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/utils/translation/trans_real.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/translation/trans_real.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/utils/translation/trans_real.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/translation/trans_real.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/utils/tree.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/tree.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/utils/tree.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/tree.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/utils/version.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/version.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/utils/version.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/version.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/utils/xmlutils.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/xmlutils.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/utils/xmlutils.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/utils/xmlutils.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/views/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/views/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/views/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/views/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/views/csrf.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/views/csrf.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/views/csrf.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/views/csrf.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/views/debug.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/views/debug.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/views/debug.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/views/debug.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/views/decorators/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/views/decorators/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/views/decorators/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/views/decorators/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/views/decorators/cache.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/views/decorators/cache.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/views/decorators/cache.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/views/decorators/cache.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/views/decorators/clickjacking.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/views/decorators/clickjacking.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/views/decorators/clickjacking.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/views/decorators/clickjacking.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/views/decorators/csrf.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/views/decorators/csrf.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/views/decorators/csrf.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/views/decorators/csrf.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/views/decorators/debug.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/views/decorators/debug.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/views/decorators/debug.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/views/decorators/debug.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/views/decorators/gzip.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/views/decorators/gzip.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/views/decorators/gzip.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/views/decorators/gzip.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/views/decorators/http.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/views/decorators/http.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/views/decorators/http.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/views/decorators/http.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/views/decorators/vary.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/views/decorators/vary.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/views/decorators/vary.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/views/decorators/vary.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/views/defaults.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/views/defaults.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/views/defaults.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/views/defaults.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/views/generic/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/views/generic/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/views/generic/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/views/generic/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/views/generic/base.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/views/generic/base.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/views/generic/base.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/views/generic/base.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/views/generic/dates.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/views/generic/dates.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/views/generic/dates.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/views/generic/dates.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/views/generic/detail.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/views/generic/detail.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/views/generic/detail.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/views/generic/detail.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/views/generic/edit.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/views/generic/edit.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/views/generic/edit.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/views/generic/edit.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/views/generic/list.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/views/generic/list.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/views/generic/list.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/views/generic/list.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/views/i18n.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/views/i18n.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/views/i18n.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/views/i18n.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/views/static.pyi b/anaconda_lib/jedi/third_party/django-stubs/django-stubs/views/static.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/django-stubs/views/static.pyi rename to anaconda_lib/jedi/third_party/django-stubs/django-stubs/views/static.pyi diff --git a/anaconda_lib/jedi/third_party/django-stubs/flake8-pyi.ini b/anaconda_lib/jedi/third_party/django-stubs/flake8-pyi.ini new file mode 100644 index 00000000..ba413f24 --- /dev/null +++ b/anaconda_lib/jedi/third_party/django-stubs/flake8-pyi.ini @@ -0,0 +1,14 @@ +[flake8] +filename = + *.pyi +exclude = + django-sources + test-data + mypy_django_plugin + scripts +select = F401, Y +max_line_length = 120 +per-file-ignores = + *__init__.pyi: F401 + base_user.pyi: Y003 + models.pyi: Y003 diff --git a/anaconda_lib/jedi/third_party/django-stubs/mypy.ini b/anaconda_lib/jedi/third_party/django-stubs/mypy.ini new file mode 100644 index 00000000..3921cb12 --- /dev/null +++ b/anaconda_lib/jedi/third_party/django-stubs/mypy.ini @@ -0,0 +1,2 @@ +[mypy] +warn_unused_ignores = True \ No newline at end of file diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/mypy_django_plugin/__init__.py old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/mypy_django_plugin/__init__.py diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/__init__.pyi b/anaconda_lib/jedi/third_party/django-stubs/mypy_django_plugin/django/__init__.py old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/__init__.pyi rename to anaconda_lib/jedi/third_party/django-stubs/mypy_django_plugin/django/__init__.py diff --git a/anaconda_lib/jedi/third_party/django-stubs/mypy_django_plugin/django/context.py b/anaconda_lib/jedi/third_party/django-stubs/mypy_django_plugin/django/context.py new file mode 100644 index 00000000..36ac0f86 --- /dev/null +++ b/anaconda_lib/jedi/third_party/django-stubs/mypy_django_plugin/django/context.py @@ -0,0 +1,383 @@ +import os +import sys +from collections import defaultdict +from contextlib import contextmanager +from typing import ( + TYPE_CHECKING, Dict, Iterable, Iterator, Optional, Set, Tuple, Type, Union, +) + +from django.core.exceptions import FieldError +from django.db import models +from django.db.models.base import Model +from django.db.models.fields import AutoField, CharField, Field +from django.db.models.fields.related import ForeignKey, RelatedField +from django.db.models.fields.reverse_related import ForeignObjectRel +from django.db.models.lookups import Exact +from django.db.models.sql.query import Query +from django.utils.functional import cached_property +from mypy.checker import TypeChecker +from mypy.plugin import MethodContext +from mypy.types import AnyType, Instance +from mypy.types import Type as MypyType +from mypy.types import TypeOfAny, UnionType + +from mypy_django_plugin.lib import fullnames, helpers + +try: + from django.contrib.postgres.fields import ArrayField +except ImportError: + class ArrayField: # type: ignore + pass + +if TYPE_CHECKING: + from django.apps.registry import Apps # noqa: F401 + from django.conf import LazySettings # noqa: F401 + + +@contextmanager +def temp_environ(): + """Allow the ability to set os.environ temporarily""" + environ = dict(os.environ) + try: + yield + finally: + os.environ.clear() + os.environ.update(environ) + + +def initialize_django(settings_module: str) -> Tuple['Apps', 'LazySettings']: + with temp_environ(): + os.environ['DJANGO_SETTINGS_MODULE'] = settings_module + + # add current directory to sys.path + sys.path.append(os.getcwd()) + + def noop_class_getitem(cls, key): + return cls + + from django.db import models + + models.QuerySet.__class_getitem__ = classmethod(noop_class_getitem) # type: ignore + models.Manager.__class_getitem__ = classmethod(noop_class_getitem) # type: ignore + + from django.conf import settings + from django.apps import apps + + apps.get_models.cache_clear() # type: ignore + apps.get_swappable_settings_name.cache_clear() # type: ignore + + if not settings.configured: + settings._setup() + + apps.populate(settings.INSTALLED_APPS) + + assert apps.apps_ready + assert settings.configured + + return apps, settings + + +class LookupsAreUnsupported(Exception): + pass + + +class DjangoContext: + def __init__(self, django_settings_module: str) -> None: + self.django_settings_module = django_settings_module + + apps, settings = initialize_django(self.django_settings_module) + self.apps_registry = apps + self.settings = settings + + @cached_property + def model_modules(self) -> Dict[str, Set[Type[Model]]]: + """ All modules that contain Django models. """ + if self.apps_registry is None: + return {} + + modules: Dict[str, Set[Type[Model]]] = defaultdict(set) + for concrete_model_cls in self.apps_registry.get_models(): + modules[concrete_model_cls.__module__].add(concrete_model_cls) + # collect abstract=True models + for model_cls in concrete_model_cls.mro()[1:]: + if (issubclass(model_cls, Model) + and hasattr(model_cls, '_meta') + and model_cls._meta.abstract): + modules[model_cls.__module__].add(model_cls) + return modules + + def get_model_class_by_fullname(self, fullname: str) -> Optional[Type[Model]]: + # Returns None if Model is abstract + module, _, model_cls_name = fullname.rpartition('.') + for model_cls in self.model_modules.get(module, set()): + if model_cls.__name__ == model_cls_name: + return model_cls + return None + + def get_model_fields(self, model_cls: Type[Model]) -> Iterator[Field]: + for field in model_cls._meta.get_fields(): + if isinstance(field, Field): + yield field + + def get_model_relations(self, model_cls: Type[Model]) -> Iterator[ForeignObjectRel]: + for field in model_cls._meta.get_fields(): + if isinstance(field, ForeignObjectRel): + yield field + + def get_field_lookup_exact_type(self, api: TypeChecker, field: Union[Field, ForeignObjectRel]) -> MypyType: + if isinstance(field, (RelatedField, ForeignObjectRel)): + related_model_cls = field.related_model + primary_key_field = self.get_primary_key_field(related_model_cls) + primary_key_type = self.get_field_get_type(api, primary_key_field, method='init') + + rel_model_info = helpers.lookup_class_typeinfo(api, related_model_cls) + if rel_model_info is None: + return AnyType(TypeOfAny.explicit) + + model_and_primary_key_type = UnionType.make_union([Instance(rel_model_info, []), primary_key_type]) + return helpers.make_optional(model_and_primary_key_type) + + field_info = helpers.lookup_class_typeinfo(api, field.__class__) + if field_info is None: + return AnyType(TypeOfAny.explicit) + return helpers.get_private_descriptor_type(field_info, '_pyi_lookup_exact_type', + is_nullable=field.null) + + def get_primary_key_field(self, model_cls: Type[Model]) -> Field: + for field in model_cls._meta.get_fields(): + if isinstance(field, Field): + if field.primary_key: + return field + raise ValueError('No primary key defined') + + def get_expected_types(self, api: TypeChecker, model_cls: Type[Model], *, method: str) -> Dict[str, MypyType]: + from django.contrib.contenttypes.fields import GenericForeignKey + + expected_types = {} + # add pk if not abstract=True + if not model_cls._meta.abstract: + primary_key_field = self.get_primary_key_field(model_cls) + field_set_type = self.get_field_set_type(api, primary_key_field, method=method) + expected_types['pk'] = field_set_type + + for field in model_cls._meta.get_fields(): + if isinstance(field, Field): + field_name = field.attname + field_set_type = self.get_field_set_type(api, field, method=method) + expected_types[field_name] = field_set_type + + if isinstance(field, ForeignKey): + field_name = field.name + foreign_key_info = helpers.lookup_class_typeinfo(api, field.__class__) + if foreign_key_info is None: + # maybe there's no type annotation for the field + expected_types[field_name] = AnyType(TypeOfAny.unannotated) + continue + + related_model = self.get_field_related_model_cls(field) + if related_model is None: + expected_types[field_name] = AnyType(TypeOfAny.from_error) + continue + + if related_model._meta.proxy_for_model is not None: + related_model = related_model._meta.proxy_for_model + + related_model_info = helpers.lookup_class_typeinfo(api, related_model) + if related_model_info is None: + expected_types[field_name] = AnyType(TypeOfAny.unannotated) + continue + + is_nullable = self.get_field_nullability(field, method) + foreign_key_set_type = helpers.get_private_descriptor_type(foreign_key_info, + '_pyi_private_set_type', + is_nullable=is_nullable) + model_set_type = helpers.convert_any_to_type(foreign_key_set_type, + Instance(related_model_info, [])) + + expected_types[field_name] = model_set_type + + elif isinstance(field, GenericForeignKey): + # it's generic, so cannot set specific model + field_name = field.name + gfk_info = helpers.lookup_class_typeinfo(api, field.__class__) + gfk_set_type = helpers.get_private_descriptor_type(gfk_info, '_pyi_private_set_type', + is_nullable=True) + expected_types[field_name] = gfk_set_type + + return expected_types + + @cached_property + def all_registered_model_classes(self) -> Set[Type[models.Model]]: + model_classes = self.apps_registry.get_models() + + all_model_bases = set() + for model_cls in model_classes: + for base_cls in model_cls.mro(): + if issubclass(base_cls, models.Model): + all_model_bases.add(base_cls) + + return all_model_bases + + @cached_property + def all_registered_model_class_fullnames(self) -> Set[str]: + return {helpers.get_class_fullname(cls) for cls in self.all_registered_model_classes} + + def get_attname(self, field: Field) -> str: + attname = field.attname + return attname + + def get_field_nullability(self, field: Union[Field, ForeignObjectRel], method: Optional[str]) -> bool: + nullable = field.null + if not nullable and isinstance(field, CharField) and field.blank: + return True + if method == '__init__': + if ((isinstance(field, Field) and field.primary_key) + or isinstance(field, ForeignKey)): + return True + if method == 'create': + if isinstance(field, AutoField): + return True + if isinstance(field, Field) and field.has_default(): + return True + return nullable + + def get_field_set_type(self, api: TypeChecker, field: Union[Field, ForeignObjectRel], *, method: str) -> MypyType: + """ Get a type of __set__ for this specific Django field. """ + target_field = field + if isinstance(field, ForeignKey): + target_field = field.target_field + + field_info = helpers.lookup_class_typeinfo(api, target_field.__class__) + if field_info is None: + return AnyType(TypeOfAny.from_error) + + field_set_type = helpers.get_private_descriptor_type(field_info, '_pyi_private_set_type', + is_nullable=self.get_field_nullability(field, method)) + if isinstance(target_field, ArrayField): + argument_field_type = self.get_field_set_type(api, target_field.base_field, method=method) + field_set_type = helpers.convert_any_to_type(field_set_type, argument_field_type) + return field_set_type + + def get_field_get_type(self, api: TypeChecker, field: Union[Field, ForeignObjectRel], *, method: str) -> MypyType: + """ Get a type of __get__ for this specific Django field. """ + field_info = helpers.lookup_class_typeinfo(api, field.__class__) + if field_info is None: + return AnyType(TypeOfAny.unannotated) + + is_nullable = self.get_field_nullability(field, method) + if isinstance(field, RelatedField): + related_model_cls = self.get_field_related_model_cls(field) + if related_model_cls is None: + return AnyType(TypeOfAny.from_error) + + if method == 'values': + primary_key_field = self.get_primary_key_field(related_model_cls) + return self.get_field_get_type(api, primary_key_field, method=method) + + model_info = helpers.lookup_class_typeinfo(api, related_model_cls) + if model_info is None: + return AnyType(TypeOfAny.unannotated) + + return Instance(model_info, []) + else: + return helpers.get_private_descriptor_type(field_info, '_pyi_private_get_type', + is_nullable=is_nullable) + + def get_field_related_model_cls(self, field: Union[RelatedField, ForeignObjectRel]) -> Optional[Type[Model]]: + if isinstance(field, RelatedField): + related_model_cls = field.remote_field.model + else: + related_model_cls = field.field.model + + if isinstance(related_model_cls, str): + if related_model_cls == 'self': + # same model + related_model_cls = field.model + elif '.' not in related_model_cls: + # same file model + related_model_fullname = field.model.__module__ + '.' + related_model_cls + related_model_cls = self.get_model_class_by_fullname(related_model_fullname) + else: + related_model_cls = self.apps_registry.get_model(related_model_cls) + + return related_model_cls + + def _resolve_field_from_parts(self, + field_parts: Iterable[str], + model_cls: Type[Model] + ) -> Union[Field, ForeignObjectRel]: + currently_observed_model = model_cls + field = None + for field_part in field_parts: + if field_part == 'pk': + field = self.get_primary_key_field(currently_observed_model) + continue + + field = currently_observed_model._meta.get_field(field_part) + if isinstance(field, RelatedField): + currently_observed_model = field.related_model + model_name = currently_observed_model._meta.model_name + if (model_name is not None + and field_part == (model_name + '_id')): + field = self.get_primary_key_field(currently_observed_model) + + if isinstance(field, ForeignObjectRel): + currently_observed_model = field.related_model + + assert field is not None + return field + + def resolve_lookup_into_field(self, model_cls: Type[Model], lookup: str) -> Union[Field, ForeignObjectRel]: + query = Query(model_cls) + lookup_parts, field_parts, is_expression = query.solve_lookup_type(lookup) + if lookup_parts: + raise LookupsAreUnsupported() + + return self._resolve_field_from_parts(field_parts, model_cls) + + def resolve_lookup_expected_type(self, ctx: MethodContext, model_cls: Type[Model], lookup: str) -> MypyType: + query = Query(model_cls) + try: + lookup_parts, field_parts, is_expression = query.solve_lookup_type(lookup) + if is_expression: + return AnyType(TypeOfAny.explicit) + except FieldError as exc: + ctx.api.fail(exc.args[0], ctx.context) + return AnyType(TypeOfAny.from_error) + + field = self._resolve_field_from_parts(field_parts, model_cls) + + lookup_cls = None + if lookup_parts: + lookup = lookup_parts[-1] + lookup_cls = field.get_lookup(lookup) + if lookup_cls is None: + # unknown lookup + return AnyType(TypeOfAny.explicit) + + if lookup_cls is None or isinstance(lookup_cls, Exact): + return self.get_field_lookup_exact_type(helpers.get_typechecker_api(ctx), field) + + assert lookup_cls is not None + + lookup_info = helpers.lookup_class_typeinfo(helpers.get_typechecker_api(ctx), lookup_cls) + if lookup_info is None: + return AnyType(TypeOfAny.explicit) + + for lookup_base in helpers.iter_bases(lookup_info): + if lookup_base.args and isinstance(lookup_base.args[0], Instance): + lookup_type: MypyType = lookup_base.args[0] + # if it's Field, consider lookup_type a __get__ of current field + if (isinstance(lookup_type, Instance) + and lookup_type.type.fullname == fullnames.FIELD_FULLNAME): + field_info = helpers.lookup_class_typeinfo(helpers.get_typechecker_api(ctx), field.__class__) + if field_info is None: + return AnyType(TypeOfAny.explicit) + lookup_type = helpers.get_private_descriptor_type(field_info, '_pyi_private_get_type', + is_nullable=field.null) + return lookup_type + + return AnyType(TypeOfAny.explicit) + + def resolve_f_expression_type(self, f_expression_type: Instance) -> MypyType: + return AnyType(TypeOfAny.explicit) diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/bdist.pyi b/anaconda_lib/jedi/third_party/django-stubs/mypy_django_plugin/lib/__init__.py old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/bdist.pyi rename to anaconda_lib/jedi/third_party/django-stubs/mypy_django_plugin/lib/__init__.py diff --git a/anaconda_lib/jedi/third_party/django-stubs/mypy_django_plugin/lib/fullnames.py b/anaconda_lib/jedi/third_party/django-stubs/mypy_django_plugin/lib/fullnames.py new file mode 100644 index 00000000..3e838936 --- /dev/null +++ b/anaconda_lib/jedi/third_party/django-stubs/mypy_django_plugin/lib/fullnames.py @@ -0,0 +1,39 @@ + +MODEL_CLASS_FULLNAME = 'django.db.models.base.Model' +FIELD_FULLNAME = 'django.db.models.fields.Field' +CHAR_FIELD_FULLNAME = 'django.db.models.fields.CharField' +ARRAY_FIELD_FULLNAME = 'django.contrib.postgres.fields.array.ArrayField' +AUTO_FIELD_FULLNAME = 'django.db.models.fields.AutoField' +GENERIC_FOREIGN_KEY_FULLNAME = 'django.contrib.contenttypes.fields.GenericForeignKey' +FOREIGN_KEY_FULLNAME = 'django.db.models.fields.related.ForeignKey' +ONETOONE_FIELD_FULLNAME = 'django.db.models.fields.related.OneToOneField' +MANYTOMANY_FIELD_FULLNAME = 'django.db.models.fields.related.ManyToManyField' +DUMMY_SETTINGS_BASE_CLASS = 'django.conf._DjangoConfLazyObject' + +QUERYSET_CLASS_FULLNAME = 'django.db.models.query.QuerySet' +BASE_MANAGER_CLASS_FULLNAME = 'django.db.models.manager.BaseManager' +MANAGER_CLASS_FULLNAME = 'django.db.models.manager.Manager' +RELATED_MANAGER_CLASS = 'django.db.models.manager.RelatedManager' + +BASEFORM_CLASS_FULLNAME = 'django.forms.forms.BaseForm' +FORM_CLASS_FULLNAME = 'django.forms.forms.Form' +MODELFORM_CLASS_FULLNAME = 'django.forms.models.ModelForm' + +FORM_MIXIN_CLASS_FULLNAME = 'django.views.generic.edit.FormMixin' + +MANAGER_CLASSES = { + MANAGER_CLASS_FULLNAME, + BASE_MANAGER_CLASS_FULLNAME, +} + +RELATED_FIELDS_CLASSES = { + FOREIGN_KEY_FULLNAME, + ONETOONE_FIELD_FULLNAME, + MANYTOMANY_FIELD_FULLNAME +} + +MIGRATION_CLASS_FULLNAME = 'django.db.migrations.migration.Migration' +OPTIONS_CLASS_FULLNAME = 'django.db.models.options.Options' +HTTPREQUEST_CLASS_FULLNAME = 'django.http.request.HttpRequest' + +F_EXPRESSION_FULLNAME = 'django.db.models.expressions.F' diff --git a/anaconda_lib/jedi/third_party/django-stubs/mypy_django_plugin/lib/helpers.py b/anaconda_lib/jedi/third_party/django-stubs/mypy_django_plugin/lib/helpers.py new file mode 100644 index 00000000..d6d7f9c6 --- /dev/null +++ b/anaconda_lib/jedi/third_party/django-stubs/mypy_django_plugin/lib/helpers.py @@ -0,0 +1,375 @@ +from collections import OrderedDict +from typing import ( + TYPE_CHECKING, Any, Dict, Iterable, Iterator, List, Optional, Set, Tuple, Union, +) + +from django.db.models.fields import Field +from django.db.models.fields.related import RelatedField +from django.db.models.fields.reverse_related import ForeignObjectRel +from mypy import checker +from mypy.checker import TypeChecker +from mypy.mro import calculate_mro +from mypy.nodes import ( + GDEF, MDEF, Argument, Block, ClassDef, Expression, FuncDef, MemberExpr, MypyFile, NameExpr, PlaceholderNode, + StrExpr, SymbolNode, SymbolTable, SymbolTableNode, TypeInfo, Var, +) +from mypy.plugin import ( + AttributeContext, CheckerPluginInterface, ClassDefContext, DynamicClassDefContext, FunctionContext, MethodContext, +) +from mypy.plugins.common import add_method +from mypy.semanal import SemanticAnalyzer +from mypy.types import AnyType, CallableType, Instance, NoneTyp, TupleType +from mypy.types import Type as MypyType +from mypy.types import TypedDictType, TypeOfAny, UnionType + +from mypy_django_plugin.lib import fullnames + +if TYPE_CHECKING: + from mypy_django_plugin.django.context import DjangoContext + + +def get_django_metadata(model_info: TypeInfo) -> Dict[str, Any]: + return model_info.metadata.setdefault('django', {}) + + +class IncompleteDefnException(Exception): + pass + + +def lookup_fully_qualified_sym(fullname: str, all_modules: Dict[str, MypyFile]) -> Optional[SymbolTableNode]: + if '.' not in fullname: + return None + module, cls_name = fullname.rsplit('.', 1) + + module_file = all_modules.get(module) + if module_file is None: + return None + sym = module_file.names.get(cls_name) + if sym is None: + return None + return sym + + +def lookup_fully_qualified_generic(name: str, all_modules: Dict[str, MypyFile]) -> Optional[SymbolNode]: + sym = lookup_fully_qualified_sym(name, all_modules) + if sym is None: + return None + return sym.node + + +def lookup_fully_qualified_typeinfo(api: Union[TypeChecker, SemanticAnalyzer], fullname: str) -> Optional[TypeInfo]: + node = lookup_fully_qualified_generic(fullname, api.modules) + if not isinstance(node, TypeInfo): + return None + return node + + +def lookup_class_typeinfo(api: TypeChecker, klass: type) -> Optional[TypeInfo]: + fullname = get_class_fullname(klass) + field_info = lookup_fully_qualified_typeinfo(api, fullname) + return field_info + + +def reparametrize_instance(instance: Instance, new_args: List[MypyType]) -> Instance: + return Instance(instance.type, args=new_args, + line=instance.line, column=instance.column) + + +def get_class_fullname(klass: type) -> str: + return klass.__module__ + '.' + klass.__qualname__ + + +def get_call_argument_by_name(ctx: Union[FunctionContext, MethodContext], name: str) -> Optional[Expression]: + """ + Return the expression for the specific argument. + This helper should only be used with non-star arguments. + """ + if name not in ctx.callee_arg_names: + return None + idx = ctx.callee_arg_names.index(name) + args = ctx.args[idx] + if len(args) != 1: + # Either an error or no value passed. + return None + return args[0] + + +def get_call_argument_type_by_name(ctx: Union[FunctionContext, MethodContext], name: str) -> Optional[MypyType]: + """Return the type for the specific argument. + + This helper should only be used with non-star arguments. + """ + if name not in ctx.callee_arg_names: + return None + idx = ctx.callee_arg_names.index(name) + arg_types = ctx.arg_types[idx] + if len(arg_types) != 1: + # Either an error or no value passed. + return None + return arg_types[0] + + +def make_optional(typ: MypyType) -> MypyType: + return UnionType.make_union([typ, NoneTyp()]) + + +def parse_bool(expr: Expression) -> Optional[bool]: + if isinstance(expr, NameExpr): + if expr.fullname == 'builtins.True': + return True + if expr.fullname == 'builtins.False': + return False + return None + + +def has_any_of_bases(info: TypeInfo, bases: Iterable[str]) -> bool: + for base_fullname in bases: + if info.has_base(base_fullname): + return True + return False + + +def iter_bases(info: TypeInfo) -> Iterator[Instance]: + for base in info.bases: + yield base + yield from iter_bases(base.type) + + +def get_private_descriptor_type(type_info: TypeInfo, private_field_name: str, is_nullable: bool) -> MypyType: + """ Return declared type of type_info's private_field_name (used for private Field attributes)""" + sym = type_info.get(private_field_name) + if sym is None: + return AnyType(TypeOfAny.explicit) + + node = sym.node + if isinstance(node, Var): + descriptor_type = node.type + if descriptor_type is None: + return AnyType(TypeOfAny.explicit) + + if is_nullable: + descriptor_type = make_optional(descriptor_type) + return descriptor_type + return AnyType(TypeOfAny.explicit) + + +def get_field_lookup_exact_type(api: TypeChecker, field: Field) -> MypyType: + if isinstance(field, (RelatedField, ForeignObjectRel)): + lookup_type_class = field.related_model + rel_model_info = lookup_class_typeinfo(api, lookup_type_class) + if rel_model_info is None: + return AnyType(TypeOfAny.from_error) + return make_optional(Instance(rel_model_info, [])) + + field_info = lookup_class_typeinfo(api, field.__class__) + if field_info is None: + return AnyType(TypeOfAny.explicit) + return get_private_descriptor_type(field_info, '_pyi_lookup_exact_type', + is_nullable=field.null) + + +def get_nested_meta_node_for_current_class(info: TypeInfo) -> Optional[TypeInfo]: + metaclass_sym = info.names.get('Meta') + if metaclass_sym is not None and isinstance(metaclass_sym.node, TypeInfo): + return metaclass_sym.node + return None + + +def add_new_class_for_module(module: MypyFile, + name: str, + bases: List[Instance], + fields: Optional[Dict[str, MypyType]] = None + ) -> TypeInfo: + new_class_unique_name = checker.gen_unique_name(name, module.names) + + # make new class expression + classdef = ClassDef(new_class_unique_name, Block([])) + classdef.fullname = module.fullname + '.' + new_class_unique_name + + # make new TypeInfo + new_typeinfo = TypeInfo(SymbolTable(), classdef, module.fullname) + new_typeinfo.bases = bases + calculate_mro(new_typeinfo) + new_typeinfo.calculate_metaclass_type() + + # add fields + if fields: + for field_name, field_type in fields.items(): + var = Var(field_name, type=field_type) + var.info = new_typeinfo + var._fullname = new_typeinfo.fullname + '.' + field_name + new_typeinfo.names[field_name] = SymbolTableNode(MDEF, var, plugin_generated=True) + + classdef.info = new_typeinfo + module.names[new_class_unique_name] = SymbolTableNode(GDEF, new_typeinfo, plugin_generated=True) + return new_typeinfo + + +def get_current_module(api: TypeChecker) -> MypyFile: + current_module = None + for item in reversed(api.scope.stack): + if isinstance(item, MypyFile): + current_module = item + break + assert current_module is not None + return current_module + + +def make_oneoff_named_tuple(api: TypeChecker, name: str, fields: 'OrderedDict[str, MypyType]') -> TupleType: + current_module = get_current_module(api) + namedtuple_info = add_new_class_for_module(current_module, name, + bases=[api.named_generic_type('typing.NamedTuple', [])], + fields=fields) + return TupleType(list(fields.values()), fallback=Instance(namedtuple_info, [])) + + +def make_tuple(api: 'TypeChecker', fields: List[MypyType]) -> TupleType: + # fallback for tuples is any builtins.tuple instance + fallback = api.named_generic_type('builtins.tuple', + [AnyType(TypeOfAny.special_form)]) + return TupleType(fields, fallback=fallback) + + +def convert_any_to_type(typ: MypyType, referred_to_type: MypyType) -> MypyType: + if isinstance(typ, UnionType): + converted_items = [] + for item in typ.items: + converted_items.append(convert_any_to_type(item, referred_to_type)) + return UnionType.make_union(converted_items, + line=typ.line, column=typ.column) + if isinstance(typ, Instance): + args = [] + for default_arg in typ.args: + if isinstance(default_arg, AnyType): + args.append(referred_to_type) + else: + args.append(default_arg) + return reparametrize_instance(typ, args) + + if isinstance(typ, AnyType): + return referred_to_type + + return typ + + +def make_typeddict(api: CheckerPluginInterface, fields: 'OrderedDict[str, MypyType]', + required_keys: Set[str]) -> TypedDictType: + object_type = api.named_generic_type('mypy_extensions._TypedDict', []) + typed_dict_type = TypedDictType(fields, required_keys=required_keys, fallback=object_type) + return typed_dict_type + + +def resolve_string_attribute_value(attr_expr: Expression, django_context: 'DjangoContext') -> Optional[str]: + if isinstance(attr_expr, StrExpr): + return attr_expr.value + + # support extracting from settings, in general case it's unresolvable yet + if isinstance(attr_expr, MemberExpr): + member_name = attr_expr.name + if isinstance(attr_expr.expr, NameExpr) and attr_expr.expr.fullname == 'django.conf.settings': + if hasattr(django_context.settings, member_name): + return getattr(django_context.settings, member_name) + return None + + +def get_semanal_api(ctx: Union[ClassDefContext, DynamicClassDefContext]) -> SemanticAnalyzer: + if not isinstance(ctx.api, SemanticAnalyzer): + raise ValueError('Not a SemanticAnalyzer') + return ctx.api + + +def get_typechecker_api(ctx: Union[AttributeContext, MethodContext, FunctionContext]) -> TypeChecker: + if not isinstance(ctx.api, TypeChecker): + raise ValueError('Not a TypeChecker') + return ctx.api + + +def is_model_subclass_info(info: TypeInfo, django_context: 'DjangoContext') -> bool: + return (info.fullname in django_context.all_registered_model_class_fullnames + or info.has_base(fullnames.MODEL_CLASS_FULLNAME)) + + +def check_types_compatible(ctx: Union[FunctionContext, MethodContext], + *, expected_type: MypyType, actual_type: MypyType, error_message: str) -> None: + api = get_typechecker_api(ctx) + api.check_subtype(actual_type, expected_type, + ctx.context, error_message, + 'got', 'expected') + + +def add_new_sym_for_info(info: TypeInfo, *, name: str, sym_type: MypyType) -> None: + # type=: type of the variable itself + var = Var(name=name, type=sym_type) + # var.info: type of the object variable is bound to + var.info = info + var._fullname = info.fullname + '.' + name + var.is_initialized_in_class = True + var.is_inferred = True + info.names[name] = SymbolTableNode(MDEF, var, + plugin_generated=True) + + +def build_unannotated_method_args(method_node: FuncDef) -> Tuple[List[Argument], MypyType]: + prepared_arguments = [] + for argument in method_node.arguments[1:]: + argument.type_annotation = AnyType(TypeOfAny.unannotated) + prepared_arguments.append(argument) + return_type = AnyType(TypeOfAny.unannotated) + return prepared_arguments, return_type + + +def copy_method_to_another_class(ctx: ClassDefContext, self_type: Instance, + new_method_name: str, method_node: FuncDef) -> None: + semanal_api = get_semanal_api(ctx) + if method_node.type is None: + if not semanal_api.final_iteration: + semanal_api.defer() + return + + arguments, return_type = build_unannotated_method_args(method_node) + add_method(ctx, + new_method_name, + args=arguments, + return_type=return_type, + self_type=self_type) + return + + method_type = method_node.type + if not isinstance(method_type, CallableType): + if not semanal_api.final_iteration: + semanal_api.defer() + return + + arguments = [] + bound_return_type = semanal_api.anal_type(method_type.ret_type, + allow_placeholder=True) + assert bound_return_type is not None + + if isinstance(bound_return_type, PlaceholderNode): + return + + for arg_name, arg_type, original_argument in zip(method_type.arg_names[1:], + method_type.arg_types[1:], + method_node.arguments[1:]): + bound_arg_type = semanal_api.anal_type(arg_type, allow_placeholder=True) + assert bound_arg_type is not None + + if isinstance(bound_arg_type, PlaceholderNode): + return + + var = Var(name=original_argument.variable.name, + type=arg_type) + var.line = original_argument.variable.line + var.column = original_argument.variable.column + argument = Argument(variable=var, + type_annotation=bound_arg_type, + initializer=original_argument.initializer, + kind=original_argument.kind) + argument.set_line(original_argument) + arguments.append(argument) + + add_method(ctx, + new_method_name, + args=arguments, + return_type=bound_return_type, + self_type=self_type) diff --git a/anaconda_lib/jedi/third_party/django-stubs/mypy_django_plugin/main.py b/anaconda_lib/jedi/third_party/django-stubs/mypy_django_plugin/main.py new file mode 100644 index 00000000..30ac0e0d --- /dev/null +++ b/anaconda_lib/jedi/third_party/django-stubs/mypy_django_plugin/main.py @@ -0,0 +1,259 @@ +import configparser +from functools import partial +from typing import Callable, Dict, List, Optional, Tuple + +from django.db.models.fields.related import RelatedField +from mypy.errors import Errors +from mypy.nodes import MypyFile, TypeInfo +from mypy.options import Options +from mypy.plugin import ( + AttributeContext, ClassDefContext, DynamicClassDefContext, FunctionContext, MethodContext, Plugin, +) +from mypy.types import Type as MypyType + +import mypy_django_plugin.transformers.orm_lookups +from mypy_django_plugin.django.context import DjangoContext +from mypy_django_plugin.lib import fullnames, helpers +from mypy_django_plugin.transformers import ( + fields, forms, init_create, meta, querysets, request, settings, +) +from mypy_django_plugin.transformers.managers import ( + create_new_manager_class_from_from_queryset_method, +) +from mypy_django_plugin.transformers.models import process_model_class + + +def transform_model_class(ctx: ClassDefContext, + django_context: DjangoContext) -> None: + sym = ctx.api.lookup_fully_qualified_or_none(fullnames.MODEL_CLASS_FULLNAME) + + if sym is not None and isinstance(sym.node, TypeInfo): + helpers.get_django_metadata(sym.node)['model_bases'][ctx.cls.fullname] = 1 + else: + if not ctx.api.final_iteration: + ctx.api.defer() + return + + process_model_class(ctx, django_context) + + +def transform_form_class(ctx: ClassDefContext) -> None: + sym = ctx.api.lookup_fully_qualified_or_none(fullnames.BASEFORM_CLASS_FULLNAME) + if sym is not None and isinstance(sym.node, TypeInfo): + helpers.get_django_metadata(sym.node)['baseform_bases'][ctx.cls.fullname] = 1 + + forms.make_meta_nested_class_inherit_from_any(ctx) + + +def add_new_manager_base(ctx: ClassDefContext) -> None: + sym = ctx.api.lookup_fully_qualified_or_none(fullnames.MANAGER_CLASS_FULLNAME) + if sym is not None and isinstance(sym.node, TypeInfo): + helpers.get_django_metadata(sym.node)['manager_bases'][ctx.cls.fullname] = 1 + + +def extract_django_settings_module(config_file_path: Optional[str]) -> str: + errors = Errors() + if config_file_path is None: + errors.report(0, None, "'django_settings_module' is not set: no mypy config file specified") + errors.raise_error() + + parser = configparser.ConfigParser() + parser.read(config_file_path) # type: ignore + + if not parser.has_section('mypy.plugins.django-stubs'): + errors.report(0, None, "'django_settings_module' is not set: no section [mypy.plugins.django-stubs]", + file=config_file_path) + errors.raise_error() + if not parser.has_option('mypy.plugins.django-stubs', 'django_settings_module'): + errors.report(0, None, "'django_settings_module' is not set: setting is not provided", + file=config_file_path) + errors.raise_error() + + django_settings_module = parser.get('mypy.plugins.django-stubs', 'django_settings_module').strip('\'"') + return django_settings_module + + +class NewSemanalDjangoPlugin(Plugin): + def __init__(self, options: Options) -> None: + super().__init__(options) + django_settings_module = extract_django_settings_module(options.config_file) + self.django_context = DjangoContext(django_settings_module) + + def _get_current_queryset_bases(self) -> Dict[str, int]: + model_sym = self.lookup_fully_qualified(fullnames.QUERYSET_CLASS_FULLNAME) + if model_sym is not None and isinstance(model_sym.node, TypeInfo): + return (helpers.get_django_metadata(model_sym.node) + .setdefault('queryset_bases', {fullnames.QUERYSET_CLASS_FULLNAME: 1})) + else: + return {} + + def _get_current_manager_bases(self) -> Dict[str, int]: + model_sym = self.lookup_fully_qualified(fullnames.MANAGER_CLASS_FULLNAME) + if model_sym is not None and isinstance(model_sym.node, TypeInfo): + return (helpers.get_django_metadata(model_sym.node) + .setdefault('manager_bases', {fullnames.MANAGER_CLASS_FULLNAME: 1})) + else: + return {} + + def _get_current_model_bases(self) -> Dict[str, int]: + model_sym = self.lookup_fully_qualified(fullnames.MODEL_CLASS_FULLNAME) + if model_sym is not None and isinstance(model_sym.node, TypeInfo): + return helpers.get_django_metadata(model_sym.node).setdefault('model_bases', + {fullnames.MODEL_CLASS_FULLNAME: 1}) + else: + return {} + + def _get_current_form_bases(self) -> Dict[str, int]: + model_sym = self.lookup_fully_qualified(fullnames.BASEFORM_CLASS_FULLNAME) + if model_sym is not None and isinstance(model_sym.node, TypeInfo): + return (helpers.get_django_metadata(model_sym.node) + .setdefault('baseform_bases', {fullnames.BASEFORM_CLASS_FULLNAME: 1, + fullnames.FORM_CLASS_FULLNAME: 1, + fullnames.MODELFORM_CLASS_FULLNAME: 1})) + else: + return {} + + def _get_typeinfo_or_none(self, class_name: str) -> Optional[TypeInfo]: + sym = self.lookup_fully_qualified(class_name) + if sym is not None and isinstance(sym.node, TypeInfo): + return sym.node + return None + + def _new_dependency(self, module: str) -> Tuple[int, str, int]: + return 10, module, -1 + + def get_additional_deps(self, file: MypyFile) -> List[Tuple[int, str, int]]: + # for settings + if file.fullname == 'django.conf' and self.django_context.django_settings_module: + return [self._new_dependency(self.django_context.django_settings_module)] + + # for values / values_list + if file.fullname == 'django.db.models': + return [self._new_dependency('mypy_extensions'), self._new_dependency('typing')] + + # for `get_user_model()` + if self.django_context.settings: + if (file.fullname == 'django.contrib.auth' + or file.fullname in {'django.http', 'django.http.request'}): + auth_user_model_name = self.django_context.settings.AUTH_USER_MODEL + try: + auth_user_module = self.django_context.apps_registry.get_model(auth_user_model_name).__module__ + except LookupError: + # get_user_model() model app is not installed + return [] + return [self._new_dependency(auth_user_module)] + + # ensure that all mentioned to='someapp.SomeModel' are loaded with corresponding related Fields + defined_model_classes = self.django_context.model_modules.get(file.fullname) + if not defined_model_classes: + return [] + deps = set() + for model_class in defined_model_classes: + # forward relations + for field in self.django_context.get_model_fields(model_class): + if isinstance(field, RelatedField): + related_model_cls = self.django_context.get_field_related_model_cls(field) + if related_model_cls is None: + continue + related_model_module = related_model_cls.__module__ + if related_model_module != file.fullname: + deps.add(self._new_dependency(related_model_module)) + # reverse relations + for relation in model_class._meta.related_objects: + related_model_cls = self.django_context.get_field_related_model_cls(relation) + related_model_module = related_model_cls.__module__ + if related_model_module != file.fullname: + deps.add(self._new_dependency(related_model_module)) + return list(deps) + + def get_function_hook(self, fullname: str + ) -> Optional[Callable[[FunctionContext], MypyType]]: + if fullname == 'django.contrib.auth.get_user_model': + return partial(settings.get_user_model_hook, django_context=self.django_context) + + manager_bases = self._get_current_manager_bases() + if fullname in manager_bases: + return querysets.determine_proper_manager_type + + info = self._get_typeinfo_or_none(fullname) + if info: + if info.has_base(fullnames.FIELD_FULLNAME): + return partial(fields.transform_into_proper_return_type, django_context=self.django_context) + + if helpers.is_model_subclass_info(info, self.django_context): + return partial(init_create.redefine_and_typecheck_model_init, django_context=self.django_context) + return None + + def get_method_hook(self, fullname: str + ) -> Optional[Callable[[MethodContext], MypyType]]: + class_fullname, _, method_name = fullname.rpartition('.') + if method_name == 'get_form_class': + info = self._get_typeinfo_or_none(class_fullname) + if info and info.has_base(fullnames.FORM_MIXIN_CLASS_FULLNAME): + return forms.extract_proper_type_for_get_form_class + + if method_name == 'get_form': + info = self._get_typeinfo_or_none(class_fullname) + if info and info.has_base(fullnames.FORM_MIXIN_CLASS_FULLNAME): + return forms.extract_proper_type_for_get_form + + if method_name == 'values': + info = self._get_typeinfo_or_none(class_fullname) + if info and info.has_base(fullnames.QUERYSET_CLASS_FULLNAME): + return partial(querysets.extract_proper_type_queryset_values, django_context=self.django_context) + + if method_name == 'values_list': + info = self._get_typeinfo_or_none(class_fullname) + if info and info.has_base(fullnames.QUERYSET_CLASS_FULLNAME): + return partial(querysets.extract_proper_type_queryset_values_list, django_context=self.django_context) + + if method_name == 'get_field': + info = self._get_typeinfo_or_none(class_fullname) + if info and info.has_base(fullnames.OPTIONS_CLASS_FULLNAME): + return partial(meta.return_proper_field_type_from_get_field, django_context=self.django_context) + + manager_classes = self._get_current_manager_bases() + if class_fullname in manager_classes and method_name == 'create': + return partial(init_create.redefine_and_typecheck_model_create, django_context=self.django_context) + if class_fullname in manager_classes and method_name in {'filter', 'get', 'exclude'}: + return partial(mypy_django_plugin.transformers.orm_lookups.typecheck_queryset_filter, + django_context=self.django_context) + return None + + def get_base_class_hook(self, fullname: str + ) -> Optional[Callable[[ClassDefContext], None]]: + if (fullname in self.django_context.all_registered_model_class_fullnames + or fullname in self._get_current_model_bases()): + return partial(transform_model_class, django_context=self.django_context) + + if fullname in self._get_current_manager_bases(): + return add_new_manager_base + + if fullname in self._get_current_form_bases(): + return transform_form_class + return None + + def get_attribute_hook(self, fullname: str + ) -> Optional[Callable[[AttributeContext], MypyType]]: + class_name, _, attr_name = fullname.rpartition('.') + if class_name == fullnames.DUMMY_SETTINGS_BASE_CLASS: + return partial(settings.get_type_of_settings_attribute, + django_context=self.django_context) + + info = self._get_typeinfo_or_none(class_name) + if info and info.has_base(fullnames.HTTPREQUEST_CLASS_FULLNAME) and attr_name == 'user': + return partial(request.set_auth_user_model_as_type_for_request_user, django_context=self.django_context) + return None + + def get_dynamic_class_hook(self, fullname: str + ) -> Optional[Callable[[DynamicClassDefContext], None]]: + if fullname.endswith('from_queryset'): + class_name, _, _ = fullname.rpartition('.') + info = self._get_typeinfo_or_none(class_name) + if info and info.has_base(fullnames.BASE_MANAGER_CLASS_FULLNAME): + return create_new_manager_class_from_from_queryset_method + return None + + +def plugin(version): + return NewSemanalDjangoPlugin diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/bdist_dumb.pyi b/anaconda_lib/jedi/third_party/django-stubs/mypy_django_plugin/transformers/__init__.py old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/bdist_dumb.pyi rename to anaconda_lib/jedi/third_party/django-stubs/mypy_django_plugin/transformers/__init__.py diff --git a/anaconda_lib/jedi/third_party/django-stubs/mypy_django_plugin/transformers/fields.py b/anaconda_lib/jedi/third_party/django-stubs/mypy_django_plugin/transformers/fields.py new file mode 100644 index 00000000..b88fdbf5 --- /dev/null +++ b/anaconda_lib/jedi/third_party/django-stubs/mypy_django_plugin/transformers/fields.py @@ -0,0 +1,157 @@ +from typing import Optional, Tuple, cast + +from django.db.models.fields import Field +from django.db.models.fields.related import RelatedField +from mypy.nodes import AssignmentStmt, NameExpr, TypeInfo +from mypy.plugin import FunctionContext +from mypy.types import AnyType, Instance +from mypy.types import Type as MypyType +from mypy.types import TypeOfAny + +from mypy_django_plugin.django.context import DjangoContext +from mypy_django_plugin.lib import fullnames, helpers + + +def _get_current_field_from_assignment(ctx: FunctionContext, django_context: DjangoContext) -> Optional[Field]: + outer_model_info = helpers.get_typechecker_api(ctx).scope.active_class() + if (outer_model_info is None + or not helpers.is_model_subclass_info(outer_model_info, django_context)): + return None + + field_name = None + for stmt in outer_model_info.defn.defs.body: + if isinstance(stmt, AssignmentStmt): + if stmt.rvalue == ctx.context: + if not isinstance(stmt.lvalues[0], NameExpr): + return None + field_name = stmt.lvalues[0].name + break + if field_name is None: + return None + + model_cls = django_context.get_model_class_by_fullname(outer_model_info.fullname) + if model_cls is None: + return None + + current_field = model_cls._meta.get_field(field_name) + return current_field + + +def reparametrize_related_field_type(related_field_type: Instance, set_type, get_type) -> Instance: + args = [ + helpers.convert_any_to_type(related_field_type.args[0], set_type), + helpers.convert_any_to_type(related_field_type.args[1], get_type), + ] + return helpers.reparametrize_instance(related_field_type, new_args=args) + + +def fill_descriptor_types_for_related_field(ctx: FunctionContext, django_context: DjangoContext) -> MypyType: + current_field = _get_current_field_from_assignment(ctx, django_context) + if current_field is None: + return AnyType(TypeOfAny.from_error) + + assert isinstance(current_field, RelatedField) + + related_model_cls = django_context.get_field_related_model_cls(current_field) + if related_model_cls is None: + return AnyType(TypeOfAny.from_error) + + default_related_field_type = set_descriptor_types_for_field(ctx) + + # self reference with abstract=True on the model where ForeignKey is defined + current_model_cls = current_field.model + if (current_model_cls._meta.abstract + and current_model_cls == related_model_cls): + # for all derived non-abstract classes, set variable with this name to + # __get__/__set__ of ForeignKey of derived model + for model_cls in django_context.all_registered_model_classes: + if issubclass(model_cls, current_model_cls) and not model_cls._meta.abstract: + derived_model_info = helpers.lookup_class_typeinfo(helpers.get_typechecker_api(ctx), model_cls) + if derived_model_info is not None: + fk_ref_type = Instance(derived_model_info, []) + derived_fk_type = reparametrize_related_field_type(default_related_field_type, + set_type=fk_ref_type, get_type=fk_ref_type) + helpers.add_new_sym_for_info(derived_model_info, + name=current_field.name, + sym_type=derived_fk_type) + + related_model = related_model_cls + related_model_to_set = related_model_cls + if related_model_to_set._meta.proxy_for_model is not None: + related_model_to_set = related_model_to_set._meta.proxy_for_model + + typechecker_api = helpers.get_typechecker_api(ctx) + + related_model_info = helpers.lookup_class_typeinfo(typechecker_api, related_model) + if related_model_info is None: + # maybe no type stub + related_model_type = AnyType(TypeOfAny.unannotated) + else: + related_model_type = Instance(related_model_info, []) # type: ignore + + related_model_to_set_info = helpers.lookup_class_typeinfo(typechecker_api, related_model_to_set) + if related_model_to_set_info is None: + # maybe no type stub + related_model_to_set_type = AnyType(TypeOfAny.unannotated) + else: + related_model_to_set_type = Instance(related_model_to_set_info, []) # type: ignore + + # replace Any with referred_to_type + return reparametrize_related_field_type(default_related_field_type, + set_type=related_model_to_set_type, + get_type=related_model_type) + + +def get_field_descriptor_types(field_info: TypeInfo, is_nullable: bool) -> Tuple[MypyType, MypyType]: + set_type = helpers.get_private_descriptor_type(field_info, '_pyi_private_set_type', + is_nullable=is_nullable) + get_type = helpers.get_private_descriptor_type(field_info, '_pyi_private_get_type', + is_nullable=is_nullable) + return set_type, get_type + + +def set_descriptor_types_for_field(ctx: FunctionContext) -> Instance: + default_return_type = cast(Instance, ctx.default_return_type) + + is_nullable = False + null_expr = helpers.get_call_argument_by_name(ctx, 'null') + if null_expr is not None: + is_nullable = helpers.parse_bool(null_expr) or False + + set_type, get_type = get_field_descriptor_types(default_return_type.type, is_nullable) + return helpers.reparametrize_instance(default_return_type, [set_type, get_type]) + + +def determine_type_of_array_field(ctx: FunctionContext, django_context: DjangoContext) -> MypyType: + default_return_type = set_descriptor_types_for_field(ctx) + + base_field_arg_type = helpers.get_call_argument_type_by_name(ctx, 'base_field') + if not base_field_arg_type or not isinstance(base_field_arg_type, Instance): + return default_return_type + + base_type = base_field_arg_type.args[1] # extract __get__ type + args = [] + for default_arg in default_return_type.args: + args.append(helpers.convert_any_to_type(default_arg, base_type)) + + return helpers.reparametrize_instance(default_return_type, args) + + +def transform_into_proper_return_type(ctx: FunctionContext, django_context: DjangoContext) -> MypyType: + default_return_type = ctx.default_return_type + assert isinstance(default_return_type, Instance) + + outer_model_info = helpers.get_typechecker_api(ctx).scope.active_class() + if (outer_model_info is None + or not helpers.is_model_subclass_info(outer_model_info, django_context)): + return ctx.default_return_type + + assert isinstance(outer_model_info, TypeInfo) + + if helpers.has_any_of_bases(default_return_type.type, fullnames.RELATED_FIELDS_CLASSES): + return fill_descriptor_types_for_related_field(ctx, django_context) + + if default_return_type.type.has_base(fullnames.ARRAY_FIELD_FULLNAME): + return determine_type_of_array_field(ctx, django_context) + + return set_descriptor_types_for_field(ctx) diff --git a/anaconda_lib/jedi/third_party/django-stubs/mypy_django_plugin/transformers/forms.py b/anaconda_lib/jedi/third_party/django-stubs/mypy_django_plugin/transformers/forms.py new file mode 100644 index 00000000..7bd0e111 --- /dev/null +++ b/anaconda_lib/jedi/third_party/django-stubs/mypy_django_plugin/transformers/forms.py @@ -0,0 +1,52 @@ +from typing import Optional + +from mypy.plugin import ClassDefContext, MethodContext +from mypy.types import CallableType, Instance, NoneTyp +from mypy.types import Type as MypyType +from mypy.types import TypeType + +from mypy_django_plugin.lib import helpers + + +def make_meta_nested_class_inherit_from_any(ctx: ClassDefContext) -> None: + meta_node = helpers.get_nested_meta_node_for_current_class(ctx.cls.info) + if meta_node is None: + if not ctx.api.final_iteration: + ctx.api.defer() + else: + meta_node.fallback_to_any = True + + +def get_specified_form_class(object_type: Instance) -> Optional[TypeType]: + form_class_sym = object_type.type.get('form_class') + if form_class_sym and isinstance(form_class_sym.type, CallableType): + return TypeType(form_class_sym.type.ret_type) + return None + + +def extract_proper_type_for_get_form(ctx: MethodContext) -> MypyType: + object_type = ctx.type + assert isinstance(object_type, Instance) + + form_class_type = helpers.get_call_argument_type_by_name(ctx, 'form_class') + if form_class_type is None or isinstance(form_class_type, NoneTyp): + form_class_type = get_specified_form_class(object_type) + + if isinstance(form_class_type, TypeType) and isinstance(form_class_type.item, Instance): + return form_class_type.item + + if isinstance(form_class_type, CallableType) and isinstance(form_class_type.ret_type, Instance): + return form_class_type.ret_type + + return ctx.default_return_type + + +def extract_proper_type_for_get_form_class(ctx: MethodContext) -> MypyType: + object_type = ctx.type + assert isinstance(object_type, Instance) + + form_class_type = get_specified_form_class(object_type) + if form_class_type is None: + return ctx.default_return_type + + return form_class_type diff --git a/anaconda_lib/jedi/third_party/django-stubs/mypy_django_plugin/transformers/init_create.py b/anaconda_lib/jedi/third_party/django-stubs/mypy_django_plugin/transformers/init_create.py new file mode 100644 index 00000000..fe0b19ee --- /dev/null +++ b/anaconda_lib/jedi/third_party/django-stubs/mypy_django_plugin/transformers/init_create.py @@ -0,0 +1,75 @@ +from typing import List, Tuple, Type, Union + +from django.db.models.base import Model +from mypy.plugin import FunctionContext, MethodContext +from mypy.types import Instance +from mypy.types import Type as MypyType + +from mypy_django_plugin.django.context import DjangoContext +from mypy_django_plugin.lib import helpers + + +def get_actual_types(ctx: Union[MethodContext, FunctionContext], + expected_keys: List[str]) -> List[Tuple[str, MypyType]]: + actual_types = [] + # positionals + for pos, (actual_name, actual_type) in enumerate(zip(ctx.arg_names[0], ctx.arg_types[0])): + if actual_name is None: + if ctx.callee_arg_names[0] == 'kwargs': + # unpacked dict as kwargs is not supported + continue + actual_name = expected_keys[pos] + actual_types.append((actual_name, actual_type)) + # kwargs + if len(ctx.callee_arg_names) > 1: + for actual_name, actual_type in zip(ctx.arg_names[1], ctx.arg_types[1]): + if actual_name is None: + # unpacked dict as kwargs is not supported + continue + actual_types.append((actual_name, actual_type)) + return actual_types + + +def typecheck_model_method(ctx: Union[FunctionContext, MethodContext], django_context: DjangoContext, + model_cls: Type[Model], method: str) -> MypyType: + typechecker_api = helpers.get_typechecker_api(ctx) + expected_types = django_context.get_expected_types(typechecker_api, model_cls, method=method) + expected_keys = [key for key in expected_types.keys() if key != 'pk'] + + for actual_name, actual_type in get_actual_types(ctx, expected_keys): + if actual_name not in expected_types: + ctx.api.fail('Unexpected attribute "{}" for model "{}"'.format(actual_name, + model_cls.__name__), + ctx.context) + continue + helpers.check_types_compatible(ctx, + expected_type=expected_types[actual_name], + actual_type=actual_type, + error_message='Incompatible type for "{}" of "{}"'.format(actual_name, + model_cls.__name__)) + + return ctx.default_return_type + + +def redefine_and_typecheck_model_init(ctx: FunctionContext, django_context: DjangoContext) -> MypyType: + assert isinstance(ctx.default_return_type, Instance) + + model_fullname = ctx.default_return_type.type.fullname + model_cls = django_context.get_model_class_by_fullname(model_fullname) + if model_cls is None: + return ctx.default_return_type + + return typecheck_model_method(ctx, django_context, model_cls, '__init__') + + +def redefine_and_typecheck_model_create(ctx: MethodContext, django_context: DjangoContext) -> MypyType: + if not isinstance(ctx.default_return_type, Instance): + # only work with ctx.default_return_type = model Instance + return ctx.default_return_type + + model_fullname = ctx.default_return_type.type.fullname + model_cls = django_context.get_model_class_by_fullname(model_fullname) + if model_cls is None: + return ctx.default_return_type + + return typecheck_model_method(ctx, django_context, model_cls, 'create') diff --git a/anaconda_lib/jedi/third_party/django-stubs/mypy_django_plugin/transformers/managers.py b/anaconda_lib/jedi/third_party/django-stubs/mypy_django_plugin/transformers/managers.py new file mode 100644 index 00000000..88201b43 --- /dev/null +++ b/anaconda_lib/jedi/third_party/django-stubs/mypy_django_plugin/transformers/managers.py @@ -0,0 +1,77 @@ +from mypy.nodes import ( + GDEF, FuncDef, MemberExpr, NameExpr, RefExpr, StrExpr, SymbolTableNode, TypeInfo, +) +from mypy.plugin import ClassDefContext, DynamicClassDefContext +from mypy.types import AnyType, Instance, TypeOfAny + +from mypy_django_plugin.lib import fullnames, helpers + + +def create_new_manager_class_from_from_queryset_method(ctx: DynamicClassDefContext) -> None: + semanal_api = helpers.get_semanal_api(ctx) + + callee = ctx.call.callee + assert isinstance(callee, MemberExpr) + assert isinstance(callee.expr, RefExpr) + + base_manager_info = callee.expr.node + if base_manager_info is None: + if not semanal_api.final_iteration: + semanal_api.defer() + return + + assert isinstance(base_manager_info, TypeInfo) + new_manager_info = semanal_api.basic_new_typeinfo(ctx.name, + basetype_or_fallback=Instance(base_manager_info, + [AnyType(TypeOfAny.unannotated)])) + new_manager_info.line = ctx.call.line + new_manager_info.defn.line = ctx.call.line + new_manager_info.metaclass_type = new_manager_info.calculate_metaclass_type() + + current_module = semanal_api.cur_mod_node + current_module.names[ctx.name] = SymbolTableNode(GDEF, new_manager_info, + plugin_generated=True) + passed_queryset = ctx.call.args[0] + assert isinstance(passed_queryset, NameExpr) + + derived_queryset_fullname = passed_queryset.fullname + assert derived_queryset_fullname is not None + + sym = semanal_api.lookup_fully_qualified_or_none(derived_queryset_fullname) + assert sym is not None + if sym.node is None: + if not semanal_api.final_iteration: + semanal_api.defer() + else: + # inherit from Any to prevent false-positives, if queryset class cannot be resolved + new_manager_info.fallback_to_any = True + return + + derived_queryset_info = sym.node + assert isinstance(derived_queryset_info, TypeInfo) + + if len(ctx.call.args) > 1: + expr = ctx.call.args[1] + assert isinstance(expr, StrExpr) + custom_manager_generated_name = expr.value + else: + custom_manager_generated_name = base_manager_info.name + 'From' + derived_queryset_info.name + + custom_manager_generated_fullname = '.'.join(['django.db.models.manager', custom_manager_generated_name]) + if 'from_queryset_managers' not in base_manager_info.metadata: + base_manager_info.metadata['from_queryset_managers'] = {} + base_manager_info.metadata['from_queryset_managers'][custom_manager_generated_fullname] = new_manager_info.fullname + + class_def_context = ClassDefContext(cls=new_manager_info.defn, + reason=ctx.call, api=semanal_api) + self_type = Instance(new_manager_info, []) + # we need to copy all methods in MRO before django.db.models.query.QuerySet + for class_mro_info in derived_queryset_info.mro: + if class_mro_info.fullname == fullnames.QUERYSET_CLASS_FULLNAME: + break + for name, sym in class_mro_info.names.items(): + if isinstance(sym.node, FuncDef): + helpers.copy_method_to_another_class(class_def_context, + self_type, + new_method_name=name, + method_node=sym.node) diff --git a/anaconda_lib/jedi/third_party/django-stubs/mypy_django_plugin/transformers/meta.py b/anaconda_lib/jedi/third_party/django-stubs/mypy_django_plugin/transformers/meta.py new file mode 100644 index 00000000..64e6e12f --- /dev/null +++ b/anaconda_lib/jedi/third_party/django-stubs/mypy_django_plugin/transformers/meta.py @@ -0,0 +1,52 @@ +from django.core.exceptions import FieldDoesNotExist +from mypy.plugin import MethodContext +from mypy.types import AnyType, Instance +from mypy.types import Type as MypyType +from mypy.types import TypeOfAny + +from mypy_django_plugin.django.context import DjangoContext +from mypy_django_plugin.lib import helpers + + +def _get_field_instance(ctx: MethodContext, field_fullname: str) -> MypyType: + field_info = helpers.lookup_fully_qualified_typeinfo(helpers.get_typechecker_api(ctx), + field_fullname) + if field_info is None: + return AnyType(TypeOfAny.unannotated) + return Instance(field_info, [AnyType(TypeOfAny.explicit), AnyType(TypeOfAny.explicit)]) + + +def return_proper_field_type_from_get_field(ctx: MethodContext, django_context: DjangoContext) -> MypyType: + # Options instance + assert isinstance(ctx.type, Instance) + + # bail if list of generic params is empty + if len(ctx.type.args) == 0: + return ctx.default_return_type + + model_type = ctx.type.args[0] + if not isinstance(model_type, Instance): + return ctx.default_return_type + + model_cls = django_context.get_model_class_by_fullname(model_type.type.fullname) + if model_cls is None: + return ctx.default_return_type + + field_name_expr = helpers.get_call_argument_by_name(ctx, 'field_name') + if field_name_expr is None: + return ctx.default_return_type + + field_name = helpers.resolve_string_attribute_value(field_name_expr, django_context) + if field_name is None: + return ctx.default_return_type + + try: + field = model_cls._meta.get_field(field_name) + except FieldDoesNotExist as exc: + # if model is abstract, do not raise exception, skip false positives + if not model_cls._meta.abstract: + ctx.api.fail(exc.args[0], ctx.context) + return AnyType(TypeOfAny.from_error) + + field_fullname = helpers.get_class_fullname(field.__class__) + return _get_field_instance(ctx, field_fullname) diff --git a/anaconda_lib/jedi/third_party/django-stubs/mypy_django_plugin/transformers/models.py b/anaconda_lib/jedi/third_party/django-stubs/mypy_django_plugin/transformers/models.py new file mode 100644 index 00000000..f0c436ca --- /dev/null +++ b/anaconda_lib/jedi/third_party/django-stubs/mypy_django_plugin/transformers/models.py @@ -0,0 +1,360 @@ +from typing import Dict, List, Optional, Type, cast + +from django.db.models.base import Model +from django.db.models.fields import DateField, DateTimeField +from django.db.models.fields.related import ForeignKey +from django.db.models.fields.reverse_related import ( + ManyToManyRel, ManyToOneRel, OneToOneRel, +) +from mypy.nodes import ARG_STAR2, Argument, Context, FuncDef, TypeInfo, Var +from mypy.plugin import ClassDefContext +from mypy.plugins import common +from mypy.semanal import SemanticAnalyzer +from mypy.types import AnyType, Instance +from mypy.types import Type as MypyType +from mypy.types import TypeOfAny + +from mypy_django_plugin.django.context import DjangoContext +from mypy_django_plugin.lib import fullnames, helpers +from mypy_django_plugin.transformers import fields +from mypy_django_plugin.transformers.fields import get_field_descriptor_types + + +class ModelClassInitializer: + api: SemanticAnalyzer + + def __init__(self, ctx: ClassDefContext, django_context: DjangoContext): + self.api = cast(SemanticAnalyzer, ctx.api) + self.model_classdef = ctx.cls + self.django_context = django_context + self.ctx = ctx + + def lookup_typeinfo(self, fullname: str) -> Optional[TypeInfo]: + return helpers.lookup_fully_qualified_typeinfo(self.api, fullname) + + def lookup_typeinfo_or_incomplete_defn_error(self, fullname: str) -> TypeInfo: + info = self.lookup_typeinfo(fullname) + if info is None: + raise helpers.IncompleteDefnException(f'No {fullname!r} found') + return info + + def lookup_class_typeinfo_or_incomplete_defn_error(self, klass: type) -> TypeInfo: + fullname = helpers.get_class_fullname(klass) + field_info = self.lookup_typeinfo_or_incomplete_defn_error(fullname) + return field_info + + def create_new_var(self, name: str, typ: MypyType) -> Var: + # type=: type of the variable itself + var = Var(name=name, type=typ) + # var.info: type of the object variable is bound to + var.info = self.model_classdef.info + var._fullname = self.model_classdef.info.fullname + '.' + name + var.is_initialized_in_class = True + var.is_inferred = True + return var + + def add_new_node_to_model_class(self, name: str, typ: MypyType) -> None: + helpers.add_new_sym_for_info(self.model_classdef.info, + name=name, + sym_type=typ) + + def add_new_class_for_current_module(self, name: str, bases: List[Instance]) -> TypeInfo: + current_module = self.api.modules[self.model_classdef.info.module_name] + new_class_info = helpers.add_new_class_for_module(current_module, + name=name, bases=bases) + return new_class_info + + def run(self) -> None: + model_cls = self.django_context.get_model_class_by_fullname(self.model_classdef.fullname) + if model_cls is None: + return + self.run_with_model_cls(model_cls) + + def run_with_model_cls(self, model_cls): + pass + + +class InjectAnyAsBaseForNestedMeta(ModelClassInitializer): + """ + Replaces + class MyModel(models.Model): + class Meta: + pass + with + class MyModel(models.Model): + class Meta(Any): + pass + to get around incompatible Meta inner classes for different models. + """ + + def run(self) -> None: + meta_node = helpers.get_nested_meta_node_for_current_class(self.model_classdef.info) + if meta_node is None: + return None + meta_node.fallback_to_any = True + + +class AddDefaultPrimaryKey(ModelClassInitializer): + def run_with_model_cls(self, model_cls: Type[Model]) -> None: + auto_field = model_cls._meta.auto_field + if auto_field and not self.model_classdef.info.has_readable_member(auto_field.attname): + # autogenerated field + auto_field_fullname = helpers.get_class_fullname(auto_field.__class__) + auto_field_info = self.lookup_typeinfo_or_incomplete_defn_error(auto_field_fullname) + + set_type, get_type = fields.get_field_descriptor_types(auto_field_info, is_nullable=False) + self.add_new_node_to_model_class(auto_field.attname, Instance(auto_field_info, + [set_type, get_type])) + + +class AddRelatedModelsId(ModelClassInitializer): + def run_with_model_cls(self, model_cls: Type[Model]) -> None: + for field in model_cls._meta.get_fields(): + if isinstance(field, ForeignKey): + related_model_cls = self.django_context.get_field_related_model_cls(field) + if related_model_cls is None: + error_context: Context = self.ctx.cls + field_sym = self.ctx.cls.info.get(field.name) + if field_sym is not None and field_sym.node is not None: + error_context = field_sym.node + self.api.fail(f'Cannot find model {field.related_model!r} ' + f'referenced in field {field.name!r} ', + ctx=error_context) + self.add_new_node_to_model_class(field.attname, + AnyType(TypeOfAny.explicit)) + continue + + if related_model_cls._meta.abstract: + continue + + rel_primary_key_field = self.django_context.get_primary_key_field(related_model_cls) + try: + field_info = self.lookup_class_typeinfo_or_incomplete_defn_error(rel_primary_key_field.__class__) + except helpers.IncompleteDefnException as exc: + if not self.api.final_iteration: + raise exc + else: + continue + + is_nullable = self.django_context.get_field_nullability(field, None) + set_type, get_type = get_field_descriptor_types(field_info, is_nullable) + self.add_new_node_to_model_class(field.attname, + Instance(field_info, [set_type, get_type])) + + +class AddManagers(ModelClassInitializer): + def has_any_parametrized_manager_as_base(self, info: TypeInfo) -> bool: + for base in helpers.iter_bases(info): + if self.is_any_parametrized_manager(base): + return True + return False + + def is_any_parametrized_manager(self, typ: Instance) -> bool: + return typ.type.fullname in fullnames.MANAGER_CLASSES and isinstance(typ.args[0], AnyType) + + def get_generated_manager_mappings(self, base_manager_fullname: str) -> Dict[str, str]: + base_manager_info = self.lookup_typeinfo(base_manager_fullname) + if (base_manager_info is None + or 'from_queryset_managers' not in base_manager_info.metadata): + return {} + return base_manager_info.metadata['from_queryset_managers'] + + def create_new_model_parametrized_manager(self, name: str, base_manager_info: TypeInfo) -> Instance: + bases = [] + for original_base in base_manager_info.bases: + if self.is_any_parametrized_manager(original_base): + if original_base.type is None: + raise helpers.IncompleteDefnException() + + original_base = helpers.reparametrize_instance(original_base, + [Instance(self.model_classdef.info, [])]) + bases.append(original_base) + + new_manager_info = self.add_new_class_for_current_module(name, bases) + # copy fields to a new manager + new_cls_def_context = ClassDefContext(cls=new_manager_info.defn, + reason=self.ctx.reason, + api=self.api) + custom_manager_type = Instance(new_manager_info, [Instance(self.model_classdef.info, [])]) + + for name, sym in base_manager_info.names.items(): + # replace self type with new class, if copying method + if isinstance(sym.node, FuncDef): + helpers.copy_method_to_another_class(new_cls_def_context, + self_type=custom_manager_type, + new_method_name=name, + method_node=sym.node) + continue + + new_sym = sym.copy() + if isinstance(new_sym.node, Var): + new_var = Var(name, type=sym.type) + new_var.info = new_manager_info + new_var._fullname = new_manager_info.fullname + '.' + name + new_sym.node = new_var + new_manager_info.names[name] = new_sym + + return custom_manager_type + + def run_with_model_cls(self, model_cls: Type[Model]) -> None: + for manager_name, manager in model_cls._meta.managers_map.items(): + manager_class_name = manager.__class__.__name__ + manager_fullname = helpers.get_class_fullname(manager.__class__) + try: + manager_info = self.lookup_typeinfo_or_incomplete_defn_error(manager_fullname) + except helpers.IncompleteDefnException as exc: + if not self.api.final_iteration: + raise exc + else: + base_manager_fullname = helpers.get_class_fullname(manager.__class__.__bases__[0]) + generated_managers = self.get_generated_manager_mappings(base_manager_fullname) + if manager_fullname not in generated_managers: + # not a generated manager, continue with the loop + continue + real_manager_fullname = generated_managers[manager_fullname] + manager_info = self.lookup_typeinfo(real_manager_fullname) # type: ignore + if manager_info is None: + continue + manager_class_name = real_manager_fullname.rsplit('.', maxsplit=1)[1] + + if manager_name not in self.model_classdef.info.names: + manager_type = Instance(manager_info, [Instance(self.model_classdef.info, [])]) + self.add_new_node_to_model_class(manager_name, manager_type) + else: + # creates new MODELNAME_MANAGERCLASSNAME class that represents manager parametrized with current model + if not self.has_any_parametrized_manager_as_base(manager_info): + continue + + custom_model_manager_name = manager.model.__name__ + '_' + manager_class_name + try: + custom_manager_type = self.create_new_model_parametrized_manager(custom_model_manager_name, + base_manager_info=manager_info) + except helpers.IncompleteDefnException: + continue + + self.add_new_node_to_model_class(manager_name, custom_manager_type) + + +class AddDefaultManagerAttribute(ModelClassInitializer): + def run_with_model_cls(self, model_cls: Type[Model]) -> None: + # add _default_manager + if '_default_manager' not in self.model_classdef.info.names: + default_manager_fullname = helpers.get_class_fullname(model_cls._meta.default_manager.__class__) + default_manager_info = self.lookup_typeinfo_or_incomplete_defn_error(default_manager_fullname) + default_manager = Instance(default_manager_info, [Instance(self.model_classdef.info, [])]) + self.add_new_node_to_model_class('_default_manager', default_manager) + + +class AddRelatedManagers(ModelClassInitializer): + def run_with_model_cls(self, model_cls: Type[Model]) -> None: + # add related managers + for relation in self.django_context.get_model_relations(model_cls): + attname = relation.get_accessor_name() + if attname is None: + # no reverse accessor + continue + + related_model_cls = self.django_context.get_field_related_model_cls(relation) + if related_model_cls is None: + continue + + try: + related_model_info = self.lookup_class_typeinfo_or_incomplete_defn_error(related_model_cls) + except helpers.IncompleteDefnException as exc: + if not self.api.final_iteration: + raise exc + else: + continue + + if isinstance(relation, OneToOneRel): + self.add_new_node_to_model_class(attname, Instance(related_model_info, [])) + continue + + if isinstance(relation, (ManyToOneRel, ManyToManyRel)): + try: + related_manager_info = self.lookup_typeinfo_or_incomplete_defn_error(fullnames.RELATED_MANAGER_CLASS) # noqa: E501 + if 'objects' not in related_model_info.names: + raise helpers.IncompleteDefnException() + except helpers.IncompleteDefnException as exc: + if not self.api.final_iteration: + raise exc + else: + continue + + # create new RelatedManager subclass + parametrized_related_manager_type = Instance(related_manager_info, + [Instance(related_model_info, [])]) + default_manager_type = related_model_info.names['objects'].type + if (default_manager_type is None + or not isinstance(default_manager_type, Instance) + or default_manager_type.type.fullname == fullnames.MANAGER_CLASS_FULLNAME): + self.add_new_node_to_model_class(attname, parametrized_related_manager_type) + continue + + name = related_model_cls.__name__ + '_' + 'RelatedManager' + bases = [parametrized_related_manager_type, default_manager_type] + new_related_manager_info = self.add_new_class_for_current_module(name, bases) + + self.add_new_node_to_model_class(attname, Instance(new_related_manager_info, [])) + + +class AddExtraFieldMethods(ModelClassInitializer): + def run_with_model_cls(self, model_cls: Type[Model]) -> None: + # get_FOO_display for choices + for field in self.django_context.get_model_fields(model_cls): + if field.choices: + info = self.lookup_typeinfo_or_incomplete_defn_error('builtins.str') + return_type = Instance(info, []) + common.add_method(self.ctx, + name='get_{}_display'.format(field.attname), + args=[], + return_type=return_type) + + # get_next_by, get_previous_by for Date, DateTime + for field in self.django_context.get_model_fields(model_cls): + if isinstance(field, (DateField, DateTimeField)) and not field.null: + return_type = Instance(self.model_classdef.info, []) + common.add_method(self.ctx, + name='get_next_by_{}'.format(field.attname), + args=[Argument(Var('kwargs', AnyType(TypeOfAny.explicit)), + AnyType(TypeOfAny.explicit), + initializer=None, + kind=ARG_STAR2)], + return_type=return_type) + common.add_method(self.ctx, + name='get_previous_by_{}'.format(field.attname), + args=[Argument(Var('kwargs', AnyType(TypeOfAny.explicit)), + AnyType(TypeOfAny.explicit), + initializer=None, + kind=ARG_STAR2)], + return_type=return_type) + + +class AddMetaOptionsAttribute(ModelClassInitializer): + def run_with_model_cls(self, model_cls: Type[Model]) -> None: + if '_meta' not in self.model_classdef.info.names: + options_info = self.lookup_typeinfo_or_incomplete_defn_error(fullnames.OPTIONS_CLASS_FULLNAME) + self.add_new_node_to_model_class('_meta', + Instance(options_info, [ + Instance(self.model_classdef.info, []) + ])) + + +def process_model_class(ctx: ClassDefContext, + django_context: DjangoContext) -> None: + initializers = [ + InjectAnyAsBaseForNestedMeta, + AddDefaultPrimaryKey, + AddRelatedModelsId, + AddManagers, + AddDefaultManagerAttribute, + AddRelatedManagers, + AddExtraFieldMethods, + AddMetaOptionsAttribute, + ] + for initializer_cls in initializers: + try: + initializer_cls(ctx, django_context).run() + except helpers.IncompleteDefnException: + if not ctx.api.final_iteration: + ctx.api.defer() diff --git a/anaconda_lib/jedi/third_party/django-stubs/mypy_django_plugin/transformers/orm_lookups.py b/anaconda_lib/jedi/third_party/django-stubs/mypy_django_plugin/transformers/orm_lookups.py new file mode 100644 index 00000000..0aa516be --- /dev/null +++ b/anaconda_lib/jedi/third_party/django-stubs/mypy_django_plugin/transformers/orm_lookups.py @@ -0,0 +1,51 @@ +from mypy.plugin import MethodContext +from mypy.types import AnyType, Instance +from mypy.types import Type as MypyType +from mypy.types import TypeOfAny + +from mypy_django_plugin.django.context import DjangoContext +from mypy_django_plugin.lib import fullnames, helpers + + +def typecheck_queryset_filter(ctx: MethodContext, django_context: DjangoContext) -> MypyType: + lookup_kwargs = ctx.arg_names[1] + provided_lookup_types = ctx.arg_types[1] + + assert isinstance(ctx.type, Instance) + + if not ctx.type.args or not isinstance(ctx.type.args[0], Instance): + return ctx.default_return_type + + model_cls_fullname = ctx.type.args[0].type.fullname + model_cls = django_context.get_model_class_by_fullname(model_cls_fullname) + if model_cls is None: + return ctx.default_return_type + + for lookup_kwarg, provided_type in zip(lookup_kwargs, provided_lookup_types): + if lookup_kwarg is None: + continue + if (isinstance(provided_type, Instance) + and provided_type.type.has_base('django.db.models.expressions.Combinable')): + provided_type = resolve_combinable_type(provided_type, django_context) + + lookup_type = django_context.resolve_lookup_expected_type(ctx, model_cls, lookup_kwarg) + # Managers as provided_type is not supported yet + if (isinstance(provided_type, Instance) + and helpers.has_any_of_bases(provided_type.type, (fullnames.MANAGER_CLASS_FULLNAME, + fullnames.QUERYSET_CLASS_FULLNAME))): + return ctx.default_return_type + + helpers.check_types_compatible(ctx, + expected_type=lookup_type, + actual_type=provided_type, + error_message=f'Incompatible type for lookup {lookup_kwarg!r}:') + + return ctx.default_return_type + + +def resolve_combinable_type(combinable_type: Instance, django_context: DjangoContext) -> MypyType: + if combinable_type.type.fullname != fullnames.F_EXPRESSION_FULLNAME: + # Combinables aside from F expressions are unsupported + return AnyType(TypeOfAny.explicit) + + return django_context.resolve_f_expression_type(combinable_type) diff --git a/anaconda_lib/jedi/third_party/django-stubs/mypy_django_plugin/transformers/querysets.py b/anaconda_lib/jedi/third_party/django-stubs/mypy_django_plugin/transformers/querysets.py new file mode 100644 index 00000000..c157bb4a --- /dev/null +++ b/anaconda_lib/jedi/third_party/django-stubs/mypy_django_plugin/transformers/querysets.py @@ -0,0 +1,192 @@ +from collections import OrderedDict +from typing import List, Optional, Sequence, Type + +from django.core.exceptions import FieldError +from django.db.models.base import Model +from django.db.models.fields.related import RelatedField +from django.db.models.fields.reverse_related import ForeignObjectRel +from mypy.nodes import Expression, NameExpr +from mypy.plugin import FunctionContext, MethodContext +from mypy.types import AnyType, Instance +from mypy.types import Type as MypyType +from mypy.types import TypeOfAny + +from mypy_django_plugin.django.context import ( + DjangoContext, LookupsAreUnsupported, +) +from mypy_django_plugin.lib import fullnames, helpers + + +def _extract_model_type_from_queryset(queryset_type: Instance) -> Optional[Instance]: + for base_type in [queryset_type, *queryset_type.type.bases]: + if (len(base_type.args) + and isinstance(base_type.args[0], Instance) + and base_type.args[0].type.has_base(fullnames.MODEL_CLASS_FULLNAME)): + return base_type.args[0] + return None + + +def determine_proper_manager_type(ctx: FunctionContext) -> MypyType: + default_return_type = ctx.default_return_type + assert isinstance(default_return_type, Instance) + + outer_model_info = helpers.get_typechecker_api(ctx).scope.active_class() + if (outer_model_info is None + or not outer_model_info.has_base(fullnames.MODEL_CLASS_FULLNAME)): + return default_return_type + + return helpers.reparametrize_instance(default_return_type, [Instance(outer_model_info, [])]) + + +def get_field_type_from_lookup(ctx: MethodContext, django_context: DjangoContext, model_cls: Type[Model], + *, method: str, lookup: str) -> Optional[MypyType]: + try: + lookup_field = django_context.resolve_lookup_into_field(model_cls, lookup) + except FieldError as exc: + ctx.api.fail(exc.args[0], ctx.context) + return None + except LookupsAreUnsupported: + return AnyType(TypeOfAny.explicit) + + if ((isinstance(lookup_field, RelatedField) and lookup_field.column == lookup) + or isinstance(lookup_field, ForeignObjectRel)): + related_model_cls = django_context.get_field_related_model_cls(lookup_field) + if related_model_cls is None: + return AnyType(TypeOfAny.from_error) + lookup_field = django_context.get_primary_key_field(related_model_cls) + + field_get_type = django_context.get_field_get_type(helpers.get_typechecker_api(ctx), + lookup_field, method=method) + return field_get_type + + +def get_values_list_row_type(ctx: MethodContext, django_context: DjangoContext, model_cls: Type[Model], + flat: bool, named: bool) -> MypyType: + field_lookups = resolve_field_lookups(ctx.args[0], django_context) + if field_lookups is None: + return AnyType(TypeOfAny.from_error) + + typechecker_api = helpers.get_typechecker_api(ctx) + if len(field_lookups) == 0: + if flat: + primary_key_field = django_context.get_primary_key_field(model_cls) + lookup_type = get_field_type_from_lookup(ctx, django_context, model_cls, + lookup=primary_key_field.attname, method='values_list') + assert lookup_type is not None + return lookup_type + elif named: + column_types: 'OrderedDict[str, MypyType]' = OrderedDict() + for field in django_context.get_model_fields(model_cls): + column_type = django_context.get_field_get_type(typechecker_api, field, + method='values_list') + column_types[field.attname] = column_type + return helpers.make_oneoff_named_tuple(typechecker_api, 'Row', column_types) + else: + # flat=False, named=False, all fields + field_lookups = [] + for field in django_context.get_model_fields(model_cls): + field_lookups.append(field.attname) + + if len(field_lookups) > 1 and flat: + typechecker_api.fail("'flat' is not valid when 'values_list' is called with more than one field", ctx.context) + return AnyType(TypeOfAny.from_error) + + column_types = OrderedDict() + for field_lookup in field_lookups: + lookup_field_type = get_field_type_from_lookup(ctx, django_context, model_cls, + lookup=field_lookup, method='values_list') + if lookup_field_type is None: + return AnyType(TypeOfAny.from_error) + column_types[field_lookup] = lookup_field_type + + if flat: + assert len(column_types) == 1 + row_type = next(iter(column_types.values())) + elif named: + row_type = helpers.make_oneoff_named_tuple(typechecker_api, 'Row', column_types) + else: + row_type = helpers.make_tuple(typechecker_api, list(column_types.values())) + + return row_type + + +def extract_proper_type_queryset_values_list(ctx: MethodContext, django_context: DjangoContext) -> MypyType: + # called on the Instance, returns QuerySet of something + assert isinstance(ctx.type, Instance) + assert isinstance(ctx.default_return_type, Instance) + + model_type = _extract_model_type_from_queryset(ctx.type) + if model_type is None: + return AnyType(TypeOfAny.from_omitted_generics) + + model_cls = django_context.get_model_class_by_fullname(model_type.type.fullname) + if model_cls is None: + return ctx.default_return_type + + flat_expr = helpers.get_call_argument_by_name(ctx, 'flat') + if flat_expr is not None and isinstance(flat_expr, NameExpr): + flat = helpers.parse_bool(flat_expr) + else: + flat = False + + named_expr = helpers.get_call_argument_by_name(ctx, 'named') + if named_expr is not None and isinstance(named_expr, NameExpr): + named = helpers.parse_bool(named_expr) + else: + named = False + + if flat and named: + ctx.api.fail("'flat' and 'named' can't be used together", ctx.context) + return helpers.reparametrize_instance(ctx.default_return_type, [model_type, AnyType(TypeOfAny.from_error)]) + + # account for possible None + flat = flat or False + named = named or False + + row_type = get_values_list_row_type(ctx, django_context, model_cls, + flat=flat, named=named) + return helpers.reparametrize_instance(ctx.default_return_type, [model_type, row_type]) + + +def resolve_field_lookups(lookup_exprs: Sequence[Expression], django_context: DjangoContext) -> Optional[List[str]]: + field_lookups = [] + for field_lookup_expr in lookup_exprs: + field_lookup = helpers.resolve_string_attribute_value(field_lookup_expr, django_context) + if field_lookup is None: + return None + field_lookups.append(field_lookup) + return field_lookups + + +def extract_proper_type_queryset_values(ctx: MethodContext, django_context: DjangoContext) -> MypyType: + # called on QuerySet, return QuerySet of something + assert isinstance(ctx.type, Instance) + assert isinstance(ctx.default_return_type, Instance) + + model_type = _extract_model_type_from_queryset(ctx.type) + if model_type is None: + return AnyType(TypeOfAny.from_omitted_generics) + + model_cls = django_context.get_model_class_by_fullname(model_type.type.fullname) + if model_cls is None: + return ctx.default_return_type + + field_lookups = resolve_field_lookups(ctx.args[0], django_context) + if field_lookups is None: + return AnyType(TypeOfAny.from_error) + + if len(field_lookups) == 0: + for field in django_context.get_model_fields(model_cls): + field_lookups.append(field.attname) + + column_types: 'OrderedDict[str, MypyType]' = OrderedDict() + for field_lookup in field_lookups: + field_lookup_type = get_field_type_from_lookup(ctx, django_context, model_cls, + lookup=field_lookup, method='values') + if field_lookup_type is None: + return helpers.reparametrize_instance(ctx.default_return_type, [model_type, AnyType(TypeOfAny.from_error)]) + + column_types[field_lookup] = field_lookup_type + + row_type = helpers.make_typeddict(ctx.api, column_types, set(column_types.keys())) + return helpers.reparametrize_instance(ctx.default_return_type, [model_type, row_type]) diff --git a/anaconda_lib/jedi/third_party/django-stubs/mypy_django_plugin/transformers/request.py b/anaconda_lib/jedi/third_party/django-stubs/mypy_django_plugin/transformers/request.py new file mode 100644 index 00000000..45b212d4 --- /dev/null +++ b/anaconda_lib/jedi/third_party/django-stubs/mypy_django_plugin/transformers/request.py @@ -0,0 +1,26 @@ +from mypy.plugin import AttributeContext +from mypy.types import Instance +from mypy.types import Type as MypyType +from mypy.types import UnionType + +from mypy_django_plugin.django.context import DjangoContext +from mypy_django_plugin.lib import helpers + + +def set_auth_user_model_as_type_for_request_user(ctx: AttributeContext, django_context: DjangoContext) -> MypyType: + auth_user_model = django_context.settings.AUTH_USER_MODEL + user_cls = django_context.apps_registry.get_model(auth_user_model) + user_info = helpers.lookup_class_typeinfo(helpers.get_typechecker_api(ctx), user_cls) + + if user_info is None: + return ctx.default_attr_type + + # Imported here because django isn't properly loaded yet when module is loaded + from django.contrib.auth.models import AnonymousUser + + anonymous_user_info = helpers.lookup_class_typeinfo(helpers.get_typechecker_api(ctx), AnonymousUser) + if anonymous_user_info is None: + # This shouldn't be able to happen, as we managed to import the model above... + return Instance(user_info, []) + + return UnionType([Instance(user_info, []), Instance(anonymous_user_info, [])]) diff --git a/anaconda_lib/jedi/third_party/django-stubs/mypy_django_plugin/transformers/settings.py b/anaconda_lib/jedi/third_party/django-stubs/mypy_django_plugin/transformers/settings.py new file mode 100644 index 00000000..ba6490b4 --- /dev/null +++ b/anaconda_lib/jedi/third_party/django-stubs/mypy_django_plugin/transformers/settings.py @@ -0,0 +1,50 @@ +from mypy.nodes import MemberExpr +from mypy.plugin import AttributeContext, FunctionContext +from mypy.types import AnyType, Instance +from mypy.types import Type as MypyType +from mypy.types import TypeOfAny, TypeType + +from mypy_django_plugin.django.context import DjangoContext +from mypy_django_plugin.lib import helpers + + +def get_user_model_hook(ctx: FunctionContext, django_context: DjangoContext) -> MypyType: + auth_user_model = django_context.settings.AUTH_USER_MODEL + model_cls = django_context.apps_registry.get_model(auth_user_model) + model_cls_fullname = helpers.get_class_fullname(model_cls) + + model_info = helpers.lookup_fully_qualified_typeinfo(helpers.get_typechecker_api(ctx), + model_cls_fullname) + if model_info is None: + return AnyType(TypeOfAny.unannotated) + + return TypeType(Instance(model_info, [])) + + +def get_type_of_settings_attribute(ctx: AttributeContext, django_context: DjangoContext) -> MypyType: + assert isinstance(ctx.context, MemberExpr) + setting_name = ctx.context.name + if not hasattr(django_context.settings, setting_name): + ctx.api.fail(f"'Settings' object has no attribute {setting_name!r}", ctx.context) + return ctx.default_attr_type + + typechecker_api = helpers.get_typechecker_api(ctx) + + # first look for the setting in the project settings file, then global settings + settings_module = typechecker_api.modules.get(django_context.django_settings_module) + global_settings_module = typechecker_api.modules.get('django.conf.global_settings') + for module in [settings_module, global_settings_module]: + if module is not None: + sym = module.names.get(setting_name) + if sym is not None and sym.type is not None: + return sym.type + + # if by any reason it isn't present there, get type from django settings + value = getattr(django_context.settings, setting_name) + value_fullname = helpers.get_class_fullname(value.__class__) + + value_info = helpers.lookup_fully_qualified_typeinfo(typechecker_api, value_fullname) + if value_info is None: + return ctx.default_attr_type + + return Instance(value_info, []) diff --git a/anaconda_lib/jedi/third_party/django-stubs/pytest.ini b/anaconda_lib/jedi/third_party/django-stubs/pytest.ini new file mode 100644 index 00000000..e918bd2b --- /dev/null +++ b/anaconda_lib/jedi/third_party/django-stubs/pytest.ini @@ -0,0 +1,9 @@ +[pytest] +testpaths = ./test-data +addopts = + --tb=native + -s + -v + --cache-clear + --mypy-ini-file=./test-data/plugins.ini + --mypy-extension-hook=scripts.tests_extension_hook.django_plugin_hook diff --git a/anaconda_lib/jedi/third_party/django-stubs/reformat.xsh b/anaconda_lib/jedi/third_party/django-stubs/reformat.xsh new file mode 100755 index 00000000..e53adf1e --- /dev/null +++ b/anaconda_lib/jedi/third_party/django-stubs/reformat.xsh @@ -0,0 +1,3 @@ +#!/usr/local/bin/xonsh + +black --line-length=120 django-stubs/ diff --git a/anaconda_lib/jedi/third_party/django-stubs/release.xsh b/anaconda_lib/jedi/third_party/django-stubs/release.xsh new file mode 100755 index 00000000..76d89f52 --- /dev/null +++ b/anaconda_lib/jedi/third_party/django-stubs/release.xsh @@ -0,0 +1,11 @@ +#!/usr/local/bin/xonsh + +try: + no_uncommitted_changes = bool(!(git diff-index --quiet HEAD --)) + if no_uncommitted_changes: + pip install wheel twine + python setup.py sdist bdist_wheel + twine upload dist/* + +finally: + rm -rf dist/ build/ \ No newline at end of file diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/bdist_packager.pyi b/anaconda_lib/jedi/third_party/django-stubs/scripts/__init__.py old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/bdist_packager.pyi rename to anaconda_lib/jedi/third_party/django-stubs/scripts/__init__.py diff --git a/anaconda_lib/jedi/third_party/django-stubs/scripts/build_import_all_test.py b/anaconda_lib/jedi/third_party/django-stubs/scripts/build_import_all_test.py new file mode 100644 index 00000000..012145b0 --- /dev/null +++ b/anaconda_lib/jedi/third_party/django-stubs/scripts/build_import_all_test.py @@ -0,0 +1,28 @@ +import os +from pathlib import Path +from typing import List + +STUBS_ROOT = Path(__file__).parent.parent / 'django-stubs' + + +def build_package_name(path: str) -> str: + return '.'.join(['django'] + list(Path(path).relative_to(STUBS_ROOT).with_suffix('').parts)) + + +packages: List[str] = [] +for dirpath, dirnames, filenames in os.walk(STUBS_ROOT): + if not dirnames: + package = build_package_name(dirpath) + packages.append(package) + + for filename in filenames: + if filename != '__init__.pyi': + package = build_package_name(os.path.join(dirpath, filename)) + packages.append(package) + +test_lines: List[str] = [] +for package in packages: + test_lines.append('import ' + package) + +test_contents = '\n'.join(sorted(test_lines)) +print(test_contents) diff --git a/anaconda_lib/jedi/third_party/django-stubs/scripts/catch_non_abstract_annotation.py b/anaconda_lib/jedi/third_party/django-stubs/scripts/catch_non_abstract_annotation.py new file mode 100644 index 00000000..df1417a1 --- /dev/null +++ b/anaconda_lib/jedi/third_party/django-stubs/scripts/catch_non_abstract_annotation.py @@ -0,0 +1,88 @@ +import os +from typing import Optional + +import libcst +from libcst import Annotation, BaseExpression, FunctionDef, Name, Subscript +from libcst.metadata import SyntacticPositionProvider + +BASE_DIR = 'django-stubs' + +fpath = os.path.join(BASE_DIR, 'core', 'checks', 'model_checks.pyi') +with open(fpath, 'r') as f: + contents = f.read() + + +tree = libcst.parse_module(contents) + + +class TypeAnnotationsAnalyzer(libcst.CSTVisitor): + METADATA_DEPENDENCIES = (SyntacticPositionProvider,) + + def __init__(self, fpath: str): + super().__init__() + self.fpath = fpath + + def get_node_location(self, node: FunctionDef) -> str: + start_line = self.get_metadata(SyntacticPositionProvider, node).start.line + return f'{self.fpath}:{start_line}' + + def show_error_for_node(self, node: FunctionDef, error_message: str): + print(self.get_node_location(node), error_message) + + def check_subscripted_annotation(self, annotation: BaseExpression) -> Optional[str]: + if isinstance(annotation, Subscript): + if isinstance(annotation.value, Name): + error_message = self.check_concrete_class_usage(annotation.value) + if error_message: + return error_message + + if annotation.value.value == 'Union': + for slice_param in annotation.slice: + if isinstance(slice_param.slice.value, Name): + error_message = self.check_concrete_class_usage(annotation.value) + if error_message: + return error_message + + def check_concrete_class_usage(self, name_node: Name) -> Optional[str]: + if name_node.value == 'List': + return (f'Concrete class {name_node.value!r} used for an iterable annotation. ' + f'Use abstract collection (Iterable, Collection, Sequence) instead') + + def visit_FunctionDef(self, node: FunctionDef) -> Optional[bool]: + params_node = node.params + for param_node in [*params_node.params, *params_node.default_params]: + param_name = param_node.name.value + annotation_node = param_node.annotation # type: Annotation + if annotation_node is not None: + annotation = annotation_node.annotation + if annotation.value == 'None': + self.show_error_for_node(node, f'"None" type annotation used for parameter {param_name!r}') + continue + + error_message = self.check_subscripted_annotation(annotation) + if error_message is not None: + self.show_error_for_node(node, error_message) + continue + + if node.returns is not None: + return_annotation = node.returns.annotation + if isinstance(return_annotation, Subscript) and return_annotation.value.value == 'Union': + self.show_error_for_node(node, 'Union is return type annotation') + + return False + + +for dirpath, dirnames, filenames in os.walk(BASE_DIR): + for filename in filenames: + fpath = os.path.join(dirpath, filename) + # skip all other checks for now, low priority + if not fpath.startswith(('django-stubs/db', 'django-stubs/views', 'django-stubs/apps', + 'django-stubs/http', 'django-stubs/contrib/postgres')): + continue + + with open(fpath, 'r') as f: + contents = f.read() + + tree = libcst.MetadataWrapper(libcst.parse_module(contents)) + analyzer = TypeAnnotationsAnalyzer(fpath) + tree.visit(analyzer) diff --git a/anaconda_lib/jedi/third_party/django-stubs/scripts/django_tests_settings.py b/anaconda_lib/jedi/third_party/django-stubs/scripts/django_tests_settings.py new file mode 100644 index 00000000..7ffe4795 --- /dev/null +++ b/anaconda_lib/jedi/third_party/django-stubs/scripts/django_tests_settings.py @@ -0,0 +1,233 @@ +import django + +SECRET_KEY = '1' +SITE_ID = 1 + +INSTALLED_APPS = [ + 'django.contrib.contenttypes', + 'django.contrib.auth', + 'django.contrib.sites', + 'django.contrib.sessions', + 'django.contrib.messages', + 'django.contrib.admin.apps.SimpleAdminConfig', + 'django.contrib.staticfiles', +] + +test_modules = [ + 'absolute_url_overrides', + 'admin_autodiscover', + 'admin_changelist', + 'admin_checks', + 'admin_custom_urls', + 'admin_default_site', + 'admin_docs', + 'admin_filters', + 'admin_inlines', + 'admin_ordering', + 'admin_registration', + 'admin_scripts', + 'admin_utils', + 'admin_views', + 'admin_widgets', + 'aggregation', + 'aggregation_regress', + 'annotations', + 'app_loading', + 'apps', + 'auth_tests', + 'backends', + 'base', + 'bash_completion', + 'basic', + 'builtin_server', + 'bulk_create', + 'cache', + 'check_framework', + 'conditional_processing', + 'constraints', + 'contenttypes_tests', + 'context_processors', + 'csrf_tests', + 'custom_columns', + 'custom_lookups', + 'custom_managers', + 'custom_methods', + 'custom_migration_operations', + 'custom_pk', + 'datatypes', + 'dates', + 'datetimes', + 'db_functions', + 'db_typecasts', + 'db_utils', + 'dbshell', + 'decorators', + 'defer', + 'defer_regress', + 'delete', + 'delete_regress', + 'deprecation', + 'dispatch', + 'distinct_on_fields', + 'empty', + 'expressions', + 'expressions_case', + 'expressions_window', + 'extra_regress', + 'field_deconstruction', + 'field_defaults', + 'field_subclassing', + 'file_storage', + 'file_uploads', + 'files', + 'filtered_relation', + 'fixtures', + 'fixtures_model_package', + 'fixtures_regress', + 'flatpages_tests', + 'force_insert_update', + 'foreign_object', + 'forms_tests', + 'from_db_value', + 'generic_inline_admin', + 'generic_relations', + 'generic_relations_regress', + 'generic_views', + 'get_earliest_or_latest', + 'get_object_or_404', + 'get_or_create', + 'gis_tests', + 'handlers', + 'httpwrappers', + 'humanize_tests', + 'i18n', + 'import_error_package', + 'indexes', + 'inline_formsets', + 'inspectdb', + 'introspection', + 'invalid_models_tests', + 'known_related_objects', + 'logging_tests', + 'lookup', + 'm2m_and_m2o', + 'm2m_intermediary', + 'm2m_multiple', + 'm2m_recursive', + 'm2m_regress', + 'm2m_signals', + 'm2m_through', + 'm2m_through_regress', + 'm2o_recursive', + 'mail', + 'managers_regress', + 'many_to_many', + 'many_to_one', + 'many_to_one_null', + 'max_lengths', + 'messages_tests', + 'middleware', + 'middleware_exceptions', + 'migrate_signals', + 'migration_test_data_persistence', + 'migrations', + 'migrations2', + 'model_fields', + 'model_forms', + 'model_formsets', + 'model_formsets_regress', + 'model_indexes', + 'model_inheritance', + 'model_inheritance_regress', + 'model_meta', + 'model_options', + 'model_package', + 'model_regress', + 'modeladmin', + 'multiple_database', + 'mutually_referential', + 'nested_foreign_keys', + 'no_models', + 'null_fk', + 'null_fk_ordering', + 'null_queries', + 'one_to_one', + 'or_lookups', + 'order_with_respect_to', + 'ordering', + 'pagination', + 'postgres_tests', + 'prefetch_related', + 'project_template', + 'properties', + 'proxy_model_inheritance', + 'proxy_models', + 'queries', + 'queryset_pickle', + 'raw_query', + 'redirects_tests', + 'requests', + 'reserved_names', + 'resolve_url', + 'responses', + 'reverse_lookup', + 'save_delete_hooks', + 'schema', + 'select_for_update', + 'select_related', + 'select_related_onetoone', + 'select_related_regress', + 'serializers', + 'servers', + 'sessions_tests', + 'settings_tests', + 'shell', + 'shortcuts', + 'signals', + 'signed_cookies_tests', + 'signing', + 'sitemaps_tests', + 'sites_framework', + 'sites_tests', + 'staticfiles_tests', + 'str', + 'string_lookup', + 'swappable_models', + 'syndication_tests', + 'template_backends', + 'template_loader', + 'template_tests', + 'test_client', + 'test_client_regress', + 'test_exceptions', + 'test_runner', + 'test_runner_apps', + 'test_utils', + 'timezones', + 'transaction_hooks', + 'transactions', + 'unmanaged_models', + 'update', + 'update_only_fields', + 'urlpatterns', + 'urlpatterns_reverse', + 'user_commands', + 'utils_tests', + 'validation', + 'validators', + 'version', + 'view_tests', + 'wsgi', +] + +if django.VERSION[0] == 2: + test_modules += ['choices'] + +invalid_apps = { + 'import_error_package', +} + +for app in invalid_apps: + test_modules.remove(app) + +INSTALLED_APPS += test_modules diff --git a/anaconda_lib/jedi/third_party/django-stubs/scripts/enabled_test_modules.py b/anaconda_lib/jedi/third_party/django-stubs/scripts/enabled_test_modules.py new file mode 100644 index 00000000..49e519e6 --- /dev/null +++ b/anaconda_lib/jedi/third_party/django-stubs/scripts/enabled_test_modules.py @@ -0,0 +1,508 @@ +# Some errors occur for the test suite itself, and cannot be addressed via django-stubs. They should be ignored +# using this constant. +import re + +IGNORED_MODULES = {'schema', 'gis_tests', 'admin_widgets', 'admin_filters', + 'sitemaps_tests', 'staticfiles_tests', 'modeladmin', + 'generic_views', 'forms_tests', 'flatpages_tests', + 'admin_ordering', 'admin_changelist', 'admin_views', + 'invalid_models_tests', 'i18n', 'model_formsets', + 'template_tests', 'template_backends', 'test_runner', 'admin_scripts', + 'inline_formsets', 'foreign_object', 'cache'} + +MOCK_OBJECTS = ['MockRequest', 'MockCompiler', 'MockModelAdmin', 'modelz', 'call_count', 'call_args_list', + 'call_args', 'MockUser', 'Xtemplate', 'DummyRequest', 'DummyUser', 'MinimalUser', 'DummyNode'] +EXTERNAL_MODULES = ['psycopg2', 'PIL', 'selenium', 'oracle', 'mysql', 'sqlparse', 'tblib', 'numpy', + 'bcrypt', 'argon2', 'xml.dom'] +IGNORED_ERRORS = { + '__common__': [ + *MOCK_OBJECTS, + *EXTERNAL_MODULES, + 'Need type annotation for', + 'has no attribute "getvalue"', + 'Cannot assign to a method', + 'already defined', + 'Cannot assign to a type', + '"HttpResponseBase" has no attribute', + '"object" has no attribute', + re.compile(r'"Callable\[.+, Any\]" has no attribute'), + 'has no attribute "deconstruct"', + # private members + re.compile(r'has no attribute ("|\')_[a-zA-Z_]+("|\')'), + "'Settings' object has no attribute", + '**Dict', + 'has incompatible type "object"', + 'undefined in superclass', + 'Argument after ** must be a mapping', + 'note:', + re.compile(r'Item "None" of "[a-zA-Z_ ,\[\]]+" has no attribute'), + '"Callable[..., None]" has no attribute', + 'does not return a value', + 'has no attribute "alternatives"', + 'gets multiple values for keyword argument', + '"Handler" has no attribute', + 'Module has no attribute', + 'namedtuple', + # TODO: see test in managers/test_managers.yml + "Cannot determine type of", + 'cache_clear', + 'cache_info', + 'Incompatible types in assignment (expression has type "None", variable has type Module)', + "Module 'django.contrib.messages.storage.fallback' has no attribute 'CookieStorage'", + # TODO: not supported yet + 'GenericRelation', + 'RelatedObjectDoesNotExist', + re.compile(r'"Field\[Any, Any\]" has no attribute ' + r'"(through|field_name|field|get_related_field|related_model|related_name' + r'|get_accessor_name|empty_strings_allowed|many_to_many)"'), + # TODO: multitable inheritance + 'ptr', + 'Incompatible types in assignment (expression has type "Callable[', + 'SimpleLazyObject', + 'Test', + 'Mixin" has no attribute', + 'Incompatible types in string interpolation', + '"None" has no attribute', + 'has no attribute "assert', + 'Unsupported dynamic base class', + 'error: "HttpResponse" has no attribute "streaming_content"', + 'error: "HttpResponse" has no attribute "context_data"', + ], + 'admin_inlines': [ + 'error: "HttpResponse" has no attribute "rendered_content"', + ], + 'admin_utils': [ + '"Article" has no attribute "non_field"', + ], + 'aggregation': [ + re.compile(r'got "Optional\[(Author|Publisher)\]", expected "Union\[(Author|Publisher), Combinable\]"'), + 'Argument 2 for "super" not an instance of argument 1', + ], + 'annotations': [ + 'Incompatible type for "store" of "Employee" (got "Optional[Store]", expected "Union[Store, Combinable]")' + ], + 'apps': [ + 'Incompatible types in assignment (expression has type "str", target has type "type")', + ], + 'auth_tests': [ + '"PasswordValidator" has no attribute "min_length"', + 'AbstractBaseUser', + 'Argument "password_validators" to "password_changed" has incompatible type "Tuple[Validator]"; ' + + 'expected "Optional[Sequence[PasswordValidator]]"', + 'Unsupported right operand type for in ("object")', + 'mock_getpass', + 'Unsupported left operand type for + ("Sequence[str]")', + 'AuthenticationFormWithInactiveUsersOkay', + 'Incompatible types in assignment (expression has type "Dict[str, Any]", variable has type "QueryDict")', + 'No overload variant of "int" matches argument type "AnonymousUser"', + 'expression has type "AnonymousUser", variable has type "User"', + ], + 'basic': [ + 'Unexpected keyword argument "unknown_kwarg" for "refresh_from_db" of "Model"', + 'Unexpected attribute "foo" for model "Article"', + 'has no attribute "touched"', + 'Incompatible types in assignment (expression has type "Type[CustomQuerySet]"', + '"Manager[Article]" has no attribute "do_something"', + ], + 'backends': [ + '"DatabaseError" has no attribute "pgcode"' + ], + 'builtin_server': [ + '"ServerHandler" has no attribute', + 'Incompatible types in assignment (expression has type "Tuple[BytesIO, BytesIO]"', + ], + 'bulk_create': [ + 'has incompatible type "List[Country]"; expected "Iterable[TwoFields]"', + 'List item 1 has incompatible type "Country"; expected "ProxyCountry"', + ], + 'check_framework': [ + 'base class "Model" defined the type as "Callable', + 'Value of type "Collection[str]" is not indexable', + 'Unsupported target for indexed assignment', + ], + 'constraints': [ + 'Argument "condition" to "UniqueConstraint" has incompatible type "str"; expected "Optional[Q]"' + ], + 'contenttypes_tests': [ + '"FooWithBrokenAbsoluteUrl" has no attribute "unknown_field"', + 'contenttypes_tests.models.Site', + 'Argument 1 to "set" of "RelatedManager" has incompatible type "SiteManager[Site]"', + ], + 'custom_lookups': [ + 'in base class "SQLFuncMixin"', + 'has no attribute "name"', + ], + 'custom_columns': [ + "Cannot resolve keyword 'firstname' into field", + ], + 'custom_pk': [ + '"Employee" has no attribute "id"', + ], + 'custom_managers': [ + 'Incompatible types in assignment (expression has type "CharField', + 'Item "Book" of "Optional[Book]" has no attribute "favorite_avg"', + ], + 'csrf_tests': [ + 'expression has type "property", base class "HttpRequest" defined the type as "QueryDict"', + 'expression has type "Dict[, ]", variable has type "SessionBase"', + ], + 'dates': [ + 'Too few arguments for "dates" of', + ], + 'dbshell': [ + 'Incompatible types in assignment (expression has type "None"', + ], + 'defer': [ + 'Too many arguments for "refresh_from_db" of "Model"' + ], + 'delete': [ + 'Incompatible type for lookup \'pk\': (got "Optional[int]", expected "Union[str, int]")', + ], + 'dispatch': [ + 'Item "str" of "Union[ValueError, str]" has no attribute "args"' + ], + 'deprecation': [ + '"Manager" has no attribute "old"', + '"Manager" has no attribute "new"' + ], + 'db_functions': [ + '"FloatModel" has no attribute', + 'Incompatible types in assignment (expression has type "Optional[Any]", variable has type "FloatModel")' + ], + 'decorators': [ + '"Type[object]" has no attribute "method"', + 'Value of type variable "_T" of function cannot be "descriptor_wrapper"' + ], + 'expressions_window': [ + 'has incompatible type "str"' + ], + 'file_uploads': [ + 'has no attribute "content_type"', + ], + 'file_storage': [ + 'Incompatible types in assignment (expression has type "None", variable has type "str")', + 'Property "base_url" defined in "FileSystemStorage" is read-only', + ], + 'files': [ + 'Incompatible types in assignment (expression has type "IOBase", variable has type "File")', + 'Argument 1 to "TextIOWrapper" has incompatible type "File"; expected "BinaryIO"', + 'Incompatible types in assignment (expression has type "BinaryIO", variable has type "File")', + ], + 'filtered_relation': [ + 'has no attribute "name"', + ], + 'fixtures': [ + 'Incompatible types in assignment (expression has type "int", target has type "Iterable[str]")', + 'Incompatible types in assignment (expression has type "SpyManager[Spy]"', + ], + 'fixtures_regress': [ + 'Unsupported left operand type for + ("None")', + ], + 'from_db_value': [ + '"Cash" has no attribute', + '"__str__" of "Decimal"', + ], + 'get_object_or_404': [ + 'Argument 1 to "get_object_or_404" has incompatible type "str"; ' + + 'expected "Union[Type[], QuerySet[]]"', + 'Argument 1 to "get_list_or_404" has incompatible type "List[Type[Article]]"; ' + + 'expected "Union[Type[], QuerySet[]]"', + 'CustomClass', + ], + 'generic_relations': [ + "Cannot resolve keyword 'vegetable' into field", + ], + 'generic_relations_regress': [ + '"Link" has no attribute', + ], + 'httpwrappers': [ + 'Argument 2 to "appendlist" of "QueryDict"', + 'Incompatible types in assignment (expression has type "int", target has type "Union[str, List[str]]")', + 'Argument 1 to "fromkeys" of "QueryDict" has incompatible type "int"', + ], + 'humanize_tests': [ + 'Argument 1 to "append" of "list" has incompatible type "None"; expected "str"', + ], + 'lookup': [ + 'Unexpected keyword argument "headline__startswith" for "in_bulk" of', + 'is called with more than one field', + "Cannot resolve keyword 'pub_date_year' into field", + "Cannot resolve keyword 'blahblah' into field", + ], + 'logging_tests': [ + re.compile(r'Argument [0-9] to "makeRecord" of "Logger"'), + '"LogRecord" has no attribute "request"', + ], + 'm2m_regress': [ + "Cannot resolve keyword 'porcupine' into field", + 'Argument 1 to "set" of "RelatedManager" has incompatible type "int"', + ], + 'mail': [ + 'List item 1 has incompatible type "None"; expected "str"', + 'Incompatible types in assignment ' + + '(expression has type "bool", variable has type "Union[SMTP_SSL, SMTP, None]")', + ], + 'messages_tests': [ + 'List item 0 has incompatible type "Dict[str, Message]"; expected "Message"', + 'Too many arguments', + 'CustomRequest', + ], + 'middleware': [ + re.compile(r'"(HttpRequest|WSGIRequest)" has no attribute'), + 'Incompatible types in assignment (expression has type "HttpResponseBase", variable has type "HttpResponse")', + ], + 'many_to_many': [ + '(expression has type "List[Article]", variable has type "Article_RelatedManager2', + '"add" of "RelatedManager" has incompatible type "Article"; expected "Union[Publication, int]"', + ], + 'many_to_one': [ + 'Incompatible type for "parent" of "Child" (got "None", expected "Union[Parent, Combinable]")', + 'Incompatible type for "parent" of "Child" (got "Child", expected "Union[Parent, Combinable]")', + 'expression has type "List[]", variable has type "RelatedManager[Article]"', + '"Reporter" has no attribute "cached_query"', + 'to "add" of "RelatedManager" has incompatible type "Reporter"; expected "Union[Article, int]"', + ], + 'middleware_exceptions': [ + 'Argument 1 to "append" of "list" has incompatible type "Tuple[Any, Any]"; expected "str"' + ], + 'migrate_signals': [ + 'Value of type "Optional[Any]" is not indexable', + 'Argument 1 to "set" has incompatible type "Optional[Any]"; expected "Iterable[Any]"', + ], + 'migrations': [ + 'FakeMigration', + 'FakeLoader', + '"Manager[Any]" has no attribute "args"', + 'Dict entry 0 has incompatible type "Any"', + 'Argument 1 to "append" of "list" has incompatible type', + 'base class "Model" defined the type as "BaseManager[Any]"', + 'Argument 1 to "RunPython" has incompatible type "str"', + + ], + 'model_fields': [ + 'Item "Field[Any, Any]" of "Union[Field[Any, Any], ForeignObjectRel]" has no attribute', + 'Incompatible types in assignment (expression has type "Type[Person', + 'Incompatible types in assignment (expression has type "FloatModel", variable has type', + '"ImageFile" has no attribute "was_opened"', + 'Incompatible type for "size" of "FloatModel" (got "object", expected "Union[float, int, str, Combinable]")', + 'Incompatible type for "value" of "IntegerModel" (got "object", expected', + '"Child" has no attribute "get_foo_display"', + ], + 'model_forms': [ + '"render" of "Widget"', + "Module 'django.core.validators' has no attribute 'ValidationError'", + 'Incompatible types in assignment', + 'NewForm', + '"type" has no attribute "base_fields"', + 'Argument "instance" to "InvalidModelForm" has incompatible type "Type[Category]"', + ], + 'model_indexes': [ + 'Argument "condition" to "Index" has incompatible type "str"; expected "Optional[Q]"' + ], + 'model_inheritance': [ + 'base class "AbstractBase" defined', + 'base class "AbstractModel" defined', + 'Definition of "name" in base class "ConcreteParent"', + ' Definition of "name" in base class "AbstractParent"', + 'referent_references', + "Cannot resolve keyword 'attached_comment_set' into field" + ], + 'model_meta': [ + 'List item 0 has incompatible type "str"; expected "Union[Field[Any, Any], ForeignObjectRel]"' + ], + 'model_regress': [ + 'Incompatible type for "department" of "Worker"', + '"PickledModel" has no attribute', + '"Department" has no attribute "evaluate"', + 'Unsupported target for indexed assignment', + ], + 'model_formsets_regress': [ + 'Incompatible types in assignment (expression has type "int", target has type "str")', + ], + 'model_options': [ + 'expression has type "Dict[str, Type[Model]]", target has type "OrderedDict', + ], + 'model_enums': [ + "'bool' is not a valid base class", + ], + 'null_queries': [ + "Cannot resolve keyword 'foo' into field" + ], + 'order_with_respect_to': [ + '"Dimension" has no attribute "set_component_order"', + ], + 'one_to_one': [ + 'expression has type "None", variable has type "UndergroundBar"', + 'Item "OneToOneField[Union[Place, Combinable], Place]" ' + + 'of "Union[OneToOneField[Union[Place, Combinable], Place], Any]"', + ], + 'pagination': [ + '"int" not callable', + ], + 'postgres_tests': [ + 'DummyArrayField', + 'DummyJSONField', + 'Incompatible types in assignment (expression has type "Type[Field[Any, Any]]', + 'Argument "encoder" to "JSONField" has incompatible type "DjangoJSONEncoder";', + '("None" and "SearchQuery")', + ], + 'properties': [ + re.compile('Unexpected attribute "(full_name|full_name_2)" for model "Person"') + ], + 'prefetch_related': [ + '"Person" has no attribute "houses_lst"', + '"Book" has no attribute "first_authors"', + '"Book" has no attribute "the_authors"', + 'Incompatible types in assignment (expression has type "List[Room]", variable has type "Manager[Room]")', + 'Item "Room" of "Optional[Room]" has no attribute "house_attr"', + 'Item "Room" of "Optional[Room]" has no attribute "main_room_of_attr"', + 'Argument 2 to "Prefetch" has incompatible type "ValuesQuerySet' + ], + 'proxy_models': [ + 'Incompatible types in assignment', + 'in base class "User"' + ], + 'queries': [ + 'Incompatible types in assignment (expression has type "None", variable has type "str")', + 'Invalid index type "Optional[str]" for "Dict[str, int]"; expected type "str"', + 'Unsupported operand types for & ("Manager[Author]" and "Manager[Tag]")', + 'Unsupported operand types for | ("Manager[Author]" and "Manager[Tag]")', + 'ObjectA', + "'flat' and 'named' can't be used together", + '"Collection[Any]" has no attribute "explain"', + "Cannot resolve keyword 'unknown_field' into field", + 'Incompatible type for lookup \'tag\': (got "str", expected "Union[Tag, int, None]")', + 'No overload variant of "__getitem__" of "QuerySet" matches argument type "str"', + ], + 'requests': [ + 'Incompatible types in assignment (expression has type "Dict[str, str]", variable has type "QueryDict")' + ], + 'responses': [ + 'Argument 1 to "TextIOWrapper" has incompatible type "HttpResponse"; expected "IO[bytes]"', + '"FileLike" has no attribute "closed"', + 'Argument 1 to "TextIOWrapper" has incompatible type "HttpResponse"; expected "BinaryIO"', + ], + 'reverse_lookup': [ + "Cannot resolve keyword 'choice' into field" + ], + 'settings_tests': [ + 'Argument 1 to "Settings" has incompatible type "Optional[str]"; expected "str"' + ], + 'shortcuts': [ + 'error: "Context" has no attribute "request"', + ], + 'signals': [ + 'Argument 1 to "append" of "list" has incompatible type "Tuple[Any, Any, Optional[Any], Any]";' + ], + 'sites_framework': [ + 'expression has type "CurrentSiteManager[CustomArticle]", base class "AbstractArticle"', + "Name 'Optional' is not defined", + ], + 'sites_tests': [ + '"RequestSite" of "Union[Site, RequestSite]" has no attribute "id"', + ], + 'syndication_tests': [ + 'Argument 1 to "add_domain" has incompatible type "*Tuple[object, ...]"', + ], + 'sessions_tests': [ + 'Incompatible types in assignment (expression has type "None", variable has type "int")', + '"AbstractBaseSession" has no attribute', + '"None" not callable', + ], + 'select_related': [ + 'Item "ForeignKey[Union[Genus, Combinable], Genus]" ' + + 'of "Union[ForeignKey[Union[Genus, Combinable], Genus], Any]"' + ], + 'select_related_onetoone': [ + 'Incompatible types in assignment (expression has type "Parent2", variable has type "Parent1")', + '"Parent1" has no attribute' + ], + 'servers': [ + re.compile('Argument [0-9] to "WSGIRequestHandler"'), + '"HTTPResponse" has no attribute', + '"type" has no attribute', + '"WSGIRequest" has no attribute "makefile"', + 'LiveServerAddress', + '"Stub" has no attribute "makefile"', + ], + 'serializers': [ + '"Model" has no attribute "data"', + '"Iterable[Any]" has no attribute "content"', + re.compile(r'Argument 1 to "(serialize|deserialize)" has incompatible type "None"; expected "str"') + ], + 'string_lookup': [ + '"Bar" has no attribute "place"', + ], + 'test_utils': [ + '"PossessedCar" has no attribute "color"', + 'expression has type "None", variable has type "List[str]"', + ], + 'test_client': [ + '(expression has type "HttpResponse", variable has type "StreamingHttpResponse")' + ], + 'test_client_regress': [ + '(expression has type "Dict[, ]", variable has type "SessionBase")', + 'Unsupported left operand type for + ("None")', + 'Argument 1 to "len" has incompatible type "Context"; expected "Sized"', + ], + 'transactions': [ + 'Incompatible types in assignment (expression has type "Thread", variable has type "Callable[[], Any]")' + ], + 'urlpatterns': [ + '"object" not callable', + '"None" not callable', + ], + 'urlpatterns_reverse': [ + 'List or tuple expected as variable arguments', + 'No overload variant of "zip" matches argument types "Any", "object"', + 'Argument 1 to "get_callable" has incompatible type "int"' + ], + 'utils_tests': [ + 'Argument 1 to "activate" has incompatible type "None"; expected "Union[tzinfo, str]"', + 'Argument 1 to "activate" has incompatible type "Optional[str]"; expected "str"', + 'Incompatible types in assignment (expression has type "None", base class "object" defined the type as', + 'Class', + 'has no attribute "cp"', + 'Argument "name" to "cached_property" has incompatible type "int"; expected "Optional[str]"', + 'has no attribute "sort"', + 'Unsupported target for indexed assignment', + 'defined the type as "None"', + 'Argument 1 to "Path" has incompatible type "Optional[str]"', + '"None" not callable', + '"WSGIRequest" has no attribute "process_response_content"', + 'No overload variant of "join" matches argument types "str", "None"', + 'Argument 1 to "Archive" has incompatible type "None"; expected "str"', + 'Argument 1 to "to_path" has incompatible type "int"; expected "Union[Path, str]"', + 'Cannot infer type argument 1 of "cached_property"', + ], + 'view_tests': [ + "Module 'django.views.debug' has no attribute 'Path'", + 'Value of type "Optional[List[str]]" is not indexable', + 'ExceptionUser', + 'view_tests.tests.test_debug.User', + 'Exception must be derived from BaseException', + "No binding for nonlocal 'tb_frames' found", + ], + 'validation': [ + 'has no attribute "name"', + ], + 'wsgi': [ + '"HttpResponse" has no attribute "block_size"', + ], +} + + +def check_if_custom_ignores_are_covered_by_common() -> None: + from scripts.typecheck_tests import is_pattern_fits + + common_ignore_patterns = IGNORED_ERRORS['__common__'] + for module_name, patterns in IGNORED_ERRORS.items(): + if module_name == '__common__': + continue + for pattern in patterns: + for common_pattern in common_ignore_patterns: + if isinstance(pattern, str) and is_pattern_fits(common_pattern, pattern): + print(f'pattern "{module_name}: {pattern!r}" is covered by pattern {common_pattern!r}') + + +check_if_custom_ignores_are_covered_by_common() diff --git a/anaconda_lib/jedi/third_party/django-stubs/scripts/mypy.ini b/anaconda_lib/jedi/third_party/django-stubs/scripts/mypy.ini new file mode 100644 index 00000000..a76ccaa3 --- /dev/null +++ b/anaconda_lib/jedi/third_party/django-stubs/scripts/mypy.ini @@ -0,0 +1,14 @@ +[mypy] +strict_optional = True +ignore_missing_imports = True +check_untyped_defs = True +warn_no_return = False +show_traceback = True +allow_redefinition = True +incremental = True + +plugins = + mypy_django_plugin.main + +[mypy.plugins.django-stubs] +django_settings_module = 'scripts.django_tests_settings' diff --git a/anaconda_lib/jedi/third_party/django-stubs/scripts/tests_extension_hook.py b/anaconda_lib/jedi/third_party/django-stubs/scripts/tests_extension_hook.py new file mode 100644 index 00000000..228cc767 --- /dev/null +++ b/anaconda_lib/jedi/third_party/django-stubs/scripts/tests_extension_hook.py @@ -0,0 +1,30 @@ +from pytest_mypy_plugins.collect import File +from pytest_mypy_plugins.item import YamlTestItem + + +def django_plugin_hook(test_item: YamlTestItem) -> None: + custom_settings = test_item.parsed_test_data.get('custom_settings', '') + installed_apps = test_item.parsed_test_data.get('installed_apps', None) + + if installed_apps and custom_settings: + raise ValueError('"installed_apps" and "custom_settings" are not compatible, please use one or the other') + + if installed_apps is not None: + # custom_settings is empty, add INSTALLED_APPS + installed_apps += ['django.contrib.contenttypes'] + installed_apps_as_str = '(' + ','.join([repr(app) for app in installed_apps]) + ',)' + custom_settings += 'INSTALLED_APPS = ' + installed_apps_as_str + + if 'SECRET_KEY' not in custom_settings: + custom_settings = 'SECRET_KEY = "1"\n' + custom_settings + + django_settings_section = "\n[mypy.plugins.django-stubs]\n" \ + "django_settings_module = mysettings" + if not test_item.additional_mypy_config: + test_item.additional_mypy_config = django_settings_section + else: + if '[mypy.plugins.django-stubs]' not in test_item.additional_mypy_config: + test_item.additional_mypy_config += django_settings_section + + mysettings_file = File(path='mysettings.py', content=custom_settings) + test_item.files.append(mysettings_file) diff --git a/anaconda_lib/jedi/third_party/django-stubs/scripts/typecheck_tests.py b/anaconda_lib/jedi/third_party/django-stubs/scripts/typecheck_tests.py new file mode 100644 index 00000000..bdc58a29 --- /dev/null +++ b/anaconda_lib/jedi/third_party/django-stubs/scripts/typecheck_tests.py @@ -0,0 +1,162 @@ +import itertools +import shutil +import subprocess +import sys +from argparse import ArgumentParser +from collections import defaultdict +from pathlib import Path +from typing import Dict, List, Pattern, Tuple, Union + +from git import RemoteProgress, Repo + +from scripts.enabled_test_modules import ( + EXTERNAL_MODULES, IGNORED_ERRORS, IGNORED_MODULES, MOCK_OBJECTS, +) + +DJANGO_COMMIT_REFS: Dict[str, Tuple[str, str]] = { + '2.2': ('stable/2.2.x', '996be04c3ceb456754d9d527d4d708f30727f07e'), + '3.0': ('stable/3.0.x', 'd9f1792c7649e9f946f4a3a35a76bddf5a412b8b') +} +PROJECT_DIRECTORY = Path(__file__).parent.parent +DJANGO_SOURCE_DIRECTORY = PROJECT_DIRECTORY / 'django-sources' # type: Path + + +def get_unused_ignores(ignored_message_freq: Dict[str, Dict[Union[str, Pattern], int]]) -> List[str]: + unused_ignores = [] + for root_key, patterns in IGNORED_ERRORS.items(): + for pattern in patterns: + if (ignored_message_freq[root_key][pattern] == 0 + and pattern not in itertools.chain(EXTERNAL_MODULES, MOCK_OBJECTS)): + unused_ignores.append(f'{root_key}: {pattern}') + return unused_ignores + + +def is_pattern_fits(pattern: Union[Pattern, str], line: str): + if isinstance(pattern, Pattern): + if pattern.search(line): + return True + else: + if pattern in line: + return True + return False + + +def is_ignored(line: str, test_folder_name: str, *, ignored_message_freqs: Dict[str, Dict[str, int]]) -> bool: + if 'runtests' in line: + return True + + if test_folder_name in IGNORED_MODULES: + return True + + for pattern in IGNORED_ERRORS.get(test_folder_name, []): + if is_pattern_fits(pattern, line): + ignored_message_freqs[test_folder_name][pattern] += 1 + return True + + for pattern in IGNORED_ERRORS['__common__']: + if is_pattern_fits(pattern, line): + ignored_message_freqs['__common__'][pattern] += 1 + return True + + return False + + +def replace_with_clickable_location(error: str, abs_test_folder: Path) -> str: + raw_path, _, error_line = error.partition(': ') + fname, _, line_number = raw_path.partition(':') + + try: + path = abs_test_folder.joinpath(fname).relative_to(PROJECT_DIRECTORY) + except ValueError: + # fail on travis, just show an error + return error + + clickable_location = f'./{path}:{line_number or 1}' + return error.replace(raw_path, clickable_location) + + +class ProgressPrinter(RemoteProgress): + def line_dropped(self, line: str) -> None: + print(line) + + def update(self, op_code, cur_count, max_count=None, message=''): + print(self._cur_line) + + +def get_django_repo_object(branch: str) -> Repo: + if not DJANGO_SOURCE_DIRECTORY.exists(): + DJANGO_SOURCE_DIRECTORY.mkdir(exist_ok=True, parents=False) + return Repo.clone_from('https://github.com/django/django.git', DJANGO_SOURCE_DIRECTORY, + progress=ProgressPrinter(), + branch=branch, + depth=100) + else: + repo = Repo(DJANGO_SOURCE_DIRECTORY) + return repo + + +if __name__ == '__main__': + parser = ArgumentParser() + parser.add_argument('--django_version', choices=['2.2', '3.0'], required=True) + args = parser.parse_args() + + # install proper Django version + subprocess.check_call([sys.executable, '-m', 'pip', 'install', f'Django=={args.django_version}.*']) + + branch, commit_sha = DJANGO_COMMIT_REFS[args.django_version] + repo = get_django_repo_object(branch) + if repo.head.commit.hexsha != commit_sha: + repo.remote('origin').fetch(branch, progress=ProgressPrinter(), depth=100) + repo.git.checkout(commit_sha) + + mypy_config_file = (PROJECT_DIRECTORY / 'scripts' / 'mypy.ini').absolute() + mypy_cache_dir = Path(__file__).parent / '.mypy_cache' + tests_root = DJANGO_SOURCE_DIRECTORY / 'tests' + global_rc = 0 + + try: + mypy_options = ['--cache-dir', str(mypy_config_file.parent / '.mypy_cache'), + '--config-file', str(mypy_config_file), + '--show-traceback', + '--no-error-summary', + '--hide-error-context' + ] + mypy_options += [str(tests_root)] + + import distutils.spawn + + mypy_executable = distutils.spawn.find_executable('mypy') + mypy_argv = [mypy_executable, *mypy_options] + completed = subprocess.run( + mypy_argv, + env={'PYTHONPATH': str(tests_root)}, + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT, + ) + output = completed.stdout.decode() + + ignored_message_freqs = defaultdict(lambda: defaultdict(int)) + + sorted_lines = sorted(output.splitlines()) + for line in sorted_lines: + try: + path_to_error = line.split(':')[0] + test_folder_name = path_to_error.split('/')[2] + except IndexError: + test_folder_name = 'unknown' + + if not is_ignored(line, test_folder_name, + ignored_message_freqs=ignored_message_freqs): + global_rc = 1 + print(line) + + unused_ignores = get_unused_ignores(ignored_message_freqs) + if unused_ignores: + print('UNUSED IGNORES ------------------------------------------------') + print('\n'.join(unused_ignores)) + + sys.exit(global_rc) + + except BaseException as exc: + shutil.rmtree(mypy_cache_dir, ignore_errors=True) + raise exc diff --git a/anaconda_lib/jedi/third_party/django-stubs/setup.cfg b/anaconda_lib/jedi/third_party/django-stubs/setup.cfg new file mode 100644 index 00000000..5e7cd6d6 --- /dev/null +++ b/anaconda_lib/jedi/third_party/django-stubs/setup.cfg @@ -0,0 +1,19 @@ +[isort] +skip = + django-sources + django-stubs + test-data +include_trailing_comma = true +multi_line_output = 5 +wrap_length = 120 +known_first_party = mypy_django_plugin + +[flake8] +exclude = + django-sources + django-stubs + test-data +max_line_length = 120 + +[metadata] +license_file = LICENSE.txt diff --git a/anaconda_lib/jedi/third_party/django-stubs/setup.py b/anaconda_lib/jedi/third_party/django-stubs/setup.py new file mode 100644 index 00000000..3a9d8276 --- /dev/null +++ b/anaconda_lib/jedi/third_party/django-stubs/setup.py @@ -0,0 +1,54 @@ +import os +from distutils.core import setup +from typing import List + +from setuptools import find_packages + + +def find_stub_files(name: str) -> List[str]: + result = [] + for root, dirs, files in os.walk(name): + for file in files: + if file.endswith('.pyi'): + if os.path.sep in root: + sub_root = root.split(os.path.sep, 1)[-1] + file = os.path.join(sub_root, file) + result.append(file) + return result + + +with open('README.md', 'r') as f: + readme = f.read() + +dependencies = [ + 'mypy>=0.780,<0.790', + 'typing-extensions', + 'django', +] + +setup( + name="django-stubs", + version="1.5.0", + description='Mypy stubs for Django', + long_description=readme, + long_description_content_type='text/markdown', + license='MIT', + url="https://github.com/typeddjango/django-stubs", + author="Maksim Kurnikov", + author_email="maxim.kurnikov@gmail.com", + py_modules=[], + python_requires='>=3.6', + install_requires=dependencies, + packages=['django-stubs', *find_packages(exclude=['scripts'])], + package_data={'django-stubs': find_stub_files('django-stubs')}, + classifiers=[ + 'Development Status :: 3 - Alpha', + 'License :: OSI Approved :: MIT License', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8' + ], + project_urls={ + 'Release notes': 'https://github.com/typeddjango/django-stubs/releases', + }, +) diff --git a/anaconda_lib/jedi/third_party/django-stubs/test-data/plugins.ini b/anaconda_lib/jedi/third_party/django-stubs/test-data/plugins.ini new file mode 100644 index 00000000..b7b510bb --- /dev/null +++ b/anaconda_lib/jedi/third_party/django-stubs/test-data/plugins.ini @@ -0,0 +1,5 @@ +[mypy] +incremental = True +strict_optional = True +plugins = + mypy_django_plugin.main diff --git a/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/contrib/admin/test_options.yml b/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/contrib/admin/test_options.yml new file mode 100644 index 00000000..ebcc3fe9 --- /dev/null +++ b/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/contrib/admin/test_options.yml @@ -0,0 +1,126 @@ +# "Happy path" test for model admin, trying to cover as many valid +# configurations as possible. +- case: test_full_admin + main: | + from django.contrib import admin + from django.forms import Form, Textarea + from django.db import models + from django.core.paginator import Paginator + from django.contrib.admin.sites import AdminSite + from django.db.models.options import Options + from django.http.request import HttpRequest + from django.db.models.query import QuerySet + + def an_action(modeladmin: admin.ModelAdmin, request: HttpRequest, queryset: QuerySet) -> None: + pass + + class A(admin.ModelAdmin): + # BaseModelAdmin + autocomplete_fields = ("strs",) + raw_id_fields = ["strs"] + fields = ( + "a field", + ["a", "list of", "fields"], + ) + exclude = ("a", "b") + fieldsets = [ + (None, {"fields": ["a", "b"]}), + ("group", {"fields": ("c",), "classes": ("a",), "description": "foo"}), + ] + form = Form + filter_vertical = ("fields",) + filter_horizontal = ("plenty", "of", "fields") + radio_fields = { + "some_field": admin.VERTICAL, + "another_field": admin.HORIZONTAL, + } + prepopulated_fields = {"slug": ("title",)} + formfield_overrides = {models.TextField: {"widget": Textarea}} + readonly_fields = ("date_modified",) + ordering = ("-pk", "date_modified") + sortable_by = ["pk"] + view_on_site = True + show_full_result_count = False + + # ModelAdmin + list_display = ("pk",) + list_display_links = ("str",) + list_filter = ("str", admin.SimpleListFilter, ("str", admin.SimpleListFilter)) + list_select_related = True + list_per_page = 1 + list_max_show_all = 2 + list_editable = ("a", "b") + search_fields = ("c", "d") + date_hirearchy = "f" + save_as = False + save_as_continue = True + save_on_top = False + paginator = Paginator + presserve_filters = False + inlines = (admin.TabularInline, admin.StackedInline) + add_form_template = "template" + change_form_template = "template" + change_list_template = "template" + delete_confirmation_template = "template" + delete_selected_confirmation_template = "template" + object_history_template = "template" + popup_response_template = "template" + actions = (an_action,) + actions_on_top = True + actions_on_bottom = False + actions_selection_counter = True + admin_site = AdminSite() +# This test is here to make sure we're not running into a mypy issue which is +# worked around using a somewhat complicated _ListOrTuple union type. Once the +# issue is solved upstream this test should pass even with the workaround +# replaced by a simpler Sequence type. +# https://github.com/python/mypy/issues/8921 +- case: test_fieldset_workaround_regression + main: | + from django.contrib import admin + + class A(admin.ModelAdmin): + fieldsets = ( + (None, { + 'fields': ('name',), + }), + ) +- case: errors_on_omitting_fields_from_fieldset_opts + main: | + from django.contrib import admin + + class A(admin.ModelAdmin): + fieldsets = [ # type: ignore + (None, {}), # E: Key 'fields' missing for TypedDict "_FieldOpts" + ] +- case: errors_on_invalid_radio_fields + main: | + from django.contrib import admin + + class A(admin.ModelAdmin): + radio_fields = {"some_field": 0} # E: Dict entry 0 has incompatible type "str": "Literal[0]"; expected "str": "Union[Literal[1], Literal[2]]" + + class B(admin.ModelAdmin): + radio_fields = {1: admin.VERTICAL} # E: Dict entry 0 has incompatible type "int": "Literal[2]"; expected "str": "Union[Literal[1], Literal[2]]" +- case: errors_for_invalid_formfield_overrides + main: | + from django.contrib import admin + from django.forms import Textarea + + class A(admin.ModelAdmin): + formfield_overrides = { + "not a field": { # E: Dict entry 0 has incompatible type "str": "Dict[str, Any]"; expected "Type[Field[Any, Any]]": "Mapping[str, Any]" + "widget": Textarea + } + } +- case: errors_for_invalid_action_signature + main: | + from django.contrib import admin + from django.http.request import HttpRequest + from django.db.models.query import QuerySet + + def an_action(modeladmin: None) -> None: + pass + + class A(admin.ModelAdmin): + actions = [an_action] # E: List item 0 has incompatible type "Callable[[None], None]"; expected "Callable[[ModelAdmin, HttpRequest, QuerySet[Any]], None]" diff --git a/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/contrib/auth/test_decorators.yml b/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/contrib/auth/test_decorators.yml new file mode 100644 index 00000000..616e007a --- /dev/null +++ b/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/contrib/auth/test_decorators.yml @@ -0,0 +1,43 @@ +- case: login_required_bare + main: | + from django.contrib.auth.decorators import login_required + @login_required + def view_func(request): ... + reveal_type(view_func) # N: Revealed type is 'def (request: Any) -> Any' +- case: login_required_fancy + main: | + from django.contrib.auth.decorators import login_required + from django.core.handlers.wsgi import WSGIRequest + from django.http import HttpResponse + @login_required(redirect_field_name='a', login_url='b') + def view_func(request: WSGIRequest, arg: str) -> HttpResponse: ... + reveal_type(view_func) # N: Revealed type is 'def (request: django.core.handlers.wsgi.WSGIRequest, arg: builtins.str) -> django.http.response.HttpResponse' +- case: login_required_weird + main: | + from django.contrib.auth.decorators import login_required + # This is non-conventional usage, but covered in Django tests, so we allow it. + def view_func(request): ... + wrapped_view = login_required(view_func, redirect_field_name='a', login_url='b') + reveal_type(wrapped_view) # N: Revealed type is 'def (request: Any) -> Any' +- case: login_required_incorrect_return + main: | + from django.contrib.auth.decorators import login_required + @login_required() # E: Value of type variable "_VIEW" of function cannot be "Callable[[Any], str]" + def view_func2(request) -> str: ... +- case: user_passes_test + main: | + from django.contrib.auth.decorators import user_passes_test + @user_passes_test(lambda u: u.username.startswith('super')) + def view_func(request): ... + reveal_type(view_func) # N: Revealed type is 'def (request: Any) -> Any' +- case: user_passes_test_bare_is_error + main: | + from django.http.response import HttpResponse + from django.contrib.auth.decorators import user_passes_test + @user_passes_test # E: Argument 1 to "user_passes_test" has incompatible type "Callable[[Any], HttpResponse]"; expected "Callable[[AbstractUser], bool]" + def view_func(request) -> HttpResponse: ... +- case: permission_required + main: | + from django.contrib.auth.decorators import permission_required + @permission_required('polls.can_vote') + def view_func(request): ... diff --git a/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/db/test_transaction.yml b/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/db/test_transaction.yml new file mode 100644 index 00000000..446dfc42 --- /dev/null +++ b/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/db/test_transaction.yml @@ -0,0 +1,28 @@ +- case: atomic_bare + main: | + from django.db.transaction import atomic + @atomic + def func(x: int) -> list: ... + reveal_type(func) # N: Revealed type is 'def (x: builtins.int) -> builtins.list[Any]' +- case: atomic_args + main: | + from django.db.transaction import atomic + @atomic(using='bla', savepoint=False) + def func(x: int) -> list: ... + reveal_type(func) # N: Revealed type is 'def (x: builtins.int) -> builtins.list[Any]' +- case: non_atomic_requests_bare + main: | + from django.db.transaction import non_atomic_requests + @non_atomic_requests + def view_func(request): ... + reveal_type(view_func) # N: Revealed type is 'def (request: Any) -> Any' + +- case: non_atomic_requests_args + main: | + from django.http.request import HttpRequest + from django.http.response import HttpResponse + from django.db.transaction import non_atomic_requests + @non_atomic_requests + def view_func(request: HttpRequest, arg: str) -> HttpResponse: ... + reveal_type(view_func) # N: Revealed type is 'def (request: django.http.request.HttpRequest, arg: builtins.str) -> django.http.response.HttpResponse' + diff --git a/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/fields/test_base.yml b/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/fields/test_base.yml new file mode 100644 index 00000000..48ce577e --- /dev/null +++ b/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/fields/test_base.yml @@ -0,0 +1,153 @@ +- case: test_model_fields_classes_present_as_primitives + main: | + from myapp.models import User + user = User(small_int=1, name='user', slug='user', text='user') + reveal_type(user.id) # N: Revealed type is 'builtins.int*' + reveal_type(user.small_int) # N: Revealed type is 'builtins.int*' + reveal_type(user.name) # N: Revealed type is 'builtins.str*' + reveal_type(user.slug) # N: Revealed type is 'builtins.str*' + reveal_type(user.text) # N: Revealed type is 'builtins.str*' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class User(models.Model): + id = models.AutoField(primary_key=True) + small_int = models.SmallIntegerField() + name = models.CharField(max_length=255) + slug = models.SlugField(max_length=255) + text = models.TextField() + +- case: test_model_field_classes_from_existing_locations + main: | + from myapp.models import Booking + booking = Booking() + reveal_type(booking.id) # N: Revealed type is 'builtins.int*' + reveal_type(booking.time_range) # N: Revealed type is 'Any' + reveal_type(booking.some_decimal) # N: Revealed type is 'decimal.Decimal*' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + from django.contrib.postgres import fields as pg_fields + from decimal import Decimal + + class Booking(models.Model): + id = models.AutoField(primary_key=True) + time_range = pg_fields.DateTimeRangeField(null=False) + some_decimal = models.DecimalField(max_digits=10, decimal_places=5) + +- case: test_add_id_field_if_no_primary_key_defined + disable_cache: true + main: | + from myapp.models import User + reveal_type(User().id) # N: Revealed type is 'builtins.int*' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class User(models.Model): + pass + +- case: test_do_not_add_id_if_field_with_primary_key_True_defined + disable_cache: true + main: | + from myapp.models import User + reveal_type(User().my_pk) # N: Revealed type is 'builtins.int*' + reveal_type(User().id) + out: | + main:3: note: Revealed type is 'Any' + main:3: error: "User" has no attribute "id" + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class User(models.Model): + my_pk = models.IntegerField(primary_key=True) + +- case: blank_and_null_char_field_allows_none + main: | + from myapp.models import MyModel + MyModel(nulltext="") + MyModel(nulltext=None) + MyModel().nulltext=None + reveal_type(MyModel().nulltext) # N: Revealed type is 'Union[builtins.str, None]' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class MyModel(models.Model): + nulltext=models.CharField(max_length=1, blank=True, null=True) + +- case: blank_and_not_null_charfield_does_not_allow_none + main: | + from myapp.models import MyModel + MyModel(notnulltext=None) # Should allow None in constructor + MyModel(notnulltext="") + MyModel().notnulltext = None # E: Incompatible types in assignment (expression has type "None", variable has type "Union[str, int, Combinable]") + reveal_type(MyModel().notnulltext) # N: Revealed type is 'builtins.str*' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class MyModel(models.Model): + notnulltext=models.CharField(max_length=1, blank=True, null=False) + +- case: if_field_called_on_class_return_field_itself + main: | + from myapp.models import MyUser + reveal_type(MyUser.name) # N: Revealed type is 'django.db.models.fields.CharField[Union[builtins.str, builtins.int, django.db.models.expressions.Combinable], builtins.str]' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class MyUser(models.Model): + name = models.CharField(max_length=100) + +- case: fields_on_non_model_classes_resolve_to_field_type + main: | + from django.db import models + class MyClass: + myfield: models.IntegerField[int, int] + reveal_type(MyClass.myfield) # N: Revealed type is 'django.db.models.fields.IntegerField[builtins.int, builtins.int]' + reveal_type(MyClass().myfield) # N: Revealed type is 'django.db.models.fields.IntegerField[builtins.int, builtins.int]' + +- case: fields_inside_mixins_used_in_model_subclasses_resolved_as_primitives + main: | + from myapp.models import MyModel, AuthMixin + reveal_type(MyModel().username) # N: Revealed type is 'builtins.str*' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class AuthMixin(models.Model): + class Meta: + abstract = True + username = models.CharField(max_length=100) + + class MyModel(AuthMixin, models.Model): + pass \ No newline at end of file diff --git a/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/fields/test_generic_foreign_key.yml b/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/fields/test_generic_foreign_key.yml new file mode 100644 index 00000000..d0979a84 --- /dev/null +++ b/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/fields/test_generic_foreign_key.yml @@ -0,0 +1,21 @@ +- case: generic_foreign_key_could_point_to_any_model_and_is_always_optional + main: | + from myapp.models import Tag, User + myuser = User() + Tag(content_object=None) + Tag(content_object=myuser) + Tag.objects.create(content_object=None) + Tag.objects.create(content_object=myuser) + reveal_type(Tag().content_object) # N: Revealed type is 'Union[Any, None]' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + from django.contrib.contenttypes import fields + class User(models.Model): + pass + class Tag(models.Model): + content_object = fields.GenericForeignKey() \ No newline at end of file diff --git a/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/fields/test_nullable.yml b/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/fields/test_nullable.yml new file mode 100644 index 00000000..e1430016 --- /dev/null +++ b/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/fields/test_nullable.yml @@ -0,0 +1,70 @@ +- case: nullable_field_with_strict_optional_true + main: | + from myapp.models import MyModel + reveal_type(MyModel().text) # N: Revealed type is 'builtins.str*' + reveal_type(MyModel().text_nullable) # N: Revealed type is 'Union[builtins.str, None]' + MyModel().text = None # E: Incompatible types in assignment (expression has type "None", variable has type "Union[str, int, Combinable]") + MyModel().text_nullable = None + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class MyModel(models.Model): + text_nullable = models.CharField(max_length=100, null=True) + text = models.CharField(max_length=100) + +- case: nullable_array_field + main: | + from myapp.models import MyModel + reveal_type(MyModel().lst) # N: Revealed type is 'Union[builtins.list[builtins.str], None]' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + from django.contrib.postgres.fields import ArrayField + + class MyModel(models.Model): + lst = ArrayField(base_field=models.CharField(max_length=100), null=True) + +- case: nullable_foreign_key + main: | + from myapp.models import Publisher, Book + reveal_type(Book().publisher) # N: Revealed type is 'Union[myapp.models.Publisher, None]' + Book().publisher = 11 # E: Incompatible types in assignment (expression has type "int", variable has type "Union[Publisher, Combinable, None]") + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + + class Publisher(models.Model): + pass + class Book(models.Model): + publisher = models.ForeignKey(to=Publisher, on_delete=models.CASCADE, null=True) + +- case: nullable_self_foreign_key + main: | + from myapp.models import Inventory + parent = Inventory() + core = Inventory(parent_id=parent.id) + reveal_type(core.parent_id) # N: Revealed type is 'Union[builtins.int, None]' + reveal_type(core.parent) # N: Revealed type is 'Union[myapp.models.Inventory, None]' + Inventory(parent=None) + Inventory(parent_id=None) + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class Inventory(models.Model): + parent = models.ForeignKey('self', on_delete=models.SET_NULL, null=True) diff --git a/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/fields/test_postgres_fields.yml b/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/fields/test_postgres_fields.yml new file mode 100644 index 00000000..2d2c0022 --- /dev/null +++ b/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/fields/test_postgres_fields.yml @@ -0,0 +1,35 @@ +- case: array_field_descriptor_access + main: | + from myapp.models import User + user = User(array=[]) + reveal_type(user.array) # N: Revealed type is 'builtins.list*[Any]' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + from django.contrib.postgres.fields import ArrayField + + class User(models.Model): + array = ArrayField(base_field=models.Field()) + +- case: array_field_base_field_parsed_into_generic_typevar + main: | + from myapp.models import User + user = User() + reveal_type(user.members) # N: Revealed type is 'builtins.list*[builtins.int]' + reveal_type(user.members_as_text) # N: Revealed type is 'builtins.list*[builtins.str]' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + from django.contrib.postgres.fields import ArrayField + + class User(models.Model): + members = ArrayField(base_field=models.IntegerField()) + members_as_text = ArrayField(base_field=models.CharField(max_length=255)) diff --git a/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/fields/test_related.yml b/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/fields/test_related.yml new file mode 100644 index 00000000..0a79d19b --- /dev/null +++ b/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/fields/test_related.yml @@ -0,0 +1,674 @@ +- case: test_foreign_key_field_with_related_name + main: | + from myapp.models import Book, Publisher + book = Book() + reveal_type(book.publisher) # N: Revealed type is 'myapp.models.Publisher*' + publisher = Publisher() + reveal_type(publisher.books) # N: Revealed type is 'django.db.models.manager.RelatedManager[myapp.models.Book]' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class Publisher(models.Model): + pass + class Book(models.Model): + publisher = models.ForeignKey(to=Publisher, on_delete=models.CASCADE, + related_name='books') + +- case: foreign_key_field_creates_attribute_with_underscore_id + main: | + from myapp.models import Book + book = Book() + reveal_type(book.publisher_id) # N: Revealed type is 'builtins.int*' + reveal_type(book.owner_id) # N: Revealed type is 'builtins.int*' + installed_apps: + - django.contrib.auth + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class Publisher(models.Model): + pass + class Book(models.Model): + publisher = models.ForeignKey(to=Publisher, on_delete=models.CASCADE) + owner = models.ForeignKey(db_column='model_id', to='auth.User', on_delete=models.CASCADE) + +- case: foreign_key_field_different_order_of_params + main: | + from myapp.models import Book, Publisher + book = Book() + reveal_type(book.publisher) # N: Revealed type is 'myapp.models.Publisher*' + reveal_type(book.publisher2) # N: Revealed type is 'myapp.models.Publisher*' + + publisher = Publisher() + reveal_type(publisher.books) # N: Revealed type is 'django.db.models.manager.RelatedManager[myapp.models.Book]' + reveal_type(publisher.books2) # N: Revealed type is 'django.db.models.manager.RelatedManager[myapp.models.Book]' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class Publisher(models.Model): + pass + class Book(models.Model): + publisher = models.ForeignKey(on_delete=models.CASCADE, to=Publisher, + related_name='books') + publisher2 = models.ForeignKey(to=Publisher, related_name='books2', on_delete=models.CASCADE) + +- case: to_parameter_as_string_with_application_name__model_imported + main: | + from myapp2.models import Book + book = Book() + reveal_type(book.publisher) # N: Revealed type is 'myapp.models.Publisher*' + installed_apps: + - myapp + - myapp2 + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class Publisher(models.Model): + pass + - path: myapp2/__init__.py + - path: myapp2/models.py + content: | + from django.db import models + class Book(models.Model): + publisher = models.ForeignKey(to='myapp.Publisher', on_delete=models.CASCADE) + +- case: one_to_one_field_no_related_name + main: | + from myapp.models import User, Profile + reveal_type(User().profile) # N: Revealed type is 'myapp.models.Profile' + reveal_type(Profile().user) # N: Revealed type is 'myapp.models.User*' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class User(models.Model): + pass + class Profile(models.Model): + user = models.OneToOneField(to=User, on_delete=models.CASCADE) + +- case: test_circular_dependency_in_imports_with_foreign_key + main: | + from myapp import models + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class App(models.Model): + def method(self) -> None: + reveal_type(self.views) # N: Revealed type is 'django.db.models.manager.RelatedManager[myapp.models.View]' + reveal_type(self.members) # N: Revealed type is 'django.db.models.manager.RelatedManager[myapp.models.Member]' + reveal_type(self.sheets) # N: Revealed type is 'django.db.models.manager.RelatedManager[myapp.models.Sheet]' + reveal_type(self.profile) # N: Revealed type is 'myapp.models.Profile' + class View(models.Model): + app = models.ForeignKey(to=App, related_name='views', on_delete=models.CASCADE) + class Member(models.Model): + app = models.ForeignKey(related_name='members', on_delete=models.CASCADE, to=App) + class Sheet(models.Model): + app = models.ForeignKey(App, related_name='sheets', on_delete=models.CASCADE) + class Profile(models.Model): + app = models.OneToOneField(App, related_name='profile', on_delete=models.CASCADE) + +- case: test_circular_dependency_in_imports_with_string_based + main: | + from myapp.models import View + reveal_type(View().app.views) # N: Revealed type is 'django.db.models.manager.RelatedManager[myapp.models.View]' + reveal_type(View().app.unknown) + out: | + main:3: note: Revealed type is 'Any' + main:3: error: "App" has no attribute "unknown" + installed_apps: + - myapp + - myapp2 + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + from myapp2.models import App + class View(models.Model): + app = models.ForeignKey(to=App, related_name='views', on_delete=models.CASCADE) + - path: myapp2/__init__.py + - path: myapp2/models.py + content: | + from django.db import models + class App(models.Model): + def method(self) -> None: + reveal_type(self.views) # N: Revealed type is 'django.db.models.manager.RelatedManager[myapp.models.View]' + +- case: models_related_managers_work_with_direct_model_inheritance_and_with_inheritance_from_other_model + main: | + from myapp.models import App + reveal_type(App().views) # N: Revealed type is 'django.db.models.manager.RelatedManager[myapp.models.View]' + reveal_type(App().views2) # N: Revealed type is 'django.db.models.manager.RelatedManager[myapp.models.View2]' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class App(models.Model): + pass + class View(models.Model): + app = models.ForeignKey(to=App, on_delete=models.CASCADE, related_name='views') + class View2(View): + app2 = models.ForeignKey(to=App, on_delete=models.CASCADE, related_name='views2') + +- case: models_imported_inside_init_file_foreign_key + main: | + from myapp2.models import View + reveal_type(View().app.views) # N: Revealed type is 'django.db.models.manager.RelatedManager[myapp2.models.View]' + installed_apps: + - myapp + - myapp2 + files: + - path: myapp/__init__.py + - path: myapp/models/__init__.py + content: | + from .app import App + - path: myapp/models/app.py + content: | + from django.db import models + class App(models.Model): + pass + - path: myapp2/__init__.py + - path: myapp2/models.py + content: | + from django.db import models + from myapp.models import App + class View(models.Model): + app = models.ForeignKey(to='myapp.App', related_name='views', on_delete=models.CASCADE) + +- case: models_imported_inside_init_file_one_to_one_field + main: | + from myapp2.models import Profile + reveal_type(Profile().user) # N: Revealed type is 'myapp.models.user.User*' + reveal_type(Profile().user.profile) # N: Revealed type is 'myapp2.models.Profile' + installed_apps: + - myapp + - myapp2 + files: + - path: myapp/__init__.py + - path: myapp/models/__init__.py + content: | + from .user import User + - path: myapp/models/user.py + content: | + from django.db import models + class User(models.Model): + pass + - path: myapp2/__init__.py + - path: myapp2/models.py + content: | + from django.db import models + from myapp.models import User + class Profile(models.Model): + user = models.OneToOneField(to='myapp.User', related_name='profile', on_delete=models.CASCADE) + +- case: models_triple_circular_reference + main: | + from myapp.models import App + reveal_type(App().owner) # N: Revealed type is 'myapp.models.user.User*' + reveal_type(App().owner.profile) # N: Revealed type is 'myapp.models.profile.Profile' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models/__init__.py + content: | + from .user import User + from .profile import Profile + from .app import App + - path: myapp/models/user.py + content: | + from django.db import models + class User(models.Model): + pass + - path: myapp/models/profile.py + content: | + from django.db import models + class Profile(models.Model): + user = models.OneToOneField(to='myapp.User', related_name='profile', on_delete=models.CASCADE) + - path: myapp/models/app.py + content: | + from django.db import models + class App(models.Model): + owner = models.ForeignKey(to='myapp.User', on_delete=models.CASCADE, related_name='apps') + +- case: many_to_many_field_converts_to_queryset_of_model_type + main: | + from myapp.models import App, Member + reveal_type(Member().apps) # N: Revealed type is 'django.db.models.manager.RelatedManager*[myapp.models.App]' + reveal_type(App().members) # N: Revealed type is 'django.db.models.manager.RelatedManager[myapp.models.Member]' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class App(models.Model): + pass + class Member(models.Model): + apps = models.ManyToManyField(to=App, related_name='members') + +- case: many_to_many_works_with_string_if_imported + main: | + from myapp.models import Member + reveal_type(Member().apps) # N: Revealed type is 'django.db.models.manager.RelatedManager*[myapp2.models.App]' + installed_apps: + - myapp + - myapp2 + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class Member(models.Model): + apps = models.ManyToManyField(to='myapp2.App', related_name='members') + - path: myapp2/__init__.py + - path: myapp2/models.py + content: | + from django.db import models + class App(models.Model): + pass + +- case: foreign_key_with_self + main: | + from myapp.models import User + reveal_type(User().parent) # N: Revealed type is 'myapp.models.User*' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class User(models.Model): + parent = models.ForeignKey('self', on_delete=models.CASCADE) + +- case: many_to_many_with_self + main: | + from myapp.models import User + reveal_type(User().friends) # N: Revealed type is 'django.db.models.manager.RelatedManager*[myapp.models.User]' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class User(models.Model): + friends = models.ManyToManyField('self') + +- case: recursively_checking_for_base_model_in_to_parameter + main: | + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + + class BaseModel(models.Model): + pass + class ParkingSpot(BaseModel): + pass + class Booking(BaseModel): + parking_spot = models.ForeignKey(to=ParkingSpot, null=True, on_delete=models.SET_NULL) + +- case: if_no_related_name_is_passed_create_default_related_managers + main: | + from myapp.models import Publisher + reveal_type(Publisher().book_set) # N: Revealed type is 'django.db.models.manager.RelatedManager[myapp.models.Book]' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class Publisher(models.Model): + pass + class Book(models.Model): + publisher = models.ForeignKey(to=Publisher, on_delete=models.CASCADE) + +- case: underscore_id_attribute_has_set_type_of_primary_key_if_explicit + main: | + import datetime + from myapp.models import Book, Book2 + + reveal_type(Book().publisher_id) # N: Revealed type is 'builtins.str*' + Book(publisher_id=1) + Book(publisher_id='hello') + Book(publisher_id=datetime.datetime.now()) # E: Incompatible type for "publisher_id" of "Book" (got "datetime", expected "Union[str, int, Combinable, None]") + Book.objects.create(publisher_id=1) + Book.objects.create(publisher_id='hello') + + reveal_type(Book2().publisher_id) # N: Revealed type is 'builtins.int*' + Book2(publisher_id=1) + Book2(publisher_id=[]) # E: Incompatible type for "publisher_id" of "Book2" (got "List[Any]", expected "Union[float, int, str, Combinable, None]") + Book2.objects.create(publisher_id=1) + Book2.objects.create(publisher_id=[]) # E: Incompatible type for "publisher_id" of "Book2" (got "List[Any]", expected "Union[float, int, str, Combinable]") + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + import datetime + class Publisher(models.Model): + mypk = models.CharField(max_length=100, primary_key=True) + class Book(models.Model): + publisher = models.ForeignKey(to=Publisher, on_delete=models.CASCADE) + + class Publisher2(models.Model): + mypk = models.IntegerField(primary_key=True) + class Book2(models.Model): + publisher = models.ForeignKey(to=Publisher2, on_delete=models.CASCADE) + +- case: if_model_is_defined_as_name_of_the_class_look_for_it_in_the_same_app + main: | + from myapp.models import Book + reveal_type(Book().publisher) # N: Revealed type is 'myapp.models.publisher.Publisher*' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models/__init__.py + content: | + from .publisher import Publisher + from .book import Book + - path: myapp/models/publisher.py + content: | + from django.db import models + class Publisher(models.Model): + pass + - path: myapp/models/book.py + content: | + from django.db import models + class Book(models.Model): + publisher = models.ForeignKey(to='Publisher', on_delete=models.CASCADE) + + +- case: fail_if_no_model_in_the_same_app_models_init_py + main: | + from myapp.models import Book + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models/__init__.py + content: | + from .book import Book + - path: myapp/models/publisher.py + content: | + from django.db import models + class Publisher(models.Model): + pass + - path: myapp/models/book.py + content: | + from django.db import models + class Book(models.Model): + publisher = models.ForeignKey(to='Publisher', on_delete=models.CASCADE) # E: Cannot find model 'Publisher' referenced in field 'publisher' + + +- case: test_foreign_key_field_without_backwards_relation + main: | + from myapp.models import Book, Publisher + book = Book() + reveal_type(book.publisher) # N: Revealed type is 'myapp.models.Publisher*' + + publisher = Publisher() + reveal_type(publisher.books) + reveal_type(publisher.books2) # N: Revealed type is 'django.db.models.manager.RelatedManager[myapp.models.Book]' + out: | + main:6: error: "Publisher" has no attribute "books"; maybe "books2"? + main:6: note: Revealed type is 'Any' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class Publisher(models.Model): + pass + class Book(models.Model): + publisher = models.ForeignKey(to=Publisher, on_delete=models.CASCADE, + related_name='+') + publisher2 = models.ForeignKey(to=Publisher, on_delete=models.CASCADE, + related_name='books2') + +- case: to_parameter_could_be_resolved_if_passed_from_settings + main: | + from myapp.models import Book + book = Book() + reveal_type(book.publisher) # N: Revealed type is 'myapp.models.Publisher*' + custom_settings: | + INSTALLED_APPS = ('django.contrib.contenttypes', 'myapp') + BOOK_RELATED_MODEL = 'myapp.Publisher' + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.conf import settings + from django.db import models + + class Publisher(models.Model): + pass + class Book(models.Model): + publisher = models.ForeignKey(to=settings.BOOK_RELATED_MODEL, on_delete=models.CASCADE, + related_name='books') + +- case: foreign_key_with_custom_app_name + main: | + from myapp.models import MyMain + reveal_type(MyMain().user) # N: Revealed type is 'myapp2.models.MyUser*' + installed_apps: + - myapp + - myapp2.apps.MyApp2Config + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class MyMain(models.Model): + user = models.ForeignKey('myapp2__user.MyUser', on_delete=models.CASCADE) + - path: myapp2/__init__.py + - path: myapp2/models.py + content: | + from django.db import models + class MyUser(models.Model): + pass + - path: myapp2/apps.py + content: | + from django.apps.config import AppConfig + class MyApp2Config(AppConfig): + name = 'myapp2' + label = 'myapp2__user' + + +- case: related_field_to_extracted_from_function + main: | + from myapp.models import Profile + reveal_type(Profile().user) # N: Revealed type is 'myapp.models.User*' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class User(models.Model): + pass + def get_user_model_name(): + return 'myapp.User' + class Profile(models.Model): + user = models.ForeignKey(to=get_user_model_name(), on_delete=models.CASCADE) + + +- case: related_manager_name_defined_by_pattern + main: | + from myapp.models import Publisher + reveal_type(Publisher().books) # N: Revealed type is 'django.db.models.manager.RelatedManager[myapp.models.Book]' + reveal_type(Publisher().articles) # N: Revealed type is 'django.db.models.manager.RelatedManager[myapp.models.Article]' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class Publisher(models.Model): + pass + class Entry(models.Model): + class Meta: + abstract = True + publisher = models.ForeignKey(to=Publisher, related_name='%(class)ss', on_delete=models.CASCADE) + class Book(Entry): + pass + class Article(Entry): + pass + + +- case: test_related_fields_returned_as_descriptors_from_model_class + main: | + from myapp.models import Author, Blog, Publisher, Profile + reveal_type(Author.blogs) # N: Revealed type is 'django.db.models.fields.related_descriptors.ManyToManyDescriptor' + reveal_type(Blog.publisher) # N: Revealed type is 'django.db.models.fields.related_descriptors.ForwardManyToOneDescriptor' + reveal_type(Publisher.profile) # N: Revealed type is 'django.db.models.fields.related_descriptors.ForwardOneToOneDescriptor' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class Profile(models.Model): + pass + class Publisher(models.Model): + profile = models.OneToOneField(Profile, on_delete=models.CASCADE) + class Blog(models.Model): + publisher = models.ForeignKey(Publisher, on_delete=models.CASCADE) + class Author(models.Model): + blogs = models.ManyToManyField(Blog) + file = models.FileField() + + +- case: test_foreign_key_from_superclass_inherits_correctly + main: | + from myapp.models import MyUser, Book, Article, LibraryEntity + reveal_type(Book().registered_by_user) # N: Revealed type is 'myapp.models.MyUser*' + reveal_type(Article().registered_by_user) # N: Revealed type is 'myapp.models.MyUser*' + + user = MyUser() + reveal_type(user.book_set) # N: Revealed type is 'django.db.models.manager.RelatedManager[myapp.models.Book]' + reveal_type(user.article_set) # N: Revealed type is 'django.db.models.manager.RelatedManager[myapp.models.Article]' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class MyUser(models.Model): + pass + class LibraryEntity(models.Model): + class Meta: + abstract = True + registered_by_user = models.ForeignKey(MyUser, on_delete=models.CASCADE) + class Book(LibraryEntity): + pass + class Article(LibraryEntity): + pass + + +- case: foreign_key_relationship_for_models_with_custom_manager + main: | + from myapp.models import Transaction + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class TransactionQuerySet(models.QuerySet): + pass + class Transaction(models.Model): + objects = TransactionQuerySet.as_manager() + def test(self) -> None: + self.transactionlog_set + class TransactionLog(models.Model): + transaction = models.ForeignKey(Transaction, on_delete=models.CASCADE) + + Transaction().test() + + +- case: resolve_primary_keys_for_foreign_keys_with_abstract_self_model + main: | + from myapp.models import User + reveal_type(User().parent) # N: Revealed type is 'myapp.models.User*' + reveal_type(User().parent_id) # N: Revealed type is 'builtins.int*' + + reveal_type(User().parent2) # N: Revealed type is 'Union[myapp.models.User, None]' + reveal_type(User().parent2_id) # N: Revealed type is 'Union[builtins.int, None]' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class AbstractUser(models.Model): + parent = models.ForeignKey('self', on_delete=models.CASCADE) + parent2 = models.ForeignKey('self', null=True, on_delete=models.CASCADE) + class Meta: + abstract = True + class User(AbstractUser): + pass + + +- case: related_manager_is_a_subclass_of_default_manager + main: | + from myapp.models import User + reveal_type(User().orders) # N: Revealed type is 'myapp.models.Order_RelatedManager' + reveal_type(User().orders.get()) # N: Revealed type is 'myapp.models.Order*' + reveal_type(User().orders.manager_method()) # N: Revealed type is 'builtins.int' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class User(models.Model): + pass + class OrderManager(models.Manager): + def manager_method(self) -> int: + pass + class Order(models.Model): + objects = OrderManager() + user = models.ForeignKey(to=User, on_delete=models.CASCADE, related_name='orders') + diff --git a/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/managers/querysets/test_basic_methods.yml b/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/managers/querysets/test_basic_methods.yml new file mode 100644 index 00000000..55d4c4ec --- /dev/null +++ b/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/managers/querysets/test_basic_methods.yml @@ -0,0 +1,47 @@ +- case: queryset_basic_methods_return_type + main: | + from myapp.models import Blog + + qs = Blog.objects.all() + reveal_type(qs) # N: Revealed type is 'django.db.models.manager.Manager[myapp.models.Blog]' + reveal_type(qs.get(id=1)) # N: Revealed type is 'myapp.models.Blog*' + reveal_type(iter(qs)) # N: Revealed type is 'typing.Iterator[myapp.models.Blog*]' + reveal_type(qs.iterator()) # N: Revealed type is 'typing.Iterator[myapp.models.Blog*]' + reveal_type(qs.first()) # N: Revealed type is 'Union[myapp.models.Blog*, None]' + reveal_type(qs.earliest()) # N: Revealed type is 'myapp.models.Blog*' + reveal_type(qs[0]) # N: Revealed type is 'myapp.models.Blog*' + reveal_type(qs[:9]) # N: Revealed type is 'django.db.models.manager.Manager[myapp.models.Blog]' + reveal_type(qs.in_bulk()) # N: Revealed type is 'builtins.dict[Any, myapp.models.Blog*]' + + # .dates / .datetimes + reveal_type(Blog.objects.dates("created_at", "day")) # N: Revealed type is 'django.db.models.query.ValuesQuerySet[myapp.models.Blog*, datetime.date]' + reveal_type(Blog.objects.datetimes("created_at", "day")) # N: Revealed type is 'django.db.models.query.ValuesQuerySet[myapp.models.Blog*, datetime.datetime]' + + # AND-ing QuerySets + reveal_type(Blog.objects.all() & Blog.objects.all()) # N: Revealed type is 'django.db.models.manager.Manager[myapp.models.Blog]' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + + class Blog(models.Model): + created_at = models.DateTimeField() + + +- case: queryset_missing_method + main: | + from myapp.models import User + reveal_type(User.objects) # N: Revealed type is 'django.db.models.manager.Manager[myapp.models.User]' + User.objects.not_existing_method() # E: "Manager[User]" has no attribute "not_existing_method" + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class User(models.Model): + pass \ No newline at end of file diff --git a/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/managers/querysets/test_filter.yml b/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/managers/querysets/test_filter.yml new file mode 100644 index 00000000..43056f55 --- /dev/null +++ b/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/managers/querysets/test_filter.yml @@ -0,0 +1,256 @@ +- case: filtering_with_proper_types + main: | + from myapp.models import User + User.objects.filter(username='maksim') + User.objects.get(username='maksim') + User.objects.exclude(username='maksim') + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class User(models.Model): + username = models.CharField(max_length=100) + + +- case: no_such_field_for_filter + main: | + from myapp.models import User + User.objects.filter(unknown_field=True) # E: Cannot resolve keyword 'unknown_field' into field. Choices are: id + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class User(models.Model): + pass + + +- case: filter_with_invalid_type + main: | + from myapp.models import User + User.objects.filter(age=User()) # E: Incompatible type for lookup 'age': (got "User", expected "Union[str, int]") + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + from django.db import models + class User(models.Model): + age = models.IntegerField() + + +- case: filter_with_multiple_fields + main: | + from myapp.models import User + User.objects.filter(age=User(), gender=User()) + installed_apps: + - myapp + out: | + main:2: error: Incompatible type for lookup 'age': (got "User", expected "Union[str, int]") + main:2: error: Incompatible type for lookup 'gender': (got "User", expected "Union[str, int]") + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class User(models.Model): + age = models.IntegerField() + gender = models.IntegerField() + + +- case: valid_filter_with_lookup + main: | + from myapp.models import User + User.objects.filter(username__contains='hello') + User.objects.filter(age__gt=1) + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class User(models.Model): + username = models.CharField(max_length=100) + age = models.IntegerField() + + +- case: invalid_filter_with_lookup + main: | + from myapp.models import User + User.objects.filter(username__contains=1) # E: Incompatible type for lookup 'username__contains': (got "int", expected "str") + User.objects.filter(username__icontains=1) # E: Incompatible type for lookup 'username__icontains': (got "int", expected "str") + User.objects.filter(username__isnull=1) # E: Incompatible type for lookup 'username__isnull': (got "int", expected "bool") + + User.objects.filter(created_at=User()) # E: Incompatible type for lookup 'created_at': (got "User", expected "Union[str, datetime]") + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class User(models.Model): + username = models.CharField(max_length=100) + age = models.IntegerField() + created_at = models.DateTimeField() + +- case: strings_are_allowed_for_exact_for_dates + main: | + from myapp.models import User + User.objects.filter(created_at='2018') + User.objects.filter(created_at__exact='2018') + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class User(models.Model): + created_at = models.DateTimeField() + + +- case: related_model_foreign_key_lookups + main: | + from myapp.models import Blog, Publisher + blog = Blog() + publisher = Publisher() + Blog.objects.filter(publisher=publisher) + Blog.objects.filter(publisher_id=1) + Blog.objects.filter(publisher__id=1) + + Blog.objects.filter(publisher=blog) # E: Incompatible type for lookup 'publisher': (got "Blog", expected "Union[Publisher, int, None]") + Blog.objects.filter(publisher_id=blog) # E: Incompatible type for lookup 'publisher_id': (got "Blog", expected "Union[str, int]") + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class Publisher(models.Model): + pass + class Blog(models.Model): + publisher = models.ForeignKey(Publisher, on_delete=models.CASCADE, related_name='blogs') + + +- case: related_model_reverse_foreign_key_lookup + main: | + from myapp.models import Blog, Publisher + blog = Blog() + publisher = Publisher() + Publisher.objects.filter(blogs=Blog()) + Publisher.objects.filter(blogs__id=1) + + Publisher.objects.filter(blogs=publisher) # E: Incompatible type for lookup 'blogs': (got "Publisher", expected "Union[Blog, int, None]") + Publisher.objects.filter(blogs__id=publisher) # E: Incompatible type for lookup 'blogs__id': (got "Publisher", expected "Union[str, int]") + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class Publisher(models.Model): + pass + class Blog(models.Model): + publisher = models.ForeignKey(Publisher, on_delete=models.CASCADE, related_name='blogs') + + +- case: many_to_many_lookups + main: | + from myapp.models import Book, Author + book = Book() + author = Author() + + Book.objects.filter(authors=author) + Book.objects.filter(authors=book) # E: Incompatible type for lookup 'authors': (got "Book", expected "Union[Author, int, None]") + Book.objects.filter(authors='hello') # E: Incompatible type for lookup 'authors': (got "str", expected "Union[Author, int, None]") + + Author.objects.filter(books=book) + Author.objects.filter(books=author) # E: Incompatible type for lookup 'books': (got "Author", expected "Union[Book, int, None]") + Author.objects.filter(books='hello') # E: Incompatible type for lookup 'books': (got "str", expected "Union[Book, int, None]") + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class Book(models.Model): + pass + class Author(models.Model): + books = models.ManyToManyField(Book, related_name='authors') + + +- case: one_to_one_lookups + main: | + from myapp.models import User, Profile + user = User() + profile = Profile() + User.objects.filter(profile=profile) + User.objects.filter(profile=user) # E: Incompatible type for lookup 'profile': (got "User", expected "Union[Profile, int, None]") + User.objects.filter(profile='hello') # E: Incompatible type for lookup 'profile': (got "str", expected "Union[Profile, int, None]") + Profile.objects.filter(user=user) + Profile.objects.filter(user=profile) # E: Incompatible type for lookup 'user': (got "Profile", expected "Union[User, int, None]") + Profile.objects.filter(user='hello') # E: Incompatible type for lookup 'user': (got "str", expected "Union[User, int, None]") + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class User(models.Model): + pass + class Profile(models.Model): + user = models.OneToOneField(User, on_delete=models.CASCADE, related_name='profile') + + +# TODO +- case: f_expression_simple_case + main: | + from myapp.models import User + from django.db import models + User.objects.filter(username=models.F('username2')) + User.objects.filter(username=models.F('age')) + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + + class User(models.Model): + username = models.TextField() + username2 = models.TextField() + + age = models.IntegerField() + + +# TODO +- case: f_expression_with_expression_math_is_not_supported + main: | + from myapp.models import User + from django.db import models + User.objects.filter(username=models.F('username2') + 'hello') + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class User(models.Model): + username = models.TextField() + username2 = models.TextField() + age = models.IntegerField() \ No newline at end of file diff --git a/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/managers/querysets/test_from_queryset.yml b/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/managers/querysets/test_from_queryset.yml new file mode 100644 index 00000000..e9f2ad4f --- /dev/null +++ b/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/managers/querysets/test_from_queryset.yml @@ -0,0 +1,181 @@ +- case: from_queryset_with_base_manager + main: | + from myapp.models import MyModel + reveal_type(MyModel().objects) # N: Revealed type is 'myapp.models.MyModel_NewManager[myapp.models.MyModel]' + reveal_type(MyModel().objects.get()) # N: Revealed type is 'myapp.models.MyModel*' + reveal_type(MyModel().objects.queryset_method()) # N: Revealed type is 'builtins.str' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + from django.db.models.manager import BaseManager + + class ModelQuerySet(models.QuerySet): + def queryset_method(self) -> str: + return 'hello' + NewManager = BaseManager.from_queryset(ModelQuerySet) + class MyModel(models.Model): + objects = NewManager() + +- case: from_queryset_with_manager + main: | + from myapp.models import MyModel + reveal_type(MyModel().objects) # N: Revealed type is 'myapp.models.MyModel_NewManager[myapp.models.MyModel]' + reveal_type(MyModel().objects.get()) # N: Revealed type is 'myapp.models.MyModel*' + reveal_type(MyModel().objects.queryset_method()) # N: Revealed type is 'builtins.str' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + + class ModelQuerySet(models.QuerySet): + def queryset_method(self) -> str: + return 'hello' + + NewManager = models.Manager.from_queryset(ModelQuerySet) + class MyModel(models.Model): + objects = NewManager() + +- case: from_queryset_returns_intersection_of_manager_and_queryset + main: | + from myapp.models import MyModel, NewManager + reveal_type(NewManager()) # N: Revealed type is 'myapp.models.NewManager' + reveal_type(MyModel.objects) # N: Revealed type is 'myapp.models.MyModel_NewManager[myapp.models.MyModel]' + reveal_type(MyModel.objects.get()) # N: Revealed type is 'Any' + reveal_type(MyModel.objects.manager_only_method()) # N: Revealed type is 'builtins.int' + reveal_type(MyModel.objects.manager_and_queryset_method()) # N: Revealed type is 'builtins.str' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class ModelBaseManager(models.Manager): + def manager_only_method(self) -> int: + return 1 + class ModelQuerySet(models.QuerySet): + def manager_and_queryset_method(self) -> str: + return 'hello' + + NewManager = ModelBaseManager.from_queryset(ModelQuerySet) + class MyModel(models.Model): + objects = NewManager() + +- case: from_queryset_with_class_name_provided + main: | + from myapp.models import MyModel, NewManager + reveal_type(NewManager()) # N: Revealed type is 'myapp.models.NewManager' + reveal_type(MyModel.objects) # N: Revealed type is 'myapp.models.MyModel_NewManager[myapp.models.MyModel]' + reveal_type(MyModel.objects.get()) # N: Revealed type is 'Any' + reveal_type(MyModel.objects.manager_only_method()) # N: Revealed type is 'builtins.int' + reveal_type(MyModel.objects.manager_and_queryset_method()) # N: Revealed type is 'builtins.str' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class ModelBaseManager(models.Manager): + def manager_only_method(self) -> int: + return 1 + class ModelQuerySet(models.QuerySet): + def manager_and_queryset_method(self) -> str: + return 'hello' + + NewManager = ModelBaseManager.from_queryset(ModelQuerySet, class_name='NewManager') + class MyModel(models.Model): + objects = NewManager() + +- case: from_queryset_with_class_inheritance + main: | + from myapp.models import MyModel + reveal_type(MyModel().objects) # N: Revealed type is 'myapp.models.MyModel_NewManager[myapp.models.MyModel]' + reveal_type(MyModel().objects.get()) # N: Revealed type is 'myapp.models.MyModel*' + reveal_type(MyModel().objects.queryset_method()) # N: Revealed type is 'builtins.str' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + from django.db.models.manager import BaseManager + class BaseQuerySet(models.QuerySet): + def queryset_method(self) -> str: + return 'hello' + class ModelQuerySet(BaseQuerySet): + pass + + NewManager = BaseManager.from_queryset(ModelQuerySet) + class MyModel(models.Model): + objects = NewManager() + +- case: from_queryset_with_manager_in_another_directory_and_imports + main: | + from myapp.models import MyModel + reveal_type(MyModel().objects) # N: Revealed type is 'myapp.models.MyModel_NewManager[myapp.models.MyModel]' + reveal_type(MyModel().objects.get()) # N: Revealed type is 'myapp.models.MyModel*' + reveal_type(MyModel().objects.queryset_method) # N: Revealed type is 'def (param: Union[builtins.str, None] =) -> Union[builtins.str, None]' + reveal_type(MyModel().objects.queryset_method('str')) # N: Revealed type is 'Union[builtins.str, None]' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + from myapp.managers import NewManager + + class MyModel(models.Model): + objects = NewManager() + - path: myapp/managers.py + content: | + from typing import Optional + from django.db import models + + class ModelQuerySet(models.QuerySet): + def queryset_method(self, param: Optional[str] = None) -> Optional[str]: + return param + + NewManager = models.Manager.from_queryset(ModelQuerySet) + +- case: from_queryset_with_inherited_manager_and_typing_no_return + disable_cache: true + main: | + from myapp.models import MyModel + reveal_type(MyModel().objects) # N: Revealed type is 'myapp.models.MyModel_NewManager[myapp.models.MyModel]' + reveal_type(MyModel().objects.get()) # N: Revealed type is 'myapp.models.MyModel*' + reveal_type(MyModel().objects.base_queryset_method) # N: Revealed type is 'def (param: Union[builtins.int, builtins.str]) -> ' + reveal_type(MyModel().objects.base_queryset_method(2)) # N: Revealed type is '' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + from myapp.managers import NewManager + class MyModel(models.Model): + objects = NewManager() + - path: myapp/managers.py + content: | + from django.db import models + from myapp.base_queryset import BaseQuerySet + class ModelQuerySet(BaseQuerySet): + pass + NewManager = models.Manager.from_queryset(ModelQuerySet) + - path: myapp/base_queryset.py + content: | + from typing import NoReturn, Union + from django.db import models + class BaseQuerySet(models.QuerySet): + def base_queryset_method(self, param: Union[int, str]) -> NoReturn: + raise ValueError \ No newline at end of file diff --git a/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/managers/querysets/test_values.yml b/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/managers/querysets/test_values.yml new file mode 100644 index 00000000..36461c1a --- /dev/null +++ b/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/managers/querysets/test_values.yml @@ -0,0 +1,126 @@ +- case: queryset_values_method_returns_typeddict + main: | + from myapp.models import Blog + values = Blog.objects.values('num_posts', 'text').get() + reveal_type(values) # N: Revealed type is 'TypedDict({'num_posts': builtins.int, 'text': builtins.str})' + reveal_type(values["num_posts"]) # N: Revealed type is 'builtins.int' + reveal_type(values["text"]) # N: Revealed type is 'builtins.str' + + values_pk = Blog.objects.values('pk').get() + reveal_type(values_pk) # N: Revealed type is 'TypedDict({'pk': builtins.int})' + reveal_type(values_pk["pk"]) # N: Revealed type is 'builtins.int' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class Blog(models.Model): + num_posts = models.IntegerField() + text = models.CharField(max_length=100) + +- case: queryset_values_all_values + main: | + from myapp.models import Blog + all_values_dict = Blog.objects.values().get() + reveal_type(all_values_dict) # N: Revealed type is 'TypedDict({'id': builtins.int, 'num_posts': builtins.int, 'text': builtins.str})' + reveal_type(all_values_dict["id"]) # N: Revealed type is 'builtins.int' + reveal_type(all_values_dict["num_posts"]) # N: Revealed type is 'builtins.int' + reveal_type(all_values_dict["text"]) # N: Revealed type is 'builtins.str' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class Publisher(models.Model): + pass + class Blog(models.Model): + num_posts = models.IntegerField() + text = models.CharField(max_length=100) + +- case: queryset_foreign_key_object_always_a_primary_key + main: | + from myapp.models import Blog + values1 = Blog.objects.values('publisher').get() + reveal_type(values1) # N: Revealed type is 'TypedDict({'publisher': builtins.int})' + reveal_type(values1['publisher']) # N: Revealed type is 'builtins.int' + + values2 = Blog.objects.values('publisher_id').get() + reveal_type(values2) # N: Revealed type is 'TypedDict({'publisher_id': builtins.int})' + reveal_type(values2["publisher_id"]) # N: Revealed type is 'builtins.int' + + # all values return _id version + all_values = Blog.objects.values().get() + reveal_type(all_values) # N: Revealed type is 'TypedDict({'id': builtins.int, 'publisher_id': builtins.int})' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class Publisher(models.Model): + pass + class Blog(models.Model): + publisher = models.ForeignKey(to=Publisher, on_delete=models.CASCADE) + +- case: values_with_related_model_fields + main: | + from myapp.models import Entry + values = Entry.objects.values('blog__num_articles', 'blog__publisher__name').get() + reveal_type(values) # N: Revealed type is 'TypedDict({'blog__num_articles': builtins.int, 'blog__publisher__name': builtins.str})' + + pk_values = Entry.objects.values('blog__pk', 'blog__publisher__pk').get() + reveal_type(pk_values) # N: Revealed type is 'TypedDict({'blog__pk': builtins.int, 'blog__publisher__pk': builtins.int})' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class Publisher(models.Model): + name = models.CharField(max_length=100) + class Blog(models.Model): + num_articles = models.IntegerField() + publisher = models.ForeignKey(to=Publisher, on_delete=models.CASCADE) + class Entry(models.Model): + blog = models.ForeignKey(Blog, on_delete=models.CASCADE) + +- case: select_all_related_model_values_for_every_current_value + main: | + from myapp.models import Publisher + related_model_values = Publisher.objects.values('id', 'blog__name').get() + reveal_type(related_model_values) # N: Revealed type is 'TypedDict({'id': builtins.int, 'blog__name': builtins.str})' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class Publisher(models.Model): + pass + class Blog(models.Model): + name = models.CharField(max_length=100) + publisher = models.ForeignKey(Publisher, on_delete=models.CASCADE) + +- case: values_of_many_to_many_field + main: | + from myapp.models import Author, Book + reveal_type(Book.objects.values('authors')) # N: Revealed type is 'django.db.models.query.ValuesQuerySet[myapp.models.Book, TypedDict({'authors': builtins.int})]' + reveal_type(Author.objects.values('books')) # N: Revealed type is 'django.db.models.query.ValuesQuerySet[myapp.models.Author, TypedDict({'books': builtins.int})]' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class Author(models.Model): + pass + class Book(models.Model): + authors = models.ManyToManyField(Author, related_name='books') diff --git a/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/managers/querysets/test_values_list.yml b/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/managers/querysets/test_values_list.yml new file mode 100644 index 00000000..c67f2658 --- /dev/null +++ b/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/managers/querysets/test_values_list.yml @@ -0,0 +1,243 @@ +- case: values_list_simple_field_returns_queryset_of_tuples + main: | + from myapp.models import MyUser + reveal_type(MyUser.objects.values_list('name').get()) # N: Revealed type is 'Tuple[builtins.str]' + reveal_type(MyUser.objects.values_list('id', 'name').get()) # N: Revealed type is 'Tuple[builtins.int, builtins.str]' + + values_tuple = MyUser.objects.values_list('name', 'age').get() + reveal_type(values_tuple[0]) # N: Revealed type is 'builtins.str' + reveal_type(values_tuple[1]) # N: Revealed type is 'builtins.int' + + # no fields specified return all fields + all_values_tuple = MyUser.objects.values_list().get() + reveal_type(all_values_tuple) # N: Revealed type is 'Tuple[builtins.int, builtins.str, builtins.int]' + + # pk as field + pk_values = MyUser.objects.values_list('pk').get() + reveal_type(pk_values) # N: # N: Revealed type is 'Tuple[builtins.int]' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class MyUser(models.Model): + name = models.CharField(max_length=100) + age = models.IntegerField() + +- case: values_list_related_model_fields + main: | + from myapp.models import Post, Blog + values_tuple = Post.objects.values_list('blog', 'blog__num_posts', 'blog__publisher', 'blog__publisher__name').get() + reveal_type(values_tuple[0]) # N: Revealed type is 'myapp.models.Blog' + reveal_type(values_tuple[1]) # N: Revealed type is 'builtins.int' + reveal_type(values_tuple[2]) # N: Revealed type is 'myapp.models.Publisher' + reveal_type(values_tuple[3]) # N: Revealed type is 'builtins.str' + + reverse_fields_list = Blog.objects.values_list('post__text').get() + reveal_type(reverse_fields_list) # N: Revealed type is 'Tuple[builtins.str]' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class Publisher(models.Model): + name = models.CharField(max_length=100) + class Blog(models.Model): + num_posts = models.IntegerField() + publisher = models.ForeignKey(to=Publisher, on_delete=models.CASCADE) + class Post(models.Model): + text = models.CharField(max_length=100) + blog = models.ForeignKey(to=Blog, on_delete=models.CASCADE) + +- case: values_list_flat_true_methods + main: | + from myapp.models import MyUser, MyUser2 + reveal_type(MyUser.objects.values_list('name', flat=True).get()) # N: Revealed type is 'builtins.str*' + reveal_type(MyUser.objects.values_list('name', 'age', flat=True).get()) + + # flat=True without specified fields returns primary key values + reveal_type(MyUser.objects.values_list(flat=True)[0]) # N: Revealed type is 'builtins.int*' + reveal_type(MyUser2.objects.values_list(flat=True)[0]) # N: Revealed type is 'builtins.str*' + out: | + main:3: error: 'flat' is not valid when 'values_list' is called with more than one field + main:3: note: Revealed type is 'Any' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class MyUser(models.Model): + name = models.CharField(max_length=100) + age = models.IntegerField() + class MyUser2(models.Model): + name = models.CharField(max_length=100, primary_key=True) + +- case: values_list_named_true + main: | + from myapp.models import MyUser + values_named_tuple = MyUser.objects.values_list('name', 'age', named=True).get() + reveal_type(values_named_tuple) # N: Revealed type is 'Tuple[builtins.str, builtins.int, fallback=main.Row]' + reveal_type(values_named_tuple.name) # N: Revealed type is 'builtins.str' + reveal_type(values_named_tuple.age) # N: Revealed type is 'builtins.int' + + # no fields specified, returns all fields namedtuple + all_values_named_tuple = MyUser.objects.values_list(named=True).get() + reveal_type(all_values_named_tuple.id) # N: Revealed type is 'builtins.int' + reveal_type(all_values_named_tuple.name) # N: Revealed type is 'builtins.str' + reveal_type(all_values_named_tuple.age) # N: Revealed type is 'builtins.int' + reveal_type(all_values_named_tuple.is_admin) # N: Revealed type is 'builtins.bool' + + # pk as field + pk_values = MyUser.objects.values_list('pk', named=True).get() + reveal_type(pk_values) # N: Revealed type is 'Tuple[builtins.int, fallback=main.Row2]' + reveal_type(pk_values.pk) # N: # N: Revealed type is 'builtins.int' + + # values_list(named=True) inside function + def func() -> None: + from myapp.models import MyUser + reveal_type(MyUser.objects.values_list('name', named=True).get()) # N: Revealed type is 'Tuple[builtins.str, fallback=main.Row3]' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class MyUser(models.Model): + name = models.CharField(max_length=100) + age = models.IntegerField() + is_admin = models.BooleanField() + +- case: values_list_flat_true_named_true_error + main: | + from myapp.models import MyUser + reveal_type(MyUser.objects.values_list('name', flat=True, named=True).get()) + out: | + main:2: error: 'flat' and 'named' can't be used together + main:2: note: Revealed type is 'Any' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class MyUser(models.Model): + name = models.CharField(max_length=100) + +- case: invalid_lookups + main: | + from myapp.models import Blog + reveal_type(Blog.objects.values_list('unknown').get()) + reveal_type(Blog.objects.values_list('unknown', flat=True).get()) + reveal_type(Blog.objects.values_list('unknown', named=True).get()) + reveal_type(Blog.objects.values_list('publisher__unknown').get()) + out: | + main:2: error: Cannot resolve keyword 'unknown' into field. Choices are: id, publisher, publisher_id + main:2: note: Revealed type is 'Any' + main:3: error: Cannot resolve keyword 'unknown' into field. Choices are: id, publisher, publisher_id + main:3: note: Revealed type is 'Any' + main:4: error: Cannot resolve keyword 'unknown' into field. Choices are: id, publisher, publisher_id + main:4: note: Revealed type is 'Any' + main:5: note: Revealed type is 'Tuple[Any]' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class Publisher(models.Model): + pass + class Blog(models.Model): + publisher = models.ForeignKey(to=Publisher, on_delete=models.CASCADE) + +- case: named_true_with_related_model_fields + main: | + from myapp.models import Entry, Blog + values = Entry.objects.values_list('blog__num_articles', 'blog__publisher__name', named=True).get() + reveal_type(values.blog__num_articles) # N: Revealed type is 'builtins.int' + reveal_type(values.blog__publisher__name) # N: Revealed type is 'builtins.str' + + pk_values = Entry.objects.values_list('blog__pk', 'blog__publisher__pk', named=True).get() + reveal_type(pk_values.blog__pk) # N: Revealed type is 'builtins.int' + reveal_type(pk_values.blog__publisher__pk) # N: Revealed type is 'builtins.int' + + # reverse relation + reverse_values = Blog.objects.values_list('entry__text', named=True).get() + reveal_type(reverse_values.entry__text) # N: Revealed type is 'builtins.str' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class Publisher(models.Model): + name = models.CharField(max_length=100) + class Blog(models.Model): + num_articles = models.IntegerField() + publisher = models.ForeignKey(to=Publisher, on_delete=models.CASCADE) + class Entry(models.Model): + text = models.CharField(max_length=100) + blog = models.ForeignKey(Blog, on_delete=models.CASCADE) + +- case: values_list_flat_true_with_ids + main: | + from myapp.models import Blog, Publisher + reveal_type(Blog.objects.values_list('id', flat=True)) # N: Revealed type is 'django.db.models.query.ValuesQuerySet[myapp.models.Blog, builtins.int]' + reveal_type(Blog.objects.values_list('publisher_id', flat=True)) # N: Revealed type is 'django.db.models.query.ValuesQuerySet[myapp.models.Blog, builtins.int]' + # is Iterable[int] + reveal_type(list(Blog.objects.values_list('id', flat=True))) # N: Revealed type is 'builtins.list[builtins.int*]' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class Publisher(models.Model): + pass + class Blog(models.Model): + publisher = models.ForeignKey(to=Publisher, on_delete=models.CASCADE) + +- case: subclass_of_queryset_has_proper_typings_on_methods + main: | + from myapp.models import TransactionQuerySet + reveal_type(TransactionQuerySet()) # N: Revealed type is 'myapp.models.TransactionQuerySet' + reveal_type(TransactionQuerySet().values()) # N: Revealed type is 'django.db.models.query.ValuesQuerySet[myapp.models.Transaction, TypedDict({'id': builtins.int, 'total': builtins.int})]' + reveal_type(TransactionQuerySet().values_list()) # N: Revealed type is 'django.db.models.query.ValuesQuerySet[myapp.models.Transaction, Tuple[builtins.int, builtins.int]]' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class TransactionQuerySet(models.QuerySet['Transaction']): + pass + class Transaction(models.Model): + total = models.IntegerField() + +- case: values_list_of_many_to_many_field + main: | + from myapp.models import Author, Book + reveal_type(Book.objects.values_list('authors')) # N: Revealed type is 'django.db.models.query.ValuesQuerySet[myapp.models.Book, Tuple[builtins.int]]' + reveal_type(Author.objects.values_list('books')) # N: Revealed type is 'django.db.models.query.ValuesQuerySet[myapp.models.Author, Tuple[builtins.int]]' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class Author(models.Model): + pass + class Book(models.Model): + authors = models.ManyToManyField(Author, related_name='books') \ No newline at end of file diff --git a/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/managers/test_managers.yml b/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/managers/test_managers.yml new file mode 100644 index 00000000..82206d64 --- /dev/null +++ b/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/managers/test_managers.yml @@ -0,0 +1,337 @@ +- case: test_every_model_has_objects_queryset_available + main: | + from myapp.models import User + reveal_type(User.objects) # N: Revealed type is 'django.db.models.manager.Manager[myapp.models.User]' + reveal_type(User.objects.get()) # N: Revealed type is 'myapp.models.User*' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class User(models.Model): + pass + +- case: every_model_has_its_own_objects_queryset + main: | + from myapp.models import Parent, Child + reveal_type(Parent.objects) # N: Revealed type is 'django.db.models.manager.Manager[myapp.models.Parent]' + reveal_type(Child.objects) # N: Revealed type is 'django.db.models.manager.Manager[myapp.models.Child]' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class Parent(models.Model): + pass + class Child(Parent): + pass + +- case: test_model_objects_attribute_present_in_case_of_model_cls_passed_as_generic_parameter + main: | + from myapp.models import Base, MyModel + base_instance = Base(MyModel) + reveal_type(base_instance.model_cls._default_manager) # N: Revealed type is 'django.db.models.manager.Manager[myapp.models.MyModel]' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from typing import TypeVar, Generic, Type + from django.db import models + + _T = TypeVar('_T', bound=models.Model) + class Base(Generic[_T]): + def __init__(self, model_cls: Type[_T]): + self.model_cls = model_cls + reveal_type(self.model_cls._default_manager) # N: Revealed type is 'django.db.models.manager.BaseManager[django.db.models.base.Model]' + class MyModel(models.Model): + pass + class Child(Base[MyModel]): + def method(self) -> None: + reveal_type(self.model_cls._default_manager) # N: Revealed type is 'django.db.models.manager.Manager[myapp.models.MyModel]' + +- case: if_custom_manager_defined_it_is_set_to_default_manager + main: | + from myapp.models import MyModel + reveal_type(MyModel._default_manager) # N: Revealed type is 'myapp.models.CustomManager[myapp.models.MyModel]' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from typing import TypeVar + from django.db import models + _T = TypeVar('_T', bound=models.Model) + class CustomManager(models.Manager[_T]): + pass + class MyModel(models.Model): + manager = CustomManager['MyModel']() + +- case: if_default_manager_name_is_passed_set_default_manager_to_it + main: | + from myapp.models import MyModel + reveal_type(MyModel._default_manager) # N: Revealed type is 'myapp.models.Manager2[myapp.models.MyModel]' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from typing import TypeVar + from django.db import models + + _T = TypeVar('_T', bound=models.Model) + class Manager1(models.Manager[_T]): + pass + class Manager2(models.Manager[_T]): + pass + class MyModel(models.Model): + class Meta: + default_manager_name = 'm2' + m1 = Manager1['MyModel']() + m2 = Manager2['MyModel']() + +- case: test_leave_as_is_if_objects_is_set_and_fill_typevars_with_outer_class + main: | + from myapp.models import MyUser + reveal_type(MyUser.objects) # N: Revealed type is 'myapp.models.UserManager[myapp.models.MyUser]' + reveal_type(MyUser.objects.get()) # N: Revealed type is 'myapp.models.MyUser*' + reveal_type(MyUser.objects.get_or_404()) # N: Revealed type is 'myapp.models.MyUser' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + + class UserManager(models.Manager['MyUser']): + def get_or_404(self) -> 'MyUser': + pass + + class MyUser(models.Model): + objects = UserManager() + +- case: model_imported_from_different_file + main: | + from myapp.models import Inventory, Band + reveal_type(Inventory.objects) # N: Revealed type is 'django.db.models.manager.Manager[myapp.models.main.Inventory]' + reveal_type(Band.objects) # N: Revealed type is 'django.db.models.manager.Manager[myapp.models.Band]' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models/__init__.py + content: | + from django.db import models + from .main import Inventory + class Band(models.Model): + pass + - path: myapp/models/main.py + content: | + from django.db import models + class Inventory(models.Model): + pass + +- case: managers_that_defined_on_other_models_do_not_influence + main: | + from myapp.models import AbstractPerson, Book + reveal_type(AbstractPerson.abstract_persons) # N: Revealed type is 'django.db.models.manager.Manager[myapp.models.AbstractPerson]' + reveal_type(Book.published_objects) # N: Revealed type is 'myapp.models.PublishedBookManager[myapp.models.Book]' + Book.published_objects.create(title='hello') + reveal_type(Book.annotated_objects) # N: Revealed type is 'myapp.models.AnnotatedBookManager[myapp.models.Book]' + Book.annotated_objects.create(title='hello') + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + + class AbstractPerson(models.Model): + abstract_persons = models.Manager['AbstractPerson']() + class PublishedBookManager(models.Manager['Book']): + pass + class AnnotatedBookManager(models.Manager['Book']): + pass + class Book(models.Model): + title = models.CharField(max_length=50) + published_objects = PublishedBookManager() + annotated_objects = AnnotatedBookManager() + +- case: managers_inherited_from_abstract_classes_multiple_inheritance + main: | + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class CustomManager1(models.Manager['AbstractBase1']): + pass + class AbstractBase1(models.Model): + class Meta: + abstract = True + name = models.CharField(max_length=50) + manager1 = CustomManager1() + class CustomManager2(models.Manager['AbstractBase2']): + pass + class AbstractBase2(models.Model): + class Meta: + abstract = True + value = models.CharField(max_length=50) + restricted = CustomManager2() + + class Child(AbstractBase1, AbstractBase2): + pass + +- case: model_has_a_manager_of_the_same_type + main: | + from myapp.models import UnrelatedModel, MyModel + reveal_type(UnrelatedModel.objects) # N: Revealed type is 'django.db.models.manager.Manager[myapp.models.UnrelatedModel]' + reveal_type(UnrelatedModel.objects.first()) # N: Revealed type is 'Union[myapp.models.UnrelatedModel*, None]' + + reveal_type(MyModel.objects) # N: Revealed type is 'django.db.models.manager.Manager[myapp.models.MyModel]' + reveal_type(MyModel.objects.first()) # N: Revealed type is 'Union[myapp.models.MyModel*, None]' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class UnrelatedModel(models.Model): + objects = models.Manager['UnrelatedModel']() + + class MyModel(models.Model): + pass + +- case: manager_without_annotation_of_the_model_gets_it_from_outer_one + main: | + from myapp.models import UnrelatedModel2, MyModel2 + reveal_type(UnrelatedModel2.objects) # N: Revealed type is 'django.db.models.manager.Manager[myapp.models.UnrelatedModel2]' + reveal_type(UnrelatedModel2.objects.first()) # N: Revealed type is 'Union[myapp.models.UnrelatedModel2*, None]' + + reveal_type(MyModel2.objects) # N: Revealed type is 'django.db.models.manager.Manager[myapp.models.MyModel2]' + reveal_type(MyModel2.objects.first()) # N: Revealed type is 'Union[myapp.models.MyModel2*, None]' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class UnrelatedModel2(models.Model): + objects = models.Manager() + + class MyModel2(models.Model): + pass + +- case: inherited_manager_has_the_proper_type_of_model + main: | + from myapp.models import ParentOfMyModel3, MyModel3 + reveal_type(ParentOfMyModel3.objects) # N: Revealed type is 'django.db.models.manager.Manager[myapp.models.ParentOfMyModel3]' + reveal_type(ParentOfMyModel3.objects.first()) # N: Revealed type is 'Union[myapp.models.ParentOfMyModel3*, None]' + + reveal_type(MyModel3.objects) # N: Revealed type is 'django.db.models.manager.Manager[myapp.models.MyModel3]' + reveal_type(MyModel3.objects.first()) # N: Revealed type is 'Union[myapp.models.MyModel3*, None]' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class ParentOfMyModel3(models.Model): + objects = models.Manager() + + class MyModel3(ParentOfMyModel3): + pass + +- case: inheritance_with_explicit_type_on_child_manager + main: | + from myapp.models import ParentOfMyModel4, MyModel4 + reveal_type(ParentOfMyModel4.objects) # N: Revealed type is 'django.db.models.manager.Manager[myapp.models.ParentOfMyModel4]' + reveal_type(ParentOfMyModel4.objects.first()) # N: Revealed type is 'Union[myapp.models.ParentOfMyModel4*, None]' + + reveal_type(MyModel4.objects) # N: Revealed type is 'django.db.models.manager.Manager[myapp.models.MyModel4]' + reveal_type(MyModel4.objects.first()) # N: Revealed type is 'Union[myapp.models.MyModel4*, None]' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class ParentOfMyModel4(models.Model): + objects = models.Manager() + + class MyModel4(ParentOfMyModel4): + objects = models.Manager['MyModel4']() + +# TODO: make it work someday +#- case: inheritance_of_two_models_with_custom_objects_manager +# main: | +# from myapp.models import MyBaseUser, MyUser +# reveal_type(MyBaseUser.objects) # N: Revealed type is 'myapp.models.MyBaseManager[myapp.models.MyBaseUser]' +# reveal_type(MyBaseUser.objects.get()) # N: Revealed type is 'myapp.models.MyBaseUser' +# +# reveal_type(MyUser.objects) # N: Revealed type is 'myapp.models.MyManager[myapp.models.MyUser]' +# reveal_type(MyUser.objects.get()) # N: Revealed type is 'myapp.models.MyUser' +# installed_apps: +# - myapp +# files: +# - path: myapp/__init__.py +# - path: myapp/models.py +# content: | +# from django.db import models +# +# class MyBaseManager(models.Manager): +# pass +# class MyBaseUser(models.Model): +# objects = MyBaseManager() +# +# class MyManager(models.Manager): +# pass +# class MyUser(MyBaseUser): +# objects = MyManager() + +- case: custom_manager_returns_proper_model_types + main: | + from myapp.models import User + reveal_type(User.objects) # N: Revealed type is 'myapp.models.User_MyManager2[myapp.models.User]' + reveal_type(User.objects.select_related()) # N: Revealed type is 'myapp.models.User_MyManager2[myapp.models.User]' + reveal_type(User.objects.get()) # N: Revealed type is 'myapp.models.User*' + reveal_type(User.objects.get_instance()) # N: Revealed type is 'builtins.int' + reveal_type(User.objects.get_instance_untyped('hello')) # N: Revealed type is 'Any' + + from myapp.models import ChildUser + reveal_type(ChildUser.objects) # N: Revealed type is 'myapp.models.ChildUser_MyManager2[myapp.models.ChildUser]' + reveal_type(ChildUser.objects.select_related()) # N: Revealed type is 'myapp.models.ChildUser_MyManager2[myapp.models.ChildUser]' + reveal_type(ChildUser.objects.get()) # N: Revealed type is 'myapp.models.ChildUser*' + reveal_type(ChildUser.objects.get_instance()) # N: Revealed type is 'builtins.int' + reveal_type(ChildUser.objects.get_instance_untyped('hello')) # N: Revealed type is 'Any' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class MyManager(models.Manager): + def get_instance(self) -> int: + pass + def get_instance_untyped(self, name): + pass + class User(models.Model): + objects = MyManager() + class ChildUser(models.Model): + objects = MyManager() diff --git a/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/models/test_contrib_models.yml b/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/models/test_contrib_models.yml new file mode 100644 index 00000000..946d2deb --- /dev/null +++ b/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/models/test_contrib_models.yml @@ -0,0 +1,28 @@ +- case: contrib_auth_model_fields + main: | + from django.contrib.auth.models import User + reveal_type(User().username) # N: Revealed type is 'builtins.str*' + reveal_type(User().password) # N: Revealed type is 'builtins.str*' + reveal_type(User().first_name) # N: Revealed type is 'builtins.str*' + reveal_type(User().last_name) # N: Revealed type is 'builtins.str*' + reveal_type(User().email) # N: Revealed type is 'builtins.str*' + reveal_type(User().is_staff) # N: Revealed type is 'builtins.bool*' + reveal_type(User().is_active) # N: Revealed type is 'builtins.bool*' + reveal_type(User().date_joined) # N: Revealed type is 'datetime.datetime*' + reveal_type(User().last_login) # N: Revealed type is 'Union[datetime.datetime, None]' + reveal_type(User().is_authenticated) # N: Revealed type is 'Literal[True]' + reveal_type(User().is_anonymous) # N: Revealed type is 'Literal[False]' + + from django.contrib.auth.models import AnonymousUser + reveal_type(AnonymousUser().is_authenticated) # N: Revealed type is 'Literal[False]' + reveal_type(AnonymousUser().is_anonymous) # N: Revealed type is 'Literal[True]' + + from django.contrib.auth.models import Permission + reveal_type(Permission().name) # N: Revealed type is 'builtins.str*' + reveal_type(Permission().codename) # N: Revealed type is 'builtins.str*' + + from django.contrib.auth.models import PermissionsMixin + reveal_type(PermissionsMixin().is_superuser) # N: Revealed type is 'builtins.bool*' + + from django.contrib.auth.models import Group + reveal_type(Group().name) # N: Revealed type is 'builtins.str*' diff --git a/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/models/test_create.yml b/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/models/test_create.yml new file mode 100644 index 00000000..37d46bdf --- /dev/null +++ b/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/models/test_create.yml @@ -0,0 +1,113 @@ +- case: default_manager_create_is_typechecked + main: | + from myapp.models import User + User.objects.create(pk=1, name='Max', age=10) + User.objects.create(age=[]) # E: Incompatible type for "age" of "User" (got "List[Any]", expected "Union[float, int, str, Combinable]") + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + + class User(models.Model): + name = models.CharField(max_length=100) + age = models.IntegerField() + +- case: model_recognises_parent_attributes + main: | + from myapp.models import Child + Child.objects.create(name='Maxim', lastname='Maxim2') + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + + class Parent(models.Model): + name = models.CharField(max_length=100) + class Child(Parent): + lastname = models.CharField(max_length=100) + +- case: deep_multiple_inheritance_with_create + main: | + from myapp.models import Child4 + Child4.objects.create(name1='n1', name2='n2', value=1, value4=4) + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + + class Parent1(models.Model): + name1 = models.CharField(max_length=50) + class Parent2(models.Model): + id2 = models.AutoField(primary_key=True) + name2 = models.CharField(max_length=50) + + class Child1(Parent1, Parent2): + value = models.IntegerField() + class Child4(Child1): + value4 = models.IntegerField() + +- case: optional_id_fields_for_create_is_error_if_not_autofield + main: | + from myapp.models import Publisher, Book + + Book.objects.create(id=None) # E: Incompatible type for "id" of "Book" (got "None", expected "Union[float, int, str, Combinable]") + Book.objects.create(publisher=None) # E: Incompatible type for "publisher" of "Book" (got "None", expected "Union[Publisher, Combinable]") + Book.objects.create(publisher_id=None) # E: Incompatible type for "publisher_id" of "Book" (got "None", expected "Union[Combinable, int, str]") + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class Publisher(models.Model): + pass + class Book(models.Model): + id = models.IntegerField(primary_key=True) + publisher = models.ForeignKey(Publisher, on_delete=models.CASCADE) + +- case: none_for_primary_key_is_allowed_if_field_is_autogenerated + main: | + from myapp.models import Book + Book.objects.create(id=None) + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class Book(models.Model): + pass + +- case: when_default_for_primary_key_is_specified_allow_none_to_be_set + main: | + from myapp.models import MyModel + MyModel(id=None) + MyModel.objects.create(id=None) + + from myapp.models import MyModel2 + MyModel2(id=None) + MyModel2.objects.create(id=None) # E: Incompatible type for "id" of "MyModel2" (got "None", expected "Union[float, int, str, Combinable]") + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + def return_int(): + return 0 + class MyModel(models.Model): + id = models.IntegerField(primary_key=True, default=return_int) + class MyModel2(models.Model): + id = models.IntegerField(primary_key=True) diff --git a/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/models/test_extra_methods.yml b/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/models/test_extra_methods.yml new file mode 100644 index 00000000..846e8ab3 --- /dev/null +++ b/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/models/test_extra_methods.yml @@ -0,0 +1,56 @@ +- case: if_field_has_choices_set_model_has_get_FIELDNAME_display_method + main: | + from myapp.models import MyUser + user = MyUser(name='user', gender='M') + user.get_name_display() # E: "MyUser" has no attribute "get_name_display"; maybe "get_gender_display"? + reveal_type(user.get_gender_display()) # N: Revealed type is 'builtins.str' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + GENDER_CHOICES = ( + ('M', 'Male'), + ('F', 'Female'), + ) + class MyUser(models.Model): + name = models.CharField(max_length=100) + gender = models.CharField(max_length=100, choices=GENDER_CHOICES) + +- case: date_datetime_fields_have_get_next_by_get_previous_by + main: | + from myapp.models import MyUser + reveal_type(MyUser().get_next_by_date()) # N: Revealed type is 'myapp.models.MyUser' + reveal_type(MyUser().get_next_by_datetime()) # N: Revealed type is 'myapp.models.MyUser' + reveal_type(MyUser().get_previous_by_date()) # N: Revealed type is 'myapp.models.MyUser' + reveal_type(MyUser().get_previous_by_datetime()) # N: Revealed type is 'myapp.models.MyUser' + + # accept arbitrary kwargs + MyUser().get_next_by_date(arg1=1, arg2=2) + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class MyUser(models.Model): + date = models.DateField() + datetime = models.DateTimeField() + +- case: get_next_by_get_previous_by_absent_if_null_true + main: | + from myapp.models import MyUser + MyUser().get_next_by_date() # E: "MyUser" has no attribute "get_next_by_date" + MyUser().get_previous_by_date() # E: "MyUser" has no attribute "get_previous_by_date" + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class MyUser(models.Model): + date = models.DateField(null=True) diff --git a/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/models/test_inheritance.yml b/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/models/test_inheritance.yml new file mode 100644 index 00000000..78366f43 --- /dev/null +++ b/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/models/test_inheritance.yml @@ -0,0 +1,115 @@ +- case: test_meta_nested_class_allows_subclassing_in_multiple_inheritance + main: | + from typing import Any + from django.db import models + class Mixin1(models.Model): + class Meta: + abstract = True + class Mixin2(models.Model): + class Meta: + abstract = True + class User(Mixin1, Mixin2): + pass + +- case: test_inheritance_from_abstract_model_does_not_fail_if_field_with_id_exists + main: | + from django.db import models + class Abstract(models.Model): + class Meta: + abstract = True + class User(Abstract): + id = models.AutoField(primary_key=True) + +- case: test_typechecking_for_model_subclasses + main: | + from myapp.models import A, B, C + def service(a: A) -> int: + pass + b_instance = B() + service(b_instance) # E: Argument 1 to "service" has incompatible type "B"; expected "A" + a_instance = A() + c_instance = C() + service(a_instance) + service(c_instance) + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class A(models.Model): + pass + class B(models.Model): + b_attr = 1 + pass + class C(A): + pass + +- case: fail_if_no_such_attribute_on_model + main: | + from myapp.models import B + b_instance = B() + reveal_type(b_instance.b_attr) # N: Revealed type is 'builtins.int' + + reveal_type(b_instance.non_existent_attribute) + b_instance.non_existent_attribute = 2 + out: | + main:5: note: Revealed type is 'Any' + main:5: error: "B" has no attribute "non_existent_attribute" + main:6: error: "B" has no attribute "non_existent_attribute" + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class B(models.Model): + b_attr = 1 + pass + + +- case: fields_recognized_if_base_model_is_subclass_of_models_model + main: | + from myapp.models import User + reveal_type(User().username) # N: Revealed type is 'builtins.str*' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + from myapp.utils import MyBaseModel + class User(MyBaseModel): + username = models.CharField(max_length=100) + - path: myapp/utils.py + content: | + from django.db.models import Model + class MyBaseModel(Model): + pass + + +- case: django_contrib_gis_base_model_mixin_inheritance + main: | + from myapp.models import User + reveal_type(User().name) # N: Revealed type is 'builtins.str*' + reveal_type(User().updated_at) # N: Revealed type is 'datetime.datetime*' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + from django.contrib.gis.db import models as gis_models + class Mixin1(gis_models.Model): + class Meta: + abstract = True + class Mixin2(gis_models.Model): + updated_at = models.DateTimeField(auto_now=True) + class Meta: + abstract = True + class User(Mixin1, Mixin2): + name = models.TextField() \ No newline at end of file diff --git a/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/models/test_init.yml b/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/models/test_init.yml new file mode 100644 index 00000000..40ac5836 --- /dev/null +++ b/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/models/test_init.yml @@ -0,0 +1,257 @@ +- case: arguments_to_init_unexpected_attributes + main: | + from myapp.models import MyUser + user = MyUser(name=1, age=12) + out: | + main:2: error: Unexpected attribute "name" for model "MyUser" + main:2: error: Unexpected attribute "age" for model "MyUser" + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + + class MyUser(models.Model): + pass + +- case: plain_function_which_returns_model + main: | + from myapp.models import MyUser + def func(i: int) -> MyUser: + pass + func("hello") # E: Argument 1 to "func" has incompatible type "str"; expected "int" + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class MyUser(models.Model): + pass + +- case: arguments_to_init_from_class_incompatible_type + main: | + from myapp.models import MyUser + user = MyUser(name='hello', age=[]) + out: | + main:2: error: Incompatible type for "age" of "MyUser" (got "List[Any]", expected "Union[float, int, str, Combinable]") + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + + class MyUser(models.Model): + name = models.CharField(max_length=100) + age = models.IntegerField() + +- case: arguments_to_init_combined_from_base_classes + main: | + from myapp.models import BaseUser, ChildUser + user = ChildUser(name='Max', age=12, lastname='Lastname') + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + + class BaseUser(models.Model): + name = models.CharField(max_length=100) + age = models.IntegerField() + class ChildUser(BaseUser): + lastname = models.CharField(max_length=100) + +- case: fields_from_abstract_user_propagate_to_init + main: | + from myapp.models import MyUser + user = MyUser(name='Maxim') + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class AbstractUser(models.Model): + class Meta: + abstract = True + name = models.CharField(max_length=100) + class MyUser(AbstractUser): + pass + +- case: pk_refers_to_primary_key_and_could_be_passed_to_init + main: | + from myapp.models import MyUser1, MyUser2 + user2 = MyUser1(pk='hello') + user3 = MyUser2(pk=1, name='maxim') + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + + class MyUser1(models.Model): + mypk = models.CharField(primary_key=True) + class MyUser2(models.Model): + name = models.CharField(max_length=100) + +- case: typechecking_of_pk + main: | + from myapp.models import MyUser1 + user = MyUser1(pk=[]) # E: Incompatible type for "pk" of "MyUser1" (got "List[Any]", expected "Union[float, int, str, Combinable, None]") + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + + class MyUser1(models.Model): + mypk = models.IntegerField(primary_key=True) + +- case: set_foreign_key_by_its_primary_key + main: | + from datetime import datetime + now = datetime.now() + + from myapp.models import Publisher, PublisherDatetime, Book + Book(publisher_id=1, publisher_dt_id=now) + Book(publisher_id=[], publisher_dt_id=now) # E: Incompatible type for "publisher_id" of "Book" (got "List[Any]", expected "Union[Combinable, int, str, None]") + Book(publisher_id=1, publisher_dt_id=1) # E: Incompatible type for "publisher_dt_id" of "Book" (got "int", expected "Union[str, date, Combinable, None]") + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + + class Publisher(models.Model): + pass + class PublisherDatetime(models.Model): + dt_pk = models.DateTimeField(primary_key=True) + class Book(models.Model): + publisher = models.ForeignKey(Publisher, on_delete=models.CASCADE) + publisher_dt = models.ForeignKey(PublisherDatetime, on_delete=models.CASCADE) + +- case: setting_value_to_an_array_of_ints + main: | + from typing import List, Tuple + from myapp.models import MyModel + array_val: Tuple[int, ...] = (1,) + MyModel(array=array_val) + array_val2: List[int] = [1] + MyModel(array=array_val2) + class NotAValid: + pass + array_val3: List[NotAValid] = [NotAValid()] + MyModel(array=array_val3) # E: Incompatible type for "array" of "MyModel" (got "List[NotAValid]", expected "Union[Sequence[Union[float, int, str, Combinable]], Combinable]") + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from typing import List, Tuple + + from django.db import models + from django.contrib.postgres.fields import ArrayField + + class MyModel(models.Model): + array = ArrayField(base_field=models.IntegerField()) + +- case: if_no_explicit_primary_key_id_can_be_passed + main: | + from myapp.models import MyModel + MyModel(id=1, name='maxim') + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class MyModel(models.Model): + name = models.CharField(max_length=100) + +- case: arguments_can_be_passed_as_positionals + main: | + from myapp.models import MyModel, MyModel2 + MyModel(1) + MyModel2(1, 12) + MyModel2(1, []) # E: Incompatible type for "name" of "MyModel2" (got "List[Any]", expected "Union[float, int, str, Combinable]") + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class MyModel(models.Model): + pass + class MyModel2(models.Model): + name = models.IntegerField() + +- case: charfield_with_integer_choices + main: | + from myapp.models import MyModel + MyModel(day=1) + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class MyModel(models.Model): + day = models.CharField(max_length=3, choices=((1, 'Fri'), (2, 'Sat'))) + +- case: optional_id_fields_allowed_in_init + main: | + from myapp.models import Book, Publisher + Book(id=None) + Book(publisher=None) + Book(publisher_id=None) + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class Publisher(models.Model): + name = models.CharField(primary_key=True, max_length=100) + class Book(models.Model): + publisher = models.ForeignKey(Publisher, on_delete=models.CASCADE) + + +- case: init_in_abstract_model_classmethod_should_not_throw_error_for_valid_fields + main: | + from myapp.models import MyModel + MyModel.base_init() + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class AbstractModel(models.Model): + class Meta: + abstract = True + text = models.CharField(max_length=100) + @classmethod + def base_init(cls) -> 'AbstractModel': + return cls(text='mytext') + class MyModel(AbstractModel): + pass \ No newline at end of file diff --git a/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/models/test_meta_options.yml b/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/models/test_meta_options.yml new file mode 100644 index 00000000..248f4e10 --- /dev/null +++ b/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/models/test_meta_options.yml @@ -0,0 +1,58 @@ +- case: meta_attribute_has_a_type_of_current_model + main: | + from myapp.models import MyUser + reveal_type(MyUser._meta) # N: Revealed type is 'django.db.models.options.Options[myapp.models.MyUser]' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class MyUser(models.Model): + pass + +- case: get_field_returns_proper_field_type + main: | + from myapp.models import MyUser + reveal_type(MyUser._meta.get_field('base_name')) # N: Revealed type is 'django.db.models.fields.CharField[Any, Any]' + reveal_type(MyUser._meta.get_field('name')) # N: Revealed type is 'django.db.models.fields.CharField[Any, Any]' + reveal_type(MyUser._meta.get_field('age')) # N: Revealed type is 'django.db.models.fields.IntegerField[Any, Any]' + reveal_type(MyUser._meta.get_field('unknown')) + reveal_type(MyUser._meta.get_field('to_user')) # N: Revealed type is 'django.db.models.fields.related.ForeignKey[Any, Any]' + out: | + main:5: note: Revealed type is 'Any' + main:5: error: MyUser has no field named 'unknown' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class MyBaseUser(models.Model): + base_name = models.CharField(max_length=100) + class MyUser(MyBaseUser): + name = models.CharField(max_length=100) + age = models.IntegerField() + to_user = models.ForeignKey('self', on_delete=models.SET_NULL) + +- case: get_field_with_abstract_inheritance + main: | + from myapp.models import AbstractModel + class MyModel(AbstractModel): + pass + reveal_type(MyModel._meta.get_field('field')) # N: Revealed type is 'Any' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + from django.contrib.postgres.fields import ArrayField + class AbstractModel(models.Model): + class Meta: + abstract = True + class MyModel(AbstractModel): + field = ArrayField(models.IntegerField(), default=[]) diff --git a/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/models/test_proxy_models.yml b/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/models/test_proxy_models.yml new file mode 100644 index 00000000..ba46845a --- /dev/null +++ b/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/models/test_proxy_models.yml @@ -0,0 +1,21 @@ +- case: foreign_key_to_proxy_model_accepts_first_non_proxy_model + main: | + from myapp.models import Blog, Publisher, PublisherProxy + Blog(publisher=Publisher()) + Blog.objects.create(publisher=Publisher()) + Blog().publisher = Publisher() + reveal_type(Blog().publisher) # N: Revealed type is 'myapp.models.PublisherProxy*' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class Publisher(models.Model): + pass + class PublisherProxy(Publisher): + class Meta: + proxy = True + class Blog(models.Model): + publisher = models.ForeignKey(to=PublisherProxy, on_delete=models.CASCADE) diff --git a/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/models/test_state.yml b/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/models/test_state.yml new file mode 100644 index 00000000..c7dd4b84 --- /dev/null +++ b/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/models/test_state.yml @@ -0,0 +1,14 @@ +- case: state_attribute_has_a_type_of_model_state + main: | + from myapp.models import MyUser + user = MyUser(pk=1) + reveal_type(user._state) # N: Revealed type is 'django.db.models.base.ModelState' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class MyUser(models.Model): + pass diff --git a/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/test/test_testcase.yml b/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/test/test_testcase.yml new file mode 100644 index 00000000..d7125c3a --- /dev/null +++ b/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/test/test_testcase.yml @@ -0,0 +1,12 @@ +- case: testcase_client_attr + main: | + from django.test.testcases import TestCase + + class ExampleTestCase(TestCase): + def test_method(self) -> None: + reveal_type(self.client) # N: Revealed type is 'django.test.client.Client' + resp = self.client.post('/url', {'doit': 'srs'}, 'application/json', False, True, extra='value') + reveal_type(resp.status_code) # N: Revealed type is 'builtins.int' + # Attributes monkey-patched by test Client class: + resp.json() + reveal_type(resp.wsgi_request) # N: Revealed type is 'django.core.handlers.wsgi.WSGIRequest' diff --git a/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/test_config.yml b/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/test_config.yml new file mode 100644 index 00000000..5d475ba9 --- /dev/null +++ b/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/test_config.yml @@ -0,0 +1,40 @@ +- case: pyproject_toml_config + main: | + from myapp.models import MyModel + mymodel = MyModel(user_id=1) + reveal_type(mymodel.id) # N: Revealed type is 'builtins.int*' + reveal_type(mymodel.user) # N: Revealed type is 'django.contrib.auth.models.User*' + reveal_type(mymodel.objects) # N: Revealed type is 'django.db.models.manager.Manager[myapp.models.MyModel]' + mypy_config: | + [mypy.plugins.django-stubs] + django_settings_module = mysettings + custom_settings: | + SECRET_KEY = '1' + INSTALLED_APPS = ('django.contrib.contenttypes', 'django.contrib.auth', 'myapp') + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from typing import TYPE_CHECKING + from django.db import models + class MyModel(models.Model): + user = models.ForeignKey('auth.User', on_delete=models.CASCADE) + if TYPE_CHECKING: + reveal_type(MyModel().user) # N: Revealed type is 'django.contrib.auth.models.User*' + +- case: generate_pyproject_toml_and_settings_file_from_installed_apps_key + main: | + from myapp.models import MyModel + mymodel = MyModel(user_id=1) + reveal_type(mymodel.id) # N: Revealed type is 'builtins.int*' + installed_apps: + - django.contrib.auth + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class MyModel(models.Model): + user = models.ForeignKey('auth.User', on_delete=models.CASCADE) + diff --git a/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/test_forms.yml b/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/test_forms.yml new file mode 100644 index 00000000..ed200a0b --- /dev/null +++ b/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/test_forms.yml @@ -0,0 +1,58 @@ +- case: no_incompatible_meta_nested_class_false_positive + main: | + from django import forms + from myapp.models import Article, Category + class ArticleForm(forms.ModelForm): + class Meta: + model = Article + fields = '__all__' + class CategoryForm(forms.ModelForm): + class Meta: + model = Category + fields = '__all__' + class CompositeForm(ArticleForm, CategoryForm): + pass + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + from django import forms + + class Article(models.Model): + pass + class Category(models.Model): + pass + +- case: formview_methods_on_forms_return_proper_types + main: | + from typing import Any + from django import forms + from django.views.generic.edit import FormView + + class MyForm(forms.ModelForm): + pass + class MyForm2(forms.ModelForm): + pass + class MyView(FormView): + form_class = MyForm + def post(self, request, *args: Any, **kwds: Any): + form_class = self.get_form_class() + reveal_type(form_class) # N: Revealed type is 'Type[main.MyForm]' + reveal_type(self.get_form(None)) # N: Revealed type is 'main.MyForm' + reveal_type(self.get_form()) # N: Revealed type is 'main.MyForm' + reveal_type(self.get_form(form_class)) # N: Revealed type is 'main.MyForm' + reveal_type(self.get_form(MyForm2)) # N: Revealed type is 'main.MyForm2' + +- case: successmessagemixin_compatible_with_formmixin + main: | + from django.views.generic.edit import FormMixin + from django.contrib.messages.views import SuccessMessageMixin + + class FormFirstView(FormMixin, SuccessMessageMixin): + pass + + class SuccessMessageFirstView(FormMixin, SuccessMessageMixin): + pass diff --git a/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/test_helpers.yml b/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/test_helpers.yml new file mode 100644 index 00000000..f82ceeaa --- /dev/null +++ b/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/test_helpers.yml @@ -0,0 +1,62 @@ +- case: transaction_atomic_contextmanager + main: | + from django.db import transaction + with transaction.atomic(): + pass + with transaction.atomic(using="mydb"): + pass + with transaction.atomic(using="mydb", savepoint=False): + pass + +- case: transaction_atomic_decorator + main: | + from django.db import transaction + + @transaction.atomic() + def decorated_func(param1: str, param2: int) -> bool: + pass + # Ensure that the function's type is preserved + reveal_type(decorated_func) # N: Revealed type is 'def (param1: builtins.str, param2: builtins.int) -> builtins.bool' + + @transaction.atomic(using="mydb") + def decorated_func_using(param1: str, param2: int) -> bool: + pass + # Ensure that the function's type is preserved + reveal_type(decorated_func_using) # N: Revealed type is 'def (param1: builtins.str, param2: builtins.int) -> builtins.bool' + + class ClassWithAtomicMethod: + # Bare decorator + @transaction.atomic + def atomic_method1(self, abc: int) -> str: + pass + @transaction.atomic(savepoint=True) + def atomic_method2(self): + pass + @transaction.atomic(using="db", savepoint=True) + def atomic_method3(self, myparam: str) -> int: + pass + ClassWithAtomicMethod().atomic_method1("abc") # E: Argument 1 to "atomic_method1" of "ClassWithAtomicMethod" has incompatible type "str"; expected "int" + # Ensure that the method's type is preserved + reveal_type(ClassWithAtomicMethod().atomic_method1) # N: Revealed type is 'def (abc: builtins.int) -> builtins.str' + # Ensure that the method's type is preserved + reveal_type(ClassWithAtomicMethod().atomic_method3) # N: Revealed type is 'def (myparam: builtins.str) -> builtins.int' + + +- case: mark_safe_decorator_and_function + main: | + from django.utils.safestring import mark_safe + s = 'hello' + reveal_type(mark_safe(s)) # N: Revealed type is 'django.utils.safestring.SafeText' + reveal_type(mark_safe(s) + mark_safe(s)) # N: Revealed type is 'django.utils.safestring.SafeText' + reveal_type(s + mark_safe(s)) # N: Revealed type is 'builtins.str' + + s += mark_safe(s) + reveal_type(s) # N: Revealed type is 'builtins.str' + ms = mark_safe(s) + ms += mark_safe(s) + reveal_type(ms) # N: Revealed type is 'django.utils.safestring.SafeText' + + @mark_safe + def func(s: str) -> str: + pass + reveal_type(func) # N: Revealed type is 'def (s: builtins.str) -> builtins.str' diff --git a/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/test_import_all.yml b/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/test_import_all.yml new file mode 100644 index 00000000..3540fa95 --- /dev/null +++ b/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/test_import_all.yml @@ -0,0 +1,442 @@ +- case: import_all_modules + main: | + import django.apps + import django.apps.config + import django.apps.registry + import django.conf.global_settings + import django.conf.locale + import django.conf.urls + import django.conf.urls.i18n + import django.conf.urls.static + import django.contrib.admin.actions + import django.contrib.admin.apps + import django.contrib.admin.checks + import django.contrib.admin.decorators + import django.contrib.admin.filters + import django.contrib.admin.forms + import django.contrib.admin.helpers + import django.contrib.admin.models + import django.contrib.admin.options + import django.contrib.admin.sites + import django.contrib.admin.templatetags + import django.contrib.admin.templatetags.admin_list + import django.contrib.admin.templatetags.admin_modify + import django.contrib.admin.templatetags.admin_static + import django.contrib.admin.templatetags.admin_urls + import django.contrib.admin.templatetags.base + import django.contrib.admin.templatetags.log + import django.contrib.admin.tests + import django.contrib.admin.utils + import django.contrib.admin.views + import django.contrib.admin.views.autocomplete + import django.contrib.admin.views.decorators + import django.contrib.admin.views.main + import django.contrib.admin.widgets + import django.contrib.admindocs + import django.contrib.admindocs.middleware + import django.contrib.admindocs.urls + import django.contrib.admindocs.utils + import django.contrib.admindocs.views + import django.contrib.auth.admin + import django.contrib.auth.apps + import django.contrib.auth.backends + import django.contrib.auth.base_user + import django.contrib.auth.checks + import django.contrib.auth.context_processors + import django.contrib.auth.decorators + import django.contrib.auth.forms + import django.contrib.auth.handlers + import django.contrib.auth.handlers.modwsgi + import django.contrib.auth.hashers + import django.contrib.auth.management.commands + import django.contrib.auth.management.commands.changepassword + import django.contrib.auth.management.commands.createsuperuser + import django.contrib.auth.middleware + import django.contrib.auth.mixins + import django.contrib.auth.models + import django.contrib.auth.password_validation + import django.contrib.auth.signals + import django.contrib.auth.tokens + import django.contrib.auth.urls + import django.contrib.auth.validators + import django.contrib.auth.views + import django.contrib.contenttypes.admin + import django.contrib.contenttypes.apps + import django.contrib.contenttypes.checks + import django.contrib.contenttypes.fields + import django.contrib.contenttypes.forms + import django.contrib.contenttypes.management.commands + import django.contrib.contenttypes.management.commands.remove_stale_contenttypes + import django.contrib.contenttypes.models + import django.contrib.contenttypes.views + import django.contrib.flatpages.forms + import django.contrib.flatpages.middleware + import django.contrib.flatpages.models + import django.contrib.flatpages.sitemaps + import django.contrib.flatpages.templatetags + import django.contrib.flatpages.templatetags.flatpages + import django.contrib.flatpages.urls + import django.contrib.flatpages.views + import django.contrib.gis.db.models + import django.contrib.gis.db.models.fields + import django.contrib.humanize.templatetags + import django.contrib.humanize.templatetags.humanize + import django.contrib.messages.api + import django.contrib.messages.constants + import django.contrib.messages.context_processors + import django.contrib.messages.middleware + import django.contrib.messages.storage + import django.contrib.messages.storage.base + import django.contrib.messages.storage.cookie + import django.contrib.messages.storage.fallback + import django.contrib.messages.storage.session + import django.contrib.messages.utils + import django.contrib.messages.views + import django.contrib.postgres.aggregates + import django.contrib.postgres.aggregates.general + import django.contrib.postgres.aggregates.mixins + import django.contrib.postgres.aggregates.statistics + import django.contrib.postgres.constraints + import django.contrib.postgres.fields + import django.contrib.postgres.fields.array + import django.contrib.postgres.fields.citext + import django.contrib.postgres.fields.hstore + import django.contrib.postgres.fields.jsonb + import django.contrib.postgres.fields.mixins + import django.contrib.postgres.fields.ranges + import django.contrib.postgres.functions + import django.contrib.postgres.indexes + import django.contrib.postgres.lookups + import django.contrib.postgres.operations + import django.contrib.postgres.search + import django.contrib.postgres.signals + import django.contrib.postgres.validators + import django.contrib.redirects + import django.contrib.redirects.middleware + import django.contrib.redirects.models + import django.contrib.sessions.backends + import django.contrib.sessions.backends.base + import django.contrib.sessions.backends.cache + import django.contrib.sessions.backends.cached_db + import django.contrib.sessions.backends.db + import django.contrib.sessions.backends.file + import django.contrib.sessions.backends.signed_cookies + import django.contrib.sessions.base_session + import django.contrib.sessions.exceptions + import django.contrib.sessions.management.commands + import django.contrib.sessions.management.commands.clearsessions + import django.contrib.sessions.middleware + import django.contrib.sessions.models + import django.contrib.sessions.serializers + import django.contrib.sitemaps.management.commands + import django.contrib.sitemaps.management.commands.ping_google + import django.contrib.sitemaps.views + import django.contrib.sites + import django.contrib.sites.apps + import django.contrib.sites.management + import django.contrib.sites.managers + import django.contrib.sites.middleware + import django.contrib.sites.models + import django.contrib.sites.requests + import django.contrib.sites.shortcuts + import django.contrib.staticfiles.apps + import django.contrib.staticfiles.checks + import django.contrib.staticfiles.finders + import django.contrib.staticfiles.handlers + import django.contrib.staticfiles.management.commands + import django.contrib.staticfiles.management.commands.collectstatic + import django.contrib.staticfiles.management.commands.findstatic + import django.contrib.staticfiles.management.commands.runserver + import django.contrib.staticfiles.storage + import django.contrib.staticfiles.templatetags + import django.contrib.staticfiles.templatetags.staticfiles + import django.contrib.staticfiles.testing + import django.contrib.staticfiles.urls + import django.contrib.staticfiles.utils + import django.contrib.staticfiles.views + import django.contrib.syndication + import django.contrib.syndication.views + import django.core.cache.backends + import django.core.cache.backends.base + import django.core.cache.backends.db + import django.core.cache.backends.dummy + import django.core.cache.backends.filebased + import django.core.cache.backends.locmem + import django.core.cache.backends.memcached + import django.core.cache.utils + import django.core.checks.caches + import django.core.checks.database + import django.core.checks.messages + import django.core.checks.model_checks + import django.core.checks.registry + import django.core.checks.security + import django.core.checks.security.base + import django.core.checks.security.csrf + import django.core.checks.security.sessions + import django.core.checks.templates + import django.core.checks.translation + import django.core.checks.urls + import django.core.exceptions + import django.core.files + import django.core.files.base + import django.core.files.images + import django.core.files.locks + import django.core.files.move + import django.core.files.storage + import django.core.files.temp + import django.core.files.uploadedfile + import django.core.files.uploadhandler + import django.core.files.utils + import django.core.handlers + import django.core.handlers.base + import django.core.handlers.exception + import django.core.handlers.wsgi + import django.core.mail.backends + import django.core.mail.backends.base + import django.core.mail.message + import django.core.mail.utils + import django.core.management.base + import django.core.management.color + import django.core.management.commands + import django.core.management.commands.dumpdata + import django.core.management.commands.loaddata + import django.core.management.commands.makemessages + import django.core.management.commands.runserver + import django.core.management.commands.testserver + import django.core.management.sql + import django.core.management.templates + import django.core.management.utils + import django.core.paginator + import django.core.serializers + import django.core.serializers.base + import django.core.serializers.json + import django.core.serializers.python + import django.core.servers + import django.core.servers.basehttp + import django.core.signals + import django.core.signing + import django.core.validators + import django.core.wsgi + import django.db.backends.base + import django.db.backends.base.base + import django.db.backends.base.client + import django.db.backends.base.creation + import django.db.backends.base.features + import django.db.backends.base.introspection + import django.db.backends.base.operations + import django.db.backends.base.schema + import django.db.backends.base.validation + import django.db.backends.ddl_references + import django.db.backends.dummy + import django.db.backends.dummy.base + import django.db.backends.mysql + import django.db.backends.mysql.client + import django.db.backends.postgresql + import django.db.backends.postgresql.base + import django.db.backends.postgresql.client + import django.db.backends.postgresql.creation + import django.db.backends.postgresql.operations + import django.db.backends.signals + import django.db.backends.sqlite3 + import django.db.backends.sqlite3.base + import django.db.backends.sqlite3.creation + import django.db.backends.sqlite3.features + import django.db.backends.sqlite3.introspection + import django.db.backends.sqlite3.operations + import django.db.backends.sqlite3.schema + import django.db.backends.utils + import django.db.migrations.autodetector + import django.db.migrations.exceptions + import django.db.migrations.executor + import django.db.migrations.graph + import django.db.migrations.loader + import django.db.migrations.migration + import django.db.migrations.operations + import django.db.migrations.operations.base + import django.db.migrations.operations.fields + import django.db.migrations.operations.models + import django.db.migrations.operations.special + import django.db.migrations.operations.utils + import django.db.migrations.optimizer + import django.db.migrations.questioner + import django.db.migrations.recorder + import django.db.migrations.serializer + import django.db.migrations.state + import django.db.migrations.topological_sort + import django.db.migrations.utils + import django.db.migrations.writer + import django.db.models.aggregates + import django.db.models.base + import django.db.models.constraints + import django.db.models.deletion + import django.db.models.expressions + import django.db.models.enums + import django.db.models.fields + import django.db.models.fields.files + import django.db.models.fields.mixins + import django.db.models.fields.proxy + import django.db.models.fields.related + import django.db.models.fields.related_descriptors + import django.db.models.fields.related_lookups + import django.db.models.fields.reverse_related + import django.db.models.functions + import django.db.models.functions.comparison + import django.db.models.functions.datetime + import django.db.models.functions.math + import django.db.models.functions.mixins + import django.db.models.functions.text + import django.db.models.functions.window + import django.db.models.indexes + import django.db.models.lookups + import django.db.models.manager + import django.db.models.options + import django.db.models.query + import django.db.models.query_utils + import django.db.models.signals + import django.db.models.sql + import django.db.models.sql.compiler + import django.db.models.sql.constants + import django.db.models.sql.datastructures + import django.db.models.sql.query + import django.db.models.sql.subqueries + import django.db.models.sql.where + import django.db.models.utils + import django.db.transaction + import django.db.utils + import django.dispatch + import django.dispatch.dispatcher + import django.forms + import django.forms.boundfield + import django.forms.fields + import django.forms.forms + import django.forms.formsets + import django.forms.models + import django.forms.renderers + import django.forms.utils + import django.forms.widgets + import django.http + import django.http.cookie + import django.http.multipartparser + import django.http.request + import django.http.response + import django.middleware + import django.middleware.cache + import django.middleware.clickjacking + import django.middleware.common + import django.middleware.csrf + import django.middleware.gzip + import django.middleware.http + import django.middleware.locale + import django.middleware.security + import django.shortcuts + import django.template.backends + import django.template.backends.base + import django.template.backends.django + import django.template.backends.dummy + import django.template.backends.jinja2 + import django.template.backends.utils + import django.template.base + import django.template.context + import django.template.context_processors + import django.template.defaultfilters + import django.template.defaulttags + import django.template.engine + import django.template.exceptions + import django.template.library + import django.template.loader + import django.template.loader_tags + import django.template.loaders + import django.template.loaders.app_directories + import django.template.loaders.base + import django.template.loaders.cached + import django.template.loaders.filesystem + import django.template.loaders.locmem + import django.template.response + import django.template.smartif + import django.template.utils + import django.templatetags + import django.templatetags.cache + import django.templatetags.i18n + import django.templatetags.l10n + import django.templatetags.static + import django.templatetags.tz + import django.test + import django.test.client + import django.test.html + import django.test.runner + import django.test.selenium + import django.test.signals + import django.test.testcases + import django.test.utils + import django.urls + import django.urls.base + import django.urls.conf + import django.urls.converters + import django.urls.exceptions + import django.urls.resolvers + import django.urls.utils + import django.utils._os + import django.utils.archive + import django.utils.autoreload + import django.utils.baseconv + import django.utils.cache + import django.utils.crypto + import django.utils.datastructures + import django.utils.dateformat + import django.utils.dateparse + import django.utils.dates + import django.utils.datetime_safe + import django.utils.deconstruct + import django.utils.decorators + import django.utils.deprecation + import django.utils.duration + import django.utils.encoding + import django.utils.feedgenerator + import django.utils.formats + import django.utils.functional + import django.utils.hashable + import django.utils.html + import django.utils.http + import django.utils.inspect + import django.utils.ipv6 + import django.utils.itercompat + import django.utils.jslex + import django.utils.log + import django.utils.lorem_ipsum + import django.utils.module_loading + import django.utils.numberformat + import django.utils.regex_helper + import django.utils.safestring + import django.utils.six + import django.utils.termcolors + import django.utils.text + import django.utils.timesince + import django.utils.timezone + import django.utils.topological_sort + import django.utils.translation + import django.utils.translation.reloader + import django.utils.translation.template + import django.utils.translation.trans_null + import django.utils.translation.trans_real + import django.utils.tree + import django.utils.version + import django.utils.xmlutils + import django.views.csrf + import django.views.debug + import django.views.decorators + import django.views.decorators.cache + import django.views.decorators.clickjacking + import django.views.decorators.csrf + import django.views.decorators.debug + import django.views.decorators.gzip + import django.views.decorators.http + import django.views.decorators.vary + import django.views.defaults + import django.views.generic + import django.views.generic.base + import django.views.generic.dates + import django.views.generic.detail + import django.views.generic.edit + import django.views.generic.list + import django.views.i18n + import django.views.static diff --git a/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/test_request.yml b/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/test_request.yml new file mode 100644 index 00000000..4a724022 --- /dev/null +++ b/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/test_request.yml @@ -0,0 +1,29 @@ +- case: request_object_has_user_of_type_auth_user_model + disable_cache: true + main: | + from django.http.request import HttpRequest + reveal_type(HttpRequest().user) # N: Revealed type is 'Union[myapp.models.MyUser, django.contrib.auth.models.AnonymousUser]' + # check that other fields work ok + reveal_type(HttpRequest().method) # N: Revealed type is 'Union[builtins.str, None]' + custom_settings: | + INSTALLED_APPS = ('django.contrib.contenttypes', 'django.contrib.auth', 'myapp') + AUTH_USER_MODEL='myapp.MyUser' + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class MyUser(models.Model): + pass +- case: request_object_user_can_be_descriminated + disable_cache: true + main: | + from django.http.request import HttpRequest + request = HttpRequest() + reveal_type(request.user) # N: Revealed type is 'Union[django.contrib.auth.models.User, django.contrib.auth.models.AnonymousUser]' + if not request.user.is_anonymous: + reveal_type(request.user) # N: Revealed type is 'django.contrib.auth.models.User' + if request.user.is_authenticated: + reveal_type(request.user) # N: Revealed type is 'django.contrib.auth.models.User' + custom_settings: | + INSTALLED_APPS = ('django.contrib.contenttypes', 'django.contrib.auth') diff --git a/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/test_settings.yml b/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/test_settings.yml new file mode 100644 index 00000000..ed5debda --- /dev/null +++ b/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/test_settings.yml @@ -0,0 +1,50 @@ +- case: settings_loaded_from_different_files + disable_cache: true + main: | + from django.conf import settings + # standard settings + reveal_type(settings.AUTH_USER_MODEL) # N: Revealed type is 'builtins.str' + reveal_type(settings.ROOT_DIR) # N: Revealed type is 'builtins.str' + reveal_type(settings.APPS_DIR) # N: Revealed type is 'pathlib.Path*' + reveal_type(settings.NUMBERS) # N: Revealed type is 'builtins.list[builtins.str*]' + reveal_type(settings.DICT) # N: Revealed type is 'builtins.dict[Any, Any]' + custom_settings: | + from base import * + SECRET_KEY = 112233 + NUMBERS = ['one', 'two'] + DICT = {} # type: ignore + files: + - path: base.py + content: | + from pathlib import Path + ROOT_DIR = '/etc' + APPS_DIR = Path(ROOT_DIR) + +- case: global_settings_are_always_loaded + main: | + from django.conf import settings + reveal_type(settings.AUTH_USER_MODEL) # N: Revealed type is 'builtins.str' + reveal_type(settings.AUTHENTICATION_BACKENDS) # N: Revealed type is 'typing.Sequence[builtins.str]' + installed_apps: [] + +- case: fail_if_there_is_no_setting + main: | + from django.conf import settings + reveal_type(settings.NOT_EXISTING) + out: | + main:2: note: Revealed type is 'Any' + main:2: error: 'Settings' object has no attribute 'NOT_EXISTING' + +- case: override_default_setting_with_different_type_in_the_different_module + custom_settings: | + from settings.basic_settings import * + main: | + from django.conf import settings + reveal_type(settings.MEDIA_ROOT) # N: Revealed type is 'pathlib.Path*' + reveal_type(settings.MEDIA_ROOT / 'part') # N: Revealed type is 'pathlib.Path*' + files: + - path: settings/__init__.py + - path: settings/basic_settings.py + content: | + from pathlib import Path + MEDIA_ROOT = Path() diff --git a/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/test_shortcuts.yml b/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/test_shortcuts.yml new file mode 100644 index 00000000..a06dcf60 --- /dev/null +++ b/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/test_shortcuts.yml @@ -0,0 +1,59 @@ +- case: get_object_or_404_returns_proper_types + main: | + from django.shortcuts import get_object_or_404, get_list_or_404 + from myapp.models import MyModel + + reveal_type(get_object_or_404(MyModel)) # N: Revealed type is 'myapp.models.MyModel*' + reveal_type(get_object_or_404(MyModel.objects)) # N: Revealed type is 'myapp.models.MyModel*' + reveal_type(get_object_or_404(MyModel.objects.get_queryset())) # N: Revealed type is 'myapp.models.MyModel*' + + reveal_type(get_list_or_404(MyModel)) # N: Revealed type is 'builtins.list[myapp.models.MyModel*]' + reveal_type(get_list_or_404(MyModel.objects)) # N: Revealed type is 'builtins.list[myapp.models.MyModel*]' + reveal_type(get_list_or_404(MyModel.objects.get_queryset())) # N: Revealed type is 'builtins.list[myapp.models.MyModel*]' + installed_apps: + - myapp + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class MyModel(models.Model): + pass + +- case: get_user_model_returns_proper_class + disable_cache: true + main: | + from django.contrib.auth import get_user_model + UserModel = get_user_model() + reveal_type(UserModel.objects) # N: Revealed type is 'django.db.models.manager.Manager[myapp.models.MyUser]' + custom_settings: | + INSTALLED_APPS = ('django.contrib.contenttypes', 'myapp') + AUTH_USER_MODEL = 'myapp.MyUser' + files: + - path: myapp/__init__.py + - path: myapp/models.py + content: | + from django.db import models + class MyUser(models.Model): + pass + +- case: check_render_function_arguments_annotations + main: | + from typing import Any + from typing_extensions import TypedDict + from django.shortcuts import render + from django.http.request import HttpRequest + + TestContext = TypedDict("TestContext", {"user": Any}) + test_context: TestContext = {"user": "test"} + reveal_type(test_context) # N: Revealed type is 'TypedDict('main.TestContext', {'user': Any})' + reveal_type(render(HttpRequest(), '', test_context)) # N: Revealed type is 'django.http.response.HttpResponse' + +- case: check_redirect_return_annotation + main: | + from django.shortcuts import redirect + reveal_type(redirect(to = '', permanent = True)) # N: Revealed type is 'django.http.response.HttpResponsePermanentRedirect' + reveal_type(redirect(to = '', permanent = False)) # N: Revealed type is 'django.http.response.HttpResponseRedirect' + + var = True + reveal_type(redirect(to = '', permanent = var)) # N: Revealed type is 'Union[django.http.response.HttpResponseRedirect, django.http.response.HttpResponsePermanentRedirect]' diff --git a/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/utils/test_decorators.yml b/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/utils/test_decorators.yml new file mode 100644 index 00000000..b347938c --- /dev/null +++ b/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/utils/test_decorators.yml @@ -0,0 +1,20 @@ +- case: method_decorator_class + main: | + from django.views.generic.base import View + from django.utils.decorators import method_decorator + from django.contrib.auth.decorators import login_required + @method_decorator(login_required, name='dispatch') + class TestView(View): ... + reveal_type(TestView()) # N: Revealed type is 'main.TestView' +- case: method_decorator_function + main: | + from django.views.generic.base import View + from django.utils.decorators import method_decorator + from django.contrib.auth.decorators import login_required + from django.http.response import HttpResponse + from django.http.request import HttpRequest + class TestView(View): + @method_decorator(login_required) + def dispatch(self, request: HttpRequest, *args, **kwargs) -> HttpResponse: + return super().dispatch(request, *args, **kwargs) + reveal_type(dispatch) # N: Revealed type is 'def (self: main.TestView, request: django.http.request.HttpRequest, *args: Any, **kwargs: Any) -> django.http.response.HttpResponse' diff --git a/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/utils/test_functional.yml b/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/utils/test_functional.yml new file mode 100644 index 00000000..0407c18d --- /dev/null +++ b/anaconda_lib/jedi/third_party/django-stubs/test-data/typecheck/utils/test_functional.yml @@ -0,0 +1,18 @@ +- case: cached_property_class_vs_instance_attributes + main: | + from django.utils.functional import cached_property + from typing import List + + class Foo: + @cached_property + def attr(self) -> List[str]: ... + + reveal_type(attr) # N: Revealed type is 'django.utils.functional.cached_property[builtins.list*[builtins.str]]' + reveal_type(attr.name) # N: Revealed type is 'builtins.str' + + reveal_type(Foo.attr) # N: Revealed type is 'django.utils.functional.cached_property[builtins.list*[builtins.str]]' + reveal_type(Foo.attr.func) # N: Revealed type is 'def (*Any, **Any) -> builtins.list*[builtins.str]' + + f = Foo() + reveal_type(f.attr) # N: Revealed type is 'builtins.list*[builtins.str]' + f.attr.name # E: "List[str]" has no attribute "name" diff --git a/anaconda_lib/jedi/third_party/typeshed/CONTRIBUTING.md b/anaconda_lib/jedi/third_party/typeshed/CONTRIBUTING.md new file mode 100644 index 00000000..cac4f873 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/CONTRIBUTING.md @@ -0,0 +1,404 @@ +# Contributing to typeshed + +Welcome! typeshed is a community project that aims to work for a wide +range of Python users and Python codebases. If you're trying a type +checker on your Python code, your experience and what you can contribute +are important to the project's success. + + +## The contribution process at a glance + +1. Read the [README.md file](README.md). +2. Set up your environment to be able to [run all tests](README.md#running-the-tests). They should pass. +3. [Prepare your changes](#preparing-changes): + * Small fixes and additions can be submitted directly as pull requests, + but [contact us](#discussion) before starting significant work. + * Create your stubs [conforming to the coding style](#stub-file-coding-style). + * Make sure your tests pass cleanly on `mypy`, `pytype`, and `flake8`. + * Reformat your stubs with `black` and `isort`. +4. [Submit your changes](#submitting-changes) by opening a pull request. +5. You can expect a reply within a few days: + * Diffs are merged when considered ready by the core team. + * Feel free to ping the core team if your pull request goes without + a reply for more than a few days. + +For more details, read below. + + +## Discussion + +If you've run into behavior in the type checker that suggests the type +stubs for a given library are incorrect or incomplete, +we want to hear from you! + +Our main forum for discussion is the project's [GitHub issue +tracker](https://github.com/python/typeshed/issues). This is the right +place to start a discussion of any of the above or most any other +topic concerning the project. + +For less formal discussion, try the typing chat room on +[gitter.im](https://gitter.im/python/typing). Some Mypy core developers +are almost always present; feel free to find us there and we're happy +to chat. Substantive technical discussion will be directed to the +issue tracker. + +### Code of Conduct + +Everyone participating in the typeshed community, and in particular in +our issue tracker, pull requests, and IRC channel, is expected to treat +other people with respect and more generally to follow the guidelines +articulated in the [Python Community Code of +Conduct](https://www.python.org/psf/codeofconduct/). + + +## Submitting Changes + +Even more excellent than a good bug report is a fix for a bug, or the +implementation of a much-needed stub. We'd love to have +your contributions. + +We use the usual GitHub pull-request flow, which may be familiar to +you if you've contributed to other projects on GitHub. For the +mechanics, see [Mypy's git and GitHub workflow help page](https://github.com/python/mypy/wiki/Using-Git-And-GitHub), +or [GitHub's own documentation](https://help.github.com/articles/using-pull-requests/). + +Anyone interested in type stubs may review your code. One of the core +developers will merge your pull request when they think it's ready. +For every pull request, we aim to promptly either merge it or say why +it's not yet ready; if you go a few days without a reply, please feel +free to ping the thread by adding a new comment. + +To get your pull request merged sooner, you should explain why you are +making the change. For example, you can point to a code sample that is +processed incorrectly by a type checker. It is also helpful to add +links to online documentation or to the implementation of the code +you are changing. + +Also, do not squash your commits after you have submitted a pull request, as this +erases context during review. We will squash commits when the pull request is merged. + +At present the core developers are (alphabetically): +* David Fisher (@ddfisher) +* Łukasz Langa (@ambv) +* Jukka Lehtosalo (@JukkaL) +* Ivan Levkivskyi (@ilevkivskyi) +* Matthias Kramm (@matthiaskramm) +* Greg Price (@gnprice) +* Sebastian Rittau (@srittau) +* Guido van Rossum (@gvanrossum) +* Shantanu (@hauntsaninja) +* Rune Tynan (@CraftSpider) +* Jelle Zijlstra (@JelleZijlstra) + +NOTE: the process for preparing and submitting changes also applies to +core developers. This ensures high quality contributions and keeps +everybody on the same page. Avoid direct pushes to the repository. + + +## Preparing Changes + +### Before you begin + +If your change will be a significant amount of work to write, we highly +recommend starting by opening an issue laying out what you want to do. +That lets a conversation happen early in case other contributors disagree +with what you'd like to do or have ideas that will help you do it. + +### What to include + +Stubs should include the complete interface (classes, functions, +constants, etc.) of the module they cover, but it is not always +clear exactly what is part of the interface. + +The following should always be included: +- All objects listed in the module's documentation. +- All objects included in ``__all__`` (if present). + +Other objects may be included if they are being used in practice +or if they are not prefixed with an underscore. This means +that typeshed will generally accept contributions that add missing +objects, even if they are undocumented. Undocumented objects should +be marked with a comment of the form ``# undocumented``. +Example: + +```python +def list2cmdline(seq: Sequence[str]) -> str: ... # undocumented +``` + +We accept such undocumented objects because omitting objects can confuse +users. Users who see an error like "module X has no attribute Y" will +not know whether the error appeared because their code had a bug or +because the stub is wrong. Although it may also be helpful for a type +checker to point out usage of private objects, we usually prefer false +negatives (no errors for wrong code) over false positives (type errors +for correct code). In addition, even for private objects a type checker +can be helpful in pointing out that an incorrect type was used. + +### Incomplete stubs + +We accept partial stubs, especially for larger packages. These need to +follow the following guidelines: + +* Included functions and methods must list all arguments, but the arguments + can be left unannotated. Do not use `Any` to mark unannotated arguments + or return values. +* Partial classes must include a `__getattr__()` method marked with an + `# incomplete` comment (see example below). +* Partial modules (i.e. modules that are missing some or all classes, + functions, or attributes) must include a top-level `__getattr__()` + function marked with an `# incomplete` comment (see example below). +* Partial packages (i.e. packages that are missing one or more sub-modules) + must have a `__init__.pyi` stub that is marked as incomplete (see above). + A better alternative is to create empty stubs for all sub-modules and + mark them as incomplete individually. + +Example of a partial module with a partial class `Foo` and a partially +annotated function `bar()`: + +```python +def __getattr__(name: str) -> Any: ... # incomplete + +class Foo: + def __getattr__(self, name: str) -> Any: ... # incomplete + x: int + y: str + +def bar(x: str, y, *, z=...): ... +``` + +### Using stubgen + +Mypy includes a tool called [stubgen](https://mypy.readthedocs.io/en/latest/stubgen.html) +that auto-generates stubs for Python and C modules using static analysis, +Sphinx docs, and runtime introspection. It can be used to get a starting +point for your stubs. Note that this generator is currently unable to +determine most argument and return types and omits them or uses ``Any`` in +their place. Fill out manually the types that you know. + +### Stub file coding style + +#### Syntax example + +The below is an excerpt from the types for the `datetime` module. + +```python +MAXYEAR: int +MINYEAR: int + +class date: + def __init__(self, year: int, month: int, day: int) -> None: ... + @classmethod + def fromtimestamp(cls, timestamp: float) -> date: ... + @classmethod + def today(cls) -> date: ... + @classmethod + def fromordinal(cls, ordinal: int) -> date: ... + @property + def year(self) -> int: ... + def replace(self, year: int = ..., month: int = ..., day: int = ...) -> date: ... + def ctime(self) -> str: ... + def weekday(self) -> int: ... +``` + +#### Conventions + +Stub files are *like* Python files and you should generally expect them +to look the same. Your tools should be able to successfully treat them +as regular Python files. However, there are a few important differences +you should know about. + +Style conventions for stub files are different from PEP 8. The general +rule is that they should be as concise as possible. Specifically: +* lines can be up to 130 characters long; +* functions and methods that don't fit in one line should be split up + with one argument per line; +* all function bodies should be empty; +* prefer ``...`` over ``pass``; +* prefer ``...`` on the same line as the class/function signature; +* avoid vertical whitespace between consecutive module-level functions, + names, or methods and fields within a single class; +* use a single blank line between top-level class definitions, or none + if the classes are very small; +* do not use docstrings; +* use variable annotations instead of type comments, even for stubs + that target older versions of Python; +* for arguments with a type and a default, use spaces around the `=`. + +Stubs should be reformatted with the formatters +[black](https://github.com/psf/black) and +[isort](https://github.com/PyCQA/isort) before submission. +These formatters are included in typeshed's `requirements-tests-py3.txt` file. +A sample `pre-commit` file is included in the typeshed repository. Copy it +to `.git/hooks` and adjust the path to your virtual environment's `bin` +directory to automatically reformat stubs before commit. + +Stub files should only contain information necessary for the type +checker, and leave out unnecessary detail: +* for arguments with a default, use `...` instead of the actual + default; +* for arguments that default to `None`, use `Optional[]` explicitly + (see below for details); +* use `float` instead of `Union[int, float]`. + +Some further tips for good type hints: +* avoid invariant collection types (`List`, `Dict`) in argument + positions, in favor of covariant types like `Mapping` or `Sequence`; +* avoid Union return types: https://github.com/python/mypy/issues/1693; +* in Python 2, whenever possible, use `unicode` if that's the only + possible type, and `Text` if it can be either `unicode` or `bytes`; +* use platform checks like `if sys.platform == 'win32'` to denote + platform-dependent APIs. + +Imports in stubs are considered private (not part of the exported API) +unless: +* they use the form ``from library import name as name`` (sic, using + explicit ``as`` even if the name stays the same); or +* they use the form ``from library import *`` which means all names + from that library are exported. + +When adding type hints, avoid using the `Any` type when possible. Reserve +the use of `Any` for when: +* the correct type cannot be expressed in the current type system; and +* to avoid Union returns (see above). + +Note that `Any` is not the correct type to use if you want to indicate +that some function can accept literally anything: in those cases use +`object` instead. + +For arguments with type and a default value of `None`, PEP 484 +prescribes that the type automatically becomes `Optional`. However we +prefer explicit over implicit in this case, and require the explicit +`Optional[]` around the type. The mypy tests enforce this (through +the use of --no-implicit-optional) and the error looks like +`Incompatible types in assignment (expression has type None, variable +has type "Blah") `. + +Stub files support forward references natively. In other words, the +order of class declarations and type aliases does not matter in +a stub file. You can also use the name of the class within its own +body. Focus on making your stubs clear to the reader. Avoid using +string literals in type annotations. + +Type variables and aliases you introduce purely for legibility reasons +should be prefixed with an underscore to make it obvious to the reader +they are not part of the stubbed API. + +When adding type annotations for context manager classes, annotate +the return type of `__exit__` as bool only if the context manager +sometimes suppresses exceptions -- if it sometimes returns `True` +at runtime. If the context manager never suppresses exceptions, +have the return type be either `None` or `Optional[bool]`. If you +are not sure whether exceptions are suppressed or not or if the +context manager is meant to be subclassed, pick `Optional[bool]`. +See https://github.com/python/mypy/issues/7214 for more details. + +A few guidelines for protocol names below. In cases that don't fall +into any of those categories, use your best judgement. + +* Use plain names for protocols that represent a clear concept + (e.g. `Iterator`, `Container`). +* Use `SupportsX` for protocols that provide callable methods (e.g. + `SupportsInt`, `SupportsRead`, `SupportsReadSeek`). +* Use `HasX` for protocols that have readable and/or writable attributes + or getter/setter methods (e.g. `HasItems`, `HasFileno`). + +NOTE: there are stubs in this repository that don't conform to the +style described above. Fixing them is a great starting point for new +contributors. + +### Stub versioning + +There are separate directories for `stdlib` and `third_party` stubs. +Within those, there are separate directories for different versions of +Python the stubs target. + +The directory name indicates the major version of Python that a stub targets +and optionally the lowest minor version, with the exception of the `2and3` +directory which applies to both Python 2 and 3. + +For example, stubs in the `3` directory will be applied to all versions of +Python 3, though stubs in the `3.7` directory will only be applied to versions +3.7 and above. However, stubs in the `2` directory will not be applied to +Python 3. + +It is preferred to use a single stub in the more generic directory that +conditionally targets specific versions when needed, as opposed +to maintaining multiple stub files within more specific directories. Similarly, +if the given library works on both Python 2 and Python 3, prefer to put your +stubs in the `2and3` directory, unless the types are so different that the stubs +become unreadable that way. + +You can use checks like `if sys.version_info >= (3, 8):` to denote new +functionality introduced in a given Python version or solve type +differences. When doing so, only use one-tuples or two-tuples. This is +because: + +* mypy doesn't support more fine-grained version checks; and more + importantly + +* the micro versions of a Python release will change over time in your + checking environment and the checker should return consistent results + regardless of the micro version used. + +Because of this, if a given functionality was introduced in, say, Python +3.7.4, your check: + +* should be expressed as `if sys.version_info >= (3, 7):` +* should NOT be expressed as `if sys.version_info >= (3, 7, 4):` +* should NOT be expressed as `if sys.version_info >= (3, 8):` + +This makes the type checker assume the functionality was also available +in 3.7.0 - 3.7.3, which while *technically* incorrect is relatively +harmless. This is a strictly better compromise than using the latter +two forms, which would generate false positive errors for correct use +under Python 3.7.4. + +Note: in its current implementation, typeshed cannot contain stubs for +multiple versions of the same third-party library. Prefer to generate +stubs for the latest version released on PyPI at the time of your +stubbing. + +### What to do when a project's documentation and implementation disagree + +Type stubs are meant to be external type annotations for a given +library. While they are useful documentation in its own merit, they +augment the project's concrete implementation, not the project's +documentation. Whenever you find them disagreeing, model the type +information after the actual implementation and file an issue on the +project's tracker to fix their documentation. + +## Issue-tracker conventions + +We aim to reply to all new issues promptly. We'll assign one or more +labels to indicate we've triaged an issue, but most typeshed issues +are relatively simple (stubs for a given module or package are +missing, incomplete or incorrect) and we won't add noise to the +tracker by labeling all of them. Please see the +[list of all labels](https://github.com/python/typeshed/issues/labels) +for a detailed description of the labels we use. + +Sometimes a PR can't make progress until some external issue is +addressed. We indicate this by editing the subject to add a ``[WIP]`` +prefix. (This should be removed before committing the issue once +unblocked!) + +### Core developer guidelines + +Core developers should follow these rules when processing pull requests: + +* Always wait for tests to pass before merging PRs. +* Use "[Squash and merge](https://github.com/blog/2141-squash-your-commits)" to merge PRs. +* Delete branches for merged PRs (by core devs pushing to the main repo). +* Make sure commit messages to master are meaningful. For example, remove irrelevant + intermediate commit messages. +* If stubs for a new library are submitted, notify the library's maintainers. + +When reviewing PRs, follow these guidelines: + +* Typing is hard. Try to be helpful and explain issues with the PR, + especially to new contributors. +* When reviewing auto-generated stubs, just scan for red flags and obvious + errors. Leave possible manual improvements for separate PRs. +* When reviewing large, hand-crafted PRs, you only need to look for red flags + and general issues, and do a few spot checks. +* Review smaller, hand-crafted PRs thoroughly. diff --git a/anaconda_lib/jedi/third_party/typeshed/LICENSE b/anaconda_lib/jedi/third_party/typeshed/LICENSE new file mode 100644 index 00000000..e5833ae4 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/LICENSE @@ -0,0 +1,238 @@ +The "typeshed" project is licensed under the terms of the Apache license, as +reproduced below. + += = = = = + +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + += = = = = + +Parts of typeshed are licensed under different licenses (like the MIT +license), reproduced below. + += = = = = + +The MIT License + +Copyright (c) 2015 Jukka Lehtosalo and contributors + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + += = = = = + diff --git a/anaconda_lib/jedi/third_party/typeshed/README.md b/anaconda_lib/jedi/third_party/typeshed/README.md new file mode 100644 index 00000000..49e2aad5 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/README.md @@ -0,0 +1,204 @@ +# typeshed + +[![Build status](https://github.com/python/typeshed/workflows/Check%20stubs/badge.svg)](https://github.com/python/typeshed/actions?query=workflow%3A%22Check+stubs%22) +[![Chat at https://gitter.im/python/typing](https://badges.gitter.im/python/typing.svg)](https://gitter.im/python/typing?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) +[![Pull Requests Welcome](https://img.shields.io/badge/pull%20requests-welcome-brightgreen.svg)](https://github.com/python/typeshed/blob/master/CONTRIBUTING.md) + +## About + +Typeshed contains external type annotations for the Python standard library +and Python builtins, as well as third party packages as contributed by +people external to those projects. + +This data can e.g. be used for static analysis, type checking or type inference. + +For information on how to use `typeshed`, read below. Information for +contributors can be found in [CONTRIBUTING.md](CONTRIBUTING.md). **Please read +it before submitting pull requests; do not report issues with annotations to +the project the stubs are for, but instead report them here to typeshed.** + +Typeshed supports Python versions 2.7 and 3.6 and up. + +## Using + +If you're just using mypy (or pytype or PyCharm), as opposed to +developing it, you don't need to interact with the typeshed repo at +all: a copy of typeshed is bundled with mypy. + +When you use a checked-out clone of the mypy repo, a copy of typeshed +should be included as a submodule, using + + $ git clone --recurse-submodules https://github.com/python/mypy.git + +or + + $ git clone https://github.com/python/mypy.git + $ cd mypy + $ git submodule init + $ git submodule update + +and occasionally you will have to repeat the final command (`git +submodule update`) to pull in changes made in the upstream typeshed +repo. + +PyCharm and pytype similarly include a copy of typeshed. The one in +pytype can be updated in the same way if you are working with the +pytype repo. + +## Format + +Each Python module is represented by a `.pyi` "stub file". This is a +syntactically valid Python file, although it usually cannot be run by +Python 3 (since forward references don't require string quotes). All +the methods are empty. + +Python function annotations ([PEP 3107](https://www.python.org/dev/peps/pep-3107/)) +are used to describe the signature of each function or method. + +See [PEP 484](http://www.python.org/dev/peps/pep-0484/) for the exact +syntax of the stub files and [CONTRIBUTING.md](CONTRIBUTING.md) for the +coding style used in typeshed. + +## Directory structure + +### stdlib + +This contains stubs for modules the Python standard library -- which +includes pure Python modules, dynamically loaded extension modules, +hard-linked extension modules, and the builtins. + +### third_party + +Modules that are not shipped with Python but have a type description in Python +go into `third_party`. Since these modules can behave differently for different +versions of Python, `third_party` has version subdirectories, just like +`stdlib`. + +For more information on directory structure and stub versioning, see +[the relevant section of CONTRIBUTING.md]( +https://github.com/python/typeshed/blob/master/CONTRIBUTING.md#stub-versioning). + +Third-party packages are generally removed from typeshed when one of the +following criteria is met: + +* The upstream package ships a py.typed file for at least 6-12 months, or +* the package does not support any of the Python versions supported by + typeshed. + +## Contributing + +Please read [CONTRIBUTING.md](CONTRIBUTING.md) before submitting pull +requests. If you have questions related to contributing, drop by the [typing Gitter](https://gitter.im/python/typing). + +## Running the tests + +The tests are automatically run on every PR and push to +the repo. + +There are several tests: +- `tests/mypy_test.py` +tests typeshed with [mypy](https://github.com/python/mypy/) +- `tests/pytype_test.py` tests typeshed with +[pytype](https://github.com/google/pytype/). +- `tests/mypy_self_check.py` checks mypy's code base using this version of +typeshed. +- `tests/mypy_test_suite.py` runs a subset of mypy's test suite using this version of +typeshed. +- `tests/check_consistent.py` checks certain files in typeshed remain +consistent with each other. +- `tests/stubtest_test.py` checks stubs against the objects at runtime. +- `flake8` enforces a style guide. + +### Setup + +Run: +``` +$ python3.6 -m venv .venv3 +$ source .venv3/bin/activate +(.venv3)$ pip install -U pip +(.venv3)$ pip install -r requirements-tests-py3.txt +``` +This will install mypy (you need the latest master branch from GitHub), +typed-ast, flake8 (and plugins), pytype, black and isort. + +### mypy_test.py + +This test requires Python 3.6 or higher; Python 3.6.1 or higher is recommended. +Run using:`(.venv3)$ python3 tests/mypy_test.py` + +This test is shallow — it verifies that all stubs can be +imported but doesn't check whether stubs match their implementation +(in the Python standard library or a third-party package). It has an exclude list of +modules that are not tested at all, which also lives in the tests directory. + +If you are in the typeshed repo that is submodule of the +mypy repo (so `..` refers to the mypy repo), there's a shortcut to run +the mypy tests that avoids installing mypy: +```bash +$ PYTHONPATH=../.. python3 tests/mypy_test.py +``` +You can restrict mypy tests to a single version by passing `-p2` or `-p3.9`: +```bash +$ PYTHONPATH=../.. python3 tests/mypy_test.py -p3.9 +running mypy --python-version 3.9 --strict-optional # with 342 files +``` + +### pytype_test.py + +This test requires Python 2.7 and Python 3.6. Pytype will +find these automatically if they're in `PATH`, but otherwise you must point to +them with the `--python27-exe` and `--python36-exe` arguments, respectively. +Run using: `(.venv3)$ python3 tests/pytype_test.py` + +This test works similarly to `mypy_test.py`, except it uses `pytype`. + +### mypy_self_check.py + +This test requires Python 3.6 or higher; Python 3.6.1 or higher is recommended. +Run using: `(.venv3)$ python3 tests/mypy_self_check.py` + +This test checks mypy's code base using mypy and typeshed code in this repo. + +### mypy_test_suite.py + +This test requires Python 3.5 or higher; Python 3.6.1 or higher is recommended. +Run using: `(.venv3)$ python3 tests/mypy_test_suite.py` + +This test runs mypy's own test suite using the typeshed code in your repo. This +will sometimes catch issues with incorrectly typed stubs, but is much slower +than the other tests. + +### check_consistent.py + +Run using: `python3 tests/check_consistent.py` + +### stubtest_test.py + +This test requires Python 3.6 or higher. +Run using `(.venv3)$ python3 tests/stubtest_test.py` + +This test compares the stdlib stubs against the objects at runtime. Because of +this, the output depends on which version of Python and on what kind of system +it is run. +Thus the easiest way to run this test is via Github Actions on your fork; +if you run it locally, it'll likely complain about system-specific +differences (in e.g, `socket`) that the type system cannot capture. +If you need a specific version of Python to repro a CI failure, +[pyenv](https://github.com/pyenv/pyenv) can help. + +Due to its dynamic nature, you may run into false positives. In this case, you +can add to the whitelists for each affected Python version in +`tests/stubtest_whitelists`. Please file issues for stubtest false positives +at [mypy](https://github.com/python/mypy/issues). + +To run stubtest against third party stubs, it's easiest to use stubtest +directly, with `(.venv3)$ python3 -m mypy.stubtest --custom-typeshed-dir + `. +stubtest can also help you find things missing from the stubs. + + +### flake8 + +flake8 requires Python 3.6 or higher. Run using: `(.venv3)$ flake8` + +Note typeshed uses the `flake8-pyi` and `flake8-bugbear` plugins. diff --git a/anaconda_lib/jedi/third_party/typeshed/pre-commit b/anaconda_lib/jedi/third_party/typeshed/pre-commit new file mode 100755 index 00000000..b5391ad0 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/pre-commit @@ -0,0 +1,28 @@ +#!/bin/sh +# +# An example hook script that will run flake8, black, and isort +# prior to committing and will stop the commit if there are any +# warnings. Adjust BIN_DIR to the virtual environment where flake8, +# black, and isort are installed. +# +# To enable this hook, copy this file to ".git/hooks". + +BIN_DIR=./.venv/bin + +CHANGED_FILES=$(git diff --cached --name-only --diff-filter=AM | grep .pyi || true) + +if test -n "${CHANGED_FILES}" -a -d "${BIN_DIR}"; then + ${BIN_DIR}/flake8 ${CHANGED_FILES} + ${BIN_DIR}/black --check ${CHANGED_FILES} + ${BIN_DIR}/isort --check-only ${CHANGED_FILES} + + # Replace the last two lines with the following lines + # if you want to reformat changed files automatically + # before committing. Please note that partial commits + # (git add -p) will not work and will commit the whole + # file! + # + # ${BIN_DIR}/black ${CHANGED_FILES} || true + # ${BIN_DIR}/isort -y ${CHANGED_FILES} || true + # git add ${CHANGED_FILES} +fi diff --git a/anaconda_lib/jedi/third_party/typeshed/requirements-tests-py3.txt b/anaconda_lib/jedi/third_party/typeshed/requirements-tests-py3.txt new file mode 100644 index 00000000..b52d9c97 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/requirements-tests-py3.txt @@ -0,0 +1,8 @@ +git+https://github.com/python/mypy.git@master +typed-ast>=1.0.4 +black==20.8b1 +flake8==3.8.4 +flake8-bugbear==20.1.4 +flake8-pyi==20.10.0 +isort[pyproject]==5.5.3 +pytype>=2020.09.16 diff --git a/anaconda_lib/jedi/third_party/typeshed/scripts/generate_proto_stubs.sh b/anaconda_lib/jedi/third_party/typeshed/scripts/generate_proto_stubs.sh new file mode 100755 index 00000000..fdab8d2a --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/scripts/generate_proto_stubs.sh @@ -0,0 +1,68 @@ +#!/bin/bash +# Some of the proto .pyi stubs in third_party/2and3/google/protobuf/ +# are autogenerated using the mypy-protobuf project on the +# latest `.proto` files shipped with protoc. +# +# When run, this script will autogenerate the _pb2.pyi stubs to +# third_party/2and3/google/protobuf. It should be run any time there's +# a meaningful update to either PROTOBUF_VERSION or MYPY_PROTOBUF_VERSION, +# followed by committing the changes to typeshed +# +# Update these two variables when rerunning script +PROTOBUF_VERSION=3.14.0 +MYPY_PROTOBUF_VERSION=8639282dae3bb64b2e1db9928d72fc374f7fa831 # Update to 1.24 when it releases + +set -ex + +if uname -a | grep Darwin; then + PLAT=osx +else + PLAT=linux +fi +REPO_ROOT=$(realpath $(dirname "${BASH_SOURCE[0]}")/..) +TMP_DIR=$(mktemp -d) +PYTHON_PROTOBUF_FILENAME=protobuf-python-${PROTOBUF_VERSION}.zip +PROTOC_FILENAME=protoc-${PROTOBUF_VERSION}-${PLAT}-x86_64.zip +PROTOC_URL=https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOBUF_VERSION}/${PROTOC_FILENAME} +PYTHON_PROTOBUF_URL=https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOBUF_VERSION}/${PYTHON_PROTOBUF_FILENAME} + +cd $TMP_DIR +echo "Working in $TMP_DIR" + +# Install protoc +wget $PROTOC_URL +mkdir protoc_install +unzip $PROTOC_FILENAME -d protoc_install + +# Fetch protoc-python (which contains all the .proto files) +wget $PYTHON_PROTOBUF_URL +unzip $PYTHON_PROTOBUF_FILENAME +PYTHON_PROTOBUF_DIR=protobuf-$PROTOBUF_VERSION + +# Install mypy-protobuf +VENV=venv +python3 -m virtualenv $VENV +source $VENV/bin/activate +python3 -m pip install git+https://github.com/dropbox/mypy-protobuf@${MYPY_PROTOBUF_VERSION}#subdirectory=python + +# Remove existing pyi +find $REPO_ROOT/third_party/2and3/ -name "*_pb2.pyi" -delete + +# Roughly reproduce the subset of .proto files on the public interface as described +# by find_package_modules in the protobuf setup.py. +# The logic (as of 3.14.0) can roughly be described as a whitelist of .proto files +# further limited to exclude *test* and internal/ +# https://github.com/protocolbuffers/protobuf/blob/master/python/setup.py +PROTO_FILES=$(grep "generate_proto.*google" $PYTHON_PROTOBUF_DIR/python/setup.py | \ + cut -d\" -f2 | \ + grep -v "test" | \ + grep -v google/protobuf/internal/ | \ + grep -v google/protobuf/pyext/python.proto | \ + grep -v src/google/protobuf/util/json_format.proto | \ + grep -v src/google/protobuf/util/json_format_proto3.proto | \ + sed "s:^:$PYTHON_PROTOBUF_DIR/python/:" | \ + xargs -L1 realpath --relative-to=. \ +) + +# And regenerate! +protoc_install/bin/protoc --proto_path=$PYTHON_PROTOBUF_DIR/src --mypy_out=$REPO_ROOT/third_party/2and3 $PROTO_FILES diff --git a/anaconda_lib/jedi/third_party/typeshed/scripts/migrate_script.py b/anaconda_lib/jedi/third_party/typeshed/scripts/migrate_script.py new file mode 100644 index 00000000..3315da68 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/scripts/migrate_script.py @@ -0,0 +1,337 @@ +""" +Ad-hoc script to migrate typeshed to a new directory structure proposed in +https://github.com/python/typeshed/issues/2491#issuecomment-611607557 +""" + +import ast +import os +import os.path +import shutil +from dataclasses import dataclass +from typing import List, Optional, Set, Tuple + +# These names may be still discussed so I make them constants. +STDLIB_NAMESPACE = "stdlib" +THIRD_PARTY_NAMESPACE = "stubs" +DEFAULT_VERSION = "0.1" +DEFAULT_PY3_VERSION = "3.6" +PY2_NAMESPACE = "python2" +OUTPUT_DIR = "out" + +# Third party imports (type ignored) of missing stubs. +MISSING_WHITELIST = { + "thrift", +} + +# Manually collected special cases where distribution name and +# package name are different. +package_to_distribution = { + "_pytest": "pytest", + "yaml": "PyYAML", + "typing_extensions": "typing-extensions", + "mypy_extensions": "mypy-extensions", + "pyre_extensions": "pyre-extensions", + "attr": "attrs", + "concurrent": "futures", + "Crypto": "pycrypto", + "datetimerange": "DateTimeRange", + "dateutil": "python-dateutil", + "enum": "enum34", + "flask": "Flask", + "gflags": "python-gflags", + "google": "protobuf", + "jinja2": "Jinja2", + "markupsafe": "MarkupSafe", + "OpenSSL": "openssl-python", + "pymysql": "PyMySQL", + "pyVmomi": "pyvmomi", + "routes": "Routes", + "typed_ast": "typed-ast", + "werkzeug": "Werkzeug", +} + +known_versions = { + "mypy-extensions": "0.4", + "typing-extensions": "3.7", + "typed-ast": "1.4", +} + + +# Classes with "Package" in name represent both packages and modules. +# The latter two are distinguished by is_dir flag. +class PackageBase: + """Common attributes for packages/modules""" + + path: str # full initial path like stdlib/2and3/argparse.pyi + is_dir: bool + + @property + def name(self) -> str: + _, tail = os.path.split(self.path) + if self.is_dir: + assert not tail.endswith(".pyi") + return tail + assert tail.endswith(".pyi") + name, _ = os.path.splitext(tail) + return name + + +@dataclass +class StdLibPackage(PackageBase): + """Package/module in standard library.""" + + path: str + py_version: Optional[str] # Can be omitted for Python 2 only packages. + is_dir: bool + + +@dataclass +class ThirdPartyPackage(PackageBase): + path: str + py2_compatible: bool + py3_compatible: bool + is_dir: bool + requires: List[str] # distributions this depends on + + +def add_stdlib_packages_from(subdir: str, packages: List[StdLibPackage], py_version: Optional[str]) -> None: + """Add standard library packages/modules from a given stdlib/xxx subdirectory. + + Append to packages list in-place, use py_version as the minimal supported version. + """ + for name in os.listdir(subdir): + path = os.path.join(subdir, name) + packages.append(StdLibPackage(path, py_version, is_dir=os.path.isdir(path))) + + +def collect_stdlib_packages() -> Tuple[List[StdLibPackage], List[StdLibPackage]]: + """Collect standard library packages/modules from all current stdlib/xxx sub-directories.""" + stdlib: List[StdLibPackage] = [] + py2_stdlib: List[StdLibPackage] = [] + # These will go to a separate subdirectory. + add_stdlib_packages_from("stdlib/2", py2_stdlib, None) + add_stdlib_packages_from("stdlib/2and3", stdlib, "2.7") + # Use oldest currently supported version for Python 3 packages/modules. + add_stdlib_packages_from("stdlib/3", stdlib, DEFAULT_PY3_VERSION) + for version in ("3.7", "3.8", "3.9"): + subdir = os.path.join("stdlib", version) + if os.path.isdir(subdir): + add_stdlib_packages_from(subdir, stdlib, version) + return stdlib, py2_stdlib + + +def add_third_party_packages_from( + subdir: str, packages: List[ThirdPartyPackage], py2_compatible: bool, py3_compatible: bool +) -> None: + """Add third party packages/modules from a given third_party/xxx subdirectory.""" + for name in os.listdir(subdir): + path = os.path.join(subdir, name) + packages.append(ThirdPartyPackage(path, py2_compatible, py3_compatible, requires=[], is_dir=os.path.isdir(path))) + + +def collect_third_party_packages() -> Tuple[List[ThirdPartyPackage], List[ThirdPartyPackage]]: + """Collect third party packages/modules from all current third_party/xxx sub-directories.""" + third_party: List[ThirdPartyPackage] = [] + py2_third_party: List[ThirdPartyPackage] = [] + add_third_party_packages_from("third_party/3", third_party, py2_compatible=False, py3_compatible=True) + add_third_party_packages_from("third_party/2and3", third_party, py2_compatible=True, py3_compatible=True) + # We special-case Python 2 for third party packages like six. + subdir = "third_party/2" + py3_packages = os.listdir("third_party/3") + for name in os.listdir(subdir): + path = os.path.join(subdir, name) + package = ThirdPartyPackage(path, py2_compatible=True, py3_compatible=False, requires=[], is_dir=os.path.isdir(path)) + if name in py3_packages: + # If there is a package with the same name in /2 and /3, we add the former to + # a separate list, packages from there will be put into /python2 sub-directories. + py2_third_party.append(package) + else: + third_party.append(package) + return third_party, py2_third_party + + +def get_top_imported_names(file: str) -> Set[str]: + """Collect names imported in given file. + + We only collect top-level names, i.e. `from foo.bar import baz` + will only add `foo` to the list. + """ + if not file.endswith(".pyi"): + return set() + with open(os.path.join(file), "rb") as f: + content = f.read() + parsed = ast.parse(content) + top_imported = set() + for node in ast.walk(parsed): + if isinstance(node, ast.Import): + for name in node.names: + top_imported.add(name.name.split(".")[0]) + elif isinstance(node, ast.ImportFrom): + if node.level > 0: + # Relative imports always refer to the current package. + continue + assert node.module + top_imported.add(node.module.split(".")[0]) + return top_imported + + +def populate_requirements( + package: ThirdPartyPackage, stdlib: List[str], py2_stdlib: List[str], known_distributions: Set[str] +) -> None: + """Generate requirements using imports found in a package.""" + assert not package.requires, "Populate must be called once" + if not package.is_dir: + all_top_imports = get_top_imported_names(package.path) + else: + all_top_imports = set() + for dir_path, _, file_names in os.walk(package.path): + for file_name in file_names: + all_top_imports |= get_top_imported_names(os.path.join(dir_path, file_name)) + + # Generate dependencies using collected imports. + requirements = set() + for name in all_top_imports: + # Note: dependencies are between distributions, not packages. + distribution = package_to_distribution.get(name, name) + if package.py3_compatible and name not in stdlib: + if distribution in known_distributions: + requirements.add(distribution) + else: + # Likely a conditional import. + assert distribution in py2_stdlib or distribution in MISSING_WHITELIST + if package.py2_compatible and name not in py2_stdlib: + if distribution in known_distributions: + requirements.add(distribution) + else: + # Likely a conditional import. + assert distribution in stdlib or distribution in MISSING_WHITELIST + # Remove dependency to itself generated by absolute imports. + current_distribution = package_to_distribution.get(package.name, package.name) + package.requires = sorted(requirements - {current_distribution}) + + +def generate_versions(packages: List[StdLibPackage]) -> str: + """Generate the stdlib/VERSIONS file for packages/modules.""" + lines = [] + for package in packages: + assert package.py_version is not None + lines.append(f"{package.name}: {package.py_version}") + return "\n".join(sorted(lines)) + + +def copy_stdlib(packages: List[StdLibPackage], py2_packages: List[StdLibPackage]) -> None: + """Refactor the standard library part using collected metadata.""" + stdlib_dir = os.path.join(OUTPUT_DIR, STDLIB_NAMESPACE) + os.makedirs(stdlib_dir, exist_ok=True) + + # Write version metadata. + with open(os.path.join(stdlib_dir, "VERSIONS"), "w") as f: + f.write(generate_versions(packages)) + f.write("\n") + + # Copy stdlib/2and3 and stdlib/3 packages/modules. + for package in packages: + if not package.is_dir: + shutil.copy(package.path, stdlib_dir) + else: + shutil.copytree(package.path, os.path.join(stdlib_dir, package.name)) + + # Copy stdlib/2 packages/modules to a nested /python namespace. + if py2_packages: + py2_stdlib_dir = os.path.join(stdlib_dir, PY2_NAMESPACE) + os.makedirs(py2_stdlib_dir, exist_ok=True) + for package in py2_packages: + if not package.is_dir: + shutil.copy(package.path, py2_stdlib_dir) + else: + shutil.copytree(package.path, os.path.join(py2_stdlib_dir, package.name)) + + +def generate_metadata(package: ThirdPartyPackage, py2_packages: List[str]) -> str: + """Generate METADATA.toml for a given package. + + Only add compatibility flags if they are different from default values: + python2 = false, python3 = true. + + Note: the metadata should be generated per distribution, but we just use + an arbitrary package to populate it, since it should be the same for all + packages. + """ + version = known_versions.get( + package_to_distribution.get(package.name, package.name), + DEFAULT_VERSION, + ) + lines = [f'version = "{version}"'] + if package.py2_compatible or package.name in py2_packages: + # Note: for packages like six that appear in both normal and Python 2 only + # lists we force set python2 = true. + lines.append("python2 = true") + if not package.py3_compatible: + lines.append("python3 = false") + if package.requires: + distributions = [f'"types-{package_to_distribution.get(dep, dep)}"' for dep in package.requires] + lines.append(f"requires = [{', '.join(distributions)}]") + return "\n".join(lines) + + +def copy_third_party(packages: List[ThirdPartyPackage], py2_packages: List[ThirdPartyPackage]) -> None: + """Refactor the third party part using collected metadata.""" + third_party_dir = os.path.join(OUTPUT_DIR, THIRD_PARTY_NAMESPACE) + os.makedirs(third_party_dir, exist_ok=True) + + # Note: these include Python 3 versions of packages like six. + for package in packages: + distribution = package_to_distribution.get(package.name, package.name) + distribution_dir = os.path.join(third_party_dir, distribution) + os.makedirs(distribution_dir, exist_ok=True) + metadata_file = os.path.join(distribution_dir, "METADATA.toml") + if not os.path.isfile(metadata_file): + # Write metadata once. + # TODO: check consistency between different packages in same distribution? + with open(metadata_file, "w") as f: + f.write(generate_metadata(package, [package.name for package in py2_packages])) + f.write("\n") + if not package.is_dir: + shutil.copy(package.path, distribution_dir) + else: + shutil.copytree(package.path, os.path.join(distribution_dir, package.name)) + + # Add Python 2 counterparts of packages like six (with different stubs) to nested + # namespaces like six/python2/six. + for package in py2_packages: + distribution = package_to_distribution.get(package.name, package.name) + distribution_dir = os.path.join(third_party_dir, distribution, PY2_NAMESPACE) + os.makedirs(distribution_dir, exist_ok=True) + if not package.is_dir: + shutil.copy(package.path, distribution_dir) + else: + shutil.copytree(package.path, os.path.join(distribution_dir, package.name)) + + +def main() -> None: + # Collect metadata for Python 2 and 3, and Python 2 only standard library + # packages/modules. The latter will go to a separate nested namespace. + stdlib, py2_stdlib = collect_stdlib_packages() + third_party, py2_third_party = collect_third_party_packages() + + # Collect standard library names to filter out from dependencies. + stdlib_names = [package.name for package in stdlib] + py2_stdlib_names = [package.name for package in py2_stdlib] + py2_stdlib_names += [package.name for package in stdlib if package.py_version == "2.7"] + + # Collect all known distributions (for sanity checks). + known_distributions = {package_to_distribution.get(package.name, package.name) for package in third_party + py2_third_party} + + # Compute dependencies between third party packages/modules to populate metadata. + for package in third_party + py2_third_party: + populate_requirements(package, stdlib_names, py2_stdlib_names, known_distributions) + + # Copy the files to a separate location (to not clobber the root directory). + if not os.path.isdir(OUTPUT_DIR): + os.mkdir(OUTPUT_DIR) + copy_stdlib(stdlib, py2_stdlib) + copy_third_party(third_party, py2_third_party) + + +if __name__ == "__main__": + main() diff --git a/anaconda_lib/jedi/third_party/typeshed/scripts/update-stubtest-whitelist.py b/anaconda_lib/jedi/third_party/typeshed/scripts/update-stubtest-whitelist.py new file mode 100755 index 00000000..52eb4d86 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/scripts/update-stubtest-whitelist.py @@ -0,0 +1,59 @@ +#!/usr/bin/env python3 + +# This script removes lines from stubtest whitelists, according to +# an input file. The input file has one entry to remove per line. +# Each line consists of a whitelist filename and an entry, separated +# by a colon. + +# This script is used by the workflow to remove unused whitelist entries. + +import sys +from collections import defaultdict +from typing import Dict, List, Set, Tuple + + +def main() -> None: + if len(sys.argv) != 2: + print(f"Usage: {sys.argv[0]} FILENAME", file=sys.stderr) + sys.exit(1) + + to_remove = parse_input_file(sys.argv[1]) + for filename, entries in to_remove.items(): + remove_entries_from_whitelist(filename, entries) + + +def parse_input_file(input_file: str) -> Dict[str, Set[str]]: + to_remove = defaultdict(set) + with open(input_file) as f: + for filename, wl_entry in [parse_input_line(li) for li in f if li.strip()]: + to_remove[filename].add(wl_entry) + return to_remove + + +# Returns a (filename, entry) tuple. +def parse_input_line(line: str) -> Tuple[str, str]: + line = line.strip() + filename, entry = line.split(":", maxsplit=1) + return filename, entry + + +def remove_entries_from_whitelist(filename: str, entries: Set[str]) -> None: + new_lines: List[str] = [] + with open(filename) as f: + for line in f: + entry = line.strip().split(" #")[0] + if entry in entries: + entries.remove(entry) + else: + new_lines.append(line) + if entries: + print(f"WARNING: The following entries were not found in '{filename}':", file=sys.stderr) + for entry in entries: + print(f" * {entry}") + with open(filename, "w") as f: + for line in new_lines: + f.write(line) + + +if __name__ == "__main__": + main() diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/BaseHTTPServer.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/BaseHTTPServer.pyi old mode 100755 new mode 100644 index ad5f24e2..28fc4de0 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/BaseHTTPServer.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/BaseHTTPServer.pyi @@ -1,14 +1,11 @@ -# Stubs for BaseHTTPServer (Python 2.7) - -from typing import Any, BinaryIO, Callable, Mapping, Optional, Tuple, Union -import SocketServer import mimetools +import SocketServer +from typing import Any, BinaryIO, Callable, Mapping, Optional, Tuple, Union class HTTPServer(SocketServer.TCPServer): server_name: str server_port: int - def __init__(self, server_address: Tuple[str, int], - RequestHandlerClass: Callable[..., BaseHTTPRequestHandler]) -> None: ... + def __init__(self, server_address: Tuple[str, int], RequestHandlerClass: Callable[..., BaseHTTPRequestHandler]) -> None: ... class BaseHTTPRequestHandler(SocketServer.StreamRequestHandler): client_address: Tuple[str, int] @@ -27,18 +24,15 @@ class BaseHTTPRequestHandler(SocketServer.StreamRequestHandler): protocol_version: str MessageClass: type responses: Mapping[int, Tuple[str, str]] - def __init__(self, request: bytes, client_address: Tuple[str, int], - server: SocketServer.BaseServer) -> None: ... + def __init__(self, request: bytes, client_address: Tuple[str, int], server: SocketServer.BaseServer) -> None: ... def handle(self) -> None: ... def handle_one_request(self) -> None: ... def send_error(self, code: int, message: Optional[str] = ...) -> None: ... - def send_response(self, code: int, - message: Optional[str] = ...) -> None: ... + def send_response(self, code: int, message: Optional[str] = ...) -> None: ... def send_header(self, keyword: str, value: str) -> None: ... def end_headers(self) -> None: ... def flush_headers(self) -> None: ... - def log_request(self, code: Union[int, str] = ..., - size: Union[int, str] = ...) -> None: ... + def log_request(self, code: Union[int, str] = ..., size: Union[int, str] = ...) -> None: ... def log_error(self, format: str, *args: Any) -> None: ... def log_message(self, format: str, *args: Any) -> None: ... def version_string(self) -> str: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/CGIHTTPServer.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/CGIHTTPServer.pyi old mode 100755 new mode 100644 index 4eae666d..393dcb83 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/CGIHTTPServer.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/CGIHTTPServer.pyi @@ -1,7 +1,5 @@ -# Stubs for CGIHTTPServer (Python 2.7) - -from typing import List import SimpleHTTPServer +from typing import List class CGIHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): cgi_directories: List[str] diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/ConfigParser.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/ConfigParser.pyi old mode 100755 new mode 100644 index fa0e5517..05c90ed2 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/ConfigParser.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/ConfigParser.pyi @@ -1,4 +1,5 @@ -from typing import Any, IO, Sequence, Tuple, Union, List, Dict, Protocol, Optional +from _typeshed import SupportsNoArgReadline +from typing import IO, Any, Dict, List, Optional, Sequence, Tuple, Union DEFAULTSECT: str MAX_INTERPOLATION_DEPTH: int @@ -50,9 +51,6 @@ class MissingSectionHeaderError(ParsingError): line: Any def __init__(self, filename: str, lineno: Any, line: Any) -> None: ... -class _Readable(Protocol): - def readline(self) -> str: ... - class RawConfigParser: _dict: Any _sections: Dict[Any, Any] @@ -68,7 +66,7 @@ class RawConfigParser: def has_section(self, section: str) -> bool: ... def options(self, section: str) -> List[str]: ... def read(self, filenames: Union[str, Sequence[str]]) -> List[str]: ... - def readfp(self, fp: _Readable, filename: str = ...) -> None: ... + def readfp(self, fp: SupportsNoArgReadline[str], filename: str = ...) -> None: ... def get(self, section: str, option: str) -> str: ... def items(self, section: str) -> List[Tuple[Any, Any]]: ... def _get(self, section: str, conv: type, option: str) -> Any: ... @@ -95,5 +93,5 @@ class SafeConfigParser(ConfigParser): _interpvar_re: Any def _interpolate(self, section: str, option: str, rawval: Any, vars: Any) -> str: ... def _interpolate_some( - self, option: str, accum: List[Any], rest: str, section: str, map: Dict[Any, Any], depth: int, + self, option: str, accum: List[Any], rest: str, section: str, map: Dict[Any, Any], depth: int ) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/Cookie.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/Cookie.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/HTMLParser.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/HTMLParser.pyi old mode 100755 new mode 100644 index 0f6c7e39..ebc2735e --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/HTMLParser.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/HTMLParser.pyi @@ -1,4 +1,5 @@ -from typing import List, Tuple, AnyStr +from typing import AnyStr, List, Tuple + from markupbase import ParserBase class HTMLParser(ParserBase): @@ -6,11 +7,9 @@ class HTMLParser(ParserBase): def feed(self, feed: AnyStr) -> None: ... def close(self) -> None: ... def reset(self) -> None: ... - def get_starttag_text(self) -> AnyStr: ... def set_cdata_mode(self, AnyStr) -> None: ... def clear_cdata_mode(self) -> None: ... - def handle_startendtag(self, tag: AnyStr, attrs: List[Tuple[AnyStr, AnyStr]]): ... def handle_starttag(self, tag: AnyStr, attrs: List[Tuple[AnyStr, AnyStr]]): ... def handle_endtag(self, tag: AnyStr): ... @@ -20,9 +19,7 @@ class HTMLParser(ParserBase): def handle_comment(self, data: AnyStr): ... def handle_decl(self, decl: AnyStr): ... def handle_pi(self, data: AnyStr): ... - def unknown_decl(self, data: AnyStr): ... - def unescape(self, s: AnyStr) -> AnyStr: ... class HTMLParseError(Exception): diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/Queue.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/Queue.pyi old mode 100755 new mode 100644 index 76e3dcb5..98dda872 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/Queue.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/Queue.pyi @@ -1,9 +1,7 @@ -# Stubs for Queue (Python 2) - from collections import deque -from typing import Any, Deque, TypeVar, Generic, Optional +from typing import Any, Deque, Generic, Optional, TypeVar -_T = TypeVar('_T') +_T = TypeVar("_T") class Empty(Exception): ... class Full(Exception): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/SimpleHTTPServer.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/SimpleHTTPServer.pyi old mode 100755 new mode 100644 index 4a36cc5b..7e62b49e --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/SimpleHTTPServer.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/SimpleHTTPServer.pyi @@ -1,8 +1,6 @@ -# Stubs for SimpleHTTPServer (Python 2) - -from typing import Any, AnyStr, IO, Mapping, Optional, Union import BaseHTTPServer from StringIO import StringIO +from typing import IO, Any, AnyStr, Mapping, Optional, Union class SimpleHTTPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler): server_version: str diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/SocketServer.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/SocketServer.pyi old mode 100755 new mode 100644 index 0b4d3a27..b8a2c14e --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/SocketServer.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/SocketServer.pyi @@ -1,10 +1,7 @@ -# NB: SocketServer.pyi and socketserver.pyi must remain consistent! -# Stubs for socketserver - -from typing import Any, BinaryIO, Callable, Optional, Tuple, Type, Text, Union -from socket import SocketType import sys import types +from socket import SocketType +from typing import Any, BinaryIO, Callable, ClassVar, List, Optional, Text, Tuple, Type, Union class BaseServer: address_family: int @@ -15,66 +12,78 @@ class BaseServer: request_queue_size: int socket_type: int timeout: Optional[float] - def __init__(self, server_address: Any, - RequestHandlerClass: Callable[..., BaseRequestHandler]) -> None: ... + def __init__(self, server_address: Any, RequestHandlerClass: Callable[..., BaseRequestHandler]) -> None: ... def fileno(self) -> int: ... def handle_request(self) -> None: ... def serve_forever(self, poll_interval: float = ...) -> None: ... def shutdown(self) -> None: ... def server_close(self) -> None: ... - def finish_request(self, request: bytes, - client_address: Tuple[str, int]) -> None: ... - def get_request(self) -> None: ... - def handle_error(self, request: bytes, - client_address: Tuple[str, int]) -> None: ... + def finish_request(self, request: bytes, client_address: Tuple[str, int]) -> None: ... + def get_request(self) -> Tuple[SocketType, Tuple[str, int]]: ... + def handle_error(self, request: bytes, client_address: Tuple[str, int]) -> None: ... def handle_timeout(self) -> None: ... - def process_request(self, request: bytes, - client_address: Tuple[str, int]) -> None: ... + def process_request(self, request: bytes, client_address: Tuple[str, int]) -> None: ... def server_activate(self) -> None: ... def server_bind(self) -> None: ... - def verify_request(self, request: bytes, - client_address: Tuple[str, int]) -> bool: ... - if sys.version_info >= (3, 6): - def __enter__(self) -> BaseServer: ... - def __exit__(self, exc_type: Optional[Type[BaseException]], - exc_val: Optional[BaseException], - exc_tb: Optional[types.TracebackType]) -> None: ... - if sys.version_info >= (3, 3): - def service_actions(self) -> None: ... + def verify_request(self, request: bytes, client_address: Tuple[str, int]) -> bool: ... class TCPServer(BaseServer): - def __init__(self, server_address: Tuple[str, int], - RequestHandlerClass: Callable[..., BaseRequestHandler], - bind_and_activate: bool = ...) -> None: ... + def __init__( + self, + server_address: Tuple[str, int], + RequestHandlerClass: Callable[..., BaseRequestHandler], + bind_and_activate: bool = ..., + ) -> None: ... class UDPServer(BaseServer): - def __init__(self, server_address: Tuple[str, int], - RequestHandlerClass: Callable[..., BaseRequestHandler], - bind_and_activate: bool = ...) -> None: ... + def __init__( + self, + server_address: Tuple[str, int], + RequestHandlerClass: Callable[..., BaseRequestHandler], + bind_and_activate: bool = ..., + ) -> None: ... -if sys.platform != 'win32': +if sys.platform != "win32": class UnixStreamServer(BaseServer): - def __init__(self, server_address: Union[Text, bytes], - RequestHandlerClass: Callable[..., BaseRequestHandler], - bind_and_activate: bool = ...) -> None: ... - + def __init__( + self, + server_address: Union[Text, bytes], + RequestHandlerClass: Callable[..., BaseRequestHandler], + bind_and_activate: bool = ..., + ) -> None: ... class UnixDatagramServer(BaseServer): - def __init__(self, server_address: Union[Text, bytes], - RequestHandlerClass: Callable[..., BaseRequestHandler], - bind_and_activate: bool = ...) -> None: ... + def __init__( + self, + server_address: Union[Text, bytes], + RequestHandlerClass: Callable[..., BaseRequestHandler], + bind_and_activate: bool = ..., + ) -> None: ... + +if sys.platform != "win32": + class ForkingMixIn: + timeout: Optional[float] # undocumented + active_children: Optional[List[int]] # undocumented + max_children: int # undocumented + def collect_children(self) -> None: ... # undocumented + def handle_timeout(self) -> None: ... # undocumented + def process_request(self, request: bytes, client_address: Tuple[str, int]) -> None: ... -class ForkingMixIn: ... -class ThreadingMixIn: ... +class ThreadingMixIn: + daemon_threads: bool + def process_request_thread(self, request: bytes, client_address: Tuple[str, int]) -> None: ... # undocumented + def process_request(self, request: bytes, client_address: Tuple[str, int]) -> None: ... + +if sys.platform != "win32": + class ForkingTCPServer(ForkingMixIn, TCPServer): ... + class ForkingUDPServer(ForkingMixIn, UDPServer): ... -class ForkingTCPServer(ForkingMixIn, TCPServer): ... -class ForkingUDPServer(ForkingMixIn, UDPServer): ... class ThreadingTCPServer(ThreadingMixIn, TCPServer): ... class ThreadingUDPServer(ThreadingMixIn, UDPServer): ... -if sys.platform != 'win32': + +if sys.platform != "win32": class ThreadingUnixStreamServer(ThreadingMixIn, UnixStreamServer): ... class ThreadingUnixDatagramServer(ThreadingMixIn, UnixDatagramServer): ... - class BaseRequestHandler: # Those are technically of types, respectively: # * Union[SocketType, Tuple[bytes, SocketType]] @@ -84,16 +93,23 @@ class BaseRequestHandler: # https://github.com/python/typeshed/pull/384#issuecomment-234649696) request: Any client_address: Any - server: BaseServer + def __init__(self, request: Any, client_address: Any, server: BaseServer) -> None: ... def setup(self) -> None: ... def handle(self) -> None: ... def finish(self) -> None: ... class StreamRequestHandler(BaseRequestHandler): + rbufsize: ClassVar[int] # Undocumented + wbufsize: ClassVar[int] # Undocumented + timeout: ClassVar[Optional[float]] # Undocumented + disable_nagle_algorithm: ClassVar[bool] # Undocumented + connection: SocketType # Undocumented rfile: BinaryIO wfile: BinaryIO class DatagramRequestHandler(BaseRequestHandler): + packet: SocketType # Undocumented + socket: SocketType # Undocumented rfile: BinaryIO wfile: BinaryIO diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/StringIO.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/StringIO.pyi old mode 100755 new mode 100644 index de17f6ab..4470b4fc --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/StringIO.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/StringIO.pyi @@ -1,6 +1,4 @@ -# Stubs for StringIO (Python 2) - -from typing import Any, IO, AnyStr, Iterator, Iterable, Generic, List, Optional +from typing import IO, Any, AnyStr, Generic, Iterable, Iterator, List, Optional class StringIO(IO[AnyStr], Generic[AnyStr]): closed: bool diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/UserDict.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/UserDict.pyi old mode 100755 new mode 100644 index 1d850cfc..afa07d86 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/UserDict.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/UserDict.pyi @@ -1,25 +1,35 @@ -from typing import (Any, Container, Dict, Generic, Iterable, Iterator, List, - Mapping, Optional, Sized, Tuple, TypeVar, Union, overload) - -_KT = TypeVar('_KT') -_VT = TypeVar('_VT') -_T = TypeVar('_T') +from typing import ( + Any, + Container, + Dict, + Generic, + Iterable, + Iterator, + List, + Mapping, + Optional, + Sized, + Tuple, + TypeVar, + Union, + overload, +) + +_KT = TypeVar("_KT") +_VT = TypeVar("_VT") +_T = TypeVar("_T") class UserDict(Dict[_KT, _VT], Generic[_KT, _VT]): data: Dict[_KT, _VT] - def __init__(self, initialdata: Mapping[_KT, _VT] = ...) -> None: ... - # TODO: __iter__ is not available for UserDict -class IterableUserDict(UserDict[_KT, _VT], Generic[_KT, _VT]): - ... +class IterableUserDict(UserDict[_KT, _VT], Generic[_KT, _VT]): ... class DictMixin(Iterable[_KT], Container[_KT], Sized, Generic[_KT, _VT]): def has_key(self, key: _KT) -> bool: ... def __len__(self) -> int: ... def __iter__(self) -> Iterator[_KT]: ... - # From typing.Mapping[_KT, _VT] # (can't inherit because of keys()) @overload @@ -32,7 +42,6 @@ class DictMixin(Iterable[_KT], Container[_KT], Sized, Generic[_KT, _VT]): def itervalues(self) -> Iterator[_VT]: ... def iteritems(self) -> Iterator[Tuple[_KT, _VT]]: ... def __contains__(self, o: Any) -> bool: ... - # From typing.MutableMapping[_KT, _VT] def clear(self) -> None: ... def pop(self, k: _KT, default: _VT = ...) -> _VT: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/UserList.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/UserList.pyi old mode 100755 new mode 100644 index 3c71e829..0fc2a31b --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/UserList.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/UserList.pyi @@ -1,4 +1,4 @@ -from typing import Iterable, MutableSequence, TypeVar, Union, overload, List +from typing import Iterable, List, MutableSequence, TypeVar, Union, overload _T = TypeVar("_T") _S = TypeVar("_S") diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/UserString.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/UserString.pyi old mode 100755 new mode 100644 index 704a93bc..df7bbc36 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/UserString.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/UserString.pyi @@ -1,5 +1,5 @@ import collections -from typing import Any, Iterable, List, MutableSequence, Sequence, Optional, overload, Text, TypeVar, Tuple, Union +from typing import Any, Iterable, List, MutableSequence, Optional, Sequence, Text, Tuple, TypeVar, Union, overload _UST = TypeVar("_UST", bound=UserString) _MST = TypeVar("_MST", bound=MutableString) diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/__builtin__.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/__builtin__.pyi old mode 100755 new mode 100644 index 249a5cd6..efe3b12c --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/__builtin__.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/__builtin__.pyi @@ -1,54 +1,80 @@ # True and False are deliberately omitted because they are keywords in # Python 3, and stub files conform to Python 3 syntax. +from _typeshed import ReadableBuffer, SupportsKeysAndGetItem, SupportsWrite +from abc import ABCMeta +from ast import mod +from types import CodeType from typing import ( - TypeVar, Iterator, Iterable, NoReturn, overload, Container, - Sequence, MutableSequence, Mapping, MutableMapping, Tuple, List, Any, Dict, Callable, Generic, - Set, AbstractSet, FrozenSet, MutableSet, Sized, Reversible, SupportsInt, SupportsFloat, SupportsAbs, - SupportsComplex, IO, BinaryIO, Union, - ItemsView, KeysView, ValuesView, ByteString, Optional, AnyStr, Type, Text, + AbstractSet, + Any, + AnyStr, + BinaryIO, + ByteString, + Callable, + Container, + Dict, + FrozenSet, + Generic, + ItemsView, + Iterable, + Iterator, + KeysView, + List, + Mapping, + MutableMapping, + MutableSequence, + MutableSet, + NoReturn, + Optional, Protocol, + Reversible, + Sequence, + Set, + Sized, + SupportsAbs, + SupportsComplex, + SupportsFloat, + SupportsInt, + Text, + Tuple, + Type, + TypeVar, + Union, + ValuesView, + overload, + runtime_checkable, ) -from abc import abstractmethod, ABCMeta -from ast import mod, AST -from types import TracebackType, CodeType -import sys - -if sys.version_info >= (3,): - from typing import SupportsBytes, SupportsRound - -if sys.version_info >= (3, 8): - from typing import Literal -else: - from typing_extensions import Literal - -_T = TypeVar('_T') -_T_co = TypeVar('_T_co', covariant=True) -_KT = TypeVar('_KT') -_VT = TypeVar('_VT') -_S = TypeVar('_S') -_T1 = TypeVar('_T1') -_T2 = TypeVar('_T2') -_T3 = TypeVar('_T3') -_T4 = TypeVar('_T4') -_T5 = TypeVar('_T5') -_TT = TypeVar('_TT', bound='type') +from typing_extensions import Literal class _SupportsIndex(Protocol): def __index__(self) -> int: ... +class _SupportsTrunc(Protocol): + def __trunc__(self) -> int: ... + +_T = TypeVar("_T") +_T_co = TypeVar("_T_co", covariant=True) +_KT = TypeVar("_KT") +_VT = TypeVar("_VT") +_S = TypeVar("_S") +_T1 = TypeVar("_T1") +_T2 = TypeVar("_T2") +_T3 = TypeVar("_T3") +_T4 = TypeVar("_T4") +_T5 = TypeVar("_T5") +_TT = TypeVar("_TT", bound="type") +_TBE = TypeVar("_TBE", bound="BaseException") + class object: __doc__: Optional[str] __dict__: Dict[str, Any] __slots__: Union[Text, Iterable[Text]] __module__: str - if sys.version_info >= (3, 6): - __annotations__: Dict[str, Any] - @property def __class__(self: _T) -> Type[_T]: ... @__class__.setter - def __class__(self, __type: Type[object]) -> None: ... + def __class__(self, __type: Type[object]) -> None: ... # noqa: F811 def __init__(self) -> None: ... def __new__(cls) -> Any: ... def __setattr__(self, name: str, value: Any) -> None: ... @@ -63,25 +89,15 @@ class object: def __sizeof__(self) -> int: ... def __reduce__(self) -> Union[str, Tuple[Any, ...]]: ... def __reduce_ex__(self, protocol: int) -> Union[str, Tuple[Any, ...]]: ... - if sys.version_info >= (3,): - def __dir__(self) -> Iterable[str]: ... - if sys.version_info >= (3, 6): - def __init_subclass__(cls) -> None: ... class staticmethod(object): # Special, only valid as a decorator. __func__: Callable[..., Any] - if sys.version_info >= (3,): - __isabstractmethod__: bool - def __init__(self, f: Callable[..., Any]) -> None: ... def __new__(cls: Type[_T], *args: Any, **kwargs: Any) -> _T: ... def __get__(self, obj: _T, type: Optional[Type[_T]] = ...) -> Callable[..., Any]: ... class classmethod(object): # Special, only valid as a decorator. __func__: Callable[..., Any] - if sys.version_info >= (3,): - __isabstractmethod__: bool - def __init__(self, f: Callable[..., Any]) -> None: ... def __new__(cls: Type[_T], *args: Any, **kwargs: Any) -> _T: ... def __get__(self, obj: _T, type: Optional[Type[_T]] = ...) -> Callable[..., Any]: ... @@ -97,11 +113,7 @@ class type(object): __module__: str __mro__: Tuple[type, ...] __name__: str - if sys.version_info >= (3,): - __qualname__: str - __text_signature__: Optional[str] __weakrefoffset__: int - @overload def __init__(self, o: object) -> None: ... @overload @@ -117,32 +129,18 @@ class type(object): def mro(self) -> List[type]: ... def __instancecheck__(self, instance: Any) -> bool: ... def __subclasscheck__(self, subclass: type) -> bool: ... - if sys.version_info >= (3,): - @classmethod - def __prepare__(metacls, __name: str, __bases: Tuple[type, ...], **kwds: Any) -> Mapping[str, Any]: ... class super(object): - if sys.version_info >= (3,): - @overload - def __init__(self, t: Any, obj: Any) -> None: ... - @overload - def __init__(self, t: Any) -> None: ... - @overload - def __init__(self) -> None: ... - else: - @overload - def __init__(self, t: Any, obj: Any) -> None: ... - @overload - def __init__(self, t: Any) -> None: ... + @overload + def __init__(self, t: Any, obj: Any) -> None: ... + @overload + def __init__(self, t: Any) -> None: ... class int: @overload - def __init__(self, x: Union[Text, bytes, SupportsInt, _SupportsIndex] = ...) -> None: ... + def __new__(cls: Type[_T], x: Union[Text, bytes, SupportsInt, _SupportsIndex, _SupportsTrunc] = ...) -> _T: ... @overload - def __init__(self, x: Union[Text, bytes, bytearray], base: int) -> None: ... - - if sys.version_info >= (3, 8): - def as_integer_ratio(self) -> Tuple[int, Literal[1]]: ... + def __new__(cls: Type[_T], x: Union[Text, bytes, bytearray], base: int) -> _T: ... @property def real(self) -> int: ... @property @@ -152,20 +150,12 @@ class int: @property def denominator(self) -> int: ... def conjugate(self) -> int: ... - def bit_length(self) -> int: ... - if sys.version_info >= (3,): - def to_bytes(self, length: int, byteorder: str, *, signed: bool = ...) -> bytes: ... - @classmethod - def from_bytes(cls, bytes: Sequence[int], byteorder: str, *, - signed: bool = ...) -> int: ... # TODO buffer object argument - def __add__(self, x: int) -> int: ... def __sub__(self, x: int) -> int: ... def __mul__(self, x: int) -> int: ... def __floordiv__(self, x: int) -> int: ... - if sys.version_info < (3,): - def __div__(self, x: int) -> int: ... + def __div__(self, x: int) -> int: ... def __truediv__(self, x: int) -> float: ... def __mod__(self, x: int) -> int: ... def __divmod__(self, x: int) -> Tuple[int, int]: ... @@ -173,13 +163,15 @@ class int: def __rsub__(self, x: int) -> int: ... def __rmul__(self, x: int) -> int: ... def __rfloordiv__(self, x: int) -> int: ... - if sys.version_info < (3,): - def __rdiv__(self, x: int) -> int: ... + def __rdiv__(self, x: int) -> int: ... def __rtruediv__(self, x: int) -> float: ... def __rmod__(self, x: int) -> int: ... def __rdivmod__(self, x: int) -> Tuple[int, int]: ... + @overload + def __pow__(self, __x: Literal[2], __modulo: Optional[int] = ...) -> int: ... + @overload def __pow__(self, __x: int, __modulo: Optional[int] = ...) -> Any: ... # Return type can be int or float, depending on x. - def __rpow__(self, x: int) -> Any: ... + def __rpow__(self, x: int, mod: Optional[int] = ...) -> Any: ... def __and__(self, n: int) -> int: ... def __or__(self, n: int) -> int: ... def __xor__(self, n: int) -> int: ... @@ -194,72 +186,55 @@ class int: def __pos__(self) -> int: ... def __invert__(self) -> int: ... def __trunc__(self) -> int: ... - if sys.version_info >= (3,): - def __ceil__(self) -> int: ... - def __floor__(self) -> int: ... - def __round__(self, ndigits: Optional[int] = ...) -> int: ... def __getnewargs__(self) -> Tuple[int]: ... - def __eq__(self, x: object) -> bool: ... def __ne__(self, x: object) -> bool: ... def __lt__(self, x: int) -> bool: ... def __le__(self, x: int) -> bool: ... def __gt__(self, x: int) -> bool: ... def __ge__(self, x: int) -> bool: ... - def __str__(self) -> str: ... def __float__(self) -> float: ... def __int__(self) -> int: ... def __abs__(self) -> int: ... def __hash__(self) -> int: ... - if sys.version_info >= (3,): - def __bool__(self) -> bool: ... - else: - def __nonzero__(self) -> bool: ... + def __nonzero__(self) -> bool: ... def __index__(self) -> int: ... class float: - def __init__(self, x: Union[SupportsFloat, _SupportsIndex, Text, bytes, bytearray] = ...) -> None: ... + def __new__(cls: Type[_T], x: Union[SupportsFloat, _SupportsIndex, Text, bytes, bytearray] = ...) -> _T: ... def as_integer_ratio(self) -> Tuple[int, int]: ... def hex(self) -> str: ... def is_integer(self) -> bool: ... @classmethod - def fromhex(cls, s: str) -> float: ... - + def fromhex(cls, __s: str) -> float: ... @property def real(self) -> float: ... @property def imag(self) -> float: ... def conjugate(self) -> float: ... - def __add__(self, x: float) -> float: ... def __sub__(self, x: float) -> float: ... def __mul__(self, x: float) -> float: ... def __floordiv__(self, x: float) -> float: ... - if sys.version_info < (3,): - def __div__(self, x: float) -> float: ... + def __div__(self, x: float) -> float: ... def __truediv__(self, x: float) -> float: ... def __mod__(self, x: float) -> float: ... def __divmod__(self, x: float) -> Tuple[float, float]: ... - def __pow__(self, x: float) -> float: ... # In Python 3, returns complex if self is negative and x is not whole + def __pow__( + self, x: float, mod: None = ... + ) -> float: ... # In Python 3, returns complex if self is negative and x is not whole def __radd__(self, x: float) -> float: ... def __rsub__(self, x: float) -> float: ... def __rmul__(self, x: float) -> float: ... def __rfloordiv__(self, x: float) -> float: ... - if sys.version_info < (3,): - def __rdiv__(self, x: float) -> float: ... + def __rdiv__(self, x: float) -> float: ... def __rtruediv__(self, x: float) -> float: ... def __rmod__(self, x: float) -> float: ... def __rdivmod__(self, x: float) -> Tuple[float, float]: ... - def __rpow__(self, x: float) -> float: ... + def __rpow__(self, x: float, mod: None = ...) -> float: ... def __getnewargs__(self) -> Tuple[float]: ... def __trunc__(self) -> int: ... - if sys.version_info >= (3,): - @overload - def __round__(self, ndigits: None = ...) -> int: ... - @overload - def __round__(self, ndigits: int) -> float: ... - def __eq__(self, x: object) -> bool: ... def __ne__(self, x: object) -> bool: ... def __lt__(self, x: float) -> bool: ... @@ -268,269 +243,192 @@ class float: def __ge__(self, x: float) -> bool: ... def __neg__(self) -> float: ... def __pos__(self) -> float: ... - def __str__(self) -> str: ... def __int__(self) -> int: ... def __float__(self) -> float: ... def __abs__(self) -> float: ... def __hash__(self) -> int: ... - if sys.version_info >= (3,): - def __bool__(self) -> bool: ... - else: - def __nonzero__(self) -> bool: ... + def __nonzero__(self) -> bool: ... class complex: @overload - def __init__(self, real: float = ..., imag: float = ...) -> None: ... + def __new__(cls: Type[_T], real: float = ..., imag: float = ...) -> _T: ... @overload - def __init__(self, real: Union[str, SupportsComplex, _SupportsIndex]) -> None: ... - + def __new__(cls: Type[_T], real: Union[str, SupportsComplex, _SupportsIndex]) -> _T: ... @property def real(self) -> float: ... @property def imag(self) -> float: ... - def conjugate(self) -> complex: ... - def __add__(self, x: complex) -> complex: ... def __sub__(self, x: complex) -> complex: ... def __mul__(self, x: complex) -> complex: ... - def __pow__(self, x: complex) -> complex: ... - if sys.version_info < (3,): - def __div__(self, x: complex) -> complex: ... + def __pow__(self, x: complex, mod: None = ...) -> complex: ... + def __div__(self, x: complex) -> complex: ... def __truediv__(self, x: complex) -> complex: ... def __radd__(self, x: complex) -> complex: ... def __rsub__(self, x: complex) -> complex: ... def __rmul__(self, x: complex) -> complex: ... - def __rpow__(self, x: complex) -> complex: ... - if sys.version_info < (3,): - def __rdiv__(self, x: complex) -> complex: ... + def __rpow__(self, x: complex, mod: None = ...) -> complex: ... + def __rdiv__(self, x: complex) -> complex: ... def __rtruediv__(self, x: complex) -> complex: ... - def __eq__(self, x: object) -> bool: ... def __ne__(self, x: object) -> bool: ... def __neg__(self) -> complex: ... def __pos__(self) -> complex: ... - def __str__(self) -> str: ... def __complex__(self) -> complex: ... def __abs__(self) -> float: ... def __hash__(self) -> int: ... - if sys.version_info >= (3,): - def __bool__(self) -> bool: ... - else: - def __nonzero__(self) -> bool: ... - -if sys.version_info >= (3,): - _str_base = object -else: - class basestring(metaclass=ABCMeta): ... - - class unicode(basestring, Sequence[unicode]): - @overload - def __init__(self) -> None: ... - @overload - def __init__(self, o: object) -> None: ... - @overload - def __init__(self, o: str, encoding: unicode = ..., errors: unicode = ...) -> None: ... - def capitalize(self) -> unicode: ... - def center(self, width: int, fillchar: unicode = ...) -> unicode: ... - def count(self, x: unicode) -> int: ... - def decode(self, encoding: unicode = ..., errors: unicode = ...) -> unicode: ... - def encode(self, encoding: unicode = ..., errors: unicode = ...) -> str: ... - def endswith(self, suffix: Union[unicode, Tuple[unicode, ...]], start: int = ..., - end: int = ...) -> bool: ... - def expandtabs(self, tabsize: int = ...) -> unicode: ... - def find(self, sub: unicode, start: int = ..., end: int = ...) -> int: ... - def format(self, *args: object, **kwargs: object) -> unicode: ... - def index(self, sub: unicode, start: int = ..., end: int = ...) -> int: ... - def isalnum(self) -> bool: ... - def isalpha(self) -> bool: ... - def isdecimal(self) -> bool: ... - def isdigit(self) -> bool: ... - def isidentifier(self) -> bool: ... - def islower(self) -> bool: ... - def isnumeric(self) -> bool: ... - def isprintable(self) -> bool: ... - def isspace(self) -> bool: ... - def istitle(self) -> bool: ... - def isupper(self) -> bool: ... - def join(self, iterable: Iterable[unicode]) -> unicode: ... - def ljust(self, width: int, fillchar: unicode = ...) -> unicode: ... - def lower(self) -> unicode: ... - def lstrip(self, chars: unicode = ...) -> unicode: ... - def partition(self, sep: unicode) -> Tuple[unicode, unicode, unicode]: ... - def replace(self, old: unicode, new: unicode, count: int = ...) -> unicode: ... - def rfind(self, sub: unicode, start: int = ..., end: int = ...) -> int: ... - def rindex(self, sub: unicode, start: int = ..., end: int = ...) -> int: ... - def rjust(self, width: int, fillchar: unicode = ...) -> unicode: ... - def rpartition(self, sep: unicode) -> Tuple[unicode, unicode, unicode]: ... - def rsplit(self, sep: Optional[unicode] = ..., maxsplit: int = ...) -> List[unicode]: ... - def rstrip(self, chars: unicode = ...) -> unicode: ... - def split(self, sep: Optional[unicode] = ..., maxsplit: int = ...) -> List[unicode]: ... - def splitlines(self, keepends: bool = ...) -> List[unicode]: ... - def startswith(self, prefix: Union[unicode, Tuple[unicode, ...]], start: int = ..., - end: int = ...) -> bool: ... - def strip(self, chars: unicode = ...) -> unicode: ... - def swapcase(self) -> unicode: ... - def title(self) -> unicode: ... - def translate(self, table: Union[Dict[int, Any], unicode]) -> unicode: ... - def upper(self) -> unicode: ... - def zfill(self, width: int) -> unicode: ... - - @overload - def __getitem__(self, i: int) -> unicode: ... - @overload - def __getitem__(self, s: slice) -> unicode: ... - def __getslice__(self, start: int, stop: int) -> unicode: ... - def __add__(self, s: unicode) -> unicode: ... - def __mul__(self, n: int) -> unicode: ... - def __rmul__(self, n: int) -> unicode: ... - def __mod__(self, x: Any) -> unicode: ... - def __eq__(self, x: object) -> bool: ... - def __ne__(self, x: object) -> bool: ... - def __lt__(self, x: unicode) -> bool: ... - def __le__(self, x: unicode) -> bool: ... - def __gt__(self, x: unicode) -> bool: ... - def __ge__(self, x: unicode) -> bool: ... - - def __len__(self) -> int: ... - # The argument type is incompatible with Sequence - def __contains__(self, s: Union[unicode, bytes]) -> bool: ... # type: ignore - def __iter__(self) -> Iterator[unicode]: ... - def __str__(self) -> str: ... - def __repr__(self) -> str: ... - def __int__(self) -> int: ... - def __float__(self) -> float: ... - def __hash__(self) -> int: ... - def __getnewargs__(self) -> Tuple[unicode]: ... - - _str_base = basestring - -class str(Sequence[str], _str_base): - if sys.version_info >= (3,): - @overload - def __init__(self, o: object = ...) -> None: ... - @overload - def __init__(self, o: bytes, encoding: str = ..., errors: str = ...) -> None: ... - else: - def __init__(self, o: object = ...) -> None: ... + def __nonzero__(self) -> bool: ... + +class basestring(metaclass=ABCMeta): ... +class unicode(basestring, Sequence[unicode]): + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, o: object) -> None: ... + @overload + def __init__(self, o: str, encoding: unicode = ..., errors: unicode = ...) -> None: ... + def capitalize(self) -> unicode: ... + def center(self, width: int, fillchar: unicode = ...) -> unicode: ... + def count(self, x: unicode) -> int: ... + def decode(self, encoding: unicode = ..., errors: unicode = ...) -> unicode: ... + def encode(self, encoding: unicode = ..., errors: unicode = ...) -> str: ... + def endswith(self, suffix: Union[unicode, Tuple[unicode, ...]], start: int = ..., end: int = ...) -> bool: ... + def expandtabs(self, tabsize: int = ...) -> unicode: ... + def find(self, sub: unicode, start: int = ..., end: int = ...) -> int: ... + def format(self, *args: object, **kwargs: object) -> unicode: ... + def index(self, sub: unicode, start: int = ..., end: int = ...) -> int: ... + def isalnum(self) -> bool: ... + def isalpha(self) -> bool: ... + def isdecimal(self) -> bool: ... + def isdigit(self) -> bool: ... + def isidentifier(self) -> bool: ... + def islower(self) -> bool: ... + def isnumeric(self) -> bool: ... + def isprintable(self) -> bool: ... + def isspace(self) -> bool: ... + def istitle(self) -> bool: ... + def isupper(self) -> bool: ... + def join(self, iterable: Iterable[unicode]) -> unicode: ... + def ljust(self, width: int, fillchar: unicode = ...) -> unicode: ... + def lower(self) -> unicode: ... + def lstrip(self, chars: unicode = ...) -> unicode: ... + def partition(self, sep: unicode) -> Tuple[unicode, unicode, unicode]: ... + def replace(self, old: unicode, new: unicode, count: int = ...) -> unicode: ... + def rfind(self, sub: unicode, start: int = ..., end: int = ...) -> int: ... + def rindex(self, sub: unicode, start: int = ..., end: int = ...) -> int: ... + def rjust(self, width: int, fillchar: unicode = ...) -> unicode: ... + def rpartition(self, sep: unicode) -> Tuple[unicode, unicode, unicode]: ... + def rsplit(self, sep: Optional[unicode] = ..., maxsplit: int = ...) -> List[unicode]: ... + def rstrip(self, chars: unicode = ...) -> unicode: ... + def split(self, sep: Optional[unicode] = ..., maxsplit: int = ...) -> List[unicode]: ... + def splitlines(self, keepends: bool = ...) -> List[unicode]: ... + def startswith(self, prefix: Union[unicode, Tuple[unicode, ...]], start: int = ..., end: int = ...) -> bool: ... + def strip(self, chars: unicode = ...) -> unicode: ... + def swapcase(self) -> unicode: ... + def title(self) -> unicode: ... + def translate(self, table: Union[Dict[int, Any], unicode]) -> unicode: ... + def upper(self) -> unicode: ... + def zfill(self, width: int) -> unicode: ... + @overload + def __getitem__(self, i: int) -> unicode: ... + @overload + def __getitem__(self, s: slice) -> unicode: ... + def __getslice__(self, start: int, stop: int) -> unicode: ... + def __add__(self, s: unicode) -> unicode: ... + def __mul__(self, n: int) -> unicode: ... + def __rmul__(self, n: int) -> unicode: ... + def __mod__(self, x: Any) -> unicode: ... + def __eq__(self, x: object) -> bool: ... + def __ne__(self, x: object) -> bool: ... + def __lt__(self, x: unicode) -> bool: ... + def __le__(self, x: unicode) -> bool: ... + def __gt__(self, x: unicode) -> bool: ... + def __ge__(self, x: unicode) -> bool: ... + def __len__(self) -> int: ... + # The argument type is incompatible with Sequence + def __contains__(self, s: Union[unicode, bytes]) -> bool: ... # type: ignore + def __iter__(self) -> Iterator[unicode]: ... + def __str__(self) -> str: ... + def __repr__(self) -> str: ... + def __int__(self) -> int: ... + def __float__(self) -> float: ... + def __hash__(self) -> int: ... + def __getnewargs__(self) -> Tuple[unicode]: ... + +class _FormatMapMapping(Protocol): + def __getitem__(self, __key: str) -> Any: ... + +class str(Sequence[str], basestring): + def __init__(self, o: object = ...) -> None: ... def capitalize(self) -> str: ... - if sys.version_info >= (3, 3): - def casefold(self) -> str: ... - def center(self, width: int, fillchar: str = ...) -> str: ... + def center(self, __width: int, __fillchar: str = ...) -> str: ... def count(self, x: Text, __start: Optional[int] = ..., __end: Optional[int] = ...) -> int: ... - if sys.version_info < (3,): - def decode(self, encoding: Text = ..., errors: Text = ...) -> unicode: ... + def decode(self, encoding: Text = ..., errors: Text = ...) -> unicode: ... def encode(self, encoding: Text = ..., errors: Text = ...) -> bytes: ... - if sys.version_info >= (3,): - def endswith(self, suffix: Union[Text, Tuple[Text, ...]], start: Optional[int] = ..., - end: Optional[int] = ...) -> bool: ... - else: - def endswith(self, suffix: Union[Text, Tuple[Text, ...]]) -> bool: ... + def endswith(self, suffix: Union[Text, Tuple[Text, ...]]) -> bool: ... def expandtabs(self, tabsize: int = ...) -> str: ... def find(self, sub: Text, __start: Optional[int] = ..., __end: Optional[int] = ...) -> int: ... def format(self, *args: object, **kwargs: object) -> str: ... - if sys.version_info >= (3,): - def format_map(self, map: Mapping[str, Any]) -> str: ... + def format_map(self, map: _FormatMapMapping) -> str: ... def index(self, sub: Text, __start: Optional[int] = ..., __end: Optional[int] = ...) -> int: ... def isalnum(self) -> bool: ... def isalpha(self) -> bool: ... - if sys.version_info >= (3, 7): - def isascii(self) -> bool: ... - if sys.version_info >= (3,): - def isdecimal(self) -> bool: ... def isdigit(self) -> bool: ... - if sys.version_info >= (3,): - def isidentifier(self) -> bool: ... def islower(self) -> bool: ... - if sys.version_info >= (3,): - def isnumeric(self) -> bool: ... - def isprintable(self) -> bool: ... def isspace(self) -> bool: ... def istitle(self) -> bool: ... def isupper(self) -> bool: ... - if sys.version_info >= (3,): - def join(self, iterable: Iterable[str]) -> str: ... - else: - def join(self, iterable: Iterable[AnyStr]) -> AnyStr: ... - def ljust(self, width: int, fillchar: str = ...) -> str: ... + def join(self, __iterable: Iterable[AnyStr]) -> AnyStr: ... + def ljust(self, __width: int, __fillchar: str = ...) -> str: ... def lower(self) -> str: ... - if sys.version_info >= (3,): - def lstrip(self, chars: Optional[str] = ...) -> str: ... - def partition(self, sep: str) -> Tuple[str, str, str]: ... - def replace(self, old: str, new: str, count: int = ...) -> str: ... - else: - @overload - def lstrip(self, chars: str = ...) -> str: ... - @overload - def lstrip(self, chars: unicode) -> unicode: ... - @overload - def partition(self, sep: bytearray) -> Tuple[str, bytearray, str]: ... - @overload - def partition(self, sep: str) -> Tuple[str, str, str]: ... - @overload - def partition(self, sep: unicode) -> Tuple[unicode, unicode, unicode]: ... - def replace(self, old: AnyStr, new: AnyStr, count: int = ...) -> AnyStr: ... + @overload + def lstrip(self, __chars: str = ...) -> str: ... + @overload + def lstrip(self, __chars: unicode) -> unicode: ... + @overload + def partition(self, __sep: bytearray) -> Tuple[str, bytearray, str]: ... + @overload + def partition(self, __sep: str) -> Tuple[str, str, str]: ... + @overload + def partition(self, __sep: unicode) -> Tuple[unicode, unicode, unicode]: ... + def replace(self, __old: AnyStr, __new: AnyStr, __count: int = ...) -> AnyStr: ... def rfind(self, sub: Text, __start: Optional[int] = ..., __end: Optional[int] = ...) -> int: ... def rindex(self, sub: Text, __start: Optional[int] = ..., __end: Optional[int] = ...) -> int: ... - def rjust(self, width: int, fillchar: str = ...) -> str: ... - if sys.version_info >= (3,): - def rpartition(self, sep: str) -> Tuple[str, str, str]: ... - def rsplit(self, sep: Optional[str] = ..., maxsplit: int = ...) -> List[str]: ... - def rstrip(self, chars: Optional[str] = ...) -> str: ... - def split(self, sep: Optional[str] = ..., maxsplit: int = ...) -> List[str]: ... - else: - @overload - def rpartition(self, sep: bytearray) -> Tuple[str, bytearray, str]: ... - @overload - def rpartition(self, sep: str) -> Tuple[str, str, str]: ... - @overload - def rpartition(self, sep: unicode) -> Tuple[unicode, unicode, unicode]: ... - @overload - def rsplit(self, sep: Optional[str] = ..., maxsplit: int = ...) -> List[str]: ... - @overload - def rsplit(self, sep: unicode, maxsplit: int = ...) -> List[unicode]: ... - @overload - def rstrip(self, chars: str = ...) -> str: ... - @overload - def rstrip(self, chars: unicode) -> unicode: ... - @overload - def split(self, sep: Optional[str] = ..., maxsplit: int = ...) -> List[str]: ... - @overload - def split(self, sep: unicode, maxsplit: int = ...) -> List[unicode]: ... + def rjust(self, __width: int, __fillchar: str = ...) -> str: ... + @overload + def rpartition(self, __sep: bytearray) -> Tuple[str, bytearray, str]: ... + @overload + def rpartition(self, __sep: str) -> Tuple[str, str, str]: ... + @overload + def rpartition(self, __sep: unicode) -> Tuple[unicode, unicode, unicode]: ... + @overload + def rsplit(self, sep: Optional[str] = ..., maxsplit: int = ...) -> List[str]: ... + @overload + def rsplit(self, sep: unicode, maxsplit: int = ...) -> List[unicode]: ... + @overload + def rstrip(self, __chars: str = ...) -> str: ... + @overload + def rstrip(self, __chars: unicode) -> unicode: ... + @overload + def split(self, sep: Optional[str] = ..., maxsplit: int = ...) -> List[str]: ... + @overload + def split(self, sep: unicode, maxsplit: int = ...) -> List[unicode]: ... def splitlines(self, keepends: bool = ...) -> List[str]: ... - if sys.version_info >= (3,): - def startswith(self, prefix: Union[Text, Tuple[Text, ...]], start: Optional[int] = ..., - end: Optional[int] = ...) -> bool: ... - def strip(self, chars: Optional[str] = ...) -> str: ... - else: - def startswith(self, prefix: Union[Text, Tuple[Text, ...]]) -> bool: ... - @overload - def strip(self, chars: str = ...) -> str: ... - @overload - def strip(self, chars: unicode) -> unicode: ... + def startswith(self, prefix: Union[Text, Tuple[Text, ...]]) -> bool: ... + @overload + def strip(self, __chars: str = ...) -> str: ... + @overload + def strip(self, chars: unicode) -> unicode: ... def swapcase(self) -> str: ... def title(self) -> str: ... - if sys.version_info >= (3,): - def translate(self, table: Union[Mapping[int, Union[int, str, None]], Sequence[Union[int, str, None]]]) -> str: ... - else: - def translate(self, table: Optional[AnyStr], deletechars: AnyStr = ...) -> AnyStr: ... + def translate(self, __table: Optional[AnyStr], deletechars: AnyStr = ...) -> AnyStr: ... def upper(self) -> str: ... - def zfill(self, width: int) -> str: ... - if sys.version_info >= (3,): - @staticmethod - @overload - def maketrans(x: Union[Dict[int, _T], Dict[str, _T], Dict[Union[str, int], _T]]) -> Dict[int, _T]: ... - @staticmethod - @overload - def maketrans(x: str, y: str, z: str = ...) -> Dict[int, Union[int, None]]: ... - - if sys.version_info >= (3,): - def __add__(self, s: str) -> str: ... - else: - def __add__(self, s: AnyStr) -> AnyStr: ... + def zfill(self, __width: int) -> str: ... + def __add__(self, s: AnyStr) -> AnyStr: ... # Incompatible with Sequence.__contains__ def __contains__(self, o: Union[str, Text]) -> bool: ... # type: ignore def __eq__(self, x: object) -> bool: ... @@ -549,197 +447,65 @@ class str(Sequence[str], _str_base): def __rmul__(self, n: int) -> str: ... def __str__(self) -> str: ... def __getnewargs__(self) -> Tuple[str]: ... + def __getslice__(self, start: int, stop: int) -> str: ... + def __float__(self) -> float: ... + def __int__(self) -> int: ... - if sys.version_info < (3,): - def __getslice__(self, start: int, stop: int) -> str: ... - def __float__(self) -> float: ... - def __int__(self) -> int: ... - -if sys.version_info >= (3,): - class bytes(ByteString): - @overload - def __init__(self, ints: Iterable[int]) -> None: ... - @overload - def __init__(self, string: str, encoding: str, - errors: str = ...) -> None: ... - @overload - def __init__(self, length: int) -> None: ... - @overload - def __init__(self) -> None: ... - @overload - def __init__(self, o: SupportsBytes) -> None: ... - def capitalize(self) -> bytes: ... - def center(self, width: int, fillchar: bytes = ...) -> bytes: ... - def count(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... - def decode(self, encoding: str = ..., errors: str = ...) -> str: ... - def endswith(self, suffix: Union[bytes, Tuple[bytes, ...]]) -> bool: ... - def expandtabs(self, tabsize: int = ...) -> bytes: ... - def find(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... - if sys.version_info >= (3, 5): - def hex(self) -> str: ... - def index(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... - def isalnum(self) -> bool: ... - def isalpha(self) -> bool: ... - if sys.version_info >= (3, 7): - def isascii(self) -> bool: ... - def isdigit(self) -> bool: ... - def islower(self) -> bool: ... - def isspace(self) -> bool: ... - def istitle(self) -> bool: ... - def isupper(self) -> bool: ... - def join(self, iterable: Iterable[Union[ByteString, memoryview]]) -> bytes: ... - def ljust(self, width: int, fillchar: bytes = ...) -> bytes: ... - def lower(self) -> bytes: ... - def lstrip(self, chars: Optional[bytes] = ...) -> bytes: ... - def partition(self, sep: bytes) -> Tuple[bytes, bytes, bytes]: ... - def replace(self, old: bytes, new: bytes, count: int = ...) -> bytes: ... - def rfind(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... - def rindex(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... - def rjust(self, width: int, fillchar: bytes = ...) -> bytes: ... - def rpartition(self, sep: bytes) -> Tuple[bytes, bytes, bytes]: ... - def rsplit(self, sep: Optional[bytes] = ..., maxsplit: int = ...) -> List[bytes]: ... - def rstrip(self, chars: Optional[bytes] = ...) -> bytes: ... - def split(self, sep: Optional[bytes] = ..., maxsplit: int = ...) -> List[bytes]: ... - def splitlines(self, keepends: bool = ...) -> List[bytes]: ... - def startswith( - self, - prefix: Union[bytes, Tuple[bytes, ...]], - start: Optional[int] = ..., - end: Optional[int] = ..., - ) -> bool: ... - def strip(self, chars: Optional[bytes] = ...) -> bytes: ... - def swapcase(self) -> bytes: ... - def title(self) -> bytes: ... - def translate(self, table: Optional[bytes], delete: bytes = ...) -> bytes: ... - def upper(self) -> bytes: ... - def zfill(self, width: int) -> bytes: ... - @classmethod - def fromhex(cls, s: str) -> bytes: ... - @classmethod - def maketrans(cls, frm: bytes, to: bytes) -> bytes: ... - - def __len__(self) -> int: ... - def __iter__(self) -> Iterator[int]: ... - def __str__(self) -> str: ... - def __repr__(self) -> str: ... - def __int__(self) -> int: ... - def __float__(self) -> float: ... - def __hash__(self) -> int: ... - @overload - def __getitem__(self, i: int) -> int: ... - @overload - def __getitem__(self, s: slice) -> bytes: ... - def __add__(self, s: bytes) -> bytes: ... - def __mul__(self, n: int) -> bytes: ... - def __rmul__(self, n: int) -> bytes: ... - if sys.version_info >= (3, 5): - def __mod__(self, value: Any) -> bytes: ... - # Incompatible with Sequence.__contains__ - def __contains__(self, o: Union[int, bytes]) -> bool: ... # type: ignore - def __eq__(self, x: object) -> bool: ... - def __ne__(self, x: object) -> bool: ... - def __lt__(self, x: bytes) -> bool: ... - def __le__(self, x: bytes) -> bool: ... - def __gt__(self, x: bytes) -> bool: ... - def __ge__(self, x: bytes) -> bool: ... - def __getnewargs__(self) -> Tuple[bytes]: ... -else: - bytes = str +bytes = str class bytearray(MutableSequence[int], ByteString): - if sys.version_info >= (3,): - @overload - def __init__(self) -> None: ... - @overload - def __init__(self, ints: Iterable[int]) -> None: ... - @overload - def __init__(self, string: Text, encoding: Text, errors: Text = ...) -> None: ... - @overload - def __init__(self, length: int) -> None: ... - else: - @overload - def __init__(self) -> None: ... - @overload - def __init__(self, ints: Iterable[int]) -> None: ... - @overload - def __init__(self, string: str) -> None: ... - @overload - def __init__(self, string: Text, encoding: Text, errors: Text = ...) -> None: ... - @overload - def __init__(self, length: int) -> None: ... + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, ints: Iterable[int]) -> None: ... + @overload + def __init__(self, string: str) -> None: ... + @overload + def __init__(self, string: Text, encoding: Text, errors: Text = ...) -> None: ... + @overload + def __init__(self, length: int) -> None: ... def capitalize(self) -> bytearray: ... - def center(self, width: int, fillchar: bytes = ...) -> bytearray: ... - if sys.version_info >= (3,): - def count(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... - def copy(self) -> bytearray: ... - else: - def count(self, x: str) -> int: ... + def center(self, __width: int, __fillchar: bytes = ...) -> bytearray: ... + def count(self, __sub: str) -> int: ... def decode(self, encoding: Text = ..., errors: Text = ...) -> str: ... - def endswith(self, suffix: Union[bytes, Tuple[bytes, ...]]) -> bool: ... + def endswith(self, __suffix: Union[bytes, Tuple[bytes, ...]]) -> bool: ... def expandtabs(self, tabsize: int = ...) -> bytearray: ... - if sys.version_info < (3,): - def extend(self, iterable: Union[str, Iterable[int]]) -> None: ... - if sys.version_info >= (3,): - def find(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... - if sys.version_info >= (3, 5): - def hex(self) -> str: ... - def index(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... - else: - def find(self, sub: str, start: int = ..., end: int = ...) -> int: ... - def index(self, sub: str, start: int = ..., end: int = ...) -> int: ... - def insert(self, index: int, object: int) -> None: ... + def extend(self, iterable: Union[str, Iterable[int]]) -> None: ... + def find(self, __sub: str, __start: int = ..., __end: int = ...) -> int: ... + def index(self, __sub: str, __start: int = ..., __end: int = ...) -> int: ... + def insert(self, __index: int, __item: int) -> None: ... def isalnum(self) -> bool: ... def isalpha(self) -> bool: ... - if sys.version_info >= (3, 7): - def isascii(self) -> bool: ... def isdigit(self) -> bool: ... def islower(self) -> bool: ... def isspace(self) -> bool: ... def istitle(self) -> bool: ... def isupper(self) -> bool: ... - if sys.version_info >= (3,): - def join(self, iterable: Iterable[Union[ByteString, memoryview]]) -> bytearray: ... - def ljust(self, width: int, fillchar: bytes = ...) -> bytearray: ... - else: - def join(self, iterable: Iterable[str]) -> bytearray: ... - def ljust(self, width: int, fillchar: str = ...) -> bytearray: ... + def join(self, __iterable: Iterable[str]) -> bytearray: ... + def ljust(self, __width: int, __fillchar: str = ...) -> bytearray: ... def lower(self) -> bytearray: ... - def lstrip(self, chars: Optional[bytes] = ...) -> bytearray: ... - def partition(self, sep: bytes) -> Tuple[bytearray, bytearray, bytearray]: ... - def replace(self, old: bytes, new: bytes, count: int = ...) -> bytearray: ... - if sys.version_info >= (3,): - def rfind(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... - def rindex(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... - else: - def rfind(self, sub: bytes, start: int = ..., end: int = ...) -> int: ... - def rindex(self, sub: bytes, start: int = ..., end: int = ...) -> int: ... - def rjust(self, width: int, fillchar: bytes = ...) -> bytearray: ... - def rpartition(self, sep: bytes) -> Tuple[bytearray, bytearray, bytearray]: ... + def lstrip(self, __bytes: Optional[bytes] = ...) -> bytearray: ... + def partition(self, __sep: bytes) -> Tuple[bytearray, bytearray, bytearray]: ... + def replace(self, __old: bytes, __new: bytes, __count: int = ...) -> bytearray: ... + def rfind(self, __sub: bytes, __start: int = ..., __end: int = ...) -> int: ... + def rindex(self, __sub: bytes, __start: int = ..., __end: int = ...) -> int: ... + def rjust(self, __width: int, __fillchar: bytes = ...) -> bytearray: ... + def rpartition(self, __sep: bytes) -> Tuple[bytearray, bytearray, bytearray]: ... def rsplit(self, sep: Optional[bytes] = ..., maxsplit: int = ...) -> List[bytearray]: ... - def rstrip(self, chars: Optional[bytes] = ...) -> bytearray: ... + def rstrip(self, __bytes: Optional[bytes] = ...) -> bytearray: ... def split(self, sep: Optional[bytes] = ..., maxsplit: int = ...) -> List[bytearray]: ... def splitlines(self, keepends: bool = ...) -> List[bytearray]: ... def startswith( - self, - prefix: Union[bytes, Tuple[bytes, ...]], - start: Optional[int] = ..., - end: Optional[int] = ..., + self, __prefix: Union[bytes, Tuple[bytes, ...]], __start: Optional[int] = ..., __end: Optional[int] = ... ) -> bool: ... - def strip(self, chars: Optional[bytes] = ...) -> bytearray: ... + def strip(self, __bytes: Optional[bytes] = ...) -> bytearray: ... def swapcase(self) -> bytearray: ... def title(self) -> bytearray: ... - if sys.version_info >= (3,): - def translate(self, table: Optional[bytes], delete: bytes = ...) -> bytearray: ... - else: - def translate(self, table: str) -> bytearray: ... + def translate(self, __table: str) -> bytearray: ... def upper(self) -> bytearray: ... - def zfill(self, width: int) -> bytearray: ... - @staticmethod - def fromhex(s: str) -> bytearray: ... - if sys.version_info >= (3,): - @classmethod - def maketrans(cls, frm: bytes, to: bytes) -> bytes: ... - + def zfill(self, __width: int) -> bytearray: ... + @classmethod + def fromhex(cls, __string: str) -> bytearray: ... def __len__(self) -> int: ... def __iter__(self) -> Iterator[int]: ... def __str__(self) -> str: ... @@ -756,19 +522,11 @@ class bytearray(MutableSequence[int], ByteString): @overload def __setitem__(self, s: slice, x: Union[Iterable[int], bytes]) -> None: ... def __delitem__(self, i: Union[int, slice]) -> None: ... - if sys.version_info < (3,): - def __getslice__(self, start: int, stop: int) -> bytearray: ... - def __setslice__(self, start: int, stop: int, x: Union[Sequence[int], str]) -> None: ... - def __delslice__(self, start: int, stop: int) -> None: ... + def __getslice__(self, start: int, stop: int) -> bytearray: ... + def __setslice__(self, start: int, stop: int, x: Union[Sequence[int], str]) -> None: ... + def __delslice__(self, start: int, stop: int) -> None: ... def __add__(self, s: bytes) -> bytearray: ... - if sys.version_info >= (3,): - def __iadd__(self, s: Iterable[int]) -> bytearray: ... def __mul__(self, n: int) -> bytearray: ... - if sys.version_info >= (3,): - def __rmul__(self, n: int) -> bytearray: ... - def __imul__(self, n: int) -> bytearray: ... - if sys.version_info >= (3, 5): - def __mod__(self, value: Any) -> bytes: ... # Incompatible with Sequence.__contains__ def __contains__(self, o: Union[int, bytes]) -> bool: ... # type: ignore def __eq__(self, x: object) -> bool: ... @@ -778,12 +536,7 @@ class bytearray(MutableSequence[int], ByteString): def __gt__(self, x: bytes) -> bool: ... def __ge__(self, x: bytes) -> bool: ... -if sys.version_info >= (3,): - _mv_container_type = int -else: - _mv_container_type = str - -class memoryview(Sized, Container[_mv_container_type]): +class memoryview(Sized, Container[str]): format: str itemsize: int shape: Optional[Tuple[int, ...]] @@ -791,45 +544,25 @@ class memoryview(Sized, Container[_mv_container_type]): suboffsets: Optional[Tuple[int, ...]] readonly: bool ndim: int - - if sys.version_info >= (3,): - c_contiguous: bool - f_contiguous: bool - contiguous: bool - nbytes: int - def __init__(self, obj: Union[bytes, bytearray, memoryview]) -> None: ... - def __enter__(self) -> memoryview: ... - def __exit__(self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType]) -> None: ... - else: - def __init__(self, obj: Union[bytes, bytearray, buffer, memoryview]) -> None: ... - + def __init__(self, obj: ReadableBuffer) -> None: ... @overload - def __getitem__(self, i: int) -> _mv_container_type: ... + def __getitem__(self, i: int) -> str: ... @overload def __getitem__(self, s: slice) -> memoryview: ... - def __contains__(self, x: object) -> bool: ... - def __iter__(self) -> Iterator[_mv_container_type]: ... + def __iter__(self) -> Iterator[str]: ... def __len__(self) -> int: ... - @overload def __setitem__(self, s: slice, o: memoryview) -> None: ... @overload def __setitem__(self, i: int, o: bytes) -> None: ... @overload def __setitem__(self, s: slice, o: Sequence[bytes]) -> None: ... - def tobytes(self) -> bytes: ... def tolist(self) -> List[int]: ... - if sys.version_info >= (3, 2): - def release(self) -> None: ... - - if sys.version_info >= (3, 5): - def hex(self) -> str: ... - class bool(int): - def __init__(self, o: object = ...) -> None: ... + def __new__(cls: Type[_T], __o: object = ...) -> _T: ... @overload def __and__(self, x: bool) -> bool: ... @overload @@ -869,7 +602,6 @@ class slice(object): class tuple(Sequence[_T_co], Generic[_T_co]): def __new__(cls: Type[_T], iterable: Iterable[_T_co] = ...) -> _T: ... - def __init__(self, iterable: Iterable[_T_co] = ...): ... def __len__(self) -> int: ... def __contains__(self, x: object) -> bool: ... @overload @@ -887,33 +619,29 @@ class tuple(Sequence[_T_co], Generic[_T_co]): def __add__(self, x: Tuple[Any, ...]) -> Tuple[Any, ...]: ... def __mul__(self, n: int) -> Tuple[_T_co, ...]: ... def __rmul__(self, n: int) -> Tuple[_T_co, ...]: ... - def count(self, x: Any) -> int: ... - if sys.version_info >= (3, 5): - def index(self, x: Any, start: int = ..., end: int = ...) -> int: ... - else: - def index(self, x: Any) -> int: ... + def count(self, __value: Any) -> int: ... + def index(self, __value: Any) -> int: ... + +class function: + # TODO not defined in builtins! + __name__: str + __module__: str + __code__: CodeType class list(MutableSequence[_T], Generic[_T]): @overload def __init__(self) -> None: ... @overload def __init__(self, iterable: Iterable[_T]) -> None: ... - if sys.version_info >= (3,): - def clear(self) -> None: ... - def copy(self) -> List[_T]: ... - def append(self, object: _T) -> None: ... - def extend(self, iterable: Iterable[_T]) -> None: ... - def pop(self, index: int = ...) -> _T: ... - def index(self, object: _T, start: int = ..., stop: int = ...) -> int: ... - def count(self, object: _T) -> int: ... - def insert(self, index: int, object: _T) -> None: ... - def remove(self, object: _T) -> None: ... + def append(self, __object: _T) -> None: ... + def extend(self, __iterable: Iterable[_T]) -> None: ... + def pop(self, __index: int = ...) -> _T: ... + def index(self, __value: _T, __start: int = ..., __stop: int = ...) -> int: ... + def count(self, __value: _T) -> int: ... + def insert(self, __index: int, __object: _T) -> None: ... + def remove(self, __value: _T) -> None: ... def reverse(self) -> None: ... - if sys.version_info >= (3,): - def sort(self, *, key: Optional[Callable[[_T], Any]] = ..., reverse: bool = ...) -> None: ... - else: - def sort(self, cmp: Callable[[_T, _T], Any] = ..., key: Callable[[_T], Any] = ..., reverse: bool = ...) -> None: ... - + def sort(self, cmp: Callable[[_T, _T], Any] = ..., key: Callable[[_T], Any] = ..., reverse: bool = ...) -> None: ... def __len__(self) -> int: ... def __iter__(self) -> Iterator[_T]: ... def __str__(self) -> str: ... @@ -927,16 +655,13 @@ class list(MutableSequence[_T], Generic[_T]): @overload def __setitem__(self, s: slice, o: Iterable[_T]) -> None: ... def __delitem__(self, i: Union[int, slice]) -> None: ... - if sys.version_info < (3,): - def __getslice__(self, start: int, stop: int) -> List[_T]: ... - def __setslice__(self, start: int, stop: int, o: Sequence[_T]) -> None: ... - def __delslice__(self, start: int, stop: int) -> None: ... + def __getslice__(self, start: int, stop: int) -> List[_T]: ... + def __setslice__(self, start: int, stop: int, o: Sequence[_T]) -> None: ... + def __delslice__(self, start: int, stop: int) -> None: ... def __add__(self, x: List[_T]) -> List[_T]: ... def __iadd__(self: _S, x: Iterable[_T]) -> _S: ... def __mul__(self, n: int) -> List[_T]: ... def __rmul__(self, n: int) -> List[_T]: ... - if sys.version_info >= (3,): - def __imul__(self: _S, n: int) -> _S: ... def __contains__(self, o: object) -> bool: ... def __reversed__(self) -> Iterator[_T]: ... def __gt__(self, x: List[_T]) -> bool: ... @@ -950,48 +675,38 @@ class dict(MutableMapping[_KT, _VT], Generic[_KT, _VT]): @overload def __init__(self, **kwargs: _VT) -> None: ... @overload - def __init__(self, map: Mapping[_KT, _VT], **kwargs: _VT) -> None: ... + def __init__(self, map: SupportsKeysAndGetItem[_KT, _VT], **kwargs: _VT) -> None: ... @overload def __init__(self, iterable: Iterable[Tuple[_KT, _VT]], **kwargs: _VT) -> None: ... - def __new__(cls: Type[_T1], *args: Any, **kwargs: Any) -> _T1: ... - - if sys.version_info < (3,): - def has_key(self, k: _KT) -> bool: ... + def has_key(self, k: _KT) -> bool: ... def clear(self) -> None: ... def copy(self) -> Dict[_KT, _VT]: ... def popitem(self) -> Tuple[_KT, _VT]: ... - def setdefault(self, k: _KT, default: _VT = ...) -> _VT: ... + def setdefault(self, __key: _KT, __default: _VT = ...) -> _VT: ... @overload def update(self, __m: Mapping[_KT, _VT], **kwargs: _VT) -> None: ... @overload def update(self, __m: Iterable[Tuple[_KT, _VT]], **kwargs: _VT) -> None: ... @overload def update(self, **kwargs: _VT) -> None: ... - if sys.version_info >= (3,): - def keys(self) -> KeysView[_KT]: ... - def values(self) -> ValuesView[_VT]: ... - def items(self) -> ItemsView[_KT, _VT]: ... - else: - def iterkeys(self) -> Iterator[_KT]: ... - def itervalues(self) -> Iterator[_VT]: ... - def iteritems(self) -> Iterator[Tuple[_KT, _VT]]: ... - def viewkeys(self) -> KeysView[_KT]: ... - def viewvalues(self) -> ValuesView[_VT]: ... - def viewitems(self) -> ItemsView[_KT, _VT]: ... - @staticmethod - @overload - def fromkeys(seq: Iterable[_T]) -> Dict[_T, Any]: ... # TODO: Actually a class method (mypy/issues#328) - @staticmethod - @overload - def fromkeys(seq: Iterable[_T], value: _S) -> Dict[_T, _S]: ... + def iterkeys(self) -> Iterator[_KT]: ... + def itervalues(self) -> Iterator[_VT]: ... + def iteritems(self) -> Iterator[Tuple[_KT, _VT]]: ... + def viewkeys(self) -> KeysView[_KT]: ... + def viewvalues(self) -> ValuesView[_VT]: ... + def viewitems(self) -> ItemsView[_KT, _VT]: ... + @classmethod + @overload + def fromkeys(cls, __iterable: Iterable[_T]) -> Dict[_T, Any]: ... + @classmethod + @overload + def fromkeys(cls, __iterable: Iterable[_T], __value: _S) -> Dict[_T, _S]: ... def __len__(self) -> int: ... def __getitem__(self, k: _KT) -> _VT: ... def __setitem__(self, k: _KT, v: _VT) -> None: ... def __delitem__(self, v: _KT) -> None: ... def __iter__(self) -> Iterator[_KT]: ... - if sys.version_info >= (3, 8): - def __reversed__(self) -> Iterator[_KT]: ... def __str__(self) -> str: ... __hash__: None # type: ignore @@ -1022,8 +737,14 @@ class set(MutableSet[_T], Generic[_T]): def __iand__(self, s: AbstractSet[object]) -> Set[_T]: ... def __or__(self, s: AbstractSet[_S]) -> Set[Union[_T, _S]]: ... def __ior__(self, s: AbstractSet[_S]) -> Set[Union[_T, _S]]: ... - def __sub__(self, s: AbstractSet[object]) -> Set[_T]: ... - def __isub__(self, s: AbstractSet[object]) -> Set[_T]: ... + @overload + def __sub__(self: Set[str], s: AbstractSet[Optional[Text]]) -> Set[_T]: ... + @overload + def __sub__(self, s: AbstractSet[Optional[_T]]) -> Set[_T]: ... + @overload # type: ignore + def __isub__(self: Set[str], s: AbstractSet[Optional[Text]]) -> Set[_T]: ... + @overload + def __isub__(self, s: AbstractSet[Optional[_T]]) -> Set[_T]: ... def __xor__(self, s: AbstractSet[_S]) -> Set[Union[_T, _S]]: ... def __ixor__(self, s: AbstractSet[_S]) -> Set[Union[_T, _S]]: ... def __le__(self, s: AbstractSet[object]) -> bool: ... @@ -1032,24 +753,24 @@ class set(MutableSet[_T], Generic[_T]): def __gt__(self, s: AbstractSet[object]) -> bool: ... __hash__: None # type: ignore -class frozenset(AbstractSet[_T], Generic[_T]): - def __init__(self, iterable: Iterable[_T] = ...) -> None: ... - def copy(self) -> FrozenSet[_T]: ... - def difference(self, *s: Iterable[object]) -> FrozenSet[_T]: ... - def intersection(self, *s: Iterable[object]) -> FrozenSet[_T]: ... - def isdisjoint(self, s: Iterable[_T]) -> bool: ... +class frozenset(AbstractSet[_T_co], Generic[_T_co]): + def __init__(self, iterable: Iterable[_T_co] = ...) -> None: ... + def copy(self) -> FrozenSet[_T_co]: ... + def difference(self, *s: Iterable[object]) -> FrozenSet[_T_co]: ... + def intersection(self, *s: Iterable[object]) -> FrozenSet[_T_co]: ... + def isdisjoint(self, s: Iterable[_T_co]) -> bool: ... def issubset(self, s: Iterable[object]) -> bool: ... def issuperset(self, s: Iterable[object]) -> bool: ... - def symmetric_difference(self, s: Iterable[_T]) -> FrozenSet[_T]: ... - def union(self, *s: Iterable[_T]) -> FrozenSet[_T]: ... + def symmetric_difference(self, s: Iterable[_T_co]) -> FrozenSet[_T_co]: ... + def union(self, *s: Iterable[_T_co]) -> FrozenSet[_T_co]: ... def __len__(self) -> int: ... def __contains__(self, o: object) -> bool: ... - def __iter__(self) -> Iterator[_T]: ... + def __iter__(self) -> Iterator[_T_co]: ... def __str__(self) -> str: ... - def __and__(self, s: AbstractSet[_T]) -> FrozenSet[_T]: ... - def __or__(self, s: AbstractSet[_S]) -> FrozenSet[Union[_T, _S]]: ... - def __sub__(self, s: AbstractSet[_T]) -> FrozenSet[_T]: ... - def __xor__(self, s: AbstractSet[_S]) -> FrozenSet[Union[_T, _S]]: ... + def __and__(self, s: AbstractSet[_T_co]) -> FrozenSet[_T_co]: ... + def __or__(self, s: AbstractSet[_S]) -> FrozenSet[Union[_T_co, _S]]: ... + def __sub__(self, s: AbstractSet[_T_co]) -> FrozenSet[_T_co]: ... + def __xor__(self, s: AbstractSet[_S]) -> FrozenSet[Union[_T_co, _S]]: ... def __le__(self, s: AbstractSet[object]) -> bool: ... def __lt__(self, s: AbstractSet[object]) -> bool: ... def __ge__(self, s: AbstractSet[object]) -> bool: ... @@ -1058,47 +779,26 @@ class frozenset(AbstractSet[_T], Generic[_T]): class enumerate(Iterator[Tuple[int, _T]], Generic[_T]): def __init__(self, iterable: Iterable[_T], start: int = ...) -> None: ... def __iter__(self) -> Iterator[Tuple[int, _T]]: ... - if sys.version_info >= (3,): - def __next__(self) -> Tuple[int, _T]: ... - else: - def next(self) -> Tuple[int, _T]: ... - -if sys.version_info >= (3,): - class range(Sequence[int]): - start: int - stop: int - step: int - @overload - def __init__(self, stop: int) -> None: ... - @overload - def __init__(self, start: int, stop: int, step: int = ...) -> None: ... - def count(self, value: int) -> int: ... - def index(self, value: int, start: int = ..., stop: Optional[int] = ...) -> int: ... - def __len__(self) -> int: ... - def __contains__(self, o: object) -> bool: ... - def __iter__(self) -> Iterator[int]: ... - @overload - def __getitem__(self, i: int) -> int: ... - @overload - def __getitem__(self, s: slice) -> range: ... - def __repr__(self) -> str: ... - def __reversed__(self) -> Iterator[int]: ... -else: - class xrange(Sized, Iterable[int], Reversible[int]): - @overload - def __init__(self, stop: int) -> None: ... - @overload - def __init__(self, start: int, stop: int, step: int = ...) -> None: ... - def __len__(self) -> int: ... - def __iter__(self) -> Iterator[int]: ... - def __getitem__(self, i: int) -> int: ... - def __reversed__(self) -> Iterator[int]: ... + def next(self) -> Tuple[int, _T]: ... + +class xrange(Sized, Iterable[int], Reversible[int]): + @overload + def __init__(self, stop: int) -> None: ... + @overload + def __init__(self, start: int, stop: int, step: int = ...) -> None: ... + def __len__(self) -> int: ... + def __iter__(self) -> Iterator[int]: ... + def __getitem__(self, i: int) -> int: ... + def __reversed__(self) -> Iterator[int]: ... class property(object): - def __init__(self, fget: Optional[Callable[[Any], Any]] = ..., - fset: Optional[Callable[[Any, Any], None]] = ..., - fdel: Optional[Callable[[Any], None]] = ..., - doc: Optional[str] = ...) -> None: ... + def __init__( + self, + fget: Optional[Callable[[Any], Any]] = ..., + fset: Optional[Callable[[Any, Any], None]] = ..., + fdel: Optional[Callable[[Any], None]] = ..., + doc: Optional[str] = ..., + ) -> None: ... def getter(self, fget: Callable[[Any], Any]) -> property: ... def setter(self, fset: Callable[[Any, Any], None]) -> property: ... def deleter(self, fdel: Callable[[Any], None]) -> property: ... @@ -1109,504 +809,351 @@ class property(object): def fset(self, value: Any) -> None: ... def fdel(self) -> None: ... -if sys.version_info < (3,): - long = int +long = int -NotImplemented: Any +class _NotImplementedType(Any): # type: ignore + # A little weird, but typing the __call__ as NotImplemented makes the error message + # for NotImplemented() much better + __call__: NotImplemented # type: ignore -def abs(__n: SupportsAbs[_T]) -> _T: ... -def all(__i: Iterable[object]) -> bool: ... -def any(__i: Iterable[object]) -> bool: ... -if sys.version_info < (3,): - def apply(__func: Callable[..., _T], __args: Optional[Sequence[Any]] = ..., __kwds: Optional[Mapping[str, Any]] = ...) -> _T: ... -if sys.version_info >= (3,): - def ascii(__o: object) -> str: ... +NotImplemented: _NotImplementedType +def abs(__x: SupportsAbs[_T]) -> _T: ... +def all(__iterable: Iterable[object]) -> bool: ... +def any(__iterable: Iterable[object]) -> bool: ... +def apply(__func: Callable[..., _T], __args: Optional[Sequence[Any]] = ..., __kwds: Optional[Mapping[str, Any]] = ...) -> _T: ... def bin(__number: Union[int, _SupportsIndex]) -> str: ... +def callable(__obj: object) -> bool: ... +def chr(__i: int) -> str: ... +def cmp(__x: Any, __y: Any) -> int: ... + +_N1 = TypeVar("_N1", bool, int, float, complex) + +def coerce(__x: _N1, __y: _N1) -> Tuple[_N1, _N1]: ... -if sys.version_info >= (3, 7): - def breakpoint(*args: Any, **kws: Any) -> None: ... -def callable(__o: object) -> bool: ... -def chr(__code: int) -> str: ... -if sys.version_info < (3,): - def cmp(__x: Any, __y: Any) -> int: ... - _N1 = TypeVar('_N1', bool, int, float, complex) - def coerce(__x: _N1, __y: _N1) -> Tuple[_N1, _N1]: ... -if sys.version_info >= (3, 6): - # This class is to be exported as PathLike from os, - # but we define it here as _PathLike to avoid import cycle issues. - # See https://github.com/python/typeshed/pull/991#issuecomment-288160993 - class _PathLike(Generic[AnyStr]): - def __fspath__(self) -> AnyStr: ... - def compile(source: Union[str, bytes, mod, AST], filename: Union[str, bytes, _PathLike[Any]], mode: str, flags: int = ..., dont_inherit: int = ..., optimize: int = ...) -> Any: ... -elif sys.version_info >= (3,): - def compile(source: Union[str, bytes, mod, AST], filename: Union[str, bytes], mode: str, flags: int = ..., dont_inherit: int = ..., optimize: int = ...) -> Any: ... -else: - def compile(source: Union[Text, mod], filename: Text, mode: Text, flags: int = ..., dont_inherit: int = ...) -> Any: ... -if sys.version_info >= (3,): - def copyright() -> None: ... - def credits() -> None: ... -def delattr(__o: Any, __name: Text) -> None: ... +# This class is to be exported as PathLike from os, +# but we define it here as _PathLike to avoid import cycle issues. +# See https://github.com/python/typeshed/pull/991#issuecomment-288160993 +_AnyStr_co = TypeVar("_AnyStr_co", str, bytes, covariant=True) +@runtime_checkable +class _PathLike(Protocol[_AnyStr_co]): + def __fspath__(self) -> _AnyStr_co: ... + +def compile(source: Union[Text, mod], filename: Text, mode: Text, flags: int = ..., dont_inherit: int = ...) -> Any: ... +def delattr(__obj: Any, __name: Text) -> None: ... def dir(__o: object = ...) -> List[str]: ... -_N2 = TypeVar('_N2', int, float) -def divmod(__a: _N2, __b: _N2) -> Tuple[_N2, _N2]: ... -def eval(__source: Union[Text, bytes, CodeType], __globals: Optional[Dict[str, Any]] = ..., __locals: Optional[Mapping[str, Any]] = ...) -> Any: ... -if sys.version_info >= (3,): - def exec(__object: Union[str, bytes, CodeType], __globals: Optional[Dict[str, Any]] = ..., __locals: Optional[Mapping[str, Any]] = ...) -> Any: ... -else: - def execfile(__filename: str, __globals: Optional[Dict[str, Any]] = ..., __locals: Optional[Dict[str, Any]] = ...) -> None: ... + +_N2 = TypeVar("_N2", int, float) + +def divmod(__x: _N2, __y: _N2) -> Tuple[_N2, _N2]: ... +def eval( + __source: Union[Text, bytes, CodeType], __globals: Optional[Dict[str, Any]] = ..., __locals: Optional[Mapping[str, Any]] = ... +) -> Any: ... +def execfile(__filename: str, __globals: Optional[Dict[str, Any]] = ..., __locals: Optional[Dict[str, Any]] = ...) -> None: ... def exit(code: object = ...) -> NoReturn: ... -if sys.version_info >= (3,): - @overload - def filter(__function: None, __iterable: Iterable[Optional[_T]]) -> Iterator[_T]: ... - @overload - def filter(__function: Callable[[_T], Any], __iterable: Iterable[_T]) -> Iterator[_T]: ... -else: - @overload - def filter(__function: Callable[[AnyStr], Any], __iterable: AnyStr) -> AnyStr: ... # type: ignore - @overload - def filter(__function: None, __iterable: Tuple[Optional[_T], ...]) -> Tuple[_T, ...]: ... # type: ignore - @overload - def filter(__function: Callable[[_T], Any], __iterable: Tuple[_T, ...]) -> Tuple[_T, ...]: ... # type: ignore - @overload - def filter(__function: None, __iterable: Iterable[Optional[_T]]) -> List[_T]: ... - @overload - def filter(__function: Callable[[_T], Any], __iterable: Iterable[_T]) -> List[_T]: ... -def format(__o: object, __format_spec: str = ...) -> str: ... # TODO unicode +@overload +def filter(__function: Callable[[AnyStr], Any], __iterable: AnyStr) -> AnyStr: ... # type: ignore +@overload +def filter(__function: None, __iterable: Tuple[Optional[_T], ...]) -> Tuple[_T, ...]: ... # type: ignore +@overload +def filter(__function: Callable[[_T], Any], __iterable: Tuple[_T, ...]) -> Tuple[_T, ...]: ... # type: ignore +@overload +def filter(__function: None, __iterable: Iterable[Optional[_T]]) -> List[_T]: ... +@overload +def filter(__function: Callable[[_T], Any], __iterable: Iterable[_T]) -> List[_T]: ... +def format(__value: object, __format_spec: str = ...) -> str: ... # TODO unicode def getattr(__o: Any, name: Text, __default: Any = ...) -> Any: ... def globals() -> Dict[str, Any]: ... -def hasattr(__o: Any, __name: Text) -> bool: ... -def hash(__o: object) -> int: ... -if sys.version_info >= (3,): - def help(*args: Any, **kwds: Any) -> None: ... -def hex(__i: Union[int, _SupportsIndex]) -> str: ... -def id(__o: object) -> int: ... -if sys.version_info >= (3,): - def input(__prompt: Any = ...) -> str: ... -else: - def input(__prompt: Any = ...) -> Any: ... - def intern(__string: str) -> str: ... +def hasattr(__obj: Any, __name: Text) -> bool: ... +def hash(__obj: object) -> int: ... +def hex(__number: Union[int, _SupportsIndex]) -> str: ... +def id(__obj: object) -> int: ... +def input(__prompt: Any = ...) -> Any: ... +def intern(__string: str) -> str: ... @overload def iter(__iterable: Iterable[_T]) -> Iterator[_T]: ... @overload def iter(__function: Callable[[], Optional[_T]], __sentinel: None) -> Iterator[_T]: ... @overload def iter(__function: Callable[[], _T], __sentinel: Any) -> Iterator[_T]: ... -def isinstance(__o: object, __t: Union[type, Tuple[Union[type, Tuple[Any, ...]], ...]]) -> bool: ... -def issubclass(__cls: type, __classinfo: Union[type, Tuple[Union[type, Tuple[Any, ...]], ...]]) -> bool: ... -def len(__o: Sized) -> int: ... -if sys.version_info >= (3,): - def license() -> None: ... +def isinstance(__obj: object, __class_or_tuple: Union[type, Tuple[Union[type, Tuple[Any, ...]], ...]]) -> bool: ... +def issubclass(__cls: type, __class_or_tuple: Union[type, Tuple[Union[type, Tuple[Any, ...]], ...]]) -> bool: ... +def len(__obj: Sized) -> int: ... def locals() -> Dict[str, Any]: ... -if sys.version_info >= (3,): - @overload - def map(__func: Callable[[_T1], _S], __iter1: Iterable[_T1]) -> Iterator[_S]: ... - @overload - def map(__func: Callable[[_T1, _T2], _S], __iter1: Iterable[_T1], - __iter2: Iterable[_T2]) -> Iterator[_S]: ... - @overload - def map(__func: Callable[[_T1, _T2, _T3], _S], - __iter1: Iterable[_T1], - __iter2: Iterable[_T2], - __iter3: Iterable[_T3]) -> Iterator[_S]: ... - @overload - def map(__func: Callable[[_T1, _T2, _T3, _T4], _S], - __iter1: Iterable[_T1], - __iter2: Iterable[_T2], - __iter3: Iterable[_T3], - __iter4: Iterable[_T4]) -> Iterator[_S]: ... - @overload - def map(__func: Callable[[_T1, _T2, _T3, _T4, _T5], _S], - __iter1: Iterable[_T1], - __iter2: Iterable[_T2], - __iter3: Iterable[_T3], - __iter4: Iterable[_T4], - __iter5: Iterable[_T5]) -> Iterator[_S]: ... - @overload - def map(__func: Callable[..., _S], - __iter1: Iterable[Any], - __iter2: Iterable[Any], - __iter3: Iterable[Any], - __iter4: Iterable[Any], - __iter5: Iterable[Any], - __iter6: Iterable[Any], - *iterables: Iterable[Any]) -> Iterator[_S]: ... -else: - @overload - def map(__func: None, __iter1: Iterable[_T1]) -> List[_T1]: ... - @overload - def map(__func: None, - __iter1: Iterable[_T1], - __iter2: Iterable[_T2]) -> List[Tuple[_T1, _T2]]: ... - @overload - def map(__func: None, - __iter1: Iterable[_T1], - __iter2: Iterable[_T2], - __iter3: Iterable[_T3]) -> List[Tuple[_T1, _T2, _T3]]: ... - @overload - def map(__func: None, - __iter1: Iterable[_T1], - __iter2: Iterable[_T2], - __iter3: Iterable[_T3], - __iter4: Iterable[_T4]) -> List[Tuple[_T1, _T2, _T3, _T4]]: ... - @overload - def map(__func: None, - __iter1: Iterable[_T1], - __iter2: Iterable[_T2], - __iter3: Iterable[_T3], - __iter4: Iterable[_T4], - __iter5: Iterable[_T5]) -> List[Tuple[_T1, _T2, _T3, _T4, _T5]]: ... - @overload - def map(__func: None, - __iter1: Iterable[Any], - __iter2: Iterable[Any], - __iter3: Iterable[Any], - __iter4: Iterable[Any], - __iter5: Iterable[Any], - __iter6: Iterable[Any], - *iterables: Iterable[Any]) -> List[Tuple[Any, ...]]: ... - @overload - def map(__func: Callable[[_T1], _S], __iter1: Iterable[_T1]) -> List[_S]: ... - @overload - def map(__func: Callable[[_T1, _T2], _S], - __iter1: Iterable[_T1], - __iter2: Iterable[_T2]) -> List[_S]: ... - @overload - def map(__func: Callable[[_T1, _T2, _T3], _S], - __iter1: Iterable[_T1], - __iter2: Iterable[_T2], - __iter3: Iterable[_T3]) -> List[_S]: ... - @overload - def map(__func: Callable[[_T1, _T2, _T3, _T4], _S], - __iter1: Iterable[_T1], - __iter2: Iterable[_T2], - __iter3: Iterable[_T3], - __iter4: Iterable[_T4]) -> List[_S]: ... - @overload - def map(__func: Callable[[_T1, _T2, _T3, _T4, _T5], _S], - __iter1: Iterable[_T1], - __iter2: Iterable[_T2], - __iter3: Iterable[_T3], - __iter4: Iterable[_T4], - __iter5: Iterable[_T5]) -> List[_S]: ... - @overload - def map(__func: Callable[..., _S], - __iter1: Iterable[Any], - __iter2: Iterable[Any], - __iter3: Iterable[Any], - __iter4: Iterable[Any], - __iter5: Iterable[Any], - __iter6: Iterable[Any], - *iterables: Iterable[Any]) -> List[_S]: ... -if sys.version_info >= (3,): - @overload - def max(__arg1: _T, __arg2: _T, *_args: _T, key: Callable[[_T], Any] = ...) -> _T: ... - @overload - def max(__iterable: Iterable[_T], *, key: Callable[[_T], Any] = ...) -> _T: ... - @overload - def max(__iterable: Iterable[_T], *, key: Callable[[_T], Any] = ..., default: _VT) -> Union[_T, _VT]: ... -else: - @overload - def max(__arg1: _T, __arg2: _T, *_args: _T, key: Callable[[_T], Any] = ...) -> _T: ... - @overload - def max(__iterable: Iterable[_T], *, key: Callable[[_T], Any] = ...) -> _T: ... -if sys.version_info >= (3,): - @overload - def min(__arg1: _T, __arg2: _T, *_args: _T, key: Callable[[_T], Any] = ...) -> _T: ... - @overload - def min(__iterable: Iterable[_T], *, key: Callable[[_T], Any] = ...) -> _T: ... - @overload - def min(__iterable: Iterable[_T], *, key: Callable[[_T], Any] = ..., default: _VT) -> Union[_T, _VT]: ... -else: - @overload - def min(__arg1: _T, __arg2: _T, *_args: _T, key: Callable[[_T], Any] = ...) -> _T: ... - @overload - def min(__iterable: Iterable[_T], *, key: Callable[[_T], Any] = ...) -> _T: ... +@overload +def map(__func: None, __iter1: Iterable[_T1]) -> List[_T1]: ... +@overload +def map(__func: None, __iter1: Iterable[_T1], __iter2: Iterable[_T2]) -> List[Tuple[_T1, _T2]]: ... +@overload +def map(__func: None, __iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3]) -> List[Tuple[_T1, _T2, _T3]]: ... +@overload +def map( + __func: None, __iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3], __iter4: Iterable[_T4] +) -> List[Tuple[_T1, _T2, _T3, _T4]]: ... +@overload +def map( + __func: None, + __iter1: Iterable[_T1], + __iter2: Iterable[_T2], + __iter3: Iterable[_T3], + __iter4: Iterable[_T4], + __iter5: Iterable[_T5], +) -> List[Tuple[_T1, _T2, _T3, _T4, _T5]]: ... +@overload +def map( + __func: None, + __iter1: Iterable[Any], + __iter2: Iterable[Any], + __iter3: Iterable[Any], + __iter4: Iterable[Any], + __iter5: Iterable[Any], + __iter6: Iterable[Any], + *iterables: Iterable[Any], +) -> List[Tuple[Any, ...]]: ... +@overload +def map(__func: Callable[[_T1], _S], __iter1: Iterable[_T1]) -> List[_S]: ... +@overload +def map(__func: Callable[[_T1, _T2], _S], __iter1: Iterable[_T1], __iter2: Iterable[_T2]) -> List[_S]: ... +@overload +def map( + __func: Callable[[_T1, _T2, _T3], _S], __iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3] +) -> List[_S]: ... +@overload +def map( + __func: Callable[[_T1, _T2, _T3, _T4], _S], + __iter1: Iterable[_T1], + __iter2: Iterable[_T2], + __iter3: Iterable[_T3], + __iter4: Iterable[_T4], +) -> List[_S]: ... +@overload +def map( + __func: Callable[[_T1, _T2, _T3, _T4, _T5], _S], + __iter1: Iterable[_T1], + __iter2: Iterable[_T2], + __iter3: Iterable[_T3], + __iter4: Iterable[_T4], + __iter5: Iterable[_T5], +) -> List[_S]: ... +@overload +def map( + __func: Callable[..., _S], + __iter1: Iterable[Any], + __iter2: Iterable[Any], + __iter3: Iterable[Any], + __iter4: Iterable[Any], + __iter5: Iterable[Any], + __iter6: Iterable[Any], + *iterables: Iterable[Any], +) -> List[_S]: ... +@overload +def max(__arg1: _T, __arg2: _T, *_args: _T, key: Callable[[_T], Any] = ...) -> _T: ... +@overload +def max(__iterable: Iterable[_T], *, key: Callable[[_T], Any] = ...) -> _T: ... +@overload +def min(__arg1: _T, __arg2: _T, *_args: _T, key: Callable[[_T], Any] = ...) -> _T: ... +@overload +def min(__iterable: Iterable[_T], *, key: Callable[[_T], Any] = ...) -> _T: ... @overload def next(__i: Iterator[_T]) -> _T: ... @overload def next(__i: Iterator[_T], default: _VT) -> Union[_T, _VT]: ... -def oct(__i: Union[int, _SupportsIndex]) -> str: ... - -if sys.version_info >= (3, 6): - def open(file: Union[str, bytes, int, _PathLike[Any]], mode: str = ..., buffering: int = ..., encoding: Optional[str] = ..., - errors: Optional[str] = ..., newline: Optional[str] = ..., closefd: bool = ..., - opener: Optional[Callable[[str, int], int]] = ...) -> IO[Any]: ... -elif sys.version_info >= (3,): - def open(file: Union[str, bytes, int], mode: str = ..., buffering: int = ..., encoding: Optional[str] = ..., - errors: Optional[str] = ..., newline: Optional[str] = ..., closefd: bool = ..., - opener: Optional[Callable[[str, int], int]] = ...) -> IO[Any]: ... -else: - def open(name: Union[unicode, int], mode: unicode = ..., buffering: int = ...) -> BinaryIO: ... - +def oct(__number: Union[int, _SupportsIndex]) -> str: ... +def open(name: Union[unicode, int], mode: unicode = ..., buffering: int = ...) -> BinaryIO: ... def ord(__c: Union[Text, bytes]) -> int: ... -if sys.version_info >= (3,): - class _Writer(Protocol): - def write(self, __s: str) -> Any: ... - def print( - *values: object, sep: Optional[Text] = ..., end: Optional[Text] = ..., file: Optional[_Writer] = ..., flush: bool = ... - ) -> None: ... -else: - class _Writer(Protocol): - def write(self, __s: Any) -> Any: ... - # This is only available after from __future__ import print_function. - def print(*values: object, sep: Optional[Text] = ..., end: Optional[Text] = ..., file: Optional[_Writer] = ...) -> None: ... +# This is only available after from __future__ import print_function. +def print( + *values: object, sep: Optional[Text] = ..., end: Optional[Text] = ..., file: Optional[SupportsWrite[Any]] = ... +) -> None: ... +_E = TypeVar("_E", contravariant=True) +_M = TypeVar("_M", contravariant=True) + +class _SupportsPow2(Protocol[_E, _T_co]): + def __pow__(self, __other: _E) -> _T_co: ... + +class _SupportsPow3(Protocol[_E, _M, _T_co]): + def __pow__(self, __other: _E, __modulo: _M) -> _T_co: ... + +@overload +def pow(__base: int, __exp: int, __mod: None = ...) -> Any: ... # returns int or float depending on whether exp is non-negative @overload -def pow(__x: int, __y: int) -> Any: ... # The return type can be int or float, depending on y +def pow(__base: int, __exp: int, __mod: int) -> int: ... @overload -def pow(__x: int, __y: int, __z: int) -> Any: ... +def pow(__base: float, __exp: float, __mod: None = ...) -> float: ... @overload -def pow(__x: float, __y: float) -> float: ... +def pow(__base: _SupportsPow2[_E, _T_co], __exp: _E) -> _T_co: ... @overload -def pow(__x: float, __y: float, __z: float) -> float: ... +def pow(__base: _SupportsPow3[_E, _M, _T_co], __exp: _E, __mod: _M) -> _T_co: ... def quit(code: object = ...) -> NoReturn: ... -if sys.version_info < (3,): - def range(__x: int, __y: int = ..., __step: int = ...) -> List[int]: ... - def raw_input(__prompt: Any = ...) -> str: ... - @overload - def reduce(__function: Callable[[_T, _S], _T], __iterable: Iterable[_S], __initializer: _T) -> _T: ... - @overload - def reduce(__function: Callable[[_T, _T], _T], __iterable: Iterable[_T]) -> _T: ... - def reload(__module: Any) -> Any: ... +def range(__x: int, __y: int = ..., __step: int = ...) -> List[int]: ... # noqa: F811 +def raw_input(__prompt: Any = ...) -> str: ... @overload -def reversed(__object: Sequence[_T]) -> Iterator[_T]: ... +def reduce(__function: Callable[[_T, _S], _T], __iterable: Iterable[_S], __initializer: _T) -> _T: ... @overload -def reversed(__object: Reversible[_T]) -> Iterator[_T]: ... -def repr(__o: object) -> str: ... -if sys.version_info >= (3,): - @overload - def round(number: float) -> int: ... - @overload - def round(number: float, ndigits: None) -> int: ... - @overload - def round(number: float, ndigits: int) -> float: ... - @overload - def round(number: SupportsRound[_T]) -> int: ... - @overload - def round(number: SupportsRound[_T], ndigits: None) -> int: ... - @overload - def round(number: SupportsRound[_T], ndigits: int) -> _T: ... -else: - @overload - def round(number: float) -> float: ... - @overload - def round(number: float, ndigits: int) -> float: ... - @overload - def round(number: SupportsFloat) -> float: ... - @overload - def round(number: SupportsFloat, ndigits: int) -> float: ... -def setattr(__object: Any, __name: Text, __value: Any) -> None: ... -if sys.version_info >= (3,): - def sorted(__iterable: Iterable[_T], *, - key: Optional[Callable[[_T], Any]] = ..., - reverse: bool = ...) -> List[_T]: ... -else: - def sorted(__iterable: Iterable[_T], *, - cmp: Callable[[_T, _T], int] = ..., - key: Optional[Callable[[_T], Any]] = ..., - reverse: bool = ...) -> List[_T]: ... +def reduce(__function: Callable[[_T, _T], _T], __iterable: Iterable[_T]) -> _T: ... +def reload(__module: Any) -> Any: ... +@overload +def reversed(__sequence: Sequence[_T]) -> Iterator[_T]: ... +@overload +def reversed(__sequence: Reversible[_T]) -> Iterator[_T]: ... +def repr(__obj: object) -> str: ... +@overload +def round(number: float) -> float: ... +@overload +def round(number: float, ndigits: int) -> float: ... +@overload +def round(number: SupportsFloat) -> float: ... +@overload +def round(number: SupportsFloat, ndigits: int) -> float: ... +def setattr(__obj: Any, __name: Text, __value: Any) -> None: ... +def sorted( + __iterable: Iterable[_T], + *, + cmp: Callable[[_T, _T], int] = ..., + key: Optional[Callable[[_T], Any]] = ..., + reverse: bool = ..., +) -> List[_T]: ... @overload def sum(__iterable: Iterable[_T]) -> Union[_T, int]: ... @overload def sum(__iterable: Iterable[_T], __start: _S) -> Union[_T, _S]: ... -if sys.version_info < (3,): - def unichr(__i: int) -> unicode: ... +def unichr(__i: int) -> unicode: ... def vars(__object: Any = ...) -> Dict[str, Any]: ... -if sys.version_info >= (3,): - @overload - def zip(__iter1: Iterable[_T1]) -> Iterator[Tuple[_T1]]: ... - @overload - def zip(__iter1: Iterable[_T1], __iter2: Iterable[_T2]) -> Iterator[Tuple[_T1, _T2]]: ... - @overload - def zip(__iter1: Iterable[_T1], __iter2: Iterable[_T2], - __iter3: Iterable[_T3]) -> Iterator[Tuple[_T1, _T2, _T3]]: ... - @overload - def zip(__iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3], - __iter4: Iterable[_T4]) -> Iterator[Tuple[_T1, _T2, _T3, _T4]]: ... - @overload - def zip(__iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3], - __iter4: Iterable[_T4], __iter5: Iterable[_T5]) -> Iterator[Tuple[_T1, _T2, _T3, _T4, _T5]]: ... - @overload - def zip(__iter1: Iterable[Any], __iter2: Iterable[Any], __iter3: Iterable[Any], - __iter4: Iterable[Any], __iter5: Iterable[Any], __iter6: Iterable[Any], - *iterables: Iterable[Any]) -> Iterator[Tuple[Any, ...]]: ... -else: - @overload - def zip(__iter1: Iterable[_T1]) -> List[Tuple[_T1]]: ... - @overload - def zip(__iter1: Iterable[_T1], - __iter2: Iterable[_T2]) -> List[Tuple[_T1, _T2]]: ... - @overload - def zip(__iter1: Iterable[_T1], __iter2: Iterable[_T2], - __iter3: Iterable[_T3]) -> List[Tuple[_T1, _T2, _T3]]: ... - @overload - def zip(__iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3], - __iter4: Iterable[_T4]) -> List[Tuple[_T1, _T2, _T3, _T4]]: ... - @overload - def zip(__iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3], - __iter4: Iterable[_T4], __iter5: Iterable[_T5]) -> List[Tuple[_T1, _T2, _T3, _T4, _T5]]: ... - @overload - def zip(__iter1: Iterable[Any], __iter2: Iterable[Any], __iter3: Iterable[Any], - __iter4: Iterable[Any], __iter5: Iterable[Any], __iter6: Iterable[Any], - *iterables: Iterable[Any]) -> List[Tuple[Any, ...]]: ... -def __import__(name: Text, globals: Optional[Mapping[str, Any]] = ..., - locals: Optional[Mapping[str, Any]] = ..., - fromlist: Sequence[str] = ..., - level: int = ...) -> Any: ... +@overload +def zip(__iter1: Iterable[_T1]) -> List[Tuple[_T1]]: ... +@overload +def zip(__iter1: Iterable[_T1], __iter2: Iterable[_T2]) -> List[Tuple[_T1, _T2]]: ... +@overload +def zip(__iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3]) -> List[Tuple[_T1, _T2, _T3]]: ... +@overload +def zip( + __iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3], __iter4: Iterable[_T4] +) -> List[Tuple[_T1, _T2, _T3, _T4]]: ... +@overload +def zip( + __iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3], __iter4: Iterable[_T4], __iter5: Iterable[_T5] +) -> List[Tuple[_T1, _T2, _T3, _T4, _T5]]: ... +@overload +def zip( + __iter1: Iterable[Any], + __iter2: Iterable[Any], + __iter3: Iterable[Any], + __iter4: Iterable[Any], + __iter5: Iterable[Any], + __iter6: Iterable[Any], + *iterables: Iterable[Any], +) -> List[Tuple[Any, ...]]: ... +def __import__( + name: Text, + globals: Optional[Mapping[str, Any]] = ..., + locals: Optional[Mapping[str, Any]] = ..., + fromlist: Sequence[str] = ..., + level: int = ..., +) -> Any: ... # Actually the type of Ellipsis is , but since it's # not exposed anywhere under that name, we make it private here. class ellipsis: ... + Ellipsis: ellipsis -if sys.version_info < (3,): - # TODO: buffer support is incomplete; e.g. some_string.startswith(some_buffer) doesn't type check. - _AnyBuffer = TypeVar('_AnyBuffer', str, unicode, bytearray, buffer) +# TODO: buffer support is incomplete; e.g. some_string.startswith(some_buffer) doesn't type check. +_AnyBuffer = TypeVar("_AnyBuffer", str, unicode, bytearray, buffer) - class buffer(Sized): - def __init__(self, object: _AnyBuffer, offset: int = ..., size: int = ...) -> None: ... - def __add__(self, other: _AnyBuffer) -> str: ... - def __cmp__(self, other: _AnyBuffer) -> bool: ... - def __getitem__(self, key: Union[int, slice]) -> str: ... - def __getslice__(self, i: int, j: int) -> str: ... - def __len__(self) -> int: ... - def __mul__(self, x: int) -> str: ... +class buffer(Sized): + def __init__(self, object: _AnyBuffer, offset: int = ..., size: int = ...) -> None: ... + def __add__(self, other: _AnyBuffer) -> str: ... + def __cmp__(self, other: _AnyBuffer) -> bool: ... + def __getitem__(self, key: Union[int, slice]) -> str: ... + def __getslice__(self, i: int, j: int) -> str: ... + def __len__(self) -> int: ... + def __mul__(self, x: int) -> str: ... class BaseException(object): args: Tuple[Any, ...] - if sys.version_info < (3,): - message: Any - if sys.version_info >= (3,): - __cause__: Optional[BaseException] - __context__: Optional[BaseException] - __suppress_context__: bool - __traceback__: Optional[TracebackType] + message: Any def __init__(self, *args: object) -> None: ... def __str__(self) -> str: ... def __repr__(self) -> str: ... - if sys.version_info < (3,): - def __getitem__(self, i: int) -> Any: ... - def __getslice__(self, start: int, stop: int) -> Tuple[Any, ...]: ... - if sys.version_info >= (3,): - def with_traceback(self, tb: Optional[TracebackType]) -> BaseException: ... + def __getitem__(self, i: int) -> Any: ... + def __getslice__(self, start: int, stop: int) -> Tuple[Any, ...]: ... class GeneratorExit(BaseException): ... class KeyboardInterrupt(BaseException): ... + class SystemExit(BaseException): code: int + class Exception(BaseException): ... -class StopIteration(Exception): - if sys.version_info >= (3,): - value: Any -if sys.version_info >= (3,): - _StandardError = Exception - class OSError(Exception): - errno: int - strerror: str - # filename, filename2 are actually Union[str, bytes, None] - filename: Any - filename2: Any - EnvironmentError = OSError - IOError = OSError -else: - class StandardError(Exception): ... - _StandardError = StandardError - class EnvironmentError(StandardError): - errno: int - strerror: str - # TODO can this be unicode? - filename: str - class OSError(EnvironmentError): ... - class IOError(EnvironmentError): ... +class StopIteration(Exception): ... +class StandardError(Exception): ... + +_StandardError = StandardError +class EnvironmentError(StandardError): + errno: int + strerror: str + # TODO can this be unicode? + filename: str + +class OSError(EnvironmentError): ... +class IOError(EnvironmentError): ... class ArithmeticError(_StandardError): ... class AssertionError(_StandardError): ... class AttributeError(_StandardError): ... class BufferError(_StandardError): ... class EOFError(_StandardError): ... -class ImportError(_StandardError): - if sys.version_info >= (3, 3): - def __init__(self, *args, name: Optional[str] = ..., path: Optional[str] = ...) -> None: ... - name: Optional[str] - path: Optional[str] +class ImportError(_StandardError): ... class LookupError(_StandardError): ... class MemoryError(_StandardError): ... class NameError(_StandardError): ... class ReferenceError(_StandardError): ... class RuntimeError(_StandardError): ... -if sys.version_info >= (3, 5): - class StopAsyncIteration(Exception): - value: Any + class SyntaxError(_StandardError): msg: str - lineno: int + lineno: Optional[int] offset: Optional[int] text: Optional[str] - filename: str + filename: Optional[str] + class SystemError(_StandardError): ... class TypeError(_StandardError): ... class ValueError(_StandardError): ... - class FloatingPointError(ArithmeticError): ... class OverflowError(ArithmeticError): ... class ZeroDivisionError(ArithmeticError): ... - -if sys.version_info >= (3, 6): - class ModuleNotFoundError(ImportError): ... - class IndexError(LookupError): ... class KeyError(LookupError): ... - class UnboundLocalError(NameError): ... class WindowsError(OSError): winerror: int -if sys.version_info >= (3,): - class BlockingIOError(OSError): - characters_written: int - class ChildProcessError(OSError): ... - class ConnectionError(OSError): ... - class BrokenPipeError(ConnectionError): ... - class ConnectionAbortedError(ConnectionError): ... - class ConnectionRefusedError(ConnectionError): ... - class ConnectionResetError(ConnectionError): ... - class FileExistsError(OSError): ... - class FileNotFoundError(OSError): ... - class InterruptedError(OSError): ... - class IsADirectoryError(OSError): ... - class NotADirectoryError(OSError): ... - class PermissionError(OSError): ... - class ProcessLookupError(OSError): ... - class TimeoutError(OSError): ... class NotImplementedError(RuntimeError): ... -if sys.version_info >= (3, 5): - class RecursionError(RuntimeError): ... - class IndentationError(SyntaxError): ... class TabError(IndentationError): ... - class UnicodeError(ValueError): ... + class UnicodeDecodeError(UnicodeError): encoding: str object: bytes start: int end: int reason: str - def __init__(self, __encoding: str, __object: bytes, __start: int, __end: int, - __reason: str) -> None: ... + def __init__(self, __encoding: str, __object: bytes, __start: int, __end: int, __reason: str) -> None: ... + class UnicodeEncodeError(UnicodeError): encoding: str object: Text start: int end: int reason: str - def __init__(self, __encoding: str, __object: Text, __start: int, __end: int, - __reason: str) -> None: ... -class UnicodeTranslateError(UnicodeError): ... + def __init__(self, __encoding: str, __object: Text, __start: int, __end: int, __reason: str) -> None: ... +class UnicodeTranslateError(UnicodeError): ... class Warning(Exception): ... class UserWarning(Warning): ... class DeprecationWarning(Warning): ... @@ -1617,34 +1164,32 @@ class PendingDeprecationWarning(Warning): ... class ImportWarning(Warning): ... class UnicodeWarning(Warning): ... class BytesWarning(Warning): ... -if sys.version_info >= (3, 2): - class ResourceWarning(Warning): ... - -if sys.version_info < (3,): - class file(BinaryIO): - @overload - def __init__(self, file: str, mode: str = ..., buffering: int = ...) -> None: ... - @overload - def __init__(self, file: unicode, mode: str = ..., buffering: int = ...) -> None: ... - @overload - def __init__(self, file: int, mode: str = ..., buffering: int = ...) -> None: ... - def __iter__(self) -> Iterator[str]: ... - def next(self) -> str: ... - def read(self, n: int = ...) -> str: ... - def __enter__(self) -> BinaryIO: ... - def __exit__(self, t: Optional[type] = ..., exc: Optional[BaseException] = ..., tb: Optional[Any] = ...) -> Optional[bool]: ... - def flush(self) -> None: ... - def fileno(self) -> int: ... - def isatty(self) -> bool: ... - def close(self) -> None: ... - - def readable(self) -> bool: ... - def writable(self) -> bool: ... - def seekable(self) -> bool: ... - def seek(self, offset: int, whence: int = ...) -> int: ... - def tell(self) -> int: ... - def readline(self, limit: int = ...) -> str: ... - def readlines(self, hint: int = ...) -> List[str]: ... - def write(self, data: str) -> int: ... - def writelines(self, data: Iterable[str]) -> None: ... - def truncate(self, pos: Optional[int] = ...) -> int: ... + +class file(BinaryIO): + @overload + def __init__(self, file: str, mode: str = ..., buffering: int = ...) -> None: ... + @overload + def __init__(self, file: unicode, mode: str = ..., buffering: int = ...) -> None: ... + @overload + def __init__(self, file: int, mode: str = ..., buffering: int = ...) -> None: ... + def __iter__(self) -> Iterator[str]: ... + def next(self) -> str: ... + def read(self, n: int = ...) -> str: ... + def __enter__(self) -> BinaryIO: ... + def __exit__( + self, t: Optional[type] = ..., exc: Optional[BaseException] = ..., tb: Optional[Any] = ... + ) -> Optional[bool]: ... + def flush(self) -> None: ... + def fileno(self) -> int: ... + def isatty(self) -> bool: ... + def close(self) -> None: ... + def readable(self) -> bool: ... + def writable(self) -> bool: ... + def seekable(self) -> bool: ... + def seek(self, offset: int, whence: int = ...) -> int: ... + def tell(self) -> int: ... + def readline(self, limit: int = ...) -> str: ... + def readlines(self, hint: int = ...) -> List[str]: ... + def write(self, data: str) -> int: ... + def writelines(self, data: Iterable[str]) -> None: ... + def truncate(self, pos: Optional[int] = ...) -> int: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/_ast.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/_ast.pyi old mode 100755 new mode 100644 index c461bb41..4ca7def6 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/_ast.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/_ast.pyi @@ -10,8 +10,7 @@ class AST: _fields: typing.Tuple[str, ...] def __init__(self, *args, **kwargs) -> None: ... -class mod(AST): - ... +class mod(AST): ... class Module(mod): body: typing.List[stmt] @@ -25,7 +24,6 @@ class Expression(mod): class Suite(mod): body: typing.List[stmt] - class stmt(AST): lineno: int col_offset: int @@ -123,10 +121,7 @@ class Expr(stmt): class Pass(stmt): ... class Break(stmt): ... class Continue(stmt): ... - - -class slice(AST): - ... +class slice(AST): ... _slice = slice # this lets us type the variable named 'slice' below @@ -143,7 +138,6 @@ class Index(slice): class Ellipsis(slice): ... - class expr(AST): lineno: int col_offset: int @@ -240,27 +234,17 @@ class Tuple(expr): elts: typing.List[expr] ctx: expr_context - -class expr_context(AST): - ... - +class expr_context(AST): ... class AugLoad(expr_context): ... class AugStore(expr_context): ... class Del(expr_context): ... class Load(expr_context): ... class Param(expr_context): ... class Store(expr_context): ... - - -class boolop(AST): - ... - +class boolop(AST): ... class And(boolop): ... class Or(boolop): ... - -class operator(AST): - ... - +class operator(AST): ... class Add(operator): ... class BitAnd(operator): ... class BitOr(operator): ... @@ -273,18 +257,12 @@ class Mult(operator): ... class Pow(operator): ... class RShift(operator): ... class Sub(operator): ... - -class unaryop(AST): - ... - +class unaryop(AST): ... class Invert(unaryop): ... class Not(unaryop): ... class UAdd(unaryop): ... class USub(unaryop): ... - -class cmpop(AST): - ... - +class cmpop(AST): ... class Eq(cmpop): ... class Gt(cmpop): ... class GtE(cmpop): ... @@ -296,16 +274,12 @@ class LtE(cmpop): ... class NotEq(cmpop): ... class NotIn(cmpop): ... - class comprehension(AST): target: expr iter: expr ifs: typing.List[expr] - -class excepthandler(AST): - ... - +class excepthandler(AST): ... class ExceptHandler(excepthandler): type: Optional[expr] @@ -314,7 +288,6 @@ class ExceptHandler(excepthandler): lineno: int col_offset: int - class arguments(AST): args: typing.List[expr] vararg: Optional[_identifier] diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/_collections.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/_collections.pyi old mode 100755 new mode 100644 index bee5d67b..f97b6d5d --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/_collections.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/_collections.pyi @@ -1,11 +1,9 @@ -"""Stub file for the '_collections' module.""" - -from typing import Any, Callable, Dict, Generic, Iterator, TypeVar, Optional, Union +from typing import Any, Callable, Dict, Generic, Iterator, Optional, TypeVar, Union _K = TypeVar("_K") _V = TypeVar("_V") -_T = TypeVar('_T') -_T2 = TypeVar('_T2') +_T = TypeVar("_T") +_T2 = TypeVar("_T2") class defaultdict(Dict[_K, _V]): default_factory: None diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/_functools.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/_functools.pyi old mode 100755 new mode 100644 index 876974e4..6143f2a0 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/_functools.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/_functools.pyi @@ -1,16 +1,11 @@ -"""Stub file for the '_functools' module.""" - -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Tuple, overload +from typing import Any, Callable, Dict, Iterable, Optional, Tuple, TypeVar, overload _T = TypeVar("_T") _S = TypeVar("_S") - @overload -def reduce(function: Callable[[_T, _T], _T], - sequence: Iterable[_T]) -> _T: ... +def reduce(function: Callable[[_T, _T], _T], sequence: Iterable[_T]) -> _T: ... @overload -def reduce(function: Callable[[_T, _S], _T], - sequence: Iterable[_S], initial: _T) -> _T: ... +def reduce(function: Callable[[_T, _S], _T], sequence: Iterable[_S], initial: _T) -> _T: ... class partial(object): func: Callable[..., Any] diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/_hotshot.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/_hotshot.pyi old mode 100755 new mode 100644 index a4404b0c..46c365f4 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/_hotshot.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/_hotshot.pyi @@ -1,9 +1,4 @@ -"""Stub file for the '_hotshot' module.""" -# This is an autogenerated file. It serves as a starting point -# for a more precise manual annotation of this module. -# Feel free to edit the source below, but remove this header when you do. - -from typing import Any, List, Tuple, Dict, Generic +from typing import Any, Dict, Generic, List, Tuple def coverage(a: str) -> Any: ... def logreader(a: str) -> LogReaderType: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/_io.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/_io.pyi old mode 100755 new mode 100644 index e8e448f2..b88f3de0 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/_io.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/_io.pyi @@ -1,6 +1,6 @@ -from typing import Any, AnyStr, BinaryIO, IO, Text, TextIO, Iterable, Iterator, List, Optional, Type, Tuple, TypeVar, Union from mmap import mmap from types import TracebackType +from typing import IO, Any, AnyStr, BinaryIO, Iterable, Iterator, List, Optional, Text, TextIO, Tuple, Type, TypeVar, Union _bytearray_like = Union[bytearray, mmap] @@ -32,7 +32,9 @@ class _IOBase(BinaryIO): def truncate(self, size: Optional[int] = ...) -> int: ... def writable(self) -> bool: ... def __enter__(self: _T) -> _T: ... - def __exit__(self, t: Optional[Type[BaseException]], value: Optional[BaseException], traceback: Optional[Any]) -> Optional[bool]: ... + def __exit__( + self, t: Optional[Type[BaseException]], value: Optional[BaseException], traceback: Optional[Any] + ) -> Optional[bool]: ... def __iter__(self: _T) -> _T: ... # The parameter type of writelines[s]() is determined by that of write(): def writelines(self, lines: Iterable[bytes]) -> None: ... @@ -53,8 +55,7 @@ class _BufferedIOBase(_IOBase): def detach(self) -> _IOBase: ... class BufferedRWPair(_BufferedIOBase): - def __init__(self, reader: _RawIOBase, writer: _RawIOBase, - buffer_size: int = ..., max_buffer_size: int = ...) -> None: ... + def __init__(self, reader: _RawIOBase, writer: _RawIOBase, buffer_size: int = ..., max_buffer_size: int = ...) -> None: ... def peek(self, n: int = ...) -> bytes: ... def __enter__(self) -> BufferedRWPair: ... @@ -62,9 +63,7 @@ class BufferedRandom(_BufferedIOBase): mode: str name: str raw: _IOBase - def __init__(self, raw: _IOBase, - buffer_size: int = ..., - max_buffer_size: int = ...) -> None: ... + def __init__(self, raw: _IOBase, buffer_size: int = ..., max_buffer_size: int = ...) -> None: ... def peek(self, n: int = ...) -> bytes: ... class BufferedReader(_BufferedIOBase): @@ -78,9 +77,7 @@ class BufferedWriter(_BufferedIOBase): name: str raw: _IOBase mode: str - def __init__(self, raw: _IOBase, - buffer_size: int = ..., - max_buffer_size: int = ...) -> None: ... + def __init__(self, raw: _IOBase, buffer_size: int = ..., max_buffer_size: int = ...) -> None: ... class BytesIO(_BufferedIOBase): def __init__(self, initial_bytes: bytes = ...) -> None: ... @@ -115,7 +112,6 @@ class IncrementalNewlineDecoder(object): def setstate(self, state: Tuple[Any, int]) -> None: ... def reset(self) -> None: ... - # Note: In the actual _io.py, _TextIOBase inherits from _IOBase. class _TextIOBase(TextIO): errors: Optional[str] @@ -146,14 +142,14 @@ class _TextIOBase(TextIO): def write(self, pbuf: unicode) -> int: ... def writelines(self, lines: Iterable[unicode]) -> None: ... def __enter__(self: _T) -> _T: ... - def __exit__(self, t: Optional[Type[BaseException]], value: Optional[BaseException], traceback: Optional[Any]) -> Optional[bool]: ... + def __exit__( + self, t: Optional[Type[BaseException]], value: Optional[BaseException], traceback: Optional[Any] + ) -> Optional[bool]: ... def __iter__(self: _T) -> _T: ... class StringIO(_TextIOBase): line_buffering: bool - def __init__(self, - initial_value: Optional[unicode] = ..., - newline: Optional[unicode] = ...) -> None: ... + def __init__(self, initial_value: Optional[unicode] = ..., newline: Optional[unicode] = ...) -> None: ... def __setstate__(self, state: Tuple[Any, ...]) -> None: ... def __getstate__(self) -> Tuple[Any, ...]: ... # StringIO does not contain a "name" field. This workaround is necessary @@ -177,10 +173,12 @@ class TextIOWrapper(_TextIOBase): write_through: bool = ..., ) -> None: ... -def open(file: Union[str, unicode, int], - mode: Text = ..., - buffering: int = ..., - encoding: Optional[Text] = ..., - errors: Optional[Text] = ..., - newline: Optional[Text] = ..., - closefd: bool = ...) -> IO[Any]: ... +def open( + file: Union[str, unicode, int], + mode: Text = ..., + buffering: int = ..., + encoding: Optional[Text] = ..., + errors: Optional[Text] = ..., + newline: Optional[Text] = ..., + closefd: bool = ..., +) -> IO[Any]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/_json.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/_json.pyi old mode 100755 new mode 100644 index f8bd265a..1c8e0409 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/_json.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/_json.pyi @@ -1,4 +1,4 @@ -from typing import Any, List, Tuple, Dict, Generic, Tuple +from typing import Any, Dict, Generic, List, Tuple def encode_basestring_ascii(*args, **kwargs) -> str: ... def scanstring(a, b, *args, **kwargs) -> Tuple[Any, ...]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/_md5.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/_md5.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/_sha.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/_sha.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/_sha256.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/_sha256.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/_sha512.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/_sha512.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/_socket.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/_socket.pyi old mode 100755 new mode 100644 index f6a058ac..61c0def5 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/_socket.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/_socket.pyi @@ -1,4 +1,4 @@ -from typing import Tuple, Union, IO, Any, Optional, overload +from typing import IO, Any, Optional, Tuple, Union, overload AF_APPLETALK: int AF_ASH: int @@ -251,7 +251,6 @@ class SocketType(object): type: int proto: int timeout: float - def __init__(self, family: int = ..., type: int = ..., proto: int = ...) -> None: ... def accept(self) -> Tuple[SocketType, Tuple[Any, ...]]: ... def bind(self, address: Tuple[Any, ...]) -> None: ... @@ -269,8 +268,7 @@ class SocketType(object): def recv(self, buffersize: int, flags: int = ...) -> str: ... def recv_into(self, buffer: bytearray, nbytes: int = ..., flags: int = ...) -> int: ... def recvfrom(self, buffersize: int, flags: int = ...) -> Tuple[Any, ...]: ... - def recvfrom_into(self, buffer: bytearray, nbytes: int = ..., - flags: int = ...) -> int: ... + def recvfrom_into(self, buffer: bytearray, nbytes: int = ..., flags: int = ...) -> int: ... def send(self, data: str, flags: int = ...) -> int: ... def sendall(self, data: str, flags: int = ...) -> None: ... @overload diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/_sre.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/_sre.pyi old mode 100755 new mode 100644 index 93300f0f..263f1da0 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/_sre.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/_sre.pyi @@ -1,6 +1,4 @@ -"""Stub file for the '_sre' module.""" - -from typing import Any, Union, Iterable, Optional, Mapping, Sequence, Dict, List, Tuple, overload +from typing import Any, Dict, Iterable, List, Mapping, Optional, Sequence, Tuple, Union, overload CODESIZE: int MAGIC: int @@ -49,7 +47,5 @@ def compile( groupindex: Mapping[str, int] = ..., indexgroup: Sequence[int] = ..., ) -> SRE_Pattern: ... - def getcodesize() -> int: ... - def getlower(a: int, b: int) -> int: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/_struct.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/_struct.pyi old mode 100755 new mode 100644 index 49f44f2c..316307ea --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/_struct.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/_struct.pyi @@ -1,5 +1,3 @@ -"""Stub file for the '_struct' module.""" - from typing import Any, AnyStr, Tuple class error(Exception): ... @@ -7,7 +5,6 @@ class error(Exception): ... class Struct(object): size: int format: str - def __init__(self, fmt: str) -> None: ... def pack_into(self, buffer: bytearray, offset: int, obj: Any) -> None: ... def pack(self, *args) -> str: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/_symtable.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/_symtable.pyi old mode 100755 new mode 100644 index fbf54244..5b237044 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/_symtable.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/_symtable.pyi @@ -1,4 +1,4 @@ -from typing import List, Dict +from typing import Dict, List CELL: int DEF_BOUND: int @@ -22,8 +22,7 @@ TYPE_FUNCTION: int TYPE_MODULE: int USE: int -class _symtable_entry(object): - ... +class _symtable_entry(object): ... class symtable(object): children: List[_symtable_entry] @@ -35,5 +34,4 @@ class symtable(object): symbols: Dict[str, int] type: int varnames: List[str] - def __init__(self, src: str, filename: str, startstr: str) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/_threading_local.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/_threading_local.pyi old mode 100755 new mode 100644 index 1a7e03de..481d3045 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/_threading_local.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/_threading_local.pyi @@ -1,4 +1,3 @@ -# Source: https://hg.python.org/cpython/file/2.7/Lib/_threading_local.py from typing import Any class _localbase(object): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/_winreg.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/_winreg.pyi new file mode 100644 index 00000000..f12186cb --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/_winreg.pyi @@ -0,0 +1,97 @@ +import sys +from types import TracebackType +from typing import Any, Optional, Tuple, Type, Union + +_KeyType = Union[HKEYType, int] + +def CloseKey(__hkey: _KeyType) -> None: ... +def ConnectRegistry(__computer_name: Optional[str], __key: _KeyType) -> HKEYType: ... +def CreateKey(__key: _KeyType, __sub_key: Optional[str]) -> HKEYType: ... +def CreateKeyEx(key: _KeyType, sub_key: Optional[str], reserved: int = ..., access: int = ...) -> HKEYType: ... +def DeleteKey(__key: _KeyType, __sub_key: str) -> None: ... +def DeleteKeyEx(key: _KeyType, sub_key: str, access: int = ..., reserved: int = ...) -> None: ... +def DeleteValue(__key: _KeyType, __value: str) -> None: ... +def EnumKey(__key: _KeyType, __index: int) -> str: ... +def EnumValue(__key: _KeyType, __index: int) -> Tuple[str, Any, int]: ... +def ExpandEnvironmentStrings(__str: str) -> str: ... +def FlushKey(__key: _KeyType) -> None: ... +def LoadKey(__key: _KeyType, __sub_key: str, __file_name: str) -> None: ... +def OpenKey(key: _KeyType, sub_key: str, reserved: int = ..., access: int = ...) -> HKEYType: ... +def OpenKeyEx(key: _KeyType, sub_key: str, reserved: int = ..., access: int = ...) -> HKEYType: ... +def QueryInfoKey(__key: _KeyType) -> Tuple[int, int, int]: ... +def QueryValue(__key: _KeyType, __sub_key: Optional[str]) -> str: ... +def QueryValueEx(__key: _KeyType, __name: str) -> Tuple[Any, int]: ... +def SaveKey(__key: _KeyType, __file_name: str) -> None: ... +def SetValue(__key: _KeyType, __sub_key: str, __type: int, __value: str) -> None: ... +def SetValueEx( + __key: _KeyType, __value_name: Optional[str], __reserved: Any, __type: int, __value: Union[str, int] +) -> None: ... # reserved is ignored +def DisableReflectionKey(__key: _KeyType) -> None: ... +def EnableReflectionKey(__key: _KeyType) -> None: ... +def QueryReflectionKey(__key: _KeyType) -> bool: ... + +HKEY_CLASSES_ROOT: int +HKEY_CURRENT_USER: int +HKEY_LOCAL_MACHINE: int +HKEY_USERS: int +HKEY_PERFORMANCE_DATA: int +HKEY_CURRENT_CONFIG: int +HKEY_DYN_DATA: int + +KEY_ALL_ACCESS: int +KEY_WRITE: int +KEY_READ: int +KEY_EXECUTE: int +KEY_QUERY_VALUE: int +KEY_SET_VALUE: int +KEY_CREATE_SUB_KEY: int +KEY_ENUMERATE_SUB_KEYS: int +KEY_NOTIFY: int +KEY_CREATE_LINK: int + +KEY_WOW64_64KEY: int +KEY_WOW64_32KEY: int + +REG_BINARY: int +REG_DWORD: int +REG_DWORD_LITTLE_ENDIAN: int +REG_DWORD_BIG_ENDIAN: int +REG_EXPAND_SZ: int +REG_LINK: int +REG_MULTI_SZ: int +REG_NONE: int +REG_RESOURCE_LIST: int +REG_FULL_RESOURCE_DESCRIPTOR: int +REG_RESOURCE_REQUIREMENTS_LIST: int +REG_SZ: int + +REG_CREATED_NEW_KEY: int # undocumented +REG_LEGAL_CHANGE_FILTER: int # undocumented +REG_LEGAL_OPTION: int # undocumented +REG_NOTIFY_CHANGE_ATTRIBUTES: int # undocumented +REG_NOTIFY_CHANGE_LAST_SET: int # undocumented +REG_NOTIFY_CHANGE_NAME: int # undocumented +REG_NOTIFY_CHANGE_SECURITY: int # undocumented +REG_NO_LAZY_FLUSH: int # undocumented +REG_OPENED_EXISTING_KEY: int # undocumented +REG_OPTION_BACKUP_RESTORE: int # undocumented +REG_OPTION_CREATE_LINK: int # undocumented +REG_OPTION_NON_VOLATILE: int # undocumented +REG_OPTION_OPEN_LINK: int # undocumented +REG_OPTION_RESERVED: int # undocumented +REG_OPTION_VOLATILE: int # undocumented +REG_REFRESH_HIVE: int # undocumented +REG_WHOLE_HIVE_VOLATILE: int # undocumented + +error = OSError + +# Though this class has a __name__ of PyHKEY, it's exposed as HKEYType for some reason +class HKEYType: + def __bool__(self) -> bool: ... + def __int__(self) -> int: ... + def __enter__(self) -> HKEYType: ... + def __exit__( + self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType] + ) -> Optional[bool]: ... + def Close(self) -> None: ... + def Detach(self) -> int: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/abc.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/abc.pyi old mode 100755 new mode 100644 index 64fbb50b..0bf046a4 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/abc.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/abc.pyi @@ -1,7 +1,7 @@ -from typing import Any, Callable, Dict, Set, Tuple, Type, TypeVar import _weakrefset +from typing import Any, Callable, Dict, Set, Tuple, Type, TypeVar -_FuncT = TypeVar('_FuncT', bound=Callable[..., Any]) +_FuncT = TypeVar("_FuncT", bound=Callable[..., Any]) # NOTE: mypy has special processing for ABCMeta and abstractmethod. diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/ast.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/ast.pyi old mode 100755 new mode 100644 index c5ffd655..a8432dd8 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/ast.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/ast.pyi @@ -20,7 +20,7 @@ def iter_fields(node: AST) -> Iterator[_typing.Tuple[str, Any]]: ... def literal_eval(node_or_string: Union[str, unicode, AST]) -> Any: ... def walk(node: AST) -> Iterator[AST]: ... -class NodeVisitor(): +class NodeVisitor: def visit(self, node: AST) -> Any: ... def generic_visit(self, node: AST) -> Any: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/atexit.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/atexit.pyi old mode 100755 new mode 100644 index 13d2602b..2336bf91 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/atexit.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/atexit.pyi @@ -1,5 +1,5 @@ -from typing import TypeVar, Any +from typing import Any, TypeVar -_FT = TypeVar('_FT') +_FT = TypeVar("_FT") def register(func: _FT, *args: Any, **kargs: Any) -> _FT: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/builtins.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/builtins.pyi new file mode 100644 index 00000000..efe3b12c --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/builtins.pyi @@ -0,0 +1,1195 @@ +# True and False are deliberately omitted because they are keywords in +# Python 3, and stub files conform to Python 3 syntax. + +from _typeshed import ReadableBuffer, SupportsKeysAndGetItem, SupportsWrite +from abc import ABCMeta +from ast import mod +from types import CodeType +from typing import ( + AbstractSet, + Any, + AnyStr, + BinaryIO, + ByteString, + Callable, + Container, + Dict, + FrozenSet, + Generic, + ItemsView, + Iterable, + Iterator, + KeysView, + List, + Mapping, + MutableMapping, + MutableSequence, + MutableSet, + NoReturn, + Optional, + Protocol, + Reversible, + Sequence, + Set, + Sized, + SupportsAbs, + SupportsComplex, + SupportsFloat, + SupportsInt, + Text, + Tuple, + Type, + TypeVar, + Union, + ValuesView, + overload, + runtime_checkable, +) +from typing_extensions import Literal + +class _SupportsIndex(Protocol): + def __index__(self) -> int: ... + +class _SupportsTrunc(Protocol): + def __trunc__(self) -> int: ... + +_T = TypeVar("_T") +_T_co = TypeVar("_T_co", covariant=True) +_KT = TypeVar("_KT") +_VT = TypeVar("_VT") +_S = TypeVar("_S") +_T1 = TypeVar("_T1") +_T2 = TypeVar("_T2") +_T3 = TypeVar("_T3") +_T4 = TypeVar("_T4") +_T5 = TypeVar("_T5") +_TT = TypeVar("_TT", bound="type") +_TBE = TypeVar("_TBE", bound="BaseException") + +class object: + __doc__: Optional[str] + __dict__: Dict[str, Any] + __slots__: Union[Text, Iterable[Text]] + __module__: str + @property + def __class__(self: _T) -> Type[_T]: ... + @__class__.setter + def __class__(self, __type: Type[object]) -> None: ... # noqa: F811 + def __init__(self) -> None: ... + def __new__(cls) -> Any: ... + def __setattr__(self, name: str, value: Any) -> None: ... + def __eq__(self, o: object) -> bool: ... + def __ne__(self, o: object) -> bool: ... + def __str__(self) -> str: ... + def __repr__(self) -> str: ... + def __hash__(self) -> int: ... + def __format__(self, format_spec: str) -> str: ... + def __getattribute__(self, name: str) -> Any: ... + def __delattr__(self, name: str) -> None: ... + def __sizeof__(self) -> int: ... + def __reduce__(self) -> Union[str, Tuple[Any, ...]]: ... + def __reduce_ex__(self, protocol: int) -> Union[str, Tuple[Any, ...]]: ... + +class staticmethod(object): # Special, only valid as a decorator. + __func__: Callable[..., Any] + def __init__(self, f: Callable[..., Any]) -> None: ... + def __new__(cls: Type[_T], *args: Any, **kwargs: Any) -> _T: ... + def __get__(self, obj: _T, type: Optional[Type[_T]] = ...) -> Callable[..., Any]: ... + +class classmethod(object): # Special, only valid as a decorator. + __func__: Callable[..., Any] + def __init__(self, f: Callable[..., Any]) -> None: ... + def __new__(cls: Type[_T], *args: Any, **kwargs: Any) -> _T: ... + def __get__(self, obj: _T, type: Optional[Type[_T]] = ...) -> Callable[..., Any]: ... + +class type(object): + __base__: type + __bases__: Tuple[type, ...] + __basicsize__: int + __dict__: Dict[str, Any] + __dictoffset__: int + __flags__: int + __itemsize__: int + __module__: str + __mro__: Tuple[type, ...] + __name__: str + __weakrefoffset__: int + @overload + def __init__(self, o: object) -> None: ... + @overload + def __init__(self, name: str, bases: Tuple[type, ...], dict: Dict[str, Any]) -> None: ... + @overload + def __new__(cls, o: object) -> type: ... + @overload + def __new__(cls, name: str, bases: Tuple[type, ...], namespace: Dict[str, Any]) -> type: ... + def __call__(self, *args: Any, **kwds: Any) -> Any: ... + def __subclasses__(self: _TT) -> List[_TT]: ... + # Note: the documentation doesnt specify what the return type is, the standard + # implementation seems to be returning a list. + def mro(self) -> List[type]: ... + def __instancecheck__(self, instance: Any) -> bool: ... + def __subclasscheck__(self, subclass: type) -> bool: ... + +class super(object): + @overload + def __init__(self, t: Any, obj: Any) -> None: ... + @overload + def __init__(self, t: Any) -> None: ... + +class int: + @overload + def __new__(cls: Type[_T], x: Union[Text, bytes, SupportsInt, _SupportsIndex, _SupportsTrunc] = ...) -> _T: ... + @overload + def __new__(cls: Type[_T], x: Union[Text, bytes, bytearray], base: int) -> _T: ... + @property + def real(self) -> int: ... + @property + def imag(self) -> int: ... + @property + def numerator(self) -> int: ... + @property + def denominator(self) -> int: ... + def conjugate(self) -> int: ... + def bit_length(self) -> int: ... + def __add__(self, x: int) -> int: ... + def __sub__(self, x: int) -> int: ... + def __mul__(self, x: int) -> int: ... + def __floordiv__(self, x: int) -> int: ... + def __div__(self, x: int) -> int: ... + def __truediv__(self, x: int) -> float: ... + def __mod__(self, x: int) -> int: ... + def __divmod__(self, x: int) -> Tuple[int, int]: ... + def __radd__(self, x: int) -> int: ... + def __rsub__(self, x: int) -> int: ... + def __rmul__(self, x: int) -> int: ... + def __rfloordiv__(self, x: int) -> int: ... + def __rdiv__(self, x: int) -> int: ... + def __rtruediv__(self, x: int) -> float: ... + def __rmod__(self, x: int) -> int: ... + def __rdivmod__(self, x: int) -> Tuple[int, int]: ... + @overload + def __pow__(self, __x: Literal[2], __modulo: Optional[int] = ...) -> int: ... + @overload + def __pow__(self, __x: int, __modulo: Optional[int] = ...) -> Any: ... # Return type can be int or float, depending on x. + def __rpow__(self, x: int, mod: Optional[int] = ...) -> Any: ... + def __and__(self, n: int) -> int: ... + def __or__(self, n: int) -> int: ... + def __xor__(self, n: int) -> int: ... + def __lshift__(self, n: int) -> int: ... + def __rshift__(self, n: int) -> int: ... + def __rand__(self, n: int) -> int: ... + def __ror__(self, n: int) -> int: ... + def __rxor__(self, n: int) -> int: ... + def __rlshift__(self, n: int) -> int: ... + def __rrshift__(self, n: int) -> int: ... + def __neg__(self) -> int: ... + def __pos__(self) -> int: ... + def __invert__(self) -> int: ... + def __trunc__(self) -> int: ... + def __getnewargs__(self) -> Tuple[int]: ... + def __eq__(self, x: object) -> bool: ... + def __ne__(self, x: object) -> bool: ... + def __lt__(self, x: int) -> bool: ... + def __le__(self, x: int) -> bool: ... + def __gt__(self, x: int) -> bool: ... + def __ge__(self, x: int) -> bool: ... + def __str__(self) -> str: ... + def __float__(self) -> float: ... + def __int__(self) -> int: ... + def __abs__(self) -> int: ... + def __hash__(self) -> int: ... + def __nonzero__(self) -> bool: ... + def __index__(self) -> int: ... + +class float: + def __new__(cls: Type[_T], x: Union[SupportsFloat, _SupportsIndex, Text, bytes, bytearray] = ...) -> _T: ... + def as_integer_ratio(self) -> Tuple[int, int]: ... + def hex(self) -> str: ... + def is_integer(self) -> bool: ... + @classmethod + def fromhex(cls, __s: str) -> float: ... + @property + def real(self) -> float: ... + @property + def imag(self) -> float: ... + def conjugate(self) -> float: ... + def __add__(self, x: float) -> float: ... + def __sub__(self, x: float) -> float: ... + def __mul__(self, x: float) -> float: ... + def __floordiv__(self, x: float) -> float: ... + def __div__(self, x: float) -> float: ... + def __truediv__(self, x: float) -> float: ... + def __mod__(self, x: float) -> float: ... + def __divmod__(self, x: float) -> Tuple[float, float]: ... + def __pow__( + self, x: float, mod: None = ... + ) -> float: ... # In Python 3, returns complex if self is negative and x is not whole + def __radd__(self, x: float) -> float: ... + def __rsub__(self, x: float) -> float: ... + def __rmul__(self, x: float) -> float: ... + def __rfloordiv__(self, x: float) -> float: ... + def __rdiv__(self, x: float) -> float: ... + def __rtruediv__(self, x: float) -> float: ... + def __rmod__(self, x: float) -> float: ... + def __rdivmod__(self, x: float) -> Tuple[float, float]: ... + def __rpow__(self, x: float, mod: None = ...) -> float: ... + def __getnewargs__(self) -> Tuple[float]: ... + def __trunc__(self) -> int: ... + def __eq__(self, x: object) -> bool: ... + def __ne__(self, x: object) -> bool: ... + def __lt__(self, x: float) -> bool: ... + def __le__(self, x: float) -> bool: ... + def __gt__(self, x: float) -> bool: ... + def __ge__(self, x: float) -> bool: ... + def __neg__(self) -> float: ... + def __pos__(self) -> float: ... + def __str__(self) -> str: ... + def __int__(self) -> int: ... + def __float__(self) -> float: ... + def __abs__(self) -> float: ... + def __hash__(self) -> int: ... + def __nonzero__(self) -> bool: ... + +class complex: + @overload + def __new__(cls: Type[_T], real: float = ..., imag: float = ...) -> _T: ... + @overload + def __new__(cls: Type[_T], real: Union[str, SupportsComplex, _SupportsIndex]) -> _T: ... + @property + def real(self) -> float: ... + @property + def imag(self) -> float: ... + def conjugate(self) -> complex: ... + def __add__(self, x: complex) -> complex: ... + def __sub__(self, x: complex) -> complex: ... + def __mul__(self, x: complex) -> complex: ... + def __pow__(self, x: complex, mod: None = ...) -> complex: ... + def __div__(self, x: complex) -> complex: ... + def __truediv__(self, x: complex) -> complex: ... + def __radd__(self, x: complex) -> complex: ... + def __rsub__(self, x: complex) -> complex: ... + def __rmul__(self, x: complex) -> complex: ... + def __rpow__(self, x: complex, mod: None = ...) -> complex: ... + def __rdiv__(self, x: complex) -> complex: ... + def __rtruediv__(self, x: complex) -> complex: ... + def __eq__(self, x: object) -> bool: ... + def __ne__(self, x: object) -> bool: ... + def __neg__(self) -> complex: ... + def __pos__(self) -> complex: ... + def __str__(self) -> str: ... + def __complex__(self) -> complex: ... + def __abs__(self) -> float: ... + def __hash__(self) -> int: ... + def __nonzero__(self) -> bool: ... + +class basestring(metaclass=ABCMeta): ... + +class unicode(basestring, Sequence[unicode]): + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, o: object) -> None: ... + @overload + def __init__(self, o: str, encoding: unicode = ..., errors: unicode = ...) -> None: ... + def capitalize(self) -> unicode: ... + def center(self, width: int, fillchar: unicode = ...) -> unicode: ... + def count(self, x: unicode) -> int: ... + def decode(self, encoding: unicode = ..., errors: unicode = ...) -> unicode: ... + def encode(self, encoding: unicode = ..., errors: unicode = ...) -> str: ... + def endswith(self, suffix: Union[unicode, Tuple[unicode, ...]], start: int = ..., end: int = ...) -> bool: ... + def expandtabs(self, tabsize: int = ...) -> unicode: ... + def find(self, sub: unicode, start: int = ..., end: int = ...) -> int: ... + def format(self, *args: object, **kwargs: object) -> unicode: ... + def index(self, sub: unicode, start: int = ..., end: int = ...) -> int: ... + def isalnum(self) -> bool: ... + def isalpha(self) -> bool: ... + def isdecimal(self) -> bool: ... + def isdigit(self) -> bool: ... + def isidentifier(self) -> bool: ... + def islower(self) -> bool: ... + def isnumeric(self) -> bool: ... + def isprintable(self) -> bool: ... + def isspace(self) -> bool: ... + def istitle(self) -> bool: ... + def isupper(self) -> bool: ... + def join(self, iterable: Iterable[unicode]) -> unicode: ... + def ljust(self, width: int, fillchar: unicode = ...) -> unicode: ... + def lower(self) -> unicode: ... + def lstrip(self, chars: unicode = ...) -> unicode: ... + def partition(self, sep: unicode) -> Tuple[unicode, unicode, unicode]: ... + def replace(self, old: unicode, new: unicode, count: int = ...) -> unicode: ... + def rfind(self, sub: unicode, start: int = ..., end: int = ...) -> int: ... + def rindex(self, sub: unicode, start: int = ..., end: int = ...) -> int: ... + def rjust(self, width: int, fillchar: unicode = ...) -> unicode: ... + def rpartition(self, sep: unicode) -> Tuple[unicode, unicode, unicode]: ... + def rsplit(self, sep: Optional[unicode] = ..., maxsplit: int = ...) -> List[unicode]: ... + def rstrip(self, chars: unicode = ...) -> unicode: ... + def split(self, sep: Optional[unicode] = ..., maxsplit: int = ...) -> List[unicode]: ... + def splitlines(self, keepends: bool = ...) -> List[unicode]: ... + def startswith(self, prefix: Union[unicode, Tuple[unicode, ...]], start: int = ..., end: int = ...) -> bool: ... + def strip(self, chars: unicode = ...) -> unicode: ... + def swapcase(self) -> unicode: ... + def title(self) -> unicode: ... + def translate(self, table: Union[Dict[int, Any], unicode]) -> unicode: ... + def upper(self) -> unicode: ... + def zfill(self, width: int) -> unicode: ... + @overload + def __getitem__(self, i: int) -> unicode: ... + @overload + def __getitem__(self, s: slice) -> unicode: ... + def __getslice__(self, start: int, stop: int) -> unicode: ... + def __add__(self, s: unicode) -> unicode: ... + def __mul__(self, n: int) -> unicode: ... + def __rmul__(self, n: int) -> unicode: ... + def __mod__(self, x: Any) -> unicode: ... + def __eq__(self, x: object) -> bool: ... + def __ne__(self, x: object) -> bool: ... + def __lt__(self, x: unicode) -> bool: ... + def __le__(self, x: unicode) -> bool: ... + def __gt__(self, x: unicode) -> bool: ... + def __ge__(self, x: unicode) -> bool: ... + def __len__(self) -> int: ... + # The argument type is incompatible with Sequence + def __contains__(self, s: Union[unicode, bytes]) -> bool: ... # type: ignore + def __iter__(self) -> Iterator[unicode]: ... + def __str__(self) -> str: ... + def __repr__(self) -> str: ... + def __int__(self) -> int: ... + def __float__(self) -> float: ... + def __hash__(self) -> int: ... + def __getnewargs__(self) -> Tuple[unicode]: ... + +class _FormatMapMapping(Protocol): + def __getitem__(self, __key: str) -> Any: ... + +class str(Sequence[str], basestring): + def __init__(self, o: object = ...) -> None: ... + def capitalize(self) -> str: ... + def center(self, __width: int, __fillchar: str = ...) -> str: ... + def count(self, x: Text, __start: Optional[int] = ..., __end: Optional[int] = ...) -> int: ... + def decode(self, encoding: Text = ..., errors: Text = ...) -> unicode: ... + def encode(self, encoding: Text = ..., errors: Text = ...) -> bytes: ... + def endswith(self, suffix: Union[Text, Tuple[Text, ...]]) -> bool: ... + def expandtabs(self, tabsize: int = ...) -> str: ... + def find(self, sub: Text, __start: Optional[int] = ..., __end: Optional[int] = ...) -> int: ... + def format(self, *args: object, **kwargs: object) -> str: ... + def format_map(self, map: _FormatMapMapping) -> str: ... + def index(self, sub: Text, __start: Optional[int] = ..., __end: Optional[int] = ...) -> int: ... + def isalnum(self) -> bool: ... + def isalpha(self) -> bool: ... + def isdigit(self) -> bool: ... + def islower(self) -> bool: ... + def isspace(self) -> bool: ... + def istitle(self) -> bool: ... + def isupper(self) -> bool: ... + def join(self, __iterable: Iterable[AnyStr]) -> AnyStr: ... + def ljust(self, __width: int, __fillchar: str = ...) -> str: ... + def lower(self) -> str: ... + @overload + def lstrip(self, __chars: str = ...) -> str: ... + @overload + def lstrip(self, __chars: unicode) -> unicode: ... + @overload + def partition(self, __sep: bytearray) -> Tuple[str, bytearray, str]: ... + @overload + def partition(self, __sep: str) -> Tuple[str, str, str]: ... + @overload + def partition(self, __sep: unicode) -> Tuple[unicode, unicode, unicode]: ... + def replace(self, __old: AnyStr, __new: AnyStr, __count: int = ...) -> AnyStr: ... + def rfind(self, sub: Text, __start: Optional[int] = ..., __end: Optional[int] = ...) -> int: ... + def rindex(self, sub: Text, __start: Optional[int] = ..., __end: Optional[int] = ...) -> int: ... + def rjust(self, __width: int, __fillchar: str = ...) -> str: ... + @overload + def rpartition(self, __sep: bytearray) -> Tuple[str, bytearray, str]: ... + @overload + def rpartition(self, __sep: str) -> Tuple[str, str, str]: ... + @overload + def rpartition(self, __sep: unicode) -> Tuple[unicode, unicode, unicode]: ... + @overload + def rsplit(self, sep: Optional[str] = ..., maxsplit: int = ...) -> List[str]: ... + @overload + def rsplit(self, sep: unicode, maxsplit: int = ...) -> List[unicode]: ... + @overload + def rstrip(self, __chars: str = ...) -> str: ... + @overload + def rstrip(self, __chars: unicode) -> unicode: ... + @overload + def split(self, sep: Optional[str] = ..., maxsplit: int = ...) -> List[str]: ... + @overload + def split(self, sep: unicode, maxsplit: int = ...) -> List[unicode]: ... + def splitlines(self, keepends: bool = ...) -> List[str]: ... + def startswith(self, prefix: Union[Text, Tuple[Text, ...]]) -> bool: ... + @overload + def strip(self, __chars: str = ...) -> str: ... + @overload + def strip(self, chars: unicode) -> unicode: ... + def swapcase(self) -> str: ... + def title(self) -> str: ... + def translate(self, __table: Optional[AnyStr], deletechars: AnyStr = ...) -> AnyStr: ... + def upper(self) -> str: ... + def zfill(self, __width: int) -> str: ... + def __add__(self, s: AnyStr) -> AnyStr: ... + # Incompatible with Sequence.__contains__ + def __contains__(self, o: Union[str, Text]) -> bool: ... # type: ignore + def __eq__(self, x: object) -> bool: ... + def __ge__(self, x: Text) -> bool: ... + def __getitem__(self, i: Union[int, slice]) -> str: ... + def __gt__(self, x: Text) -> bool: ... + def __hash__(self) -> int: ... + def __iter__(self) -> Iterator[str]: ... + def __le__(self, x: Text) -> bool: ... + def __len__(self) -> int: ... + def __lt__(self, x: Text) -> bool: ... + def __mod__(self, x: Any) -> str: ... + def __mul__(self, n: int) -> str: ... + def __ne__(self, x: object) -> bool: ... + def __repr__(self) -> str: ... + def __rmul__(self, n: int) -> str: ... + def __str__(self) -> str: ... + def __getnewargs__(self) -> Tuple[str]: ... + def __getslice__(self, start: int, stop: int) -> str: ... + def __float__(self) -> float: ... + def __int__(self) -> int: ... + +bytes = str + +class bytearray(MutableSequence[int], ByteString): + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, ints: Iterable[int]) -> None: ... + @overload + def __init__(self, string: str) -> None: ... + @overload + def __init__(self, string: Text, encoding: Text, errors: Text = ...) -> None: ... + @overload + def __init__(self, length: int) -> None: ... + def capitalize(self) -> bytearray: ... + def center(self, __width: int, __fillchar: bytes = ...) -> bytearray: ... + def count(self, __sub: str) -> int: ... + def decode(self, encoding: Text = ..., errors: Text = ...) -> str: ... + def endswith(self, __suffix: Union[bytes, Tuple[bytes, ...]]) -> bool: ... + def expandtabs(self, tabsize: int = ...) -> bytearray: ... + def extend(self, iterable: Union[str, Iterable[int]]) -> None: ... + def find(self, __sub: str, __start: int = ..., __end: int = ...) -> int: ... + def index(self, __sub: str, __start: int = ..., __end: int = ...) -> int: ... + def insert(self, __index: int, __item: int) -> None: ... + def isalnum(self) -> bool: ... + def isalpha(self) -> bool: ... + def isdigit(self) -> bool: ... + def islower(self) -> bool: ... + def isspace(self) -> bool: ... + def istitle(self) -> bool: ... + def isupper(self) -> bool: ... + def join(self, __iterable: Iterable[str]) -> bytearray: ... + def ljust(self, __width: int, __fillchar: str = ...) -> bytearray: ... + def lower(self) -> bytearray: ... + def lstrip(self, __bytes: Optional[bytes] = ...) -> bytearray: ... + def partition(self, __sep: bytes) -> Tuple[bytearray, bytearray, bytearray]: ... + def replace(self, __old: bytes, __new: bytes, __count: int = ...) -> bytearray: ... + def rfind(self, __sub: bytes, __start: int = ..., __end: int = ...) -> int: ... + def rindex(self, __sub: bytes, __start: int = ..., __end: int = ...) -> int: ... + def rjust(self, __width: int, __fillchar: bytes = ...) -> bytearray: ... + def rpartition(self, __sep: bytes) -> Tuple[bytearray, bytearray, bytearray]: ... + def rsplit(self, sep: Optional[bytes] = ..., maxsplit: int = ...) -> List[bytearray]: ... + def rstrip(self, __bytes: Optional[bytes] = ...) -> bytearray: ... + def split(self, sep: Optional[bytes] = ..., maxsplit: int = ...) -> List[bytearray]: ... + def splitlines(self, keepends: bool = ...) -> List[bytearray]: ... + def startswith( + self, __prefix: Union[bytes, Tuple[bytes, ...]], __start: Optional[int] = ..., __end: Optional[int] = ... + ) -> bool: ... + def strip(self, __bytes: Optional[bytes] = ...) -> bytearray: ... + def swapcase(self) -> bytearray: ... + def title(self) -> bytearray: ... + def translate(self, __table: str) -> bytearray: ... + def upper(self) -> bytearray: ... + def zfill(self, __width: int) -> bytearray: ... + @classmethod + def fromhex(cls, __string: str) -> bytearray: ... + def __len__(self) -> int: ... + def __iter__(self) -> Iterator[int]: ... + def __str__(self) -> str: ... + def __repr__(self) -> str: ... + def __int__(self) -> int: ... + def __float__(self) -> float: ... + __hash__: None # type: ignore + @overload + def __getitem__(self, i: int) -> int: ... + @overload + def __getitem__(self, s: slice) -> bytearray: ... + @overload + def __setitem__(self, i: int, x: int) -> None: ... + @overload + def __setitem__(self, s: slice, x: Union[Iterable[int], bytes]) -> None: ... + def __delitem__(self, i: Union[int, slice]) -> None: ... + def __getslice__(self, start: int, stop: int) -> bytearray: ... + def __setslice__(self, start: int, stop: int, x: Union[Sequence[int], str]) -> None: ... + def __delslice__(self, start: int, stop: int) -> None: ... + def __add__(self, s: bytes) -> bytearray: ... + def __mul__(self, n: int) -> bytearray: ... + # Incompatible with Sequence.__contains__ + def __contains__(self, o: Union[int, bytes]) -> bool: ... # type: ignore + def __eq__(self, x: object) -> bool: ... + def __ne__(self, x: object) -> bool: ... + def __lt__(self, x: bytes) -> bool: ... + def __le__(self, x: bytes) -> bool: ... + def __gt__(self, x: bytes) -> bool: ... + def __ge__(self, x: bytes) -> bool: ... + +class memoryview(Sized, Container[str]): + format: str + itemsize: int + shape: Optional[Tuple[int, ...]] + strides: Optional[Tuple[int, ...]] + suboffsets: Optional[Tuple[int, ...]] + readonly: bool + ndim: int + def __init__(self, obj: ReadableBuffer) -> None: ... + @overload + def __getitem__(self, i: int) -> str: ... + @overload + def __getitem__(self, s: slice) -> memoryview: ... + def __contains__(self, x: object) -> bool: ... + def __iter__(self) -> Iterator[str]: ... + def __len__(self) -> int: ... + @overload + def __setitem__(self, s: slice, o: memoryview) -> None: ... + @overload + def __setitem__(self, i: int, o: bytes) -> None: ... + @overload + def __setitem__(self, s: slice, o: Sequence[bytes]) -> None: ... + def tobytes(self) -> bytes: ... + def tolist(self) -> List[int]: ... + +class bool(int): + def __new__(cls: Type[_T], __o: object = ...) -> _T: ... + @overload + def __and__(self, x: bool) -> bool: ... + @overload + def __and__(self, x: int) -> int: ... + @overload + def __or__(self, x: bool) -> bool: ... + @overload + def __or__(self, x: int) -> int: ... + @overload + def __xor__(self, x: bool) -> bool: ... + @overload + def __xor__(self, x: int) -> int: ... + @overload + def __rand__(self, x: bool) -> bool: ... + @overload + def __rand__(self, x: int) -> int: ... + @overload + def __ror__(self, x: bool) -> bool: ... + @overload + def __ror__(self, x: int) -> int: ... + @overload + def __rxor__(self, x: bool) -> bool: ... + @overload + def __rxor__(self, x: int) -> int: ... + def __getnewargs__(self) -> Tuple[int]: ... + +class slice(object): + start: Any + step: Any + stop: Any + @overload + def __init__(self, stop: Any) -> None: ... + @overload + def __init__(self, start: Any, stop: Any, step: Any = ...) -> None: ... + __hash__: None # type: ignore + def indices(self, len: int) -> Tuple[int, int, int]: ... + +class tuple(Sequence[_T_co], Generic[_T_co]): + def __new__(cls: Type[_T], iterable: Iterable[_T_co] = ...) -> _T: ... + def __len__(self) -> int: ... + def __contains__(self, x: object) -> bool: ... + @overload + def __getitem__(self, x: int) -> _T_co: ... + @overload + def __getitem__(self, x: slice) -> Tuple[_T_co, ...]: ... + def __iter__(self) -> Iterator[_T_co]: ... + def __lt__(self, x: Tuple[_T_co, ...]) -> bool: ... + def __le__(self, x: Tuple[_T_co, ...]) -> bool: ... + def __gt__(self, x: Tuple[_T_co, ...]) -> bool: ... + def __ge__(self, x: Tuple[_T_co, ...]) -> bool: ... + @overload + def __add__(self, x: Tuple[_T_co, ...]) -> Tuple[_T_co, ...]: ... + @overload + def __add__(self, x: Tuple[Any, ...]) -> Tuple[Any, ...]: ... + def __mul__(self, n: int) -> Tuple[_T_co, ...]: ... + def __rmul__(self, n: int) -> Tuple[_T_co, ...]: ... + def count(self, __value: Any) -> int: ... + def index(self, __value: Any) -> int: ... + +class function: + # TODO not defined in builtins! + __name__: str + __module__: str + __code__: CodeType + +class list(MutableSequence[_T], Generic[_T]): + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, iterable: Iterable[_T]) -> None: ... + def append(self, __object: _T) -> None: ... + def extend(self, __iterable: Iterable[_T]) -> None: ... + def pop(self, __index: int = ...) -> _T: ... + def index(self, __value: _T, __start: int = ..., __stop: int = ...) -> int: ... + def count(self, __value: _T) -> int: ... + def insert(self, __index: int, __object: _T) -> None: ... + def remove(self, __value: _T) -> None: ... + def reverse(self) -> None: ... + def sort(self, cmp: Callable[[_T, _T], Any] = ..., key: Callable[[_T], Any] = ..., reverse: bool = ...) -> None: ... + def __len__(self) -> int: ... + def __iter__(self) -> Iterator[_T]: ... + def __str__(self) -> str: ... + __hash__: None # type: ignore + @overload + def __getitem__(self, i: int) -> _T: ... + @overload + def __getitem__(self, s: slice) -> List[_T]: ... + @overload + def __setitem__(self, i: int, o: _T) -> None: ... + @overload + def __setitem__(self, s: slice, o: Iterable[_T]) -> None: ... + def __delitem__(self, i: Union[int, slice]) -> None: ... + def __getslice__(self, start: int, stop: int) -> List[_T]: ... + def __setslice__(self, start: int, stop: int, o: Sequence[_T]) -> None: ... + def __delslice__(self, start: int, stop: int) -> None: ... + def __add__(self, x: List[_T]) -> List[_T]: ... + def __iadd__(self: _S, x: Iterable[_T]) -> _S: ... + def __mul__(self, n: int) -> List[_T]: ... + def __rmul__(self, n: int) -> List[_T]: ... + def __contains__(self, o: object) -> bool: ... + def __reversed__(self) -> Iterator[_T]: ... + def __gt__(self, x: List[_T]) -> bool: ... + def __ge__(self, x: List[_T]) -> bool: ... + def __lt__(self, x: List[_T]) -> bool: ... + def __le__(self, x: List[_T]) -> bool: ... + +class dict(MutableMapping[_KT, _VT], Generic[_KT, _VT]): + # NOTE: Keyword arguments are special. If they are used, _KT must include + # str, but we have no way of enforcing it here. + @overload + def __init__(self, **kwargs: _VT) -> None: ... + @overload + def __init__(self, map: SupportsKeysAndGetItem[_KT, _VT], **kwargs: _VT) -> None: ... + @overload + def __init__(self, iterable: Iterable[Tuple[_KT, _VT]], **kwargs: _VT) -> None: ... + def __new__(cls: Type[_T1], *args: Any, **kwargs: Any) -> _T1: ... + def has_key(self, k: _KT) -> bool: ... + def clear(self) -> None: ... + def copy(self) -> Dict[_KT, _VT]: ... + def popitem(self) -> Tuple[_KT, _VT]: ... + def setdefault(self, __key: _KT, __default: _VT = ...) -> _VT: ... + @overload + def update(self, __m: Mapping[_KT, _VT], **kwargs: _VT) -> None: ... + @overload + def update(self, __m: Iterable[Tuple[_KT, _VT]], **kwargs: _VT) -> None: ... + @overload + def update(self, **kwargs: _VT) -> None: ... + def iterkeys(self) -> Iterator[_KT]: ... + def itervalues(self) -> Iterator[_VT]: ... + def iteritems(self) -> Iterator[Tuple[_KT, _VT]]: ... + def viewkeys(self) -> KeysView[_KT]: ... + def viewvalues(self) -> ValuesView[_VT]: ... + def viewitems(self) -> ItemsView[_KT, _VT]: ... + @classmethod + @overload + def fromkeys(cls, __iterable: Iterable[_T]) -> Dict[_T, Any]: ... + @classmethod + @overload + def fromkeys(cls, __iterable: Iterable[_T], __value: _S) -> Dict[_T, _S]: ... + def __len__(self) -> int: ... + def __getitem__(self, k: _KT) -> _VT: ... + def __setitem__(self, k: _KT, v: _VT) -> None: ... + def __delitem__(self, v: _KT) -> None: ... + def __iter__(self) -> Iterator[_KT]: ... + def __str__(self) -> str: ... + __hash__: None # type: ignore + +class set(MutableSet[_T], Generic[_T]): + def __init__(self, iterable: Iterable[_T] = ...) -> None: ... + def add(self, element: _T) -> None: ... + def clear(self) -> None: ... + def copy(self) -> Set[_T]: ... + def difference(self, *s: Iterable[Any]) -> Set[_T]: ... + def difference_update(self, *s: Iterable[Any]) -> None: ... + def discard(self, element: _T) -> None: ... + def intersection(self, *s: Iterable[Any]) -> Set[_T]: ... + def intersection_update(self, *s: Iterable[Any]) -> None: ... + def isdisjoint(self, s: Iterable[Any]) -> bool: ... + def issubset(self, s: Iterable[Any]) -> bool: ... + def issuperset(self, s: Iterable[Any]) -> bool: ... + def pop(self) -> _T: ... + def remove(self, element: _T) -> None: ... + def symmetric_difference(self, s: Iterable[_T]) -> Set[_T]: ... + def symmetric_difference_update(self, s: Iterable[_T]) -> None: ... + def union(self, *s: Iterable[_T]) -> Set[_T]: ... + def update(self, *s: Iterable[_T]) -> None: ... + def __len__(self) -> int: ... + def __contains__(self, o: object) -> bool: ... + def __iter__(self) -> Iterator[_T]: ... + def __str__(self) -> str: ... + def __and__(self, s: AbstractSet[object]) -> Set[_T]: ... + def __iand__(self, s: AbstractSet[object]) -> Set[_T]: ... + def __or__(self, s: AbstractSet[_S]) -> Set[Union[_T, _S]]: ... + def __ior__(self, s: AbstractSet[_S]) -> Set[Union[_T, _S]]: ... + @overload + def __sub__(self: Set[str], s: AbstractSet[Optional[Text]]) -> Set[_T]: ... + @overload + def __sub__(self, s: AbstractSet[Optional[_T]]) -> Set[_T]: ... + @overload # type: ignore + def __isub__(self: Set[str], s: AbstractSet[Optional[Text]]) -> Set[_T]: ... + @overload + def __isub__(self, s: AbstractSet[Optional[_T]]) -> Set[_T]: ... + def __xor__(self, s: AbstractSet[_S]) -> Set[Union[_T, _S]]: ... + def __ixor__(self, s: AbstractSet[_S]) -> Set[Union[_T, _S]]: ... + def __le__(self, s: AbstractSet[object]) -> bool: ... + def __lt__(self, s: AbstractSet[object]) -> bool: ... + def __ge__(self, s: AbstractSet[object]) -> bool: ... + def __gt__(self, s: AbstractSet[object]) -> bool: ... + __hash__: None # type: ignore + +class frozenset(AbstractSet[_T_co], Generic[_T_co]): + def __init__(self, iterable: Iterable[_T_co] = ...) -> None: ... + def copy(self) -> FrozenSet[_T_co]: ... + def difference(self, *s: Iterable[object]) -> FrozenSet[_T_co]: ... + def intersection(self, *s: Iterable[object]) -> FrozenSet[_T_co]: ... + def isdisjoint(self, s: Iterable[_T_co]) -> bool: ... + def issubset(self, s: Iterable[object]) -> bool: ... + def issuperset(self, s: Iterable[object]) -> bool: ... + def symmetric_difference(self, s: Iterable[_T_co]) -> FrozenSet[_T_co]: ... + def union(self, *s: Iterable[_T_co]) -> FrozenSet[_T_co]: ... + def __len__(self) -> int: ... + def __contains__(self, o: object) -> bool: ... + def __iter__(self) -> Iterator[_T_co]: ... + def __str__(self) -> str: ... + def __and__(self, s: AbstractSet[_T_co]) -> FrozenSet[_T_co]: ... + def __or__(self, s: AbstractSet[_S]) -> FrozenSet[Union[_T_co, _S]]: ... + def __sub__(self, s: AbstractSet[_T_co]) -> FrozenSet[_T_co]: ... + def __xor__(self, s: AbstractSet[_S]) -> FrozenSet[Union[_T_co, _S]]: ... + def __le__(self, s: AbstractSet[object]) -> bool: ... + def __lt__(self, s: AbstractSet[object]) -> bool: ... + def __ge__(self, s: AbstractSet[object]) -> bool: ... + def __gt__(self, s: AbstractSet[object]) -> bool: ... + +class enumerate(Iterator[Tuple[int, _T]], Generic[_T]): + def __init__(self, iterable: Iterable[_T], start: int = ...) -> None: ... + def __iter__(self) -> Iterator[Tuple[int, _T]]: ... + def next(self) -> Tuple[int, _T]: ... + +class xrange(Sized, Iterable[int], Reversible[int]): + @overload + def __init__(self, stop: int) -> None: ... + @overload + def __init__(self, start: int, stop: int, step: int = ...) -> None: ... + def __len__(self) -> int: ... + def __iter__(self) -> Iterator[int]: ... + def __getitem__(self, i: int) -> int: ... + def __reversed__(self) -> Iterator[int]: ... + +class property(object): + def __init__( + self, + fget: Optional[Callable[[Any], Any]] = ..., + fset: Optional[Callable[[Any, Any], None]] = ..., + fdel: Optional[Callable[[Any], None]] = ..., + doc: Optional[str] = ..., + ) -> None: ... + def getter(self, fget: Callable[[Any], Any]) -> property: ... + def setter(self, fset: Callable[[Any, Any], None]) -> property: ... + def deleter(self, fdel: Callable[[Any], None]) -> property: ... + def __get__(self, obj: Any, type: Optional[type] = ...) -> Any: ... + def __set__(self, obj: Any, value: Any) -> None: ... + def __delete__(self, obj: Any) -> None: ... + def fget(self) -> Any: ... + def fset(self, value: Any) -> None: ... + def fdel(self) -> None: ... + +long = int + +class _NotImplementedType(Any): # type: ignore + # A little weird, but typing the __call__ as NotImplemented makes the error message + # for NotImplemented() much better + __call__: NotImplemented # type: ignore + +NotImplemented: _NotImplementedType + +def abs(__x: SupportsAbs[_T]) -> _T: ... +def all(__iterable: Iterable[object]) -> bool: ... +def any(__iterable: Iterable[object]) -> bool: ... +def apply(__func: Callable[..., _T], __args: Optional[Sequence[Any]] = ..., __kwds: Optional[Mapping[str, Any]] = ...) -> _T: ... +def bin(__number: Union[int, _SupportsIndex]) -> str: ... +def callable(__obj: object) -> bool: ... +def chr(__i: int) -> str: ... +def cmp(__x: Any, __y: Any) -> int: ... + +_N1 = TypeVar("_N1", bool, int, float, complex) + +def coerce(__x: _N1, __y: _N1) -> Tuple[_N1, _N1]: ... + +# This class is to be exported as PathLike from os, +# but we define it here as _PathLike to avoid import cycle issues. +# See https://github.com/python/typeshed/pull/991#issuecomment-288160993 +_AnyStr_co = TypeVar("_AnyStr_co", str, bytes, covariant=True) +@runtime_checkable +class _PathLike(Protocol[_AnyStr_co]): + def __fspath__(self) -> _AnyStr_co: ... + +def compile(source: Union[Text, mod], filename: Text, mode: Text, flags: int = ..., dont_inherit: int = ...) -> Any: ... +def delattr(__obj: Any, __name: Text) -> None: ... +def dir(__o: object = ...) -> List[str]: ... + +_N2 = TypeVar("_N2", int, float) + +def divmod(__x: _N2, __y: _N2) -> Tuple[_N2, _N2]: ... +def eval( + __source: Union[Text, bytes, CodeType], __globals: Optional[Dict[str, Any]] = ..., __locals: Optional[Mapping[str, Any]] = ... +) -> Any: ... +def execfile(__filename: str, __globals: Optional[Dict[str, Any]] = ..., __locals: Optional[Dict[str, Any]] = ...) -> None: ... +def exit(code: object = ...) -> NoReturn: ... +@overload +def filter(__function: Callable[[AnyStr], Any], __iterable: AnyStr) -> AnyStr: ... # type: ignore +@overload +def filter(__function: None, __iterable: Tuple[Optional[_T], ...]) -> Tuple[_T, ...]: ... # type: ignore +@overload +def filter(__function: Callable[[_T], Any], __iterable: Tuple[_T, ...]) -> Tuple[_T, ...]: ... # type: ignore +@overload +def filter(__function: None, __iterable: Iterable[Optional[_T]]) -> List[_T]: ... +@overload +def filter(__function: Callable[[_T], Any], __iterable: Iterable[_T]) -> List[_T]: ... +def format(__value: object, __format_spec: str = ...) -> str: ... # TODO unicode +def getattr(__o: Any, name: Text, __default: Any = ...) -> Any: ... +def globals() -> Dict[str, Any]: ... +def hasattr(__obj: Any, __name: Text) -> bool: ... +def hash(__obj: object) -> int: ... +def hex(__number: Union[int, _SupportsIndex]) -> str: ... +def id(__obj: object) -> int: ... +def input(__prompt: Any = ...) -> Any: ... +def intern(__string: str) -> str: ... +@overload +def iter(__iterable: Iterable[_T]) -> Iterator[_T]: ... +@overload +def iter(__function: Callable[[], Optional[_T]], __sentinel: None) -> Iterator[_T]: ... +@overload +def iter(__function: Callable[[], _T], __sentinel: Any) -> Iterator[_T]: ... +def isinstance(__obj: object, __class_or_tuple: Union[type, Tuple[Union[type, Tuple[Any, ...]], ...]]) -> bool: ... +def issubclass(__cls: type, __class_or_tuple: Union[type, Tuple[Union[type, Tuple[Any, ...]], ...]]) -> bool: ... +def len(__obj: Sized) -> int: ... +def locals() -> Dict[str, Any]: ... +@overload +def map(__func: None, __iter1: Iterable[_T1]) -> List[_T1]: ... +@overload +def map(__func: None, __iter1: Iterable[_T1], __iter2: Iterable[_T2]) -> List[Tuple[_T1, _T2]]: ... +@overload +def map(__func: None, __iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3]) -> List[Tuple[_T1, _T2, _T3]]: ... +@overload +def map( + __func: None, __iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3], __iter4: Iterable[_T4] +) -> List[Tuple[_T1, _T2, _T3, _T4]]: ... +@overload +def map( + __func: None, + __iter1: Iterable[_T1], + __iter2: Iterable[_T2], + __iter3: Iterable[_T3], + __iter4: Iterable[_T4], + __iter5: Iterable[_T5], +) -> List[Tuple[_T1, _T2, _T3, _T4, _T5]]: ... +@overload +def map( + __func: None, + __iter1: Iterable[Any], + __iter2: Iterable[Any], + __iter3: Iterable[Any], + __iter4: Iterable[Any], + __iter5: Iterable[Any], + __iter6: Iterable[Any], + *iterables: Iterable[Any], +) -> List[Tuple[Any, ...]]: ... +@overload +def map(__func: Callable[[_T1], _S], __iter1: Iterable[_T1]) -> List[_S]: ... +@overload +def map(__func: Callable[[_T1, _T2], _S], __iter1: Iterable[_T1], __iter2: Iterable[_T2]) -> List[_S]: ... +@overload +def map( + __func: Callable[[_T1, _T2, _T3], _S], __iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3] +) -> List[_S]: ... +@overload +def map( + __func: Callable[[_T1, _T2, _T3, _T4], _S], + __iter1: Iterable[_T1], + __iter2: Iterable[_T2], + __iter3: Iterable[_T3], + __iter4: Iterable[_T4], +) -> List[_S]: ... +@overload +def map( + __func: Callable[[_T1, _T2, _T3, _T4, _T5], _S], + __iter1: Iterable[_T1], + __iter2: Iterable[_T2], + __iter3: Iterable[_T3], + __iter4: Iterable[_T4], + __iter5: Iterable[_T5], +) -> List[_S]: ... +@overload +def map( + __func: Callable[..., _S], + __iter1: Iterable[Any], + __iter2: Iterable[Any], + __iter3: Iterable[Any], + __iter4: Iterable[Any], + __iter5: Iterable[Any], + __iter6: Iterable[Any], + *iterables: Iterable[Any], +) -> List[_S]: ... +@overload +def max(__arg1: _T, __arg2: _T, *_args: _T, key: Callable[[_T], Any] = ...) -> _T: ... +@overload +def max(__iterable: Iterable[_T], *, key: Callable[[_T], Any] = ...) -> _T: ... +@overload +def min(__arg1: _T, __arg2: _T, *_args: _T, key: Callable[[_T], Any] = ...) -> _T: ... +@overload +def min(__iterable: Iterable[_T], *, key: Callable[[_T], Any] = ...) -> _T: ... +@overload +def next(__i: Iterator[_T]) -> _T: ... +@overload +def next(__i: Iterator[_T], default: _VT) -> Union[_T, _VT]: ... +def oct(__number: Union[int, _SupportsIndex]) -> str: ... +def open(name: Union[unicode, int], mode: unicode = ..., buffering: int = ...) -> BinaryIO: ... +def ord(__c: Union[Text, bytes]) -> int: ... + +# This is only available after from __future__ import print_function. +def print( + *values: object, sep: Optional[Text] = ..., end: Optional[Text] = ..., file: Optional[SupportsWrite[Any]] = ... +) -> None: ... + +_E = TypeVar("_E", contravariant=True) +_M = TypeVar("_M", contravariant=True) + +class _SupportsPow2(Protocol[_E, _T_co]): + def __pow__(self, __other: _E) -> _T_co: ... + +class _SupportsPow3(Protocol[_E, _M, _T_co]): + def __pow__(self, __other: _E, __modulo: _M) -> _T_co: ... + +@overload +def pow(__base: int, __exp: int, __mod: None = ...) -> Any: ... # returns int or float depending on whether exp is non-negative +@overload +def pow(__base: int, __exp: int, __mod: int) -> int: ... +@overload +def pow(__base: float, __exp: float, __mod: None = ...) -> float: ... +@overload +def pow(__base: _SupportsPow2[_E, _T_co], __exp: _E) -> _T_co: ... +@overload +def pow(__base: _SupportsPow3[_E, _M, _T_co], __exp: _E, __mod: _M) -> _T_co: ... +def quit(code: object = ...) -> NoReturn: ... +def range(__x: int, __y: int = ..., __step: int = ...) -> List[int]: ... # noqa: F811 +def raw_input(__prompt: Any = ...) -> str: ... +@overload +def reduce(__function: Callable[[_T, _S], _T], __iterable: Iterable[_S], __initializer: _T) -> _T: ... +@overload +def reduce(__function: Callable[[_T, _T], _T], __iterable: Iterable[_T]) -> _T: ... +def reload(__module: Any) -> Any: ... +@overload +def reversed(__sequence: Sequence[_T]) -> Iterator[_T]: ... +@overload +def reversed(__sequence: Reversible[_T]) -> Iterator[_T]: ... +def repr(__obj: object) -> str: ... +@overload +def round(number: float) -> float: ... +@overload +def round(number: float, ndigits: int) -> float: ... +@overload +def round(number: SupportsFloat) -> float: ... +@overload +def round(number: SupportsFloat, ndigits: int) -> float: ... +def setattr(__obj: Any, __name: Text, __value: Any) -> None: ... +def sorted( + __iterable: Iterable[_T], + *, + cmp: Callable[[_T, _T], int] = ..., + key: Optional[Callable[[_T], Any]] = ..., + reverse: bool = ..., +) -> List[_T]: ... +@overload +def sum(__iterable: Iterable[_T]) -> Union[_T, int]: ... +@overload +def sum(__iterable: Iterable[_T], __start: _S) -> Union[_T, _S]: ... +def unichr(__i: int) -> unicode: ... +def vars(__object: Any = ...) -> Dict[str, Any]: ... +@overload +def zip(__iter1: Iterable[_T1]) -> List[Tuple[_T1]]: ... +@overload +def zip(__iter1: Iterable[_T1], __iter2: Iterable[_T2]) -> List[Tuple[_T1, _T2]]: ... +@overload +def zip(__iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3]) -> List[Tuple[_T1, _T2, _T3]]: ... +@overload +def zip( + __iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3], __iter4: Iterable[_T4] +) -> List[Tuple[_T1, _T2, _T3, _T4]]: ... +@overload +def zip( + __iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3], __iter4: Iterable[_T4], __iter5: Iterable[_T5] +) -> List[Tuple[_T1, _T2, _T3, _T4, _T5]]: ... +@overload +def zip( + __iter1: Iterable[Any], + __iter2: Iterable[Any], + __iter3: Iterable[Any], + __iter4: Iterable[Any], + __iter5: Iterable[Any], + __iter6: Iterable[Any], + *iterables: Iterable[Any], +) -> List[Tuple[Any, ...]]: ... +def __import__( + name: Text, + globals: Optional[Mapping[str, Any]] = ..., + locals: Optional[Mapping[str, Any]] = ..., + fromlist: Sequence[str] = ..., + level: int = ..., +) -> Any: ... + +# Actually the type of Ellipsis is , but since it's +# not exposed anywhere under that name, we make it private here. +class ellipsis: ... + +Ellipsis: ellipsis + +# TODO: buffer support is incomplete; e.g. some_string.startswith(some_buffer) doesn't type check. +_AnyBuffer = TypeVar("_AnyBuffer", str, unicode, bytearray, buffer) + +class buffer(Sized): + def __init__(self, object: _AnyBuffer, offset: int = ..., size: int = ...) -> None: ... + def __add__(self, other: _AnyBuffer) -> str: ... + def __cmp__(self, other: _AnyBuffer) -> bool: ... + def __getitem__(self, key: Union[int, slice]) -> str: ... + def __getslice__(self, i: int, j: int) -> str: ... + def __len__(self) -> int: ... + def __mul__(self, x: int) -> str: ... + +class BaseException(object): + args: Tuple[Any, ...] + message: Any + def __init__(self, *args: object) -> None: ... + def __str__(self) -> str: ... + def __repr__(self) -> str: ... + def __getitem__(self, i: int) -> Any: ... + def __getslice__(self, start: int, stop: int) -> Tuple[Any, ...]: ... + +class GeneratorExit(BaseException): ... +class KeyboardInterrupt(BaseException): ... + +class SystemExit(BaseException): + code: int + +class Exception(BaseException): ... +class StopIteration(Exception): ... +class StandardError(Exception): ... + +_StandardError = StandardError + +class EnvironmentError(StandardError): + errno: int + strerror: str + # TODO can this be unicode? + filename: str + +class OSError(EnvironmentError): ... +class IOError(EnvironmentError): ... +class ArithmeticError(_StandardError): ... +class AssertionError(_StandardError): ... +class AttributeError(_StandardError): ... +class BufferError(_StandardError): ... +class EOFError(_StandardError): ... +class ImportError(_StandardError): ... +class LookupError(_StandardError): ... +class MemoryError(_StandardError): ... +class NameError(_StandardError): ... +class ReferenceError(_StandardError): ... +class RuntimeError(_StandardError): ... + +class SyntaxError(_StandardError): + msg: str + lineno: Optional[int] + offset: Optional[int] + text: Optional[str] + filename: Optional[str] + +class SystemError(_StandardError): ... +class TypeError(_StandardError): ... +class ValueError(_StandardError): ... +class FloatingPointError(ArithmeticError): ... +class OverflowError(ArithmeticError): ... +class ZeroDivisionError(ArithmeticError): ... +class IndexError(LookupError): ... +class KeyError(LookupError): ... +class UnboundLocalError(NameError): ... + +class WindowsError(OSError): + winerror: int + +class NotImplementedError(RuntimeError): ... +class IndentationError(SyntaxError): ... +class TabError(IndentationError): ... +class UnicodeError(ValueError): ... + +class UnicodeDecodeError(UnicodeError): + encoding: str + object: bytes + start: int + end: int + reason: str + def __init__(self, __encoding: str, __object: bytes, __start: int, __end: int, __reason: str) -> None: ... + +class UnicodeEncodeError(UnicodeError): + encoding: str + object: Text + start: int + end: int + reason: str + def __init__(self, __encoding: str, __object: Text, __start: int, __end: int, __reason: str) -> None: ... + +class UnicodeTranslateError(UnicodeError): ... +class Warning(Exception): ... +class UserWarning(Warning): ... +class DeprecationWarning(Warning): ... +class SyntaxWarning(Warning): ... +class RuntimeWarning(Warning): ... +class FutureWarning(Warning): ... +class PendingDeprecationWarning(Warning): ... +class ImportWarning(Warning): ... +class UnicodeWarning(Warning): ... +class BytesWarning(Warning): ... + +class file(BinaryIO): + @overload + def __init__(self, file: str, mode: str = ..., buffering: int = ...) -> None: ... + @overload + def __init__(self, file: unicode, mode: str = ..., buffering: int = ...) -> None: ... + @overload + def __init__(self, file: int, mode: str = ..., buffering: int = ...) -> None: ... + def __iter__(self) -> Iterator[str]: ... + def next(self) -> str: ... + def read(self, n: int = ...) -> str: ... + def __enter__(self) -> BinaryIO: ... + def __exit__( + self, t: Optional[type] = ..., exc: Optional[BaseException] = ..., tb: Optional[Any] = ... + ) -> Optional[bool]: ... + def flush(self) -> None: ... + def fileno(self) -> int: ... + def isatty(self) -> bool: ... + def close(self) -> None: ... + def readable(self) -> bool: ... + def writable(self) -> bool: ... + def seekable(self) -> bool: ... + def seek(self, offset: int, whence: int = ...) -> int: ... + def tell(self) -> int: ... + def readline(self, limit: int = ...) -> str: ... + def readlines(self, hint: int = ...) -> List[str]: ... + def write(self, data: str) -> int: ... + def writelines(self, data: Iterable[str]) -> None: ... + def truncate(self, pos: Optional[int] = ...) -> int: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/cPickle.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/cPickle.pyi old mode 100755 new mode 100644 index 0421c50e..d8db140c --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/cPickle.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/cPickle.pyi @@ -1,4 +1,4 @@ -from typing import Any, IO, List +from typing import IO, Any, List HIGHEST_PROTOCOL: int compatible_formats: List[str] @@ -6,20 +6,14 @@ format_version: str class Pickler: def __init__(self, file: IO[str], protocol: int = ...) -> None: ... - def dump(self, obj: Any) -> None: ... - def clear_memo(self) -> None: ... - class Unpickler: def __init__(self, file: IO[str]) -> None: ... - def load(self) -> Any: ... - def noload(self) -> Any: ... - def dump(obj: Any, file: IO[str], protocol: int = ...) -> None: ... def dumps(obj: Any, protocol: int = ...) -> str: ... def load(file: IO[str]) -> Any: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/cStringIO.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/cStringIO.pyi old mode 100755 new mode 100644 index 380e3a4b..603ce3f2 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/cStringIO.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/cStringIO.pyi @@ -1,11 +1,6 @@ -# Stubs for cStringIO (Python 2.7) -# See https://docs.python.org/2/library/stringio.html - from abc import ABCMeta -from typing import overload, IO, List, Iterable, Iterator, Optional, Union from types import TracebackType - -# TODO the typing.IO[] generics should be split into input and output. +from typing import IO, Iterable, Iterator, List, Optional, Union, overload # This class isn't actually abstract, but you can't instantiate it # directly, so we might as well treat it as abstract in the stub. @@ -26,7 +21,6 @@ class InputType(IO[str], Iterator[str], metaclass=ABCMeta): def next(self) -> str: ... def reset(self) -> None: ... - class OutputType(IO[str], Iterator[str], metaclass=ABCMeta): @property def softspace(self) -> int: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/collections.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/collections.pyi old mode 100755 new mode 100644 index 988e9202..f6f75cb0 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/collections.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/collections.pyi @@ -1,38 +1,50 @@ -# These are not exported. -from typing import Any, Dict, Generic, TypeVar, Tuple, overload, Type, Optional, List, Union, Reversible - -# These are exported. from typing import ( + AbstractSet, + Any, Callable as Callable, Container as Container, + Dict, + Generic, Hashable as Hashable, ItemsView as ItemsView, Iterable as Iterable, Iterator as Iterator, KeysView as KeysView, + List, Mapping as Mapping, MappingView as MappingView, MutableMapping as MutableMapping, MutableSequence as MutableSequence, MutableSet as MutableSet, + Optional, + Reversible, Sequence as Sequence, - AbstractSet as Set, Sized as Sized, + Tuple, + Type, + TypeVar, + Union, ValuesView as ValuesView, + overload, ) -_S = TypeVar('_S') -_T = TypeVar('_T') -_KT = TypeVar('_KT') -_VT = TypeVar('_VT') +Set = AbstractSet + +_S = TypeVar("_S") +_T = TypeVar("_T") +_KT = TypeVar("_KT") +_VT = TypeVar("_VT") # namedtuple is special-cased in the type checker; the initializer is ignored. -def namedtuple(typename: Union[str, unicode], field_names: Union[str, unicode, Iterable[Union[str, unicode]]], - verbose: bool = ..., rename: bool = ...) -> Type[Tuple[Any, ...]]: ... +def namedtuple( + typename: Union[str, unicode], + field_names: Union[str, unicode, Iterable[Union[str, unicode]]], + verbose: bool = ..., + rename: bool = ..., +) -> Type[Tuple[Any, ...]]: ... class deque(Sized, Iterable[_T], Reversible[_T], Generic[_T]): - def __init__(self, iterable: Iterable[_T] = ..., - maxlen: int = ...) -> None: ... + def __init__(self, iterable: Iterable[_T] = ..., maxlen: int = ...) -> None: ... @property def maxlen(self) -> Optional[int]: ... def append(self, x: _T) -> None: ... @@ -45,7 +57,7 @@ class deque(Sized, Iterable[_T], Reversible[_T], Generic[_T]): def popleft(self) -> _T: ... def remove(self, value: _T) -> None: ... def reverse(self) -> None: ... - def rotate(self, n: int) -> None: ... + def rotate(self, n: int = ...) -> None: ... def __len__(self) -> int: ... def __iter__(self) -> Iterator[_T]: ... def __str__(self) -> str: ... @@ -81,7 +93,6 @@ class Counter(Dict[_T, int], Generic[_T]): def update(self, __m: Union[Iterable[_T], Iterable[Tuple[_T, int]]], **kwargs: int) -> None: ... @overload def update(self, **kwargs: int) -> None: ... - def __add__(self, other: Counter[_T]) -> Counter[_T]: ... def __sub__(self, other: Counter[_T]) -> Counter[_T]: ... def __and__(self, other: Counter[_T]) -> Counter[_T]: ... @@ -105,16 +116,14 @@ class defaultdict(Dict[_KT, _VT], Generic[_KT, _VT]): @overload def __init__(self, default_factory: Optional[Callable[[], _VT]], **kwargs: _VT) -> None: ... @overload - def __init__(self, default_factory: Optional[Callable[[], _VT]], - map: Mapping[_KT, _VT]) -> None: ... + def __init__(self, default_factory: Optional[Callable[[], _VT]], map: Mapping[_KT, _VT]) -> None: ... @overload - def __init__(self, default_factory: Optional[Callable[[], _VT]], - map: Mapping[_KT, _VT], **kwargs: _VT) -> None: ... + def __init__(self, default_factory: Optional[Callable[[], _VT]], map: Mapping[_KT, _VT], **kwargs: _VT) -> None: ... @overload - def __init__(self, default_factory: Optional[Callable[[], _VT]], - iterable: Iterable[Tuple[_KT, _VT]]) -> None: ... + def __init__(self, default_factory: Optional[Callable[[], _VT]], iterable: Iterable[Tuple[_KT, _VT]]) -> None: ... @overload - def __init__(self, default_factory: Optional[Callable[[], _VT]], - iterable: Iterable[Tuple[_KT, _VT]], **kwargs: _VT) -> None: ... + def __init__( + self, default_factory: Optional[Callable[[], _VT]], iterable: Iterable[Tuple[_KT, _VT]], **kwargs: _VT + ) -> None: ... def __missing__(self, key: _KT) -> _VT: ... def copy(self: _S) -> _S: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/commands.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/commands.pyi old mode 100755 new mode 100644 index e321f084..970d6ccf --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/commands.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/commands.pyi @@ -1,12 +1,10 @@ -from typing import overload, AnyStr, Text, Tuple +from typing import AnyStr, Text, Tuple, overload def getstatus(file: Text) -> str: ... def getoutput(cmd: Text) -> str: ... def getstatusoutput(cmd: Text) -> Tuple[int, str]: ... - @overload def mk2arg(head: bytes, x: bytes) -> bytes: ... @overload def mk2arg(head: Text, x: Text) -> Text: ... - def mkarg(x: AnyStr) -> AnyStr: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/compileall.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/compileall.pyi old mode 100755 new mode 100644 index 2b7046d8..59680fd7 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/compileall.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/compileall.pyi @@ -1,19 +1,16 @@ -# Stubs for compileall (Python 2) - -from typing import Any, Optional, Pattern, Union - -_Path = Union[str, bytes] +from _typeshed import AnyPath +from typing import Any, Optional, Pattern # rx can be any object with a 'search' method; once we have Protocols we can change the type def compile_dir( - dir: _Path, + dir: AnyPath, maxlevels: int = ..., - ddir: Optional[_Path] = ..., + ddir: Optional[AnyPath] = ..., force: bool = ..., rx: Optional[Pattern[Any]] = ..., quiet: int = ..., ) -> int: ... def compile_file( - fullname: _Path, ddir: Optional[_Path] = ..., force: bool = ..., rx: Optional[Pattern[Any]] = ..., quiet: int = ..., + fullname: AnyPath, ddir: Optional[AnyPath] = ..., force: bool = ..., rx: Optional[Pattern[Any]] = ..., quiet: int = ... ) -> int: ... def compile_path(skip_curdir: bool = ..., maxlevels: int = ..., force: bool = ..., quiet: int = ...) -> int: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/cookielib.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/cookielib.pyi old mode 100755 new mode 100644 index abbf2989..7405ba91 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/cookielib.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/cookielib.pyi @@ -17,8 +17,26 @@ class Cookie: comment: Any comment_url: Any rfc2109: Any - def __init__(self, version, name, value, port, port_specified, domain, domain_specified, domain_initial_dot, path, - path_specified, secure, expires, discard, comment, comment_url, rest, rfc2109: bool = ...): ... + def __init__( + self, + version, + name, + value, + port, + port_specified, + domain, + domain_specified, + domain_initial_dot, + path, + path_specified, + secure, + expires, + discard, + comment, + comment_url, + rest, + rfc2109: bool = ..., + ): ... def has_nonstandard_attr(self, name): ... def get_nonstandard_attr(self, name, default: Optional[Any] = ...): ... def set_nonstandard_attr(self, name, value): ... @@ -46,10 +64,21 @@ class DefaultCookiePolicy(CookiePolicy): strict_ns_domain: Any strict_ns_set_initial_dollar: Any strict_ns_set_path: Any - def __init__(self, blocked_domains: Optional[Any] = ..., allowed_domains: Optional[Any] = ..., netscape: bool = ..., - rfc2965: bool = ..., rfc2109_as_netscape: Optional[Any] = ..., hide_cookie2: bool = ..., - strict_domain: bool = ..., strict_rfc2965_unverifiable: bool = ..., strict_ns_unverifiable: bool = ..., - strict_ns_domain=..., strict_ns_set_initial_dollar: bool = ..., strict_ns_set_path: bool = ...): ... + def __init__( + self, + blocked_domains: Optional[Any] = ..., + allowed_domains: Optional[Any] = ..., + netscape: bool = ..., + rfc2965: bool = ..., + rfc2109_as_netscape: Optional[Any] = ..., + hide_cookie2: bool = ..., + strict_domain: bool = ..., + strict_rfc2965_unverifiable: bool = ..., + strict_ns_unverifiable: bool = ..., + strict_ns_domain=..., + strict_ns_set_initial_dollar: bool = ..., + strict_ns_set_path: bool = ..., + ): ... def blocked_domains(self): ... def set_blocked_domains(self, blocked_domains): ... def is_blocked(self, domain): ... @@ -109,4 +138,5 @@ class LWPCookieJar(FileCookieJar): def as_lwp_str(self, ignore_discard: bool = ..., ignore_expires: bool = ...) -> str: ... # undocumented MozillaCookieJar = FileCookieJar + def lwp_cookie_str(cookie: Cookie) -> str: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/copy_reg.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/copy_reg.pyi old mode 100755 new mode 100644 index a64a82c7..a41f5e41 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/copy_reg.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/copy_reg.pyi @@ -1,13 +1,15 @@ - -from typing import TypeVar, Callable, Union, Tuple, Any, Optional, SupportsInt, Hashable, List - +from typing import Any, Callable, Hashable, List, Optional, SupportsInt, Tuple, TypeVar, Union _Type = TypeVar("_Type", bound=type) _Reduce = Union[Tuple[Callable[..., _Type], Tuple[Any, ...]], Tuple[Callable[..., _Type], Tuple[Any, ...], Optional[Any]]] __all__: List[str] -def pickle(ob_type: _Type, pickle_function: Callable[[_Type], Union[str, _Reduce[_Type]]], constructor_ob: Optional[Callable[[_Reduce[_Type]], _Type]] = ...) -> None: ... +def pickle( + ob_type: _Type, + pickle_function: Callable[[_Type], Union[str, _Reduce[_Type]]], + constructor_ob: Optional[Callable[[_Reduce[_Type]], _Type]] = ..., +) -> None: ... def constructor(object: Callable[[_Reduce[_Type]], _Type]) -> None: ... def add_extension(module: Hashable, name: Hashable, code: SupportsInt) -> None: ... def remove_extension(module: Hashable, name: Hashable, code: int) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/dircache.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/dircache.pyi old mode 100755 new mode 100644 index ac6732b6..fd906f6f --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/dircache.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/dircache.pyi @@ -1,5 +1,3 @@ -# Source: https://hg.python.org/cpython/file/2.7/Lib/dircache.py - from typing import List, MutableSequence, Text, Union def reset() -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/__init__.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/archive_util.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/archive_util.pyi new file mode 100644 index 00000000..0e94d381 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/archive_util.pyi @@ -0,0 +1,12 @@ +from typing import Optional + +def make_archive( + base_name: str, + format: str, + root_dir: Optional[str] = ..., + base_dir: Optional[str] = ..., + verbose: int = ..., + dry_run: int = ..., +) -> str: ... +def make_tarball(base_name: str, base_dir: str, compress: Optional[str] = ..., verbose: int = ..., dry_run: int = ...) -> str: ... +def make_zipfile(base_name: str, base_dir: str, verbose: int = ..., dry_run: int = ...) -> str: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/bcppcompiler.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/bcppcompiler.pyi old mode 100755 new mode 100644 similarity index 67% rename from anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/bcppcompiler.pyi rename to anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/bcppcompiler.pyi index 9f27a0ae..3e432f94 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/bcppcompiler.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/bcppcompiler.pyi @@ -1,6 +1,3 @@ -# Stubs for distutils.bcppcompiler - from distutils.ccompiler import CCompiler - class BCPPCompiler(CCompiler): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/ccompiler.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/ccompiler.pyi new file mode 100644 index 00000000..831311d2 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/ccompiler.pyi @@ -0,0 +1,150 @@ +from typing import Any, Callable, List, Optional, Tuple, Union + +_Macro = Union[Tuple[str], Tuple[str, Optional[str]]] + +def gen_lib_options( + compiler: CCompiler, library_dirs: List[str], runtime_library_dirs: List[str], libraries: List[str] +) -> List[str]: ... +def gen_preprocess_options(macros: List[_Macro], include_dirs: List[str]) -> List[str]: ... +def get_default_compiler(osname: Optional[str] = ..., platform: Optional[str] = ...) -> str: ... +def new_compiler( + plat: Optional[str] = ..., compiler: Optional[str] = ..., verbose: int = ..., dry_run: int = ..., force: int = ... +) -> CCompiler: ... +def show_compilers() -> None: ... + +class CCompiler: + dry_run: bool + force: bool + verbose: bool + output_dir: Optional[str] + macros: List[_Macro] + include_dirs: List[str] + libraries: List[str] + library_dirs: List[str] + runtime_library_dirs: List[str] + objects: List[str] + def __init__(self, verbose: int = ..., dry_run: int = ..., force: int = ...) -> None: ... + def add_include_dir(self, dir: str) -> None: ... + def set_include_dirs(self, dirs: List[str]) -> None: ... + def add_library(self, libname: str) -> None: ... + def set_libraries(self, libnames: List[str]) -> None: ... + def add_library_dir(self, dir: str) -> None: ... + def set_library_dirs(self, dirs: List[str]) -> None: ... + def add_runtime_library_dir(self, dir: str) -> None: ... + def set_runtime_library_dirs(self, dirs: List[str]) -> None: ... + def define_macro(self, name: str, value: Optional[str] = ...) -> None: ... + def undefine_macro(self, name: str) -> None: ... + def add_link_object(self, object: str) -> None: ... + def set_link_objects(self, objects: List[str]) -> None: ... + def detect_language(self, sources: Union[str, List[str]]) -> Optional[str]: ... + def find_library_file(self, dirs: List[str], lib: str, debug: bool = ...) -> Optional[str]: ... + def has_function( + self, + funcname: str, + includes: Optional[List[str]] = ..., + include_dirs: Optional[List[str]] = ..., + libraries: Optional[List[str]] = ..., + library_dirs: Optional[List[str]] = ..., + ) -> bool: ... + def library_dir_option(self, dir: str) -> str: ... + def library_option(self, lib: str) -> str: ... + def runtime_library_dir_option(self, dir: str) -> str: ... + def set_executables(self, **args: str) -> None: ... + def compile( + self, + sources: List[str], + output_dir: Optional[str] = ..., + macros: Optional[_Macro] = ..., + include_dirs: Optional[List[str]] = ..., + debug: bool = ..., + extra_preargs: Optional[List[str]] = ..., + extra_postargs: Optional[List[str]] = ..., + depends: Optional[List[str]] = ..., + ) -> List[str]: ... + def create_static_lib( + self, + objects: List[str], + output_libname: str, + output_dir: Optional[str] = ..., + debug: bool = ..., + target_lang: Optional[str] = ..., + ) -> None: ... + def link( + self, + target_desc: str, + objects: List[str], + output_filename: str, + output_dir: Optional[str] = ..., + libraries: Optional[List[str]] = ..., + library_dirs: Optional[List[str]] = ..., + runtime_library_dirs: Optional[List[str]] = ..., + export_symbols: Optional[List[str]] = ..., + debug: bool = ..., + extra_preargs: Optional[List[str]] = ..., + extra_postargs: Optional[List[str]] = ..., + build_temp: Optional[str] = ..., + target_lang: Optional[str] = ..., + ) -> None: ... + def link_executable( + self, + objects: List[str], + output_progname: str, + output_dir: Optional[str] = ..., + libraries: Optional[List[str]] = ..., + library_dirs: Optional[List[str]] = ..., + runtime_library_dirs: Optional[List[str]] = ..., + debug: bool = ..., + extra_preargs: Optional[List[str]] = ..., + extra_postargs: Optional[List[str]] = ..., + target_lang: Optional[str] = ..., + ) -> None: ... + def link_shared_lib( + self, + objects: List[str], + output_libname: str, + output_dir: Optional[str] = ..., + libraries: Optional[List[str]] = ..., + library_dirs: Optional[List[str]] = ..., + runtime_library_dirs: Optional[List[str]] = ..., + export_symbols: Optional[List[str]] = ..., + debug: bool = ..., + extra_preargs: Optional[List[str]] = ..., + extra_postargs: Optional[List[str]] = ..., + build_temp: Optional[str] = ..., + target_lang: Optional[str] = ..., + ) -> None: ... + def link_shared_object( + self, + objects: List[str], + output_filename: str, + output_dir: Optional[str] = ..., + libraries: Optional[List[str]] = ..., + library_dirs: Optional[List[str]] = ..., + runtime_library_dirs: Optional[List[str]] = ..., + export_symbols: Optional[List[str]] = ..., + debug: bool = ..., + extra_preargs: Optional[List[str]] = ..., + extra_postargs: Optional[List[str]] = ..., + build_temp: Optional[str] = ..., + target_lang: Optional[str] = ..., + ) -> None: ... + def preprocess( + self, + source: str, + output_file: Optional[str] = ..., + macros: Optional[List[_Macro]] = ..., + include_dirs: Optional[List[str]] = ..., + extra_preargs: Optional[List[str]] = ..., + extra_postargs: Optional[List[str]] = ..., + ) -> None: ... + def executable_filename(self, basename: str, strip_dir: int = ..., output_dir: str = ...) -> str: ... + def library_filename(self, libname: str, lib_type: str = ..., strip_dir: int = ..., output_dir: str = ...) -> str: ... + def object_filenames(self, source_filenames: List[str], strip_dir: int = ..., output_dir: str = ...) -> List[str]: ... + def shared_object_filename(self, basename: str, strip_dir: int = ..., output_dir: str = ...) -> str: ... + def execute(self, func: Callable[..., None], args: Tuple[Any, ...], msg: Optional[str] = ..., level: int = ...) -> None: ... + def spawn(self, cmd: List[str]) -> None: ... + def mkpath(self, name: str, mode: int = ...) -> None: ... + def move_file(self, src: str, dst: str) -> str: ... + def announce(self, msg: str, level: int = ...) -> None: ... + def warn(self, msg: str) -> None: ... + def debug_print(self, msg: str) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/cmd.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/cmd.pyi old mode 100755 new mode 100644 similarity index 53% rename from anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/cmd.pyi rename to anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/cmd.pyi index 2ec5a508..b888c189 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/cmd.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/cmd.pyi @@ -1,11 +1,9 @@ -# Stubs for distutils.cmd - -from typing import Callable, List, Tuple, Union, Optional, Iterable, Any, Text from abc import abstractmethod from distutils.dist import Distribution +from typing import Any, Callable, Iterable, List, Optional, Text, Tuple, Union class Command: - sub_commands: List[Tuple[str, Union[Callable[[], bool], str, None]]] + sub_commands: List[Tuple[str, Optional[Callable[[Command], bool]]]] def __init__(self, dist: Distribution) -> None: ... @abstractmethod def initialize_options(self) -> None: ... @@ -13,28 +11,57 @@ class Command: def finalize_options(self) -> None: ... @abstractmethod def run(self) -> None: ... - def announce(self, msg: Text, level: int = ...) -> None: ... def debug_print(self, msg: Text) -> None: ... - def ensure_string(self, option: str, default: Optional[str] = ...) -> None: ... def ensure_string_list(self, option: Union[str, List[str]]) -> None: ... def ensure_filename(self, option: str) -> None: ... def ensure_dirname(self, option: str) -> None: ... - def get_command_name(self) -> str: ... def set_undefined_options(self, src_cmd: Text, *option_pairs: Tuple[str, str]) -> None: ... def get_finalized_command(self, command: Text, create: int = ...) -> Command: ... def reinitialize_command(self, command: Union[Command, Text], reinit_subcommands: int = ...) -> Command: ... def run_command(self, command: Text) -> None: ... def get_sub_commands(self) -> List[str]: ... - def warn(self, msg: Text) -> None: ... def execute(self, func: Callable[..., Any], args: Iterable[Any], msg: Optional[Text] = ..., level: int = ...) -> None: ... def mkpath(self, name: str, mode: int = ...) -> None: ... - def copy_file(self, infile: str, outfile: str, preserve_mode: int = ..., preserve_times: int = ..., link: Optional[str] = ..., level: Any = ...) -> Tuple[str, bool]: ... # level is not used - def copy_tree(self, infile: str, outfile: str, preserve_mode: int = ..., preserve_times: int = ..., preserve_symlinks: int = ..., level: Any = ...) -> List[str]: ... # level is not used - def move_file(self, src: str, dest: str, level: Any = ...) -> str: ... # level is not used + def copy_file( + self, + infile: str, + outfile: str, + preserve_mode: int = ..., + preserve_times: int = ..., + link: Optional[str] = ..., + level: Any = ..., + ) -> Tuple[str, bool]: ... # level is not used + def copy_tree( + self, + infile: str, + outfile: str, + preserve_mode: int = ..., + preserve_times: int = ..., + preserve_symlinks: int = ..., + level: Any = ..., + ) -> List[str]: ... # level is not used + def move_file(self, src: str, dst: str, level: Any = ...) -> str: ... # level is not used def spawn(self, cmd: Iterable[str], search_path: int = ..., level: Any = ...) -> None: ... # level is not used - def make_archive(self, base_name: str, format: str, root_dir: Optional[str] = ..., base_dir: Optional[str] = ..., owner: Optional[str] = ..., group: Optional[str] = ...) -> str: ... - def make_file(self, infiles: Union[str, List[str], Tuple[str]], outfile: str, func: Callable[..., Any], args: List[Any], exec_msg: Optional[str] = ..., skip_msg: Optional[str] = ..., level: Any = ...) -> None: ... # level is not used + def make_archive( + self, + base_name: str, + format: str, + root_dir: Optional[str] = ..., + base_dir: Optional[str] = ..., + owner: Optional[str] = ..., + group: Optional[str] = ..., + ) -> str: ... + def make_file( + self, + infiles: Union[str, List[str], Tuple[str]], + outfile: str, + func: Callable[..., Any], + args: List[Any], + exec_msg: Optional[str] = ..., + skip_msg: Optional[str] = ..., + level: Any = ..., + ) -> None: ... # level is not used diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/Fortuna/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/command/__init__.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/Fortuna/__init__.pyi rename to anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/command/__init__.pyi diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/bdist_rpm.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/command/bdist.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/bdist_rpm.pyi rename to anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/command/bdist.pyi diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/bdist_wininst.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/command/bdist_dumb.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/bdist_wininst.pyi rename to anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/command/bdist_dumb.pyi diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/bdist_msi.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/command/bdist_msi.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/bdist_msi.pyi rename to anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/command/bdist_msi.pyi diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/build.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/command/bdist_packager.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/build.pyi rename to anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/command/bdist_packager.pyi diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/build_clib.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/command/bdist_rpm.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/build_clib.pyi rename to anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/command/bdist_rpm.pyi diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/build_ext.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/command/bdist_wininst.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/build_ext.pyi rename to anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/command/bdist_wininst.pyi diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/build_scripts.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/command/build.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/build_scripts.pyi rename to anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/command/build.pyi diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/check.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/command/build_clib.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/check.pyi rename to anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/command/build_clib.pyi diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/clean.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/command/build_ext.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/clean.pyi rename to anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/command/build_ext.pyi diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/command/build_py.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/command/build_py.pyi new file mode 100644 index 00000000..a29a1f3a --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/command/build_py.pyi @@ -0,0 +1,6 @@ +from distutils.cmd import Command + +class build_py(Command): + def initialize_options(self) -> None: ... + def finalize_options(self) -> None: ... + def run(self) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/config.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/command/build_scripts.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/config.pyi rename to anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/command/build_scripts.pyi diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/install_data.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/command/check.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/install_data.pyi rename to anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/command/check.pyi diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/install_headers.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/command/clean.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/install_headers.pyi rename to anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/command/clean.pyi diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/command/config.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/command/config.pyi new file mode 100644 index 00000000..6b57a64b --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/command/config.pyi @@ -0,0 +1,87 @@ +from distutils import log as log +from distutils.ccompiler import CCompiler +from distutils.core import Command as Command +from distutils.errors import DistutilsExecError as DistutilsExecError +from distutils.sysconfig import customize_compiler as customize_compiler +from typing import Dict, List, Optional, Pattern, Sequence, Tuple, Union + +LANG_EXT: Dict[str, str] + +class config(Command): + description: str = ... + # Tuple is full name, short name, description + user_options: Sequence[Tuple[str, Optional[str], str]] = ... + compiler: Optional[Union[str, CCompiler]] = ... + cc: Optional[str] = ... + include_dirs: Optional[Sequence[str]] = ... + libraries: Optional[Sequence[str]] = ... + library_dirs: Optional[Sequence[str]] = ... + noisy: int = ... + dump_source: int = ... + temp_files: Sequence[str] = ... + def initialize_options(self) -> None: ... + def finalize_options(self) -> None: ... + def run(self) -> None: ... + def try_cpp( + self, + body: Optional[str] = ..., + headers: Optional[Sequence[str]] = ..., + include_dirs: Optional[Sequence[str]] = ..., + lang: str = ..., + ) -> bool: ... + def search_cpp( + self, + pattern: Union[Pattern[str], str], + body: Optional[str] = ..., + headers: Optional[Sequence[str]] = ..., + include_dirs: Optional[Sequence[str]] = ..., + lang: str = ..., + ) -> bool: ... + def try_compile( + self, body: str, headers: Optional[Sequence[str]] = ..., include_dirs: Optional[Sequence[str]] = ..., lang: str = ... + ) -> bool: ... + def try_link( + self, + body: str, + headers: Optional[Sequence[str]] = ..., + include_dirs: Optional[Sequence[str]] = ..., + libraries: Optional[Sequence[str]] = ..., + library_dirs: Optional[Sequence[str]] = ..., + lang: str = ..., + ) -> bool: ... + def try_run( + self, + body: str, + headers: Optional[Sequence[str]] = ..., + include_dirs: Optional[Sequence[str]] = ..., + libraries: Optional[Sequence[str]] = ..., + library_dirs: Optional[Sequence[str]] = ..., + lang: str = ..., + ) -> bool: ... + def check_func( + self, + func: str, + headers: Optional[Sequence[str]] = ..., + include_dirs: Optional[Sequence[str]] = ..., + libraries: Optional[Sequence[str]] = ..., + library_dirs: Optional[Sequence[str]] = ..., + decl: int = ..., + call: int = ..., + ) -> bool: ... + def check_lib( + self, + library: str, + library_dirs: Optional[Sequence[str]] = ..., + headers: Optional[Sequence[str]] = ..., + include_dirs: Optional[Sequence[str]] = ..., + other_libraries: List[str] = ..., + ) -> bool: ... + def check_header( + self, + header: str, + include_dirs: Optional[Sequence[str]] = ..., + library_dirs: Optional[Sequence[str]] = ..., + lang: str = ..., + ) -> bool: ... + +def dump_file(filename: str, head: Optional[str] = ...) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/install.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/command/install.pyi old mode 100755 new mode 100644 similarity index 99% rename from anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/install.pyi rename to anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/command/install.pyi index 94a90082..dc6d96b8 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/install.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/command/install.pyi @@ -1,14 +1,12 @@ from distutils.cmd import Command from typing import Optional, Text - class install(Command): user: bool prefix: Optional[Text] home: Optional[Text] root: Optional[Text] install_lib: Optional[Text] - def initialize_options(self) -> None: ... def finalize_options(self) -> None: ... def run(self) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/install_lib.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/command/install_data.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/install_lib.pyi rename to anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/command/install_data.pyi diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/command/install_egg_info.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/command/install_egg_info.pyi new file mode 100644 index 00000000..80ffb19b --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/command/install_egg_info.pyi @@ -0,0 +1,10 @@ +from distutils.cmd import Command +from typing import ClassVar, List, Optional, Tuple + +class install_egg_info(Command): + description: ClassVar[str] + user_options: ClassVar[List[Tuple[str, Optional[str], str]]] + def initialize_options(self) -> None: ... + def finalize_options(self) -> None: ... + def run(self) -> None: ... + def get_outputs(self) -> List[str]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/install_scripts.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/command/install_headers.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/install_scripts.pyi rename to anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/command/install_headers.pyi diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/register.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/command/install_lib.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/register.pyi rename to anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/command/install_lib.pyi diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/sdist.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/command/install_scripts.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/sdist.pyi rename to anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/command/install_scripts.pyi diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/command/register.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/command/register.pyi new file mode 100644 index 00000000..e69de29b diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/command/sdist.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/command/sdist.pyi new file mode 100644 index 00000000..e69de29b diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/command/upload.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/command/upload.pyi new file mode 100644 index 00000000..c49a4e5b --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/command/upload.pyi @@ -0,0 +1,8 @@ +from distutils.config import PyPIRCCommand +from typing import ClassVar, List, Optional, Tuple + +class upload(PyPIRCCommand): + description: ClassVar[str] + boolean_options: ClassVar[List[str]] + def run(self) -> None: ... + def upload_file(self, command, pyversion, filename) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/config.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/config.pyi new file mode 100644 index 00000000..e60507e0 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/config.pyi @@ -0,0 +1,17 @@ +from abc import abstractmethod +from distutils.cmd import Command +from typing import ClassVar, List, Optional, Tuple + +DEFAULT_PYPIRC: str + +class PyPIRCCommand(Command): + DEFAULT_REPOSITORY: ClassVar[str] + DEFAULT_REALM: ClassVar[str] + repository: None + realm: None + user_options: ClassVar[List[Tuple[str, Optional[str], str]]] + boolean_options: ClassVar[List[str]] + def initialize_options(self) -> None: ... + def finalize_options(self) -> None: ... + @abstractmethod + def run(self) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/core.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/core.pyi new file mode 100644 index 00000000..9a3fa70f --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/core.pyi @@ -0,0 +1,48 @@ +from distutils.cmd import Command as Command +from distutils.dist import Distribution as Distribution +from distutils.extension import Extension as Extension +from typing import Any, List, Mapping, Optional, Tuple, Type, Union + +def setup( + *, + name: str = ..., + version: str = ..., + description: str = ..., + long_description: str = ..., + author: str = ..., + author_email: str = ..., + maintainer: str = ..., + maintainer_email: str = ..., + url: str = ..., + download_url: str = ..., + packages: List[str] = ..., + py_modules: List[str] = ..., + scripts: List[str] = ..., + ext_modules: List[Extension] = ..., + classifiers: List[str] = ..., + distclass: Type[Distribution] = ..., + script_name: str = ..., + script_args: List[str] = ..., + options: Mapping[str, Any] = ..., + license: str = ..., + keywords: Union[List[str], str] = ..., + platforms: Union[List[str], str] = ..., + cmdclass: Mapping[str, Type[Command]] = ..., + data_files: List[Tuple[str, List[str]]] = ..., + package_dir: Mapping[str, str] = ..., + obsoletes: List[str] = ..., + provides: List[str] = ..., + requires: List[str] = ..., + command_packages: List[str] = ..., + command_options: Mapping[str, Mapping[str, Tuple[Any, Any]]] = ..., + package_data: Mapping[str, List[str]] = ..., + include_package_data: bool = ..., + libraries: List[str] = ..., + headers: List[str] = ..., + ext_package: str = ..., + include_dirs: List[str] = ..., + password: str = ..., + fullname: str = ..., + **attrs: Any, +) -> None: ... +def run_setup(script_name: str, script_args: Optional[List[str]] = ..., stop_after: str = ...) -> Distribution: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/cygwinccompiler.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/cygwinccompiler.pyi old mode 100755 new mode 100644 similarity index 77% rename from anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/cygwinccompiler.pyi rename to anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/cygwinccompiler.pyi index 1bfab90e..1f85b254 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/cygwinccompiler.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/cygwinccompiler.pyi @@ -1,7 +1,4 @@ -# Stubs for distutils.cygwinccompiler - from distutils.unixccompiler import UnixCCompiler - class CygwinCCompiler(UnixCCompiler): ... class Mingw32CCompiler(CygwinCCompiler): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/debug.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/debug.pyi new file mode 100644 index 00000000..098dc3de --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/debug.pyi @@ -0,0 +1 @@ +DEBUG: bool diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/dep_util.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/dep_util.pyi old mode 100755 new mode 100644 similarity index 53% rename from anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/dep_util.pyi rename to anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/dep_util.pyi index 7df58478..6f779d54 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/dep_util.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/dep_util.pyi @@ -1,8 +1,5 @@ -# Stubs for distutils.dep_util - from typing import List, Tuple def newer(source: str, target: str) -> bool: ... -def newer_pairwise(sources: List[str], - targets: List[str]) -> List[Tuple[str, str]]: ... +def newer_pairwise(sources: List[str], targets: List[str]) -> List[Tuple[str, str]]: ... def newer_group(sources: List[str], target: str, missing: str = ...) -> bool: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/dir_util.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/dir_util.pyi new file mode 100644 index 00000000..4c4a2210 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/dir_util.pyi @@ -0,0 +1,15 @@ +from typing import List + +def mkpath(name: str, mode: int = ..., verbose: int = ..., dry_run: int = ...) -> List[str]: ... +def create_tree(base_dir: str, files: List[str], mode: int = ..., verbose: int = ..., dry_run: int = ...) -> None: ... +def copy_tree( + src: str, + dst: str, + preserve_mode: int = ..., + preserve_times: int = ..., + preserve_symlinks: int = ..., + update: int = ..., + verbose: int = ..., + dry_run: int = ..., +) -> List[str]: ... +def remove_tree(directory: str, verbose: int = ..., dry_run: int = ...) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/dist.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/dist.pyi old mode 100755 new mode 100644 similarity index 77% rename from anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/dist.pyi rename to anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/dist.pyi index 65e766d1..685423bd --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/dist.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/dist.pyi @@ -1,10 +1,8 @@ -# Stubs for distutils.dist from distutils.cmd import Command - -from typing import Any, Mapping, Optional, Dict, Tuple, Iterable, Text - +from typing import Any, Dict, Iterable, Mapping, Optional, Text, Tuple, Type class Distribution: + cmdclass: Dict[str, Type[Command]] def __init__(self, attrs: Optional[Mapping[str, Any]] = ...) -> None: ... def get_option_dict(self, command: str) -> Dict[str, Tuple[str, Text]]: ... def parse_config_files(self, filenames: Optional[Iterable[Text]] = ...) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/emxccompiler.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/emxccompiler.pyi old mode 100755 new mode 100644 index 97e4a29a..19e4023f --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/emxccompiler.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/emxccompiler.pyi @@ -1,5 +1,3 @@ -# Stubs for emxccompiler - from distutils.unixccompiler import UnixCCompiler class EMXCCompiler(UnixCCompiler): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/errors.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/errors.pyi old mode 100755 new mode 100644 similarity index 100% rename from anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/errors.pyi rename to anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/errors.pyi diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/extension.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/extension.pyi new file mode 100644 index 00000000..02c1f556 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/extension.pyi @@ -0,0 +1,21 @@ +from typing import List, Optional, Tuple + +class Extension: + def __init__( + self, + name: str, + sources: List[str], + include_dirs: List[str] = ..., + define_macros: List[Tuple[str, Optional[str]]] = ..., + undef_macros: List[str] = ..., + library_dirs: List[str] = ..., + libraries: List[str] = ..., + runtime_library_dirs: List[str] = ..., + extra_objects: List[str] = ..., + extra_compile_args: List[str] = ..., + extra_link_args: List[str] = ..., + export_symbols: List[str] = ..., + swig_opts: Optional[str] = ..., # undocumented + depends: List[str] = ..., + language: str = ..., + ) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/fancy_getopt.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/fancy_getopt.pyi old mode 100755 new mode 100644 similarity index 65% rename from anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/fancy_getopt.pyi rename to anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/fancy_getopt.pyi index 4d38a755..8eb4c416 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/fancy_getopt.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/fancy_getopt.pyi @@ -1,17 +1,11 @@ -# Stubs for distutils.fancy_getopt - -from typing import ( - Any, List, Mapping, Optional, Tuple, Union, - TypeVar, overload, -) +from typing import Any, List, Mapping, Optional, Tuple, Union, overload _Option = Tuple[str, Optional[str], str] _GR = Tuple[List[str], OptionDummy] -def fancy_getopt(options: List[_Option], - negative_opt: Mapping[_Option, _Option], - object: Any, - args: Optional[List[str]]) -> Union[List[str], _GR]: ... +def fancy_getopt( + options: List[_Option], negative_opt: Mapping[_Option, _Option], object: Any, args: Optional[List[str]] +) -> Union[List[str], _GR]: ... def wrap_text(text: str, width: int) -> List[str]: ... class FancyGetopt: diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/file_util.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/file_util.pyi new file mode 100644 index 00000000..01833973 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/file_util.pyi @@ -0,0 +1,14 @@ +from typing import Optional, Sequence, Tuple + +def copy_file( + src: str, + dst: str, + preserve_mode: bool = ..., + preserve_times: bool = ..., + update: bool = ..., + link: Optional[str] = ..., + verbose: bool = ..., + dry_run: bool = ..., +) -> Tuple[str, str]: ... +def move_file(src: str, dst: str, verbose: bool = ..., dry_run: bool = ...) -> str: ... +def write_file(filename: str, contents: Sequence[str]) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/filelist.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/filelist.pyi new file mode 100644 index 00000000..8fa55d09 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/filelist.pyi @@ -0,0 +1 @@ +class FileList: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/log.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/log.pyi old mode 100755 new mode 100644 similarity index 63% rename from anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/log.pyi rename to anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/log.pyi index 6c37cc50..668adaab --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/log.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/log.pyi @@ -1,4 +1,4 @@ -from typing import Any, Callable, Iterable, Text +from typing import Any, Text DEBUG: int INFO: int @@ -15,14 +15,11 @@ class Log: def error(self, msg: Text, *args: Any) -> None: ... def fatal(self, msg: Text, *args: Any) -> None: ... -_LogFunc = Callable[[Text, Iterable[Any]], None] - -log: Callable[[int, Text, Iterable[Any]], None] -debug: _LogFunc -info: _LogFunc -warn: _LogFunc -error: _LogFunc -fatal: _LogFunc - +def log(level: int, msg: Text, *args: Any) -> None: ... +def debug(msg: Text, *args: Any) -> None: ... +def info(msg: Text, *args: Any) -> None: ... +def warn(msg: Text, *args: Any) -> None: ... +def error(msg: Text, *args: Any) -> None: ... +def fatal(msg: Text, *args: Any) -> None: ... def set_threshold(level: int) -> int: ... def set_verbosity(v: int) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/msvccompiler.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/msvccompiler.pyi old mode 100755 new mode 100644 similarity index 67% rename from anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/msvccompiler.pyi rename to anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/msvccompiler.pyi index ffc9e449..80872a6b --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/msvccompiler.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/msvccompiler.pyi @@ -1,6 +1,3 @@ -# Stubs for distutils.msvccompiler - from distutils.ccompiler import CCompiler - class MSVCCompiler(CCompiler): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/spawn.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/spawn.pyi new file mode 100644 index 00000000..e12eae99 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/spawn.pyi @@ -0,0 +1,4 @@ +from typing import List, Optional + +def spawn(cmd: List[str], search_path: bool = ..., verbose: bool = ..., dry_run: bool = ...) -> None: ... +def find_executable(executable: str, path: Optional[str] = ...) -> Optional[str]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/sysconfig.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/sysconfig.pyi old mode 100755 new mode 100644 similarity index 69% rename from anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/sysconfig.pyi rename to anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/sysconfig.pyi index 62fa9af8..9061db75 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/sysconfig.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/sysconfig.pyi @@ -1,7 +1,5 @@ -# Stubs for distutils.sysconfig - -from typing import Mapping, Optional, Union from distutils.ccompiler import CCompiler +from typing import Mapping, Optional, Union PREFIX: str EXEC_PREFIX: str @@ -10,10 +8,7 @@ def get_config_var(name: str) -> Union[int, str, None]: ... def get_config_vars(*args: str) -> Mapping[str, Union[int, str]]: ... def get_config_h_filename() -> str: ... def get_makefile_filename() -> str: ... -def get_python_inc(plat_specific: bool = ..., - prefix: Optional[str] = ...) -> str: ... -def get_python_lib(plat_specific: bool = ..., standard_lib: bool = ..., - prefix: Optional[str] = ...) -> str: ... - +def get_python_inc(plat_specific: bool = ..., prefix: Optional[str] = ...) -> str: ... +def get_python_lib(plat_specific: bool = ..., standard_lib: bool = ..., prefix: Optional[str] = ...) -> str: ... def customize_compiler(compiler: CCompiler) -> None: ... def set_python_build() -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/text_file.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/text_file.pyi new file mode 100644 index 00000000..9872a1f2 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/text_file.pyi @@ -0,0 +1,21 @@ +from typing import IO, List, Optional, Tuple, Union + +class TextFile: + def __init__( + self, + filename: Optional[str] = ..., + file: Optional[IO[str]] = ..., + *, + strip_comments: bool = ..., + lstrip_ws: bool = ..., + rstrip_ws: bool = ..., + skip_blanks: bool = ..., + join_lines: bool = ..., + collapse_join: bool = ..., + ) -> None: ... + def open(self, filename: str) -> None: ... + def close(self) -> None: ... + def warn(self, msg: str, line: Union[List[int], Tuple[int, int], int] = ...) -> None: ... + def readline(self) -> Optional[str]: ... + def readlines(self) -> List[str]: ... + def unreadline(self, line: str) -> str: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/unixccompiler.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/unixccompiler.pyi old mode 100755 new mode 100644 similarity index 67% rename from anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/unixccompiler.pyi rename to anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/unixccompiler.pyi index 7ab7298b..e1d44347 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/unixccompiler.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/unixccompiler.pyi @@ -1,6 +1,3 @@ -# Stubs for distutils.unixccompiler - from distutils.ccompiler import CCompiler - class UnixCCompiler(CCompiler): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/util.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/util.pyi new file mode 100644 index 00000000..0086d726 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/util.pyi @@ -0,0 +1,23 @@ +from typing import Any, Callable, List, Mapping, Optional, Tuple + +def get_platform() -> str: ... +def convert_path(pathname: str) -> str: ... +def change_root(new_root: str, pathname: str) -> str: ... +def check_environ() -> None: ... +def subst_vars(s: str, local_vars: Mapping[str, str]) -> None: ... +def split_quoted(s: str) -> List[str]: ... +def execute( + func: Callable[..., None], args: Tuple[Any, ...], msg: Optional[str] = ..., verbose: bool = ..., dry_run: bool = ... +) -> None: ... +def strtobool(val: str) -> bool: ... +def byte_compile( + py_files: List[str], + optimize: int = ..., + force: bool = ..., + prefix: Optional[str] = ..., + base_dir: Optional[str] = ..., + verbose: bool = ..., + dry_run: bool = ..., + direct: Optional[bool] = ..., +) -> None: ... +def rfc822_escape(header: str) -> str: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/version.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/version.pyi new file mode 100644 index 00000000..f55d01d1 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/distutils/version.pyi @@ -0,0 +1,33 @@ +from abc import abstractmethod +from typing import Optional, Pattern, Text, Tuple, TypeVar, Union + +_T = TypeVar("_T", bound=Version) + +class Version: + def __repr__(self) -> str: ... + @abstractmethod + def __init__(self, vstring: Optional[Text] = ...) -> None: ... + @abstractmethod + def parse(self: _T, vstring: Text) -> _T: ... + @abstractmethod + def __str__(self) -> str: ... + @abstractmethod + def __cmp__(self: _T, other: Union[_T, str]) -> bool: ... + +class StrictVersion(Version): + version_re: Pattern[str] + version: Tuple[int, int, int] + prerelease: Optional[Tuple[Text, int]] + def __init__(self, vstring: Optional[Text] = ...) -> None: ... + def parse(self: _T, vstring: Text) -> _T: ... + def __str__(self) -> str: ... + def __cmp__(self: _T, other: Union[_T, str]) -> bool: ... + +class LooseVersion(Version): + component_re: Pattern[str] + vstring: Text + version: Tuple[Union[Text, int], ...] + def __init__(self, vstring: Optional[Text] = ...) -> None: ... + def parse(self: _T, vstring: Text) -> _T: ... + def __str__(self) -> str: ... + def __cmp__(self: _T, other: Union[_T, str]) -> bool: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/dummy_thread.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/dummy_thread.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/MIMEText.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/MIMEText.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/__init__.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/_parseaddr.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/_parseaddr.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/base64mime.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/base64mime.pyi old mode 100755 new mode 100644 index f05003b8..fc655297 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/base64mime.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/base64mime.pyi @@ -1,8 +1,11 @@ def base64_len(s: bytes) -> int: ... def header_encode(header, charset=..., keep_eols=..., maxlinelen=..., eol=...): ... def encode(s, binary=..., maxlinelen=..., eol=...): ... + body_encode = encode encodestring = encode + def decode(s, convert_eols=...): ... + body_decode = decode decodestring = decode diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/charset.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/charset.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/encoders.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/encoders.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/feedparser.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/feedparser.pyi old mode 100755 new mode 100644 index 51f82593..fb2aa9f5 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/feedparser.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/feedparser.pyi @@ -11,7 +11,6 @@ class BufferedSubFile: def __iter__(self): ... def next(self): ... - class FeedParser: def __init__(self, _factory=...) -> None: ... def feed(self, data) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/generator.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/generator.pyi old mode 100755 new mode 100644 index 96cfe2d2..a5f5983b --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/generator.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/generator.pyi @@ -4,6 +4,5 @@ class Generator: def flatten(self, msg, unixfrom: bool = ...) -> None: ... def clone(self, fp): ... - class DecodedGenerator(Generator): def __init__(self, outfp, mangle_from_: bool = ..., maxheaderlen: int = ..., fmt=...) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/header.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/header.pyi old mode 100755 new mode 100644 index 69c93630..429ee16d --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/header.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/header.pyi @@ -2,8 +2,7 @@ def decode_header(header): ... def make_header(decoded_seq, maxlinelen=..., header_name=..., continuation_ws=...): ... class Header: - def __init__(self, s=..., charset=..., maxlinelen=..., header_name=..., continuation_ws=..., - errors=...) -> None: ... + def __init__(self, s=..., charset=..., maxlinelen=..., header_name=..., continuation_ws=..., errors=...) -> None: ... def __unicode__(self): ... def __eq__(self, other): ... def __ne__(self, other): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/iterators.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/iterators.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/message.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/message.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/mime/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/mime/__init__.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/mime/application.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/mime/application.pyi old mode 100755 new mode 100644 index 99da6728..4245e3e0 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/mime/application.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/mime/application.pyi @@ -1,11 +1,9 @@ -# Stubs for email.mime.application - -from typing import Callable, Optional, Tuple, Union from email.mime.nonmultipart import MIMENonMultipart +from typing import Callable, Optional, Tuple, Union _ParamsType = Union[str, None, Tuple[str, Optional[str], str]] class MIMEApplication(MIMENonMultipart): - def __init__(self, _data: bytes, _subtype: str = ..., - _encoder: Callable[[MIMEApplication], None] = ..., - **_params: _ParamsType) -> None: ... + def __init__( + self, _data: bytes, _subtype: str = ..., _encoder: Callable[[MIMEApplication], None] = ..., **_params: _ParamsType + ) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/mime/audio.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/mime/audio.pyi old mode 100755 new mode 100644 index 406ade11..5f11f8d7 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/mime/audio.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/mime/audio.pyi @@ -1,5 +1,4 @@ from email.mime.nonmultipart import MIMENonMultipart - class MIMEAudio(MIMENonMultipart): def __init__(self, _audiodata, _subtype=..., _encoder=..., **_params) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/mime/base.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/mime/base.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/mime/image.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/mime/image.pyi old mode 100755 new mode 100644 index 2dfb098b..3fe8249d --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/mime/image.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/mime/image.pyi @@ -1,5 +1,4 @@ from email.mime.nonmultipart import MIMENonMultipart - class MIMEImage(MIMENonMultipart): def __init__(self, _imagedata, _subtype=..., _encoder=..., **_params) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/mime/message.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/mime/message.pyi old mode 100755 new mode 100644 index 33552faf..9d6fafa2 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/mime/message.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/mime/message.pyi @@ -1,5 +1,4 @@ from email.mime.nonmultipart import MIMENonMultipart - class MIMEMessage(MIMENonMultipart): def __init__(self, _msg, _subtype=...) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/mime/multipart.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/mime/multipart.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/mime/nonmultipart.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/mime/nonmultipart.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/mime/text.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/mime/text.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/parser.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/parser.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/quoprimime.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/quoprimime.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/utils.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/utils.pyi old mode 100755 new mode 100644 index 7b868efc..257e4b1c --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/utils.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/email/utils.pyi @@ -1,9 +1,11 @@ -from email._parseaddr import AddressList as _AddressList -from email._parseaddr import mktime_tz as mktime_tz -from email._parseaddr import parsedate as _parsedate -from email._parseaddr import parsedate_tz as _parsedate_tz +from email._parseaddr import ( + AddressList as _AddressList, + mktime_tz as mktime_tz, + parsedate as _parsedate, + parsedate_tz as _parsedate_tz, +) from quopri import decodestring as _qdecode -from typing import Optional, Any +from typing import Any, Optional def formataddr(pair): ... def getaddresses(fieldvalues): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/encodings/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/encodings/__init__.pyi old mode 100755 new mode 100644 index 2ae6c0a9..d6f4389b --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/encodings/__init__.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/encodings/__init__.pyi @@ -1,6 +1,7 @@ import codecs +from typing import Any -import typing +def search_function(encoding: str) -> codecs.CodecInfo: ... -def search_function(encoding: str) -> codecs.CodecInfo: - ... +# Explicitly mark this package as incomplete. +def __getattr__(name: str) -> Any: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/encodings/utf_8.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/encodings/utf_8.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/exceptions.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/exceptions.pyi old mode 100755 new mode 100644 index 6e4bafc9..fbad8975 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/exceptions.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/exceptions.pyi @@ -1,48 +1,50 @@ -from __builtin__ import ArithmeticError as ArithmeticError -from __builtin__ import AssertionError as AssertionError -from __builtin__ import AttributeError as AttributeError -from __builtin__ import BaseException as BaseException -from __builtin__ import BufferError as BufferError -from __builtin__ import BytesWarning as BytesWarning -from __builtin__ import DeprecationWarning as DeprecationWarning -from __builtin__ import EOFError as EOFError -from __builtin__ import EnvironmentError as EnvironmentError -from __builtin__ import Exception as Exception -from __builtin__ import FloatingPointError as FloatingPointError -from __builtin__ import FutureWarning as FutureWarning -from __builtin__ import GeneratorExit as GeneratorExit -from __builtin__ import IOError as IOError -from __builtin__ import ImportError as ImportError -from __builtin__ import ImportWarning as ImportWarning -from __builtin__ import IndentationError as IndentationError -from __builtin__ import IndexError as IndexError -from __builtin__ import KeyError as KeyError -from __builtin__ import KeyboardInterrupt as KeyboardInterrupt -from __builtin__ import LookupError as LookupError -from __builtin__ import MemoryError as MemoryError -from __builtin__ import NameError as NameError -from __builtin__ import NotImplementedError as NotImplementedError -from __builtin__ import OSError as OSError -from __builtin__ import OverflowError as OverflowError -from __builtin__ import PendingDeprecationWarning as PendingDeprecationWarning -from __builtin__ import ReferenceError as ReferenceError -from __builtin__ import RuntimeError as RuntimeError -from __builtin__ import RuntimeWarning as RuntimeWarning -from __builtin__ import StandardError as StandardError -from __builtin__ import StopIteration as StopIteration -from __builtin__ import SyntaxError as SyntaxError -from __builtin__ import SyntaxWarning as SyntaxWarning -from __builtin__ import SystemError as SystemError -from __builtin__ import SystemExit as SystemExit -from __builtin__ import TabError as TabError -from __builtin__ import TypeError as TypeError -from __builtin__ import UnboundLocalError as UnboundLocalError -from __builtin__ import UnicodeError as UnicodeError -from __builtin__ import UnicodeDecodeError as UnicodeDecodeError -from __builtin__ import UnicodeEncodeError as UnicodeEncodeError -from __builtin__ import UnicodeTranslateError as UnicodeTranslateError -from __builtin__ import UnicodeWarning as UnicodeWarning -from __builtin__ import UserWarning as UserWarning -from __builtin__ import ValueError as ValueError -from __builtin__ import Warning as Warning -from __builtin__ import ZeroDivisionError as ZeroDivisionError +from __builtin__ import ( + ArithmeticError as ArithmeticError, + AssertionError as AssertionError, + AttributeError as AttributeError, + BaseException as BaseException, + BufferError as BufferError, + BytesWarning as BytesWarning, + DeprecationWarning as DeprecationWarning, + EnvironmentError as EnvironmentError, + EOFError as EOFError, + Exception as Exception, + FloatingPointError as FloatingPointError, + FutureWarning as FutureWarning, + GeneratorExit as GeneratorExit, + ImportError as ImportError, + ImportWarning as ImportWarning, + IndentationError as IndentationError, + IndexError as IndexError, + IOError as IOError, + KeyboardInterrupt as KeyboardInterrupt, + KeyError as KeyError, + LookupError as LookupError, + MemoryError as MemoryError, + NameError as NameError, + NotImplementedError as NotImplementedError, + OSError as OSError, + OverflowError as OverflowError, + PendingDeprecationWarning as PendingDeprecationWarning, + ReferenceError as ReferenceError, + RuntimeError as RuntimeError, + RuntimeWarning as RuntimeWarning, + StandardError as StandardError, + StopIteration as StopIteration, + SyntaxError as SyntaxError, + SyntaxWarning as SyntaxWarning, + SystemError as SystemError, + SystemExit as SystemExit, + TabError as TabError, + TypeError as TypeError, + UnboundLocalError as UnboundLocalError, + UnicodeDecodeError as UnicodeDecodeError, + UnicodeEncodeError as UnicodeEncodeError, + UnicodeError as UnicodeError, + UnicodeTranslateError as UnicodeTranslateError, + UnicodeWarning as UnicodeWarning, + UserWarning as UserWarning, + ValueError as ValueError, + Warning as Warning, + ZeroDivisionError as ZeroDivisionError, +) diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/fcntl.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/fcntl.pyi old mode 100755 new mode 100644 index 5ba64ae8..200e2249 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/fcntl.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/fcntl.pyi @@ -1,5 +1,5 @@ -from typing import Any, Union, IO -import io +from _typeshed import FileDescriptorLike +from typing import Any, Union FASYNC: int FD_CLOEXEC: int @@ -72,16 +72,11 @@ LOCK_SH: int LOCK_UN: int LOCK_WRITE: int -_ANYFILE = Union[int, IO] - # TODO All these return either int or bytes depending on the value of # cmd (not on the type of arg). -def fcntl(fd: _ANYFILE, op: int, arg: Union[int, bytes] = ...) -> Any: ... +def fcntl(fd: FileDescriptorLike, op: int, arg: Union[int, bytes] = ...) -> Any: ... # TODO: arg: int or read-only buffer interface or read-write buffer interface -def ioctl(fd: _ANYFILE, op: int, arg: Union[int, bytes] = ..., - mutate_flag: bool = ...) -> Any: ... - -def flock(fd: _ANYFILE, op: int) -> None: ... -def lockf(fd: _ANYFILE, op: int, length: int = ..., start: int = ..., - whence: int = ...) -> Any: ... +def ioctl(fd: FileDescriptorLike, op: int, arg: Union[int, bytes] = ..., mutate_flag: bool = ...) -> Any: ... +def flock(fd: FileDescriptorLike, op: int) -> None: ... +def lockf(fd: FileDescriptorLike, op: int, length: int = ..., start: int = ..., whence: int = ...) -> Any: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/fnmatch.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/fnmatch.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/functools.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/functools.pyi old mode 100755 new mode 100644 index dc812962..1231dd13 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/functools.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/functools.pyi @@ -1,28 +1,25 @@ -# Stubs for functools (Python 2.7) - -# NOTE: These are incomplete! - from abc import ABCMeta, abstractmethod -from typing import Any, Callable, Generic, Dict, Iterable, Optional, Sequence, Tuple, TypeVar, overload +from typing import Any, Callable, Dict, Generic, Iterable, Optional, Sequence, Tuple, Type, TypeVar, overload _AnyCallable = Callable[..., Any] _T = TypeVar("_T") _S = TypeVar("_S") @overload -def reduce(function: Callable[[_T, _T], _T], - sequence: Iterable[_T]) -> _T: ... +def reduce(function: Callable[[_T, _T], _T], sequence: Iterable[_T]) -> _T: ... @overload -def reduce(function: Callable[[_T, _S], _T], - sequence: Iterable[_S], initial: _T) -> _T: ... +def reduce(function: Callable[[_T, _S], _T], sequence: Iterable[_S], initial: _T) -> _T: ... WRAPPER_ASSIGNMENTS: Sequence[str] WRAPPER_UPDATES: Sequence[str] -def update_wrapper(wrapper: _AnyCallable, wrapped: _AnyCallable, assigned: Sequence[str] = ..., - updated: Sequence[str] = ...) -> _AnyCallable: ... -def wraps(wrapped: _AnyCallable, assigned: Sequence[str] = ..., updated: Sequence[str] = ...) -> Callable[[_AnyCallable], _AnyCallable]: ... -def total_ordering(cls: type) -> type: ... +def update_wrapper( + wrapper: _AnyCallable, wrapped: _AnyCallable, assigned: Sequence[str] = ..., updated: Sequence[str] = ... +) -> _AnyCallable: ... +def wraps( + wrapped: _AnyCallable, assigned: Sequence[str] = ..., updated: Sequence[str] = ... +) -> Callable[[_AnyCallable], _AnyCallable]: ... +def total_ordering(cls: Type[_T]) -> Type[_T]: ... def cmp_to_key(mycmp: Callable[[_T, _T], int]) -> Callable[[_T], Any]: ... class partial(Generic[_T]): diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/future_builtins.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/future_builtins.pyi old mode 100755 new mode 100644 index a9b25b2f..2a06c73c --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/future_builtins.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/future_builtins.pyi @@ -1,14 +1,10 @@ +from itertools import ifilter, imap, izip from typing import Any -from itertools import ifilter as filter -from itertools import imap as map -from itertools import izip as zip - +filter = ifilter +map = imap +zip = izip def ascii(obj: Any) -> str: ... - - def hex(x: int) -> str: ... - - def oct(x: int) -> str: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/gc.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/gc.pyi old mode 100755 new mode 100644 index cdfae749..b1fb1acc --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/gc.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/gc.pyi @@ -1,8 +1,5 @@ -# Stubs for gc - from typing import Any, List, Tuple - def enable() -> None: ... def disable() -> None: ... def isenabled() -> bool: ... @@ -10,8 +7,7 @@ def collect(generation: int = ...) -> int: ... def set_debug(flags: int) -> None: ... def get_debug() -> int: ... def get_objects() -> List[Any]: ... -def set_threshold(threshold0: int, threshold1: int = ..., - threshold2: int = ...) -> None: ... +def set_threshold(threshold0: int, threshold1: int = ..., threshold2: int = ...) -> None: ... def get_count() -> Tuple[int, int, int]: ... def get_threshold() -> Tuple[int, int, int]: ... def get_referrers(*objs: Any) -> List[Any]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/getopt.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/getopt.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/getpass.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/getpass.pyi old mode 100755 new mode 100644 index 011fc8e7..784eb1a1 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/getpass.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/getpass.pyi @@ -1,6 +1,4 @@ -# Stubs for getpass (Python 2) - -from typing import Any, IO +from typing import IO, Any class GetPassWarning(UserWarning): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/gettext.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/gettext.pyi old mode 100755 new mode 100644 index c7bfceb7..0930fe63 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/gettext.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/gettext.pyi @@ -1,4 +1,4 @@ -from typing import Any, Container, Dict, IO, List, Optional, Sequence, Type, Union +from typing import IO, Any, Container, Dict, List, Optional, Sequence, Type, Union def bindtextdomain(domain: str, localedir: str = ...) -> str: ... def bind_textdomain_codeset(domain: str, codeset: str = ...) -> str: ... @@ -32,10 +32,17 @@ class GNUTranslations(NullTranslations): LE_MAGIC: int BE_MAGIC: int -def find(domain: str, localedir: Optional[str] = ..., languages: Optional[Sequence[str]] = ..., - all: Any = ...) -> Optional[Union[str, List[str]]]: ... - -def translation(domain: str, localedir: Optional[str] = ..., languages: Optional[Sequence[str]] = ..., - class_: Optional[Type[NullTranslations]] = ..., fallback: bool = ..., codeset: Optional[str] = ...) -> NullTranslations: ... -def install(domain: str, localedir: Optional[str] = ..., unicode: bool = ..., codeset: Optional[str] = ..., - names: Container[str] = ...) -> None: ... +def find( + domain: str, localedir: Optional[str] = ..., languages: Optional[Sequence[str]] = ..., all: Any = ... +) -> Optional[Union[str, List[str]]]: ... +def translation( + domain: str, + localedir: Optional[str] = ..., + languages: Optional[Sequence[str]] = ..., + class_: Optional[Type[NullTranslations]] = ..., + fallback: bool = ..., + codeset: Optional[str] = ..., +) -> NullTranslations: ... +def install( + domain: str, localedir: Optional[str] = ..., unicode: bool = ..., codeset: Optional[str] = ..., names: Container[str] = ... +) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/glob.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/glob.pyi old mode 100755 new mode 100644 index 5caa166f..2804d74a --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/glob.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/glob.pyi @@ -1,4 +1,4 @@ -from typing import List, Iterator, Union, AnyStr +from typing import AnyStr, Iterator, List, Union def glob(pathname: AnyStr) -> List[AnyStr]: ... def iglob(pathname: AnyStr) -> Iterator[AnyStr]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/gzip.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/gzip.pyi old mode 100755 new mode 100644 index 50c38e42..f5c5af9c --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/gzip.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/gzip.pyi @@ -1,5 +1,5 @@ -from typing import Any, IO, Text import io +from typing import IO, Any, Text class GzipFile(io.BufferedIOBase): myfileobj: Any @@ -14,8 +14,9 @@ class GzipFile(io.BufferedIOBase): fileobj: Any offset: Any mtime: Any - def __init__(self, filename: str = ..., mode: Text = ..., compresslevel: int = ..., - fileobj: IO[str] = ..., mtime: float = ...) -> None: ... + def __init__( + self, filename: str = ..., mode: Text = ..., compresslevel: int = ..., fileobj: IO[str] = ..., mtime: float = ... + ) -> None: ... @property def filename(self): ... size: Any diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/hashlib.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/hashlib.pyi old mode 100755 new mode 100644 index 70423742..842804b4 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/hashlib.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/hashlib.pyi @@ -1,5 +1,3 @@ -# Stubs for hashlib (Python 2) - from typing import Tuple, Union _DataType = Union[str, unicode, bytearray, buffer, memoryview] @@ -16,7 +14,6 @@ class _hash(object): # This is not actually in the module namespace. def copy(self) -> _hash: ... def new(name: str, data: str = ...) -> _hash: ... - def md5(s: _DataType = ...) -> _hash: ... def sha1(s: _DataType = ...) -> _hash: ... def sha224(s: _DataType = ...) -> _hash: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/heapq.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/heapq.pyi old mode 100755 new mode 100644 index 0e706c5f..d6da32d7 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/heapq.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/heapq.pyi @@ -1,9 +1,7 @@ -from typing import TypeVar, List, Iterable, Any, Callable, Optional, Protocol +from _typeshed import SupportsLessThan +from typing import Any, Callable, Iterable, List, Optional, Protocol, TypeVar -_T = TypeVar('_T') - -class _Sortable(Protocol): - def __lt__(self: _T, other: _T) -> bool: ... +_T = TypeVar("_T") def cmp_lt(x, y) -> bool: ... def heappush(heap: List[_T], item: _T) -> None: ... @@ -12,7 +10,6 @@ def heappushpop(heap: List[_T], item: _T) -> _T: ... def heapify(x: List[_T]) -> None: ... def heapreplace(heap: List[_T], item: _T) -> _T: ... def merge(*iterables: Iterable[_T]) -> Iterable[_T]: ... -def nlargest(n: int, iterable: Iterable[_T], - key: Optional[Callable[[_T], _Sortable]] = ...) -> List[_T]: ... -def nsmallest(n: int, iterable: Iterable[_T], - key: Optional[Callable[[_T], _Sortable]] = ...) -> List[_T]: ... +def nlargest(n: int, iterable: Iterable[_T], key: Optional[Callable[[_T], SupportsLessThan]] = ...) -> List[_T]: ... +def nsmallest(n: int, iterable: Iterable[_T], key: Optional[Callable[[_T], SupportsLessThan]] = ...) -> List[_T]: ... +def _heapify_max(__x: List[_T]) -> None: ... # undocumented diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/htmlentitydefs.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/htmlentitydefs.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/httplib.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/httplib.pyi old mode 100755 new mode 100644 index 4e3843c1..59dc658f --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/httplib.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/httplib.pyi @@ -1,11 +1,6 @@ -# Stubs for httplib (Python 2) -# -# Generated by stubgen and manually massaged a bit. -# Needs lots more work! - -from typing import Any, Dict, Optional, Protocol import mimetools import ssl +from typing import Any, Dict, Optional, Protocol class HTTPMessage(mimetools.Message): def addcontinue(self, key: str, more: str) -> None: ... @@ -29,8 +24,9 @@ class HTTPResponse: chunk_left: Any length: Any will_close: Any - def __init__(self, sock, debuglevel: int = ..., strict: int = ..., method: Optional[Any] = ..., - buffering: bool = ...) -> None: ... + def __init__( + self, sock, debuglevel: int = ..., strict: int = ..., method: Optional[Any] = ..., buffering: bool = ... + ) -> None: ... def begin(self): ... def close(self): ... def isclosed(self): ... @@ -59,8 +55,9 @@ class HTTPConnection: sock: Any host: str = ... port: int = ... - def __init__(self, host, port: Optional[Any] = ..., strict: Optional[Any] = ..., timeout=..., - source_address: Optional[Any] = ...) -> None: ... + def __init__( + self, host, port: Optional[Any] = ..., strict: Optional[Any] = ..., timeout=..., source_address: Optional[Any] = ... + ) -> None: ... def set_tunnel(self, host, port: Optional[Any] = ..., headers: Optional[Any] = ...): ... def set_debuglevel(self, level): ... def connect(self): ... @@ -86,16 +83,32 @@ class HTTPSConnection(HTTPConnection): default_port: Any key_file: Any cert_file: Any - def __init__(self, host, port: Optional[Any] = ..., key_file: Optional[Any] = ..., cert_file: Optional[Any] = ..., - strict: Optional[Any] = ..., timeout=..., source_address: Optional[Any] = ..., - context: Optional[Any] = ...) -> None: ... + def __init__( + self, + host, + port: Optional[Any] = ..., + key_file: Optional[Any] = ..., + cert_file: Optional[Any] = ..., + strict: Optional[Any] = ..., + timeout=..., + source_address: Optional[Any] = ..., + context: Optional[Any] = ..., + ) -> None: ... sock: Any def connect(self): ... class HTTPS(HTTP): key_file: Any cert_file: Any - def __init__(self, host: str = ..., port: Optional[Any] = ..., key_file: Optional[Any] = ..., cert_file: Optional[Any] = ..., strict: Optional[Any] = ..., context: Optional[Any] = ...) -> None: ... + def __init__( + self, + host: str = ..., + port: Optional[Any] = ..., + key_file: Optional[Any] = ..., + cert_file: Optional[Any] = ..., + strict: Optional[Any] = ..., + context: Optional[Any] = ..., + ) -> None: ... class HTTPException(Exception): ... class NotConnected(HTTPException): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/imp.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/imp.pyi old mode 100755 new mode 100644 index 8ff9e1ae..3cd37648 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/imp.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/imp.pyi @@ -1,7 +1,5 @@ -"""Stubs for the 'imp' module.""" - -from typing import List, Optional, Tuple, Iterable, IO, Any import types +from typing import IO, Any, Iterable, List, Optional, Tuple C_BUILTIN: int C_EXTENSION: int diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/importlib.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/importlib.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/inspect.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/inspect.pyi old mode 100755 new mode 100644 index c5ed0ca7..8e95a92c --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/inspect.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/inspect.pyi @@ -1,5 +1,5 @@ -from types import CodeType, TracebackType, FrameType, FunctionType, MethodType, ModuleType -from typing import Any, Dict, Callable, List, NamedTuple, Optional, Sequence, Tuple, Type, Union +from types import CodeType, FrameType, FunctionType, MethodType, ModuleType, TracebackType +from typing import Any, AnyStr, Callable, Dict, List, NamedTuple, Optional, Sequence, Tuple, Type, Union # Types and members class EndOfBlock(Exception): ... @@ -10,8 +10,9 @@ class BlockFinder: started: bool passline: bool last: int - def tokeneater(self, type: int, token: str, srow_scol: Tuple[int, int], - erow_ecol: Tuple[int, int], line: str) -> None: ... + def tokeneater( + self, type: int, token: AnyStr, srow_scol: Tuple[int, int], erow_ecol: Tuple[int, int], line: AnyStr + ) -> None: ... CO_GENERATOR: int CO_NESTED: int @@ -28,13 +29,9 @@ class ModuleInfo(NamedTuple): mode: str module_type: int -def getmembers( - object: object, - predicate: Optional[Callable[[Any], bool]] = ... -) -> List[Tuple[str, Any]]: ... -def getmoduleinfo(path: str) -> Optional[ModuleInfo]: ... -def getmodulename(path: str) -> Optional[str]: ... - +def getmembers(object: object, predicate: Optional[Callable[[Any], bool]] = ...) -> List[Tuple[str, Any]]: ... +def getmoduleinfo(path: Union[str, unicode]) -> Optional[ModuleInfo]: ... +def getmodulename(path: AnyStr) -> Optional[AnyStr]: ... def ismodule(object: object) -> bool: ... def isclass(object: object) -> bool: ... def ismethod(object: object) -> bool: ... @@ -57,7 +54,7 @@ _SourceObjectType = Union[ModuleType, Type[Any], MethodType, FunctionType, Trace def findsource(object: _SourceObjectType) -> Tuple[List[str], int]: ... def getabsfile(object: _SourceObjectType) -> str: ... -def getblock(lines: Sequence[str]) -> Sequence[str]: ... +def getblock(lines: Sequence[AnyStr]) -> Sequence[AnyStr]: ... def getdoc(object: object) -> Optional[str]: ... def getcomments(object: object) -> Optional[str]: ... def getfile(object: _SourceObjectType) -> str: ... @@ -65,8 +62,8 @@ def getmodule(object: object) -> Optional[ModuleType]: ... def getsourcefile(object: _SourceObjectType) -> Optional[str]: ... def getsourcelines(object: _SourceObjectType) -> Tuple[List[str], int]: ... def getsource(object: _SourceObjectType) -> str: ... -def cleandoc(doc: str) -> str: ... -def indentsize(line: str) -> int: ... +def cleandoc(doc: AnyStr) -> AnyStr: ... +def indentsize(line: Union[str, unicode]) -> int: ... # Classes and functions def getclasstree(classes: List[type], unique: bool = ...) -> List[Union[Tuple[type, Tuple[type, ...]], List[Any]]]: ... @@ -91,12 +88,12 @@ class Arguments(NamedTuple): def getargs(co: CodeType) -> Arguments: ... def getargspec(func: object) -> ArgSpec: ... def getargvalues(frame: FrameType) -> ArgInfo: ... -def formatargspec(args, varargs=..., varkw=..., defaults=..., - formatarg=..., formatvarargs=..., formatvarkw=..., formatvalue=..., - join=...) -> str: ... -def formatargvalues(args, varargs=..., varkw=..., defaults=..., - formatarg=..., formatvarargs=..., formatvarkw=..., formatvalue=..., - join=...) -> str: ... +def formatargspec( + args, varargs=..., varkw=..., defaults=..., formatarg=..., formatvarargs=..., formatvarkw=..., formatvalue=..., join=... +) -> str: ... +def formatargvalues( + args, varargs=..., varkw=..., defaults=..., formatarg=..., formatvarargs=..., formatvarkw=..., formatvalue=..., join=... +) -> str: ... def getmro(cls: type) -> Tuple[type, ...]: ... def getcallargs(func, *args, **kwds) -> Dict[str, Any]: ... @@ -115,15 +112,18 @@ def getouterframes(frame: FrameType, context: int = ...) -> List[_FrameInfo]: .. def getframeinfo(frame: Union[FrameType, TracebackType], context: int = ...) -> Traceback: ... def getinnerframes(traceback: TracebackType, context: int = ...) -> List[_FrameInfo]: ... def getlineno(frame: FrameType) -> int: ... - def currentframe(depth: int = ...) -> FrameType: ... def stack(context: int = ...) -> List[_FrameInfo]: ... def trace(context: int = ...) -> List[_FrameInfo]: ... +# Create private type alias to avoid conflict with symbol of same +# name created in Attribute class. +_Object = object + class Attribute(NamedTuple): name: str kind: str defining_class: type - object: object + object: _Object def classify_class_attrs(cls: type) -> List[Attribute]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/io.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/io.pyi old mode 100755 new mode 100644 index 1ab6b906..1e29cc67 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/io.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/io.pyi @@ -1,40 +1,38 @@ -# Stubs for io +from typing import IO, Any, Union -# Based on https://docs.python.org/2/library/io.html - -# Only a subset of functionality is included. - -from typing import List, BinaryIO, TextIO, IO, overload, Iterator, Iterable, Any, Union, Optional import _io - -from _io import BlockingIOError as BlockingIOError -from _io import BufferedRWPair as BufferedRWPair -from _io import BufferedRandom as BufferedRandom -from _io import BufferedReader as BufferedReader -from _io import BufferedWriter as BufferedWriter -from _io import BytesIO as BytesIO -from _io import DEFAULT_BUFFER_SIZE as DEFAULT_BUFFER_SIZE -from _io import FileIO as FileIO -from _io import IncrementalNewlineDecoder as IncrementalNewlineDecoder -from _io import StringIO as StringIO -from _io import TextIOWrapper as TextIOWrapper -from _io import UnsupportedOperation as UnsupportedOperation -from _io import open as open - -def _OpenWrapper(file: Union[str, unicode, int], - mode: unicode = ..., buffering: int = ..., encoding: unicode = ..., - errors: unicode = ..., newline: unicode = ..., - closefd: bool = ...) -> IO[Any]: ... +from _io import ( + DEFAULT_BUFFER_SIZE as DEFAULT_BUFFER_SIZE, + BlockingIOError as BlockingIOError, + BufferedRandom as BufferedRandom, + BufferedReader as BufferedReader, + BufferedRWPair as BufferedRWPair, + BufferedWriter as BufferedWriter, + BytesIO as BytesIO, + FileIO as FileIO, + IncrementalNewlineDecoder as IncrementalNewlineDecoder, + StringIO as StringIO, + TextIOWrapper as TextIOWrapper, + UnsupportedOperation as UnsupportedOperation, + open as open, +) + +def _OpenWrapper( + file: Union[str, unicode, int], + mode: unicode = ..., + buffering: int = ..., + encoding: unicode = ..., + errors: unicode = ..., + newline: unicode = ..., + closefd: bool = ..., +) -> IO[Any]: ... SEEK_SET: int SEEK_CUR: int SEEK_END: int - class IOBase(_io._IOBase): ... - class RawIOBase(_io._RawIOBase, IOBase): ... - class BufferedIOBase(_io._BufferedIOBase, IOBase): ... # Note: In the actual io.py, TextIOBase subclasses IOBase. diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/itertools.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/itertools.pyi old mode 100755 new mode 100644 index 1d5b4ee8..59a329f7 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/itertools.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/itertools.pyi @@ -1,16 +1,14 @@ -# Stubs for itertools +from typing import Any, Callable, Generic, Iterable, Iterator, Optional, Sequence, Tuple, TypeVar, Union, overload -# Based on https://docs.python.org/2/library/itertools.html +_T = TypeVar("_T") +_S = TypeVar("_S") -from typing import (Iterator, TypeVar, Iterable, overload, Any, Callable, Tuple, - Union, Sequence, Generic, Optional) +def count(start: int = ..., step: int = ...) -> Iterator[int]: ... # more general types? -_T = TypeVar('_T') -_S = TypeVar('_S') - -def count(start: int = ..., - step: int = ...) -> Iterator[int]: ... # more general types? -def cycle(iterable: Iterable[_T]) -> Iterator[_T]: ... +class cycle(Iterator[_T], Generic[_T]): + def __init__(self, iterable: Iterable[_T]) -> None: ... + def next(self) -> _T: ... + def __iter__(self) -> Iterator[_T]: ... def repeat(object: _T, times: int = ...) -> Iterator[_T]: ... @@ -22,142 +20,145 @@ class chain(Iterator[_T], Generic[_T]): def from_iterable(iterable: Iterable[Iterable[_S]]) -> Iterator[_S]: ... def compress(data: Iterable[_T], selectors: Iterable[Any]) -> Iterator[_T]: ... -def dropwhile(predicate: Callable[[_T], Any], - iterable: Iterable[_T]) -> Iterator[_T]: ... -def ifilter(predicate: Optional[Callable[[_T], Any]], - iterable: Iterable[_T]) -> Iterator[_T]: ... -def ifilterfalse(predicate: Optional[Callable[[_T], Any]], - iterable: Iterable[_T]) -> Iterator[_T]: ... - +def dropwhile(predicate: Callable[[_T], Any], iterable: Iterable[_T]) -> Iterator[_T]: ... +def ifilter(predicate: Optional[Callable[[_T], Any]], iterable: Iterable[_T]) -> Iterator[_T]: ... +def ifilterfalse(predicate: Optional[Callable[[_T], Any]], iterable: Iterable[_T]) -> Iterator[_T]: ... @overload def groupby(iterable: Iterable[_T], key: None = ...) -> Iterator[Tuple[_T, Iterator[_T]]]: ... @overload def groupby(iterable: Iterable[_T], key: Callable[[_T], _S]) -> Iterator[Tuple[_S, Iterator[_T]]]: ... - @overload def islice(iterable: Iterable[_T], stop: Optional[int]) -> Iterator[_T]: ... @overload -def islice(iterable: Iterable[_T], start: Optional[int], stop: Optional[int], - step: Optional[int] = ...) -> Iterator[_T]: ... - -_T1 = TypeVar('_T1') -_T2 = TypeVar('_T2') -_T3 = TypeVar('_T3') -_T4 = TypeVar('_T4') -_T5 = TypeVar('_T5') -_T6 = TypeVar('_T6') +def islice(iterable: Iterable[_T], start: Optional[int], stop: Optional[int], step: Optional[int] = ...) -> Iterator[_T]: ... +_T1 = TypeVar("_T1") +_T2 = TypeVar("_T2") +_T3 = TypeVar("_T3") +_T4 = TypeVar("_T4") +_T5 = TypeVar("_T5") +_T6 = TypeVar("_T6") @overload def imap(func: Callable[[_T1], _S], iter1: Iterable[_T1]) -> Iterator[_S]: ... @overload -def imap(func: Callable[[_T1, _T2], _S], - iter1: Iterable[_T1], - iter2: Iterable[_T2]) -> Iterator[_S]: ... -@overload -def imap(func: Callable[[_T1, _T2, _T3], _S], - iter1: Iterable[_T1], iter2: Iterable[_T2], - iter3: Iterable[_T3]) -> Iterator[_S]: ... - -@overload -def imap(func: Callable[[_T1, _T2, _T3, _T4], _S], - iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], - iter4: Iterable[_T4]) -> Iterator[_S]: ... - -@overload -def imap(func: Callable[[_T1, _T2, _T3, _T4, _T5], _S], - iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], - iter4: Iterable[_T4], iter5: Iterable[_T5]) -> Iterator[_S]: ... - -@overload -def imap(func: Callable[[_T1, _T2, _T3, _T4, _T5, _T6], _S], - iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], - iter4: Iterable[_T4], iter5: Iterable[_T5], - iter6: Iterable[_T6]) -> Iterator[_S]: ... - -@overload -def imap(func: Callable[..., _S], - iter1: Iterable[Any], iter2: Iterable[Any], iter3: Iterable[Any], - iter4: Iterable[Any], iter5: Iterable[Any], iter6: Iterable[Any], - iter7: Iterable[Any], *iterables: Iterable[Any]) -> Iterator[_S]: ... - +def imap(func: Callable[[_T1, _T2], _S], iter1: Iterable[_T1], iter2: Iterable[_T2]) -> Iterator[_S]: ... +@overload +def imap( + func: Callable[[_T1, _T2, _T3], _S], iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3] +) -> Iterator[_S]: ... +@overload +def imap( + func: Callable[[_T1, _T2, _T3, _T4], _S], + iter1: Iterable[_T1], + iter2: Iterable[_T2], + iter3: Iterable[_T3], + iter4: Iterable[_T4], +) -> Iterator[_S]: ... +@overload +def imap( + func: Callable[[_T1, _T2, _T3, _T4, _T5], _S], + iter1: Iterable[_T1], + iter2: Iterable[_T2], + iter3: Iterable[_T3], + iter4: Iterable[_T4], + iter5: Iterable[_T5], +) -> Iterator[_S]: ... +@overload +def imap( + func: Callable[[_T1, _T2, _T3, _T4, _T5, _T6], _S], + iter1: Iterable[_T1], + iter2: Iterable[_T2], + iter3: Iterable[_T3], + iter4: Iterable[_T4], + iter5: Iterable[_T5], + iter6: Iterable[_T6], +) -> Iterator[_S]: ... +@overload +def imap( + func: Callable[..., _S], + iter1: Iterable[Any], + iter2: Iterable[Any], + iter3: Iterable[Any], + iter4: Iterable[Any], + iter5: Iterable[Any], + iter6: Iterable[Any], + iter7: Iterable[Any], + *iterables: Iterable[Any], +) -> Iterator[_S]: ... def starmap(func: Any, iterable: Iterable[Any]) -> Iterator[Any]: ... -def takewhile(predicate: Callable[[_T], Any], - iterable: Iterable[_T]) -> Iterator[_T]: ... +def takewhile(predicate: Callable[[_T], Any], iterable: Iterable[_T]) -> Iterator[_T]: ... def tee(iterable: Iterable[_T], n: int = ...) -> Tuple[Iterator[_T], ...]: ... - @overload def izip(iter1: Iterable[_T1]) -> Iterator[Tuple[_T1]]: ... @overload -def izip(iter1: Iterable[_T1], - iter2: Iterable[_T2]) -> Iterator[Tuple[_T1, _T2]]: ... -@overload -def izip(iter1: Iterable[_T1], iter2: Iterable[_T2], - iter3: Iterable[_T3]) -> Iterator[Tuple[_T1, _T2, _T3]]: ... -@overload -def izip(iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], - iter4: Iterable[_T4]) -> Iterator[Tuple[_T1, _T2, - _T3, _T4]]: ... -@overload -def izip(iter1: Iterable[_T1], iter2: Iterable[_T2], - iter3: Iterable[_T3], iter4: Iterable[_T4], - iter5: Iterable[_T5]) -> Iterator[Tuple[_T1, _T2, - _T3, _T4, _T5]]: ... -@overload -def izip(iter1: Iterable[_T1], iter2: Iterable[_T2], - iter3: Iterable[_T3], iter4: Iterable[_T4], - iter5: Iterable[_T5], iter6: Iterable[_T6]) -> Iterator[Tuple[_T1, _T2, _T3, - _T4, _T5, _T6]]: ... -@overload -def izip(iter1: Iterable[Any], iter2: Iterable[Any], - iter3: Iterable[Any], iter4: Iterable[Any], - iter5: Iterable[Any], iter6: Iterable[Any], - iter7: Iterable[Any], *iterables: Iterable[Any]) -> Iterator[Tuple[Any, ...]]: ... - -def izip_longest(*p: Iterable[Any], - fillvalue: Any = ...) -> Iterator[Any]: ... - +def izip(iter1: Iterable[_T1], iter2: Iterable[_T2]) -> Iterator[Tuple[_T1, _T2]]: ... +@overload +def izip(iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3]) -> Iterator[Tuple[_T1, _T2, _T3]]: ... +@overload +def izip( + iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], iter4: Iterable[_T4] +) -> Iterator[Tuple[_T1, _T2, _T3, _T4]]: ... +@overload +def izip( + iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], iter4: Iterable[_T4], iter5: Iterable[_T5] +) -> Iterator[Tuple[_T1, _T2, _T3, _T4, _T5]]: ... +@overload +def izip( + iter1: Iterable[_T1], + iter2: Iterable[_T2], + iter3: Iterable[_T3], + iter4: Iterable[_T4], + iter5: Iterable[_T5], + iter6: Iterable[_T6], +) -> Iterator[Tuple[_T1, _T2, _T3, _T4, _T5, _T6]]: ... +@overload +def izip( + iter1: Iterable[Any], + iter2: Iterable[Any], + iter3: Iterable[Any], + iter4: Iterable[Any], + iter5: Iterable[Any], + iter6: Iterable[Any], + iter7: Iterable[Any], + *iterables: Iterable[Any], +) -> Iterator[Tuple[Any, ...]]: ... +def izip_longest(*p: Iterable[Any], fillvalue: Any = ...) -> Iterator[Any]: ... @overload def product(iter1: Iterable[_T1]) -> Iterator[Tuple[_T1]]: ... @overload -def product(iter1: Iterable[_T1], - iter2: Iterable[_T2]) -> Iterator[Tuple[_T1, _T2]]: ... -@overload -def product(iter1: Iterable[_T1], - iter2: Iterable[_T2], - iter3: Iterable[_T3]) -> Iterator[Tuple[_T1, _T2, _T3]]: ... -@overload -def product(iter1: Iterable[_T1], - iter2: Iterable[_T2], - iter3: Iterable[_T3], - iter4: Iterable[_T4]) -> Iterator[Tuple[_T1, _T2, _T3, _T4]]: ... -@overload -def product(iter1: Iterable[_T1], - iter2: Iterable[_T2], - iter3: Iterable[_T3], - iter4: Iterable[_T4], - iter5: Iterable[_T5]) -> Iterator[Tuple[_T1, _T2, _T3, _T4, _T5]]: ... -@overload -def product(iter1: Iterable[_T1], - iter2: Iterable[_T2], - iter3: Iterable[_T3], - iter4: Iterable[_T4], - iter5: Iterable[_T5], - iter6: Iterable[_T6]) -> Iterator[Tuple[_T1, _T2, _T3, _T4, _T5, _T6]]: ... -@overload -def product(iter1: Iterable[Any], - iter2: Iterable[Any], - iter3: Iterable[Any], - iter4: Iterable[Any], - iter5: Iterable[Any], - iter6: Iterable[Any], - iter7: Iterable[Any], - *iterables: Iterable[Any]) -> Iterator[Tuple[Any, ...]]: ... +def product(iter1: Iterable[_T1], iter2: Iterable[_T2]) -> Iterator[Tuple[_T1, _T2]]: ... +@overload +def product(iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3]) -> Iterator[Tuple[_T1, _T2, _T3]]: ... +@overload +def product( + iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], iter4: Iterable[_T4] +) -> Iterator[Tuple[_T1, _T2, _T3, _T4]]: ... +@overload +def product( + iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], iter4: Iterable[_T4], iter5: Iterable[_T5] +) -> Iterator[Tuple[_T1, _T2, _T3, _T4, _T5]]: ... +@overload +def product( + iter1: Iterable[_T1], + iter2: Iterable[_T2], + iter3: Iterable[_T3], + iter4: Iterable[_T4], + iter5: Iterable[_T5], + iter6: Iterable[_T6], +) -> Iterator[Tuple[_T1, _T2, _T3, _T4, _T5, _T6]]: ... +@overload +def product( + iter1: Iterable[Any], + iter2: Iterable[Any], + iter3: Iterable[Any], + iter4: Iterable[Any], + iter5: Iterable[Any], + iter6: Iterable[Any], + iter7: Iterable[Any], + *iterables: Iterable[Any], +) -> Iterator[Tuple[Any, ...]]: ... @overload def product(*iterables: Iterable[Any], repeat: int) -> Iterator[Tuple[Any, ...]]: ... - -def permutations(iterable: Iterable[_T], - r: int = ...) -> Iterator[Sequence[_T]]: ... -def combinations(iterable: Iterable[_T], - r: int) -> Iterator[Sequence[_T]]: ... -def combinations_with_replacement(iterable: Iterable[_T], - r: int) -> Iterator[Sequence[_T]]: ... +def permutations(iterable: Iterable[_T], r: int = ...) -> Iterator[Sequence[_T]]: ... +def combinations(iterable: Iterable[_T], r: int) -> Iterator[Sequence[_T]]: ... +def combinations_with_replacement(iterable: Iterable[_T], r: int) -> Iterator[Sequence[_T]]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/json.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/json.pyi old mode 100755 new mode 100644 index 578e0cd0..2d38e6b4 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/json.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/json.pyi @@ -1,70 +1,69 @@ -from typing import Any, IO, Optional, Tuple, Callable, Dict, List, Union, Text, Protocol, Type +from _typeshed import SupportsRead +from typing import IO, Any, Callable, Dict, List, Optional, Text, Tuple, Type, Union -class JSONDecodeError(ValueError): - def dumps(self, obj: Any) -> str: ... - def dump(self, obj: Any, fp: IO[str], *args: Any, **kwds: Any) -> None: ... - def loads(self, s: str) -> Any: ... - def load(self, fp: IO[str]) -> Any: ... - -def dumps(obj: Any, - skipkeys: bool = ..., - ensure_ascii: bool = ..., - check_circular: bool = ..., - allow_nan: bool = ..., - cls: Optional[Type[JSONEncoder]] = ..., - indent: Optional[int] = ..., - separators: Optional[Tuple[str, str]] = ..., - encoding: str = ..., - default: Optional[Callable[[Any], Any]] = ..., - sort_keys: bool = ..., - **kwds: Any) -> str: ... - -def dump(obj: Any, - fp: Union[IO[str], IO[Text]], - skipkeys: bool = ..., - ensure_ascii: bool = ..., - check_circular: bool = ..., - allow_nan: bool = ..., - cls: Optional[Type[JSONEncoder]] = ..., - indent: Optional[int] = ..., - separators: Optional[Tuple[str, str]] = ..., - encoding: str = ..., - default: Optional[Callable[[Any], Any]] = ..., - sort_keys: bool = ..., - **kwds: Any) -> None: ... - -def loads(s: Union[Text, bytes], - encoding: Any = ..., - cls: Optional[Type[JSONDecoder]] = ..., - object_hook: Optional[Callable[[Dict[Any, Any]], Any]] = ..., - parse_float: Optional[Callable[[str], Any]] = ..., - parse_int: Optional[Callable[[str], Any]] = ..., - parse_constant: Optional[Callable[[str], Any]] = ..., - object_pairs_hook: Optional[Callable[[List[Tuple[Any, Any]]], Any]] = ..., - **kwds: Any) -> Any: ... - -class _Reader(Protocol): - def read(self) -> Union[Text, bytes]: ... - -def load(fp: _Reader, - encoding: Optional[str] = ..., - cls: Optional[Type[JSONDecoder]] = ..., - object_hook: Optional[Callable[[Dict[Any, Any]], Any]] = ..., - parse_float: Optional[Callable[[str], Any]] = ..., - parse_int: Optional[Callable[[str], Any]] = ..., - parse_constant: Optional[Callable[[str], Any]] = ..., - object_pairs_hook: Optional[Callable[[List[Tuple[Any, Any]]], Any]] = ..., - **kwds: Any) -> Any: ... +def dumps( + obj: Any, + skipkeys: bool = ..., + ensure_ascii: bool = ..., + check_circular: bool = ..., + allow_nan: bool = ..., + cls: Optional[Type[JSONEncoder]] = ..., + indent: Optional[int] = ..., + separators: Optional[Tuple[str, str]] = ..., + encoding: str = ..., + default: Optional[Callable[[Any], Any]] = ..., + sort_keys: bool = ..., + **kwds: Any, +) -> str: ... +def dump( + obj: Any, + fp: Union[IO[str], IO[Text]], + skipkeys: bool = ..., + ensure_ascii: bool = ..., + check_circular: bool = ..., + allow_nan: bool = ..., + cls: Optional[Type[JSONEncoder]] = ..., + indent: Optional[int] = ..., + separators: Optional[Tuple[str, str]] = ..., + encoding: str = ..., + default: Optional[Callable[[Any], Any]] = ..., + sort_keys: bool = ..., + **kwds: Any, +) -> None: ... +def loads( + s: Union[Text, bytes], + encoding: Any = ..., + cls: Optional[Type[JSONDecoder]] = ..., + object_hook: Optional[Callable[[Dict[Any, Any]], Any]] = ..., + parse_float: Optional[Callable[[str], Any]] = ..., + parse_int: Optional[Callable[[str], Any]] = ..., + parse_constant: Optional[Callable[[str], Any]] = ..., + object_pairs_hook: Optional[Callable[[List[Tuple[Any, Any]]], Any]] = ..., + **kwds: Any, +) -> Any: ... +def load( + fp: SupportsRead[Union[Text, bytes]], + encoding: Optional[str] = ..., + cls: Optional[Type[JSONDecoder]] = ..., + object_hook: Optional[Callable[[Dict[Any, Any]], Any]] = ..., + parse_float: Optional[Callable[[str], Any]] = ..., + parse_int: Optional[Callable[[str], Any]] = ..., + parse_constant: Optional[Callable[[str], Any]] = ..., + object_pairs_hook: Optional[Callable[[List[Tuple[Any, Any]]], Any]] = ..., + **kwds: Any, +) -> Any: ... class JSONDecoder(object): - def __init__(self, - encoding: Union[Text, bytes] = ..., - object_hook: Callable[..., Any] = ..., - parse_float: Callable[[str], float] = ..., - parse_int: Callable[[str], int] = ..., - parse_constant: Callable[[str], Any] = ..., - strict: bool = ..., - object_pairs_hook: Callable[..., Any] = ...) -> None: ... + def __init__( + self, + encoding: Union[Text, bytes] = ..., + object_hook: Callable[..., Any] = ..., + parse_float: Callable[[str], float] = ..., + parse_int: Callable[[str], int] = ..., + parse_constant: Callable[[str], Any] = ..., + strict: bool = ..., + object_pairs_hook: Callable[..., Any] = ..., + ) -> None: ... def decode(self, s: Union[Text, bytes], _w: Any = ...) -> Any: ... def raw_decode(self, s: Union[Text, bytes], idx: int = ...) -> Tuple[Any, Any]: ... @@ -77,20 +76,18 @@ class JSONEncoder(object): allow_nan: bool sort_keys: bool indent: Optional[int] - - def __init__(self, - skipkeys: bool = ..., - ensure_ascii: bool = ..., - check_circular: bool = ..., - allow_nan: bool = ..., - sort_keys: bool = ..., - indent: Optional[int] = ..., - separators: Tuple[Union[Text, bytes], Union[Text, bytes]] = ..., - encoding: Union[Text, bytes] = ..., - default: Callable[..., Any] = ...) -> None: ... - + def __init__( + self, + skipkeys: bool = ..., + ensure_ascii: bool = ..., + check_circular: bool = ..., + allow_nan: bool = ..., + sort_keys: bool = ..., + indent: Optional[int] = ..., + separators: Tuple[Union[Text, bytes], Union[Text, bytes]] = ..., + encoding: Union[Text, bytes] = ..., + default: Callable[..., Any] = ..., + ) -> None: ... def default(self, o: Any) -> Any: ... - def encode(self, o: Any) -> str: ... - def iterencode(self, o: Any, _one_shot: bool = ...) -> str: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/markupbase.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/markupbase.pyi old mode 100755 new mode 100644 index 358ba16c..727daaac --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/markupbase.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/markupbase.pyi @@ -5,5 +5,4 @@ class ParserBase(object): def error(self, message: str) -> None: ... def reset(self) -> None: ... def getpos(self) -> Tuple[int, int]: ... - def unknown_decl(self, data: str) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/md5.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/md5.pyi old mode 100755 new mode 100644 index 96eabd14..371f6113 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/md5.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/md5.pyi @@ -1,6 +1,5 @@ -# Stubs for Python 2.7 md5 stdlib module - -from hashlib import md5 as md5, md5 as new +from hashlib import md5 as md5 +new = md5 blocksize: int digest_size: int diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/mimetools.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/mimetools.pyi old mode 100755 new mode 100644 index f565202f..3c6cbfcb --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/mimetools.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/mimetools.pyi @@ -1,5 +1,5 @@ -from typing import Any import rfc822 +from typing import Any class Message(rfc822.Message): encodingheader: Any diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/multiprocessing/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/multiprocessing/__init__.pyi old mode 100755 new mode 100644 index fb00b245..b4f58920 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/multiprocessing/__init__.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/multiprocessing/__init__.pyi @@ -1,16 +1,15 @@ -from typing import Any, Callable, Optional, TypeVar, Iterable - from multiprocessing import pool -from multiprocessing.process import Process as Process, current_process as current_process, active_children as active_children +from multiprocessing.process import Process as Process, active_children as active_children, current_process as current_process from multiprocessing.util import SUBDEBUG as SUBDEBUG, SUBWARNING as SUBWARNING from Queue import Queue as _BaseQueue +from typing import Any, Callable, Iterable, Optional, TypeVar class ProcessError(Exception): ... class BufferTooShort(ProcessError): ... class TimeoutError(ProcessError): ... class AuthenticationError(ProcessError): ... -_T = TypeVar('_T') +_T = TypeVar("_T") class Queue(_BaseQueue[_T]): def __init__(self, maxsize: int = ...) -> None: ... @@ -43,8 +42,9 @@ def RawValue(typecode_or_type, *args): ... def RawArray(typecode_or_type, size_or_initializer): ... def Value(typecode_or_type, *args, **kwds): ... def Array(typecode_or_type, size_or_initializer, **kwds): ... - -def Pool(processes: Optional[int] = ..., - initializer: Optional[Callable[..., Any]] = ..., - initargs: Iterable[Any] = ..., - maxtasksperchild: Optional[int] = ...) -> pool.Pool: ... +def Pool( + processes: Optional[int] = ..., + initializer: Optional[Callable[..., Any]] = ..., + initargs: Iterable[Any] = ..., + maxtasksperchild: Optional[int] = ..., +) -> pool.Pool: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/multiprocessing/dummy/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/multiprocessing/dummy/__init__.pyi old mode 100755 new mode 100644 index ea41a4cf..8f6b2124 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/multiprocessing/dummy/__init__.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/multiprocessing/dummy/__init__.pyi @@ -1,17 +1,13 @@ -from typing import Any, Optional, List, Type - -import threading -import sys -import weakref import array import itertools - +import sys +import threading +import weakref from multiprocessing import TimeoutError, cpu_count from multiprocessing.dummy.connection import Pipe -from threading import Lock, RLock, Semaphore, BoundedSemaphore -from threading import Event from Queue import Queue - +from threading import BoundedSemaphore, Event, Lock, RLock, Semaphore +from typing import Any, List, Optional, Type class DummyProcess(threading.Thread): _children: weakref.WeakKeyDictionary[Any, Any] @@ -22,7 +18,6 @@ class DummyProcess(threading.Thread): @property def exitcode(self) -> Optional[int]: ... - Process = DummyProcess # This should be threading._Condition but threading.pyi exports it as Condition diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/multiprocessing/dummy/connection.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/multiprocessing/dummy/connection.pyi old mode 100755 new mode 100644 index 663d3943..60e456e3 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/multiprocessing/dummy/connection.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/multiprocessing/dummy/connection.pyi @@ -21,6 +21,5 @@ class Listener(object): def accept(self) -> Connection: ... def close(self) -> None: ... - def Client(address) -> Connection: ... def Pipe(duplex=...) -> Tuple[Connection, Connection]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/multiprocessing/pool.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/multiprocessing/pool.pyi old mode 100755 new mode 100644 index 4001a5a2..b20618ca --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/multiprocessing/pool.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/multiprocessing/pool.pyi @@ -1,11 +1,8 @@ -from typing import ( - Any, Callable, ContextManager, Iterable, Optional, Dict, List, - TypeVar, Iterator, -) +from typing import Any, Callable, Dict, Iterable, Iterator, List, Optional, TypeVar -_T = TypeVar('_T', bound=Pool) +_T = TypeVar("_T", bound=Pool) -class AsyncResult(): +class AsyncResult: def get(self, timeout: Optional[float] = ...) -> Any: ... def wait(self, timeout: Optional[float] = ...) -> None: ... def ready(self) -> bool: ... @@ -17,43 +14,39 @@ class IMapIterator(Iterator[Any]): class IMapUnorderedIterator(IMapIterator): ... -class Pool(ContextManager[Pool]): - def __init__(self, processes: Optional[int] = ..., - initializer: Optional[Callable[..., None]] = ..., - initargs: Iterable[Any] = ..., - maxtasksperchild: Optional[int] = ...) -> None: ... - def apply(self, - func: Callable[..., Any], - args: Iterable[Any] = ..., - kwds: Dict[str, Any] = ...) -> Any: ... - def apply_async(self, - func: Callable[..., Any], - args: Iterable[Any] = ..., - kwds: Dict[str, Any] = ..., - callback: Optional[Callable[..., None]] = ...) -> AsyncResult: ... - def map(self, - func: Callable[..., Any], - iterable: Iterable[Any] = ..., - chunksize: Optional[int] = ...) -> List[Any]: ... - def map_async(self, func: Callable[..., Any], - iterable: Iterable[Any] = ..., - chunksize: Optional[int] = ..., - callback: Optional[Callable[..., None]] = ...) -> AsyncResult: ... - def imap(self, - func: Callable[..., Any], - iterable: Iterable[Any] = ..., - chunksize: Optional[int] = ...) -> IMapIterator: ... - def imap_unordered(self, - func: Callable[..., Any], - iterable: Iterable[Any] = ..., - chunksize: Optional[int] = ...) -> IMapIterator: ... +class Pool(object): + def __init__( + self, + processes: Optional[int] = ..., + initializer: Optional[Callable[..., None]] = ..., + initargs: Iterable[Any] = ..., + maxtasksperchild: Optional[int] = ..., + ) -> None: ... + def apply(self, func: Callable[..., Any], args: Iterable[Any] = ..., kwds: Dict[str, Any] = ...) -> Any: ... + def apply_async( + self, + func: Callable[..., Any], + args: Iterable[Any] = ..., + kwds: Dict[str, Any] = ..., + callback: Optional[Callable[..., None]] = ..., + ) -> AsyncResult: ... + def map(self, func: Callable[..., Any], iterable: Iterable[Any] = ..., chunksize: Optional[int] = ...) -> List[Any]: ... + def map_async( + self, + func: Callable[..., Any], + iterable: Iterable[Any] = ..., + chunksize: Optional[int] = ..., + callback: Optional[Callable[..., None]] = ..., + ) -> AsyncResult: ... + def imap(self, func: Callable[..., Any], iterable: Iterable[Any] = ..., chunksize: Optional[int] = ...) -> IMapIterator: ... + def imap_unordered( + self, func: Callable[..., Any], iterable: Iterable[Any] = ..., chunksize: Optional[int] = ... + ) -> IMapIterator: ... def close(self) -> None: ... def terminate(self) -> None: ... def join(self) -> None: ... - def __enter__(self: _T) -> _T: ... -class ThreadPool(Pool, ContextManager[ThreadPool]): - - def __init__(self, processes: Optional[int] = ..., - initializer: Optional[Callable[..., Any]] = ..., - initargs: Iterable[Any] = ...) -> None: ... +class ThreadPool(Pool): + def __init__( + self, processes: Optional[int] = ..., initializer: Optional[Callable[..., Any]] = ..., initargs: Iterable[Any] = ... + ) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/multiprocessing/process.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/multiprocessing/process.pyi old mode 100755 new mode 100644 index 476b4032..9ab9628e --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/multiprocessing/process.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/multiprocessing/process.pyi @@ -4,8 +4,9 @@ def current_process(): ... def active_children(): ... class Process: - def __init__(self, group: Optional[Any] = ..., target: Optional[Any] = ..., name: Optional[Any] = ..., args=..., - kwargs=...): ... + def __init__( + self, group: Optional[Any] = ..., target: Optional[Any] = ..., name: Optional[Any] = ..., args=..., kwargs=... + ): ... def run(self): ... def start(self): ... def terminate(self): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/multiprocessing/util.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/multiprocessing/util.pyi old mode 100755 new mode 100644 index 14d44f6e..9520022e --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/multiprocessing/util.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/multiprocessing/util.pyi @@ -1,5 +1,5 @@ -from typing import Any, Optional import threading +from typing import Any, Optional SUBDEBUG: Any SUBWARNING: Any diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/mutex.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/mutex.pyi old mode 100755 new mode 100644 index fa41bbb4..532760e0 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/mutex.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/mutex.pyi @@ -1,8 +1,6 @@ -# Source: https://hg.python.org/cpython/file/2.7/Lib/mutex.py - from typing import Any, Callable, Deque, TypeVar -_ArgType = TypeVar('_ArgType') +_ArgType = TypeVar("_ArgType") class mutex: locked: bool diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/ntpath.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/ntpath.pyi new file mode 100644 index 00000000..f0964286 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/ntpath.pyi @@ -0,0 +1,85 @@ +import os +import sys +from _typeshed import AnyPath, BytesPath, StrPath +from genericpath import exists as exists +from typing import Any, AnyStr, Callable, List, Optional, Sequence, Text, Tuple, TypeVar, overload + +_T = TypeVar("_T") + +# ----- os.path variables ----- +supports_unicode_filenames: bool +# aliases (also in os) +curdir: str +pardir: str +sep: str +if sys.platform == "win32": + altsep: str +else: + altsep: Optional[str] +extsep: str +pathsep: str +defpath: str +devnull: str + +# ----- os.path function stubs ----- +def abspath(path: AnyStr) -> AnyStr: ... +def basename(p: AnyStr) -> AnyStr: ... +def dirname(p: AnyStr) -> AnyStr: ... +def expanduser(path: AnyStr) -> AnyStr: ... +def expandvars(path: AnyStr) -> AnyStr: ... +def normcase(s: AnyStr) -> AnyStr: ... +def normpath(path: AnyStr) -> AnyStr: ... + +if sys.platform == "win32": + def realpath(path: AnyStr) -> AnyStr: ... + +else: + def realpath(filename: AnyStr) -> AnyStr: ... + +# NOTE: Empty lists results in '' (str) regardless of contained type. +# Also, in Python 2 mixed sequences of Text and bytes results in either Text or bytes +# So, fall back to Any +def commonprefix(m: Sequence[AnyPath]) -> Any: ... +def lexists(path: AnyPath) -> bool: ... + +# These return float if os.stat_float_times() == True, +# but int is a subclass of float. +def getatime(filename: AnyPath) -> float: ... +def getmtime(filename: AnyPath) -> float: ... +def getctime(filename: AnyPath) -> float: ... +def getsize(filename: AnyPath) -> int: ... +def isabs(s: AnyPath) -> bool: ... +def isfile(path: AnyPath) -> bool: ... +def isdir(s: AnyPath) -> bool: ... +def islink(path: AnyPath) -> bool: ... +def ismount(path: AnyPath) -> bool: ... + +# Make sure signatures are disjunct, and allow combinations of bytes and unicode. +# (Since Python 2 allows that, too) +# Note that e.g. os.path.join("a", "b", "c", "d", u"e") will still result in +# a type error. +@overload +def join(__p1: bytes, *p: bytes) -> bytes: ... +@overload +def join(__p1: bytes, __p2: bytes, __p3: bytes, __p4: Text, *p: AnyPath) -> Text: ... +@overload +def join(__p1: bytes, __p2: bytes, __p3: Text, *p: AnyPath) -> Text: ... +@overload +def join(__p1: bytes, __p2: Text, *p: AnyPath) -> Text: ... +@overload +def join(__p1: Text, *p: AnyPath) -> Text: ... +@overload +def relpath(path: BytesPath, start: Optional[BytesPath] = ...) -> bytes: ... +@overload +def relpath(path: StrPath, start: Optional[StrPath] = ...) -> Text: ... +def samefile(f1: AnyPath, f2: AnyPath) -> bool: ... +def sameopenfile(fp1: int, fp2: int) -> bool: ... +def samestat(s1: os.stat_result, s2: os.stat_result) -> bool: ... +def split(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ... +def splitdrive(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ... +def splitext(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + +if sys.platform == "win32": + def splitunc(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ... # deprecated + +def walk(path: AnyStr, visit: Callable[[_T, AnyStr, List[AnyStr]], Any], arg: _T) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/nturl2path.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/nturl2path.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/os/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/os/__init__.pyi old mode 100755 new mode 100644 index 7041e1fb..c43b24f2 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/os/__init__.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/os/__init__.pyi @@ -1,20 +1,42 @@ -# Stubs for os -# Ron Murawski - -from builtins import OSError as error +import sys +from _typeshed import AnyPath, FileDescriptorLike +from builtins import OSError from io import TextIOWrapper as _TextIOWrapper from posix import listdir as listdir, stat_result as stat_result # TODO: use this, see https://github.com/python/mypy/issues/3078 -import sys from typing import ( - Mapping, MutableMapping, Dict, List, Any, Tuple, Iterator, overload, Union, AnyStr, - Optional, Generic, Set, Callable, Text, Sequence, IO, NamedTuple, NoReturn, TypeVar + IO, + Any, + AnyStr, + Callable, + Dict, + Generic, + Iterator, + List, + Mapping, + MutableMapping, + NamedTuple, + NoReturn, + Optional, + Sequence, + Set, + Text, + Tuple, + TypeVar, + Union, + overload, ) + from . import path as path -_T = TypeVar('_T') +# We need to use something from path, or flake8 and pytype get unhappy +_supports_unicode_filenames = path.supports_unicode_filenames + +_T = TypeVar("_T") # ----- os variables ----- +error = OSError + if sys.version_info >= (3, 2): supports_bytes_environ: bool @@ -38,32 +60,32 @@ O_TRUNC: int # We don't use sys.platform for O_* flags to denote platform-dependent APIs because some codes, # including tests for mypy, use a more finer way than sys.platform before using these APIs # See https://github.com/python/typeshed/pull/2286 for discussions -O_DSYNC: int # Unix only -O_RSYNC: int # Unix only -O_SYNC: int # Unix only -O_NDELAY: int # Unix only +O_DSYNC: int # Unix only +O_RSYNC: int # Unix only +O_SYNC: int # Unix only +O_NDELAY: int # Unix only O_NONBLOCK: int # Unix only -O_NOCTTY: int # Unix only -O_SHLOCK: int # Unix only -O_EXLOCK: int # Unix only -O_BINARY: int # Windows only +O_NOCTTY: int # Unix only +O_SHLOCK: int # Unix only +O_EXLOCK: int # Unix only +O_BINARY: int # Windows only O_NOINHERIT: int # Windows only O_SHORT_LIVED: int # Windows only O_TEMPORARY: int # Windows only -O_RANDOM: int # Windows only +O_RANDOM: int # Windows only O_SEQUENTIAL: int # Windows only -O_TEXT: int # Windows only -O_ASYNC: int # Gnu extension if in C library -O_DIRECT: int # Gnu extension if in C library +O_TEXT: int # Windows only +O_ASYNC: int # Gnu extension if in C library +O_DIRECT: int # Gnu extension if in C library O_DIRECTORY: int # Gnu extension if in C library -O_NOFOLLOW: int # Gnu extension if in C library -O_NOATIME: int # Gnu extension if in C library +O_NOFOLLOW: int # Gnu extension if in C library +O_NOATIME: int # Gnu extension if in C library O_LARGEFILE: int # Gnu extension if in C library curdir: str pardir: str sep: str -if sys.platform == 'win32': +if sys.platform == "win32": altsep: str else: altsep: Optional[str] @@ -91,7 +113,7 @@ environ: _Environ[str] if sys.version_info >= (3, 2): environb: _Environ[bytes] -if sys.platform != 'win32': +if sys.platform != "win32": # Unix only confstr_names: Dict[str, int] pathconf_names: Dict[str, int] @@ -118,12 +140,12 @@ if sys.platform != 'win32': P_NOWAIT: int P_NOWAITO: int P_WAIT: int -if sys.platform == 'win32': +if sys.platform == "win32": P_DETACH: int P_OVERLAY: int # wait()/waitpid() options -if sys.platform != 'win32': +if sys.platform != "win32": WNOHANG: int # Unix only WCONTINUED: int # some Unix systems WUNTRACED: int # Unix only @@ -132,9 +154,9 @@ TMP_MAX: int # Undocumented, but used by tempfile # ----- os classes (structures) ----- if sys.version_info >= (3, 6): - from builtins import _PathLike as PathLike # See comment in builtins + from builtins import _PathLike -_PathType = path._PathType + PathLike = _PathLike # See comment in builtins class _StatVFS(NamedTuple): f_bsize: int @@ -154,7 +176,7 @@ def getppid() -> int: ... def strerror(code: int) -> str: ... def umask(mask: int) -> int: ... -if sys.platform != 'win32': +if sys.platform != "win32": def ctermid() -> str: ... def getegid() -> int: ... def geteuid() -> int: ... @@ -187,58 +209,59 @@ def getenv(key: Text) -> Optional[str]: ... def getenv(key: Text, default: _T) -> Union[str, _T]: ... def putenv(key: Union[bytes, Text], value: Union[bytes, Text]) -> None: ... def unsetenv(key: Union[bytes, Text]) -> None: ... - def fdopen(fd: int, *args, **kwargs) -> IO[Any]: ... def close(fd: int) -> None: ... def closerange(fd_low: int, fd_high: int) -> None: ... def dup(fd: int) -> int: ... def dup2(fd: int, fd2: int) -> None: ... def fstat(fd: int) -> Any: ... -def fsync(fd: int) -> None: ... +def fsync(fd: FileDescriptorLike) -> None: ... def lseek(fd: int, pos: int, how: int) -> int: ... -def open(file: _PathType, flags: int, mode: int = ...) -> int: ... +def open(file: AnyPath, flags: int, mode: int = ...) -> int: ... def pipe() -> Tuple[int, int]: ... def read(fd: int, n: int) -> bytes: ... def write(fd: int, string: Union[bytes, buffer]) -> int: ... -def access(path: _PathType, mode: int) -> bool: ... -def chdir(path: _PathType) -> None: ... -def fchdir(fd: int) -> None: ... +def access(path: AnyPath, mode: int) -> bool: ... +def chdir(path: AnyPath) -> None: ... +def fchdir(fd: FileDescriptorLike) -> None: ... def getcwd() -> str: ... def getcwdu() -> unicode: ... -def chmod(path: _PathType, mode: int) -> None: ... -def link(src: _PathType, link_name: _PathType) -> None: ... -def lstat(path: _PathType) -> Any: ... -def mknod(filename: _PathType, mode: int = ..., device: int = ...) -> None: ... +def chmod(path: AnyPath, mode: int) -> None: ... +def link(src: AnyPath, link_name: AnyPath) -> None: ... +def lstat(path: AnyPath) -> Any: ... +def mknod(filename: AnyPath, mode: int = ..., device: int = ...) -> None: ... def major(device: int) -> int: ... def minor(device: int) -> int: ... def makedev(major: int, minor: int) -> int: ... -def mkdir(path: _PathType, mode: int = ...) -> None: ... -def makedirs(path: _PathType, mode: int = ...) -> None: ... +def mkdir(path: AnyPath, mode: int = ...) -> None: ... +def makedirs(path: AnyPath, mode: int = ...) -> None: ... def readlink(path: AnyStr) -> AnyStr: ... -def remove(path: _PathType) -> None: ... -def removedirs(path: _PathType) -> None: ... -def rename(src: _PathType, dst: _PathType) -> None: ... -def renames(old: _PathType, new: _PathType) -> None: ... -def rmdir(path: _PathType) -> None: ... -def stat(path: _PathType) -> Any: ... +def remove(path: AnyPath) -> None: ... +def removedirs(path: AnyPath) -> None: ... +def rename(src: AnyPath, dst: AnyPath) -> None: ... +def renames(old: AnyPath, new: AnyPath) -> None: ... +def rmdir(path: AnyPath) -> None: ... +def stat(path: AnyPath) -> Any: ... @overload def stat_float_times() -> bool: ... @overload def stat_float_times(newvalue: bool) -> None: ... -def symlink(source: _PathType, link_name: _PathType) -> None: ... -def unlink(path: _PathType) -> None: ... +def symlink(source: AnyPath, link_name: AnyPath) -> None: ... +def unlink(path: AnyPath) -> None: ... + # TODO: add ns, dir_fd, follow_symlinks argument if sys.version_info >= (3, 0): - def utime(path: _PathType, times: Optional[Tuple[float, float]] = ...) -> None: ... + def utime(path: AnyPath, times: Optional[Tuple[float, float]] = ...) -> None: ... + else: - def utime(path: _PathType, times: Optional[Tuple[float, float]]) -> None: ... + def utime(path: AnyPath, times: Optional[Tuple[float, float]]) -> None: ... -if sys.platform != 'win32': +if sys.platform != "win32": # Unix only def fchmod(fd: int, mode: int) -> None: ... def fchown(fd: int, uid: int, gid: int) -> None: ... - if sys.platform != 'darwin': - def fdatasync(fd: int) -> None: ... # Unix only, not Mac + if sys.platform != "darwin": + def fdatasync(fd: FileDescriptorLike) -> None: ... # Unix only, not Mac def fpathconf(fd: int, name: Union[str, int]) -> int: ... def fstatvfs(fd: int) -> _StatVFS: ... def ftruncate(fd: int, length: int) -> None: ... @@ -247,85 +270,88 @@ if sys.platform != 'win32': def tcgetpgrp(fd: int) -> int: ... def tcsetpgrp(fd: int, pg: int) -> None: ... def ttyname(fd: int) -> str: ... - def chflags(path: _PathType, flags: int) -> None: ... - def chroot(path: _PathType) -> None: ... - def chown(path: _PathType, uid: int, gid: int) -> None: ... - def lchflags(path: _PathType, flags: int) -> None: ... - def lchmod(path: _PathType, mode: int) -> None: ... - def lchown(path: _PathType, uid: int, gid: int) -> None: ... - def mkfifo(path: _PathType, mode: int = ...) -> None: ... - def pathconf(path: _PathType, name: Union[str, int]) -> int: ... - def statvfs(path: _PathType) -> _StatVFS: ... + def chflags(path: AnyPath, flags: int) -> None: ... + def chroot(path: AnyPath) -> None: ... + def chown(path: AnyPath, uid: int, gid: int) -> None: ... + def lchflags(path: AnyPath, flags: int) -> None: ... + def lchmod(path: AnyPath, mode: int) -> None: ... + def lchown(path: AnyPath, uid: int, gid: int) -> None: ... + def mkfifo(path: AnyPath, mode: int = ...) -> None: ... + def pathconf(path: AnyPath, name: Union[str, int]) -> int: ... + def statvfs(path: AnyPath) -> _StatVFS: ... if sys.version_info >= (3, 6): - def walk(top: Union[AnyStr, PathLike[AnyStr]], topdown: bool = ..., - onerror: Optional[Callable[[OSError], Any]] = ..., - followlinks: bool = ...) -> Iterator[Tuple[AnyStr, List[AnyStr], - List[AnyStr]]]: ... + def walk( + top: Union[AnyStr, PathLike[AnyStr]], + topdown: bool = ..., + onerror: Optional[Callable[[OSError], Any]] = ..., + followlinks: bool = ..., + ) -> Iterator[Tuple[AnyStr, List[AnyStr], List[AnyStr]]]: ... + else: - def walk(top: AnyStr, topdown: bool = ..., onerror: Optional[Callable[[OSError], Any]] = ..., - followlinks: bool = ...) -> Iterator[Tuple[AnyStr, List[AnyStr], - List[AnyStr]]]: ... + def walk( + top: AnyStr, topdown: bool = ..., onerror: Optional[Callable[[OSError], Any]] = ..., followlinks: bool = ... + ) -> Iterator[Tuple[AnyStr, List[AnyStr], List[AnyStr]]]: ... def abort() -> NoReturn: ... + # These are defined as execl(file, *args) but the first *arg is mandatory. -def execl(file: _PathType, __arg0: Union[bytes, Text], *args: Union[bytes, Text]) -> NoReturn: ... -def execlp(file: _PathType, __arg0: Union[bytes, Text], *args: Union[bytes, Text]) -> NoReturn: ... +def execl(file: AnyPath, __arg0: Union[bytes, Text], *args: Union[bytes, Text]) -> NoReturn: ... +def execlp(file: AnyPath, __arg0: Union[bytes, Text], *args: Union[bytes, Text]) -> NoReturn: ... # These are: execle(file, *args, env) but env is pulled from the last element of the args. -def execle(file: _PathType, __arg0: Union[bytes, Text], *args: Any) -> NoReturn: ... -def execlpe(file: _PathType, __arg0: Union[bytes, Text], *args: Any) -> NoReturn: ... +def execle(file: AnyPath, __arg0: Union[bytes, Text], *args: Any) -> NoReturn: ... +def execlpe(file: AnyPath, __arg0: Union[bytes, Text], *args: Any) -> NoReturn: ... # The docs say `args: tuple or list of strings` # The implementation enforces tuple or list so we can't use Sequence. _ExecVArgs = Union[Tuple[Union[bytes, Text], ...], List[bytes], List[Text], List[Union[bytes, Text]]] -def execv(path: _PathType, args: _ExecVArgs) -> NoReturn: ... -def execve(path: _PathType, args: _ExecVArgs, env: Mapping[str, str]) -> NoReturn: ... -def execvp(file: _PathType, args: _ExecVArgs) -> NoReturn: ... -def execvpe(file: _PathType, args: _ExecVArgs, env: Mapping[str, str]) -> NoReturn: ... +def execv(path: AnyPath, args: _ExecVArgs) -> NoReturn: ... +def execve(path: AnyPath, args: _ExecVArgs, env: Mapping[str, str]) -> NoReturn: ... +def execvp(file: AnyPath, args: _ExecVArgs) -> NoReturn: ... +def execvpe(file: AnyPath, args: _ExecVArgs, env: Mapping[str, str]) -> NoReturn: ... def _exit(n: int) -> NoReturn: ... def kill(pid: int, sig: int) -> None: ... -if sys.platform != 'win32': +if sys.platform != "win32": # Unix only def fork() -> int: ... def forkpty() -> Tuple[int, int]: ... # some flavors of Unix - def killpg(pgid: int, sig: int) -> None: ... + def killpg(__pgid: int, __signal: int) -> None: ... def nice(increment: int) -> int: ... def plock(op: int) -> None: ... # ???op is int? if sys.version_info >= (3, 0): class popen(_TextIOWrapper): # TODO 'b' modes or bytes command not accepted? - def __init__(self, command: str, mode: str = ..., - bufsize: int = ...) -> None: ... + def __init__(self, command: str, mode: str = ..., bufsize: int = ...) -> None: ... def close(self) -> Any: ... # may return int + else: def popen(command: str, *args, **kwargs) -> IO[Any]: ... def popen2(cmd: str, *args, **kwargs) -> Tuple[IO[Any], IO[Any]]: ... def popen3(cmd: str, *args, **kwargs) -> Tuple[IO[Any], IO[Any], IO[Any]]: ... def popen4(cmd: str, *args, **kwargs) -> Tuple[IO[Any], IO[Any]]: ... -def spawnl(mode: int, path: _PathType, arg0: Union[bytes, Text], *args: Union[bytes, Text]) -> int: ... -def spawnle(mode: int, path: _PathType, arg0: Union[bytes, Text], - *args: Any) -> int: ... # Imprecise sig -def spawnv(mode: int, path: _PathType, args: List[Union[bytes, Text]]) -> int: ... -def spawnve(mode: int, path: _PathType, args: List[Union[bytes, Text]], - env: Mapping[str, str]) -> int: ... -def system(command: _PathType) -> int: ... +def spawnl(mode: int, path: AnyPath, arg0: Union[bytes, Text], *args: Union[bytes, Text]) -> int: ... +def spawnle(mode: int, path: AnyPath, arg0: Union[bytes, Text], *args: Any) -> int: ... # Imprecise sig +def spawnv(mode: int, path: AnyPath, args: List[Union[bytes, Text]]) -> int: ... +def spawnve(mode: int, path: AnyPath, args: List[Union[bytes, Text]], env: Mapping[str, str]) -> int: ... +def system(command: AnyPath) -> int: ... def times() -> Tuple[float, float, float, float, float]: ... def waitpid(pid: int, options: int) -> Tuple[int, int]: ... def urandom(n: int) -> bytes: ... -if sys.platform == 'win32': - def startfile(path: _PathType, operation: Optional[str] = ...) -> None: ... +if sys.platform == "win32": + def startfile(path: AnyPath, operation: Optional[str] = ...) -> None: ... + else: # Unix only - def spawnlp(mode: int, file: _PathType, arg0: Union[bytes, Text], *args: Union[bytes, Text]) -> int: ... - def spawnlpe(mode: int, file: _PathType, arg0: Union[bytes, Text], *args: Any) -> int: ... # Imprecise signature - def spawnvp(mode: int, file: _PathType, args: List[Union[bytes, Text]]) -> int: ... - def spawnvpe(mode: int, file: _PathType, args: List[Union[bytes, Text]], env: Mapping[str, str]) -> int: ... + def spawnlp(mode: int, file: AnyPath, arg0: Union[bytes, Text], *args: Union[bytes, Text]) -> int: ... + def spawnlpe(mode: int, file: AnyPath, arg0: Union[bytes, Text], *args: Any) -> int: ... # Imprecise signature + def spawnvp(mode: int, file: AnyPath, args: List[Union[bytes, Text]]) -> int: ... + def spawnvpe(mode: int, file: AnyPath, args: List[Union[bytes, Text]], env: Mapping[str, str]) -> int: ... def wait() -> Tuple[int, int]: ... def wait3(options: int) -> Tuple[int, int, Any]: ... def wait4(pid: int, options: int) -> Tuple[int, int, Any]: ... @@ -343,6 +369,7 @@ else: if sys.version_info >= (3, 0): def sched_getaffinity(id: int) -> Set[int]: ... + if sys.version_info >= (3, 3): class waitresult: si_pid: int diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/os/path.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/os/path.pyi old mode 100755 new mode 100644 index 42409c0e..f0964286 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/os/path.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/os/path.pyi @@ -1,22 +1,10 @@ -# NB: path.pyi and stdlib/2 and stdlib/3 must remain consistent! -# Stubs for os.path -# Ron Murawski - import os import sys -from typing import overload, List, Any, AnyStr, Sequence, Tuple, TypeVar, Union, Text, Callable, Optional - -_T = TypeVar('_T') +from _typeshed import AnyPath, BytesPath, StrPath +from genericpath import exists as exists +from typing import Any, AnyStr, Callable, List, Optional, Sequence, Text, Tuple, TypeVar, overload -if sys.version_info >= (3, 6): - from builtins import _PathLike - _PathType = Union[bytes, Text, _PathLike] - _StrPath = Union[Text, _PathLike[Text]] - _BytesPath = Union[bytes, _PathLike[bytes]] -else: - _PathType = Union[bytes, Text] - _StrPath = Text - _BytesPath = bytes +_T = TypeVar("_T") # ----- os.path variables ----- supports_unicode_filenames: bool @@ -24,7 +12,7 @@ supports_unicode_filenames: bool curdir: str pardir: str sep: str -if sys.platform == 'win32': +if sys.platform == "win32": altsep: str else: altsep: Optional[str] @@ -34,144 +22,64 @@ defpath: str devnull: str # ----- os.path function stubs ----- -if sys.version_info >= (3, 6): - # Overloads are necessary to work around python/mypy#3644. - @overload - def abspath(path: _PathLike[AnyStr]) -> AnyStr: ... - @overload - def abspath(path: AnyStr) -> AnyStr: ... - @overload - def basename(path: _PathLike[AnyStr]) -> AnyStr: ... - @overload - def basename(path: AnyStr) -> AnyStr: ... - @overload - def dirname(path: _PathLike[AnyStr]) -> AnyStr: ... - @overload - def dirname(path: AnyStr) -> AnyStr: ... - @overload - def expanduser(path: _PathLike[AnyStr]) -> AnyStr: ... - @overload - def expanduser(path: AnyStr) -> AnyStr: ... - @overload - def expandvars(path: _PathLike[AnyStr]) -> AnyStr: ... - @overload - def expandvars(path: AnyStr) -> AnyStr: ... - @overload - def normcase(path: _PathLike[AnyStr]) -> AnyStr: ... - @overload - def normcase(path: AnyStr) -> AnyStr: ... - @overload - def normpath(path: _PathLike[AnyStr]) -> AnyStr: ... - @overload - def normpath(path: AnyStr) -> AnyStr: ... - if sys.platform == 'win32': - @overload - def realpath(path: _PathLike[AnyStr]) -> AnyStr: ... - @overload - def realpath(path: AnyStr) -> AnyStr: ... - else: - @overload - def realpath(filename: _PathLike[AnyStr]) -> AnyStr: ... - @overload - def realpath(filename: AnyStr) -> AnyStr: ... +def abspath(path: AnyStr) -> AnyStr: ... +def basename(p: AnyStr) -> AnyStr: ... +def dirname(p: AnyStr) -> AnyStr: ... +def expanduser(path: AnyStr) -> AnyStr: ... +def expandvars(path: AnyStr) -> AnyStr: ... +def normcase(s: AnyStr) -> AnyStr: ... +def normpath(path: AnyStr) -> AnyStr: ... -else: - def abspath(path: AnyStr) -> AnyStr: ... - def basename(path: AnyStr) -> AnyStr: ... - def dirname(path: AnyStr) -> AnyStr: ... - def expanduser(path: AnyStr) -> AnyStr: ... - def expandvars(path: AnyStr) -> AnyStr: ... - def normcase(path: AnyStr) -> AnyStr: ... - def normpath(path: AnyStr) -> AnyStr: ... - if sys.platform == 'win32': - def realpath(path: AnyStr) -> AnyStr: ... - else: - def realpath(filename: AnyStr) -> AnyStr: ... +if sys.platform == "win32": + def realpath(path: AnyStr) -> AnyStr: ... -if sys.version_info >= (3, 6): - # In reality it returns str for sequences of _StrPath and bytes for sequences - # of _BytesPath, but mypy does not accept such a signature. - def commonpath(paths: Sequence[_PathType]) -> Any: ... -elif sys.version_info >= (3, 5): - def commonpath(paths: Sequence[AnyStr]) -> AnyStr: ... +else: + def realpath(filename: AnyStr) -> AnyStr: ... # NOTE: Empty lists results in '' (str) regardless of contained type. # Also, in Python 2 mixed sequences of Text and bytes results in either Text or bytes # So, fall back to Any -def commonprefix(list: Sequence[_PathType]) -> Any: ... - -if sys.version_info >= (3, 3): - def exists(path: Union[_PathType, int]) -> bool: ... -else: - def exists(path: _PathType) -> bool: ... -def lexists(path: _PathType) -> bool: ... +def commonprefix(m: Sequence[AnyPath]) -> Any: ... +def lexists(path: AnyPath) -> bool: ... # These return float if os.stat_float_times() == True, # but int is a subclass of float. -def getatime(path: _PathType) -> float: ... -def getmtime(path: _PathType) -> float: ... -def getctime(path: _PathType) -> float: ... - -def getsize(path: _PathType) -> int: ... -def isabs(path: _PathType) -> bool: ... -def isfile(path: _PathType) -> bool: ... -def isdir(path: _PathType) -> bool: ... -def islink(path: _PathType) -> bool: ... -def ismount(path: _PathType) -> bool: ... - -if sys.version_info < (3, 0): - # Make sure signatures are disjunct, and allow combinations of bytes and unicode. - # (Since Python 2 allows that, too) - # Note that e.g. os.path.join("a", "b", "c", "d", u"e") will still result in - # a type error. - @overload - def join(__p1: bytes, *p: bytes) -> bytes: ... - @overload - def join(__p1: bytes, __p2: bytes, __p3: bytes, __p4: Text, *p: _PathType) -> Text: ... - @overload - def join(__p1: bytes, __p2: bytes, __p3: Text, *p: _PathType) -> Text: ... - @overload - def join(__p1: bytes, __p2: Text, *p: _PathType) -> Text: ... - @overload - def join(__p1: Text, *p: _PathType) -> Text: ... -elif sys.version_info >= (3, 6): - # Mypy complains that the signatures overlap (same for relpath below), but things seem to behave correctly anyway. - @overload - def join(path: _StrPath, *paths: _StrPath) -> Text: ... - @overload - def join(path: _BytesPath, *paths: _BytesPath) -> bytes: ... -else: - def join(path: AnyStr, *paths: AnyStr) -> AnyStr: ... - +def getatime(filename: AnyPath) -> float: ... +def getmtime(filename: AnyPath) -> float: ... +def getctime(filename: AnyPath) -> float: ... +def getsize(filename: AnyPath) -> int: ... +def isabs(s: AnyPath) -> bool: ... +def isfile(path: AnyPath) -> bool: ... +def isdir(s: AnyPath) -> bool: ... +def islink(path: AnyPath) -> bool: ... +def ismount(path: AnyPath) -> bool: ... + +# Make sure signatures are disjunct, and allow combinations of bytes and unicode. +# (Since Python 2 allows that, too) +# Note that e.g. os.path.join("a", "b", "c", "d", u"e") will still result in +# a type error. @overload -def relpath(path: _BytesPath, start: Optional[_BytesPath] = ...) -> bytes: ... +def join(__p1: bytes, *p: bytes) -> bytes: ... @overload -def relpath(path: _StrPath, start: Optional[_StrPath] = ...) -> Text: ... - -def samefile(path1: _PathType, path2: _PathType) -> bool: ... +def join(__p1: bytes, __p2: bytes, __p3: bytes, __p4: Text, *p: AnyPath) -> Text: ... +@overload +def join(__p1: bytes, __p2: bytes, __p3: Text, *p: AnyPath) -> Text: ... +@overload +def join(__p1: bytes, __p2: Text, *p: AnyPath) -> Text: ... +@overload +def join(__p1: Text, *p: AnyPath) -> Text: ... +@overload +def relpath(path: BytesPath, start: Optional[BytesPath] = ...) -> bytes: ... +@overload +def relpath(path: StrPath, start: Optional[StrPath] = ...) -> Text: ... +def samefile(f1: AnyPath, f2: AnyPath) -> bool: ... def sameopenfile(fp1: int, fp2: int) -> bool: ... -def samestat(stat1: os.stat_result, stat2: os.stat_result) -> bool: ... - -if sys.version_info >= (3, 6): - @overload - def split(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... - @overload - def split(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... - @overload - def splitdrive(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... - @overload - def splitdrive(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... - @overload - def splitext(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... - @overload - def splitext(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... -else: - def split(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... - def splitdrive(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... - def splitext(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... +def samestat(s1: os.stat_result, s2: os.stat_result) -> bool: ... +def split(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ... +def splitdrive(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ... +def splitext(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ... -if sys.platform == 'win32': - def splitunc(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... # deprecated +if sys.platform == "win32": + def splitunc(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ... # deprecated -if sys.version_info < (3,): - def walk(path: AnyStr, visit: Callable[[_T, AnyStr, List[AnyStr]], Any], arg: _T) -> None: ... +def walk(path: AnyStr, visit: Callable[[_T, AnyStr, List[AnyStr]], Any], arg: _T) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/os2emxpath.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/os2emxpath.pyi old mode 100755 new mode 100644 index 42409c0e..f0964286 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/os2emxpath.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/os2emxpath.pyi @@ -1,22 +1,10 @@ -# NB: path.pyi and stdlib/2 and stdlib/3 must remain consistent! -# Stubs for os.path -# Ron Murawski - import os import sys -from typing import overload, List, Any, AnyStr, Sequence, Tuple, TypeVar, Union, Text, Callable, Optional - -_T = TypeVar('_T') +from _typeshed import AnyPath, BytesPath, StrPath +from genericpath import exists as exists +from typing import Any, AnyStr, Callable, List, Optional, Sequence, Text, Tuple, TypeVar, overload -if sys.version_info >= (3, 6): - from builtins import _PathLike - _PathType = Union[bytes, Text, _PathLike] - _StrPath = Union[Text, _PathLike[Text]] - _BytesPath = Union[bytes, _PathLike[bytes]] -else: - _PathType = Union[bytes, Text] - _StrPath = Text - _BytesPath = bytes +_T = TypeVar("_T") # ----- os.path variables ----- supports_unicode_filenames: bool @@ -24,7 +12,7 @@ supports_unicode_filenames: bool curdir: str pardir: str sep: str -if sys.platform == 'win32': +if sys.platform == "win32": altsep: str else: altsep: Optional[str] @@ -34,144 +22,64 @@ defpath: str devnull: str # ----- os.path function stubs ----- -if sys.version_info >= (3, 6): - # Overloads are necessary to work around python/mypy#3644. - @overload - def abspath(path: _PathLike[AnyStr]) -> AnyStr: ... - @overload - def abspath(path: AnyStr) -> AnyStr: ... - @overload - def basename(path: _PathLike[AnyStr]) -> AnyStr: ... - @overload - def basename(path: AnyStr) -> AnyStr: ... - @overload - def dirname(path: _PathLike[AnyStr]) -> AnyStr: ... - @overload - def dirname(path: AnyStr) -> AnyStr: ... - @overload - def expanduser(path: _PathLike[AnyStr]) -> AnyStr: ... - @overload - def expanduser(path: AnyStr) -> AnyStr: ... - @overload - def expandvars(path: _PathLike[AnyStr]) -> AnyStr: ... - @overload - def expandvars(path: AnyStr) -> AnyStr: ... - @overload - def normcase(path: _PathLike[AnyStr]) -> AnyStr: ... - @overload - def normcase(path: AnyStr) -> AnyStr: ... - @overload - def normpath(path: _PathLike[AnyStr]) -> AnyStr: ... - @overload - def normpath(path: AnyStr) -> AnyStr: ... - if sys.platform == 'win32': - @overload - def realpath(path: _PathLike[AnyStr]) -> AnyStr: ... - @overload - def realpath(path: AnyStr) -> AnyStr: ... - else: - @overload - def realpath(filename: _PathLike[AnyStr]) -> AnyStr: ... - @overload - def realpath(filename: AnyStr) -> AnyStr: ... +def abspath(path: AnyStr) -> AnyStr: ... +def basename(p: AnyStr) -> AnyStr: ... +def dirname(p: AnyStr) -> AnyStr: ... +def expanduser(path: AnyStr) -> AnyStr: ... +def expandvars(path: AnyStr) -> AnyStr: ... +def normcase(s: AnyStr) -> AnyStr: ... +def normpath(path: AnyStr) -> AnyStr: ... -else: - def abspath(path: AnyStr) -> AnyStr: ... - def basename(path: AnyStr) -> AnyStr: ... - def dirname(path: AnyStr) -> AnyStr: ... - def expanduser(path: AnyStr) -> AnyStr: ... - def expandvars(path: AnyStr) -> AnyStr: ... - def normcase(path: AnyStr) -> AnyStr: ... - def normpath(path: AnyStr) -> AnyStr: ... - if sys.platform == 'win32': - def realpath(path: AnyStr) -> AnyStr: ... - else: - def realpath(filename: AnyStr) -> AnyStr: ... +if sys.platform == "win32": + def realpath(path: AnyStr) -> AnyStr: ... -if sys.version_info >= (3, 6): - # In reality it returns str for sequences of _StrPath and bytes for sequences - # of _BytesPath, but mypy does not accept such a signature. - def commonpath(paths: Sequence[_PathType]) -> Any: ... -elif sys.version_info >= (3, 5): - def commonpath(paths: Sequence[AnyStr]) -> AnyStr: ... +else: + def realpath(filename: AnyStr) -> AnyStr: ... # NOTE: Empty lists results in '' (str) regardless of contained type. # Also, in Python 2 mixed sequences of Text and bytes results in either Text or bytes # So, fall back to Any -def commonprefix(list: Sequence[_PathType]) -> Any: ... - -if sys.version_info >= (3, 3): - def exists(path: Union[_PathType, int]) -> bool: ... -else: - def exists(path: _PathType) -> bool: ... -def lexists(path: _PathType) -> bool: ... +def commonprefix(m: Sequence[AnyPath]) -> Any: ... +def lexists(path: AnyPath) -> bool: ... # These return float if os.stat_float_times() == True, # but int is a subclass of float. -def getatime(path: _PathType) -> float: ... -def getmtime(path: _PathType) -> float: ... -def getctime(path: _PathType) -> float: ... - -def getsize(path: _PathType) -> int: ... -def isabs(path: _PathType) -> bool: ... -def isfile(path: _PathType) -> bool: ... -def isdir(path: _PathType) -> bool: ... -def islink(path: _PathType) -> bool: ... -def ismount(path: _PathType) -> bool: ... - -if sys.version_info < (3, 0): - # Make sure signatures are disjunct, and allow combinations of bytes and unicode. - # (Since Python 2 allows that, too) - # Note that e.g. os.path.join("a", "b", "c", "d", u"e") will still result in - # a type error. - @overload - def join(__p1: bytes, *p: bytes) -> bytes: ... - @overload - def join(__p1: bytes, __p2: bytes, __p3: bytes, __p4: Text, *p: _PathType) -> Text: ... - @overload - def join(__p1: bytes, __p2: bytes, __p3: Text, *p: _PathType) -> Text: ... - @overload - def join(__p1: bytes, __p2: Text, *p: _PathType) -> Text: ... - @overload - def join(__p1: Text, *p: _PathType) -> Text: ... -elif sys.version_info >= (3, 6): - # Mypy complains that the signatures overlap (same for relpath below), but things seem to behave correctly anyway. - @overload - def join(path: _StrPath, *paths: _StrPath) -> Text: ... - @overload - def join(path: _BytesPath, *paths: _BytesPath) -> bytes: ... -else: - def join(path: AnyStr, *paths: AnyStr) -> AnyStr: ... - +def getatime(filename: AnyPath) -> float: ... +def getmtime(filename: AnyPath) -> float: ... +def getctime(filename: AnyPath) -> float: ... +def getsize(filename: AnyPath) -> int: ... +def isabs(s: AnyPath) -> bool: ... +def isfile(path: AnyPath) -> bool: ... +def isdir(s: AnyPath) -> bool: ... +def islink(path: AnyPath) -> bool: ... +def ismount(path: AnyPath) -> bool: ... + +# Make sure signatures are disjunct, and allow combinations of bytes and unicode. +# (Since Python 2 allows that, too) +# Note that e.g. os.path.join("a", "b", "c", "d", u"e") will still result in +# a type error. @overload -def relpath(path: _BytesPath, start: Optional[_BytesPath] = ...) -> bytes: ... +def join(__p1: bytes, *p: bytes) -> bytes: ... @overload -def relpath(path: _StrPath, start: Optional[_StrPath] = ...) -> Text: ... - -def samefile(path1: _PathType, path2: _PathType) -> bool: ... +def join(__p1: bytes, __p2: bytes, __p3: bytes, __p4: Text, *p: AnyPath) -> Text: ... +@overload +def join(__p1: bytes, __p2: bytes, __p3: Text, *p: AnyPath) -> Text: ... +@overload +def join(__p1: bytes, __p2: Text, *p: AnyPath) -> Text: ... +@overload +def join(__p1: Text, *p: AnyPath) -> Text: ... +@overload +def relpath(path: BytesPath, start: Optional[BytesPath] = ...) -> bytes: ... +@overload +def relpath(path: StrPath, start: Optional[StrPath] = ...) -> Text: ... +def samefile(f1: AnyPath, f2: AnyPath) -> bool: ... def sameopenfile(fp1: int, fp2: int) -> bool: ... -def samestat(stat1: os.stat_result, stat2: os.stat_result) -> bool: ... - -if sys.version_info >= (3, 6): - @overload - def split(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... - @overload - def split(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... - @overload - def splitdrive(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... - @overload - def splitdrive(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... - @overload - def splitext(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... - @overload - def splitext(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... -else: - def split(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... - def splitdrive(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... - def splitext(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... +def samestat(s1: os.stat_result, s2: os.stat_result) -> bool: ... +def split(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ... +def splitdrive(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ... +def splitext(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ... -if sys.platform == 'win32': - def splitunc(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... # deprecated +if sys.platform == "win32": + def splitunc(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ... # deprecated -if sys.version_info < (3,): - def walk(path: AnyStr, visit: Callable[[_T, AnyStr, List[AnyStr]], Any], arg: _T) -> None: ... +def walk(path: AnyStr, visit: Callable[[_T, AnyStr, List[AnyStr]], Any], arg: _T) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/pipes.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/pipes.pyi old mode 100755 new mode 100644 index d5f5291e..52495434 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/pipes.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/pipes.pyi @@ -1,4 +1,4 @@ -from typing import Any, IO +from typing import IO, Any, AnyStr class Template: def __init__(self) -> None: ... @@ -10,4 +10,4 @@ class Template: def open(self, file: str, mode: str) -> IO[Any]: ... def copy(self, infile: str, outfile: str) -> None: ... -def quote(s: str) -> str: ... +def quote(s: AnyStr) -> AnyStr: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/platform.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/platform.pyi old mode 100755 new mode 100644 index e6e03780..cccb024d --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/platform.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/platform.pyi @@ -1,7 +1,3 @@ -# Stubs for platform (Python 2) -# -# Based on stub generated by stubgen. - from typing import Any, Optional, Tuple __copyright__: Any diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/popen2.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/popen2.pyi old mode 100755 new mode 100644 index b39ba5f0..5101a6f8 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/popen2.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/popen2.pyi @@ -1,7 +1,6 @@ -from typing import Any, Iterable, List, Optional, Union, TextIO, Tuple, TypeVar - -_T = TypeVar('_T') +from typing import Any, Iterable, List, Optional, TextIO, Tuple, TypeVar, Union +_T = TypeVar("_T") class Popen3: sts: int diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/posix.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/posix.pyi old mode 100755 new mode 100644 index 6cfd8520..ae79286e --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/posix.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/posix.pyi @@ -1,4 +1,5 @@ -from typing import AnyStr, Dict, List, Mapping, Tuple, Union, Sequence, IO, Optional, TypeVar +from _typeshed import FileDescriptorLike +from typing import IO, AnyStr, Dict, List, Mapping, NamedTuple, Optional, Sequence, Tuple, TypeVar, Union error = OSError @@ -78,10 +79,7 @@ class stat_result(object): st_mtime: int st_ctime: int -class statvfs_result(object): - n_fields: int - n_sequence_fields: int - n_unnamed_fields: int +class statvfs_result(NamedTuple): f_bsize: int f_frsize: int f_blocks: int @@ -108,17 +106,17 @@ def dup(fd: int) -> int: ... def dup2(fd: int, fd2: int) -> None: ... def execv(path: str, args: Sequence[str], env: Mapping[str, str]) -> None: ... def execve(path: str, args: Sequence[str], env: Mapping[str, str]) -> None: ... -def fchdir(fd: int) -> None: ... +def fchdir(fd: FileDescriptorLike) -> None: ... def fchmod(fd: int, mode: int) -> None: ... def fchown(fd: int, uid: int, gid: int) -> None: ... -def fdatasync(fd: int) -> None: ... +def fdatasync(fd: FileDescriptorLike) -> None: ... def fdopen(fd: int, mode: str = ..., bufsize: int = ...) -> IO[str]: ... def fork() -> int: ... def forkpty() -> Tuple[int, int]: ... def fpathconf(fd: int, name: str) -> None: ... def fstat(fd: int) -> stat_result: ... def fstatvfs(fd: int) -> statvfs_result: ... -def fsync(fd: int) -> None: ... +def fsync(fd: FileDescriptorLike) -> None: ... def ftruncate(fd: int, length: int) -> None: ... def getcwd() -> str: ... def getcwdu() -> unicode: ... @@ -194,7 +192,9 @@ def unsetenv(varname: str) -> None: ... def urandom(n: int) -> str: ... def utime(path: unicode, times: Optional[Tuple[int, int]]) -> None: ... def wait() -> int: ... + _r = Tuple[float, float, int, int, int, int, int, int, int, int, int, int, int, int, int, int] + def wait3(options: int) -> Tuple[int, int, _r]: ... def wait4(pid: int, options: int) -> Tuple[int, int, _r]: ... def waitpid(pid: int, options: int) -> int: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/posixpath.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/posixpath.pyi new file mode 100644 index 00000000..f0964286 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/posixpath.pyi @@ -0,0 +1,85 @@ +import os +import sys +from _typeshed import AnyPath, BytesPath, StrPath +from genericpath import exists as exists +from typing import Any, AnyStr, Callable, List, Optional, Sequence, Text, Tuple, TypeVar, overload + +_T = TypeVar("_T") + +# ----- os.path variables ----- +supports_unicode_filenames: bool +# aliases (also in os) +curdir: str +pardir: str +sep: str +if sys.platform == "win32": + altsep: str +else: + altsep: Optional[str] +extsep: str +pathsep: str +defpath: str +devnull: str + +# ----- os.path function stubs ----- +def abspath(path: AnyStr) -> AnyStr: ... +def basename(p: AnyStr) -> AnyStr: ... +def dirname(p: AnyStr) -> AnyStr: ... +def expanduser(path: AnyStr) -> AnyStr: ... +def expandvars(path: AnyStr) -> AnyStr: ... +def normcase(s: AnyStr) -> AnyStr: ... +def normpath(path: AnyStr) -> AnyStr: ... + +if sys.platform == "win32": + def realpath(path: AnyStr) -> AnyStr: ... + +else: + def realpath(filename: AnyStr) -> AnyStr: ... + +# NOTE: Empty lists results in '' (str) regardless of contained type. +# Also, in Python 2 mixed sequences of Text and bytes results in either Text or bytes +# So, fall back to Any +def commonprefix(m: Sequence[AnyPath]) -> Any: ... +def lexists(path: AnyPath) -> bool: ... + +# These return float if os.stat_float_times() == True, +# but int is a subclass of float. +def getatime(filename: AnyPath) -> float: ... +def getmtime(filename: AnyPath) -> float: ... +def getctime(filename: AnyPath) -> float: ... +def getsize(filename: AnyPath) -> int: ... +def isabs(s: AnyPath) -> bool: ... +def isfile(path: AnyPath) -> bool: ... +def isdir(s: AnyPath) -> bool: ... +def islink(path: AnyPath) -> bool: ... +def ismount(path: AnyPath) -> bool: ... + +# Make sure signatures are disjunct, and allow combinations of bytes and unicode. +# (Since Python 2 allows that, too) +# Note that e.g. os.path.join("a", "b", "c", "d", u"e") will still result in +# a type error. +@overload +def join(__p1: bytes, *p: bytes) -> bytes: ... +@overload +def join(__p1: bytes, __p2: bytes, __p3: bytes, __p4: Text, *p: AnyPath) -> Text: ... +@overload +def join(__p1: bytes, __p2: bytes, __p3: Text, *p: AnyPath) -> Text: ... +@overload +def join(__p1: bytes, __p2: Text, *p: AnyPath) -> Text: ... +@overload +def join(__p1: Text, *p: AnyPath) -> Text: ... +@overload +def relpath(path: BytesPath, start: Optional[BytesPath] = ...) -> bytes: ... +@overload +def relpath(path: StrPath, start: Optional[StrPath] = ...) -> Text: ... +def samefile(f1: AnyPath, f2: AnyPath) -> bool: ... +def sameopenfile(fp1: int, fp2: int) -> bool: ... +def samestat(s1: os.stat_result, s2: os.stat_result) -> bool: ... +def split(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ... +def splitdrive(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ... +def splitext(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + +if sys.platform == "win32": + def splitunc(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ... # deprecated + +def walk(path: AnyStr, visit: Callable[[_T, AnyStr, List[AnyStr]], Any], arg: _T) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/random.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/random.pyi old mode 100755 new mode 100644 index 65d323db..059bd936 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/random.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/random.pyi @@ -1,16 +1,8 @@ -# Stubs for random -# Ron Murawski -# Updated by Jukka Lehtosalo - -# based on https://docs.python.org/2/library/random.html - -# ----- random classes ----- - import _random -from typing import AbstractSet, Any, Callable, Iterator, List, Protocol, Sequence, TypeVar, Union, overload +from typing import AbstractSet, Any, Callable, Iterator, List, MutableSequence, Protocol, Sequence, TypeVar, Union, overload _T = TypeVar("_T") -_T_co = TypeVar('_T_co', covariant=True) +_T_co = TypeVar("_T_co", covariant=True) class _Sampleable(Protocol[_T_co]): def __iter__(self) -> Iterator[_T_co]: ... @@ -29,7 +21,7 @@ class Random(_random.Random): def randrange(self, start: int, stop: int, step: int = ...) -> int: ... def randint(self, a: int, b: int) -> int: ... def choice(self, seq: Sequence[_T]) -> _T: ... - def shuffle(self, x: List[Any], random: Callable[[], None] = ...) -> None: ... + def shuffle(self, x: MutableSequence[Any], random: Callable[[], None] = ...) -> None: ... def sample(self, population: _Sampleable[_T], k: int) -> List[_T]: ... def random(self) -> float: ... def uniform(self, a: float, b: float) -> float: ... @@ -45,8 +37,7 @@ class Random(_random.Random): def weibullvariate(self, alpha: float, beta: float) -> float: ... # SystemRandom is not implemented for all OS's; good on Windows & Linux -class SystemRandom(Random): - ... +class SystemRandom(Random): ... # ----- random function stubs ----- def seed(x: object = ...) -> None: ... @@ -60,12 +51,11 @@ def randrange(stop: int) -> int: ... def randrange(start: int, stop: int, step: int = ...) -> int: ... def randint(a: int, b: int) -> int: ... def choice(seq: Sequence[_T]) -> _T: ... -def shuffle(x: List[Any], random: Callable[[], float] = ...) -> None: ... +def shuffle(x: MutableSequence[Any], random: Callable[[], float] = ...) -> None: ... def sample(population: _Sampleable[_T], k: int) -> List[_T]: ... def random() -> float: ... def uniform(a: float, b: float) -> float: ... -def triangular(low: float = ..., high: float = ..., - mode: float = ...) -> float: ... +def triangular(low: float = ..., high: float = ..., mode: float = ...) -> float: ... def betavariate(alpha: float, beta: float) -> float: ... def expovariate(lambd: float) -> float: ... def gammavariate(alpha: float, beta: float) -> float: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/re.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/re.pyi old mode 100755 new mode 100644 index 71486692..11e3d02f --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/re.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/re.pyi @@ -1,12 +1,18 @@ -# Stubs for re -# Ron Murawski -# 'bytes' support added by Jukka Lehtosalo - -# based on: http: //docs.python.org/2.7/library/re.html - from typing import ( - List, Iterator, overload, Callable, Tuple, Sequence, Dict, - Generic, AnyStr, Match, Pattern, Any, Optional, Union + Any, + AnyStr, + Callable, + Dict, + Generic, + Iterator, + List, + Match, + Optional, + Pattern, + Sequence, + Tuple, + Union, + overload, ) # ----- re variables and constants ----- @@ -32,24 +38,20 @@ class error(Exception): ... def compile(pattern: AnyStr, flags: int = ...) -> Pattern[AnyStr]: ... @overload def compile(pattern: Pattern[AnyStr], flags: int = ...) -> Pattern[AnyStr]: ... - @overload def search(pattern: Union[str, unicode], string: AnyStr, flags: int = ...) -> Optional[Match[AnyStr]]: ... @overload def search(pattern: Union[Pattern[str], Pattern[unicode]], string: AnyStr, flags: int = ...) -> Optional[Match[AnyStr]]: ... - @overload def match(pattern: Union[str, unicode], string: AnyStr, flags: int = ...) -> Optional[Match[AnyStr]]: ... @overload def match(pattern: Union[Pattern[str], Pattern[unicode]], string: AnyStr, flags: int = ...) -> Optional[Match[AnyStr]]: ... - @overload -def split(pattern: Union[str, unicode], string: AnyStr, - maxsplit: int = ..., flags: int = ...) -> List[AnyStr]: ... +def split(pattern: Union[str, unicode], string: AnyStr, maxsplit: int = ..., flags: int = ...) -> List[AnyStr]: ... @overload -def split(pattern: Union[Pattern[str], Pattern[unicode]], string: AnyStr, - maxsplit: int = ..., flags: int = ...) -> List[AnyStr]: ... - +def split( + pattern: Union[Pattern[str], Pattern[unicode]], string: AnyStr, maxsplit: int = ..., flags: int = ... +) -> List[AnyStr]: ... @overload def findall(pattern: Union[str, unicode], string: AnyStr, flags: int = ...) -> List[Any]: ... @overload @@ -60,41 +62,47 @@ def findall(pattern: Union[Pattern[str], Pattern[unicode]], string: AnyStr, flag # matches are returned in the order found. Empty matches are included in the # result unless they touch the beginning of another match. @overload -def finditer(pattern: Union[str, unicode], string: AnyStr, - flags: int = ...) -> Iterator[Match[AnyStr]]: ... +def finditer(pattern: Union[str, unicode], string: AnyStr, flags: int = ...) -> Iterator[Match[AnyStr]]: ... @overload -def finditer(pattern: Union[Pattern[str], Pattern[unicode]], string: AnyStr, - flags: int = ...) -> Iterator[Match[AnyStr]]: ... - +def finditer(pattern: Union[Pattern[str], Pattern[unicode]], string: AnyStr, flags: int = ...) -> Iterator[Match[AnyStr]]: ... @overload -def sub(pattern: Union[str, unicode], repl: AnyStr, string: AnyStr, count: int = ..., - flags: int = ...) -> AnyStr: ... +def sub(pattern: Union[str, unicode], repl: AnyStr, string: AnyStr, count: int = ..., flags: int = ...) -> AnyStr: ... @overload -def sub(pattern: Union[str, unicode], repl: Callable[[Match[AnyStr]], AnyStr], - string: AnyStr, count: int = ..., flags: int = ...) -> AnyStr: ... +def sub( + pattern: Union[str, unicode], repl: Callable[[Match[AnyStr]], AnyStr], string: AnyStr, count: int = ..., flags: int = ... +) -> AnyStr: ... @overload -def sub(pattern: Union[Pattern[str], Pattern[unicode]], repl: AnyStr, string: AnyStr, count: int = ..., - flags: int = ...) -> AnyStr: ... +def sub( + pattern: Union[Pattern[str], Pattern[unicode]], repl: AnyStr, string: AnyStr, count: int = ..., flags: int = ... +) -> AnyStr: ... @overload -def sub(pattern: Union[Pattern[str], Pattern[unicode]], repl: Callable[[Match[AnyStr]], AnyStr], - string: AnyStr, count: int = ..., flags: int = ...) -> AnyStr: ... - +def sub( + pattern: Union[Pattern[str], Pattern[unicode]], + repl: Callable[[Match[AnyStr]], AnyStr], + string: AnyStr, + count: int = ..., + flags: int = ..., +) -> AnyStr: ... @overload -def subn(pattern: Union[str, unicode], repl: AnyStr, string: AnyStr, count: int = ..., - flags: int = ...) -> Tuple[AnyStr, int]: ... +def subn( + pattern: Union[str, unicode], repl: AnyStr, string: AnyStr, count: int = ..., flags: int = ... +) -> Tuple[AnyStr, int]: ... @overload -def subn(pattern: Union[str, unicode], repl: Callable[[Match[AnyStr]], AnyStr], - string: AnyStr, count: int = ..., - flags: int = ...) -> Tuple[AnyStr, int]: ... +def subn( + pattern: Union[str, unicode], repl: Callable[[Match[AnyStr]], AnyStr], string: AnyStr, count: int = ..., flags: int = ... +) -> Tuple[AnyStr, int]: ... @overload -def subn(pattern: Union[Pattern[str], Pattern[unicode]], repl: AnyStr, string: AnyStr, count: int = ..., - flags: int = ...) -> Tuple[AnyStr, int]: ... +def subn( + pattern: Union[Pattern[str], Pattern[unicode]], repl: AnyStr, string: AnyStr, count: int = ..., flags: int = ... +) -> Tuple[AnyStr, int]: ... @overload -def subn(pattern: Union[Pattern[str], Pattern[unicode]], repl: Callable[[Match[AnyStr]], AnyStr], - string: AnyStr, count: int = ..., - flags: int = ...) -> Tuple[AnyStr, int]: ... - +def subn( + pattern: Union[Pattern[str], Pattern[unicode]], + repl: Callable[[Match[AnyStr]], AnyStr], + string: AnyStr, + count: int = ..., + flags: int = ..., +) -> Tuple[AnyStr, int]: ... def escape(string: AnyStr) -> AnyStr: ... - def purge() -> None: ... def template(pattern: Union[AnyStr, Pattern[AnyStr]], flags: int = ...) -> Pattern[AnyStr]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/repr.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/repr.pyi old mode 100755 new mode 100644 index a24e59bc..bdb8822a --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/repr.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/repr.pyi @@ -30,4 +30,5 @@ class Repr: def _possibly_sorted(x) -> List[Any]: ... aRepr: Repr + def repr(x) -> str: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/resource.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/resource.pyi old mode 100755 new mode 100644 index 3763bc25..ad9502db --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/resource.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/resource.pyi @@ -1,8 +1,9 @@ -from typing import Tuple, NamedTuple +from typing import NamedTuple, Tuple class error(Exception): ... RLIM_INFINITY: int + def getrlimit(resource: int) -> Tuple[int, int]: ... def setrlimit(resource: int, limits: Tuple[int, int]) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/rfc822.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/rfc822.pyi old mode 100755 new mode 100644 index 20cd1d63..f536568b --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/rfc822.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/rfc822.pyi @@ -1,7 +1,3 @@ -# Stubs for rfc822 (Python 2) -# -# Based on stub generated by stubgen. - from typing import Any, Optional class Message: diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/robotparser.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/robotparser.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/runpy.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/runpy.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/sets.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/sets.pyi old mode 100755 new mode 100644 index 3ec4cae2..e0a65205 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/sets.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/sets.pyi @@ -1,9 +1,8 @@ -# Stubs for sets (Python 2) from typing import Any, Callable, Hashable, Iterable, Iterator, MutableMapping, Optional, TypeVar, Union -_T = TypeVar('_T') +_T = TypeVar("_T") _Setlike = Union[BaseSet[_T], Iterable[_T]] -_SelfT = TypeVar('_SelfT') +_SelfT = TypeVar("_SelfT") class BaseSet(Iterable[_T]): def __init__(self) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/sha.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/sha.pyi old mode 100755 new mode 100644 index 00ad4d9f..aac8c8bc --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/sha.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/sha.pyi @@ -1,5 +1,3 @@ -# Stubs for Python 2.7 sha stdlib module - class sha(object): def update(self, arg: str) -> None: ... def digest(self) -> str: ... @@ -7,5 +5,6 @@ class sha(object): def copy(self) -> sha: ... def new(string: str = ...) -> sha: ... + blocksize: int digest_size: int diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/shelve.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/shelve.pyi old mode 100755 new mode 100644 index 15828bc1..442c3fe3 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/shelve.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/shelve.pyi @@ -1,9 +1,10 @@ -from typing import Any, Dict, Iterator, List, Optional, Tuple import collections - +from typing import Any, Dict, Iterator, List, Optional, Tuple class Shelf(collections.MutableMapping[Any, Any]): - def __init__(self, dict: Dict[Any, Any], protocol: Optional[int] = ..., writeback: bool = ..., keyencoding: str = ...) -> None: ... + def __init__( + self, dict: Dict[Any, Any], protocol: Optional[int] = ..., writeback: bool = ..., keyencoding: str = ... + ) -> None: ... def __iter__(self) -> Iterator[str]: ... def keys(self) -> List[Any]: ... def __len__(self) -> int: ... @@ -20,7 +21,9 @@ class Shelf(collections.MutableMapping[Any, Any]): def sync(self) -> None: ... class BsdDbShelf(Shelf): - def __init__(self, dict: Dict[Any, Any], protocol: Optional[int] = ..., writeback: bool = ..., keyencoding: str = ...) -> None: ... + def __init__( + self, dict: Dict[Any, Any], protocol: Optional[int] = ..., writeback: bool = ..., keyencoding: str = ... + ) -> None: ... def set_location(self, key: Any) -> Tuple[str, Any]: ... def next(self) -> Tuple[str, Any]: ... def previous(self) -> Tuple[str, Any]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/shlex.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/shlex.pyi old mode 100755 new mode 100644 index a29b83eb..37c66723 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/shlex.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/shlex.pyi @@ -1,11 +1,11 @@ -from typing import Any, IO, List, Optional, TypeVar +from typing import IO, Any, List, Optional, Text, TypeVar, Union def split(s: Optional[str], comments: bool = ..., posix: bool = ...) -> List[str]: ... -_SLT = TypeVar('_SLT', bound=shlex) +_SLT = TypeVar("_SLT", bound=shlex) class shlex: - def __init__(self, instream: IO[Any] = ..., infile: IO[Any] = ..., posix: bool = ...) -> None: ... + def __init__(self, instream: Union[IO[Any], Text] = ..., infile: IO[Any] = ..., posix: bool = ...) -> None: ... def __iter__(self: _SLT) -> _SLT: ... def next(self) -> str: ... def get_token(self) -> Optional[str]: ... @@ -15,7 +15,6 @@ class shlex: def push_source(self, stream: IO[Any], filename: str = ...) -> None: ... def pop_source(self) -> IO[Any]: ... def error_leader(self, file: str = ..., line: int = ...) -> str: ... - commenters: str wordchars: str whitespace: str diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/signal.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/signal.pyi old mode 100755 new mode 100644 index 24bfbf07..c33ff19d --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/signal.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/signal.pyi @@ -1,5 +1,5 @@ -from typing import Callable, Any, Tuple, Union from types import FrameType +from typing import Any, Callable, Tuple, Union SIG_DFL: int = ... SIG_IGN: int = ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/smtplib.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/smtplib.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/spwd.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/spwd.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/sre_constants.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/sre_constants.pyi old mode 100755 new mode 100644 index 89d453ea..bc15754d --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/sre_constants.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/sre_constants.pyi @@ -1,5 +1,3 @@ -# Source: https://hg.python.org/cpython/file/2.7/Lib/sre_constants.py - from typing import Dict, List, TypeVar MAGIC: int @@ -72,7 +70,8 @@ CATEGORY_UNI_NOT_WORD: str CATEGORY_UNI_LINEBREAK: str CATEGORY_UNI_NOT_LINEBREAK: str -_T = TypeVar('_T') +_T = TypeVar("_T") + def makedict(list: List[_T]) -> Dict[_T, int]: ... OP_IGNORE: Dict[str, str] diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/sre_parse.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/sre_parse.pyi old mode 100755 new mode 100644 index d2375352..e2a0be4e --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/sre_parse.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/sre_parse.pyi @@ -1,5 +1,3 @@ -# Source: https://hg.python.org/cpython/file/2.7/Lib/sre_parse.py - from typing import Any, Dict, Iterable, List, Match, Optional, Pattern as _Pattern, Set, Tuple, Union SPECIAL_CHARS: str @@ -23,7 +21,6 @@ class Pattern: def closegroup(self, gid: int) -> None: ... def checkgroup(self, gid: int) -> bool: ... - _OpSubpatternType = Tuple[Optional[int], int, int, SubPattern] _OpGroupRefExistsType = Tuple[int, SubPattern, SubPattern] _OpInType = List[Tuple[str, int]] @@ -58,6 +55,8 @@ def isident(char: str) -> bool: ... def isdigit(char: str) -> bool: ... def isname(name: str) -> bool: ... def parse(str: str, flags: int = ..., pattern: Pattern = ...) -> SubPattern: ... + _Template = Tuple[List[Tuple[int, int]], List[Optional[int]]] + def parse_template(source: str, pattern: _Pattern[Any]) -> _Template: ... def expand_template(template: _Template, match: Match[Any]) -> str: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/stat.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/stat.pyi old mode 100755 new mode 100644 index 5230d670..b75c955d --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/stat.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/stat.pyi @@ -5,7 +5,6 @@ def S_ISREG(mode: int) -> bool: ... def S_ISFIFO(mode: int) -> bool: ... def S_ISLNK(mode: int) -> bool: ... def S_ISSOCK(mode: int) -> bool: ... - def S_IMODE(mode: int) -> int: ... def S_IFMT(mode: int) -> int: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/string.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/string.pyi old mode 100755 new mode 100644 index bf55e922..03a6a2df --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/string.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/string.pyi @@ -1,8 +1,4 @@ -# Stubs for string - -# Based on http://docs.python.org/3.2/library/string.html - -from typing import Any, AnyStr, Iterable, List, Mapping, Optional, overload, Sequence, Text, Tuple, Union +from typing import Any, AnyStr, Iterable, List, Mapping, Optional, Sequence, Text, Tuple, Union, overload ascii_letters: str ascii_lowercase: str @@ -18,6 +14,7 @@ uppercase: str whitespace: str def capwords(s: AnyStr, sep: AnyStr = ...) -> AnyStr: ... + # TODO: originally named 'from' def maketrans(_from: str, to: str) -> str: ... def atof(s: unicode) -> float: ... @@ -49,7 +46,6 @@ def replace(s: AnyStr, old: AnyStr, new: AnyStr, maxreplace: int = ...) -> AnySt class Template: template: Text - def __init__(self, template: Text) -> None: ... @overload def substitute(self, mapping: Union[Mapping[str, str], Mapping[unicode, str]] = ..., **kwds: str) -> str: ... @@ -63,13 +59,10 @@ class Template: # TODO(MichalPokorny): This is probably badly and/or loosely typed. class Formatter(object): def format(self, format_string: str, *args, **kwargs) -> str: ... - def vformat(self, format_string: str, args: Sequence[Any], - kwargs: Mapping[str, Any]) -> str: ... + def vformat(self, format_string: str, args: Sequence[Any], kwargs: Mapping[str, Any]) -> str: ... def parse(self, format_string: str) -> Iterable[Tuple[str, str, str, str]]: ... - def get_field(self, field_name: str, args: Sequence[Any], - kwargs: Mapping[str, Any]) -> Any: ... + def get_field(self, field_name: str, args: Sequence[Any], kwargs: Mapping[str, Any]) -> Any: ... def get_value(self, key: Union[int, str], args: Sequence[Any], kwargs: Mapping[str, Any]) -> Any: ... - def check_unused_args(self, used_args: Sequence[Union[int, str]], args: Sequence[Any], - kwargs: Mapping[str, Any]) -> None: ... + def check_unused_args(self, used_args: Sequence[Union[int, str]], args: Sequence[Any], kwargs: Mapping[str, Any]) -> None: ... def format_field(self, value: Any, format_spec: str) -> Any: ... def convert_field(self, value: Any, conversion: str) -> Any: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/stringold.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/stringold.pyi old mode 100755 new mode 100644 index ab3e764e..ea11da72 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/stringold.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/stringold.pyi @@ -1,4 +1,3 @@ -# Source: https://hg.python.org/cpython/file/2.7/Lib/stringold.py from typing import AnyStr, Iterable, List, Optional, Type whitespace: str @@ -15,7 +14,6 @@ atoi_error = ValueError atof_error = ValueError atol_error = ValueError - def lower(s: AnyStr) -> AnyStr: ... def upper(s: AnyStr) -> AnyStr: ... def swapcase(s: AnyStr) -> AnyStr: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/strop.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/strop.pyi old mode 100755 new mode 100644 index 578a4775..81035eaa --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/strop.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/strop.pyi @@ -1,5 +1,3 @@ -"""Stub file for the 'strop' module.""" - from typing import List, Sequence lowercase: str diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/subprocess.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/subprocess.pyi old mode 100755 new mode 100644 index b603e42c..b3a2e92e --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/subprocess.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/subprocess.pyi @@ -1,10 +1,4 @@ -# Stubs for subprocess - -# Based on http://docs.python.org/2/library/subprocess.html and Python 3 stub - -from typing import ( - Sequence, Any, Mapping, Callable, Tuple, IO, Union, Optional, List, Text, TypeVar, Generic, -) +from typing import IO, Any, Callable, Generic, List, Mapping, Optional, Sequence, Text, Tuple, TypeVar, Union _FILE = Union[None, int, IO[Any]] _TXT = Union[bytes, Text] @@ -12,50 +6,55 @@ _CMD = Union[_TXT, Sequence[_TXT]] _ENV = Union[Mapping[bytes, _TXT], Mapping[Text, _TXT]] # Same args as Popen.__init__ -def call(args: _CMD, - bufsize: int = ..., - executable: _TXT = ..., - stdin: _FILE = ..., - stdout: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: _TXT = ..., - env: _ENV = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ...) -> int: ... - -def check_call(args: _CMD, - bufsize: int = ..., - executable: _TXT = ..., - stdin: _FILE = ..., - stdout: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: _TXT = ..., - env: _ENV = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ...) -> int: ... +def call( + args: _CMD, + bufsize: int = ..., + executable: _TXT = ..., + stdin: _FILE = ..., + stdout: _FILE = ..., + stderr: _FILE = ..., + preexec_fn: Callable[[], Any] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_TXT] = ..., + env: Optional[_ENV] = ..., + universal_newlines: bool = ..., + startupinfo: Any = ..., + creationflags: int = ..., +) -> int: ... +def check_call( + args: _CMD, + bufsize: int = ..., + executable: _TXT = ..., + stdin: _FILE = ..., + stdout: _FILE = ..., + stderr: _FILE = ..., + preexec_fn: Callable[[], Any] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_TXT] = ..., + env: Optional[_ENV] = ..., + universal_newlines: bool = ..., + startupinfo: Any = ..., + creationflags: int = ..., +) -> int: ... # Same args as Popen.__init__ except for stdout -def check_output(args: _CMD, - bufsize: int = ..., - executable: _TXT = ..., - stdin: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: _TXT = ..., - env: _ENV = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ...) -> bytes: ... +def check_output( + args: _CMD, + bufsize: int = ..., + executable: _TXT = ..., + stdin: _FILE = ..., + stderr: _FILE = ..., + preexec_fn: Callable[[], Any] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_TXT] = ..., + env: Optional[_ENV] = ..., + universal_newlines: bool = ..., + startupinfo: Any = ..., + creationflags: int = ..., +) -> bytes: ... PIPE: int STDOUT: int @@ -66,14 +65,10 @@ class CalledProcessError(Exception): cmd: Any # morally: Optional[bytes] output: bytes - - def __init__(self, - returncode: int, - cmd: _CMD, - output: Optional[bytes] = ...) -> None: ... + def __init__(self, returncode: int, cmd: _CMD, output: Optional[bytes] = ...) -> None: ... # We use a dummy type variable used to make Popen generic like it is in python 3 -_T = TypeVar('_T', bound=bytes) +_T = TypeVar("_T", bound=bytes) class Popen(Generic[_T]): stdin: Optional[IO[bytes]] @@ -81,24 +76,24 @@ class Popen(Generic[_T]): stderr: Optional[IO[bytes]] pid: int returncode: int - - def __new__(cls, - args: _CMD, - bufsize: int = ..., - executable: Optional[_TXT] = ..., - stdin: Optional[_FILE] = ..., - stdout: Optional[_FILE] = ..., - stderr: Optional[_FILE] = ..., - preexec_fn: Optional[Callable[[], Any]] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_TXT] = ..., - env: Optional[_ENV] = ..., - universal_newlines: bool = ..., - startupinfo: Optional[Any] = ..., - creationflags: int = ...) -> Popen[bytes]: ... - - def poll(self) -> int: ... + def __new__( + cls, + args: _CMD, + bufsize: int = ..., + executable: Optional[_TXT] = ..., + stdin: Optional[_FILE] = ..., + stdout: Optional[_FILE] = ..., + stderr: Optional[_FILE] = ..., + preexec_fn: Optional[Callable[[], Any]] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_TXT] = ..., + env: Optional[_ENV] = ..., + universal_newlines: bool = ..., + startupinfo: Optional[Any] = ..., + creationflags: int = ..., + ) -> Popen[bytes]: ... + def poll(self) -> Optional[int]: ... def wait(self) -> int: ... # morally: -> Tuple[Optional[bytes], Optional[bytes]] def communicate(self, input: Optional[_TXT] = ...) -> Tuple[bytes, bytes]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/symbol.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/symbol.pyi old mode 100755 new mode 100644 index 55d25a6b..a3561fe6 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/symbol.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/symbol.pyi @@ -1,5 +1,3 @@ -# Stubs for symbol (Python 2) - from typing import Dict single_input: int diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/sys.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/sys.pyi old mode 100755 new mode 100644 index be688f5b..0136f345 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/sys.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/sys.pyi @@ -1,10 +1,5 @@ -"""Stubs for the 'sys' module.""" - -from typing import ( - IO, NoReturn, Union, List, Sequence, Any, Dict, Tuple, BinaryIO, Optional, - Callable, overload, Text, Type, -) -from types import FrameType, ModuleType, TracebackType, ClassType +from types import ClassType, FrameType, ModuleType, TracebackType +from typing import IO, Any, BinaryIO, Callable, Dict, List, NoReturn, Optional, Sequence, Text, Tuple, Type, Union, overload # The following type alias are stub-only and do not exist during runtime _ExcInfo = Tuple[Type[BaseException], BaseException, TracebackType] @@ -89,8 +84,8 @@ last_traceback: TracebackType meta_path: List[Any] path_hooks: List[Any] path_importer_cache: Dict[str, Any] -displayhook: Optional[Callable[[int], None]] -excepthook: Optional[Callable[[type, BaseException, TracebackType], None]] +displayhook: Callable[[object], Any] +excepthook: Callable[[Type[BaseException], BaseException, TracebackType], Any] exc_type: Optional[type] exc_value: Union[BaseException, ClassType] exc_traceback: TracebackType @@ -107,12 +102,11 @@ class _WindowsVersionType: product_type: Any def getwindowsversion() -> _WindowsVersionType: ... - def _clear_type_cache() -> None: ... def _current_frames() -> Dict[int, FrameType]: ... def _getframe(depth: int = ...) -> FrameType: ... def call_tracing(fn: Any, args: Any) -> Any: ... -def __displayhook__(value: int) -> None: ... +def __displayhook__(value: object) -> None: ... def __excepthook__(type_: type, value: BaseException, traceback: TracebackType) -> None: ... def exc_clear() -> None: ... def exc_info() -> _OptExcInfo: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/tempfile.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/tempfile.pyi old mode 100755 new mode 100644 index 536b391a..687e1078 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/tempfile.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/tempfile.pyi @@ -1,6 +1,6 @@ -from typing import Any, AnyStr, IO, Iterable, Iterator, List, Optional, overload, Text, Tuple, Union -from thread import LockType from random import Random +from thread import LockType +from typing import IO, Any, AnyStr, Iterable, Iterator, List, Optional, Text, Tuple, Union, overload TMP_MAX: int tempdir: str @@ -48,7 +48,6 @@ class _TemporaryFileWrapper(IO[str]): def write(self, s: Text) -> int: ... def writelines(self, lines: Iterable[str]) -> None: ... - # TODO text files def TemporaryFile( @@ -56,36 +55,30 @@ def TemporaryFile( bufsize: int = ..., suffix: Union[bytes, unicode] = ..., prefix: Union[bytes, unicode] = ..., - dir: Union[bytes, unicode] = ... -) -> _TemporaryFileWrapper: - ... - + dir: Union[bytes, unicode] = ..., +) -> _TemporaryFileWrapper: ... def NamedTemporaryFile( mode: Union[bytes, unicode] = ..., bufsize: int = ..., suffix: Union[bytes, unicode] = ..., prefix: Union[bytes, unicode] = ..., dir: Union[bytes, unicode] = ..., - delete: bool = ... -) -> _TemporaryFileWrapper: - ... - + delete: bool = ..., +) -> _TemporaryFileWrapper: ... def SpooledTemporaryFile( max_size: int = ..., mode: Union[bytes, unicode] = ..., buffering: int = ..., suffix: Union[bytes, unicode] = ..., prefix: Union[bytes, unicode] = ..., - dir: Union[bytes, unicode] = ... -) -> _TemporaryFileWrapper: - ... + dir: Union[bytes, unicode] = ..., +) -> _TemporaryFileWrapper: ... class TemporaryDirectory: name: Any - def __init__(self, - suffix: Union[bytes, unicode] = ..., - prefix: Union[bytes, unicode] = ..., - dir: Union[bytes, unicode] = ...) -> None: ... + def __init__( + self, suffix: Union[bytes, unicode] = ..., prefix: Union[bytes, unicode] = ..., dir: Union[bytes, unicode] = ... + ) -> None: ... def cleanup(self) -> None: ... def __enter__(self) -> Any: ... # Can be str or unicode def __exit__(self, type, value, traceback) -> None: ... @@ -93,8 +86,7 @@ class TemporaryDirectory: @overload def mkstemp() -> Tuple[int, str]: ... @overload -def mkstemp(suffix: AnyStr = ..., prefix: AnyStr = ..., dir: Optional[AnyStr] = ..., - text: bool = ...) -> Tuple[int, AnyStr]: ... +def mkstemp(suffix: AnyStr = ..., prefix: AnyStr = ..., dir: Optional[AnyStr] = ..., text: bool = ...) -> Tuple[int, AnyStr]: ... @overload def mkdtemp() -> str: ... @overload @@ -105,7 +97,6 @@ def mktemp() -> str: ... def mktemp(suffix: AnyStr = ..., prefix: AnyStr = ..., dir: Optional[AnyStr] = ...) -> AnyStr: ... def gettempdir() -> str: ... def gettempprefix() -> str: ... - def _candidate_tempdir_list() -> List[str]: ... def _get_candidate_names() -> Optional[_RandomNameSequence]: ... def _get_default_tempdir() -> str: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/textwrap.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/textwrap.pyi old mode 100755 new mode 100644 index 60498a65..c4147b4b --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/textwrap.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/textwrap.pyi @@ -1,4 +1,4 @@ -from typing import AnyStr, List, Dict, Pattern +from typing import AnyStr, Dict, List, Pattern class TextWrapper(object): width: int = ... @@ -19,43 +19,43 @@ class TextWrapper(object): unicode_whitespace_trans: Dict[int, int] = ... uspace: int = ... x: int = ... - def __init__( - self, - width: int = ..., - initial_indent: str = ..., - subsequent_indent: str = ..., - expand_tabs: bool = ..., - replace_whitespace: bool = ..., - fix_sentence_endings: bool = ..., - break_long_words: bool = ..., - drop_whitespace: bool = ..., - break_on_hyphens: bool = ...) -> None: - ... - + self, + width: int = ..., + initial_indent: str = ..., + subsequent_indent: str = ..., + expand_tabs: bool = ..., + replace_whitespace: bool = ..., + fix_sentence_endings: bool = ..., + break_long_words: bool = ..., + drop_whitespace: bool = ..., + break_on_hyphens: bool = ..., + ) -> None: ... def wrap(self, text: AnyStr) -> List[AnyStr]: ... def fill(self, text: AnyStr) -> AnyStr: ... -def wrap(text: AnyStr, - width: int = ..., - initial_indent: AnyStr = ..., - subsequent_indent: AnyStr = ..., - expand_tabs: bool = ..., - replace_whitespace: bool = ..., - fix_sentence_endings: bool = ..., - break_long_words: bool = ..., - drop_whitespace: bool = ..., - break_on_hyphens: bool = ...) -> List[AnyStr]: ... - -def fill(text: AnyStr, - width: int = ..., - initial_indent: AnyStr = ..., - subsequent_indent: AnyStr = ..., - expand_tabs: bool = ..., - replace_whitespace: bool = ..., - fix_sentence_endings: bool = ..., - break_long_words: bool = ..., - drop_whitespace: bool = ..., - break_on_hyphens: bool = ...) -> AnyStr: ... - +def wrap( + text: AnyStr, + width: int = ..., + initial_indent: AnyStr = ..., + subsequent_indent: AnyStr = ..., + expand_tabs: bool = ..., + replace_whitespace: bool = ..., + fix_sentence_endings: bool = ..., + break_long_words: bool = ..., + drop_whitespace: bool = ..., + break_on_hyphens: bool = ..., +) -> List[AnyStr]: ... +def fill( + text: AnyStr, + width: int = ..., + initial_indent: AnyStr = ..., + subsequent_indent: AnyStr = ..., + expand_tabs: bool = ..., + replace_whitespace: bool = ..., + fix_sentence_endings: bool = ..., + break_long_words: bool = ..., + drop_whitespace: bool = ..., + break_on_hyphens: bool = ..., +) -> AnyStr: ... def dedent(text: AnyStr) -> AnyStr: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/thread.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/thread.pyi old mode 100755 new mode 100644 index 5bc40f4b..b3ba062a --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/thread.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/thread.pyi @@ -1,5 +1,4 @@ -"""Stubs for the "thread" module.""" -from typing import Callable, Any +from typing import Any, Callable def _count() -> int: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/toaiff.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/toaiff.pyi old mode 100755 new mode 100644 index f3e1b29d..b70e026d --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/toaiff.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/toaiff.pyi @@ -1,6 +1,3 @@ -# Stubs for toaiff (Python 2) - -# Source: https://hg.python.org/cpython/file/2.7/Lib/toaiff.py from pipes import Template from typing import Dict, List diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/tokenize.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/tokenize.pyi old mode 100755 new mode 100644 index 43457b6a..86d5937d --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/tokenize.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/tokenize.pyi @@ -1,6 +1,4 @@ -# Automatically generated by pytype, manually fixed up. May still contain errors. - -from typing import Any, Callable, Dict, Generator, Iterator, List, Tuple, Union, Iterable +from typing import Any, Callable, Dict, Generator, Iterable, Iterator, List, Tuple, Union __author__: str __credits__: str @@ -123,7 +121,6 @@ def tokenize_loop(readline: Callable[[], str], tokeneater: Callable[[Tuple[int, def untokenize(iterable: Iterable[_TokenType]) -> str: ... class StopTokenizing(Exception): ... - class TokenError(Exception): ... class Untokenizer: diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/types.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/types.pyi old mode 100755 new mode 100644 index 47c52e88..cf57c632 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/types.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/types.pyi @@ -1,14 +1,11 @@ -# Stubs for types -# Note, all classes "defined" here require special handling. +from typing import Any, Callable, Dict, Iterable, Iterator, List, Optional, Tuple, Type, TypeVar, Union, overload -from typing import ( - Any, Callable, Dict, Iterable, Iterator, List, Optional, - Tuple, Type, TypeVar, Union, overload, -) +_T = TypeVar("_T") -_T = TypeVar('_T') +# Note, all classes "defined" here require special handling. class NoneType: ... + TypeType = type ObjectType = object @@ -43,7 +40,14 @@ class FunctionType: __dict__ = func_dict __globals__ = func_globals __name__ = func_name - def __init__(self, code: CodeType, globals: Dict[str, Any], name: Optional[str] = ..., argdefs: Optional[Tuple[object, ...]] = ..., closure: Optional[Tuple[_Cell, ...]] = ...) -> None: ... + def __init__( + self, + code: CodeType, + globals: Dict[str, Any], + name: Optional[str] = ..., + argdefs: Optional[Tuple[object, ...]] = ..., + closure: Optional[Tuple[_Cell, ...]] = ..., + ) -> None: ... def __call__(self, *args: Any, **kwargs: Any) -> Any: ... def __get__(self, obj: Optional[object], type: Optional[type]) -> UnboundMethodType: ... @@ -89,13 +93,16 @@ class GeneratorType: def __iter__(self) -> GeneratorType: ... def close(self) -> None: ... def next(self) -> Any: ... - def send(self, arg: Any) -> Any: ... + def send(self, __arg: Any) -> Any: ... @overload - def throw(self, val: BaseException) -> Any: ... + def throw( + self, __typ: Type[BaseException], __val: Union[BaseException, object] = ..., __tb: Optional[TracebackType] = ... + ) -> Any: ... @overload - def throw(self, typ: type, val: BaseException = ..., tb: TracebackType = ...) -> Any: ... + def throw(self, __typ: BaseException, __val: None = ..., __tb: Optional[TracebackType] = ...) -> Any: ... class ClassType: ... + class UnboundMethodType: im_class: type = ... im_func: FunctionType = ... @@ -113,6 +120,7 @@ MethodType = UnboundMethodType class BuiltinFunctionType: __self__: Optional[object] def __call__(self, *args: Any, **kwargs: Any) -> Any: ... + BuiltinMethodType = BuiltinFunctionType class ModuleType: @@ -123,6 +131,7 @@ class ModuleType: __path__: Optional[Iterable[str]] __dict__: Dict[str, Any] def __init__(self, name: str, doc: Optional[str] = ...) -> None: ... + FileType = file XRangeType = xrange @@ -145,10 +154,10 @@ class FrameType: f_locals: Dict[str, Any] f_restricted: bool f_trace: Callable[[], None] - def clear(self) -> None: ... SliceType = slice + class EllipsisType: ... class DictProxyType: @@ -176,6 +185,7 @@ class GetSetDescriptorType: def __get__(self, obj: Any, type: type = ...) -> Any: ... def __set__(self, obj: Any) -> None: ... def __delete__(self, obj: Any) -> None: ... + # Same type on Jython, different on CPython and PyPy, unknown on IronPython. class MemberDescriptorType: __name__: str diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/typing.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/typing.pyi old mode 100755 new mode 100644 index 45eb2e49..e134d174 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/typing.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/typing.pyi @@ -1,20 +1,35 @@ -# Stubs for typing (Python 2.7) - -from abc import abstractmethod, ABCMeta -from types import CodeType, FrameType, TracebackType import collections # Needed by aliases like DefaultDict, see mypy issue 2986 +from abc import ABCMeta, abstractmethod +from types import CodeType, FrameType, TracebackType # Definitions of special type checking related constructs. Their definitions # are not used, so their value does not matter. overload = object() Any = object() -TypeVar = object() + +class TypeVar: + __name__: str + __bound__: Optional[Type[Any]] + __constraints__: Tuple[Type[Any], ...] + __covariant__: bool + __contravariant__: bool + def __init__( + self, + name: str, + *constraints: Type[Any], + bound: Optional[Type[Any]] = ..., + covariant: bool = ..., + contravariant: bool = ..., + ) -> None: ... + _promote = object() class _SpecialForm(object): def __getitem__(self, typeargs: Any) -> object: ... +Union: _SpecialForm = ... +Optional: _SpecialForm = ... Tuple: _SpecialForm = ... Generic: _SpecialForm = ... Protocol: _SpecialForm = ... @@ -22,8 +37,10 @@ Callable: _SpecialForm = ... Type: _SpecialForm = ... ClassVar: _SpecialForm = ... Final: _SpecialForm = ... -_F = TypeVar('_F', bound=Callable[..., Any]) +_F = TypeVar("_F", bound=Callable[..., Any]) + def final(f: _F) -> _F: ... + Literal: _SpecialForm = ... # TypedDict is a (non-subscriptable) special form. TypedDict: object = ... @@ -36,45 +53,42 @@ class GenericMeta(type): ... NoReturn = Union[None] # These type variables are used by the container types. -_T = TypeVar('_T') -_S = TypeVar('_S') -_KT = TypeVar('_KT') # Key type. -_VT = TypeVar('_VT') # Value type. -_T_co = TypeVar('_T_co', covariant=True) # Any type covariant containers. -_V_co = TypeVar('_V_co', covariant=True) # Any type covariant containers. -_KT_co = TypeVar('_KT_co', covariant=True) # Key type covariant containers. -_VT_co = TypeVar('_VT_co', covariant=True) # Value type covariant containers. -_T_contra = TypeVar('_T_contra', contravariant=True) # Ditto contravariant. -_TC = TypeVar('_TC', bound=Type[object]) +_T = TypeVar("_T") +_S = TypeVar("_S") +_KT = TypeVar("_KT") # Key type. +_VT = TypeVar("_VT") # Value type. +_T_co = TypeVar("_T_co", covariant=True) # Any type covariant containers. +_V_co = TypeVar("_V_co", covariant=True) # Any type covariant containers. +_KT_co = TypeVar("_KT_co", covariant=True) # Key type covariant containers. +_VT_co = TypeVar("_VT_co", covariant=True) # Value type covariant containers. +_T_contra = TypeVar("_T_contra", contravariant=True) # Ditto contravariant. +_TC = TypeVar("_TC", bound=Type[object]) _C = TypeVar("_C", bound=Callable[..., Any]) no_type_check = object() + def no_type_check_decorator(decorator: _C) -> _C: ... # Type aliases and type constructors -class TypeAlias: +class _Alias: # Class for defining generic aliases for library types. - def __init__(self, target_type: type) -> None: ... def __getitem__(self, typeargs: Any) -> Any: ... -Union = TypeAlias(object) -Optional = TypeAlias(object) -List = TypeAlias(object) -Dict = TypeAlias(object) -DefaultDict = TypeAlias(object) -Set = TypeAlias(object) -FrozenSet = TypeAlias(object) -Counter = TypeAlias(object) -Deque = TypeAlias(object) +List = _Alias() +Dict = _Alias() +DefaultDict = _Alias() +Set = _Alias() +FrozenSet = _Alias() +Counter = _Alias() +Deque = _Alias() # Predefined type variables. -AnyStr = TypeVar('AnyStr', str, unicode) +AnyStr = TypeVar("AnyStr", str, unicode) # Abstract base classes. def runtime_checkable(cls: _TC) -> _TC: ... - @runtime_checkable class SupportsInt(Protocol, metaclass=ABCMeta): @abstractmethod @@ -127,13 +141,16 @@ class Iterator(Iterable[_T_co], Protocol[_T_co]): class Generator(Iterator[_T_co], Generic[_T_co, _T_contra, _V_co]): @abstractmethod def next(self) -> _T_co: ... - @abstractmethod - def send(self, value: _T_contra) -> _T_co: ... - + def send(self, __value: _T_contra) -> _T_co: ... + @overload + @abstractmethod + def throw( + self, __typ: Type[BaseException], __val: Union[BaseException, object] = ..., __tb: Optional[TracebackType] = ... + ) -> _T_co: ... + @overload @abstractmethod - def throw(self, typ: Type[BaseException], val: Optional[BaseException] = ..., - tb: TracebackType = ...) -> _T_co: ... + def throw(self, __typ: BaseException, __val: None = ..., __tb: Optional[TracebackType] = ...) -> _T_co: ... @abstractmethod def close(self) -> None: ... @property @@ -212,7 +229,6 @@ class AbstractSet(Iterable[_T_co], Container[_T_co], Generic[_T_co]): @abstractmethod def __len__(self) -> int: ... - class MutableSet(AbstractSet[_T], Generic[_T]): @abstractmethod def add(self, x: _T) -> None: ... @@ -231,30 +247,35 @@ class MappingView(object): def __len__(self) -> int: ... class ItemsView(MappingView, AbstractSet[Tuple[_KT_co, _VT_co]], Generic[_KT_co, _VT_co]): + def __init__(self, mapping: Mapping[_KT_co, _VT_co]) -> None: ... def __contains__(self, o: object) -> bool: ... def __iter__(self) -> Iterator[Tuple[_KT_co, _VT_co]]: ... class KeysView(MappingView, AbstractSet[_KT_co], Generic[_KT_co]): + def __init__(self, mapping: Mapping[_KT_co, _VT_co]) -> None: ... def __contains__(self, o: object) -> bool: ... def __iter__(self) -> Iterator[_KT_co]: ... class ValuesView(MappingView, Iterable[_VT_co], Generic[_VT_co]): + def __init__(self, mapping: Mapping[_KT_co, _VT_co]) -> None: ... def __contains__(self, o: object) -> bool: ... def __iter__(self) -> Iterator[_VT_co]: ... @runtime_checkable class ContextManager(Protocol[_T_co]): def __enter__(self) -> _T_co: ... - def __exit__(self, __exc_type: Optional[Type[BaseException]], - __exc_value: Optional[BaseException], - __traceback: Optional[TracebackType]) -> Optional[bool]: ... + def __exit__( + self, + __exc_type: Optional[Type[BaseException]], + __exc_value: Optional[BaseException], + __traceback: Optional[TracebackType], + ) -> Optional[bool]: ... class Mapping(Iterable[_KT], Container[_KT], Generic[_KT, _VT_co]): # TODO: We wish the key type could also be covariant, but that doesn't work, # see discussion in https: //github.com/python/typing/pull/273. @abstractmethod - def __getitem__(self, k: _KT) -> _VT_co: - ... + def __getitem__(self, k: _KT) -> _VT_co: ... # Mixin methods @overload def get(self, k: _KT) -> Optional[_VT_co]: ... @@ -276,7 +297,6 @@ class MutableMapping(Mapping[_KT, _VT], Generic[_KT, _VT]): def __setitem__(self, k: _KT, v: _VT) -> None: ... @abstractmethod def __delitem__(self, v: _KT) -> None: ... - def clear(self) -> None: ... @overload def pop(self, k: _KT) -> _VT: ... @@ -336,7 +356,6 @@ class IO(Iterator[AnyStr], Generic[AnyStr]): def write(self, s: AnyStr) -> int: ... @abstractmethod def writelines(self, lines: Iterable[AnyStr]) -> None: ... - @abstractmethod def next(self) -> AnyStr: ... @abstractmethod @@ -344,8 +363,9 @@ class IO(Iterator[AnyStr], Generic[AnyStr]): @abstractmethod def __enter__(self) -> IO[AnyStr]: ... @abstractmethod - def __exit__(self, t: Optional[Type[BaseException]], value: Optional[BaseException], - traceback: Optional[TracebackType]) -> Optional[bool]: ... + def __exit__( + self, t: Optional[Type[BaseException]], value: Optional[BaseException], traceback: Optional[TracebackType] + ) -> Optional[bool]: ... class BinaryIO(IO[str]): # TODO readinto @@ -387,25 +407,20 @@ class Match(Generic[AnyStr]): # Can be None if there are no groups or if the last group was unnamed; # otherwise matches the type of the pattern. lastgroup: Optional[Any] - def expand(self, template: Union[str, Text]) -> Any: ... - @overload def group(self, group1: int = ...) -> AnyStr: ... @overload def group(self, group1: str) -> AnyStr: ... @overload - def group(self, group1: int, group2: int, - *groups: int) -> Tuple[AnyStr, ...]: ... + def group(self, group1: int, group2: int, *groups: int) -> Tuple[AnyStr, ...]: ... @overload - def group(self, group1: str, group2: str, - *groups: str) -> Tuple[AnyStr, ...]: ... - + def group(self, group1: str, group2: str, *groups: str) -> Tuple[AnyStr, ...]: ... def groups(self, default: AnyStr = ...) -> Tuple[AnyStr, ...]: ... def groupdict(self, default: AnyStr = ...) -> Dict[str, AnyStr]: ... - def start(self, group: Union[int, str] = ...) -> int: ... - def end(self, group: Union[int, str] = ...) -> int: ... - def span(self, group: Union[int, str] = ...) -> Tuple[int, int]: ... + def start(self, __group: Union[int, str] = ...) -> int: ... + def end(self, __group: Union[int, str] = ...) -> int: ... + def span(self, __group: Union[int, str] = ...) -> Tuple[int, int]: ... @property def regs(self) -> Tuple[Tuple[int, int], ...]: ... # undocumented @@ -413,63 +428,49 @@ class Match(Generic[AnyStr]): # Pattern is generic over AnyStr (determining the type of its .pattern # attribute), but at the same time its methods take either bytes or # Text and return the same type, regardless of the type of the pattern. -_AnyStr2 = TypeVar('_AnyStr2', bytes, Text) +_AnyStr2 = TypeVar("_AnyStr2", bytes, Text) class Pattern(Generic[AnyStr]): flags: int groupindex: Dict[AnyStr, int] groups: int pattern: AnyStr - - def search(self, string: _AnyStr2, pos: int = ..., - endpos: int = ...) -> Optional[Match[_AnyStr2]]: ... - def match(self, string: _AnyStr2, pos: int = ..., - endpos: int = ...) -> Optional[Match[_AnyStr2]]: ... + def search(self, string: _AnyStr2, pos: int = ..., endpos: int = ...) -> Optional[Match[_AnyStr2]]: ... + def match(self, string: _AnyStr2, pos: int = ..., endpos: int = ...) -> Optional[Match[_AnyStr2]]: ... def split(self, string: _AnyStr2, maxsplit: int = ...) -> List[_AnyStr2]: ... # Returns either a list of _AnyStr2 or a list of tuples, depending on # whether there are groups in the pattern. - def findall(self, string: Union[bytes, Text], pos: int = ..., - endpos: int = ...) -> List[Any]: ... - def finditer(self, string: _AnyStr2, pos: int = ..., - endpos: int = ...) -> Iterator[Match[_AnyStr2]]: ... - + def findall(self, string: Union[bytes, Text], pos: int = ..., endpos: int = ...) -> List[Any]: ... + def finditer(self, string: _AnyStr2, pos: int = ..., endpos: int = ...) -> Iterator[Match[_AnyStr2]]: ... @overload - def sub(self, repl: _AnyStr2, string: _AnyStr2, - count: int = ...) -> _AnyStr2: ... + def sub(self, repl: _AnyStr2, string: _AnyStr2, count: int = ...) -> _AnyStr2: ... @overload - def sub(self, repl: Callable[[Match[_AnyStr2]], _AnyStr2], string: _AnyStr2, - count: int = ...) -> _AnyStr2: ... - + def sub(self, repl: Callable[[Match[_AnyStr2]], _AnyStr2], string: _AnyStr2, count: int = ...) -> _AnyStr2: ... @overload - def subn(self, repl: _AnyStr2, string: _AnyStr2, - count: int = ...) -> Tuple[_AnyStr2, int]: ... + def subn(self, repl: _AnyStr2, string: _AnyStr2, count: int = ...) -> Tuple[_AnyStr2, int]: ... @overload - def subn(self, repl: Callable[[Match[_AnyStr2]], _AnyStr2], string: _AnyStr2, - count: int = ...) -> Tuple[_AnyStr2, int]: ... + def subn(self, repl: Callable[[Match[_AnyStr2]], _AnyStr2], string: _AnyStr2, count: int = ...) -> Tuple[_AnyStr2, int]: ... # Functions def get_type_hints( - obj: Callable[..., Any], globalns: Optional[Dict[Text, Any]] = ..., localns: Optional[Dict[Text, Any]] = ..., + obj: Callable[..., Any], globalns: Optional[Dict[Text, Any]] = ..., localns: Optional[Dict[Text, Any]] = ... ) -> None: ... - @overload def cast(tp: Type[_T], obj: Any) -> _T: ... @overload def cast(tp: str, obj: Any) -> Any: ... +@overload +def cast(tp: object, obj: Any) -> Any: ... # Type constructors # NamedTuple is special-cased in the type checker class NamedTuple(Tuple[Any, ...]): _fields: Tuple[str, ...] - - def __init__(self, typename: Text, fields: Iterable[Tuple[Text, Any]] = ..., - **kwargs: Any) -> None: ... - + def __init__(self, typename: Text, fields: Iterable[Tuple[Text, Any]] = ..., **kwargs: Any) -> None: ... @classmethod def _make(cls: Type[_T], iterable: Iterable[Any]) -> _T: ... - def _asdict(self) -> Dict[str, Any]: ... def _replace(self: _T, **kwargs: Any) -> _T: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/unittest.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/unittest.pyi old mode 100755 new mode 100644 index 366a3735..57b73a76 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/unittest.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/unittest.pyi @@ -1,20 +1,37 @@ -# Stubs for unittest - -# Based on http://docs.python.org/2.7/library/unittest.html - -from typing import (Any, Callable, Dict, FrozenSet, Iterable, Iterator, - List, Mapping, NoReturn, Optional, overload, Pattern, - Sequence, Set, Text, TextIO, Tuple, Type, TypeVar, Union) -from abc import abstractmethod, ABCMeta import datetime import types +from abc import ABCMeta, abstractmethod +from typing import ( + Any, + Callable, + Dict, + FrozenSet, + Iterable, + Iterator, + List, + Mapping, + NoReturn, + Optional, + Pattern, + Sequence, + Set, + Text, + TextIO, + Tuple, + Type, + TypeVar, + Union, + overload, +) -_T = TypeVar('_T') -_FT = TypeVar('_FT') +_T = TypeVar("_T") +_FT = TypeVar("_FT") _ExceptionType = Union[Type[BaseException], Tuple[Type[BaseException], ...]] _Regexp = Union[Text, Pattern[Text]] +_SysExcInfoType = Union[Tuple[Type[BaseException], BaseException, types.TracebackType], Tuple[None, None, None]] + class Testable(metaclass=ABCMeta): @abstractmethod def run(self, result: TestResult) -> None: ... @@ -26,28 +43,27 @@ class Testable(metaclass=ABCMeta): # TODO ABC for test runners? class TestResult: - errors: List[Tuple[Testable, str]] - failures: List[Tuple[Testable, str]] - skipped: List[Tuple[Testable, str]] - expectedFailures: List[Tuple[Testable, str]] - unexpectedSuccesses: List[Testable] + errors: List[Tuple[TestCase, str]] + failures: List[Tuple[TestCase, str]] + skipped: List[Tuple[TestCase, str]] + expectedFailures: List[Tuple[TestCase, str]] + unexpectedSuccesses: List[TestCase] shouldStop: bool testsRun: int buffer: bool failfast: bool - def wasSuccessful(self) -> bool: ... def stop(self) -> None: ... - def startTest(self, test: Testable) -> None: ... - def stopTest(self, test: Testable) -> None: ... + def startTest(self, test: TestCase) -> None: ... + def stopTest(self, test: TestCase) -> None: ... def startTestRun(self) -> None: ... def stopTestRun(self) -> None: ... - def addError(self, test: Testable, err: Tuple[type, Any, Any]) -> None: ... # TODO - def addFailure(self, test: Testable, err: Tuple[type, Any, Any]) -> None: ... # TODO - def addSuccess(self, test: Testable) -> None: ... - def addSkip(self, test: Testable, reason: str) -> None: ... - def addExpectedFailure(self, test: Testable, err: str) -> None: ... - def addUnexpectedSuccess(self, test: Testable) -> None: ... + def addError(self, test: TestCase, err: _SysExcInfoType) -> None: ... + def addFailure(self, test: TestCase, err: _SysExcInfoType) -> None: ... + def addSuccess(self, test: TestCase) -> None: ... + def addSkip(self, test: TestCase, reason: str) -> None: ... + def addExpectedFailure(self, test: TestCase, err: str) -> None: ... + def addUnexpectedSuccess(self, test: TestCase) -> None: ... class _AssertRaisesBaseContext: expected: Any @@ -78,98 +94,76 @@ class TestCase(Testable): def assert_(self, expr: Any, msg: object = ...) -> None: ... def failUnless(self, expr: Any, msg: object = ...) -> None: ... def assertTrue(self, expr: Any, msg: object = ...) -> None: ... - def assertEqual(self, first: Any, second: Any, - msg: object = ...) -> None: ... - def assertEquals(self, first: Any, second: Any, - msg: object = ...) -> None: ... - def failUnlessEqual(self, first: Any, second: Any, - msg: object = ...) -> None: ... - def assertNotEqual(self, first: Any, second: Any, - msg: object = ...) -> None: ... - def assertNotEquals(self, first: Any, second: Any, - msg: object = ...) -> None: ... - def failIfEqual(self, first: Any, second: Any, - msg: object = ...) -> None: ... + def assertEqual(self, first: Any, second: Any, msg: object = ...) -> None: ... + def assertEquals(self, first: Any, second: Any, msg: object = ...) -> None: ... + def failUnlessEqual(self, first: Any, second: Any, msg: object = ...) -> None: ... + def assertNotEqual(self, first: Any, second: Any, msg: object = ...) -> None: ... + def assertNotEquals(self, first: Any, second: Any, msg: object = ...) -> None: ... + def failIfEqual(self, first: Any, second: Any, msg: object = ...) -> None: ... @overload - def assertAlmostEqual(self, first: float, second: float, - places: int = ..., msg: Any = ...) -> None: ... + def assertAlmostEqual(self, first: float, second: float, places: int = ..., msg: Any = ...) -> None: ... @overload - def assertAlmostEqual(self, first: float, second: float, *, - msg: Any = ..., delta: float = ...) -> None: ... + def assertAlmostEqual(self, first: float, second: float, *, msg: Any = ..., delta: float = ...) -> None: ... @overload - def assertAlmostEqual(self, first: datetime.datetime, - second: datetime.datetime, *, - msg: Any = ..., delta: datetime.timedelta = ...) -> None: ... + def assertAlmostEqual( + self, first: datetime.datetime, second: datetime.datetime, *, msg: Any = ..., delta: datetime.timedelta = ... + ) -> None: ... @overload - def assertAlmostEquals(self, first: float, second: float, - places: int = ..., msg: Any = ...) -> None: ... + def assertAlmostEquals(self, first: float, second: float, places: int = ..., msg: Any = ...) -> None: ... @overload - def assertAlmostEquals(self, first: float, second: float, *, - msg: Any = ..., delta: float = ...) -> None: ... + def assertAlmostEquals(self, first: float, second: float, *, msg: Any = ..., delta: float = ...) -> None: ... @overload - def assertAlmostEquals(self, first: datetime.datetime, - second: datetime.datetime, *, - msg: Any = ..., delta: datetime.timedelta = ...) -> None: ... - def failUnlessAlmostEqual(self, first: float, second: float, places: int = ..., - msg: object = ...) -> None: ... + def assertAlmostEquals( + self, first: datetime.datetime, second: datetime.datetime, *, msg: Any = ..., delta: datetime.timedelta = ... + ) -> None: ... + def failUnlessAlmostEqual(self, first: float, second: float, places: int = ..., msg: object = ...) -> None: ... @overload - def assertNotAlmostEqual(self, first: float, second: float, - places: int = ..., msg: Any = ...) -> None: ... + def assertNotAlmostEqual(self, first: float, second: float, places: int = ..., msg: Any = ...) -> None: ... @overload - def assertNotAlmostEqual(self, first: float, second: float, *, - msg: Any = ..., delta: float = ...) -> None: ... + def assertNotAlmostEqual(self, first: float, second: float, *, msg: Any = ..., delta: float = ...) -> None: ... @overload - def assertNotAlmostEqual(self, first: datetime.datetime, - second: datetime.datetime, *, - msg: Any = ..., delta: datetime.timedelta = ...) -> None: ... + def assertNotAlmostEqual( + self, first: datetime.datetime, second: datetime.datetime, *, msg: Any = ..., delta: datetime.timedelta = ... + ) -> None: ... @overload - def assertNotAlmostEquals(self, first: float, second: float, - places: int = ..., msg: Any = ...) -> None: ... + def assertNotAlmostEquals(self, first: float, second: float, places: int = ..., msg: Any = ...) -> None: ... @overload - def assertNotAlmostEquals(self, first: float, second: float, *, - msg: Any = ..., delta: float = ...) -> None: ... + def assertNotAlmostEquals(self, first: float, second: float, *, msg: Any = ..., delta: float = ...) -> None: ... @overload - def assertNotAlmostEquals(self, first: datetime.datetime, - second: datetime.datetime, *, - msg: Any = ..., delta: datetime.timedelta = ...) -> None: ... - def failIfAlmostEqual(self, first: float, second: float, places: int = ..., - msg: object = ..., - delta: float = ...) -> None: ... - def assertGreater(self, first: Any, second: Any, - msg: object = ...) -> None: ... - def assertGreaterEqual(self, first: Any, second: Any, - msg: object = ...) -> None: ... - def assertMultiLineEqual(self, first: str, second: str, - msg: object = ...) -> None: ... - def assertSequenceEqual(self, first: Sequence[Any], second: Sequence[Any], - msg: object = ..., seq_type: type = ...) -> None: ... - def assertListEqual(self, first: List[Any], second: List[Any], - msg: object = ...) -> None: ... - def assertTupleEqual(self, first: Tuple[Any, ...], second: Tuple[Any, ...], - msg: object = ...) -> None: ... - def assertSetEqual(self, first: Union[Set[Any], FrozenSet[Any]], - second: Union[Set[Any], FrozenSet[Any]], msg: object = ...) -> None: ... - def assertDictEqual(self, first: Dict[Any, Any], second: Dict[Any, Any], - msg: object = ...) -> None: ... - def assertLess(self, first: Any, second: Any, - msg: object = ...) -> None: ... - def assertLessEqual(self, first: Any, second: Any, - msg: object = ...) -> None: ... + def assertNotAlmostEquals( + self, first: datetime.datetime, second: datetime.datetime, *, msg: Any = ..., delta: datetime.timedelta = ... + ) -> None: ... + def failIfAlmostEqual( + self, first: float, second: float, places: int = ..., msg: object = ..., delta: float = ... + ) -> None: ... + def assertGreater(self, first: Any, second: Any, msg: object = ...) -> None: ... + def assertGreaterEqual(self, first: Any, second: Any, msg: object = ...) -> None: ... + def assertMultiLineEqual(self, first: str, second: str, msg: object = ...) -> None: ... + def assertSequenceEqual( + self, first: Sequence[Any], second: Sequence[Any], msg: object = ..., seq_type: type = ... + ) -> None: ... + def assertListEqual(self, first: List[Any], second: List[Any], msg: object = ...) -> None: ... + def assertTupleEqual(self, first: Tuple[Any, ...], second: Tuple[Any, ...], msg: object = ...) -> None: ... + def assertSetEqual( + self, first: Union[Set[Any], FrozenSet[Any]], second: Union[Set[Any], FrozenSet[Any]], msg: object = ... + ) -> None: ... + def assertDictEqual(self, first: Dict[Any, Any], second: Dict[Any, Any], msg: object = ...) -> None: ... + def assertLess(self, first: Any, second: Any, msg: object = ...) -> None: ... + def assertLessEqual(self, first: Any, second: Any, msg: object = ...) -> None: ... @overload def assertRaises(self, exception: _ExceptionType, callable: Callable[..., Any], *args: Any, **kwargs: Any) -> None: ... @overload def assertRaises(self, exception: _ExceptionType) -> _AssertRaisesContext: ... @overload - def assertRaisesRegexp(self, exception: _ExceptionType, regexp: _Regexp, callable: Callable[..., Any], *args: Any, **kwargs: Any) -> None: ... + def assertRaisesRegexp( + self, exception: _ExceptionType, regexp: _Regexp, callable: Callable[..., Any], *args: Any, **kwargs: Any + ) -> None: ... @overload def assertRaisesRegexp(self, exception: _ExceptionType, regexp: _Regexp) -> _AssertRaisesContext: ... def assertRegexpMatches(self, text: Text, regexp: _Regexp, msg: object = ...) -> None: ... def assertNotRegexpMatches(self, text: Text, regexp: _Regexp, msg: object = ...) -> None: ... def assertItemsEqual(self, first: Iterable[Any], second: Iterable[Any], msg: object = ...) -> None: ... - def assertDictContainsSubset(self, - expected: Mapping[Any, Any], - actual: Mapping[Any, Any], - msg: object = ...) -> None: ... + def assertDictContainsSubset(self, expected: Mapping[Any, Any], actual: Mapping[Any, Any], msg: object = ...) -> None: ... def addTypeEqualityFunc(self, typeobj: type, function: Callable[..., None]) -> None: ... @overload def failUnlessRaises(self, exception: _ExceptionType, callable: Callable[..., Any], *args: Any, **kwargs: Any) -> None: ... @@ -177,20 +171,14 @@ class TestCase(Testable): def failUnlessRaises(self, exception: _ExceptionType) -> _AssertRaisesContext: ... def failIf(self, expr: Any, msg: object = ...) -> None: ... def assertFalse(self, expr: Any, msg: object = ...) -> None: ... - def assertIs(self, first: object, second: object, - msg: object = ...) -> None: ... - def assertIsNot(self, first: object, second: object, - msg: object = ...) -> None: ... + def assertIs(self, first: object, second: object, msg: object = ...) -> None: ... + def assertIsNot(self, first: object, second: object, msg: object = ...) -> None: ... def assertIsNone(self, expr: Any, msg: object = ...) -> None: ... def assertIsNotNone(self, expr: Any, msg: object = ...) -> None: ... - def assertIn(self, first: _T, second: Iterable[_T], - msg: object = ...) -> None: ... - def assertNotIn(self, first: _T, second: Iterable[_T], - msg: object = ...) -> None: ... - def assertIsInstance(self, obj: Any, cls: Union[type, Tuple[type, ...]], - msg: object = ...) -> None: ... - def assertNotIsInstance(self, obj: Any, cls: Union[type, Tuple[type, ...]], - msg: object = ...) -> None: ... + def assertIn(self, first: _T, second: Iterable[_T], msg: object = ...) -> None: ... + def assertNotIn(self, first: _T, second: Iterable[_T], msg: object = ...) -> None: ... + def assertIsInstance(self, obj: Any, cls: Union[type, Tuple[type, ...]], msg: object = ...) -> None: ... + def assertNotIsInstance(self, obj: Any, cls: Union[type, Tuple[type, ...]], msg: object = ...) -> None: ... def fail(self, msg: object = ...) -> NoReturn: ... def countTestCases(self) -> int: ... def defaultTestResult(self) -> TestResult: ... @@ -202,12 +190,14 @@ class TestCase(Testable): def _formatMessage(self, msg: Optional[Text], standardMsg: Text) -> str: ... # undocumented def _getAssertEqualityFunc(self, first: Any, second: Any) -> Callable[..., None]: ... # undocumented -class FunctionTestCase(Testable): - def __init__(self, testFunc: Callable[[], None], - setUp: Optional[Callable[[], None]] = ..., - tearDown: Optional[Callable[[], None]] = ..., - description: Optional[str] = ...) -> None: ... - def run(self, result: TestResult) -> None: ... +class FunctionTestCase(TestCase): + def __init__( + self, + testFunc: Callable[[], None], + setUp: Optional[Callable[[], None]] = ..., + tearDown: Optional[Callable[[], None]] = ..., + description: Optional[str] = ..., + ) -> None: ... def debug(self) -> None: ... def countTestCases(self) -> int: ... @@ -224,31 +214,35 @@ class TestLoader: testMethodPrefix: str sortTestMethodsUsing: Optional[Callable[[str, str], int]] suiteClass: Callable[[List[TestCase]], TestSuite] - def loadTestsFromTestCase(self, - testCaseClass: Type[TestCase]) -> TestSuite: ... - def loadTestsFromModule(self, module: types.ModuleType = ..., - use_load_tests: bool = ...) -> TestSuite: ... - def loadTestsFromName(self, name: str = ..., - module: Optional[types.ModuleType] = ...) -> TestSuite: ... - def loadTestsFromNames(self, names: List[str] = ..., - module: Optional[types.ModuleType] = ...) -> TestSuite: ... - def discover(self, start_dir: str, pattern: str = ..., - top_level_dir: Optional[str] = ...) -> TestSuite: ... + def loadTestsFromTestCase(self, testCaseClass: Type[TestCase]) -> TestSuite: ... + def loadTestsFromModule(self, module: types.ModuleType = ..., use_load_tests: bool = ...) -> TestSuite: ... + def loadTestsFromName(self, name: str = ..., module: Optional[types.ModuleType] = ...) -> TestSuite: ... + def loadTestsFromNames(self, names: List[str] = ..., module: Optional[types.ModuleType] = ...) -> TestSuite: ... + def discover(self, start_dir: str, pattern: str = ..., top_level_dir: Optional[str] = ...) -> TestSuite: ... def getTestCaseNames(self, testCaseClass: Type[TestCase] = ...) -> List[str]: ... defaultTestLoader: TestLoader class TextTestResult(TestResult): def __init__(self, stream: TextIO, descriptions: bool, verbosity: int) -> None: ... + def getDescription(self, test: TestCase) -> str: ... # undocumented + def printErrors(self) -> None: ... # undocumented + def printErrorList(self, flavour: str, errors: List[Tuple[TestCase, str]]) -> None: ... # undocumented class TextTestRunner: - def __init__(self, stream: Optional[TextIO] = ..., descriptions: bool = ..., - verbosity: int = ..., failfast: bool = ..., buffer: bool = ..., - resultclass: Optional[Type[TestResult]] = ...) -> None: ... + def __init__( + self, + stream: Optional[TextIO] = ..., + descriptions: bool = ..., + verbosity: int = ..., + failfast: bool = ..., + buffer: bool = ..., + resultclass: Optional[Type[TestResult]] = ..., + ) -> None: ... def _makeResult(self) -> TestResult: ... + def run(self, test: Testable) -> TestResult: ... # undocumented -class SkipTest(Exception): - ... +class SkipTest(Exception): ... # TODO precise types def skipUnless(condition: Any, reason: Union[str, unicode]) -> Any: ... @@ -261,15 +255,19 @@ class TestProgram: result: TestResult def runTests(self) -> None: ... # undocumented -def main(module: Union[None, Text, types.ModuleType] = ..., defaultTest: Optional[str] = ..., - argv: Optional[Sequence[str]] = ..., - testRunner: Union[Type[TextTestRunner], TextTestRunner, None] = ..., - testLoader: TestLoader = ..., exit: bool = ..., verbosity: int = ..., - failfast: Optional[bool] = ..., catchbreak: Optional[bool] = ..., - buffer: Optional[bool] = ...) -> TestProgram: ... - +def main( + module: Union[None, Text, types.ModuleType] = ..., + defaultTest: Optional[str] = ..., + argv: Optional[Sequence[str]] = ..., + testRunner: Union[Type[TextTestRunner], TextTestRunner, None] = ..., + testLoader: TestLoader = ..., + exit: bool = ..., + verbosity: int = ..., + failfast: Optional[bool] = ..., + catchbreak: Optional[bool] = ..., + buffer: Optional[bool] = ..., +) -> TestProgram: ... def load_tests(loader: TestLoader, tests: TestSuite, pattern: Optional[Text]) -> TestSuite: ... - def installHandler() -> None: ... def registerResult(result: TestResult) -> None: ... def removeResult(result: TestResult) -> bool: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/urllib.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/urllib.pyi old mode 100755 new mode 100644 index fe044948..c719c1fa --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/urllib.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/urllib.pyi @@ -1,4 +1,4 @@ -from typing import Any, AnyStr, IO, List, Mapping, Sequence, Text, Tuple, TypeVar, Union +from typing import IO, Any, AnyStr, List, Mapping, Sequence, Text, Tuple, TypeVar, Union def url2pathname(pathname: AnyStr) -> AnyStr: ... def pathname2url(pathname: AnyStr) -> AnyStr: ... @@ -126,7 +126,6 @@ def unquote_plus(s: AnyStr) -> AnyStr: ... def quote(s: AnyStr, safe: Text = ...) -> AnyStr: ... def quote_plus(s: AnyStr, safe: Text = ...) -> AnyStr: ... def urlencode(query: Union[Sequence[Tuple[Any, Any]], Mapping[Any, Any]], doseq=...) -> str: ... - def getproxies() -> Mapping[str, str]: ... def proxy_bypass(host: str) -> Any: ... # Undocumented diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/urllib2.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/urllib2.pyi old mode 100755 new mode 100644 index 6611ad24..4468ad10 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/urllib2.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/urllib2.pyi @@ -1,8 +1,7 @@ - import ssl -from typing import Any, AnyStr, Dict, List, Union, Optional, Mapping, Callable, Sequence, Text, Tuple, Type -from urllib import addinfourl from httplib import HTTPConnectionProtocol, HTTPResponse +from typing import Any, AnyStr, Callable, Dict, List, Mapping, Optional, Sequence, Text, Tuple, Type, Union +from urllib import addinfourl _string = Union[str, unicode] @@ -23,9 +22,14 @@ class Request(object): type: Optional[str] origin_req_host = ... unredirected_hdrs: Dict[str, str] - - def __init__(self, url: str, data: Optional[str] = ..., headers: Dict[str, str] = ..., - origin_req_host: Optional[str] = ..., unverifiable: bool = ...) -> None: ... + def __init__( + self, + url: str, + data: Optional[str] = ..., + headers: Dict[str, str] = ..., + origin_req_host: Optional[str] = ..., + unverifiable: bool = ..., + ) -> None: ... def __getattr__(self, attr): ... def get_method(self) -> str: ... def add_data(self, data) -> None: ... @@ -47,23 +51,29 @@ class Request(object): class OpenerDirector(object): addheaders: List[Tuple[str, str]] - def add_handler(self, handler: BaseHandler) -> None: ... - def open(self, fullurl: Union[Request, _string], data: Optional[_string] = ..., timeout: Optional[float] = ...) -> Optional[addinfourl]: ... + def open( + self, fullurl: Union[Request, _string], data: Optional[_string] = ..., timeout: Optional[float] = ... + ) -> Optional[addinfourl]: ... def error(self, proto: _string, *args: Any): ... # Note that this type is somewhat a lie. The return *can* be None if # a custom opener has been installed that fails to handle the request. -def urlopen(url: Union[Request, _string], data: Optional[_string] = ..., timeout: Optional[float] = ..., - cafile: Optional[_string] = ..., capath: Optional[_string] = ..., cadefault: bool = ..., - context: Optional[ssl.SSLContext] = ...) -> addinfourl: ... +def urlopen( + url: Union[Request, _string], + data: Optional[_string] = ..., + timeout: Optional[float] = ..., + cafile: Optional[_string] = ..., + capath: Optional[_string] = ..., + cadefault: bool = ..., + context: Optional[ssl.SSLContext] = ..., +) -> addinfourl: ... def install_opener(opener: OpenerDirector) -> None: ... def build_opener(*handlers: Union[BaseHandler, Type[BaseHandler]]) -> OpenerDirector: ... class BaseHandler: handler_order: int parent: OpenerDirector - def add_parent(self, parent: OpenerDirector) -> None: ... def close(self) -> None: ... def __lt__(self, other: Any) -> bool: ... @@ -84,10 +94,8 @@ class HTTPRedirectHandler(BaseHandler): def http_error_307(self, req: Request, fp: addinfourl, code: int, msg: str, headers: Mapping[str, str]): ... inf_msg: str - class ProxyHandler(BaseHandler): proxies: Mapping[str, str] - def __init__(self, proxies: Optional[Mapping[str, str]] = ...): ... def proxy_open(self, req: Request, proxy, type): ... @@ -118,8 +126,7 @@ class AbstractDigestAuthHandler: def __init__(self, passwd: Optional[HTTPPasswordMgr] = ...) -> None: ... def add_password(self, realm: Optional[Text], uri: Union[Text, Sequence[Text]], user: Text, passwd: Text) -> None: ... def reset_retry_count(self) -> None: ... - def http_error_auth_reqed(self, auth_header: str, host: str, req: Request, - headers: Mapping[str, str]) -> None: ... + def http_error_auth_reqed(self, auth_header: str, host: str, req: Request, headers: Mapping[str, str]) -> None: ... def retry_http_digest_auth(self, req: Request, auth: str) -> Optional[HTTPResponse]: ... def get_cnonce(self, nonce: str) -> str: ... def get_authorization(self, req: Request, chal: Mapping[str, str]) -> str: ... @@ -140,10 +147,7 @@ class AbstractHTTPHandler(BaseHandler): # undocumented def __init__(self, debuglevel: int = ...) -> None: ... def set_http_debuglevel(self, level: int) -> None: ... def do_request_(self, request: Request) -> Request: ... - def do_open(self, - http_class: HTTPConnectionProtocol, - req: Request, - **http_conn_args: Optional[Any]) -> addinfourl: ... + def do_open(self, http_class: HTTPConnectionProtocol, req: Request, **http_conn_args: Optional[Any]) -> addinfourl: ... class HTTPHandler(AbstractHTTPHandler): def http_open(self, req: Request) -> addinfourl: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/urlparse.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/urlparse.pyi old mode 100755 new mode 100644 index 2ab28a7e..40691239 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/urlparse.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/urlparse.pyi @@ -1,6 +1,4 @@ -# Stubs for urlparse (Python 2) - -from typing import AnyStr, Dict, List, NamedTuple, Tuple, Sequence, Union, overload, Optional +from typing import AnyStr, Dict, List, NamedTuple, Optional, Sequence, Tuple, Union, overload _String = Union[str, unicode] @@ -31,6 +29,7 @@ class _SplitResult(NamedTuple): path: str query: str fragment: str + class SplitResult(_SplitResult, ResultMixin): def geturl(self) -> str: ... @@ -41,26 +40,22 @@ class _ParseResult(NamedTuple): params: str query: str fragment: str + class ParseResult(_ParseResult, ResultMixin): - def geturl(self) -> str: ... + def geturl(self) -> _String: ... -def urlparse(url: _String, scheme: _String = ..., - allow_fragments: bool = ...) -> ParseResult: ... -def urlsplit(url: _String, scheme: _String = ..., - allow_fragments: bool = ...) -> SplitResult: ... +def urlparse(url: _String, scheme: _String = ..., allow_fragments: bool = ...) -> ParseResult: ... +def urlsplit(url: _String, scheme: _String = ..., allow_fragments: bool = ...) -> SplitResult: ... @overload -def urlunparse(data: Tuple[_String, _String, _String, _String, _String, _String]) -> str: ... +def urlunparse(data: Tuple[AnyStr, AnyStr, AnyStr, AnyStr, AnyStr, AnyStr]) -> AnyStr: ... @overload -def urlunparse(data: Sequence[_String]) -> str: ... +def urlunparse(data: Sequence[AnyStr]) -> AnyStr: ... @overload -def urlunsplit(data: Tuple[_String, _String, _String, _String, _String]) -> str: ... +def urlunsplit(data: Tuple[AnyStr, AnyStr, AnyStr, AnyStr, AnyStr]) -> AnyStr: ... @overload -def urlunsplit(data: Sequence[_String]) -> str: ... -def urljoin(base: _String, url: _String, - allow_fragments: bool = ...) -> str: ... -def urldefrag(url: AnyStr) -> Tuple[AnyStr, str]: ... +def urlunsplit(data: Sequence[AnyStr]) -> AnyStr: ... +def urljoin(base: AnyStr, url: AnyStr, allow_fragments: bool = ...) -> AnyStr: ... +def urldefrag(url: AnyStr) -> Tuple[AnyStr, AnyStr]: ... def unquote(s: AnyStr) -> AnyStr: ... -def parse_qs(qs: AnyStr, keep_blank_values: bool = ..., - strict_parsing: bool = ...) -> Dict[AnyStr, List[AnyStr]]: ... -def parse_qsl(qs: AnyStr, keep_blank_values: int = ..., - strict_parsing: bool = ...) -> List[Tuple[AnyStr, AnyStr]]: ... +def parse_qs(qs: AnyStr, keep_blank_values: bool = ..., strict_parsing: bool = ...) -> Dict[AnyStr, List[AnyStr]]: ... +def parse_qsl(qs: AnyStr, keep_blank_values: int = ..., strict_parsing: bool = ...) -> List[Tuple[AnyStr, AnyStr]]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/user.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/user.pyi old mode 100755 new mode 100644 index e857a3a9..9c33922b --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/user.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/user.pyi @@ -1,9 +1,6 @@ -# Stubs for user (Python 2) - -# Docs: https://docs.python.org/2/library/user.html -# Source: https://hg.python.org/cpython/file/2.7/Lib/user.py from typing import Any def __getattr__(name) -> Any: ... + home: str pythonrc: str diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/whichdb.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/whichdb.pyi old mode 100755 new mode 100644 index b1a69f48..67542096 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/whichdb.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/whichdb.pyi @@ -1,5 +1,3 @@ -# Source: https://hg.python.org/cpython/file/2.7/Lib/whichdb.py - from typing import Optional, Text def whichdb(filename: Text) -> Optional[str]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/xmlrpclib.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/xmlrpclib.pyi old mode 100755 new mode 100644 index d1d29371..52e36b61 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2/xmlrpclib.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2/xmlrpclib.pyi @@ -1,13 +1,11 @@ -# Stubs for xmlrpclib (Python 2) - -from typing import Any, AnyStr, Callable, IO, Iterable, List, Mapping, MutableMapping, Optional, Tuple, Type, TypeVar, Union -from types import InstanceType from datetime import datetime -from time import struct_time +from gzip import GzipFile from httplib import HTTPConnection, HTTPResponse, HTTPSConnection from ssl import SSLContext from StringIO import StringIO -from gzip import GzipFile +from time import struct_time +from types import InstanceType +from typing import IO, Any, AnyStr, Callable, Iterable, List, Mapping, MutableMapping, Optional, Tuple, Type, TypeVar, Union _Unmarshaller = Any _timeTuple = Tuple[int, int, int, int, int, int, int, int, int] @@ -121,7 +119,7 @@ class Marshaller: Mapping[Any, Any], datetime, InstanceType, - ], + ] ], Fault, ], @@ -131,8 +129,18 @@ class Marshaller: def dump_bool(self, value: bool, write: Callable[[str], None]) -> None: ... def dump_long(self, value: long, write: Callable[[str], None]) -> None: ... def dump_double(self, value: float, write: Callable[[str], None]) -> None: ... - def dump_string(self, value: str, write: Callable[[str], None], escape: Callable[[AnyStr, Callable[[AnyStr, AnyStr, AnyStr], AnyStr]], AnyStr] = ...) -> None: ... - def dump_unicode(self, value: unicode, write: Callable[[str], None], escape: Callable[[AnyStr, Callable[[AnyStr, AnyStr, AnyStr], AnyStr]], AnyStr] = ...) -> None: ... + def dump_string( + self, + value: str, + write: Callable[[str], None], + escape: Callable[[AnyStr, Callable[[AnyStr, AnyStr, AnyStr], AnyStr]], AnyStr] = ..., + ) -> None: ... + def dump_unicode( + self, + value: unicode, + write: Callable[[str], None], + escape: Callable[[AnyStr, Callable[[AnyStr, AnyStr, AnyStr], AnyStr]], AnyStr] = ..., + ) -> None: ... def dump_array(self, value: Iterable[Any], write: Callable[[str], None]) -> None: ... def dump_struct( self, @@ -170,6 +178,7 @@ class Unmarshaller: class _MultiCallMethod: def __init__(self, call_list: List[Tuple[str, Tuple[Any, ...]]], name: str) -> None: ... + class MultiCallIterator: def __init__(self, results: List[Any]) -> None: ... @@ -187,7 +196,6 @@ def dumps( allow_none: bool = ..., ) -> str: ... def loads(data: str, use_datetime: bool = ...) -> Tuple[Tuple[Any, ...], Optional[str]]: ... - def gzip_encode(data: str) -> str: ... def gzip_decode(data: str, max_decode: int = ...) -> str: ... @@ -224,7 +232,16 @@ class SafeTransport(Transport): def make_connection(self, host: _hostDesc) -> HTTPSConnection: ... class ServerProxy: - def __init__(self, uri: str, transport: Optional[Transport] = ..., encoding: Optional[str] = ..., verbose: bool = ..., allow_none: bool = ..., use_datetime: bool = ..., context: Optional[SSLContext] = ...) -> None: ... + def __init__( + self, + uri: str, + transport: Optional[Transport] = ..., + encoding: Optional[str] = ..., + verbose: bool = ..., + allow_none: bool = ..., + use_datetime: bool = ..., + context: Optional[SSLContext] = ..., + ) -> None: ... def __getattr__(self, name: str) -> _Method: ... def __call__(self, attr: str) -> Optional[Transport]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/__future__.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/__future__.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/_bisect.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/_bisect.pyi old mode 100755 new mode 100644 index 38e7a7b3..1e909c2a --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/_bisect.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/_bisect.pyi @@ -1,11 +1,8 @@ -"""Stub file for the '_bisect' module.""" +from typing import MutableSequence, Optional, Sequence, TypeVar -from typing import Sequence, MutableSequence, TypeVar +_T = TypeVar("_T") -_T = TypeVar('_T') -def bisect(a: Sequence[_T], x: _T, lo: int = ..., hi: int = ...) -> int: ... -def bisect_left(a: Sequence[_T], x: _T, lo: int = ..., hi: int = ...) -> int: ... -def bisect_right(a: Sequence[_T], x: _T, lo: int = ..., hi: int = ...) -> int: ... -def insort(a: MutableSequence[_T], x: _T, lo: int = ..., hi: int = ...) -> None: ... -def insort_left(a: MutableSequence[_T], x: _T, lo: int = ..., hi: int = ...) -> None: ... -def insort_right(a: MutableSequence[_T], x: _T, lo: int = ..., hi: int = ...) -> None: ... +def bisect_left(a: Sequence[_T], x: _T, lo: int = ..., hi: Optional[int] = ...) -> int: ... +def bisect_right(a: Sequence[_T], x: _T, lo: int = ..., hi: Optional[int] = ...) -> int: ... +def insort_left(a: MutableSequence[_T], x: _T, lo: int = ..., hi: Optional[int] = ...) -> None: ... +def insort_right(a: MutableSequence[_T], x: _T, lo: int = ..., hi: Optional[int] = ...) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/_codecs.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/_codecs.pyi old mode 100755 new mode 100644 index c9762567..2316cdbb --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/_codecs.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/_codecs.pyi @@ -1,9 +1,6 @@ -"""Stub file for the '_codecs' module.""" - -import sys -from typing import Any, Callable, Tuple, Optional, Dict, Text, Union - import codecs +import sys +from typing import Any, Callable, Dict, Optional, Text, Tuple, Union # For convenience: _Handler = Callable[[Exception], Tuple[Text, int]] @@ -19,57 +16,67 @@ else: # This type is not exposed; it is defined in unicodeobject.c class _EncodingMap(object): def size(self) -> int: ... + _MapT = Union[Dict[int, int], _EncodingMap] -def register(search_function: Callable[[str], Any]) -> None: ... -def register_error(errors: Union[str, Text], handler: _Handler) -> None: ... -def lookup(encoding: Union[str, Text]) -> codecs.CodecInfo: ... -def lookup_error(name: Union[str, Text]) -> _Handler: ... +def register(__search_function: Callable[[str], Any]) -> None: ... +def register_error(__errors: Union[str, Text], __handler: _Handler) -> None: ... +def lookup(__encoding: Union[str, Text]) -> codecs.CodecInfo: ... +def lookup_error(__name: Union[str, Text]) -> _Handler: ... def decode(obj: Any, encoding: Union[str, Text] = ..., errors: _Errors = ...) -> Any: ... def encode(obj: Any, encoding: Union[str, Text] = ..., errors: _Errors = ...) -> Any: ... -def charmap_build(map: Text) -> _MapT: ... +def charmap_build(__map: Text) -> _MapT: ... +def ascii_decode(__data: _Decodable, __errors: _Errors = ...) -> Tuple[Text, int]: ... +def ascii_encode(__str: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ... + +if sys.version_info < (3, 2): + def charbuffer_encode(__data: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ... + +def charmap_decode(__data: _Decodable, __errors: _Errors = ..., __mapping: Optional[_MapT] = ...) -> Tuple[Text, int]: ... +def charmap_encode(__str: _Encodable, __errors: _Errors = ..., __mapping: Optional[_MapT] = ...) -> Tuple[bytes, int]: ... +def escape_decode(__data: _String, __errors: _Errors = ...) -> Tuple[str, int]: ... +def escape_encode(__data: bytes, __errors: _Errors = ...) -> Tuple[bytes, int]: ... +def latin_1_decode(__data: _Decodable, __errors: _Errors = ...) -> Tuple[Text, int]: ... +def latin_1_encode(__str: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ... +def raw_unicode_escape_decode(__data: _String, __errors: _Errors = ...) -> Tuple[Text, int]: ... +def raw_unicode_escape_encode(__str: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ... +def readbuffer_encode(__data: _String, __errors: _Errors = ...) -> Tuple[bytes, int]: ... +def unicode_escape_decode(__data: _String, __errors: _Errors = ...) -> Tuple[Text, int]: ... +def unicode_escape_encode(__str: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ... -def ascii_decode(data: _Decodable, errors: _Errors = ...) -> Tuple[Text, int]: ... -def ascii_encode(data: _Encodable, errors: _Errors = ...) -> Tuple[bytes, int]: ... -def charbuffer_encode(data: _Encodable, errors: _Errors = ...) -> Tuple[bytes, int]: ... -def charmap_decode(data: _Decodable, errors: _Errors = ..., mapping: Optional[_MapT] = ...) -> Tuple[Text, int]: ... -def charmap_encode(data: _Encodable, errors: _Errors, mapping: Optional[_MapT] = ...) -> Tuple[bytes, int]: ... -def escape_decode(data: _String, errors: _Errors = ...) -> Tuple[str, int]: ... -def escape_encode(data: bytes, errors: _Errors = ...) -> Tuple[bytes, int]: ... -def latin_1_decode(data: _Decodable, errors: _Errors = ...) -> Tuple[Text, int]: ... -def latin_1_encode(data: _Encodable, errors: _Errors = ...) -> Tuple[bytes, int]: ... -def raw_unicode_escape_decode(data: _String, errors: _Errors = ...) -> Tuple[Text, int]: ... -def raw_unicode_escape_encode(data: _Encodable, errors: _Errors = ...) -> Tuple[bytes, int]: ... -def readbuffer_encode(data: _String, errors: _Errors = ...) -> Tuple[bytes, int]: ... -def unicode_escape_decode(data: _String, errors: _Errors = ...) -> Tuple[Text, int]: ... -def unicode_escape_encode(data: _Encodable, errors: _Errors = ...) -> Tuple[bytes, int]: ... if sys.version_info < (3, 8): - def unicode_internal_decode(data: _String, errors: _Errors = ...) -> Tuple[Text, int]: ... - def unicode_internal_encode(data: _String, errors: _Errors = ...) -> Tuple[bytes, int]: ... -def utf_16_be_decode(data: _Decodable, errors: _Errors = ..., final: int = ...) -> Tuple[Text, int]: ... -def utf_16_be_encode(data: _Encodable, errors: _Errors = ...) -> Tuple[bytes, int]: ... -def utf_16_decode(data: _Decodable, errors: _Errors = ..., final: int = ...) -> Tuple[Text, int]: ... -def utf_16_encode(data: _Encodable, errors: _Errors = ..., byteorder: int = ...) -> Tuple[bytes, int]: ... -def utf_16_ex_decode(data: _Decodable, errors: _Errors = ..., final: int = ...) -> Tuple[Text, int, int]: ... -def utf_16_le_decode(data: _Decodable, errors: _Errors = ..., final: int = ...) -> Tuple[Text, int]: ... -def utf_16_le_encode(data: _Encodable, errors: _Errors = ...) -> Tuple[bytes, int]: ... -def utf_32_be_decode(data: _Decodable, errors: _Errors = ..., final: int = ...) -> Tuple[Text, int]: ... -def utf_32_be_encode(data: _Encodable, errors: _Errors = ...) -> Tuple[bytes, int]: ... -def utf_32_decode(data: _Decodable, errors: _Errors = ..., final: int = ...) -> Tuple[Text, int]: ... -def utf_32_encode(data: _Encodable, errors: _Errors = ..., byteorder: int = ...) -> Tuple[bytes, int]: ... -def utf_32_ex_decode(data: _Decodable, errors: _Errors = ..., final: int = ...) -> Tuple[Text, int, int]: ... -def utf_32_le_decode(data: _Decodable, errors: _Errors = ..., final: int = ...) -> Tuple[Text, int]: ... -def utf_32_le_encode(data: _Encodable, errors: _Errors = ...) -> Tuple[bytes, int]: ... -def utf_7_decode(data: _Decodable, errors: _Errors = ..., final: int = ...) -> Tuple[Text, int]: ... -def utf_7_encode(data: _Encodable, errors: _Errors = ...) -> Tuple[bytes, int]: ... -def utf_8_decode(data: _Decodable, errors: _Errors = ..., final: int = ...) -> Tuple[Text, int]: ... -def utf_8_encode(data: _Encodable, errors: _Errors = ...) -> Tuple[bytes, int]: ... + def unicode_internal_decode(__obj: _String, __errors: _Errors = ...) -> Tuple[Text, int]: ... + def unicode_internal_encode(__obj: _String, __errors: _Errors = ...) -> Tuple[bytes, int]: ... + +def utf_16_be_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int]: ... +def utf_16_be_encode(__str: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ... +def utf_16_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int]: ... +def utf_16_encode(__str: _Encodable, __errors: _Errors = ..., __byteorder: int = ...) -> Tuple[bytes, int]: ... +def utf_16_ex_decode( + __data: _Decodable, __errors: _Errors = ..., __byteorder: int = ..., __final: int = ... +) -> Tuple[Text, int, int]: ... +def utf_16_le_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int]: ... +def utf_16_le_encode(__str: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ... +def utf_32_be_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int]: ... +def utf_32_be_encode(__str: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ... +def utf_32_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int]: ... +def utf_32_encode(__str: _Encodable, __errors: _Errors = ..., __byteorder: int = ...) -> Tuple[bytes, int]: ... +def utf_32_ex_decode( + __data: _Decodable, __errors: _Errors = ..., __byteorder: int = ..., __final: int = ... +) -> Tuple[Text, int, int]: ... +def utf_32_le_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int]: ... +def utf_32_le_encode(__str: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ... +def utf_7_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int]: ... +def utf_7_encode(__str: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ... +def utf_8_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int]: ... +def utf_8_encode(__str: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ... -if sys.platform == 'win32': - def mbcs_decode(data: _Decodable, errors: _Errors = ..., final: int = ...) -> Tuple[Text, int]: ... - def mbcs_encode(str: _Encodable, errors: _Errors = ...) -> Tuple[bytes, int]: ... +if sys.platform == "win32": + def mbcs_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int]: ... + def mbcs_encode(__str: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ... if sys.version_info >= (3, 0): - def oem_decode(data: bytes, errors: _Errors = ..., final: int = ...) -> Tuple[Text, int]: ... - def code_page_decode(codepage: int, data: bytes, errors: _Errors = ..., final: int = ...) -> Tuple[Text, int]: ... - def oem_encode(str: Text, errors: _Errors = ...) -> Tuple[bytes, int]: ... - def code_page_encode(code_page: int, str: Text, errors: _Errors = ...) -> Tuple[bytes, int]: ... + def code_page_decode(__codepage: int, __data: bytes, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int]: ... + def code_page_encode(__code_page: int, __str: Text, __errors: _Errors = ...) -> Tuple[bytes, int]: ... + if sys.version_info >= (3, 6): + def oem_decode(__data: bytes, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int]: ... + def oem_encode(__str: Text, __errors: _Errors = ...) -> Tuple[bytes, int]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/_csv.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/_csv.pyi old mode 100755 new mode 100644 index 1c4c26ef..2b4b1a74 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/_csv.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/_csv.pyi @@ -1,6 +1,5 @@ import sys - -from typing import Any, Iterable, Iterator, List, Optional, Sequence, Text +from typing import Any, Iterable, Iterator, List, Optional, Protocol, Sequence, Text, Type, Union QUOTE_ALL: int QUOTE_MINIMAL: int @@ -20,6 +19,8 @@ class Dialect: strict: int def __init__(self) -> None: ... +_DialectLike = Union[str, Dialect, Type[Dialect]] + class _reader(Iterator[List[str]]): dialect: Dialect line_num: int @@ -32,16 +33,17 @@ class _writer: dialect: Dialect if sys.version_info >= (3, 5): - def writerow(self, row: Iterable[Any]) -> None: ... + def writerow(self, row: Iterable[Any]) -> Any: ... def writerows(self, rows: Iterable[Iterable[Any]]) -> None: ... else: - def writerow(self, row: Sequence[Any]) -> None: ... + def writerow(self, row: Sequence[Any]) -> Any: ... def writerows(self, rows: Iterable[Sequence[Any]]) -> None: ... +class _Writer(Protocol): + def write(self, s: str) -> Any: ... -# TODO: precise type -def writer(csvfile: Any, dialect: Any = ..., **fmtparams: Any) -> _writer: ... -def reader(csvfile: Iterable[Text], dialect: Any = ..., **fmtparams: Any) -> _reader: ... +def writer(csvfile: _Writer, dialect: _DialectLike = ..., **fmtparams: Any) -> _writer: ... +def reader(csvfile: Iterable[Text], dialect: _DialectLike = ..., **fmtparams: Any) -> _reader: ... def register_dialect(name: str, dialect: Any = ..., **fmtparams: Any) -> None: ... def unregister_dialect(name: str) -> None: ... def get_dialect(name: str) -> Dialect: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/_curses.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/_curses.pyi old mode 100755 new mode 100644 index 4126f36d..5e447a24 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/_curses.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/_curses.pyi @@ -1,5 +1,5 @@ import sys -from typing import Any, BinaryIO, IO, NamedTuple, Optional, Tuple, Union, overload +from typing import IO, Any, BinaryIO, NamedTuple, Optional, Tuple, Union, overload _chtype = Union[str, bytes, int] @@ -221,15 +221,15 @@ version: bytes def baudrate() -> int: ... def beep() -> None: ... def can_change_color() -> bool: ... -def cbreak(flag: bool = ...) -> None: ... -def color_content(color_number: int) -> Tuple[int, int, int]: ... -def color_pair(color_number: int) -> int: ... -def curs_set(visibility: int) -> int: ... +def cbreak(__flag: bool = ...) -> None: ... +def color_content(__color_number: int) -> Tuple[int, int, int]: ... +def color_pair(__color_number: int) -> int: ... +def curs_set(__visibility: int) -> int: ... def def_prog_mode() -> None: ... def def_shell_mode() -> None: ... -def delay_output(ms: int) -> None: ... +def delay_output(__ms: int) -> None: ... def doupdate() -> None: ... -def echo(flag: bool = ...) -> None: ... +def echo(__flag: bool = ...) -> None: ... def endwin() -> None: ... def erasechar() -> bytes: ... def filter() -> None: ... @@ -237,63 +237,78 @@ def flash() -> None: ... def flushinp() -> None: ... def getmouse() -> Tuple[int, int, int, int, int]: ... def getsyx() -> Tuple[int, int]: ... -def getwin(f: BinaryIO) -> _CursesWindow: ... -def halfdelay(tenths: int) -> None: ... +def getwin(__file: BinaryIO) -> _CursesWindow: ... +def halfdelay(__tenths: int) -> None: ... def has_colors() -> bool: ... def has_ic() -> bool: ... def has_il() -> bool: ... -def has_key(ch: int) -> bool: ... -def init_color(color_number: int, r: int, g: int, b: int) -> None: ... -def init_pair(pair_number: int, fg: int, bg: int) -> None: ... +def has_key(__key: int) -> bool: ... +def init_color(__color_number: int, __r: int, __g: int, __b: int) -> None: ... +def init_pair(__pair_number: int, __fg: int, __bg: int) -> None: ... def initscr() -> _CursesWindow: ... -def intrflush(ch: bool) -> None: ... -def is_term_resized(nlines: int, ncols: int) -> bool: ... +def intrflush(__flag: bool) -> None: ... +def is_term_resized(__nlines: int, __ncols: int) -> bool: ... def isendwin() -> bool: ... -def keyname(k: int) -> bytes: ... +def keyname(__key: int) -> bytes: ... def killchar() -> bytes: ... def longname() -> bytes: ... -def meta(yes: bool) -> None: ... -def mouseinterval(interval: int) -> None: ... -def mousemask(mousemask: int) -> Tuple[int, int]: ... -def napms(ms: int) -> int: ... -def newpad(nlines: int, ncols: int) -> _CursesWindow: ... -def newwin(nlines: int, ncols: int, begin_y: int = ..., begin_x: int = ...) -> _CursesWindow: ... -def nl(flag: bool = ...) -> None: ... +def meta(__yes: bool) -> None: ... +def mouseinterval(__interval: int) -> None: ... +def mousemask(__newmask: int) -> Tuple[int, int]: ... +def napms(__ms: int) -> int: ... +def newpad(__nlines: int, __ncols: int) -> _CursesWindow: ... +def newwin(__nlines: int, __ncols: int, __begin_y: int = ..., __begin_x: int = ...) -> _CursesWindow: ... +def nl(__flag: bool = ...) -> None: ... def nocbreak() -> None: ... def noecho() -> None: ... def nonl() -> None: ... def noqiflush() -> None: ... def noraw() -> None: ... -def pair_content(pair_number: int) -> Tuple[int, int]: ... -def pair_number(attr: int) -> int: ... -def putp(string: bytes) -> None: ... -def qiflush(flag: bool = ...) -> None: ... -def raw(flag: bool = ...) -> None: ... +def pair_content(__pair_number: int) -> Tuple[int, int]: ... +def pair_number(__attr: int) -> int: ... +def putp(__string: bytes) -> None: ... +def qiflush(__flag: bool = ...) -> None: ... +def raw(__flag: bool = ...) -> None: ... def reset_prog_mode() -> None: ... def reset_shell_mode() -> None: ... def resetty() -> None: ... -def resize_term(nlines: int, ncols: int) -> None: ... -def resizeterm(nlines: int, ncols: int) -> None: ... +def resize_term(__nlines: int, __ncols: int) -> None: ... +def resizeterm(__nlines: int, __ncols: int) -> None: ... def savetty() -> None: ... -def setsyx(y: int, x: int) -> None: ... -def setupterm(termstr: str = ..., fd: int = ...) -> None: ... +def setsyx(__y: int, __x: int) -> None: ... +def setupterm(term: Optional[str] = ..., fd: int = ...) -> None: ... def start_color() -> None: ... def termattrs() -> int: ... def termname() -> bytes: ... -def tigetflag(capname: str) -> int: ... -def tigetnum(capname: str) -> int: ... -def tigetstr(capname: str) -> bytes: ... -def tparm(fmt: bytes, i1: int = ..., i2: int = ..., i3: int = ..., i4: int = ..., i5: int = ..., i6: int = ..., i7: int = ..., i8: int = ..., i9: int = ...) -> bytes: ... -def typeahead(fd: int) -> None: ... -def unctrl(ch: _chtype) -> bytes: ... +def tigetflag(__capname: str) -> int: ... +def tigetnum(__capname: str) -> int: ... +def tigetstr(__capname: str) -> bytes: ... +def tparm( + __str: bytes, + __i1: int = ..., + __i2: int = ..., + __i3: int = ..., + __i4: int = ..., + __i5: int = ..., + __i6: int = ..., + __i7: int = ..., + __i8: int = ..., + __i9: int = ..., +) -> bytes: ... +def typeahead(__fd: int) -> None: ... +def unctrl(__ch: _chtype) -> bytes: ... + if sys.version_info >= (3, 3): - def unget_wch(ch: Union[int, str]) -> None: ... -def ungetch(ch: _chtype) -> None: ... -def ungetmouse(id: int, x: int, y: int, z: int, bstate: int) -> None: ... + def unget_wch(__ch: Union[int, str]) -> None: ... + +def ungetch(__ch: _chtype) -> None: ... +def ungetmouse(__id: int, __x: int, __y: int, __z: int, __bstate: int) -> None: ... + if sys.version_info >= (3, 5): def update_lines_cols() -> int: ... + def use_default_colors() -> None: ... -def use_env(flag: bool) -> None: ... +def use_env(__flag: bool) -> None: ... class error(Exception): ... @@ -316,8 +331,18 @@ class _CursesWindow: def attron(self, attr: int) -> None: ... def attrset(self, attr: int) -> None: ... def bkgd(self, ch: _chtype, attr: int = ...) -> None: ... - def bkgset(self, ch: _chtype, attr: int = ...) -> None: ... - def border(self, ls: _chtype = ..., rs: _chtype = ..., ts: _chtype = ..., bs: _chtype = ..., tl: _chtype = ..., tr: _chtype = ..., bl: _chtype = ..., br: _chtype = ...) -> None: ... + def bkgdset(self, ch: _chtype, attr: int = ...) -> None: ... + def border( + self, + ls: _chtype = ..., + rs: _chtype = ..., + ts: _chtype = ..., + bs: _chtype = ..., + tl: _chtype = ..., + tr: _chtype = ..., + bl: _chtype = ..., + br: _chtype = ..., + ) -> None: ... @overload def box(self) -> None: ... @overload @@ -415,11 +440,15 @@ class _CursesWindow: @overload def overlay(self, destwin: _CursesWindow) -> None: ... @overload - def overlay(self, destwin: _CursesWindow, sminrow: int, smincol: int, dminrow: int, dmincol: int, dmaxrow: int, dmaxcol: int) -> None: ... + def overlay( + self, destwin: _CursesWindow, sminrow: int, smincol: int, dminrow: int, dmincol: int, dmaxrow: int, dmaxcol: int + ) -> None: ... @overload def overwrite(self, destwin: _CursesWindow) -> None: ... @overload - def overwrite(self, destwin: _CursesWindow, sminrow: int, smincol: int, dminrow: int, dmincol: int, dmaxrow: int, dmaxcol: int) -> None: ... + def overwrite( + self, destwin: _CursesWindow, sminrow: int, smincol: int, dminrow: int, dmincol: int, dmaxrow: int, dmaxcol: int + ) -> None: ... def putwin(self, file: IO[Any]) -> None: ... def redrawln(self, beg: int, num: int) -> None: ... def redrawwin(self) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/_dummy_threading.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/_dummy_threading.pyi new file mode 100644 index 00000000..625ec7b5 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/_dummy_threading.pyi @@ -0,0 +1,187 @@ +import sys +from types import FrameType, TracebackType +from typing import Any, Callable, Iterable, List, Mapping, Optional, Text, Type, TypeVar, Union + +# TODO recursive type +_TF = Callable[[FrameType, str, Any], Optional[Callable[..., Any]]] + +_PF = Callable[[FrameType, str, Any], None] +_T = TypeVar("_T") + +__all__: List[str] + +def active_count() -> int: ... + +if sys.version_info < (3,): + def activeCount() -> int: ... + +def current_thread() -> Thread: ... +def currentThread() -> Thread: ... + +if sys.version_info >= (3,): + def get_ident() -> int: ... + +def enumerate() -> List[Thread]: ... + +if sys.version_info >= (3, 4): + def main_thread() -> Thread: ... + +if sys.version_info >= (3, 8): + from _thread import get_native_id as get_native_id + +def settrace(func: _TF) -> None: ... +def setprofile(func: Optional[_PF]) -> None: ... +def stack_size(size: int = ...) -> int: ... + +if sys.version_info >= (3,): + TIMEOUT_MAX: float + +class ThreadError(Exception): ... + +class local(object): + def __getattribute__(self, name: str) -> Any: ... + def __setattr__(self, name: str, value: Any) -> None: ... + def __delattr__(self, name: str) -> None: ... + +class Thread: + name: str + ident: Optional[int] + daemon: bool + if sys.version_info >= (3,): + def __init__( + self, + group: None = ..., + target: Optional[Callable[..., Any]] = ..., + name: Optional[str] = ..., + args: Iterable[Any] = ..., + kwargs: Mapping[str, Any] = ..., + *, + daemon: Optional[bool] = ..., + ) -> None: ... + else: + def __init__( + self, + group: None = ..., + target: Optional[Callable[..., Any]] = ..., + name: Optional[Text] = ..., + args: Iterable[Any] = ..., + kwargs: Mapping[Text, Any] = ..., + ) -> None: ... + def start(self) -> None: ... + def run(self) -> None: ... + def join(self, timeout: Optional[float] = ...) -> None: ... + def getName(self) -> str: ... + def setName(self, name: Text) -> None: ... + if sys.version_info >= (3, 8): + @property + def native_id(self) -> Optional[int]: ... # only available on some platforms + def is_alive(self) -> bool: ... + if sys.version_info < (3, 9): + def isAlive(self) -> bool: ... + def isDaemon(self) -> bool: ... + def setDaemon(self, daemonic: bool) -> None: ... + +class _DummyThread(Thread): ... + +class Lock: + def __init__(self) -> None: ... + def __enter__(self) -> bool: ... + def __exit__( + self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType] + ) -> Optional[bool]: ... + if sys.version_info >= (3,): + def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ... + else: + def acquire(self, blocking: bool = ...) -> bool: ... + def release(self) -> None: ... + def locked(self) -> bool: ... + +class _RLock: + def __init__(self) -> None: ... + def __enter__(self) -> bool: ... + def __exit__( + self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType] + ) -> Optional[bool]: ... + if sys.version_info >= (3,): + def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ... + else: + def acquire(self, blocking: bool = ...) -> bool: ... + def release(self) -> None: ... + +RLock = _RLock + +class Condition: + def __init__(self, lock: Union[Lock, _RLock, None] = ...) -> None: ... + def __enter__(self) -> bool: ... + def __exit__( + self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType] + ) -> Optional[bool]: ... + if sys.version_info >= (3,): + def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ... + else: + def acquire(self, blocking: bool = ...) -> bool: ... + def release(self) -> None: ... + def wait(self, timeout: Optional[float] = ...) -> bool: ... + if sys.version_info >= (3,): + def wait_for(self, predicate: Callable[[], _T], timeout: Optional[float] = ...) -> _T: ... + def notify(self, n: int = ...) -> None: ... + def notify_all(self) -> None: ... + def notifyAll(self) -> None: ... + +class Semaphore: + def __init__(self, value: int = ...) -> None: ... + def __enter__(self) -> bool: ... + def __exit__( + self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType] + ) -> Optional[bool]: ... + if sys.version_info >= (3,): + def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ... + else: + def acquire(self, blocking: bool = ...) -> bool: ... + if sys.version_info >= (3, 9): + def release(self, n: int = ...) -> None: ... + else: + def release(self) -> None: ... + +class BoundedSemaphore(Semaphore): ... + +class Event: + def __init__(self) -> None: ... + def is_set(self) -> bool: ... + if sys.version_info < (3,): + def isSet(self) -> bool: ... + def set(self) -> None: ... + def clear(self) -> None: ... + def wait(self, timeout: Optional[float] = ...) -> bool: ... + +if sys.version_info >= (3, 8): + from _thread import _excepthook, _ExceptHookArgs + + excepthook = _excepthook + ExceptHookArgs = _ExceptHookArgs + +class Timer(Thread): + if sys.version_info >= (3,): + def __init__( + self, + interval: float, + function: Callable[..., Any], + args: Optional[Iterable[Any]] = ..., + kwargs: Optional[Mapping[str, Any]] = ..., + ) -> None: ... + else: + def __init__( + self, interval: float, function: Callable[..., Any], args: Iterable[Any] = ..., kwargs: Mapping[str, Any] = ... + ) -> None: ... + def cancel(self) -> None: ... + +if sys.version_info >= (3,): + class Barrier: + parties: int + n_waiting: int + broken: bool + def __init__(self, parties: int, action: Optional[Callable[[], None]] = ..., timeout: Optional[float] = ...) -> None: ... + def wait(self, timeout: Optional[float] = ...) -> int: ... + def reset(self) -> None: ... + def abort(self) -> None: ... + class BrokenBarrierError(RuntimeError): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/_heapq.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/_heapq.pyi old mode 100755 new mode 100644 index 2fc4e048..673c03e8 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/_heapq.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/_heapq.pyi @@ -1,15 +1,14 @@ -"""Stub file for the '_heapq' module.""" - -from typing import TypeVar, List, Iterable, Any, Callable, Optional import sys +from typing import Any, Callable, Iterable, List, Optional, TypeVar _T = TypeVar("_T") -def heapify(heap: List[_T]) -> None: ... -def heappop(heap: List[_T]) -> _T: ... -def heappush(heap: List[_T], item: _T) -> None: ... -def heappushpop(heap: List[_T], item: _T) -> _T: ... -def heapreplace(heap: List[_T], item: _T) -> _T: ... +def heapify(__heap: List[_T]) -> None: ... +def heappop(__heap: List[_T]) -> _T: ... +def heappush(__heap: List[_T], __item: _T) -> None: ... +def heappushpop(__heap: List[_T], __item: _T) -> _T: ... +def heapreplace(__heap: List[_T], __item: _T) -> _T: ... + if sys.version_info < (3,): - def nlargest(n: int, iterable: Iterable[_T]) -> List[_T]: ... - def nsmallest(n: int, iterable: Iterable[_T]) -> List[_T]: ... + def nlargest(__n: int, __iterable: Iterable[_T], __key: Optional[Callable[[_T], Any]] = ...) -> List[_T]: ... + def nsmallest(__n: int, __iterable: Iterable[_T], __key: Optional[Callable[[_T], Any]] = ...) -> List[_T]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/_msi.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/_msi.pyi new file mode 100644 index 00000000..a8f9c60b --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/_msi.pyi @@ -0,0 +1,49 @@ +import sys +from typing import List, Optional, Union + +if sys.platform == "win32": + + # Actual typename View, not exposed by the implementation + class _View: + def Execute(self, params: Optional[_Record] = ...) -> None: ... + def GetColumnInfo(self, kind: int) -> _Record: ... + def Fetch(self) -> _Record: ... + def Modify(self, mode: int, record: _Record) -> None: ... + def Close(self) -> None: ... + # Don't exist at runtime + __new__: None # type: ignore + __init__: None # type: ignore + # Actual typename Summary, not exposed by the implementation + class _Summary: + def GetProperty(self, propid: int) -> Optional[Union[str, bytes]]: ... + def GetPropertyCount(self) -> int: ... + def SetProperty(self, propid: int, value: Union[str, bytes]) -> None: ... + def Persist(self) -> None: ... + # Don't exist at runtime + __new__: None # type: ignore + __init__: None # type: ignore + # Actual typename Database, not exposed by the implementation + class _Database: + def OpenView(self, sql: str) -> _View: ... + def Commit(self) -> None: ... + def GetSummaryInformation(self, updateCount: int) -> _Summary: ... + def Close(self) -> None: ... + # Don't exist at runtime + __new__: None # type: ignore + __init__: None # type: ignore + # Actual typename Record, not exposed by the implementation + class _Record: + def GetFieldCount(self) -> int: ... + def GetInteger(self, field: int) -> int: ... + def GetString(self, field: int) -> str: ... + def SetString(self, field: int, str: str) -> None: ... + def SetStream(self, field: int, stream: str) -> None: ... + def SetInteger(self, field: int, int: int) -> None: ... + def ClearData(self) -> None: ... + # Don't exist at runtime + __new__: None # type: ignore + __init__: None # type: ignore + def UuidCreate() -> str: ... + def FCICreate(cabname: str, files: List[str]) -> None: ... + def OpenDatabase(name: str, flags: int) -> _Database: ... + def CreateRecord(count: int) -> _Record: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/_random.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/_random.pyi old mode 100755 new mode 100644 index a37149da..aa096934 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/_random.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/_random.pyi @@ -1,5 +1,3 @@ -# Stubs for _random - import sys from typing import Tuple @@ -8,10 +6,10 @@ _State = Tuple[int, ...] class Random(object): def __init__(self, seed: object = ...) -> None: ... - def seed(self, x: object = ...) -> None: ... + def seed(self, __n: object = ...) -> None: ... def getstate(self) -> _State: ... - def setstate(self, state: _State) -> None: ... + def setstate(self, __state: _State) -> None: ... def random(self) -> float: ... - def getrandbits(self, k: int) -> int: ... + def getrandbits(self, __k: int) -> int: ... if sys.version_info < (3,): def jumpahead(self, i: int) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/_typeshed/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/_typeshed/__init__.pyi new file mode 100644 index 00000000..c74f495d --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/_typeshed/__init__.pyi @@ -0,0 +1,183 @@ +# Utility types for typeshed + +# This module contains various common types to be used by typeshed. The +# module and its types do not exist at runtime. You can use this module +# outside of typeshed, but no API stability guarantees are made. To use +# it in implementation (.py) files, the following construct must be used: +# +# from typing import TYPE_CHECKING +# if TYPE_CHECKING: +# from _typeshed import ... +# +# If on Python versions < 3.10 and "from __future__ import annotations" +# is not used, types from this module must be quoted. + +import array +import mmap +import sys +from typing import AbstractSet, Any, Container, Iterable, Protocol, Text, Tuple, TypeVar, Union +from typing_extensions import Literal, final + +_KT = TypeVar("_KT") +_KT_co = TypeVar("_KT_co", covariant=True) +_KT_contra = TypeVar("_KT_contra", contravariant=True) +_VT = TypeVar("_VT") +_VT_co = TypeVar("_VT_co", covariant=True) +_T_co = TypeVar("_T_co", covariant=True) +_T_contra = TypeVar("_T_contra", contravariant=True) + +class SupportsLessThan(Protocol): + def __lt__(self, __other: Any) -> bool: ... + +SupportsLessThanT = TypeVar("SupportsLessThanT", bound=SupportsLessThan) # noqa: Y001 + +# Mapping-like protocols + +class SupportsItems(Protocol[_KT_co, _VT_co]): + if sys.version_info >= (3,): + def items(self) -> AbstractSet[Tuple[_KT_co, _VT_co]]: ... + else: + # We want dictionaries to support this on Python 2. + def items(self) -> Iterable[Tuple[_KT_co, _VT_co]]: ... + +class SupportsKeysAndGetItem(Protocol[_KT, _VT_co]): + def keys(self) -> Iterable[_KT]: ... + def __getitem__(self, __k: _KT) -> _VT_co: ... + +class SupportsGetItem(Container[_KT_contra], Protocol[_KT_contra, _VT_co]): + def __getitem__(self, __k: _KT_contra) -> _VT_co: ... + +class SupportsItemAccess(SupportsGetItem[_KT_contra, _VT], Protocol[_KT_contra, _VT]): + def __setitem__(self, __k: _KT_contra, __v: _VT) -> None: ... + def __delitem__(self, __v: _KT_contra) -> None: ... + +# StrPath and AnyPath can be used in places where a +# path can be used instead of a string, starting with Python 3.6. +if sys.version_info >= (3, 6): + from os import PathLike + + StrPath = Union[str, PathLike[str]] + BytesPath = Union[bytes, PathLike[bytes]] + AnyPath = Union[str, bytes, PathLike[str], PathLike[bytes]] +else: + StrPath = Text + BytesPath = bytes + AnyPath = Union[Text, bytes] + +OpenTextMode = Literal[ + "r", + "r+", + "+r", + "rt", + "tr", + "rt+", + "r+t", + "+rt", + "tr+", + "t+r", + "+tr", + "w", + "w+", + "+w", + "wt", + "tw", + "wt+", + "w+t", + "+wt", + "tw+", + "t+w", + "+tw", + "a", + "a+", + "+a", + "at", + "ta", + "at+", + "a+t", + "+at", + "ta+", + "t+a", + "+ta", + "x", + "x+", + "+x", + "xt", + "tx", + "xt+", + "x+t", + "+xt", + "tx+", + "t+x", + "+tx", + "U", + "rU", + "Ur", + "rtU", + "rUt", + "Urt", + "trU", + "tUr", + "Utr", +] +OpenBinaryModeUpdating = Literal[ + "rb+", + "r+b", + "+rb", + "br+", + "b+r", + "+br", + "wb+", + "w+b", + "+wb", + "bw+", + "b+w", + "+bw", + "ab+", + "a+b", + "+ab", + "ba+", + "b+a", + "+ba", + "xb+", + "x+b", + "+xb", + "bx+", + "b+x", + "+bx", +] +OpenBinaryModeWriting = Literal["wb", "bw", "ab", "ba", "xb", "bx"] +OpenBinaryModeReading = Literal["rb", "br", "rbU", "rUb", "Urb", "brU", "bUr", "Ubr"] +OpenBinaryMode = Union[OpenBinaryModeUpdating, OpenBinaryModeReading, OpenBinaryModeWriting] + +class HasFileno(Protocol): + def fileno(self) -> int: ... + +FileDescriptor = int +FileDescriptorLike = Union[int, HasFileno] + +class SupportsRead(Protocol[_T_co]): + def read(self, __length: int = ...) -> _T_co: ... + +class SupportsReadline(Protocol[_T_co]): + def readline(self, __length: int = ...) -> _T_co: ... + +class SupportsNoArgReadline(Protocol[_T_co]): + def readline(self) -> _T_co: ... + +class SupportsWrite(Protocol[_T_contra]): + def write(self, __s: _T_contra) -> int: ... + +if sys.version_info >= (3,): + ReadableBuffer = Union[bytes, bytearray, memoryview, array.array, mmap.mmap] + WriteableBuffer = Union[bytearray, memoryview, array.array, mmap.mmap] +else: + ReadableBuffer = Union[bytes, bytearray, memoryview, array.array, mmap.mmap, buffer] + WriteableBuffer = Union[bytearray, memoryview, array.array, mmap.mmap, buffer] + +if sys.version_info >= (3, 10): + from types import NoneType as NoneType +else: + # Used by type checkers for checks involving None (does not exist at runtime) + @final + class NoneType: + def __bool__(self) -> Literal[False]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/_typeshed/wsgi.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/_typeshed/wsgi.pyi new file mode 100644 index 00000000..bafaf7bc --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/_typeshed/wsgi.pyi @@ -0,0 +1,35 @@ +# Types to support PEP 3333 (WSGI) +# +# This module doesn't exist at runtime and neither do the types defined in this +# file. They are provided for type checking purposes. + +from sys import _OptExcInfo +from typing import Any, Callable, Dict, Iterable, List, Optional, Protocol, Text, Tuple + +class StartResponse(Protocol): + def __call__( + self, status: str, headers: List[Tuple[str, str]], exc_info: Optional[_OptExcInfo] = ... + ) -> Callable[[bytes], Any]: ... + +WSGIEnvironment = Dict[Text, Any] +WSGIApplication = Callable[[WSGIEnvironment, StartResponse], Iterable[bytes]] + +# WSGI input streams per PEP 3333 +class InputStream(Protocol): + def read(self, size: int = ...) -> bytes: ... + def readline(self, size: int = ...) -> bytes: ... + def readlines(self, hint: int = ...) -> List[bytes]: ... + def __iter__(self) -> Iterable[bytes]: ... + +# WSGI error streams per PEP 3333 +class ErrorStream(Protocol): + def flush(self) -> None: ... + def write(self, s: str) -> None: ... + def writelines(self, seq: List[str]) -> None: ... + +class _Readable(Protocol): + def read(self, size: int = ...) -> bytes: ... + +# Optional file wrapper in wsgi.file_wrapper +class FileWrapper(Protocol): + def __call__(self, file: _Readable, block_size: int = ...) -> Iterable[bytes]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/_typeshed/xml.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/_typeshed/xml.pyi new file mode 100644 index 00000000..7ad28aef --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/_typeshed/xml.pyi @@ -0,0 +1,10 @@ +# Stub-only types. This module does not exist at runtime. + +from typing import Any, Optional +from typing_extensions import Protocol + +# As defined https://docs.python.org/3/library/xml.dom.html#domimplementation-objects +class DOMImplementation(Protocol): + def hasFeature(self, feature: str, version: Optional[str]) -> bool: ... + def createDocument(self, namespaceUri: str, qualifiedName: str, doctype: Optional[Any]) -> Any: ... + def createDocumentType(self, qualifiedName: str, publicId: str, systemId: str) -> Any: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/_warnings.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/_warnings.pyi old mode 100755 new mode 100644 index f764f7c7..b4ec4e6e --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/_warnings.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/_warnings.pyi @@ -7,28 +7,61 @@ if sys.version_info >= (3, 0): else: default_action: str once_registry: Dict[Any, Any] + filters: List[Tuple[Any, ...]] -@overload -def warn(message: str, category: Optional[Type[Warning]] = ..., stacklevel: int = ...) -> None: ... -@overload -def warn(message: Warning, category: Any = ..., stacklevel: int = ...) -> None: ... -@overload -def warn_explicit( - message: str, - category: Type[Warning], - filename: str, - lineno: int, - module: Optional[str] = ..., - registry: Optional[Dict[Union[str, Tuple[str, Type[Warning], int]], int]] = ..., - module_globals: Optional[Dict[str, Any]] = ..., -) -> None: ... -@overload -def warn_explicit( - message: Warning, - category: Any, - filename: str, - lineno: int, - module: Optional[str] = ..., - registry: Optional[Dict[Union[str, Tuple[str, Type[Warning], int]], int]] = ..., - module_globals: Optional[Dict[str, Any]] = ..., -) -> None: ... + +if sys.version_info >= (3, 6): + @overload + def warn( + message: str, category: Optional[Type[Warning]] = ..., stacklevel: int = ..., source: Optional[Any] = ... + ) -> None: ... + @overload + def warn(message: Warning, category: Any = ..., stacklevel: int = ..., source: Optional[Any] = ...) -> None: ... + @overload + def warn_explicit( + message: str, + category: Type[Warning], + filename: str, + lineno: int, + module: Optional[str] = ..., + registry: Optional[Dict[Union[str, Tuple[str, Type[Warning], int]], int]] = ..., + module_globals: Optional[Dict[str, Any]] = ..., + source: Optional[Any] = ..., + ) -> None: ... + @overload + def warn_explicit( + message: Warning, + category: Any, + filename: str, + lineno: int, + module: Optional[str] = ..., + registry: Optional[Dict[Union[str, Tuple[str, Type[Warning], int]], int]] = ..., + module_globals: Optional[Dict[str, Any]] = ..., + source: Optional[Any] = ..., + ) -> None: ... + +else: + @overload + def warn(message: str, category: Optional[Type[Warning]] = ..., stacklevel: int = ...) -> None: ... + @overload + def warn(message: Warning, category: Any = ..., stacklevel: int = ...) -> None: ... + @overload + def warn_explicit( + message: str, + category: Type[Warning], + filename: str, + lineno: int, + module: Optional[str] = ..., + registry: Optional[Dict[Union[str, Tuple[str, Type[Warning], int]], int]] = ..., + module_globals: Optional[Dict[str, Any]] = ..., + ) -> None: ... + @overload + def warn_explicit( + message: Warning, + category: Any, + filename: str, + lineno: int, + module: Optional[str] = ..., + registry: Optional[Dict[Union[str, Tuple[str, Type[Warning], int]], int]] = ..., + module_globals: Optional[Dict[str, Any]] = ..., + ) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/_weakref.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/_weakref.pyi old mode 100755 new mode 100644 index 6a527c18..5b487022 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/_weakref.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/_weakref.pyi @@ -1,8 +1,11 @@ import sys from typing import Any, Callable, Generic, Optional, TypeVar, overload -_C = TypeVar('_C', bound=Callable[..., Any]) -_T = TypeVar('_T') +if sys.version_info >= (3, 9): + from types import GenericAlias + +_C = TypeVar("_C", bound=Callable[..., Any]) +_T = TypeVar("_T") class CallableProxyType(object): # "weakcallableproxy" def __getattr__(self, attr: str) -> Any: ... @@ -16,13 +19,16 @@ class ReferenceType(Generic[_T]): def __init__(self, o: _T, callback: Optional[Callable[[ReferenceType[_T]], Any]] = ...) -> None: ... def __call__(self) -> Optional[_T]: ... def __hash__(self) -> int: ... + if sys.version_info >= (3, 9): + def __class_getitem__(cls, item: Any) -> GenericAlias: ... ref = ReferenceType -def getweakrefcount(object: Any) -> int: ... +def getweakrefcount(__object: Any) -> int: ... def getweakrefs(object: Any) -> int: ... @overload def proxy(object: _C, callback: Optional[Callable[[_C], Any]] = ...) -> CallableProxyType: ... + # Return CallableProxyType if object is callable, ProxyType otherwise @overload def proxy(object: _T, callback: Optional[Callable[[_T], Any]] = ...) -> Any: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/_weakrefset.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/_weakrefset.pyi old mode 100755 new mode 100644 index f7dc56ec..6f841246 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/_weakrefset.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/_weakrefset.pyi @@ -1,12 +1,15 @@ -from typing import Iterator, Any, Iterable, MutableSet, Optional, TypeVar, Generic, Union +import sys +from typing import Any, Generic, Iterable, Iterator, MutableSet, Optional, TypeVar, Union -_S = TypeVar('_S') -_T = TypeVar('_T') -_SelfT = TypeVar('_SelfT', bound=WeakSet[Any]) +if sys.version_info >= (3, 9): + from types import GenericAlias + +_S = TypeVar("_S") +_T = TypeVar("_T") +_SelfT = TypeVar("_SelfT", bound=WeakSet[Any]) class WeakSet(MutableSet[_T], Generic[_T]): def __init__(self, data: Optional[Iterable[_T]] = ...) -> None: ... - def add(self, item: _T) -> None: ... def clear(self) -> None: ... def discard(self, item: _T) -> None: ... @@ -17,7 +20,6 @@ class WeakSet(MutableSet[_T], Generic[_T]): def __contains__(self, item: object) -> bool: ... def __len__(self) -> int: ... def __iter__(self) -> Iterator[_T]: ... - def __ior__(self, other: Iterable[_S]) -> WeakSet[Union[_S, _T]]: ... def difference(self: _SelfT, other: Iterable[_T]) -> _SelfT: ... def __sub__(self: _SelfT, other: Iterable[_T]) -> _SelfT: ... @@ -41,3 +43,5 @@ class WeakSet(MutableSet[_T], Generic[_T]): def union(self, other: Iterable[_S]) -> WeakSet[Union[_S, _T]]: ... def __or__(self, other: Iterable[_S]) -> WeakSet[Union[_S, _T]]: ... def isdisjoint(self, other: Iterable[_T]) -> bool: ... + if sys.version_info >= (3, 9): + def __class_getitem__(cls, item: Any) -> GenericAlias: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/aifc.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/aifc.pyi old mode 100755 new mode 100644 index c2fd608d..f812ac59 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/aifc.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/aifc.pyi @@ -1,7 +1,7 @@ -from typing import Union, IO, Optional, Type, NamedTuple, List, Tuple, Any, Text, overload -from typing_extensions import Literal -from types import TracebackType import sys +from types import TracebackType +from typing import IO, Any, List, NamedTuple, Optional, Text, Tuple, Type, Union, overload +from typing_extensions import Literal class Error(Exception): ... @@ -20,8 +20,9 @@ class Aifc_read: def __init__(self, f: _File) -> None: ... if sys.version_info >= (3, 4): def __enter__(self) -> Aifc_read: ... - def __exit__(self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], - exc_tb: Optional[TracebackType]) -> None: ... + def __exit__( + self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType] + ) -> None: ... def initfp(self, file: IO[bytes]) -> None: ... def getfp(self) -> IO[bytes]: ... def rewind(self) -> None: ... @@ -44,8 +45,9 @@ class Aifc_write: def __del__(self) -> None: ... if sys.version_info >= (3, 4): def __enter__(self) -> Aifc_write: ... - def __exit__(self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], - exc_tb: Optional[TracebackType]) -> None: ... + def __exit__( + self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType] + ) -> None: ... def initfp(self, file: IO[bytes]) -> None: ... def aiff(self) -> None: ... def aifc(self) -> None: ... @@ -71,15 +73,16 @@ class Aifc_write: def close(self) -> None: ... @overload -def open(f: _File, mode: Literal["r", "rb"] = ...) -> Aifc_read: ... +def open(f: _File, mode: Literal["r", "rb"]) -> Aifc_read: ... @overload def open(f: _File, mode: Literal["w", "wb"]) -> Aifc_write: ... @overload -def open(f: _File, mode: str) -> Any: ... +def open(f: _File, mode: Optional[str] = ...) -> Any: ... -@overload -def openfp(f: _File, mode: Literal["r", "rb"] = ...) -> Aifc_read: ... -@overload -def openfp(f: _File, mode: Literal["w", "wb"]) -> Aifc_write: ... -@overload -def openfp(f: _File, mode: str) -> Any: ... +if sys.version_info < (3, 9): + @overload + def openfp(f: _File, mode: Literal["r", "rb"]) -> Aifc_read: ... + @overload + def openfp(f: _File, mode: Literal["w", "wb"]) -> Aifc_write: ... + @overload + def openfp(f: _File, mode: Optional[str] = ...) -> Any: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/antigravity.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/antigravity.pyi new file mode 100644 index 00000000..52e2c5d9 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/antigravity.pyi @@ -0,0 +1,4 @@ +import sys + +if sys.version_info >= (3, 0): + def geohash(latitude: float, longitude: float, datedow: bytes) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/argparse.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/argparse.pyi old mode 100755 new mode 100644 index 2c33cac7..3dd6e561 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/argparse.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/argparse.pyi @@ -1,12 +1,28 @@ +import sys from typing import ( - Any, Callable, Dict, Generator, Iterable, List, IO, NoReturn, Optional, - Pattern, Sequence, Text, Tuple, Type, Union, TypeVar, overload + IO, + Any, + Callable, + Dict, + Generator, + Iterable, + List, + NoReturn, + Optional, + Pattern, + Protocol, + Sequence, + Text, + Tuple, + Type, + TypeVar, + Union, + overload, ) -import sys -_T = TypeVar('_T') -_ActionT = TypeVar('_ActionT', bound=Action) -_N = TypeVar('_N') +_T = TypeVar("_T") +_ActionT = TypeVar("_ActionT", bound=Action) +_N = TypeVar("_N") if sys.version_info >= (3,): _Text = str @@ -21,7 +37,10 @@ SUPPRESS: str ZERO_OR_MORE: str _UNRECOGNIZED_ARGS_ATTR: str # undocumented -class ArgumentError(Exception): ... +class ArgumentError(Exception): + argument_name: Optional[str] + message: str + def __init__(self, argument: Optional[Action], message: str) -> None: ... # undocumented class _AttributeHolder: @@ -32,7 +51,7 @@ class _AttributeHolder: class _ActionsContainer: description: Optional[_Text] prefix_chars: _Text - argument_default: Optional[_Text] + argument_default: Any conflict_handler: _Text _registries: Dict[_Text, Dict[Any, Any]] @@ -43,27 +62,29 @@ class _ActionsContainer: _defaults: Dict[str, Any] _negative_number_matcher: Pattern[str] _has_negative_number_optionals: List[bool] - - def __init__(self, description: Optional[Text], prefix_chars: Text, - argument_default: Optional[Text], conflict_handler: Text) -> None: ... + def __init__( + self, description: Optional[Text], prefix_chars: Text, argument_default: Any, conflict_handler: Text + ) -> None: ... def register(self, registry_name: Text, value: Any, object: Any) -> None: ... def _registry_get(self, registry_name: Text, value: Any, default: Any = ...) -> Any: ... def set_defaults(self, **kwargs: Any) -> None: ... def get_default(self, dest: Text) -> Any: ... - def add_argument(self, - *name_or_flags: Text, - action: Union[Text, Type[Action]] = ..., - nargs: Union[int, Text] = ..., - const: Any = ..., - default: Any = ..., - type: Union[Callable[[Text], _T], Callable[[str], _T], FileType] = ..., - choices: Iterable[_T] = ..., - required: bool = ..., - help: Optional[Text] = ..., - metavar: Optional[Union[Text, Tuple[Text, ...]]] = ..., - dest: Optional[Text] = ..., - version: Text = ..., - **kwargs: Any) -> Action: ... + def add_argument( + self, + *name_or_flags: Text, + action: Union[Text, Type[Action]] = ..., + nargs: Union[int, Text] = ..., + const: Any = ..., + default: Any = ..., + type: Union[Callable[[Text], _T], Callable[[str], _T], FileType] = ..., + choices: Iterable[_T] = ..., + required: bool = ..., + help: Optional[Text] = ..., + metavar: Optional[Union[Text, Tuple[Text, ...]]] = ..., + dest: Optional[Text] = ..., + version: Text = ..., + **kwargs: Any, + ) -> Action: ... def add_argument_group(self, *args: Any, **kwargs: Any) -> _ArgumentGroup: ... def add_mutually_exclusive_group(self, **kwargs: Any) -> _MutuallyExclusiveGroup: ... def _add_action(self, action: _ActionT) -> _ActionT: ... @@ -77,11 +98,14 @@ class _ActionsContainer: def _handle_conflict_error(self, action: Action, conflicting_actions: Iterable[Tuple[Text, Action]]) -> NoReturn: ... def _handle_conflict_resolve(self, action: Action, conflicting_actions: Iterable[Tuple[Text, Action]]) -> None: ... +class _FormatterClass(Protocol): + def __call__(self, prog: str) -> HelpFormatter: ... + class ArgumentParser(_AttributeHolder, _ActionsContainer): prog: _Text usage: Optional[_Text] epilog: Optional[_Text] - formatter_class: Type[HelpFormatter] + formatter_class: _FormatterClass fromfile_prefix_chars: Optional[_Text] add_help: bool @@ -93,34 +117,54 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer): _optionals: _ArgumentGroup _subparsers: Optional[_ArgumentGroup] - if sys.version_info >= (3, 5): - def __init__(self, - prog: Optional[str] = ..., - usage: Optional[str] = ..., - description: Optional[str] = ..., - epilog: Optional[str] = ..., - parents: Sequence[ArgumentParser] = ..., - formatter_class: Type[HelpFormatter] = ..., - prefix_chars: str = ..., - fromfile_prefix_chars: Optional[str] = ..., - argument_default: Optional[str] = ..., - conflict_handler: str = ..., - add_help: bool = ..., - allow_abbrev: bool = ...) -> None: ... + if sys.version_info >= (3, 9): + def __init__( + self, + prog: Optional[str] = ..., + usage: Optional[str] = ..., + description: Optional[str] = ..., + epilog: Optional[str] = ..., + parents: Sequence[ArgumentParser] = ..., + formatter_class: _FormatterClass = ..., + prefix_chars: str = ..., + fromfile_prefix_chars: Optional[str] = ..., + argument_default: Any = ..., + conflict_handler: str = ..., + add_help: bool = ..., + allow_abbrev: bool = ..., + exit_on_error: bool = ..., + ) -> None: ... + elif sys.version_info >= (3, 5): + def __init__( + self, + prog: Optional[str] = ..., + usage: Optional[str] = ..., + description: Optional[str] = ..., + epilog: Optional[str] = ..., + parents: Sequence[ArgumentParser] = ..., + formatter_class: _FormatterClass = ..., + prefix_chars: str = ..., + fromfile_prefix_chars: Optional[str] = ..., + argument_default: Any = ..., + conflict_handler: str = ..., + add_help: bool = ..., + allow_abbrev: bool = ..., + ) -> None: ... else: - def __init__(self, - prog: Optional[Text] = ..., - usage: Optional[Text] = ..., - description: Optional[Text] = ..., - epilog: Optional[Text] = ..., - parents: Sequence[ArgumentParser] = ..., - formatter_class: Type[HelpFormatter] = ..., - prefix_chars: Text = ..., - fromfile_prefix_chars: Optional[Text] = ..., - argument_default: Optional[Text] = ..., - conflict_handler: Text = ..., - add_help: bool = ...) -> None: ... - + def __init__( + self, + prog: Optional[Text] = ..., + usage: Optional[Text] = ..., + description: Optional[Text] = ..., + epilog: Optional[Text] = ..., + parents: Sequence[ArgumentParser] = ..., + formatter_class: _FormatterClass = ..., + prefix_chars: Text = ..., + fromfile_prefix_chars: Optional[Text] = ..., + argument_default: Any = ..., + conflict_handler: Text = ..., + add_help: bool = ..., + ) -> None: ... # The type-ignores in these overloads should be temporary. See: # https://github.com/python/typeshed/pull/2643#issuecomment-442280277 @overload @@ -133,44 +177,52 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer): def parse_args(self, *, namespace: None) -> Namespace: ... # type: ignore @overload def parse_args(self, *, namespace: _N) -> _N: ... - if sys.version_info >= (3, 7): - def add_subparsers(self, title: str = ..., - description: Optional[str] = ..., - prog: str = ..., - parser_class: Type[ArgumentParser] = ..., - action: Type[Action] = ..., - option_string: str = ..., - dest: Optional[str] = ..., - required: bool = ..., - help: Optional[str] = ..., - metavar: Optional[str] = ...) -> _SubParsersAction: ... + def add_subparsers( + self, + *, + title: str = ..., + description: Optional[str] = ..., + prog: str = ..., + parser_class: Type[ArgumentParser] = ..., + action: Type[Action] = ..., + option_string: str = ..., + dest: Optional[str] = ..., + required: bool = ..., + help: Optional[str] = ..., + metavar: Optional[str] = ..., + ) -> _SubParsersAction: ... else: - def add_subparsers(self, title: Text = ..., - description: Optional[Text] = ..., - prog: Text = ..., - parser_class: Type[ArgumentParser] = ..., - action: Type[Action] = ..., - option_string: Text = ..., - dest: Optional[Text] = ..., - help: Optional[Text] = ..., - metavar: Optional[Text] = ...) -> _SubParsersAction: ... - + def add_subparsers( + self, + *, + title: Text = ..., + description: Optional[Text] = ..., + prog: Text = ..., + parser_class: Type[ArgumentParser] = ..., + action: Type[Action] = ..., + option_string: Text = ..., + dest: Optional[Text] = ..., + help: Optional[Text] = ..., + metavar: Optional[Text] = ..., + ) -> _SubParsersAction: ... def print_usage(self, file: Optional[IO[str]] = ...) -> None: ... def print_help(self, file: Optional[IO[str]] = ...) -> None: ... def format_usage(self) -> str: ... def format_help(self) -> str: ... - def parse_known_args(self, args: Optional[Sequence[Text]] = ..., - namespace: Optional[Namespace] = ...) -> Tuple[Namespace, List[str]]: ... + def parse_known_args( + self, args: Optional[Sequence[Text]] = ..., namespace: Optional[Namespace] = ... + ) -> Tuple[Namespace, List[str]]: ... def convert_arg_line_to_args(self, arg_line: Text) -> List[str]: ... def exit(self, status: int = ..., message: Optional[Text] = ...) -> NoReturn: ... def error(self, message: Text) -> NoReturn: ... if sys.version_info >= (3, 7): - def parse_intermixed_args(self, args: Optional[Sequence[str]] = ..., - namespace: Optional[Namespace] = ...) -> Namespace: ... - def parse_known_intermixed_args(self, - args: Optional[Sequence[str]] = ..., - namespace: Optional[Namespace] = ...) -> Tuple[Namespace, List[str]]: ... + def parse_intermixed_args( + self, args: Optional[Sequence[str]] = ..., namespace: Optional[Namespace] = ... + ) -> Namespace: ... + def parse_known_intermixed_args( + self, args: Optional[Sequence[str]] = ..., namespace: Optional[Namespace] = ... + ) -> Tuple[Namespace, List[str]]: ... # undocumented def _get_optional_actions(self) -> List[Action]: ... def _get_positional_actions(self) -> List[Action]: ... @@ -201,21 +253,25 @@ class HelpFormatter: _whitespace_matcher: Pattern[str] _long_break_matcher: Pattern[str] _Section: Type[Any] # Nested class - def __init__(self, prog: Text, indent_increment: int = ..., - max_help_position: int = ..., - width: Optional[int] = ...) -> None: ... + def __init__( + self, prog: Text, indent_increment: int = ..., max_help_position: int = ..., width: Optional[int] = ... + ) -> None: ... def _indent(self) -> None: ... def _dedent(self) -> None: ... def _add_item(self, func: Callable[..., _Text], args: Iterable[Any]) -> None: ... def start_section(self, heading: Optional[Text]) -> None: ... def end_section(self) -> None: ... def add_text(self, text: Optional[Text]) -> None: ... - def add_usage(self, usage: Text, actions: Iterable[Action], groups: Iterable[_ArgumentGroup], prefix: Optional[Text] = ...) -> None: ... + def add_usage( + self, usage: Text, actions: Iterable[Action], groups: Iterable[_ArgumentGroup], prefix: Optional[Text] = ... + ) -> None: ... def add_argument(self, action: Action) -> None: ... def add_arguments(self, actions: Iterable[Action]) -> None: ... def format_help(self) -> _Text: ... def _join_parts(self, part_strings: Iterable[Text]) -> _Text: ... - def _format_usage(self, usage: Text, actions: Iterable[Action], groups: Iterable[_ArgumentGroup], prefix: Optional[Text]) -> _Text: ... + def _format_usage( + self, usage: Text, actions: Iterable[Action], groups: Iterable[_ArgumentGroup], prefix: Optional[Text] + ) -> _Text: ... def _format_actions_usage(self, actions: Iterable[Action], groups: Iterable[_ArgumentGroup]) -> _Text: ... def _format_text(self, text: Text) -> _Text: ... def _format_action(self, action: Action) -> _Text: ... @@ -231,8 +287,9 @@ class HelpFormatter: def _get_default_metavar_for_positional(self, action: Action) -> _Text: ... class RawDescriptionHelpFormatter(HelpFormatter): ... -class RawTextHelpFormatter(HelpFormatter): ... +class RawTextHelpFormatter(RawDescriptionHelpFormatter): ... class ArgumentDefaultsHelpFormatter(HelpFormatter): ... + if sys.version_info >= (3,): class MetavarTypeHelpFormatter(HelpFormatter): ... @@ -247,21 +304,42 @@ class Action(_AttributeHolder): required: bool help: Optional[_Text] metavar: Optional[Union[_Text, Tuple[_Text, ...]]] - - def __init__(self, - option_strings: Sequence[Text], - dest: Text, - nargs: Optional[Union[int, Text]] = ..., - const: Any = ..., - default: Any = ..., - type: Optional[Union[Callable[[Text], _T], Callable[[str], _T], FileType]] = ..., - choices: Optional[Iterable[_T]] = ..., - required: bool = ..., - help: Optional[Text] = ..., - metavar: Optional[Union[Text, Tuple[Text, ...]]] = ...) -> None: ... - def __call__(self, parser: ArgumentParser, namespace: Namespace, - values: Union[Text, Sequence[Any], None], - option_string: Optional[Text] = ...) -> None: ... + def __init__( + self, + option_strings: Sequence[Text], + dest: Text, + nargs: Optional[Union[int, Text]] = ..., + const: Optional[_T] = ..., + default: Union[_T, str, None] = ..., + type: Optional[Union[Callable[[Text], _T], Callable[[str], _T], FileType]] = ..., + choices: Optional[Iterable[_T]] = ..., + required: bool = ..., + help: Optional[Text] = ..., + metavar: Optional[Union[Text, Tuple[Text, ...]]] = ..., + ) -> None: ... + def __call__( + self, + parser: ArgumentParser, + namespace: Namespace, + values: Union[Text, Sequence[Any], None], + option_string: Optional[Text] = ..., + ) -> None: ... + if sys.version_info >= (3, 9): + def format_usage(self) -> str: ... + +if sys.version_info >= (3, 9): + class BooleanOptionalAction(Action): + def __init__( + self, + option_strings: Sequence[str], + dest: str, + default: Union[_T, str, None] = ..., + type: Optional[Union[Callable[[Text], _T], Callable[[str], _T], FileType]] = ..., + choices: Optional[Iterable[_T]] = ..., + required: bool = ..., + help: Optional[Text] = ..., + metavar: Optional[Union[Text, Tuple[Text, ...]]] = ..., + ) -> None: ... class Namespace(_AttributeHolder): def __init__(self, **kwargs: Any) -> None: ... @@ -276,21 +354,20 @@ class FileType: if sys.version_info >= (3,): _encoding: Optional[str] _errors: Optional[str] - def __init__(self, mode: str = ..., bufsize: int = ..., - encoding: Optional[str] = ..., - errors: Optional[str] = ...) -> None: ... + def __init__( + self, mode: str = ..., bufsize: int = ..., encoding: Optional[str] = ..., errors: Optional[str] = ... + ) -> None: ... else: - def __init__(self, - mode: Text = ..., bufsize: Optional[int] = ...) -> None: ... + def __init__(self, mode: Text = ..., bufsize: Optional[int] = ...) -> None: ... def __call__(self, string: Text) -> IO[Any]: ... # undocumented class _ArgumentGroup(_ActionsContainer): title: Optional[_Text] _group_actions: List[Action] - def __init__(self, container: _ActionsContainer, - title: Optional[Text] = ..., - description: Optional[Text] = ..., **kwargs: Any) -> None: ... + def __init__( + self, container: _ActionsContainer, title: Optional[Text] = ..., description: Optional[Text] = ..., **kwargs: Any + ) -> None: ... # undocumented class _MutuallyExclusiveGroup(_ArgumentGroup): @@ -303,73 +380,68 @@ class _StoreAction(Action): ... # undocumented class _StoreConstAction(Action): - def __init__(self, - option_strings: Sequence[Text], - dest: Text, - const: Any, - default: Any = ..., - required: bool = ..., - help: Optional[Text] = ..., - metavar: Optional[Union[Text, Tuple[Text, ...]]] = ...) -> None: ... + def __init__( + self, + option_strings: Sequence[Text], + dest: Text, + const: Any, + default: Any = ..., + required: bool = ..., + help: Optional[Text] = ..., + metavar: Optional[Union[Text, Tuple[Text, ...]]] = ..., + ) -> None: ... # undocumented class _StoreTrueAction(_StoreConstAction): - def __init__(self, - option_strings: Sequence[Text], - dest: Text, - default: bool = ..., - required: bool = ..., - help: Optional[Text] = ...) -> None: ... + def __init__( + self, option_strings: Sequence[Text], dest: Text, default: bool = ..., required: bool = ..., help: Optional[Text] = ... + ) -> None: ... # undocumented class _StoreFalseAction(_StoreConstAction): - def __init__(self, - option_strings: Sequence[Text], - dest: Text, - default: bool = ..., - required: bool = ..., - help: Optional[Text] = ...) -> None: ... + def __init__( + self, option_strings: Sequence[Text], dest: Text, default: bool = ..., required: bool = ..., help: Optional[Text] = ... + ) -> None: ... # undocumented class _AppendAction(Action): ... # undocumented class _AppendConstAction(Action): - def __init__(self, - option_strings: Sequence[Text], - dest: Text, - const: Any, - default: Any = ..., - required: bool = ..., - help: Optional[Text] = ..., - metavar: Optional[Union[Text, Tuple[Text, ...]]] = ...) -> None: ... + def __init__( + self, + option_strings: Sequence[Text], + dest: Text, + const: Any, + default: Any = ..., + required: bool = ..., + help: Optional[Text] = ..., + metavar: Optional[Union[Text, Tuple[Text, ...]]] = ..., + ) -> None: ... # undocumented class _CountAction(Action): - def __init__(self, - option_strings: Sequence[Text], - dest: Text, - default: Any = ..., - required: bool = ..., - help: Optional[Text] = ...) -> None: ... + def __init__( + self, option_strings: Sequence[Text], dest: Text, default: Any = ..., required: bool = ..., help: Optional[Text] = ... + ) -> None: ... # undocumented class _HelpAction(Action): - def __init__(self, - option_strings: Sequence[Text], - dest: Text = ..., - default: Text = ..., - help: Optional[Text] = ...) -> None: ... + def __init__( + self, option_strings: Sequence[Text], dest: Text = ..., default: Text = ..., help: Optional[Text] = ... + ) -> None: ... # undocumented class _VersionAction(Action): version: Optional[_Text] - def __init__(self, - option_strings: Sequence[Text], - version: Optional[Text] = ..., - dest: Text = ..., - default: Text = ..., - help: Text = ...) -> None: ... + def __init__( + self, + option_strings: Sequence[Text], + version: Optional[Text] = ..., + dest: Text = ..., + default: Text = ..., + help: Text = ..., + ) -> None: ... # undocumented class _SubParsersAction(Action): @@ -379,14 +451,27 @@ class _SubParsersAction(Action): _name_parser_map: Dict[_Text, ArgumentParser] choices: Dict[_Text, ArgumentParser] _choices_actions: List[Action] - def __init__(self, - option_strings: Sequence[Text], - prog: Text, - parser_class: Type[ArgumentParser], - dest: Text = ..., - required: bool = ..., - help: Optional[Text] = ..., - metavar: Optional[Union[Text, Tuple[Text, ...]]] = ...) -> None: ... + if sys.version_info >= (3, 7): + def __init__( + self, + option_strings: Sequence[Text], + prog: Text, + parser_class: Type[ArgumentParser], + dest: Text = ..., + required: bool = ..., + help: Optional[Text] = ..., + metavar: Optional[Union[Text, Tuple[Text, ...]]] = ..., + ) -> None: ... + else: + def __init__( + self, + option_strings: Sequence[Text], + prog: Text, + parser_class: Type[ArgumentParser], + dest: Text = ..., + help: Optional[Text] = ..., + metavar: Optional[Union[Text, Tuple[Text, ...]]] = ..., + ) -> None: ... # TODO: Type keyword args properly. def add_parser(self, name: Text, **kwargs: Any) -> ArgumentParser: ... def _get_subactions(self) -> List[Action]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/array.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/array.pyi old mode 100755 new mode 100644 index 01c6f994..c7e1ef0b --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/array.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/array.pyi @@ -1,60 +1,64 @@ -# Stubs for array - -# Based on http://docs.python.org/3.6/library/array.html - import sys -from typing import (Any, BinaryIO, Generic, Iterable, Iterator, List, MutableSequence, - overload, Text, Tuple, TypeVar, Union) +from typing import Any, BinaryIO, Generic, Iterable, List, MutableSequence, Text, Tuple, TypeVar, Union, overload +from typing_extensions import Literal + +_IntTypeCode = Literal["b", "B", "h", "H", "i", "I", "l", "L", "q", "Q"] +_FloatTypeCode = Literal["f", "d"] +_UnicodeTypeCode = Literal["u"] +_TypeCode = Union[_IntTypeCode, _FloatTypeCode, _UnicodeTypeCode] -_T = TypeVar('_T', int, float, Text) +_T = TypeVar("_T", int, float, Text) if sys.version_info >= (3,): typecodes: str class array(MutableSequence[_T], Generic[_T]): - typecode: str + typecode: _TypeCode itemsize: int - def __init__(self, typecode: str, - __initializer: Union[bytes, Iterable[_T]] = ...) -> None: ... - def append(self, x: _T) -> None: ... + @overload + def __init__(self: array[int], typecode: _IntTypeCode, __initializer: Union[bytes, Iterable[_T]] = ...) -> None: ... + @overload + def __init__(self: array[float], typecode: _FloatTypeCode, __initializer: Union[bytes, Iterable[_T]] = ...) -> None: ... + @overload + def __init__(self: array[Text], typecode: _UnicodeTypeCode, __initializer: Union[bytes, Iterable[_T]] = ...) -> None: ... + @overload + def __init__(self, typecode: str, __initializer: Union[bytes, Iterable[_T]] = ...) -> None: ... + def append(self, __v: _T) -> None: ... def buffer_info(self) -> Tuple[int, int]: ... def byteswap(self) -> None: ... - def count(self, x: Any) -> int: ... - def extend(self, iterable: Iterable[_T]) -> None: ... + def count(self, __v: Any) -> int: ... + def extend(self, __bb: Iterable[_T]) -> None: ... if sys.version_info >= (3, 2): - def frombytes(self, s: bytes) -> None: ... - def fromfile(self, f: BinaryIO, n: int) -> None: ... - def fromlist(self, list: List[_T]) -> None: ... - def fromstring(self, s: bytes) -> None: ... - def fromunicode(self, s: str) -> None: ... - def index(self, x: _T) -> int: ... # type: ignore # Overrides Sequence - def insert(self, i: int, x: _T) -> None: ... - def pop(self, i: int = ...) -> _T: ... + def frombytes(self, __buffer: bytes) -> None: ... + def fromfile(self, __f: BinaryIO, __n: int) -> None: ... + def fromlist(self, __list: List[_T]) -> None: ... + def fromunicode(self, __ustr: str) -> None: ... + def index(self, __v: _T) -> int: ... # type: ignore # Overrides Sequence + def insert(self, __i: int, __v: _T) -> None: ... + def pop(self, __i: int = ...) -> _T: ... if sys.version_info < (3,): def read(self, f: BinaryIO, n: int) -> None: ... - def remove(self, x: Any) -> None: ... + def remove(self, __v: Any) -> None: ... def reverse(self) -> None: ... if sys.version_info >= (3, 2): def tobytes(self) -> bytes: ... - def tofile(self, f: BinaryIO) -> None: ... + def tofile(self, __f: BinaryIO) -> None: ... def tolist(self) -> List[_T]: ... - def tostring(self) -> bytes: ... def tounicode(self) -> str: ... if sys.version_info < (3,): def write(self, f: BinaryIO) -> None: ... - + if sys.version_info < (3, 9): + def fromstring(self, __buffer: bytes) -> None: ... + def tostring(self) -> bytes: ... def __len__(self) -> int: ... - @overload def __getitem__(self, i: int) -> _T: ... @overload def __getitem__(self, s: slice) -> array[_T]: ... - @overload # type: ignore # Overrides MutableSequence def __setitem__(self, i: int, o: _T) -> None: ... @overload def __setitem__(self, s: slice, o: array[_T]) -> None: ... - def __delitem__(self, i: Union[int, slice]) -> None: ... def __add__(self, x: array[_T]) -> array[_T]: ... def __ge__(self, other: array[_T]) -> bool: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/asynchat.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/asynchat.pyi old mode 100755 new mode 100644 index a359ae7d..34039b99 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/asynchat.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/asynchat.pyi @@ -1,10 +1,9 @@ -from abc import abstractmethod import asyncore import socket import sys +from abc import abstractmethod from typing import Optional, Sequence, Tuple, Union - class simple_producer: def __init__(self, data: bytes, buffer_size: int = ...) -> None: ... def more(self) -> bytes: ... @@ -13,7 +12,6 @@ class async_chat(asyncore.dispatcher): ac_in_buffer_size: int ac_out_buffer_size: int def __init__(self, sock: Optional[socket.socket] = ..., map: Optional[asyncore._maptype] = ...) -> None: ... - @abstractmethod def collect_incoming_data(self, data: bytes) -> None: ... @abstractmethod diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/asyncore.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/asyncore.pyi old mode 100755 new mode 100644 index 9d0a2c60..a05a2051 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/asyncore.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/asyncore.pyi @@ -1,16 +1,7 @@ -from typing import Tuple, Union, Optional, Any, Dict, overload - -import os -import select import sys -import time -import warnings +from _typeshed import FileDescriptorLike from socket import SocketType -from typing import Optional - -from errno import (EALREADY, EINPROGRESS, EWOULDBLOCK, ECONNRESET, EINVAL, - ENOTCONN, ESHUTDOWN, EINTR, EISCONN, EBADF, ECONNABORTED, - EPIPE, EAGAIN, errorcode) +from typing import Any, Dict, Optional, Tuple, Union, overload # cyclic dependence with asynchat _maptype = Dict[int, Any] @@ -22,13 +13,12 @@ class ExitNow(Exception): ... def read(obj: Any) -> None: ... def write(obj: Any) -> None: ... def readwrite(obj: Any, flags: int) -> None: ... -def poll(timeout: float = ..., map: _maptype = ...) -> None: ... -def poll2(timeout: float = ..., map: _maptype = ...) -> None: ... +def poll(timeout: float = ..., map: Optional[_maptype] = ...) -> None: ... +def poll2(timeout: float = ..., map: Optional[_maptype] = ...) -> None: ... poll3 = poll2 -def loop(timeout: float = ..., use_poll: bool = ..., map: _maptype = ..., count: Optional[int] = ...) -> None: ... - +def loop(timeout: float = ..., use_poll: bool = ..., map: Optional[_maptype] = ..., count: Optional[int] = ...) -> None: ... # Not really subclass of socket.socket; it's only delegation. # It is not covariant to it. @@ -41,23 +31,21 @@ class dispatcher: closing: bool ignore_log_types: frozenset[str] socket: Optional[SocketType] - - def __init__(self, sock: Optional[SocketType] = ..., map: _maptype = ...) -> None: ... - def add_channel(self, map: _maptype = ...) -> None: ... - def del_channel(self, map: _maptype = ...) -> None: ... - def create_socket(self, family: int, type: int) -> None: ... - def set_socket(self, sock: SocketType, map: _maptype = ...) -> None: ... + def __init__(self, sock: Optional[SocketType] = ..., map: Optional[_maptype] = ...) -> None: ... + def add_channel(self, map: Optional[_maptype] = ...) -> None: ... + def del_channel(self, map: Optional[_maptype] = ...) -> None: ... + def create_socket(self, family: int = ..., type: int = ...) -> None: ... + def set_socket(self, sock: SocketType, map: Optional[_maptype] = ...) -> None: ... def set_reuse_addr(self) -> None: ... def readable(self) -> bool: ... def writable(self) -> bool: ... - def listen(self, backlog: int) -> None: ... - def bind(self, address: Union[Tuple[Any, ...], str]) -> None: ... + def listen(self, num: int) -> None: ... + def bind(self, addr: Union[Tuple[Any, ...], str]) -> None: ... def connect(self, address: Union[Tuple[Any, ...], str]) -> None: ... def accept(self) -> Optional[Tuple[SocketType, Any]]: ... def send(self, data: bytes) -> int: ... def recv(self, buffer_size: int) -> bytes: ... def close(self) -> None: ... - def log(self, message: Any) -> None: ... def log_info(self, message: Any, type: str = ...) -> None: ... def handle_read_event(self) -> None: ... @@ -71,34 +59,26 @@ class dispatcher: def handle_connect(self) -> None: ... def handle_accept(self) -> None: ... def handle_close(self) -> None: ... - if sys.version_info < (3, 5): # Historically, some methods were "imported" from `self.socket` by # means of `__getattr__`. This was long deprecated, and as of Python # 3.5 has been removed; simply call the relevant methods directly on # self.socket if necessary. - def detach(self) -> int: ... def fileno(self) -> int: ... - # return value is an address def getpeername(self) -> Any: ... def getsockname(self) -> Any: ... - @overload - def getsockopt(self, level: int, optname: int) -> int: ... + def getsockopt(self, level: int, optname: int, buflen: None = ...) -> int: ... @overload def getsockopt(self, level: int, optname: int, buflen: int) -> bytes: ... - def gettimeout(self) -> float: ... - def ioctl(self, control: object, - option: Tuple[int, int, int]) -> None: ... + def ioctl(self, control: object, option: Tuple[int, int, int]) -> None: ... # TODO the return value may be BinaryIO or TextIO, depending on mode - def makefile(self, mode: str = ..., buffering: int = ..., - encoding: str = ..., errors: str = ..., - newline: str = ...) -> Any: - ... - + def makefile( + self, mode: str = ..., buffering: int = ..., encoding: str = ..., errors: str = ..., newline: str = ... + ) -> Any: ... # return type is an address def recvfrom(self, bufsize: int, flags: int = ...) -> Any: ... def recvfrom_into(self, buffer: bytes, nbytes: int, flags: int = ...) -> Any: ... @@ -111,35 +91,29 @@ class dispatcher: def shutdown(self, how: int) -> None: ... class dispatcher_with_send(dispatcher): - def __init__(self, sock: SocketType = ..., map: _maptype = ...) -> None: ... + def __init__(self, sock: SocketType = ..., map: Optional[_maptype] = ...) -> None: ... def initiate_send(self) -> None: ... def handle_write(self) -> None: ... # incompatible signature: # def send(self, data: bytes) -> Optional[int]: ... def compact_traceback() -> Tuple[Tuple[str, str, str], type, type, str]: ... -def close_all(map: _maptype = ..., ignore_all: bool = ...) -> None: ... - -# if os.name == 'posix': -# import fcntl -class file_wrapper: - fd: int - - def __init__(self, fd: int) -> None: ... - def recv(self, bufsize: int, flags: int = ...) -> bytes: ... - def send(self, data: bytes, flags: int = ...) -> int: ... - - @overload - def getsockopt(self, level: int, optname: int) -> int: ... - @overload - def getsockopt(self, level: int, optname: int, buflen: int) -> bytes: ... - - def read(self, bufsize: int, flags: int = ...) -> bytes: ... - def write(self, data: bytes, flags: int = ...) -> int: ... - - def close(self) -> None: ... - def fileno(self) -> int: ... - -class file_dispatcher(dispatcher): - def __init__(self, fd: int, map: _maptype = ...) -> None: ... - def set_file(self, fd: int) -> None: ... +def close_all(map: Optional[_maptype] = ..., ignore_all: bool = ...) -> None: ... + +if sys.platform != "win32": + class file_wrapper: + fd: int + def __init__(self, fd: int) -> None: ... + def recv(self, bufsize: int, flags: int = ...) -> bytes: ... + def send(self, data: bytes, flags: int = ...) -> int: ... + @overload + def getsockopt(self, level: int, optname: int, buflen: None = ...) -> int: ... + @overload + def getsockopt(self, level: int, optname: int, buflen: int) -> bytes: ... + def read(self, bufsize: int, flags: int = ...) -> bytes: ... + def write(self, data: bytes, flags: int = ...) -> int: ... + def close(self) -> None: ... + def fileno(self) -> int: ... + class file_dispatcher(dispatcher): + def __init__(self, fd: FileDescriptorLike, map: Optional[_maptype] = ...) -> None: ... + def set_file(self, fd: int) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/audioop.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/audioop.pyi old mode 100755 new mode 100644 index 0881dc43..606f4b9f --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/audioop.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/audioop.pyi @@ -1,42 +1,42 @@ -from typing import Any, Optional, Tuple +from typing import Optional, Tuple AdpcmState = Tuple[int, int] RatecvState = Tuple[int, Tuple[Tuple[int, int], ...]] class error(Exception): ... -def add(fragment1: bytes, fragment2: bytes, width: int) -> bytes: ... -def adpcm2lin(adpcmfragment: bytes, width: int, state: Optional[AdpcmState]) -> Tuple[bytes, AdpcmState]: ... -def alaw2lin(fragment: bytes, width: int) -> bytes: ... -def avg(fragment: bytes, width: int) -> int: ... -def avgpp(fragment: bytes, width: int) -> int: ... -def bias(fragment: bytes, width: int, bias: int) -> bytes: ... -def byteswap(fragment: bytes, width: int) -> bytes: ... -def cross(fragment: bytes, width: int) -> int: ... -def findfactor(fragment: bytes, reference: bytes) -> float: ... -def findfit(fragment: bytes, reference: bytes) -> Tuple[int, float]: ... -def findmax(fragment: bytes, length: int) -> int: ... -def getsample(fragment: bytes, width: int, index: int) -> int: ... -def lin2adpcm(fragment: bytes, width: int, state: Optional[AdpcmState]) -> Tuple[bytes, AdpcmState]: ... -def lin2alaw(fragment: bytes, width: int) -> bytes: ... -def lin2lin(fragment: bytes, width: int, newwidth: int) -> bytes: ... -def lin2ulaw(fragment: bytes, width: int) -> bytes: ... -def max(fragment: bytes, width: int) -> int: ... -def maxpp(fragment: bytes, width: int) -> int: ... -def minmax(fragment: bytes, width: int) -> Tuple[int, int]: ... -def mul(fragment: bytes, width: int, factor: float) -> bytes: ... +def add(__fragment1: bytes, __fragment2: bytes, __width: int) -> bytes: ... +def adpcm2lin(__fragment: bytes, __width: int, __state: Optional[AdpcmState]) -> Tuple[bytes, AdpcmState]: ... +def alaw2lin(__fragment: bytes, __width: int) -> bytes: ... +def avg(__fragment: bytes, __width: int) -> int: ... +def avgpp(__fragment: bytes, __width: int) -> int: ... +def bias(__fragment: bytes, __width: int, __bias: int) -> bytes: ... +def byteswap(__fragment: bytes, __width: int) -> bytes: ... +def cross(__fragment: bytes, __width: int) -> int: ... +def findfactor(__fragment: bytes, __reference: bytes) -> float: ... +def findfit(__fragment: bytes, __reference: bytes) -> Tuple[int, float]: ... +def findmax(__fragment: bytes, __length: int) -> int: ... +def getsample(__fragment: bytes, __width: int, __index: int) -> int: ... +def lin2adpcm(__fragment: bytes, __width: int, __state: Optional[AdpcmState]) -> Tuple[bytes, AdpcmState]: ... +def lin2alaw(__fragment: bytes, __width: int) -> bytes: ... +def lin2lin(__fragment: bytes, __width: int, __newwidth: int) -> bytes: ... +def lin2ulaw(__fragment: bytes, __width: int) -> bytes: ... +def max(__fragment: bytes, __width: int) -> int: ... +def maxpp(__fragment: bytes, __width: int) -> int: ... +def minmax(__fragment: bytes, __width: int) -> Tuple[int, int]: ... +def mul(__fragment: bytes, __width: int, __factor: float) -> bytes: ... def ratecv( - fragment: bytes, - width: int, - nchannels: int, - inrate: int, - outrate: int, - state: Optional[RatecvState], - weightA: int = ..., - weightB: int = ..., + __fragment: bytes, + __width: int, + __nchannels: int, + __inrate: int, + __outrate: int, + __state: Optional[RatecvState], + __weightA: int = ..., + __weightB: int = ..., ) -> Tuple[bytes, RatecvState]: ... -def reverse(fragment: bytes, width: int) -> bytes: ... -def rms(fragment: bytes, width: int) -> int: ... -def tomono(fragment: bytes, width: int, lfactor: float, rfactor: float) -> bytes: ... -def tostereo(fragment: bytes, width: int, lfactor: float, rfactor: float) -> bytes: ... -def ulaw2lin(fragment: bytes, width: int) -> bytes: ... +def reverse(__fragment: bytes, __width: int) -> bytes: ... +def rms(__fragment: bytes, __width: int) -> int: ... +def tomono(__fragment: bytes, __width: int, __lfactor: float, __rfactor: float) -> bytes: ... +def tostereo(__fragment: bytes, __width: int, __lfactor: float, __rfactor: float) -> bytes: ... +def ulaw2lin(__fragment: bytes, __width: int) -> bytes: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/base64.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/base64.pyi old mode 100755 new mode 100644 index 7c648c8b..01be704a --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/base64.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/base64.pyi @@ -1,7 +1,5 @@ -# Stubs for base64 - -from typing import IO, Union, Text import sys +from typing import IO, Optional, Union if sys.version_info < (3,): _encodable = Union[bytes, unicode] @@ -10,29 +8,30 @@ else: _encodable = bytes _decodable = Union[bytes, str] -def b64encode(s: _encodable, altchars: bytes = ...) -> bytes: ... -def b64decode(s: _decodable, altchars: bytes = ..., - validate: bool = ...) -> bytes: ... +def b64encode(s: _encodable, altchars: Optional[bytes] = ...) -> bytes: ... +def b64decode(s: _decodable, altchars: Optional[bytes] = ..., validate: bool = ...) -> bytes: ... def standard_b64encode(s: _encodable) -> bytes: ... def standard_b64decode(s: _decodable) -> bytes: ... def urlsafe_b64encode(s: _encodable) -> bytes: ... def urlsafe_b64decode(s: _decodable) -> bytes: ... def b32encode(s: _encodable) -> bytes: ... -def b32decode(s: _decodable, casefold: bool = ..., - map01: bytes = ...) -> bytes: ... +def b32decode(s: _decodable, casefold: bool = ..., map01: Optional[bytes] = ...) -> bytes: ... def b16encode(s: _encodable) -> bytes: ... def b16decode(s: _decodable, casefold: bool = ...) -> bytes: ... + if sys.version_info >= (3, 4): - def a85encode(b: _encodable, *, foldspaces: bool = ..., wrapcol: int = ..., - pad: bool = ..., adobe: bool = ...) -> bytes: ... - def a85decode(b: _decodable, *, foldspaces: bool = ..., - adobe: bool = ..., ignorechars: Union[str, bytes] = ...) -> bytes: ... + def a85encode(b: _encodable, *, foldspaces: bool = ..., wrapcol: int = ..., pad: bool = ..., adobe: bool = ...) -> bytes: ... + def a85decode(b: _decodable, *, foldspaces: bool = ..., adobe: bool = ..., ignorechars: Union[str, bytes] = ...) -> bytes: ... def b85encode(b: _encodable, pad: bool = ...) -> bytes: ... def b85decode(b: _decodable) -> bytes: ... def decode(input: IO[bytes], output: IO[bytes]) -> None: ... -def decodebytes(s: bytes) -> bytes: ... -def decodestring(s: bytes) -> bytes: ... def encode(input: IO[bytes], output: IO[bytes]) -> None: ... -def encodebytes(s: bytes) -> bytes: ... -def encodestring(s: bytes) -> bytes: ... + +if sys.version_info >= (3,): + def encodebytes(s: bytes) -> bytes: ... + def decodebytes(s: bytes) -> bytes: ... + +if sys.version_info < (3, 9): + def encodestring(s: bytes) -> bytes: ... + def decodestring(s: bytes) -> bytes: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/bdb.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/bdb.pyi old mode 100755 new mode 100644 index 18f46893..9d76b3af --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/bdb.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/bdb.pyi @@ -1,7 +1,5 @@ - -from typing import Set, Dict, Iterable, Any, Callable, Tuple, Type, SupportsInt, List, Union, TypeVar, Optional, IO -from types import FrameType, TracebackType, CodeType - +from types import CodeType, FrameType, TracebackType +from typing import IO, Any, Callable, Dict, Iterable, List, Mapping, Optional, Set, SupportsInt, Tuple, Type, TypeVar, Union _T = TypeVar("_T") _TraceDispatch = Callable[[FrameType, str, Any], Any] # TODO: Recursive type @@ -22,8 +20,7 @@ class Bdb: stopframe: Optional[FrameType] returnframe: Optional[FrameType] stoplineno: int - - def __init__(self, skip: Iterable[str] = ...) -> None: ... + def __init__(self, skip: Optional[Iterable[str]] = ...) -> None: ... def canonic(self, filename: str) -> str: ... def reset(self) -> None: ... def trace_dispatch(self, frame: FrameType, event: str, arg: Any) -> _TraceDispatch: ... @@ -34,7 +31,7 @@ class Bdb: def is_skipped_module(self, module_name: str) -> bool: ... def stop_here(self, frame: FrameType) -> bool: ... def break_here(self, frame: FrameType) -> bool: ... - def do_clear(self, arg: Any) -> None: ... + def do_clear(self, arg: Any) -> Optional[bool]: ... def break_anywhere(self, frame: FrameType) -> bool: ... def user_call(self, frame: FrameType, argument_list: None) -> None: ... def user_line(self, frame: FrameType) -> None: ... @@ -47,7 +44,9 @@ class Bdb: def set_trace(self, frame: Optional[FrameType] = ...) -> None: ... def set_continue(self) -> None: ... def set_quit(self) -> None: ... - def set_break(self, filename: str, lineno: int, temporary: bool = ..., cond: Optional[str] = ..., funcname: Optional[str] = ...) -> None: ... + def set_break( + self, filename: str, lineno: int, temporary: bool = ..., cond: Optional[str] = ..., funcname: Optional[str] = ... + ) -> None: ... def clear_break(self, filename: str, lineno: int) -> None: ... def clear_bpbynumber(self, arg: SupportsInt) -> None: ... def clear_all_file_breaks(self, filename: str) -> None: ... @@ -57,12 +56,16 @@ class Bdb: def get_breaks(self, filename: str, lineno: int) -> List[Breakpoint]: ... def get_file_breaks(self, filename: str) -> List[Breakpoint]: ... def get_all_breaks(self) -> List[Breakpoint]: ... - def get_stack(self, f: FrameType, t: TracebackType) -> Tuple[List[Tuple[FrameType, int]], int]: ... + def get_stack(self, f: Optional[FrameType], t: Optional[TracebackType]) -> Tuple[List[Tuple[FrameType, int]], int]: ... def format_stack_entry(self, frame_lineno: int, lprefix: str = ...) -> str: ... - def run(self, cmd: Union[str, CodeType], globals: Dict[str, Any] = ..., locals: Dict[str, Any] = ...) -> None: ... - def runeval(self, expr: str, globals: Dict[str, Any] = ..., locals: Dict[str, Any] = ...) -> None: ... - def runctx(self, cmd: Union[str, CodeType], globals: Dict[str, Any], locals: Dict[str, Any]) -> None: ... - def runcall(self, func: Callable[[Any], _T], *args: Any, **kwds: Any) -> Optional[_T]: ... + def run( + self, cmd: Union[str, CodeType], globals: Optional[Dict[str, Any]] = ..., locals: Optional[Mapping[str, Any]] = ... + ) -> None: ... + def runeval(self, expr: str, globals: Optional[Dict[str, Any]] = ..., locals: Optional[Mapping[str, Any]] = ...) -> None: ... + def runctx( + self, cmd: Union[str, CodeType], globals: Optional[Dict[str, Any]], locals: Optional[Mapping[str, Any]] + ) -> None: ... + def runcall(self, __func: Callable[..., _T], *args: Any, **kwds: Any) -> Optional[_T]: ... class Breakpoint: @@ -80,8 +83,9 @@ class Breakpoint: ignore: int hits: int number: int - - def __init__(self, file: str, line: int, temporary: bool = ..., cond: Optional[str] = ..., funcname: Optional[str] = ...) -> None: ... + def __init__( + self, file: str, line: int, temporary: bool = ..., cond: Optional[str] = ..., funcname: Optional[str] = ... + ) -> None: ... def deleteMe(self) -> None: ... def enable(self) -> None: ... def disable(self) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/binascii.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/binascii.pyi old mode 100755 new mode 100644 index d268a1b6..d4141b9c --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/binascii.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/binascii.pyi @@ -1,9 +1,5 @@ -# Stubs for binascii - -# Based on http://docs.python.org/3.2/library/binascii.html - import sys -from typing import Union, Text +from typing import Text, Union if sys.version_info < (3,): # Python 2 accepts unicode ascii pretty much everywhere. @@ -15,28 +11,40 @@ else: _Bytes = bytes _Ascii = Union[bytes, str] -def a2b_uu(string: _Ascii) -> bytes: ... +def a2b_uu(__data: _Ascii) -> bytes: ... + if sys.version_info >= (3, 7): - def b2a_uu(data: _Bytes, *, backtick: bool = ...) -> bytes: ... + def b2a_uu(__data: _Bytes, *, backtick: bool = ...) -> bytes: ... + else: - def b2a_uu(data: _Bytes) -> bytes: ... -def a2b_base64(string: _Ascii) -> bytes: ... + def b2a_uu(__data: _Bytes) -> bytes: ... + +def a2b_base64(__data: _Ascii) -> bytes: ... + if sys.version_info >= (3, 6): - def b2a_base64(data: _Bytes, *, newline: bool = ...) -> bytes: ... + def b2a_base64(__data: _Bytes, *, newline: bool = ...) -> bytes: ... + else: - def b2a_base64(data: _Bytes) -> bytes: ... -def a2b_qp(string: _Ascii, header: bool = ...) -> bytes: ... + def b2a_base64(__data: _Bytes) -> bytes: ... + +def a2b_qp(data: _Ascii, header: bool = ...) -> bytes: ... def b2a_qp(data: _Bytes, quotetabs: bool = ..., istext: bool = ..., header: bool = ...) -> bytes: ... -def a2b_hqx(string: _Ascii) -> bytes: ... -def rledecode_hqx(data: _Bytes) -> bytes: ... -def rlecode_hqx(data: _Bytes) -> bytes: ... -def b2a_hqx(data: _Bytes) -> bytes: ... -def crc_hqx(data: _Bytes, crc: int) -> int: ... -def crc32(data: _Bytes, crc: int = ...) -> int: ... -def b2a_hex(data: _Bytes) -> bytes: ... -def hexlify(data: _Bytes) -> bytes: ... -def a2b_hex(hexstr: _Ascii) -> bytes: ... -def unhexlify(hexlify: _Ascii) -> bytes: ... - -class Error(Exception): ... +def a2b_hqx(__data: _Ascii) -> bytes: ... +def rledecode_hqx(__data: _Bytes) -> bytes: ... +def rlecode_hqx(__data: _Bytes) -> bytes: ... +def b2a_hqx(__data: _Bytes) -> bytes: ... +def crc_hqx(__data: _Bytes, __crc: int) -> int: ... +def crc32(__data: _Bytes, __crc: int = ...) -> int: ... +def b2a_hex(__data: _Bytes) -> bytes: ... + +if sys.version_info >= (3, 8): + def hexlify(data: bytes, sep: Union[str, bytes] = ..., bytes_per_sep: int = ...) -> bytes: ... + +else: + def hexlify(__data: _Bytes) -> bytes: ... + +def a2b_hex(__hexstr: _Ascii) -> bytes: ... +def unhexlify(__hexstr: _Ascii) -> bytes: ... + +class Error(ValueError): ... class Incomplete(Exception): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/binhex.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/binhex.pyi old mode 100755 new mode 100644 index c759ba0b..02d094fa --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/binhex.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/binhex.pyi @@ -1,10 +1,4 @@ -from typing import ( - Any, - IO, - Tuple, - Union, -) - +from typing import IO, Any, Tuple, Union class Error(Exception): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/bisect.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/bisect.pyi old mode 100755 new mode 100644 index c3075297..60dfc48d --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/bisect.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/bisect.pyi @@ -1,13 +1,4 @@ -# Stubs for bisect +from _bisect import * -from typing import Any, Sequence, MutableSequence, TypeVar - -_T = TypeVar('_T') - -def bisect_left(a: Sequence[_T], x: _T, lo: int = ..., hi: int = ...) -> int: ... -def bisect_right(a: Sequence[_T], x: _T, lo: int = ..., hi: int = ...) -> int: ... -def bisect(a: Sequence[_T], x: _T, lo: int = ..., hi: int = ...) -> int: ... - -def insort_left(a: MutableSequence[_T], x: _T, lo: int = ..., hi: int = ...) -> int: ... -def insort_right(a: MutableSequence[_T], x: _T, lo: int = ..., hi: int = ...) -> int: ... -def insort(a: MutableSequence[_T], x: _T, lo: int = ..., hi: int = ...) -> int: ... +bisect = bisect_right +insort = insort_right diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/builtins.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/builtins.pyi deleted file mode 100755 index 249a5cd6..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/builtins.pyi +++ /dev/null @@ -1,1650 +0,0 @@ -# True and False are deliberately omitted because they are keywords in -# Python 3, and stub files conform to Python 3 syntax. - -from typing import ( - TypeVar, Iterator, Iterable, NoReturn, overload, Container, - Sequence, MutableSequence, Mapping, MutableMapping, Tuple, List, Any, Dict, Callable, Generic, - Set, AbstractSet, FrozenSet, MutableSet, Sized, Reversible, SupportsInt, SupportsFloat, SupportsAbs, - SupportsComplex, IO, BinaryIO, Union, - ItemsView, KeysView, ValuesView, ByteString, Optional, AnyStr, Type, Text, - Protocol, -) -from abc import abstractmethod, ABCMeta -from ast import mod, AST -from types import TracebackType, CodeType -import sys - -if sys.version_info >= (3,): - from typing import SupportsBytes, SupportsRound - -if sys.version_info >= (3, 8): - from typing import Literal -else: - from typing_extensions import Literal - -_T = TypeVar('_T') -_T_co = TypeVar('_T_co', covariant=True) -_KT = TypeVar('_KT') -_VT = TypeVar('_VT') -_S = TypeVar('_S') -_T1 = TypeVar('_T1') -_T2 = TypeVar('_T2') -_T3 = TypeVar('_T3') -_T4 = TypeVar('_T4') -_T5 = TypeVar('_T5') -_TT = TypeVar('_TT', bound='type') - -class _SupportsIndex(Protocol): - def __index__(self) -> int: ... - -class object: - __doc__: Optional[str] - __dict__: Dict[str, Any] - __slots__: Union[Text, Iterable[Text]] - __module__: str - if sys.version_info >= (3, 6): - __annotations__: Dict[str, Any] - - @property - def __class__(self: _T) -> Type[_T]: ... - @__class__.setter - def __class__(self, __type: Type[object]) -> None: ... - def __init__(self) -> None: ... - def __new__(cls) -> Any: ... - def __setattr__(self, name: str, value: Any) -> None: ... - def __eq__(self, o: object) -> bool: ... - def __ne__(self, o: object) -> bool: ... - def __str__(self) -> str: ... - def __repr__(self) -> str: ... - def __hash__(self) -> int: ... - def __format__(self, format_spec: str) -> str: ... - def __getattribute__(self, name: str) -> Any: ... - def __delattr__(self, name: str) -> None: ... - def __sizeof__(self) -> int: ... - def __reduce__(self) -> Union[str, Tuple[Any, ...]]: ... - def __reduce_ex__(self, protocol: int) -> Union[str, Tuple[Any, ...]]: ... - if sys.version_info >= (3,): - def __dir__(self) -> Iterable[str]: ... - if sys.version_info >= (3, 6): - def __init_subclass__(cls) -> None: ... - -class staticmethod(object): # Special, only valid as a decorator. - __func__: Callable[..., Any] - if sys.version_info >= (3,): - __isabstractmethod__: bool - - def __init__(self, f: Callable[..., Any]) -> None: ... - def __new__(cls: Type[_T], *args: Any, **kwargs: Any) -> _T: ... - def __get__(self, obj: _T, type: Optional[Type[_T]] = ...) -> Callable[..., Any]: ... - -class classmethod(object): # Special, only valid as a decorator. - __func__: Callable[..., Any] - if sys.version_info >= (3,): - __isabstractmethod__: bool - - def __init__(self, f: Callable[..., Any]) -> None: ... - def __new__(cls: Type[_T], *args: Any, **kwargs: Any) -> _T: ... - def __get__(self, obj: _T, type: Optional[Type[_T]] = ...) -> Callable[..., Any]: ... - -class type(object): - __base__: type - __bases__: Tuple[type, ...] - __basicsize__: int - __dict__: Dict[str, Any] - __dictoffset__: int - __flags__: int - __itemsize__: int - __module__: str - __mro__: Tuple[type, ...] - __name__: str - if sys.version_info >= (3,): - __qualname__: str - __text_signature__: Optional[str] - __weakrefoffset__: int - - @overload - def __init__(self, o: object) -> None: ... - @overload - def __init__(self, name: str, bases: Tuple[type, ...], dict: Dict[str, Any]) -> None: ... - @overload - def __new__(cls, o: object) -> type: ... - @overload - def __new__(cls, name: str, bases: Tuple[type, ...], namespace: Dict[str, Any]) -> type: ... - def __call__(self, *args: Any, **kwds: Any) -> Any: ... - def __subclasses__(self: _TT) -> List[_TT]: ... - # Note: the documentation doesnt specify what the return type is, the standard - # implementation seems to be returning a list. - def mro(self) -> List[type]: ... - def __instancecheck__(self, instance: Any) -> bool: ... - def __subclasscheck__(self, subclass: type) -> bool: ... - if sys.version_info >= (3,): - @classmethod - def __prepare__(metacls, __name: str, __bases: Tuple[type, ...], **kwds: Any) -> Mapping[str, Any]: ... - -class super(object): - if sys.version_info >= (3,): - @overload - def __init__(self, t: Any, obj: Any) -> None: ... - @overload - def __init__(self, t: Any) -> None: ... - @overload - def __init__(self) -> None: ... - else: - @overload - def __init__(self, t: Any, obj: Any) -> None: ... - @overload - def __init__(self, t: Any) -> None: ... - -class int: - @overload - def __init__(self, x: Union[Text, bytes, SupportsInt, _SupportsIndex] = ...) -> None: ... - @overload - def __init__(self, x: Union[Text, bytes, bytearray], base: int) -> None: ... - - if sys.version_info >= (3, 8): - def as_integer_ratio(self) -> Tuple[int, Literal[1]]: ... - @property - def real(self) -> int: ... - @property - def imag(self) -> int: ... - @property - def numerator(self) -> int: ... - @property - def denominator(self) -> int: ... - def conjugate(self) -> int: ... - - def bit_length(self) -> int: ... - if sys.version_info >= (3,): - def to_bytes(self, length: int, byteorder: str, *, signed: bool = ...) -> bytes: ... - @classmethod - def from_bytes(cls, bytes: Sequence[int], byteorder: str, *, - signed: bool = ...) -> int: ... # TODO buffer object argument - - def __add__(self, x: int) -> int: ... - def __sub__(self, x: int) -> int: ... - def __mul__(self, x: int) -> int: ... - def __floordiv__(self, x: int) -> int: ... - if sys.version_info < (3,): - def __div__(self, x: int) -> int: ... - def __truediv__(self, x: int) -> float: ... - def __mod__(self, x: int) -> int: ... - def __divmod__(self, x: int) -> Tuple[int, int]: ... - def __radd__(self, x: int) -> int: ... - def __rsub__(self, x: int) -> int: ... - def __rmul__(self, x: int) -> int: ... - def __rfloordiv__(self, x: int) -> int: ... - if sys.version_info < (3,): - def __rdiv__(self, x: int) -> int: ... - def __rtruediv__(self, x: int) -> float: ... - def __rmod__(self, x: int) -> int: ... - def __rdivmod__(self, x: int) -> Tuple[int, int]: ... - def __pow__(self, __x: int, __modulo: Optional[int] = ...) -> Any: ... # Return type can be int or float, depending on x. - def __rpow__(self, x: int) -> Any: ... - def __and__(self, n: int) -> int: ... - def __or__(self, n: int) -> int: ... - def __xor__(self, n: int) -> int: ... - def __lshift__(self, n: int) -> int: ... - def __rshift__(self, n: int) -> int: ... - def __rand__(self, n: int) -> int: ... - def __ror__(self, n: int) -> int: ... - def __rxor__(self, n: int) -> int: ... - def __rlshift__(self, n: int) -> int: ... - def __rrshift__(self, n: int) -> int: ... - def __neg__(self) -> int: ... - def __pos__(self) -> int: ... - def __invert__(self) -> int: ... - def __trunc__(self) -> int: ... - if sys.version_info >= (3,): - def __ceil__(self) -> int: ... - def __floor__(self) -> int: ... - def __round__(self, ndigits: Optional[int] = ...) -> int: ... - def __getnewargs__(self) -> Tuple[int]: ... - - def __eq__(self, x: object) -> bool: ... - def __ne__(self, x: object) -> bool: ... - def __lt__(self, x: int) -> bool: ... - def __le__(self, x: int) -> bool: ... - def __gt__(self, x: int) -> bool: ... - def __ge__(self, x: int) -> bool: ... - - def __str__(self) -> str: ... - def __float__(self) -> float: ... - def __int__(self) -> int: ... - def __abs__(self) -> int: ... - def __hash__(self) -> int: ... - if sys.version_info >= (3,): - def __bool__(self) -> bool: ... - else: - def __nonzero__(self) -> bool: ... - def __index__(self) -> int: ... - -class float: - def __init__(self, x: Union[SupportsFloat, _SupportsIndex, Text, bytes, bytearray] = ...) -> None: ... - def as_integer_ratio(self) -> Tuple[int, int]: ... - def hex(self) -> str: ... - def is_integer(self) -> bool: ... - @classmethod - def fromhex(cls, s: str) -> float: ... - - @property - def real(self) -> float: ... - @property - def imag(self) -> float: ... - def conjugate(self) -> float: ... - - def __add__(self, x: float) -> float: ... - def __sub__(self, x: float) -> float: ... - def __mul__(self, x: float) -> float: ... - def __floordiv__(self, x: float) -> float: ... - if sys.version_info < (3,): - def __div__(self, x: float) -> float: ... - def __truediv__(self, x: float) -> float: ... - def __mod__(self, x: float) -> float: ... - def __divmod__(self, x: float) -> Tuple[float, float]: ... - def __pow__(self, x: float) -> float: ... # In Python 3, returns complex if self is negative and x is not whole - def __radd__(self, x: float) -> float: ... - def __rsub__(self, x: float) -> float: ... - def __rmul__(self, x: float) -> float: ... - def __rfloordiv__(self, x: float) -> float: ... - if sys.version_info < (3,): - def __rdiv__(self, x: float) -> float: ... - def __rtruediv__(self, x: float) -> float: ... - def __rmod__(self, x: float) -> float: ... - def __rdivmod__(self, x: float) -> Tuple[float, float]: ... - def __rpow__(self, x: float) -> float: ... - def __getnewargs__(self) -> Tuple[float]: ... - def __trunc__(self) -> int: ... - if sys.version_info >= (3,): - @overload - def __round__(self, ndigits: None = ...) -> int: ... - @overload - def __round__(self, ndigits: int) -> float: ... - - def __eq__(self, x: object) -> bool: ... - def __ne__(self, x: object) -> bool: ... - def __lt__(self, x: float) -> bool: ... - def __le__(self, x: float) -> bool: ... - def __gt__(self, x: float) -> bool: ... - def __ge__(self, x: float) -> bool: ... - def __neg__(self) -> float: ... - def __pos__(self) -> float: ... - - def __str__(self) -> str: ... - def __int__(self) -> int: ... - def __float__(self) -> float: ... - def __abs__(self) -> float: ... - def __hash__(self) -> int: ... - if sys.version_info >= (3,): - def __bool__(self) -> bool: ... - else: - def __nonzero__(self) -> bool: ... - -class complex: - @overload - def __init__(self, real: float = ..., imag: float = ...) -> None: ... - @overload - def __init__(self, real: Union[str, SupportsComplex, _SupportsIndex]) -> None: ... - - @property - def real(self) -> float: ... - @property - def imag(self) -> float: ... - - def conjugate(self) -> complex: ... - - def __add__(self, x: complex) -> complex: ... - def __sub__(self, x: complex) -> complex: ... - def __mul__(self, x: complex) -> complex: ... - def __pow__(self, x: complex) -> complex: ... - if sys.version_info < (3,): - def __div__(self, x: complex) -> complex: ... - def __truediv__(self, x: complex) -> complex: ... - def __radd__(self, x: complex) -> complex: ... - def __rsub__(self, x: complex) -> complex: ... - def __rmul__(self, x: complex) -> complex: ... - def __rpow__(self, x: complex) -> complex: ... - if sys.version_info < (3,): - def __rdiv__(self, x: complex) -> complex: ... - def __rtruediv__(self, x: complex) -> complex: ... - - def __eq__(self, x: object) -> bool: ... - def __ne__(self, x: object) -> bool: ... - def __neg__(self) -> complex: ... - def __pos__(self) -> complex: ... - - def __str__(self) -> str: ... - def __complex__(self) -> complex: ... - def __abs__(self) -> float: ... - def __hash__(self) -> int: ... - if sys.version_info >= (3,): - def __bool__(self) -> bool: ... - else: - def __nonzero__(self) -> bool: ... - -if sys.version_info >= (3,): - _str_base = object -else: - class basestring(metaclass=ABCMeta): ... - - class unicode(basestring, Sequence[unicode]): - @overload - def __init__(self) -> None: ... - @overload - def __init__(self, o: object) -> None: ... - @overload - def __init__(self, o: str, encoding: unicode = ..., errors: unicode = ...) -> None: ... - def capitalize(self) -> unicode: ... - def center(self, width: int, fillchar: unicode = ...) -> unicode: ... - def count(self, x: unicode) -> int: ... - def decode(self, encoding: unicode = ..., errors: unicode = ...) -> unicode: ... - def encode(self, encoding: unicode = ..., errors: unicode = ...) -> str: ... - def endswith(self, suffix: Union[unicode, Tuple[unicode, ...]], start: int = ..., - end: int = ...) -> bool: ... - def expandtabs(self, tabsize: int = ...) -> unicode: ... - def find(self, sub: unicode, start: int = ..., end: int = ...) -> int: ... - def format(self, *args: object, **kwargs: object) -> unicode: ... - def index(self, sub: unicode, start: int = ..., end: int = ...) -> int: ... - def isalnum(self) -> bool: ... - def isalpha(self) -> bool: ... - def isdecimal(self) -> bool: ... - def isdigit(self) -> bool: ... - def isidentifier(self) -> bool: ... - def islower(self) -> bool: ... - def isnumeric(self) -> bool: ... - def isprintable(self) -> bool: ... - def isspace(self) -> bool: ... - def istitle(self) -> bool: ... - def isupper(self) -> bool: ... - def join(self, iterable: Iterable[unicode]) -> unicode: ... - def ljust(self, width: int, fillchar: unicode = ...) -> unicode: ... - def lower(self) -> unicode: ... - def lstrip(self, chars: unicode = ...) -> unicode: ... - def partition(self, sep: unicode) -> Tuple[unicode, unicode, unicode]: ... - def replace(self, old: unicode, new: unicode, count: int = ...) -> unicode: ... - def rfind(self, sub: unicode, start: int = ..., end: int = ...) -> int: ... - def rindex(self, sub: unicode, start: int = ..., end: int = ...) -> int: ... - def rjust(self, width: int, fillchar: unicode = ...) -> unicode: ... - def rpartition(self, sep: unicode) -> Tuple[unicode, unicode, unicode]: ... - def rsplit(self, sep: Optional[unicode] = ..., maxsplit: int = ...) -> List[unicode]: ... - def rstrip(self, chars: unicode = ...) -> unicode: ... - def split(self, sep: Optional[unicode] = ..., maxsplit: int = ...) -> List[unicode]: ... - def splitlines(self, keepends: bool = ...) -> List[unicode]: ... - def startswith(self, prefix: Union[unicode, Tuple[unicode, ...]], start: int = ..., - end: int = ...) -> bool: ... - def strip(self, chars: unicode = ...) -> unicode: ... - def swapcase(self) -> unicode: ... - def title(self) -> unicode: ... - def translate(self, table: Union[Dict[int, Any], unicode]) -> unicode: ... - def upper(self) -> unicode: ... - def zfill(self, width: int) -> unicode: ... - - @overload - def __getitem__(self, i: int) -> unicode: ... - @overload - def __getitem__(self, s: slice) -> unicode: ... - def __getslice__(self, start: int, stop: int) -> unicode: ... - def __add__(self, s: unicode) -> unicode: ... - def __mul__(self, n: int) -> unicode: ... - def __rmul__(self, n: int) -> unicode: ... - def __mod__(self, x: Any) -> unicode: ... - def __eq__(self, x: object) -> bool: ... - def __ne__(self, x: object) -> bool: ... - def __lt__(self, x: unicode) -> bool: ... - def __le__(self, x: unicode) -> bool: ... - def __gt__(self, x: unicode) -> bool: ... - def __ge__(self, x: unicode) -> bool: ... - - def __len__(self) -> int: ... - # The argument type is incompatible with Sequence - def __contains__(self, s: Union[unicode, bytes]) -> bool: ... # type: ignore - def __iter__(self) -> Iterator[unicode]: ... - def __str__(self) -> str: ... - def __repr__(self) -> str: ... - def __int__(self) -> int: ... - def __float__(self) -> float: ... - def __hash__(self) -> int: ... - def __getnewargs__(self) -> Tuple[unicode]: ... - - _str_base = basestring - -class str(Sequence[str], _str_base): - if sys.version_info >= (3,): - @overload - def __init__(self, o: object = ...) -> None: ... - @overload - def __init__(self, o: bytes, encoding: str = ..., errors: str = ...) -> None: ... - else: - def __init__(self, o: object = ...) -> None: ... - - def capitalize(self) -> str: ... - if sys.version_info >= (3, 3): - def casefold(self) -> str: ... - def center(self, width: int, fillchar: str = ...) -> str: ... - def count(self, x: Text, __start: Optional[int] = ..., __end: Optional[int] = ...) -> int: ... - if sys.version_info < (3,): - def decode(self, encoding: Text = ..., errors: Text = ...) -> unicode: ... - def encode(self, encoding: Text = ..., errors: Text = ...) -> bytes: ... - if sys.version_info >= (3,): - def endswith(self, suffix: Union[Text, Tuple[Text, ...]], start: Optional[int] = ..., - end: Optional[int] = ...) -> bool: ... - else: - def endswith(self, suffix: Union[Text, Tuple[Text, ...]]) -> bool: ... - def expandtabs(self, tabsize: int = ...) -> str: ... - def find(self, sub: Text, __start: Optional[int] = ..., __end: Optional[int] = ...) -> int: ... - def format(self, *args: object, **kwargs: object) -> str: ... - if sys.version_info >= (3,): - def format_map(self, map: Mapping[str, Any]) -> str: ... - def index(self, sub: Text, __start: Optional[int] = ..., __end: Optional[int] = ...) -> int: ... - def isalnum(self) -> bool: ... - def isalpha(self) -> bool: ... - if sys.version_info >= (3, 7): - def isascii(self) -> bool: ... - if sys.version_info >= (3,): - def isdecimal(self) -> bool: ... - def isdigit(self) -> bool: ... - if sys.version_info >= (3,): - def isidentifier(self) -> bool: ... - def islower(self) -> bool: ... - if sys.version_info >= (3,): - def isnumeric(self) -> bool: ... - def isprintable(self) -> bool: ... - def isspace(self) -> bool: ... - def istitle(self) -> bool: ... - def isupper(self) -> bool: ... - if sys.version_info >= (3,): - def join(self, iterable: Iterable[str]) -> str: ... - else: - def join(self, iterable: Iterable[AnyStr]) -> AnyStr: ... - def ljust(self, width: int, fillchar: str = ...) -> str: ... - def lower(self) -> str: ... - if sys.version_info >= (3,): - def lstrip(self, chars: Optional[str] = ...) -> str: ... - def partition(self, sep: str) -> Tuple[str, str, str]: ... - def replace(self, old: str, new: str, count: int = ...) -> str: ... - else: - @overload - def lstrip(self, chars: str = ...) -> str: ... - @overload - def lstrip(self, chars: unicode) -> unicode: ... - @overload - def partition(self, sep: bytearray) -> Tuple[str, bytearray, str]: ... - @overload - def partition(self, sep: str) -> Tuple[str, str, str]: ... - @overload - def partition(self, sep: unicode) -> Tuple[unicode, unicode, unicode]: ... - def replace(self, old: AnyStr, new: AnyStr, count: int = ...) -> AnyStr: ... - def rfind(self, sub: Text, __start: Optional[int] = ..., __end: Optional[int] = ...) -> int: ... - def rindex(self, sub: Text, __start: Optional[int] = ..., __end: Optional[int] = ...) -> int: ... - def rjust(self, width: int, fillchar: str = ...) -> str: ... - if sys.version_info >= (3,): - def rpartition(self, sep: str) -> Tuple[str, str, str]: ... - def rsplit(self, sep: Optional[str] = ..., maxsplit: int = ...) -> List[str]: ... - def rstrip(self, chars: Optional[str] = ...) -> str: ... - def split(self, sep: Optional[str] = ..., maxsplit: int = ...) -> List[str]: ... - else: - @overload - def rpartition(self, sep: bytearray) -> Tuple[str, bytearray, str]: ... - @overload - def rpartition(self, sep: str) -> Tuple[str, str, str]: ... - @overload - def rpartition(self, sep: unicode) -> Tuple[unicode, unicode, unicode]: ... - @overload - def rsplit(self, sep: Optional[str] = ..., maxsplit: int = ...) -> List[str]: ... - @overload - def rsplit(self, sep: unicode, maxsplit: int = ...) -> List[unicode]: ... - @overload - def rstrip(self, chars: str = ...) -> str: ... - @overload - def rstrip(self, chars: unicode) -> unicode: ... - @overload - def split(self, sep: Optional[str] = ..., maxsplit: int = ...) -> List[str]: ... - @overload - def split(self, sep: unicode, maxsplit: int = ...) -> List[unicode]: ... - def splitlines(self, keepends: bool = ...) -> List[str]: ... - if sys.version_info >= (3,): - def startswith(self, prefix: Union[Text, Tuple[Text, ...]], start: Optional[int] = ..., - end: Optional[int] = ...) -> bool: ... - def strip(self, chars: Optional[str] = ...) -> str: ... - else: - def startswith(self, prefix: Union[Text, Tuple[Text, ...]]) -> bool: ... - @overload - def strip(self, chars: str = ...) -> str: ... - @overload - def strip(self, chars: unicode) -> unicode: ... - def swapcase(self) -> str: ... - def title(self) -> str: ... - if sys.version_info >= (3,): - def translate(self, table: Union[Mapping[int, Union[int, str, None]], Sequence[Union[int, str, None]]]) -> str: ... - else: - def translate(self, table: Optional[AnyStr], deletechars: AnyStr = ...) -> AnyStr: ... - def upper(self) -> str: ... - def zfill(self, width: int) -> str: ... - if sys.version_info >= (3,): - @staticmethod - @overload - def maketrans(x: Union[Dict[int, _T], Dict[str, _T], Dict[Union[str, int], _T]]) -> Dict[int, _T]: ... - @staticmethod - @overload - def maketrans(x: str, y: str, z: str = ...) -> Dict[int, Union[int, None]]: ... - - if sys.version_info >= (3,): - def __add__(self, s: str) -> str: ... - else: - def __add__(self, s: AnyStr) -> AnyStr: ... - # Incompatible with Sequence.__contains__ - def __contains__(self, o: Union[str, Text]) -> bool: ... # type: ignore - def __eq__(self, x: object) -> bool: ... - def __ge__(self, x: Text) -> bool: ... - def __getitem__(self, i: Union[int, slice]) -> str: ... - def __gt__(self, x: Text) -> bool: ... - def __hash__(self) -> int: ... - def __iter__(self) -> Iterator[str]: ... - def __le__(self, x: Text) -> bool: ... - def __len__(self) -> int: ... - def __lt__(self, x: Text) -> bool: ... - def __mod__(self, x: Any) -> str: ... - def __mul__(self, n: int) -> str: ... - def __ne__(self, x: object) -> bool: ... - def __repr__(self) -> str: ... - def __rmul__(self, n: int) -> str: ... - def __str__(self) -> str: ... - def __getnewargs__(self) -> Tuple[str]: ... - - if sys.version_info < (3,): - def __getslice__(self, start: int, stop: int) -> str: ... - def __float__(self) -> float: ... - def __int__(self) -> int: ... - -if sys.version_info >= (3,): - class bytes(ByteString): - @overload - def __init__(self, ints: Iterable[int]) -> None: ... - @overload - def __init__(self, string: str, encoding: str, - errors: str = ...) -> None: ... - @overload - def __init__(self, length: int) -> None: ... - @overload - def __init__(self) -> None: ... - @overload - def __init__(self, o: SupportsBytes) -> None: ... - def capitalize(self) -> bytes: ... - def center(self, width: int, fillchar: bytes = ...) -> bytes: ... - def count(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... - def decode(self, encoding: str = ..., errors: str = ...) -> str: ... - def endswith(self, suffix: Union[bytes, Tuple[bytes, ...]]) -> bool: ... - def expandtabs(self, tabsize: int = ...) -> bytes: ... - def find(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... - if sys.version_info >= (3, 5): - def hex(self) -> str: ... - def index(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... - def isalnum(self) -> bool: ... - def isalpha(self) -> bool: ... - if sys.version_info >= (3, 7): - def isascii(self) -> bool: ... - def isdigit(self) -> bool: ... - def islower(self) -> bool: ... - def isspace(self) -> bool: ... - def istitle(self) -> bool: ... - def isupper(self) -> bool: ... - def join(self, iterable: Iterable[Union[ByteString, memoryview]]) -> bytes: ... - def ljust(self, width: int, fillchar: bytes = ...) -> bytes: ... - def lower(self) -> bytes: ... - def lstrip(self, chars: Optional[bytes] = ...) -> bytes: ... - def partition(self, sep: bytes) -> Tuple[bytes, bytes, bytes]: ... - def replace(self, old: bytes, new: bytes, count: int = ...) -> bytes: ... - def rfind(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... - def rindex(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... - def rjust(self, width: int, fillchar: bytes = ...) -> bytes: ... - def rpartition(self, sep: bytes) -> Tuple[bytes, bytes, bytes]: ... - def rsplit(self, sep: Optional[bytes] = ..., maxsplit: int = ...) -> List[bytes]: ... - def rstrip(self, chars: Optional[bytes] = ...) -> bytes: ... - def split(self, sep: Optional[bytes] = ..., maxsplit: int = ...) -> List[bytes]: ... - def splitlines(self, keepends: bool = ...) -> List[bytes]: ... - def startswith( - self, - prefix: Union[bytes, Tuple[bytes, ...]], - start: Optional[int] = ..., - end: Optional[int] = ..., - ) -> bool: ... - def strip(self, chars: Optional[bytes] = ...) -> bytes: ... - def swapcase(self) -> bytes: ... - def title(self) -> bytes: ... - def translate(self, table: Optional[bytes], delete: bytes = ...) -> bytes: ... - def upper(self) -> bytes: ... - def zfill(self, width: int) -> bytes: ... - @classmethod - def fromhex(cls, s: str) -> bytes: ... - @classmethod - def maketrans(cls, frm: bytes, to: bytes) -> bytes: ... - - def __len__(self) -> int: ... - def __iter__(self) -> Iterator[int]: ... - def __str__(self) -> str: ... - def __repr__(self) -> str: ... - def __int__(self) -> int: ... - def __float__(self) -> float: ... - def __hash__(self) -> int: ... - @overload - def __getitem__(self, i: int) -> int: ... - @overload - def __getitem__(self, s: slice) -> bytes: ... - def __add__(self, s: bytes) -> bytes: ... - def __mul__(self, n: int) -> bytes: ... - def __rmul__(self, n: int) -> bytes: ... - if sys.version_info >= (3, 5): - def __mod__(self, value: Any) -> bytes: ... - # Incompatible with Sequence.__contains__ - def __contains__(self, o: Union[int, bytes]) -> bool: ... # type: ignore - def __eq__(self, x: object) -> bool: ... - def __ne__(self, x: object) -> bool: ... - def __lt__(self, x: bytes) -> bool: ... - def __le__(self, x: bytes) -> bool: ... - def __gt__(self, x: bytes) -> bool: ... - def __ge__(self, x: bytes) -> bool: ... - def __getnewargs__(self) -> Tuple[bytes]: ... -else: - bytes = str - -class bytearray(MutableSequence[int], ByteString): - if sys.version_info >= (3,): - @overload - def __init__(self) -> None: ... - @overload - def __init__(self, ints: Iterable[int]) -> None: ... - @overload - def __init__(self, string: Text, encoding: Text, errors: Text = ...) -> None: ... - @overload - def __init__(self, length: int) -> None: ... - else: - @overload - def __init__(self) -> None: ... - @overload - def __init__(self, ints: Iterable[int]) -> None: ... - @overload - def __init__(self, string: str) -> None: ... - @overload - def __init__(self, string: Text, encoding: Text, errors: Text = ...) -> None: ... - @overload - def __init__(self, length: int) -> None: ... - def capitalize(self) -> bytearray: ... - def center(self, width: int, fillchar: bytes = ...) -> bytearray: ... - if sys.version_info >= (3,): - def count(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... - def copy(self) -> bytearray: ... - else: - def count(self, x: str) -> int: ... - def decode(self, encoding: Text = ..., errors: Text = ...) -> str: ... - def endswith(self, suffix: Union[bytes, Tuple[bytes, ...]]) -> bool: ... - def expandtabs(self, tabsize: int = ...) -> bytearray: ... - if sys.version_info < (3,): - def extend(self, iterable: Union[str, Iterable[int]]) -> None: ... - if sys.version_info >= (3,): - def find(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... - if sys.version_info >= (3, 5): - def hex(self) -> str: ... - def index(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... - else: - def find(self, sub: str, start: int = ..., end: int = ...) -> int: ... - def index(self, sub: str, start: int = ..., end: int = ...) -> int: ... - def insert(self, index: int, object: int) -> None: ... - def isalnum(self) -> bool: ... - def isalpha(self) -> bool: ... - if sys.version_info >= (3, 7): - def isascii(self) -> bool: ... - def isdigit(self) -> bool: ... - def islower(self) -> bool: ... - def isspace(self) -> bool: ... - def istitle(self) -> bool: ... - def isupper(self) -> bool: ... - if sys.version_info >= (3,): - def join(self, iterable: Iterable[Union[ByteString, memoryview]]) -> bytearray: ... - def ljust(self, width: int, fillchar: bytes = ...) -> bytearray: ... - else: - def join(self, iterable: Iterable[str]) -> bytearray: ... - def ljust(self, width: int, fillchar: str = ...) -> bytearray: ... - def lower(self) -> bytearray: ... - def lstrip(self, chars: Optional[bytes] = ...) -> bytearray: ... - def partition(self, sep: bytes) -> Tuple[bytearray, bytearray, bytearray]: ... - def replace(self, old: bytes, new: bytes, count: int = ...) -> bytearray: ... - if sys.version_info >= (3,): - def rfind(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... - def rindex(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... - else: - def rfind(self, sub: bytes, start: int = ..., end: int = ...) -> int: ... - def rindex(self, sub: bytes, start: int = ..., end: int = ...) -> int: ... - def rjust(self, width: int, fillchar: bytes = ...) -> bytearray: ... - def rpartition(self, sep: bytes) -> Tuple[bytearray, bytearray, bytearray]: ... - def rsplit(self, sep: Optional[bytes] = ..., maxsplit: int = ...) -> List[bytearray]: ... - def rstrip(self, chars: Optional[bytes] = ...) -> bytearray: ... - def split(self, sep: Optional[bytes] = ..., maxsplit: int = ...) -> List[bytearray]: ... - def splitlines(self, keepends: bool = ...) -> List[bytearray]: ... - def startswith( - self, - prefix: Union[bytes, Tuple[bytes, ...]], - start: Optional[int] = ..., - end: Optional[int] = ..., - ) -> bool: ... - def strip(self, chars: Optional[bytes] = ...) -> bytearray: ... - def swapcase(self) -> bytearray: ... - def title(self) -> bytearray: ... - if sys.version_info >= (3,): - def translate(self, table: Optional[bytes], delete: bytes = ...) -> bytearray: ... - else: - def translate(self, table: str) -> bytearray: ... - def upper(self) -> bytearray: ... - def zfill(self, width: int) -> bytearray: ... - @staticmethod - def fromhex(s: str) -> bytearray: ... - if sys.version_info >= (3,): - @classmethod - def maketrans(cls, frm: bytes, to: bytes) -> bytes: ... - - def __len__(self) -> int: ... - def __iter__(self) -> Iterator[int]: ... - def __str__(self) -> str: ... - def __repr__(self) -> str: ... - def __int__(self) -> int: ... - def __float__(self) -> float: ... - __hash__: None # type: ignore - @overload - def __getitem__(self, i: int) -> int: ... - @overload - def __getitem__(self, s: slice) -> bytearray: ... - @overload - def __setitem__(self, i: int, x: int) -> None: ... - @overload - def __setitem__(self, s: slice, x: Union[Iterable[int], bytes]) -> None: ... - def __delitem__(self, i: Union[int, slice]) -> None: ... - if sys.version_info < (3,): - def __getslice__(self, start: int, stop: int) -> bytearray: ... - def __setslice__(self, start: int, stop: int, x: Union[Sequence[int], str]) -> None: ... - def __delslice__(self, start: int, stop: int) -> None: ... - def __add__(self, s: bytes) -> bytearray: ... - if sys.version_info >= (3,): - def __iadd__(self, s: Iterable[int]) -> bytearray: ... - def __mul__(self, n: int) -> bytearray: ... - if sys.version_info >= (3,): - def __rmul__(self, n: int) -> bytearray: ... - def __imul__(self, n: int) -> bytearray: ... - if sys.version_info >= (3, 5): - def __mod__(self, value: Any) -> bytes: ... - # Incompatible with Sequence.__contains__ - def __contains__(self, o: Union[int, bytes]) -> bool: ... # type: ignore - def __eq__(self, x: object) -> bool: ... - def __ne__(self, x: object) -> bool: ... - def __lt__(self, x: bytes) -> bool: ... - def __le__(self, x: bytes) -> bool: ... - def __gt__(self, x: bytes) -> bool: ... - def __ge__(self, x: bytes) -> bool: ... - -if sys.version_info >= (3,): - _mv_container_type = int -else: - _mv_container_type = str - -class memoryview(Sized, Container[_mv_container_type]): - format: str - itemsize: int - shape: Optional[Tuple[int, ...]] - strides: Optional[Tuple[int, ...]] - suboffsets: Optional[Tuple[int, ...]] - readonly: bool - ndim: int - - if sys.version_info >= (3,): - c_contiguous: bool - f_contiguous: bool - contiguous: bool - nbytes: int - def __init__(self, obj: Union[bytes, bytearray, memoryview]) -> None: ... - def __enter__(self) -> memoryview: ... - def __exit__(self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType]) -> None: ... - else: - def __init__(self, obj: Union[bytes, bytearray, buffer, memoryview]) -> None: ... - - @overload - def __getitem__(self, i: int) -> _mv_container_type: ... - @overload - def __getitem__(self, s: slice) -> memoryview: ... - - def __contains__(self, x: object) -> bool: ... - def __iter__(self) -> Iterator[_mv_container_type]: ... - def __len__(self) -> int: ... - - @overload - def __setitem__(self, s: slice, o: memoryview) -> None: ... - @overload - def __setitem__(self, i: int, o: bytes) -> None: ... - @overload - def __setitem__(self, s: slice, o: Sequence[bytes]) -> None: ... - - def tobytes(self) -> bytes: ... - def tolist(self) -> List[int]: ... - - if sys.version_info >= (3, 2): - def release(self) -> None: ... - - if sys.version_info >= (3, 5): - def hex(self) -> str: ... - -class bool(int): - def __init__(self, o: object = ...) -> None: ... - @overload - def __and__(self, x: bool) -> bool: ... - @overload - def __and__(self, x: int) -> int: ... - @overload - def __or__(self, x: bool) -> bool: ... - @overload - def __or__(self, x: int) -> int: ... - @overload - def __xor__(self, x: bool) -> bool: ... - @overload - def __xor__(self, x: int) -> int: ... - @overload - def __rand__(self, x: bool) -> bool: ... - @overload - def __rand__(self, x: int) -> int: ... - @overload - def __ror__(self, x: bool) -> bool: ... - @overload - def __ror__(self, x: int) -> int: ... - @overload - def __rxor__(self, x: bool) -> bool: ... - @overload - def __rxor__(self, x: int) -> int: ... - def __getnewargs__(self) -> Tuple[int]: ... - -class slice(object): - start: Any - step: Any - stop: Any - @overload - def __init__(self, stop: Any) -> None: ... - @overload - def __init__(self, start: Any, stop: Any, step: Any = ...) -> None: ... - __hash__: None # type: ignore - def indices(self, len: int) -> Tuple[int, int, int]: ... - -class tuple(Sequence[_T_co], Generic[_T_co]): - def __new__(cls: Type[_T], iterable: Iterable[_T_co] = ...) -> _T: ... - def __init__(self, iterable: Iterable[_T_co] = ...): ... - def __len__(self) -> int: ... - def __contains__(self, x: object) -> bool: ... - @overload - def __getitem__(self, x: int) -> _T_co: ... - @overload - def __getitem__(self, x: slice) -> Tuple[_T_co, ...]: ... - def __iter__(self) -> Iterator[_T_co]: ... - def __lt__(self, x: Tuple[_T_co, ...]) -> bool: ... - def __le__(self, x: Tuple[_T_co, ...]) -> bool: ... - def __gt__(self, x: Tuple[_T_co, ...]) -> bool: ... - def __ge__(self, x: Tuple[_T_co, ...]) -> bool: ... - @overload - def __add__(self, x: Tuple[_T_co, ...]) -> Tuple[_T_co, ...]: ... - @overload - def __add__(self, x: Tuple[Any, ...]) -> Tuple[Any, ...]: ... - def __mul__(self, n: int) -> Tuple[_T_co, ...]: ... - def __rmul__(self, n: int) -> Tuple[_T_co, ...]: ... - def count(self, x: Any) -> int: ... - if sys.version_info >= (3, 5): - def index(self, x: Any, start: int = ..., end: int = ...) -> int: ... - else: - def index(self, x: Any) -> int: ... - -class list(MutableSequence[_T], Generic[_T]): - @overload - def __init__(self) -> None: ... - @overload - def __init__(self, iterable: Iterable[_T]) -> None: ... - if sys.version_info >= (3,): - def clear(self) -> None: ... - def copy(self) -> List[_T]: ... - def append(self, object: _T) -> None: ... - def extend(self, iterable: Iterable[_T]) -> None: ... - def pop(self, index: int = ...) -> _T: ... - def index(self, object: _T, start: int = ..., stop: int = ...) -> int: ... - def count(self, object: _T) -> int: ... - def insert(self, index: int, object: _T) -> None: ... - def remove(self, object: _T) -> None: ... - def reverse(self) -> None: ... - if sys.version_info >= (3,): - def sort(self, *, key: Optional[Callable[[_T], Any]] = ..., reverse: bool = ...) -> None: ... - else: - def sort(self, cmp: Callable[[_T, _T], Any] = ..., key: Callable[[_T], Any] = ..., reverse: bool = ...) -> None: ... - - def __len__(self) -> int: ... - def __iter__(self) -> Iterator[_T]: ... - def __str__(self) -> str: ... - __hash__: None # type: ignore - @overload - def __getitem__(self, i: int) -> _T: ... - @overload - def __getitem__(self, s: slice) -> List[_T]: ... - @overload - def __setitem__(self, i: int, o: _T) -> None: ... - @overload - def __setitem__(self, s: slice, o: Iterable[_T]) -> None: ... - def __delitem__(self, i: Union[int, slice]) -> None: ... - if sys.version_info < (3,): - def __getslice__(self, start: int, stop: int) -> List[_T]: ... - def __setslice__(self, start: int, stop: int, o: Sequence[_T]) -> None: ... - def __delslice__(self, start: int, stop: int) -> None: ... - def __add__(self, x: List[_T]) -> List[_T]: ... - def __iadd__(self: _S, x: Iterable[_T]) -> _S: ... - def __mul__(self, n: int) -> List[_T]: ... - def __rmul__(self, n: int) -> List[_T]: ... - if sys.version_info >= (3,): - def __imul__(self: _S, n: int) -> _S: ... - def __contains__(self, o: object) -> bool: ... - def __reversed__(self) -> Iterator[_T]: ... - def __gt__(self, x: List[_T]) -> bool: ... - def __ge__(self, x: List[_T]) -> bool: ... - def __lt__(self, x: List[_T]) -> bool: ... - def __le__(self, x: List[_T]) -> bool: ... - -class dict(MutableMapping[_KT, _VT], Generic[_KT, _VT]): - # NOTE: Keyword arguments are special. If they are used, _KT must include - # str, but we have no way of enforcing it here. - @overload - def __init__(self, **kwargs: _VT) -> None: ... - @overload - def __init__(self, map: Mapping[_KT, _VT], **kwargs: _VT) -> None: ... - @overload - def __init__(self, iterable: Iterable[Tuple[_KT, _VT]], **kwargs: _VT) -> None: ... - - def __new__(cls: Type[_T1], *args: Any, **kwargs: Any) -> _T1: ... - - if sys.version_info < (3,): - def has_key(self, k: _KT) -> bool: ... - def clear(self) -> None: ... - def copy(self) -> Dict[_KT, _VT]: ... - def popitem(self) -> Tuple[_KT, _VT]: ... - def setdefault(self, k: _KT, default: _VT = ...) -> _VT: ... - @overload - def update(self, __m: Mapping[_KT, _VT], **kwargs: _VT) -> None: ... - @overload - def update(self, __m: Iterable[Tuple[_KT, _VT]], **kwargs: _VT) -> None: ... - @overload - def update(self, **kwargs: _VT) -> None: ... - if sys.version_info >= (3,): - def keys(self) -> KeysView[_KT]: ... - def values(self) -> ValuesView[_VT]: ... - def items(self) -> ItemsView[_KT, _VT]: ... - else: - def iterkeys(self) -> Iterator[_KT]: ... - def itervalues(self) -> Iterator[_VT]: ... - def iteritems(self) -> Iterator[Tuple[_KT, _VT]]: ... - def viewkeys(self) -> KeysView[_KT]: ... - def viewvalues(self) -> ValuesView[_VT]: ... - def viewitems(self) -> ItemsView[_KT, _VT]: ... - @staticmethod - @overload - def fromkeys(seq: Iterable[_T]) -> Dict[_T, Any]: ... # TODO: Actually a class method (mypy/issues#328) - @staticmethod - @overload - def fromkeys(seq: Iterable[_T], value: _S) -> Dict[_T, _S]: ... - def __len__(self) -> int: ... - def __getitem__(self, k: _KT) -> _VT: ... - def __setitem__(self, k: _KT, v: _VT) -> None: ... - def __delitem__(self, v: _KT) -> None: ... - def __iter__(self) -> Iterator[_KT]: ... - if sys.version_info >= (3, 8): - def __reversed__(self) -> Iterator[_KT]: ... - def __str__(self) -> str: ... - __hash__: None # type: ignore - -class set(MutableSet[_T], Generic[_T]): - def __init__(self, iterable: Iterable[_T] = ...) -> None: ... - def add(self, element: _T) -> None: ... - def clear(self) -> None: ... - def copy(self) -> Set[_T]: ... - def difference(self, *s: Iterable[Any]) -> Set[_T]: ... - def difference_update(self, *s: Iterable[Any]) -> None: ... - def discard(self, element: _T) -> None: ... - def intersection(self, *s: Iterable[Any]) -> Set[_T]: ... - def intersection_update(self, *s: Iterable[Any]) -> None: ... - def isdisjoint(self, s: Iterable[Any]) -> bool: ... - def issubset(self, s: Iterable[Any]) -> bool: ... - def issuperset(self, s: Iterable[Any]) -> bool: ... - def pop(self) -> _T: ... - def remove(self, element: _T) -> None: ... - def symmetric_difference(self, s: Iterable[_T]) -> Set[_T]: ... - def symmetric_difference_update(self, s: Iterable[_T]) -> None: ... - def union(self, *s: Iterable[_T]) -> Set[_T]: ... - def update(self, *s: Iterable[_T]) -> None: ... - def __len__(self) -> int: ... - def __contains__(self, o: object) -> bool: ... - def __iter__(self) -> Iterator[_T]: ... - def __str__(self) -> str: ... - def __and__(self, s: AbstractSet[object]) -> Set[_T]: ... - def __iand__(self, s: AbstractSet[object]) -> Set[_T]: ... - def __or__(self, s: AbstractSet[_S]) -> Set[Union[_T, _S]]: ... - def __ior__(self, s: AbstractSet[_S]) -> Set[Union[_T, _S]]: ... - def __sub__(self, s: AbstractSet[object]) -> Set[_T]: ... - def __isub__(self, s: AbstractSet[object]) -> Set[_T]: ... - def __xor__(self, s: AbstractSet[_S]) -> Set[Union[_T, _S]]: ... - def __ixor__(self, s: AbstractSet[_S]) -> Set[Union[_T, _S]]: ... - def __le__(self, s: AbstractSet[object]) -> bool: ... - def __lt__(self, s: AbstractSet[object]) -> bool: ... - def __ge__(self, s: AbstractSet[object]) -> bool: ... - def __gt__(self, s: AbstractSet[object]) -> bool: ... - __hash__: None # type: ignore - -class frozenset(AbstractSet[_T], Generic[_T]): - def __init__(self, iterable: Iterable[_T] = ...) -> None: ... - def copy(self) -> FrozenSet[_T]: ... - def difference(self, *s: Iterable[object]) -> FrozenSet[_T]: ... - def intersection(self, *s: Iterable[object]) -> FrozenSet[_T]: ... - def isdisjoint(self, s: Iterable[_T]) -> bool: ... - def issubset(self, s: Iterable[object]) -> bool: ... - def issuperset(self, s: Iterable[object]) -> bool: ... - def symmetric_difference(self, s: Iterable[_T]) -> FrozenSet[_T]: ... - def union(self, *s: Iterable[_T]) -> FrozenSet[_T]: ... - def __len__(self) -> int: ... - def __contains__(self, o: object) -> bool: ... - def __iter__(self) -> Iterator[_T]: ... - def __str__(self) -> str: ... - def __and__(self, s: AbstractSet[_T]) -> FrozenSet[_T]: ... - def __or__(self, s: AbstractSet[_S]) -> FrozenSet[Union[_T, _S]]: ... - def __sub__(self, s: AbstractSet[_T]) -> FrozenSet[_T]: ... - def __xor__(self, s: AbstractSet[_S]) -> FrozenSet[Union[_T, _S]]: ... - def __le__(self, s: AbstractSet[object]) -> bool: ... - def __lt__(self, s: AbstractSet[object]) -> bool: ... - def __ge__(self, s: AbstractSet[object]) -> bool: ... - def __gt__(self, s: AbstractSet[object]) -> bool: ... - -class enumerate(Iterator[Tuple[int, _T]], Generic[_T]): - def __init__(self, iterable: Iterable[_T], start: int = ...) -> None: ... - def __iter__(self) -> Iterator[Tuple[int, _T]]: ... - if sys.version_info >= (3,): - def __next__(self) -> Tuple[int, _T]: ... - else: - def next(self) -> Tuple[int, _T]: ... - -if sys.version_info >= (3,): - class range(Sequence[int]): - start: int - stop: int - step: int - @overload - def __init__(self, stop: int) -> None: ... - @overload - def __init__(self, start: int, stop: int, step: int = ...) -> None: ... - def count(self, value: int) -> int: ... - def index(self, value: int, start: int = ..., stop: Optional[int] = ...) -> int: ... - def __len__(self) -> int: ... - def __contains__(self, o: object) -> bool: ... - def __iter__(self) -> Iterator[int]: ... - @overload - def __getitem__(self, i: int) -> int: ... - @overload - def __getitem__(self, s: slice) -> range: ... - def __repr__(self) -> str: ... - def __reversed__(self) -> Iterator[int]: ... -else: - class xrange(Sized, Iterable[int], Reversible[int]): - @overload - def __init__(self, stop: int) -> None: ... - @overload - def __init__(self, start: int, stop: int, step: int = ...) -> None: ... - def __len__(self) -> int: ... - def __iter__(self) -> Iterator[int]: ... - def __getitem__(self, i: int) -> int: ... - def __reversed__(self) -> Iterator[int]: ... - -class property(object): - def __init__(self, fget: Optional[Callable[[Any], Any]] = ..., - fset: Optional[Callable[[Any, Any], None]] = ..., - fdel: Optional[Callable[[Any], None]] = ..., - doc: Optional[str] = ...) -> None: ... - def getter(self, fget: Callable[[Any], Any]) -> property: ... - def setter(self, fset: Callable[[Any, Any], None]) -> property: ... - def deleter(self, fdel: Callable[[Any], None]) -> property: ... - def __get__(self, obj: Any, type: Optional[type] = ...) -> Any: ... - def __set__(self, obj: Any, value: Any) -> None: ... - def __delete__(self, obj: Any) -> None: ... - def fget(self) -> Any: ... - def fset(self, value: Any) -> None: ... - def fdel(self) -> None: ... - -if sys.version_info < (3,): - long = int - -NotImplemented: Any - -def abs(__n: SupportsAbs[_T]) -> _T: ... -def all(__i: Iterable[object]) -> bool: ... -def any(__i: Iterable[object]) -> bool: ... -if sys.version_info < (3,): - def apply(__func: Callable[..., _T], __args: Optional[Sequence[Any]] = ..., __kwds: Optional[Mapping[str, Any]] = ...) -> _T: ... -if sys.version_info >= (3,): - def ascii(__o: object) -> str: ... - -def bin(__number: Union[int, _SupportsIndex]) -> str: ... - -if sys.version_info >= (3, 7): - def breakpoint(*args: Any, **kws: Any) -> None: ... -def callable(__o: object) -> bool: ... -def chr(__code: int) -> str: ... -if sys.version_info < (3,): - def cmp(__x: Any, __y: Any) -> int: ... - _N1 = TypeVar('_N1', bool, int, float, complex) - def coerce(__x: _N1, __y: _N1) -> Tuple[_N1, _N1]: ... -if sys.version_info >= (3, 6): - # This class is to be exported as PathLike from os, - # but we define it here as _PathLike to avoid import cycle issues. - # See https://github.com/python/typeshed/pull/991#issuecomment-288160993 - class _PathLike(Generic[AnyStr]): - def __fspath__(self) -> AnyStr: ... - def compile(source: Union[str, bytes, mod, AST], filename: Union[str, bytes, _PathLike[Any]], mode: str, flags: int = ..., dont_inherit: int = ..., optimize: int = ...) -> Any: ... -elif sys.version_info >= (3,): - def compile(source: Union[str, bytes, mod, AST], filename: Union[str, bytes], mode: str, flags: int = ..., dont_inherit: int = ..., optimize: int = ...) -> Any: ... -else: - def compile(source: Union[Text, mod], filename: Text, mode: Text, flags: int = ..., dont_inherit: int = ...) -> Any: ... -if sys.version_info >= (3,): - def copyright() -> None: ... - def credits() -> None: ... -def delattr(__o: Any, __name: Text) -> None: ... -def dir(__o: object = ...) -> List[str]: ... -_N2 = TypeVar('_N2', int, float) -def divmod(__a: _N2, __b: _N2) -> Tuple[_N2, _N2]: ... -def eval(__source: Union[Text, bytes, CodeType], __globals: Optional[Dict[str, Any]] = ..., __locals: Optional[Mapping[str, Any]] = ...) -> Any: ... -if sys.version_info >= (3,): - def exec(__object: Union[str, bytes, CodeType], __globals: Optional[Dict[str, Any]] = ..., __locals: Optional[Mapping[str, Any]] = ...) -> Any: ... -else: - def execfile(__filename: str, __globals: Optional[Dict[str, Any]] = ..., __locals: Optional[Dict[str, Any]] = ...) -> None: ... -def exit(code: object = ...) -> NoReturn: ... -if sys.version_info >= (3,): - @overload - def filter(__function: None, __iterable: Iterable[Optional[_T]]) -> Iterator[_T]: ... - @overload - def filter(__function: Callable[[_T], Any], __iterable: Iterable[_T]) -> Iterator[_T]: ... -else: - @overload - def filter(__function: Callable[[AnyStr], Any], __iterable: AnyStr) -> AnyStr: ... # type: ignore - @overload - def filter(__function: None, __iterable: Tuple[Optional[_T], ...]) -> Tuple[_T, ...]: ... # type: ignore - @overload - def filter(__function: Callable[[_T], Any], __iterable: Tuple[_T, ...]) -> Tuple[_T, ...]: ... # type: ignore - @overload - def filter(__function: None, __iterable: Iterable[Optional[_T]]) -> List[_T]: ... - @overload - def filter(__function: Callable[[_T], Any], __iterable: Iterable[_T]) -> List[_T]: ... -def format(__o: object, __format_spec: str = ...) -> str: ... # TODO unicode -def getattr(__o: Any, name: Text, __default: Any = ...) -> Any: ... -def globals() -> Dict[str, Any]: ... -def hasattr(__o: Any, __name: Text) -> bool: ... -def hash(__o: object) -> int: ... -if sys.version_info >= (3,): - def help(*args: Any, **kwds: Any) -> None: ... -def hex(__i: Union[int, _SupportsIndex]) -> str: ... -def id(__o: object) -> int: ... -if sys.version_info >= (3,): - def input(__prompt: Any = ...) -> str: ... -else: - def input(__prompt: Any = ...) -> Any: ... - def intern(__string: str) -> str: ... -@overload -def iter(__iterable: Iterable[_T]) -> Iterator[_T]: ... -@overload -def iter(__function: Callable[[], Optional[_T]], __sentinel: None) -> Iterator[_T]: ... -@overload -def iter(__function: Callable[[], _T], __sentinel: Any) -> Iterator[_T]: ... -def isinstance(__o: object, __t: Union[type, Tuple[Union[type, Tuple[Any, ...]], ...]]) -> bool: ... -def issubclass(__cls: type, __classinfo: Union[type, Tuple[Union[type, Tuple[Any, ...]], ...]]) -> bool: ... -def len(__o: Sized) -> int: ... -if sys.version_info >= (3,): - def license() -> None: ... -def locals() -> Dict[str, Any]: ... -if sys.version_info >= (3,): - @overload - def map(__func: Callable[[_T1], _S], __iter1: Iterable[_T1]) -> Iterator[_S]: ... - @overload - def map(__func: Callable[[_T1, _T2], _S], __iter1: Iterable[_T1], - __iter2: Iterable[_T2]) -> Iterator[_S]: ... - @overload - def map(__func: Callable[[_T1, _T2, _T3], _S], - __iter1: Iterable[_T1], - __iter2: Iterable[_T2], - __iter3: Iterable[_T3]) -> Iterator[_S]: ... - @overload - def map(__func: Callable[[_T1, _T2, _T3, _T4], _S], - __iter1: Iterable[_T1], - __iter2: Iterable[_T2], - __iter3: Iterable[_T3], - __iter4: Iterable[_T4]) -> Iterator[_S]: ... - @overload - def map(__func: Callable[[_T1, _T2, _T3, _T4, _T5], _S], - __iter1: Iterable[_T1], - __iter2: Iterable[_T2], - __iter3: Iterable[_T3], - __iter4: Iterable[_T4], - __iter5: Iterable[_T5]) -> Iterator[_S]: ... - @overload - def map(__func: Callable[..., _S], - __iter1: Iterable[Any], - __iter2: Iterable[Any], - __iter3: Iterable[Any], - __iter4: Iterable[Any], - __iter5: Iterable[Any], - __iter6: Iterable[Any], - *iterables: Iterable[Any]) -> Iterator[_S]: ... -else: - @overload - def map(__func: None, __iter1: Iterable[_T1]) -> List[_T1]: ... - @overload - def map(__func: None, - __iter1: Iterable[_T1], - __iter2: Iterable[_T2]) -> List[Tuple[_T1, _T2]]: ... - @overload - def map(__func: None, - __iter1: Iterable[_T1], - __iter2: Iterable[_T2], - __iter3: Iterable[_T3]) -> List[Tuple[_T1, _T2, _T3]]: ... - @overload - def map(__func: None, - __iter1: Iterable[_T1], - __iter2: Iterable[_T2], - __iter3: Iterable[_T3], - __iter4: Iterable[_T4]) -> List[Tuple[_T1, _T2, _T3, _T4]]: ... - @overload - def map(__func: None, - __iter1: Iterable[_T1], - __iter2: Iterable[_T2], - __iter3: Iterable[_T3], - __iter4: Iterable[_T4], - __iter5: Iterable[_T5]) -> List[Tuple[_T1, _T2, _T3, _T4, _T5]]: ... - @overload - def map(__func: None, - __iter1: Iterable[Any], - __iter2: Iterable[Any], - __iter3: Iterable[Any], - __iter4: Iterable[Any], - __iter5: Iterable[Any], - __iter6: Iterable[Any], - *iterables: Iterable[Any]) -> List[Tuple[Any, ...]]: ... - @overload - def map(__func: Callable[[_T1], _S], __iter1: Iterable[_T1]) -> List[_S]: ... - @overload - def map(__func: Callable[[_T1, _T2], _S], - __iter1: Iterable[_T1], - __iter2: Iterable[_T2]) -> List[_S]: ... - @overload - def map(__func: Callable[[_T1, _T2, _T3], _S], - __iter1: Iterable[_T1], - __iter2: Iterable[_T2], - __iter3: Iterable[_T3]) -> List[_S]: ... - @overload - def map(__func: Callable[[_T1, _T2, _T3, _T4], _S], - __iter1: Iterable[_T1], - __iter2: Iterable[_T2], - __iter3: Iterable[_T3], - __iter4: Iterable[_T4]) -> List[_S]: ... - @overload - def map(__func: Callable[[_T1, _T2, _T3, _T4, _T5], _S], - __iter1: Iterable[_T1], - __iter2: Iterable[_T2], - __iter3: Iterable[_T3], - __iter4: Iterable[_T4], - __iter5: Iterable[_T5]) -> List[_S]: ... - @overload - def map(__func: Callable[..., _S], - __iter1: Iterable[Any], - __iter2: Iterable[Any], - __iter3: Iterable[Any], - __iter4: Iterable[Any], - __iter5: Iterable[Any], - __iter6: Iterable[Any], - *iterables: Iterable[Any]) -> List[_S]: ... -if sys.version_info >= (3,): - @overload - def max(__arg1: _T, __arg2: _T, *_args: _T, key: Callable[[_T], Any] = ...) -> _T: ... - @overload - def max(__iterable: Iterable[_T], *, key: Callable[[_T], Any] = ...) -> _T: ... - @overload - def max(__iterable: Iterable[_T], *, key: Callable[[_T], Any] = ..., default: _VT) -> Union[_T, _VT]: ... -else: - @overload - def max(__arg1: _T, __arg2: _T, *_args: _T, key: Callable[[_T], Any] = ...) -> _T: ... - @overload - def max(__iterable: Iterable[_T], *, key: Callable[[_T], Any] = ...) -> _T: ... -if sys.version_info >= (3,): - @overload - def min(__arg1: _T, __arg2: _T, *_args: _T, key: Callable[[_T], Any] = ...) -> _T: ... - @overload - def min(__iterable: Iterable[_T], *, key: Callable[[_T], Any] = ...) -> _T: ... - @overload - def min(__iterable: Iterable[_T], *, key: Callable[[_T], Any] = ..., default: _VT) -> Union[_T, _VT]: ... -else: - @overload - def min(__arg1: _T, __arg2: _T, *_args: _T, key: Callable[[_T], Any] = ...) -> _T: ... - @overload - def min(__iterable: Iterable[_T], *, key: Callable[[_T], Any] = ...) -> _T: ... -@overload -def next(__i: Iterator[_T]) -> _T: ... -@overload -def next(__i: Iterator[_T], default: _VT) -> Union[_T, _VT]: ... -def oct(__i: Union[int, _SupportsIndex]) -> str: ... - -if sys.version_info >= (3, 6): - def open(file: Union[str, bytes, int, _PathLike[Any]], mode: str = ..., buffering: int = ..., encoding: Optional[str] = ..., - errors: Optional[str] = ..., newline: Optional[str] = ..., closefd: bool = ..., - opener: Optional[Callable[[str, int], int]] = ...) -> IO[Any]: ... -elif sys.version_info >= (3,): - def open(file: Union[str, bytes, int], mode: str = ..., buffering: int = ..., encoding: Optional[str] = ..., - errors: Optional[str] = ..., newline: Optional[str] = ..., closefd: bool = ..., - opener: Optional[Callable[[str, int], int]] = ...) -> IO[Any]: ... -else: - def open(name: Union[unicode, int], mode: unicode = ..., buffering: int = ...) -> BinaryIO: ... - -def ord(__c: Union[Text, bytes]) -> int: ... -if sys.version_info >= (3,): - class _Writer(Protocol): - def write(self, __s: str) -> Any: ... - def print( - *values: object, sep: Optional[Text] = ..., end: Optional[Text] = ..., file: Optional[_Writer] = ..., flush: bool = ... - ) -> None: ... - -else: - class _Writer(Protocol): - def write(self, __s: Any) -> Any: ... - # This is only available after from __future__ import print_function. - def print(*values: object, sep: Optional[Text] = ..., end: Optional[Text] = ..., file: Optional[_Writer] = ...) -> None: ... - -@overload -def pow(__x: int, __y: int) -> Any: ... # The return type can be int or float, depending on y -@overload -def pow(__x: int, __y: int, __z: int) -> Any: ... -@overload -def pow(__x: float, __y: float) -> float: ... -@overload -def pow(__x: float, __y: float, __z: float) -> float: ... -def quit(code: object = ...) -> NoReturn: ... -if sys.version_info < (3,): - def range(__x: int, __y: int = ..., __step: int = ...) -> List[int]: ... - def raw_input(__prompt: Any = ...) -> str: ... - @overload - def reduce(__function: Callable[[_T, _S], _T], __iterable: Iterable[_S], __initializer: _T) -> _T: ... - @overload - def reduce(__function: Callable[[_T, _T], _T], __iterable: Iterable[_T]) -> _T: ... - def reload(__module: Any) -> Any: ... -@overload -def reversed(__object: Sequence[_T]) -> Iterator[_T]: ... -@overload -def reversed(__object: Reversible[_T]) -> Iterator[_T]: ... -def repr(__o: object) -> str: ... -if sys.version_info >= (3,): - @overload - def round(number: float) -> int: ... - @overload - def round(number: float, ndigits: None) -> int: ... - @overload - def round(number: float, ndigits: int) -> float: ... - @overload - def round(number: SupportsRound[_T]) -> int: ... - @overload - def round(number: SupportsRound[_T], ndigits: None) -> int: ... - @overload - def round(number: SupportsRound[_T], ndigits: int) -> _T: ... -else: - @overload - def round(number: float) -> float: ... - @overload - def round(number: float, ndigits: int) -> float: ... - @overload - def round(number: SupportsFloat) -> float: ... - @overload - def round(number: SupportsFloat, ndigits: int) -> float: ... -def setattr(__object: Any, __name: Text, __value: Any) -> None: ... -if sys.version_info >= (3,): - def sorted(__iterable: Iterable[_T], *, - key: Optional[Callable[[_T], Any]] = ..., - reverse: bool = ...) -> List[_T]: ... -else: - def sorted(__iterable: Iterable[_T], *, - cmp: Callable[[_T, _T], int] = ..., - key: Optional[Callable[[_T], Any]] = ..., - reverse: bool = ...) -> List[_T]: ... -@overload -def sum(__iterable: Iterable[_T]) -> Union[_T, int]: ... -@overload -def sum(__iterable: Iterable[_T], __start: _S) -> Union[_T, _S]: ... -if sys.version_info < (3,): - def unichr(__i: int) -> unicode: ... -def vars(__object: Any = ...) -> Dict[str, Any]: ... -if sys.version_info >= (3,): - @overload - def zip(__iter1: Iterable[_T1]) -> Iterator[Tuple[_T1]]: ... - @overload - def zip(__iter1: Iterable[_T1], __iter2: Iterable[_T2]) -> Iterator[Tuple[_T1, _T2]]: ... - @overload - def zip(__iter1: Iterable[_T1], __iter2: Iterable[_T2], - __iter3: Iterable[_T3]) -> Iterator[Tuple[_T1, _T2, _T3]]: ... - @overload - def zip(__iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3], - __iter4: Iterable[_T4]) -> Iterator[Tuple[_T1, _T2, _T3, _T4]]: ... - @overload - def zip(__iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3], - __iter4: Iterable[_T4], __iter5: Iterable[_T5]) -> Iterator[Tuple[_T1, _T2, _T3, _T4, _T5]]: ... - @overload - def zip(__iter1: Iterable[Any], __iter2: Iterable[Any], __iter3: Iterable[Any], - __iter4: Iterable[Any], __iter5: Iterable[Any], __iter6: Iterable[Any], - *iterables: Iterable[Any]) -> Iterator[Tuple[Any, ...]]: ... -else: - @overload - def zip(__iter1: Iterable[_T1]) -> List[Tuple[_T1]]: ... - @overload - def zip(__iter1: Iterable[_T1], - __iter2: Iterable[_T2]) -> List[Tuple[_T1, _T2]]: ... - @overload - def zip(__iter1: Iterable[_T1], __iter2: Iterable[_T2], - __iter3: Iterable[_T3]) -> List[Tuple[_T1, _T2, _T3]]: ... - @overload - def zip(__iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3], - __iter4: Iterable[_T4]) -> List[Tuple[_T1, _T2, _T3, _T4]]: ... - @overload - def zip(__iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3], - __iter4: Iterable[_T4], __iter5: Iterable[_T5]) -> List[Tuple[_T1, _T2, _T3, _T4, _T5]]: ... - @overload - def zip(__iter1: Iterable[Any], __iter2: Iterable[Any], __iter3: Iterable[Any], - __iter4: Iterable[Any], __iter5: Iterable[Any], __iter6: Iterable[Any], - *iterables: Iterable[Any]) -> List[Tuple[Any, ...]]: ... -def __import__(name: Text, globals: Optional[Mapping[str, Any]] = ..., - locals: Optional[Mapping[str, Any]] = ..., - fromlist: Sequence[str] = ..., - level: int = ...) -> Any: ... - -# Actually the type of Ellipsis is , but since it's -# not exposed anywhere under that name, we make it private here. -class ellipsis: ... -Ellipsis: ellipsis - -if sys.version_info < (3,): - # TODO: buffer support is incomplete; e.g. some_string.startswith(some_buffer) doesn't type check. - _AnyBuffer = TypeVar('_AnyBuffer', str, unicode, bytearray, buffer) - - class buffer(Sized): - def __init__(self, object: _AnyBuffer, offset: int = ..., size: int = ...) -> None: ... - def __add__(self, other: _AnyBuffer) -> str: ... - def __cmp__(self, other: _AnyBuffer) -> bool: ... - def __getitem__(self, key: Union[int, slice]) -> str: ... - def __getslice__(self, i: int, j: int) -> str: ... - def __len__(self) -> int: ... - def __mul__(self, x: int) -> str: ... - -class BaseException(object): - args: Tuple[Any, ...] - if sys.version_info < (3,): - message: Any - if sys.version_info >= (3,): - __cause__: Optional[BaseException] - __context__: Optional[BaseException] - __suppress_context__: bool - __traceback__: Optional[TracebackType] - def __init__(self, *args: object) -> None: ... - def __str__(self) -> str: ... - def __repr__(self) -> str: ... - if sys.version_info < (3,): - def __getitem__(self, i: int) -> Any: ... - def __getslice__(self, start: int, stop: int) -> Tuple[Any, ...]: ... - if sys.version_info >= (3,): - def with_traceback(self, tb: Optional[TracebackType]) -> BaseException: ... - -class GeneratorExit(BaseException): ... -class KeyboardInterrupt(BaseException): ... -class SystemExit(BaseException): - code: int -class Exception(BaseException): ... -class StopIteration(Exception): - if sys.version_info >= (3,): - value: Any -if sys.version_info >= (3,): - _StandardError = Exception - class OSError(Exception): - errno: int - strerror: str - # filename, filename2 are actually Union[str, bytes, None] - filename: Any - filename2: Any - EnvironmentError = OSError - IOError = OSError -else: - class StandardError(Exception): ... - _StandardError = StandardError - class EnvironmentError(StandardError): - errno: int - strerror: str - # TODO can this be unicode? - filename: str - class OSError(EnvironmentError): ... - class IOError(EnvironmentError): ... - -class ArithmeticError(_StandardError): ... -class AssertionError(_StandardError): ... -class AttributeError(_StandardError): ... -class BufferError(_StandardError): ... -class EOFError(_StandardError): ... -class ImportError(_StandardError): - if sys.version_info >= (3, 3): - def __init__(self, *args, name: Optional[str] = ..., path: Optional[str] = ...) -> None: ... - name: Optional[str] - path: Optional[str] -class LookupError(_StandardError): ... -class MemoryError(_StandardError): ... -class NameError(_StandardError): ... -class ReferenceError(_StandardError): ... -class RuntimeError(_StandardError): ... -if sys.version_info >= (3, 5): - class StopAsyncIteration(Exception): - value: Any -class SyntaxError(_StandardError): - msg: str - lineno: int - offset: Optional[int] - text: Optional[str] - filename: str -class SystemError(_StandardError): ... -class TypeError(_StandardError): ... -class ValueError(_StandardError): ... - -class FloatingPointError(ArithmeticError): ... -class OverflowError(ArithmeticError): ... -class ZeroDivisionError(ArithmeticError): ... - -if sys.version_info >= (3, 6): - class ModuleNotFoundError(ImportError): ... - -class IndexError(LookupError): ... -class KeyError(LookupError): ... - -class UnboundLocalError(NameError): ... - -class WindowsError(OSError): - winerror: int -if sys.version_info >= (3,): - class BlockingIOError(OSError): - characters_written: int - class ChildProcessError(OSError): ... - class ConnectionError(OSError): ... - class BrokenPipeError(ConnectionError): ... - class ConnectionAbortedError(ConnectionError): ... - class ConnectionRefusedError(ConnectionError): ... - class ConnectionResetError(ConnectionError): ... - class FileExistsError(OSError): ... - class FileNotFoundError(OSError): ... - class InterruptedError(OSError): ... - class IsADirectoryError(OSError): ... - class NotADirectoryError(OSError): ... - class PermissionError(OSError): ... - class ProcessLookupError(OSError): ... - class TimeoutError(OSError): ... - -class NotImplementedError(RuntimeError): ... -if sys.version_info >= (3, 5): - class RecursionError(RuntimeError): ... - -class IndentationError(SyntaxError): ... -class TabError(IndentationError): ... - -class UnicodeError(ValueError): ... -class UnicodeDecodeError(UnicodeError): - encoding: str - object: bytes - start: int - end: int - reason: str - def __init__(self, __encoding: str, __object: bytes, __start: int, __end: int, - __reason: str) -> None: ... -class UnicodeEncodeError(UnicodeError): - encoding: str - object: Text - start: int - end: int - reason: str - def __init__(self, __encoding: str, __object: Text, __start: int, __end: int, - __reason: str) -> None: ... -class UnicodeTranslateError(UnicodeError): ... - -class Warning(Exception): ... -class UserWarning(Warning): ... -class DeprecationWarning(Warning): ... -class SyntaxWarning(Warning): ... -class RuntimeWarning(Warning): ... -class FutureWarning(Warning): ... -class PendingDeprecationWarning(Warning): ... -class ImportWarning(Warning): ... -class UnicodeWarning(Warning): ... -class BytesWarning(Warning): ... -if sys.version_info >= (3, 2): - class ResourceWarning(Warning): ... - -if sys.version_info < (3,): - class file(BinaryIO): - @overload - def __init__(self, file: str, mode: str = ..., buffering: int = ...) -> None: ... - @overload - def __init__(self, file: unicode, mode: str = ..., buffering: int = ...) -> None: ... - @overload - def __init__(self, file: int, mode: str = ..., buffering: int = ...) -> None: ... - def __iter__(self) -> Iterator[str]: ... - def next(self) -> str: ... - def read(self, n: int = ...) -> str: ... - def __enter__(self) -> BinaryIO: ... - def __exit__(self, t: Optional[type] = ..., exc: Optional[BaseException] = ..., tb: Optional[Any] = ...) -> Optional[bool]: ... - def flush(self) -> None: ... - def fileno(self) -> int: ... - def isatty(self) -> bool: ... - def close(self) -> None: ... - - def readable(self) -> bool: ... - def writable(self) -> bool: ... - def seekable(self) -> bool: ... - def seek(self, offset: int, whence: int = ...) -> int: ... - def tell(self) -> int: ... - def readline(self, limit: int = ...) -> str: ... - def readlines(self, hint: int = ...) -> List[str]: ... - def write(self, data: str) -> int: ... - def writelines(self, data: Iterable[str]) -> None: ... - def truncate(self, pos: Optional[int] = ...) -> int: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/bz2.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/bz2.pyi old mode 100755 new mode 100644 index 2cb329ce..b67d00cc --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/bz2.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/bz2.pyi @@ -1,32 +1,54 @@ import io import sys -from typing import Any, IO, Optional, Union +from _typeshed import AnyPath +from typing import IO, Any, Optional, TextIO, TypeVar, Union, overload +from typing_extensions import Literal -if sys.version_info >= (3, 6): - from os import PathLike - _PathOrFile = Union[str, bytes, IO[Any], PathLike[Any]] -elif sys.version_info >= (3, 3): - _PathOrFile = Union[str, bytes, IO[Any]] -else: - _PathOrFile = str +_PathOrFile = Union[AnyPath, IO[bytes]] +_T = TypeVar("_T") def compress(data: bytes, compresslevel: int = ...) -> bytes: ... def decompress(data: bytes) -> bytes: ... if sys.version_info >= (3, 3): - def open(filename: _PathOrFile, - mode: str = ..., - compresslevel: int = ..., - encoding: Optional[str] = ..., - errors: Optional[str] = ..., - newline: Optional[str] = ...) -> IO[Any]: ... + _OpenBinaryMode = Literal["r", "rb", "w", "wb", "x", "xb", "a", "ab"] + _OpenTextMode = Literal["rt", "wt", "xt", "at"] + @overload + def open( + filename: _PathOrFile, + mode: _OpenBinaryMode = ..., + compresslevel: int = ..., + encoding: None = ..., + errors: None = ..., + newline: None = ..., + ) -> BZ2File: ... + @overload + def open( + filename: AnyPath, + mode: _OpenTextMode, + compresslevel: int = ..., + encoding: Optional[str] = ..., + errors: Optional[str] = ..., + newline: Optional[str] = ..., + ) -> TextIO: ... + @overload + def open( + filename: _PathOrFile, + mode: str, + compresslevel: int = ..., + encoding: Optional[str] = ..., + errors: Optional[str] = ..., + newline: Optional[str] = ..., + ) -> Union[BZ2File, TextIO]: ... -class BZ2File(io.BufferedIOBase, IO[bytes]): # type: ignore # python/mypy#5027 - def __init__(self, - filename: _PathOrFile, - mode: str = ..., - buffering: Optional[Any] = ..., - compresslevel: int = ...) -> None: ... +class BZ2File(io.BufferedIOBase, IO[bytes]): + def __enter__(self: _T) -> _T: ... + if sys.version_info >= (3, 9): + def __init__(self, filename: _PathOrFile, mode: str = ..., *, compresslevel: int = ...) -> None: ... + else: + def __init__( + self, filename: _PathOrFile, mode: str = ..., buffering: Optional[Any] = ..., compresslevel: int = ... + ) -> None: ... class BZ2Compressor(object): def __init__(self, compresslevel: int = ...) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/cProfile.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/cProfile.pyi old mode 100755 new mode 100644 index c6a11721..e5399bea --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/cProfile.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/cProfile.pyi @@ -1,27 +1,28 @@ -import os import sys -from typing import Any, Callable, Dict, Optional, Text, TypeVar, Union +from _typeshed import AnyPath +from typing import Any, Callable, Dict, Optional, TypeVar, Union def run(statement: str, filename: Optional[str] = ..., sort: Union[str, int] = ...) -> None: ... -def runctx(statement: str, globals: Dict[str, Any], locals: Dict[str, Any], filename: Optional[str] = ..., sort: Union[str, int] = ...) -> None: ... +def runctx( + statement: str, globals: Dict[str, Any], locals: Dict[str, Any], filename: Optional[str] = ..., sort: Union[str, int] = ... +) -> None: ... -_SelfT = TypeVar('_SelfT', bound=Profile) -_T = TypeVar('_T') -if sys.version_info >= (3, 6): - _Path = Union[bytes, Text, os.PathLike[Any]] -else: - _Path = Union[bytes, Text] +_SelfT = TypeVar("_SelfT", bound=Profile) +_T = TypeVar("_T") class Profile: - def __init__(self, custom_timer: Callable[[], float] = ..., time_unit: float = ..., subcalls: bool = ..., builtins: bool = ...) -> None: ... + def __init__( + self, timer: Callable[[], float] = ..., timeunit: float = ..., subcalls: bool = ..., builtins: bool = ... + ) -> None: ... def enable(self) -> None: ... def disable(self) -> None: ... def print_stats(self, sort: Union[str, int] = ...) -> None: ... - def dump_stats(self, file: _Path) -> None: ... + def dump_stats(self, file: AnyPath) -> None: ... def create_stats(self) -> None: ... + def snapshot_stats(self) -> None: ... def run(self: _SelfT, cmd: str) -> _SelfT: ... def runctx(self: _SelfT, cmd: str, globals: Dict[str, Any], locals: Dict[str, Any]) -> _SelfT: ... - def runcall(self, func: Callable[..., _T], *args: Any, **kw: Any) -> _T: ... + def runcall(self, __func: Callable[..., _T], *args: Any, **kw: Any) -> _T: ... if sys.version_info >= (3, 8): def __enter__(self: _SelfT) -> _SelfT: ... def __exit__(self, *exc_info: Any) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/calendar.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/calendar.pyi old mode 100755 new mode 100644 index 4b452cc3..af2aa83e --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/calendar.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/calendar.pyi @@ -3,7 +3,6 @@ import sys from time import struct_time from typing import Any, Iterable, List, Optional, Sequence, Tuple, Union - _LocaleType = Tuple[Optional[str], Optional[str]] class IllegalMonthError(ValueError): @@ -82,6 +81,7 @@ if sys.version_info < (3, 0): def __init__(self, locale: _LocaleType) -> None: ... def __enter__(self) -> _LocaleType: ... def __exit__(self, *args: Any) -> None: ... + else: class different_locale: def __init__(self, locale: _LocaleType) -> None: ... @@ -99,6 +99,7 @@ class LocaleHTMLCalendar(HTMLCalendar): def formatmonthname(self, theyear: int, themonth: int, withyear: bool = ...) -> str: ... c: TextCalendar + def setfirstweekday(firstweekday: int) -> None: ... def format(cols: int, colwidth: int = ..., spacing: int = ...) -> str: ... def formatstring(cols: int, colwidth: int = ..., spacing: int = ...) -> str: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/cgi.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/cgi.pyi old mode 100755 new mode 100644 index 5d901d93..c868d652 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/cgi.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/cgi.pyi @@ -1,27 +1,45 @@ import sys -from typing import Any, AnyStr, Dict, IO, Iterable, List, Mapping, Optional, Tuple, TypeVar, Union +from _typeshed import SupportsGetItem, SupportsItemAccess +from builtins import type as _type +from typing import IO, Any, AnyStr, Dict, Iterable, Iterator, List, Mapping, Optional, Protocol, Tuple, TypeVar, Union -_T = TypeVar('_T', bound=FieldStorage) +_T = TypeVar("_T", bound=FieldStorage) + +def parse( + fp: Optional[IO[Any]] = ..., + environ: SupportsItemAccess[str, str] = ..., + keep_blank_values: bool = ..., + strict_parsing: bool = ..., +) -> Dict[str, List[str]]: ... -def parse(fp: IO[Any] = ..., environ: Mapping[str, str] = ..., - keep_blank_values: bool = ..., strict_parsing: bool = ...) -> Dict[str, List[str]]: ... if sys.version_info < (3, 8): def parse_qs(qs: str, keep_blank_values: bool = ..., strict_parsing: bool = ...) -> Dict[str, List[str]]: ... - def parse_qsl(qs: str, keep_blank_values: bool = ..., strict_parsing: bool = ...) -> Dict[str, List[str]]: ... + def parse_qsl(qs: str, keep_blank_values: bool = ..., strict_parsing: bool = ...) -> List[Tuple[str, str]]: ... + if sys.version_info >= (3, 7): - def parse_multipart(fp: IO[Any], pdict: Mapping[str, bytes], encoding: str = ..., errors: str = ...) -> Dict[str, List[Any]]: ... + def parse_multipart( + fp: IO[Any], pdict: SupportsGetItem[str, bytes], encoding: str = ..., errors: str = ... + ) -> Dict[str, List[Any]]: ... + else: - def parse_multipart(fp: IO[Any], pdict: Mapping[str, bytes]) -> Dict[str, List[bytes]]: ... -def parse_header(s: str) -> Tuple[str, Dict[str, str]]: ... -def test(environ: Mapping[str, str] = ...) -> None: ... -def print_environ(environ: Mapping[str, str] = ...) -> None: ... + def parse_multipart(fp: IO[Any], pdict: SupportsGetItem[str, bytes]) -> Dict[str, List[bytes]]: ... + +class _Environ(Protocol): + def __getitem__(self, __k: str) -> str: ... + def keys(self) -> Iterable[str]: ... + +def parse_header(line: str) -> Tuple[str, Dict[str, str]]: ... +def test(environ: _Environ = ...) -> None: ... +def print_environ(environ: _Environ = ...) -> None: ... def print_form(form: Dict[str, Any]) -> None: ... def print_directory() -> None: ... def print_environ_usage() -> None: ... + if sys.version_info < (3,): def escape(s: AnyStr, quote: bool = ...) -> AnyStr: ... + elif sys.version_info < (3, 8): - def escape(s: str, quote: bool = ...) -> str: ... + def escape(s: str, quote: Optional[bool] = ...) -> str: ... class MiniFieldStorage: # The first five "Any" attributes here are always None, but mypy doesn't support that @@ -35,13 +53,11 @@ class MiniFieldStorage: headers: Dict[Any, Any] name: Any value: Any - def __init__(self, name: Any, value: Any) -> None: ... def __repr__(self) -> str: ... - class FieldStorage(object): - FieldStorageClass: Optional[type] + FieldStorageClass: Optional[_type] keep_blank_values: int strict_parsing: int qs_on_post: Optional[str] @@ -64,19 +80,48 @@ class FieldStorage(object): list: Optional[List[Any]] value: Union[None, bytes, List[Any]] - if sys.version_info >= (3, 0): - def __init__(self, fp: IO[Any] = ..., headers: Mapping[str, str] = ..., outerboundary: bytes = ..., - environ: Mapping[str, str] = ..., keep_blank_values: int = ..., strict_parsing: int = ..., - limit: int = ..., encoding: str = ..., errors: str = ...) -> None: ... + if sys.version_info >= (3, 6): + def __init__( + self, + fp: Optional[IO[Any]] = ..., + headers: Optional[Mapping[str, str]] = ..., + outerboundary: bytes = ..., + environ: SupportsGetItem[str, str] = ..., + keep_blank_values: int = ..., + strict_parsing: int = ..., + limit: Optional[int] = ..., + encoding: str = ..., + errors: str = ..., + max_num_fields: Optional[int] = ..., + ) -> None: ... + elif sys.version_info >= (3, 0): + def __init__( + self, + fp: Optional[IO[Any]] = ..., + headers: Optional[Mapping[str, str]] = ..., + outerboundary: bytes = ..., + environ: SupportsGetItem[str, str] = ..., + keep_blank_values: int = ..., + strict_parsing: int = ..., + limit: Optional[int] = ..., + encoding: str = ..., + errors: str = ..., + ) -> None: ... else: - def __init__(self, fp: IO[Any] = ..., headers: Mapping[str, str] = ..., outerboundary: bytes = ..., - environ: Mapping[str, str] = ..., keep_blank_values: int = ..., strict_parsing: int = ...) -> None: ... - + def __init__( + self, + fp: IO[Any] = ..., + headers: Mapping[str, str] = ..., + outerboundary: bytes = ..., + environ: SupportsGetItem[str, str] = ..., + keep_blank_values: int = ..., + strict_parsing: int = ..., + ) -> None: ... if sys.version_info >= (3, 0): def __enter__(self: _T) -> _T: ... def __exit__(self, *args: Any) -> None: ... def __repr__(self) -> str: ... - def __iter__(self) -> Iterable[str]: ... + def __iter__(self) -> Iterator[str]: ... def __getitem__(self, key: str) -> Any: ... def getvalue(self, key: str, default: Any = ...) -> Any: ... def getfirst(self, key: str, default: Any = ...) -> Any: ... @@ -97,19 +142,14 @@ class FieldStorage(object): # In Python 2 it always returns bytes and ignores the "binary" flag def make_file(self, binary: Any = ...) -> IO[bytes]: ... - if sys.version_info < (3, 0): from UserDict import UserDict - class FormContentDict(UserDict[str, List[str]]): query_string: str def __init__(self, environ: Mapping[str, str] = ..., keep_blank_values: int = ..., strict_parsing: int = ...) -> None: ... - class SvFormContentDict(FormContentDict): def getlist(self, key: Any) -> Any: ... - class InterpFormContentDict(SvFormContentDict): ... - class FormContent(FormContentDict): # TODO this should have # def values(self, key: Any) -> Any: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/cgitb.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/cgitb.pyi old mode 100755 new mode 100644 index ded055cb..7603ecd9 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/cgitb.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/cgitb.pyi @@ -1,33 +1,33 @@ - -from typing import Dict, Any, List, Tuple, Optional, Callable, Type, Union, IO, AnyStr, TypeVar +from _typeshed import AnyPath from types import FrameType, TracebackType -import sys - +from typing import IO, Any, Callable, Dict, List, Optional, Tuple, Type -_T = TypeVar("_T") _ExcInfo = Tuple[Optional[Type[BaseException]], Optional[BaseException], Optional[TracebackType]] -if sys.version_info >= (3, 6): - from os import PathLike - _Path = Union[_T, PathLike[_T]] -else: - _Path = Union[_T] - def reset() -> str: ... # undocumented def small(text: str) -> str: ... # undocumented def strong(text: str) -> str: ... # undocumented def grey(text: str) -> str: ... # undocumented def lookup(name: str, frame: FrameType, locals: Dict[str, Any]) -> Tuple[Optional[str], Any]: ... # undocumented -def scanvars(reader: Callable[[], bytes], frame: FrameType, locals: Dict[str, Any]) -> List[Tuple[str, Optional[str], Any]]: ... # undocumented +def scanvars( + reader: Callable[[], bytes], frame: FrameType, locals: Dict[str, Any] +) -> List[Tuple[str, Optional[str], Any]]: ... # undocumented def html(einfo: _ExcInfo, context: int = ...) -> str: ... def text(einfo: _ExcInfo, context: int = ...) -> str: ... class Hook: # undocumented - - def __init__(self, display: int = ..., logdir: Optional[_Path[AnyStr]] = ..., context: int = ..., file: Optional[IO[str]] = ..., format: str = ...) -> None: ... - def __call__(self, etype: Optional[Type[BaseException]], evalue: Optional[BaseException], etb: Optional[TracebackType]) -> None: ... + def __init__( + self, + display: int = ..., + logdir: Optional[AnyPath] = ..., + context: int = ..., + file: Optional[IO[str]] = ..., + format: str = ..., + ) -> None: ... + def __call__( + self, etype: Optional[Type[BaseException]], evalue: Optional[BaseException], etb: Optional[TracebackType] + ) -> None: ... def handle(self, info: Optional[_ExcInfo] = ...) -> None: ... def handler(info: Optional[_ExcInfo] = ...) -> None: ... - -def enable(display: int = ..., logdir: Optional[_Path[AnyStr]] = ..., context: int = ..., format: str = ...) -> None: ... +def enable(display: int = ..., logdir: Optional[AnyPath] = ..., context: int = ..., format: str = ...) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/chunk.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/chunk.pyi old mode 100755 new mode 100644 index 2337f00c..50ff267c --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/chunk.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/chunk.pyi @@ -1,6 +1,3 @@ -# Source(py2): https://hg.python.org/cpython/file/2.7/Lib/chunk.py -# Source(py3): https://github.com/python/cpython/blob/master/Lib/chunk.py - from typing import IO class Chunk: diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/cmath.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/cmath.pyi old mode 100755 new mode 100644 index 4b15f0b7..bb9e302e --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/cmath.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/cmath.pyi @@ -1,5 +1,3 @@ -"""Stub file for the 'cmath' module.""" - import sys from typing import SupportsComplex, SupportsFloat, Tuple, Union @@ -14,29 +12,31 @@ if sys.version_info >= (3, 6): _C = Union[SupportsFloat, SupportsComplex] -def acos(x: _C) -> complex: ... -def acosh(x: _C) -> complex: ... -def asin(x: _C) -> complex: ... -def asinh(x: _C) -> complex: ... -def atan(x: _C) -> complex: ... -def atanh(x: _C) -> complex: ... -def cos(x: _C) -> complex: ... -def cosh(x: _C) -> complex: ... -def exp(x: _C) -> complex: ... +def acos(__z: _C) -> complex: ... +def acosh(__z: _C) -> complex: ... +def asin(__z: _C) -> complex: ... +def asinh(__z: _C) -> complex: ... +def atan(__z: _C) -> complex: ... +def atanh(__z: _C) -> complex: ... +def cos(__z: _C) -> complex: ... +def cosh(__z: _C) -> complex: ... +def exp(__z: _C) -> complex: ... + if sys.version_info >= (3, 5): def isclose(a: _C, b: _C, *, rel_tol: SupportsFloat = ..., abs_tol: SupportsFloat = ...) -> bool: ... -def isinf(z: _C) -> bool: ... -def isnan(z: _C) -> bool: ... -def log(x: _C, base: _C = ...) -> complex: ... -def log10(x: _C) -> complex: ... -def phase(z: _C) -> float: ... -def polar(z: _C) -> Tuple[float, float]: ... -def rect(r: float, phi: float) -> complex: ... -def sin(x: _C) -> complex: ... -def sinh(x: _C) -> complex: ... -def sqrt(x: _C) -> complex: ... -def tan(x: _C) -> complex: ... -def tanh(x: _C) -> complex: ... + +def isinf(__z: _C) -> bool: ... +def isnan(__z: _C) -> bool: ... +def log(__x: _C, __y_obj: _C = ...) -> complex: ... +def log10(__z: _C) -> complex: ... +def phase(__z: _C) -> float: ... +def polar(__z: _C) -> Tuple[float, float]: ... +def rect(__r: float, __phi: float) -> complex: ... +def sin(__z: _C) -> complex: ... +def sinh(__z: _C) -> complex: ... +def sqrt(__z: _C) -> complex: ... +def tan(__z: _C) -> complex: ... +def tanh(__z: _C) -> complex: ... if sys.version_info >= (3,): - def isfinite(z: _C) -> bool: ... + def isfinite(__z: _C) -> bool: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/cmd.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/cmd.pyi old mode 100755 new mode 100644 index c2aeb75b..0b7a7f70 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/cmd.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/cmd.pyi @@ -1,6 +1,4 @@ -# Stubs for cmd (Python 2/3) - -from typing import Any, Optional, Text, IO, List, Callable, Tuple +from typing import IO, Any, Callable, List, Optional, Tuple class Cmd: prompt: str @@ -36,6 +34,6 @@ class Cmd: def get_names(self) -> List[str]: ... # Only the first element of args matters. def complete_help(self, *args: Any) -> List[str]: ... - def do_help(self, arg: Optional[str]) -> None: ... + def do_help(self, arg: str) -> Optional[bool]: ... def print_topics(self, header: str, cmds: Optional[List[str]], cmdlen: Any, maxcol: int) -> None: ... def columnize(self, list: Optional[List[str]], displaywidth: int = ...) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/code.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/code.pyi old mode 100755 new mode 100644 index 293ab9b9..16c2b129 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/code.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/code.pyi @@ -1,24 +1,19 @@ -# Stubs for code - import sys -from typing import Any, Callable, Mapping, Optional from types import CodeType +from typing import Any, Callable, Mapping, Optional class InteractiveInterpreter: def __init__(self, locals: Optional[Mapping[str, Any]] = ...) -> None: ... - def runsource(self, source: str, filename: str = ..., - symbol: str = ...) -> bool: ... + def runsource(self, source: str, filename: str = ..., symbol: str = ...) -> bool: ... def runcode(self, code: CodeType) -> None: ... def showsyntaxerror(self, filename: Optional[str] = ...) -> None: ... def showtraceback(self) -> None: ... def write(self, data: str) -> None: ... class InteractiveConsole(InteractiveInterpreter): - def __init__(self, locals: Optional[Mapping[str, Any]] = ..., - filename: str = ...) -> None: ... + def __init__(self, locals: Optional[Mapping[str, Any]] = ..., filename: str = ...) -> None: ... if sys.version_info >= (3, 6): - def interact(self, banner: Optional[str] = ..., - exitmsg: Optional[str] = ...) -> None: ... + def interact(self, banner: Optional[str] = ..., exitmsg: Optional[str] = ...) -> None: ... else: def interact(self, banner: Optional[str] = ...) -> None: ... def push(self, line: str) -> bool: ... @@ -26,13 +21,16 @@ class InteractiveConsole(InteractiveInterpreter): def raw_input(self, prompt: str = ...) -> str: ... if sys.version_info >= (3, 6): - def interact(banner: Optional[str] = ..., - readfunc: Optional[Callable[[str], str]] = ..., - local: Optional[Mapping[str, Any]] = ..., - exitmsg: Optional[str] = ...) -> None: ... + def interact( + banner: Optional[str] = ..., + readfunc: Optional[Callable[[str], str]] = ..., + local: Optional[Mapping[str, Any]] = ..., + exitmsg: Optional[str] = ..., + ) -> None: ... + else: - def interact(banner: Optional[str] = ..., - readfunc: Optional[Callable[[str], str]] = ..., - local: Optional[Mapping[str, Any]] = ...) -> None: ... -def compile_command(source: str, filename: str = ..., - symbol: str = ...) -> Optional[CodeType]: ... + def interact( + banner: Optional[str] = ..., readfunc: Optional[Callable[[str], str]] = ..., local: Optional[Mapping[str, Any]] = ... + ) -> None: ... + +def compile_command(source: str, filename: str = ..., symbol: str = ...) -> Optional[CodeType]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/codecs.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/codecs.pyi old mode 100755 new mode 100644 index 7c06ee93..1a596b95 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/codecs.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/codecs.pyi @@ -1,8 +1,26 @@ import sys -from typing import Any, BinaryIO, Callable, Generator, IO, Iterable, Iterator, List, Optional, Protocol, Text, TextIO, Tuple, Type, TypeVar, Union - -from abc import abstractmethod import types +from abc import abstractmethod +from typing import ( + IO, + Any, + BinaryIO, + Callable, + Generator, + Iterable, + Iterator, + List, + Optional, + Protocol, + Text, + TextIO, + Tuple, + Type, + TypeVar, + Union, + overload, +) +from typing_extensions import Literal # TODO: this only satisfies the most common interface, where # bytes (py2 str) is the raw form and str (py2 unicode) is the cooked form. @@ -15,22 +33,55 @@ _Encoded = bytes class _Encoder(Protocol): def __call__(self, input: _Decoded, errors: str = ...) -> Tuple[_Encoded, int]: ... # signature of Codec().encode + class _Decoder(Protocol): def __call__(self, input: _Encoded, errors: str = ...) -> Tuple[_Decoded, int]: ... # signature of Codec().decode class _StreamReader(Protocol): def __call__(self, stream: IO[_Encoded], errors: str = ...) -> StreamReader: ... + class _StreamWriter(Protocol): def __call__(self, stream: IO[_Encoded], errors: str = ...) -> StreamWriter: ... class _IncrementalEncoder(Protocol): def __call__(self, errors: str = ...) -> IncrementalEncoder: ... + class _IncrementalDecoder(Protocol): def __call__(self, errors: str = ...) -> IncrementalDecoder: ... +# The type ignore on `encode` and `decode` is to avoid issues with overlapping overloads, for more details, see #300 +# mypy and pytype disagree about where the type ignore can and cannot go, so alias the long type +_BytesToBytesEncodingT = Literal[ + "base64", + "base_64", + "base64_codec", + "bz2", + "bz2_codec", + "hex", + "hex_codec", + "quopri", + "quotedprintable", + "quoted_printable", + "quopri_codec", + "uu", + "uu_codec", + "zip", + "zlib", + "zlib_codec", +] +@overload +def encode(obj: bytes, encoding: _BytesToBytesEncodingT, errors: str = ...) -> bytes: ... +@overload +def encode(obj: str, encoding: Literal["rot13", "rot_13"] = ..., errors: str = ...) -> str: ... # type: ignore +@overload def encode(obj: _Decoded, encoding: str = ..., errors: str = ...) -> _Encoded: ... +@overload +def decode(obj: bytes, encoding: _BytesToBytesEncodingT, errors: str = ...) -> bytes: ... # type: ignore +@overload +def decode(obj: str, encoding: Literal["rot13", "rot_13"] = ..., errors: str = ...) -> Text: ... +@overload def decode(obj: _Encoded, encoding: str = ..., errors: str = ...) -> _Decoded: ... -def lookup(encoding: str) -> CodecInfo: ... +def lookup(__encoding: str) -> CodecInfo: ... def utf_16_be_decode(__obj: _Encoded, __errors: str = ..., __final: bool = ...) -> Tuple[_Decoded, int]: ... # undocumented def utf_16_be_encode(__obj: _Decoded, __errors: str = ...) -> Tuple[_Encoded, int]: ... # undocumented @@ -48,16 +99,18 @@ class CodecInfo(Tuple[_Encoder, _Decoder, _StreamReader, _StreamWriter]): @property def incrementaldecoder(self) -> _IncrementalDecoder: ... name: str - def __init__( - self, + def __new__( + cls, encode: _Encoder, decode: _Decoder, - streamreader: _StreamReader = ..., - streamwriter: _StreamWriter = ..., - incrementalencoder: _IncrementalEncoder = ..., - incrementaldecoder: _IncrementalDecoder = ..., - name: str = ..., - ) -> None: ... + streamreader: Optional[_StreamReader] = ..., + streamwriter: Optional[_StreamWriter] = ..., + incrementalencoder: Optional[_IncrementalEncoder] = ..., + incrementaldecoder: Optional[_IncrementalDecoder] = ..., + name: Optional[str] = ..., + *, + _is_text_encoding: Optional[bool] = ..., + ) -> CodecInfo: ... def getencoder(encoding: str) -> _Encoder: ... def getdecoder(encoding: str) -> _Decoder: ... @@ -65,9 +118,13 @@ def getincrementalencoder(encoding: str) -> _IncrementalEncoder: ... def getincrementaldecoder(encoding: str) -> _IncrementalDecoder: ... def getreader(encoding: str) -> _StreamReader: ... def getwriter(encoding: str) -> _StreamWriter: ... -def register(search_function: Callable[[str], Optional[CodecInfo]]) -> None: ... -def open(filename: str, mode: str = ..., encoding: str = ..., errors: str = ..., buffering: int = ...) -> StreamReaderWriter: ... -def EncodedFile(file: IO[_Encoded], data_encoding: str, file_encoding: str = ..., errors: str = ...) -> StreamRecoder: ... +def register(__search_function: Callable[[str], Optional[CodecInfo]]) -> None: ... +def open( + filename: str, mode: str = ..., encoding: Optional[str] = ..., errors: str = ..., buffering: int = ... +) -> StreamReaderWriter: ... +def EncodedFile( + file: IO[_Encoded], data_encoding: str, file_encoding: Optional[str] = ..., errors: str = ... +) -> StreamRecoder: ... def iterencode(iterator: Iterable[_Decoded], encoding: str, errors: str = ...) -> Generator[_Encoded, None, None]: ... def iterdecode(iterator: Iterable[_Encoded], encoding: str, errors: str = ...) -> Generator[_Decoded, None, None]: ... @@ -85,8 +142,8 @@ BOM_UTF32_LE: bytes # It is expected that different actions be taken depending on which of the # three subclasses of `UnicodeError` is actually ...ed. However, the Union # is still needed for at least one of the cases. -def register_error(name: str, error_handler: Callable[[UnicodeError], Tuple[Union[str, bytes], int]]) -> None: ... -def lookup_error(name: str) -> Callable[[UnicodeError], Tuple[Union[str, bytes], int]]: ... +def register_error(__errors: str, __handler: Callable[[UnicodeError], Tuple[Union[str, bytes], int]]) -> None: ... +def lookup_error(__name: str) -> Callable[[UnicodeError], Tuple[Union[str, bytes], int]]: ... def strict_errors(exception: UnicodeError) -> Tuple[Union[str, bytes], int]: ... def replace_errors(exception: UnicodeError) -> Tuple[Union[str, bytes], int]: ... def ignore_errors(exception: UnicodeError) -> Tuple[Union[str, bytes], int]: ... @@ -113,7 +170,7 @@ class IncrementalDecoder: errors: str def __init__(self, errors: str = ...) -> None: ... @abstractmethod - def decode(self, object: _Encoded, final: bool = ...) -> _Decoded: ... + def decode(self, input: _Encoded, final: bool = ...) -> _Decoded: ... def reset(self) -> None: ... def getstate(self) -> Tuple[_Encoded, int]: ... def setstate(self, state: Tuple[_Encoded, int]) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/codeop.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/codeop.pyi old mode 100755 new mode 100644 index 0e1129e6..f3d6c281 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/codeop.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/codeop.pyi @@ -1,6 +1,3 @@ -# Source(py2): https://hg.python.org/cpython/file/2.7/Lib/codeop.py -# Source(py3): https://github.com/python/cpython/blob/master/Lib/codeop.py - from types import CodeType from typing import Optional diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/colorsys.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/colorsys.pyi old mode 100755 new mode 100644 index c8b55918..8db2e2c9 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/colorsys.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/colorsys.pyi @@ -1,5 +1,3 @@ -# Stubs for colorsys - from typing import Tuple def rgb_to_yiq(r: float, g: float, b: float) -> Tuple[float, float, float]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/contextlib.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/contextlib.pyi old mode 100755 new mode 100644 index 2832d94b..509bcb6e --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/contextlib.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/contextlib.pyi @@ -1,36 +1,30 @@ -# Stubs for contextlib - -from typing import ( - Any, Callable, Generator, IO, Iterable, Iterator, Optional, Type, - Generic, TypeVar, overload -) -from types import TracebackType import sys -# Aliased here for backwards compatibility; TODO eventually remove this -from typing import ContextManager as ContextManager +from types import TracebackType +from typing import IO, Any, Callable, ContextManager, Iterable, Iterator, Optional, Type, TypeVar, overload if sys.version_info >= (3, 5): from typing import AsyncContextManager, AsyncIterator if sys.version_info >= (3, 6): - from typing import ContextManager as AbstractContextManager + AbstractContextManager = ContextManager if sys.version_info >= (3, 7): - from typing import AsyncContextManager as AbstractAsyncContextManager + AbstractAsyncContextManager = AsyncContextManager -_T = TypeVar('_T') -_F = TypeVar('_F', bound=Callable[..., Any]) +_T = TypeVar("_T") +_T_co = TypeVar("_T_co", covariant=True) +_T_io = TypeVar("_T_io", bound=Optional[IO[str]]) +_F = TypeVar("_F", bound=Callable[..., Any]) -_ExitFunc = Callable[[Optional[Type[BaseException]], - Optional[BaseException], - Optional[TracebackType]], bool] -_CM_EF = TypeVar('_CM_EF', ContextManager[Any], _ExitFunc) +_ExitFunc = Callable[[Optional[Type[BaseException]], Optional[BaseException], Optional[TracebackType]], bool] +_CM_EF = TypeVar("_CM_EF", ContextManager[Any], _ExitFunc) if sys.version_info >= (3, 2): - class _GeneratorContextManager(ContextManager[_T], Generic[_T]): + class _GeneratorContextManager(ContextManager[_T_co]): def __call__(self, func: _F) -> _F: ... def contextmanager(func: Callable[..., Iterator[_T]]) -> Callable[..., _GeneratorContextManager[_T]]: ... + else: - class GeneratorContextManager(ContextManager[_T], Generic[_T]): + class GeneratorContextManager(ContextManager[_T_co]): def __call__(self, func: _F) -> _F: ... def contextmanager(func: Callable[..., Iterator[_T]]) -> Callable[..., ContextManager[_T]]: ... @@ -40,69 +34,66 @@ if sys.version_info >= (3, 7): if sys.version_info < (3,): def nested(*mgr: ContextManager[Any]) -> ContextManager[Iterable[Any]]: ... -class closing(ContextManager[_T], Generic[_T]): +class closing(ContextManager[_T]): def __init__(self, thing: _T) -> None: ... if sys.version_info >= (3, 4): class suppress(ContextManager[None]): def __init__(self, *exceptions: Type[BaseException]) -> None: ... - def __exit__(self, exctype: Optional[Type[BaseException]], - excinst: Optional[BaseException], - exctb: Optional[TracebackType]) -> bool: ... - - class redirect_stdout(ContextManager[None]): - def __init__(self, new_target: Optional[IO[str]]) -> None: ... + def __exit__( + self, exctype: Optional[Type[BaseException]], excinst: Optional[BaseException], exctb: Optional[TracebackType] + ) -> bool: ... + class redirect_stdout(ContextManager[_T_io]): + def __init__(self, new_target: _T_io) -> None: ... if sys.version_info >= (3, 5): - class redirect_stderr(ContextManager[None]): - def __init__(self, new_target: Optional[IO[str]]) -> None: ... + class redirect_stderr(ContextManager[_T_io]): + def __init__(self, new_target: _T_io) -> None: ... if sys.version_info >= (3,): class ContextDecorator: - def __call__(self, func: Callable[..., None]) -> Callable[..., ContextManager[None]]: ... - - _U = TypeVar('_U', bound=ExitStack) - + def __call__(self, func: _F) -> _F: ... + _U = TypeVar("_U", bound=ExitStack) class ExitStack(ContextManager[ExitStack]): def __init__(self) -> None: ... def enter_context(self, cm: ContextManager[_T]) -> _T: ... def push(self, exit: _CM_EF) -> _CM_EF: ... - def callback(self, callback: Callable[..., Any], - *args: Any, **kwds: Any) -> Callable[..., Any]: ... + def callback(self, callback: Callable[..., Any], *args: Any, **kwds: Any) -> Callable[..., Any]: ... def pop_all(self: _U) -> _U: ... def close(self) -> None: ... def __enter__(self: _U) -> _U: ... - def __exit__(self, __exc_type: Optional[Type[BaseException]], - __exc_value: Optional[BaseException], - __traceback: Optional[TracebackType]) -> bool: ... + def __exit__( + self, + __exc_type: Optional[Type[BaseException]], + __exc_value: Optional[BaseException], + __traceback: Optional[TracebackType], + ) -> bool: ... if sys.version_info >= (3, 7): from typing import Awaitable - _S = TypeVar('_S', bound=AsyncExitStack) + _S = TypeVar("_S", bound=AsyncExitStack) - _ExitCoroFunc = Callable[[Optional[Type[BaseException]], - Optional[BaseException], - Optional[TracebackType]], Awaitable[bool]] + _ExitCoroFunc = Callable[[Optional[Type[BaseException]], Optional[BaseException], Optional[TracebackType]], Awaitable[bool]] _CallbackCoroFunc = Callable[..., Awaitable[Any]] - _ACM_EF = TypeVar('_ACM_EF', AsyncContextManager[Any], _ExitCoroFunc) - + _ACM_EF = TypeVar("_ACM_EF", AsyncContextManager[Any], _ExitCoroFunc) class AsyncExitStack(AsyncContextManager[AsyncExitStack]): def __init__(self) -> None: ... def enter_context(self, cm: ContextManager[_T]) -> _T: ... def enter_async_context(self, cm: AsyncContextManager[_T]) -> Awaitable[_T]: ... def push(self, exit: _CM_EF) -> _CM_EF: ... def push_async_exit(self, exit: _ACM_EF) -> _ACM_EF: ... - def callback(self, callback: Callable[..., Any], - *args: Any, **kwds: Any) -> Callable[..., Any]: ... - def push_async_callback(self, callback: _CallbackCoroFunc, - *args: Any, **kwds: Any) -> _CallbackCoroFunc: ... + def callback(self, callback: Callable[..., Any], *args: Any, **kwds: Any) -> Callable[..., Any]: ... + def push_async_callback(self, callback: _CallbackCoroFunc, *args: Any, **kwds: Any) -> _CallbackCoroFunc: ... def pop_all(self: _S) -> _S: ... def aclose(self) -> Awaitable[None]: ... def __aenter__(self: _S) -> Awaitable[_S]: ... - def __aexit__(self, __exc_type: Optional[Type[BaseException]], - __exc_value: Optional[BaseException], - __traceback: Optional[TracebackType]) -> Awaitable[bool]: ... + def __aexit__( + self, + __exc_type: Optional[Type[BaseException]], + __exc_value: Optional[BaseException], + __traceback: Optional[TracebackType], + ) -> Awaitable[bool]: ... if sys.version_info >= (3, 7): @overload diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/copy.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/copy.pyi old mode 100755 new mode 100644 index 523802a8..b51c79c6 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/copy.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/copy.pyi @@ -1,14 +1,14 @@ -# Stubs for copy +from typing import Any, Dict, Optional, TypeVar -from typing import TypeVar, Optional, Dict, Any - -_T = TypeVar('_T') +_T = TypeVar("_T") # None in CPython but non-None in Jython PyStringMap: Any # Note: memo and _nil are internal kwargs. -def deepcopy(x: _T, memo: Optional[Dict[int, _T]] = ..., _nil: Any = ...) -> _T: ... +def deepcopy(x: _T, memo: Optional[Dict[int, Any]] = ..., _nil: Any = ...) -> _T: ... def copy(x: _T) -> _T: ... + class Error(Exception): ... + error = Error diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/crypt.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/crypt.pyi old mode 100755 new mode 100644 index 621ce0bd..18893721 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/crypt.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/crypt.pyi @@ -3,7 +3,6 @@ from typing import List, Optional, Union if sys.version_info >= (3, 3): class _Method: ... - METHOD_CRYPT: _Method METHOD_MD5: _Method METHOD_SHA256: _Method @@ -18,5 +17,6 @@ if sys.version_info >= (3, 3): else: def mksalt(method: Optional[_Method] = ...) -> str: ... def crypt(word: str, salt: Optional[Union[str, _Method]] = ...) -> str: ... + else: def crypt(word: str, salt: str) -> str: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/csv.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/csv.pyi old mode 100755 new mode 100644 index f2493db0..606694dc --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/csv.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/csv.pyi @@ -4,7 +4,9 @@ from _csv import ( QUOTE_MINIMAL as QUOTE_MINIMAL, QUOTE_NONE as QUOTE_NONE, QUOTE_NONNUMERIC as QUOTE_NONNUMERIC, + Dialect as Dialect, Error as Error, + _DialectLike, _reader, _writer, field_size_limit as field_size_limit, @@ -16,21 +18,10 @@ from _csv import ( writer as writer, ) from collections import OrderedDict -from typing import Any, Dict, Iterable, Iterator, List, Mapping, Optional, Sequence, Text, Type, Union +from typing import Any, Dict, Iterable, Iterator, List, Mapping, Optional, Sequence, Text, Type -_Dialect = Union[str, Dialect, Type[Dialect]] _DictRow = Mapping[str, Any] -class Dialect(object): - delimiter: str - quotechar: Optional[str] - escapechar: Optional[str] - doublequote: bool - skipinitialspace: bool - lineterminator: str - quoting: int - def __init__(self) -> None: ... - class excel(Dialect): delimiter: str quotechar: str @@ -51,7 +42,9 @@ if sys.version_info >= (3,): lineterminator: str quoting: int -if sys.version_info >= (3, 6): +if sys.version_info >= (3, 8): + _DRMapping = Dict[str, str] +elif sys.version_info >= (3, 6): _DRMapping = OrderedDict[str, str] else: _DRMapping = Dict[str, str] @@ -60,16 +53,16 @@ class DictReader(Iterator[_DRMapping]): restkey: Optional[str] restval: Optional[str] reader: _reader - dialect: _Dialect + dialect: _DialectLike line_num: int - fieldnames: Sequence[str] + fieldnames: Optional[Sequence[str]] def __init__( self, f: Iterable[Text], fieldnames: Optional[Sequence[str]] = ..., restkey: Optional[str] = ..., restval: Optional[str] = ..., - dialect: _Dialect = ..., + dialect: _DialectLike = ..., *args: Any, **kwds: Any, ) -> None: ... @@ -90,12 +83,15 @@ class DictWriter(object): fieldnames: Iterable[str], restval: Optional[Any] = ..., extrasaction: str = ..., - dialect: _Dialect = ..., + dialect: _DialectLike = ..., *args: Any, **kwds: Any, ) -> None: ... - def writeheader(self) -> None: ... - def writerow(self, rowdict: _DictRow) -> None: ... + if sys.version_info >= (3, 8): + def writeheader(self) -> Any: ... + else: + def writeheader(self) -> None: ... + def writerow(self, rowdict: _DictRow) -> Any: ... def writerows(self, rowdicts: Iterable[_DictRow]) -> None: ... class Sniffer(object): diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/ctypes/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/ctypes/__init__.pyi old mode 100755 new mode 100644 index d07efd65..f06fa739 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/ctypes/__init__.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/ctypes/__init__.pyi @@ -1,23 +1,35 @@ -# Stubs for ctypes - +import sys from array import array from typing import ( - Any, Callable, ClassVar, Iterator, Iterable, List, Mapping, Optional, Sequence, Sized, Text, - Tuple, Type, Generic, TypeVar, overload, + Any, + Callable, + ClassVar, + Generic, + Iterable, + Iterator, + List, + Mapping, + Optional, + Sequence, + Text, + Tuple, + Type, + TypeVar, + Union as _UnionT, + overload, ) -from typing import Union as _UnionT -import sys -_T = TypeVar('_T') -_DLLT = TypeVar('_DLLT', bound=CDLL) -_CT = TypeVar('_CT', bound=_CData) +if sys.version_info >= (3, 9): + from types import GenericAlias +_T = TypeVar("_T") +_DLLT = TypeVar("_DLLT", bound=CDLL) +_CT = TypeVar("_CT", bound=_CData) RTLD_GLOBAL: int = ... RTLD_LOCAL: int = ... DEFAULT_MODE: int = ... - class CDLL(object): _func_flags_: ClassVar[int] = ... _func_restype_: ClassVar[_CData] = ... @@ -26,18 +38,20 @@ class CDLL(object): _FuncPtr: Type[_FuncPointer] = ... def __init__( self, - name: str, + name: Optional[str], mode: int = ..., handle: Optional[int] = ..., use_errno: bool = ..., use_last_error: bool = ..., winmode: Optional[int] = ..., ) -> None: ... - def __getattr__(self, name: str) -> _FuncPointer: ... - def __getitem__(self, name: str) -> _FuncPointer: ... -if sys.platform == 'win32': + def __getattr__(self, name: str) -> _NamedFuncPointer: ... + def __getitem__(self, name: str) -> _NamedFuncPointer: ... + +if sys.platform == "win32": class OleDLL(CDLL): ... class WinDLL(CDLL): ... + class PyDLL(CDLL): ... class LibraryLoader(Generic[_DLLT]): @@ -45,9 +59,11 @@ class LibraryLoader(Generic[_DLLT]): def __getattr__(self, name: str) -> _DLLT: ... def __getitem__(self, name: str) -> _DLLT: ... def LoadLibrary(self, name: str) -> _DLLT: ... + if sys.version_info >= (3, 9): + def __class_getitem__(cls, item: Any) -> GenericAlias: ... cdll: LibraryLoader[CDLL] = ... -if sys.platform == 'win32': +if sys.platform == "win32": windll: LibraryLoader[WinDLL] = ... oledll: LibraryLoader[OleDLL] = ... pydll: LibraryLoader[PyDLL] = ... @@ -66,6 +82,7 @@ class _CDataMeta(type): # uses _CDataMeta as its metaclass is _CData. So it's safe to ignore the errors here. def __mul__(cls: Type[_CT], other: int) -> Type[Array[_CT]]: ... # type: ignore def __rmul__(cls: Type[_CT], other: int) -> Type[Array[_CT]]: ... # type: ignore + class _CData(metaclass=_CDataMeta): _b_base: int = ... _b_needsfree_: bool = ... @@ -81,17 +98,12 @@ class _CData(metaclass=_CDataMeta): @classmethod def in_dll(cls: Type[_CT], library: CDLL, name: str) -> _CT: ... -class _PointerLike(_CData): ... - -_ECT = Callable[[Optional[Type[_CData]], - _FuncPointer, - Tuple[_CData, ...]], - _CData] -_PF = _UnionT[ - Tuple[int], - Tuple[int, str], - Tuple[int, str, Any] -] +class _CanCastTo(_CData): ... +class _PointerLike(_CanCastTo): ... + +_ECT = Callable[[Optional[Type[_CData]], _FuncPointer, Tuple[_CData, ...]], _CData] +_PF = _UnionT[Tuple[int], Tuple[int, str], Tuple[int, str, Any]] + class _FuncPointer(_PointerLike, _CData): restype: _UnionT[Type[_CData], Callable[[int], None], None] = ... argtypes: Sequence[Type[_CData]] = ... @@ -101,28 +113,26 @@ class _FuncPointer(_PointerLike, _CData): @overload def __init__(self, callable: Callable[..., Any]) -> None: ... @overload - def __init__(self, func_spec: Tuple[_UnionT[str, int], CDLL], - paramflags: Tuple[_PF, ...] = ...) -> None: ... + def __init__(self, func_spec: Tuple[_UnionT[str, int], CDLL], paramflags: Tuple[_PF, ...] = ...) -> None: ... @overload - def __init__(self, vtlb_index: int, name: str, - paramflags: Tuple[_PF, ...] = ..., - iid: pointer[c_int] = ...) -> None: ... + def __init__(self, vtlb_index: int, name: str, paramflags: Tuple[_PF, ...] = ..., iid: pointer[c_int] = ...) -> None: ... def __call__(self, *args: Any, **kwargs: Any) -> Any: ... +class _NamedFuncPointer(_FuncPointer): + __name__: str + class ArgumentError(Exception): ... +def CFUNCTYPE( + restype: Optional[Type[_CData]], *argtypes: Type[_CData], use_errno: bool = ..., use_last_error: bool = ... +) -> Type[_FuncPointer]: ... -def CFUNCTYPE(restype: Optional[Type[_CData]], - *argtypes: Type[_CData], - use_errno: bool = ..., - use_last_error: bool = ...) -> Type[_FuncPointer]: ... -if sys.platform == 'win32': - def WINFUNCTYPE(restype: Optional[Type[_CData]], - *argtypes: Type[_CData], - use_errno: bool = ..., - use_last_error: bool = ...) -> Type[_FuncPointer]: ... -def PYFUNCTYPE(restype: Optional[Type[_CData]], - *argtypes: Type[_CData]) -> Type[_FuncPointer]: ... +if sys.platform == "win32": + def WINFUNCTYPE( + restype: Optional[Type[_CData]], *argtypes: Type[_CData], use_errno: bool = ..., use_last_error: bool = ... + ) -> Type[_FuncPointer]: ... + +def PYFUNCTYPE(restype: Optional[Type[_CData]], *argtypes: Type[_CData]) -> Type[_FuncPointer]: ... class _CArgObject: ... @@ -138,21 +148,27 @@ _CVoidConstPLike = _UnionT[_CVoidPLike, bytes] def addressof(obj: _CData) -> int: ... def alignment(obj_or_type: _UnionT[_CData, Type[_CData]]) -> int: ... def byref(obj: _CData, offset: int = ...) -> _CArgObject: ... -_PT = TypeVar('_PT', bound=_PointerLike) -def cast(obj: _UnionT[_CData, _CArgObject], type: Type[_PT]) -> _PT: ... -def create_string_buffer(init_or_size: _UnionT[int, bytes], - size: Optional[int] = ...) -> Array[c_char]: ... + +_CastT = TypeVar("_CastT", bound=_CanCastTo) + +def cast(obj: _UnionT[_CData, _CArgObject, int], type: Type[_CastT]) -> _CastT: ... +def create_string_buffer(init: _UnionT[int, bytes], size: Optional[int] = ...) -> Array[c_char]: ... + c_buffer = create_string_buffer -def create_unicode_buffer(init_or_size: _UnionT[int, Text], - size: Optional[int] = ...) -> Array[c_wchar]: ... -if sys.platform == 'win32': + +def create_unicode_buffer(init: _UnionT[int, Text], size: Optional[int] = ...) -> Array[c_wchar]: ... + +if sys.platform == "win32": def DllCanUnloadNow() -> int: ... def DllGetClassObject(rclsid: Any, riid: Any, ppv: Any) -> int: ... # TODO not documented def FormatError(code: int) -> str: ... def GetLastError() -> int: ... + def get_errno() -> int: ... -if sys.platform == 'win32': + +if sys.platform == "win32": def get_last_error() -> int: ... + def memmove(dst: _CVoidPLike, src: _CVoidConstPLike, count: int) -> None: ... def memset(dst: _CVoidPLike, c: int, count: int) -> None: ... def POINTER(type: Type[_CT]) -> Type[pointer[_CT]]: ... @@ -174,16 +190,21 @@ class pointer(Generic[_CT], _PointerLike, _CData): def __setitem__(self, s: slice, o: Iterable[_CT]) -> None: ... def resize(obj: _CData, size: int) -> None: ... + if sys.version_info < (3,): def set_conversion_mode(encoding: str, errors: str) -> Tuple[str, str]: ... + def set_errno(value: int) -> int: ... -if sys.platform == 'win32': + +if sys.platform == "win32": def set_last_error(value: int) -> int: ... + def sizeof(obj_or_type: _UnionT[_CData, Type[_CData]]) -> int: ... def string_at(address: _CVoidConstPLike, size: int = ...) -> bytes: ... -if sys.platform == 'win32': - def WinError(code: Optional[int] = ..., - desc: Optional[str] = ...) -> WindowsError: ... + +if sys.platform == "win32": + def WinError(code: Optional[int] = ..., descr: Optional[str] = ...) -> OSError: ... + def wstring_at(address: _CVoidConstPLike, size: int = ...) -> str: ... class _SimpleCData(Generic[_T], _CData): @@ -194,62 +215,56 @@ class c_byte(_SimpleCData[int]): ... class c_char(_SimpleCData[bytes]): def __init__(self, value: _UnionT[int, bytes] = ...) -> None: ... + class c_char_p(_PointerLike, _SimpleCData[Optional[bytes]]): def __init__(self, value: Optional[_UnionT[int, bytes]] = ...) -> None: ... class c_double(_SimpleCData[float]): ... class c_longdouble(_SimpleCData[float]): ... class c_float(_SimpleCData[float]): ... - class c_int(_SimpleCData[int]): ... class c_int8(_SimpleCData[int]): ... class c_int16(_SimpleCData[int]): ... class c_int32(_SimpleCData[int]): ... class c_int64(_SimpleCData[int]): ... - class c_long(_SimpleCData[int]): ... class c_longlong(_SimpleCData[int]): ... - class c_short(_SimpleCData[int]): ... - class c_size_t(_SimpleCData[int]): ... class c_ssize_t(_SimpleCData[int]): ... - class c_ubyte(_SimpleCData[int]): ... - class c_uint(_SimpleCData[int]): ... class c_uint8(_SimpleCData[int]): ... class c_uint16(_SimpleCData[int]): ... class c_uint32(_SimpleCData[int]): ... class c_uint64(_SimpleCData[int]): ... - class c_ulong(_SimpleCData[int]): ... class c_ulonglong(_SimpleCData[int]): ... - class c_ushort(_SimpleCData[int]): ... - class c_void_p(_PointerLike, _SimpleCData[Optional[int]]): ... - class c_wchar(_SimpleCData[Text]): ... + class c_wchar_p(_PointerLike, _SimpleCData[Optional[Text]]): def __init__(self, value: Optional[_UnionT[int, Text]] = ...) -> None: ... class c_bool(_SimpleCData[bool]): def __init__(self, value: bool = ...) -> None: ... -if sys.platform == 'win32': +if sys.platform == "win32": class HRESULT(_SimpleCData[int]): ... # TODO undocumented -class py_object(_SimpleCData[_T]): ... +class py_object(_CanCastTo, _SimpleCData[_T]): ... class _CField: offset: int = ... size: int = ... + class _StructUnionMeta(_CDataMeta): _fields_: Sequence[_UnionT[Tuple[str, Type[_CData]], Tuple[str, Type[_CData], int]]] = ... _pack_: int = ... _anonymous_: Sequence[str] = ... def __getattr__(self, name: str) -> _CField: ... + class _StructUnionBase(_CData, metaclass=_StructUnionMeta): def __init__(self, *args: Any, **kw: Any) -> None: ... def __getattr__(self, name: str) -> Any: ... @@ -290,3 +305,5 @@ class Array(Generic[_CT], _CData): # Can't inherit from Sized because the metaclass conflict between # Sized and _CData prevents using _CDataMeta. def __len__(self) -> int: ... + if sys.version_info >= (3, 9): + def __class_getitem__(cls, item: Any) -> GenericAlias: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/ctypes/util.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/ctypes/util.pyi old mode 100755 new mode 100644 index 7077d9d2..20914c70 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/ctypes/util.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/ctypes/util.pyi @@ -1,8 +1,7 @@ -# Stubs for ctypes.util - -from typing import Optional import sys +from typing import Optional def find_library(name: str) -> Optional[str]: ... -if sys.platform == 'win32': + +if sys.platform == "win32": def find_msvcrt() -> Optional[str]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/ctypes/wintypes.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/ctypes/wintypes.pyi old mode 100755 new mode 100644 index c5a6226b..c178a9bd --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/ctypes/wintypes.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/ctypes/wintypes.pyi @@ -1,6 +1,23 @@ from ctypes import ( - _SimpleCData, Array, Structure, c_byte, c_char, c_char_p, c_double, c_float, c_int, c_long, - c_longlong, c_short, c_uint, c_ulong, c_ulonglong, c_ushort, c_void_p, c_wchar, c_wchar_p, + Array, + Structure, + _SimpleCData, + c_byte, + c_char, + c_char_p, + c_double, + c_float, + c_int, + c_long, + c_longlong, + c_short, + c_uint, + c_ulong, + c_ulonglong, + c_ushort, + c_void_p, + c_wchar, + c_wchar_p, pointer, ) @@ -15,7 +32,9 @@ DOUBLE = c_double FLOAT = c_float BOOLEAN = BYTE BOOL = c_long + class VARIANT_BOOL(_SimpleCData[bool]): ... + ULONG = c_ulong LONG = c_long USHORT = c_ushort @@ -86,6 +105,7 @@ class RECT(Structure): top: LONG right: LONG bottom: LONG + RECTL = RECT _RECTL = RECT tagRECT = RECT @@ -95,6 +115,7 @@ class _SMALL_RECT(Structure): Top: SHORT Right: SHORT Bottom: SHORT + SMALL_RECT = _SMALL_RECT class _COORD(Structure): @@ -104,6 +125,7 @@ class _COORD(Structure): class POINT(Structure): x: LONG y: LONG + POINTL = POINT _POINTL = POINT tagPOINT = POINT @@ -111,6 +133,7 @@ tagPOINT = POINT class SIZE(Structure): cx: LONG cy: LONG + SIZEL = SIZE tagSIZE = SIZE @@ -119,6 +142,7 @@ def RGB(red: int, green: int, blue: int) -> int: ... class FILETIME(Structure): dwLowDateTime: DWORD dwHighDateTime: DWORD + _FILETIME = FILETIME class MSG(Structure): @@ -128,6 +152,7 @@ class MSG(Structure): lParam: LPARAM time: DWORD pt: POINT + tagMSG = MSG MAX_PATH: int diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/curses/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/curses/__init__.pyi old mode 100755 new mode 100644 index 8bd806b4..73e84fba --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/curses/__init__.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/curses/__init__.pyi @@ -1,8 +1,8 @@ from _curses import * # noqa: F403 from _curses import _CursesWindow as _CursesWindow -from typing import TypeVar, Callable, Any +from typing import Any, Callable, TypeVar -_T = TypeVar('_T') +_T = TypeVar("_T") # available after calling `curses.initscr()` LINES: int @@ -12,4 +12,4 @@ COLS: int COLORS: int COLOR_PAIRS: int -def wrapper(func: Callable[..., _T], *arg: Any, **kwds: Any) -> _T: ... +def wrapper(__func: Callable[..., _T], *arg: Any, **kwds: Any) -> _T: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/curses/ascii.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/curses/ascii.pyi old mode 100755 new mode 100644 index 40337692..2a076601 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/curses/ascii.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/curses/ascii.pyi @@ -1,6 +1,6 @@ -from typing import List, Union, overload, TypeVar +from typing import List, TypeVar, Union -_Ch = TypeVar('_Ch', str, int) +_Ch = TypeVar("_Ch", str, int) NUL: int SOH: int diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/curses/panel.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/curses/panel.pyi old mode 100755 new mode 100644 index 90f70c4f..138e4a9f --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/curses/panel.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/curses/panel.pyi @@ -15,6 +15,6 @@ class _Curses_Panel: # type is (note the s def window(self) -> _CursesWindow: ... def bottom_panel() -> _Curses_Panel: ... -def new_panel(win: _CursesWindow) -> _Curses_Panel: ... +def new_panel(__win: _CursesWindow) -> _Curses_Panel: ... def top_panel() -> _Curses_Panel: ... def update_panels() -> _Curses_Panel: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/curses/textpad.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/curses/textpad.pyi old mode 100755 new mode 100644 index a218564c..d2b5766f --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/curses/textpad.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/curses/textpad.pyi @@ -1,11 +1,11 @@ from _curses import _CursesWindow -from typing import Callable, Union +from typing import Callable, Optional, Union def rectangle(win: _CursesWindow, uly: int, ulx: int, lry: int, lrx: int) -> None: ... class Textbox: stripspaces: bool - def __init__(self, w: _CursesWindow, insert_mode: bool = ...) -> None: ... - def edit(self, validate: Callable[[int], int]) -> str: ... + def __init__(self, win: _CursesWindow, insert_mode: bool = ...) -> None: ... + def edit(self, validate: Optional[Callable[[int], int]] = ...) -> str: ... def do_command(self, ch: Union[str, int]) -> None: ... def gather(self) -> str: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/datetime.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/datetime.pyi old mode 100755 new mode 100644 index 9c4031ad..5cfb42b3 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/datetime.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/datetime.pyi @@ -1,6 +1,6 @@ import sys from time import struct_time -from typing import AnyStr, Optional, SupportsAbs, Tuple, Union, overload, ClassVar, Type, TypeVar +from typing import AnyStr, ClassVar, Optional, SupportsAbs, Tuple, Type, TypeVar, Union, overload _S = TypeVar("_S") @@ -23,7 +23,6 @@ if sys.version_info >= (3, 2): utc: ClassVar[timezone] min: ClassVar[timezone] max: ClassVar[timezone] - def __init__(self, offset: timedelta, name: str = ...) -> None: ... def __hash__(self) -> int: ... @@ -33,11 +32,9 @@ class date: min: ClassVar[date] max: ClassVar[date] resolution: ClassVar[timedelta] - - def __init__(self, year: int, month: int, day: int) -> None: ... - + def __new__(cls: Type[_S], year: int, month: int, day: int) -> _S: ... @classmethod - def fromtimestamp(cls: Type[_S], t: float) -> _S: ... + def fromtimestamp(cls: Type[_S], __timestamp: float) -> _S: ... @classmethod def today(cls: Type[_S]) -> _S: ... @classmethod @@ -48,14 +45,12 @@ class date: if sys.version_info >= (3, 8): @classmethod def fromisocalendar(cls: Type[_S], year: int, week: int, day: int) -> _S: ... - @property def year(self) -> int: ... @property def month(self) -> int: ... @property def day(self) -> int: ... - def ctime(self) -> str: ... def strftime(self, fmt: _Text) -> str: ... if sys.version_info >= (3,): @@ -91,12 +86,20 @@ class time: resolution: ClassVar[timedelta] if sys.version_info >= (3, 6): - def __init__(self, hour: int = ..., minute: int = ..., second: int = ..., microsecond: int = ..., - tzinfo: Optional[_tzinfo] = ..., *, fold: int = ...) -> None: ... + def __init__( + self, + hour: int = ..., + minute: int = ..., + second: int = ..., + microsecond: int = ..., + tzinfo: Optional[_tzinfo] = ..., + *, + fold: int = ..., + ) -> None: ... else: - def __init__(self, hour: int = ..., minute: int = ..., second: int = ..., microsecond: int = ..., - tzinfo: Optional[_tzinfo] = ...) -> None: ... - + def __init__( + self, hour: int = ..., minute: int = ..., second: int = ..., microsecond: int = ..., tzinfo: Optional[_tzinfo] = ... + ) -> None: ... @property def hour(self) -> int: ... @property @@ -110,7 +113,6 @@ class time: if sys.version_info >= (3, 6): @property def fold(self) -> int: ... - def __le__(self, other: time) -> bool: ... def __lt__(self, other: time) -> bool: ... def __ge__(self, other: time) -> bool: ... @@ -130,14 +132,22 @@ class time: def __format__(self, fmt: AnyStr) -> AnyStr: ... def utcoffset(self) -> Optional[timedelta]: ... def tzname(self) -> Optional[str]: ... - def dst(self) -> Optional[int]: ... + def dst(self) -> Optional[timedelta]: ... if sys.version_info >= (3, 6): - def replace(self, hour: int = ..., minute: int = ..., second: int = ..., - microsecond: int = ..., tzinfo: Optional[_tzinfo] = ..., - *, fold: int = ...) -> time: ... + def replace( + self, + hour: int = ..., + minute: int = ..., + second: int = ..., + microsecond: int = ..., + tzinfo: Optional[_tzinfo] = ..., + *, + fold: int = ..., + ) -> time: ... else: - def replace(self, hour: int = ..., minute: int = ..., second: int = ..., - microsecond: int = ..., tzinfo: Optional[_tzinfo] = ...) -> time: ... + def replace( + self, hour: int = ..., minute: int = ..., second: int = ..., microsecond: int = ..., tzinfo: Optional[_tzinfo] = ... + ) -> time: ... _date = date _time = time @@ -148,21 +158,35 @@ class timedelta(SupportsAbs[timedelta]): resolution: ClassVar[timedelta] if sys.version_info >= (3, 6): - def __init__(self, days: float = ..., seconds: float = ..., microseconds: float = ..., - milliseconds: float = ..., minutes: float = ..., hours: float = ..., - weeks: float = ..., *, fold: int = ...) -> None: ... + def __init__( + self, + days: float = ..., + seconds: float = ..., + microseconds: float = ..., + milliseconds: float = ..., + minutes: float = ..., + hours: float = ..., + weeks: float = ..., + *, + fold: int = ..., + ) -> None: ... else: - def __init__(self, days: float = ..., seconds: float = ..., microseconds: float = ..., - milliseconds: float = ..., minutes: float = ..., hours: float = ..., - weeks: float = ...) -> None: ... - + def __init__( + self, + days: float = ..., + seconds: float = ..., + microseconds: float = ..., + milliseconds: float = ..., + minutes: float = ..., + hours: float = ..., + weeks: float = ..., + ) -> None: ... @property def days(self) -> int: ... @property def seconds(self) -> int: ... @property def microseconds(self) -> int: ... - def total_seconds(self) -> float: ... def __add__(self, other: timedelta) -> timedelta: ... def __radd__(self, other: timedelta) -> timedelta: ... @@ -201,14 +225,31 @@ class datetime(date): resolution: ClassVar[timedelta] if sys.version_info >= (3, 6): - def __init__(self, year: int, month: int, day: int, hour: int = ..., - minute: int = ..., second: int = ..., microsecond: int = ..., - tzinfo: Optional[_tzinfo] = ..., *, fold: int = ...) -> None: ... + def __new__( + cls: Type[_S], + year: int, + month: int, + day: int, + hour: int = ..., + minute: int = ..., + second: int = ..., + microsecond: int = ..., + tzinfo: Optional[_tzinfo] = ..., + *, + fold: int = ..., + ) -> _S: ... else: - def __init__(self, year: int, month: int, day: int, hour: int = ..., - minute: int = ..., second: int = ..., microsecond: int = ..., - tzinfo: Optional[_tzinfo] = ...) -> None: ... - + def __new__( + cls: Type[_S], + year: int, + month: int, + day: int, + hour: int = ..., + minute: int = ..., + second: int = ..., + microsecond: int = ..., + tzinfo: Optional[_tzinfo] = ..., + ) -> _S: ... @property def year(self) -> int: ... @property @@ -228,7 +269,6 @@ class datetime(date): if sys.version_info >= (3, 6): @property def fold(self) -> int: ... - @classmethod def fromtimestamp(cls: Type[_S], t: float, tz: Optional[_tzinfo] = ...) -> _S: ... @classmethod @@ -272,13 +312,31 @@ class datetime(date): def time(self) -> _time: ... def timetz(self) -> _time: ... if sys.version_info >= (3, 6): - def replace(self, year: int = ..., month: int = ..., day: int = ..., hour: int = ..., - minute: int = ..., second: int = ..., microsecond: int = ..., tzinfo: - Optional[_tzinfo] = ..., *, fold: int = ...) -> datetime: ... + def replace( + self, + year: int = ..., + month: int = ..., + day: int = ..., + hour: int = ..., + minute: int = ..., + second: int = ..., + microsecond: int = ..., + tzinfo: Optional[_tzinfo] = ..., + *, + fold: int = ..., + ) -> datetime: ... else: - def replace(self, year: int = ..., month: int = ..., day: int = ..., hour: int = ..., - minute: int = ..., second: int = ..., microsecond: int = ..., tzinfo: - Optional[_tzinfo] = ...) -> datetime: ... + def replace( + self, + year: int = ..., + month: int = ..., + day: int = ..., + hour: int = ..., + minute: int = ..., + second: int = ..., + microsecond: int = ..., + tzinfo: Optional[_tzinfo] = ..., + ) -> datetime: ... if sys.version_info >= (3, 8): def astimezone(self: _S, tz: Optional[_tzinfo] = ...) -> _S: ... elif sys.version_info >= (3, 3): diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/decimal.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/decimal.pyi old mode 100755 new mode 100644 index 06193c7a..c3a671d4 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/decimal.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/decimal.pyi @@ -1,9 +1,7 @@ import numbers import sys from types import TracebackType -from typing import ( - Any, Container, Dict, List, NamedTuple, Optional, overload, Sequence, Text, Tuple, Type, TypeVar, Union, -) +from typing import Any, Container, Dict, List, NamedTuple, Optional, Sequence, Text, Tuple, Type, TypeVar, Union, overload _Decimal = Union[Decimal, int] _DecimalNew = Union[Decimal, float, Text, Tuple[int, Sequence[int], int]] @@ -11,7 +9,7 @@ if sys.version_info >= (3,): _ComparableNum = Union[Decimal, float, numbers.Rational] else: _ComparableNum = Union[Decimal, float] -_DecimalT = TypeVar('_DecimalT', bound=Decimal) +_DecimalT = TypeVar("_DecimalT", bound=Decimal) class DecimalTuple(NamedTuple): sign: int @@ -35,82 +33,97 @@ if sys.version_info >= (3,): MIN_ETINY: int class DecimalException(ArithmeticError): - def handle(self, context: Context, *args: Any) -> Optional[Decimal]: ... + if sys.version_info < (3,): + def handle(self, context: Context, *args: Any) -> Optional[Decimal]: ... class Clamped(DecimalException): ... - class InvalidOperation(DecimalException): ... - class ConversionSyntax(InvalidOperation): ... - class DivisionByZero(DecimalException, ZeroDivisionError): ... - class DivisionImpossible(InvalidOperation): ... - class DivisionUndefined(InvalidOperation, ZeroDivisionError): ... - class Inexact(DecimalException): ... - class InvalidContext(InvalidOperation): ... - class Rounded(DecimalException): ... - class Subnormal(DecimalException): ... - class Overflow(Inexact, Rounded): ... - class Underflow(Inexact, Rounded, Subnormal): ... if sys.version_info >= (3,): class FloatOperation(DecimalException, TypeError): ... -def setcontext(context: Context) -> None: ... +def setcontext(__context: Context) -> None: ... def getcontext() -> Context: ... def localcontext(ctx: Optional[Context] = ...) -> _ContextManager: ... class Decimal(object): def __new__(cls: Type[_DecimalT], value: _DecimalNew = ..., context: Optional[Context] = ...) -> _DecimalT: ... @classmethod - def from_float(cls, f: float) -> Decimal: ... + def from_float(cls, __f: float) -> Decimal: ... if sys.version_info >= (3,): def __bool__(self) -> bool: ... else: def __nonzero__(self) -> bool: ... - def __eq__(self, other: object, context: Optional[Context] = ...) -> bool: ... - if sys.version_info < (3,): + def __div__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __rdiv__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... def __ne__(self, other: object, context: Optional[Context] = ...) -> bool: ... - def __lt__(self, other: _ComparableNum, context: Optional[Context] = ...) -> bool: ... - def __le__(self, other: _ComparableNum, context: Optional[Context] = ...) -> bool: ... - def __gt__(self, other: _ComparableNum, context: Optional[Context] = ...) -> bool: ... - def __ge__(self, other: _ComparableNum, context: Optional[Context] = ...) -> bool: ... def compare(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... def __hash__(self) -> int: ... def as_tuple(self) -> DecimalTuple: ... - if sys.version_info >= (3,): + if sys.version_info >= (3, 6): def as_integer_ratio(self) -> Tuple[int, int]: ... - def __str__(self, eng: bool = ..., context: Optional[Context] = ...) -> str: ... def to_eng_string(self, context: Optional[Context] = ...) -> str: ... - def __neg__(self, context: Optional[Context] = ...) -> Decimal: ... - def __pos__(self, context: Optional[Context] = ...) -> Decimal: ... - def __abs__(self, round: bool = ..., context: Optional[Context] = ...) -> Decimal: ... - def __add__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... - def __radd__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... - def __sub__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... - def __rsub__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... - def __mul__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... - def __rmul__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... - def __truediv__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... - def __rtruediv__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... - if sys.version_info < (3,): - def __div__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... - def __rdiv__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... - def __divmod__(self, other: _Decimal, context: Optional[Context] = ...) -> Tuple[Decimal, Decimal]: ... - def __rdivmod__(self, other: _Decimal, context: Optional[Context] = ...) -> Tuple[Decimal, Decimal]: ... - def __mod__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... - def __rmod__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + if sys.version_info >= (3,): + def __abs__(self) -> Decimal: ... + def __add__(self, other: _Decimal) -> Decimal: ... + def __divmod__(self, other: _Decimal) -> Tuple[Decimal, Decimal]: ... + def __eq__(self, other: object) -> bool: ... + def __floordiv__(self, other: _Decimal) -> Decimal: ... + def __ge__(self, other: _ComparableNum) -> bool: ... + def __gt__(self, other: _ComparableNum) -> bool: ... + def __le__(self, other: _ComparableNum) -> bool: ... + def __lt__(self, other: _ComparableNum) -> bool: ... + def __mod__(self, other: _Decimal) -> Decimal: ... + def __mul__(self, other: _Decimal) -> Decimal: ... + def __neg__(self) -> Decimal: ... + def __pos__(self) -> Decimal: ... + def __pow__(self, other: _Decimal, modulo: Optional[_Decimal] = ...) -> Decimal: ... + def __radd__(self, other: _Decimal) -> Decimal: ... + def __rdivmod__(self, other: _Decimal) -> Tuple[Decimal, Decimal]: ... + def __rfloordiv__(self, other: _Decimal) -> Decimal: ... + def __rmod__(self, other: _Decimal) -> Decimal: ... + def __rmul__(self, other: _Decimal) -> Decimal: ... + def __rsub__(self, other: _Decimal) -> Decimal: ... + def __rtruediv__(self, other: _Decimal) -> Decimal: ... + def __str__(self) -> str: ... + def __sub__(self, other: _Decimal) -> Decimal: ... + def __truediv__(self, other: _Decimal) -> Decimal: ... + else: + def __abs__(self, round: bool = ..., context: Optional[Context] = ...) -> Decimal: ... + def __add__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __divmod__(self, other: _Decimal, context: Optional[Context] = ...) -> Tuple[Decimal, Decimal]: ... + def __eq__(self, other: object, context: Optional[Context] = ...) -> bool: ... + def __floordiv__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __ge__(self, other: _ComparableNum, context: Optional[Context] = ...) -> bool: ... + def __gt__(self, other: _ComparableNum, context: Optional[Context] = ...) -> bool: ... + def __le__(self, other: _ComparableNum, context: Optional[Context] = ...) -> bool: ... + def __lt__(self, other: _ComparableNum, context: Optional[Context] = ...) -> bool: ... + def __mod__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __mul__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __neg__(self, context: Optional[Context] = ...) -> Decimal: ... + def __pos__(self, context: Optional[Context] = ...) -> Decimal: ... + def __pow__(self, other: _Decimal, modulo: Optional[_Decimal] = ..., context: Optional[Context] = ...) -> Decimal: ... + def __radd__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __rdivmod__(self, other: _Decimal, context: Optional[Context] = ...) -> Tuple[Decimal, Decimal]: ... + def __rfloordiv__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __rmod__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __rmul__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __rsub__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __rtruediv__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __str__(self, eng: bool = ..., context: Optional[Context] = ...) -> str: ... + def __sub__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __truediv__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... def remainder_near(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... - def __floordiv__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... - def __rfloordiv__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... def __float__(self) -> float: ... def __int__(self) -> int: ... def __trunc__(self) -> int: ... @@ -130,16 +143,15 @@ class Decimal(object): else: def __long__(self) -> long: ... def fma(self, other: _Decimal, third: _Decimal, context: Optional[Context] = ...) -> Decimal: ... - def __pow__(self, other: _Decimal, modulo: Optional[_Decimal] = ..., context: Optional[Context] = ...) -> Decimal: ... def __rpow__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... def normalize(self, context: Optional[Context] = ...) -> Decimal: ... if sys.version_info >= (3,): - def quantize(self, exp: _Decimal, rounding: Optional[str] = ..., - context: Optional[Context] = ...) -> Decimal: ... + def quantize(self, exp: _Decimal, rounding: Optional[str] = ..., context: Optional[Context] = ...) -> Decimal: ... def same_quantum(self, other: _Decimal, context: Optional[Context] = ...) -> bool: ... else: - def quantize(self, exp: _Decimal, rounding: Optional[str] = ..., - context: Optional[Context] = ..., watchexp: bool = ...) -> Decimal: ... + def quantize( + self, exp: _Decimal, rounding: Optional[str] = ..., context: Optional[Context] = ..., watchexp: bool = ... + ) -> Decimal: ... def same_quantum(self, other: _Decimal) -> bool: ... def to_integral_exact(self, rounding: Optional[str] = ..., context: Optional[Context] = ...) -> Decimal: ... def to_integral_value(self, rounding: Optional[str] = ..., context: Optional[Context] = ...) -> Decimal: ... @@ -220,19 +232,31 @@ class Context(object): traps: Dict[_TrapType, bool] flags: Dict[_TrapType, bool] if sys.version_info >= (3,): - def __init__(self, prec: Optional[int] = ..., rounding: Optional[str] = ..., - Emin: Optional[int] = ..., Emax: Optional[int] = ..., - capitals: Optional[int] = ..., clamp: Optional[int] = ..., - flags: Union[None, Dict[_TrapType, bool], Container[_TrapType]] = ..., - traps: Union[None, Dict[_TrapType, bool], Container[_TrapType]] = ..., - _ignored_flags: Optional[List[_TrapType]] = ...) -> None: ... + def __init__( + self, + prec: Optional[int] = ..., + rounding: Optional[str] = ..., + Emin: Optional[int] = ..., + Emax: Optional[int] = ..., + capitals: Optional[int] = ..., + clamp: Optional[int] = ..., + flags: Union[None, Dict[_TrapType, bool], Container[_TrapType]] = ..., + traps: Union[None, Dict[_TrapType, bool], Container[_TrapType]] = ..., + _ignored_flags: Optional[List[_TrapType]] = ..., + ) -> None: ... else: - def __init__(self, prec: Optional[int] = ..., rounding: Optional[str] = ..., - traps: Union[None, Dict[_TrapType, bool], Container[_TrapType]] = ..., - flags: Union[None, Dict[_TrapType, bool], Container[_TrapType]] = ..., - Emin: Optional[int] = ..., Emax: Optional[int] = ..., - capitals: Optional[int] = ..., _clamp: Optional[int] = ..., - _ignored_flags: Optional[List[_TrapType]] = ...) -> None: ... + def __init__( + self, + prec: Optional[int] = ..., + rounding: Optional[str] = ..., + traps: Union[None, Dict[_TrapType, bool], Container[_TrapType]] = ..., + flags: Union[None, Dict[_TrapType, bool], Container[_TrapType]] = ..., + Emin: Optional[int] = ..., + Emax: Optional[int] = ..., + capitals: Optional[int] = ..., + _clamp: Optional[int] = ..., + _ignored_flags: Optional[List[_TrapType]] = ..., + ) -> None: ... if sys.version_info >= (3,): # __setattr__() only allows to set a specific set of attributes, # already defined above. @@ -246,69 +270,69 @@ class Context(object): __hash__: Any = ... def Etiny(self) -> int: ... def Etop(self) -> int: ... - def create_decimal(self, num: _DecimalNew = ...) -> Decimal: ... - def create_decimal_from_float(self, f: float) -> Decimal: ... - def abs(self, a: _Decimal) -> Decimal: ... - def add(self, a: _Decimal, b: _Decimal) -> Decimal: ... - def canonical(self, a: Decimal) -> Decimal: ... - def compare(self, a: _Decimal, b: _Decimal) -> Decimal: ... - def compare_signal(self, a: _Decimal, b: _Decimal) -> Decimal: ... - def compare_total(self, a: _Decimal, b: _Decimal) -> Decimal: ... - def compare_total_mag(self, a: _Decimal, b: _Decimal) -> Decimal: ... - def copy_abs(self, a: _Decimal) -> Decimal: ... - def copy_decimal(self, a: _Decimal) -> Decimal: ... - def copy_negate(self, a: _Decimal) -> Decimal: ... - def copy_sign(self, a: _Decimal, b: _Decimal) -> Decimal: ... - def divide(self, a: _Decimal, b: _Decimal) -> Decimal: ... - def divide_int(self, a: _Decimal, b: _Decimal) -> Decimal: ... - def divmod(self, a: _Decimal, b: _Decimal) -> Tuple[Decimal, Decimal]: ... - def exp(self, a: _Decimal) -> Decimal: ... - def fma(self, a: _Decimal, b: _Decimal, c: _Decimal) -> Decimal: ... - def is_canonical(self, a: _Decimal) -> bool: ... - def is_finite(self, a: _Decimal) -> bool: ... - def is_infinite(self, a: _Decimal) -> bool: ... - def is_nan(self, a: _Decimal) -> bool: ... - def is_normal(self, a: _Decimal) -> bool: ... - def is_qnan(self, a: _Decimal) -> bool: ... - def is_signed(self, a: _Decimal) -> bool: ... - def is_snan(self, a: _Decimal) -> bool: ... - def is_subnormal(self, a: _Decimal) -> bool: ... - def is_zero(self, a: _Decimal) -> bool: ... - def ln(self, a: _Decimal) -> Decimal: ... - def log10(self, a: _Decimal) -> Decimal: ... - def logb(self, a: _Decimal) -> Decimal: ... - def logical_and(self, a: _Decimal, b: _Decimal) -> Decimal: ... - def logical_invert(self, a: _Decimal) -> Decimal: ... - def logical_or(self, a: _Decimal, b: _Decimal) -> Decimal: ... - def logical_xor(self, a: _Decimal, b: _Decimal) -> Decimal: ... - def max(self, a: _Decimal, b: _Decimal) -> Decimal: ... - def max_mag(self, a: _Decimal, b: _Decimal) -> Decimal: ... - def min(self, a: _Decimal, b: _Decimal) -> Decimal: ... - def min_mag(self, a: _Decimal, b: _Decimal) -> Decimal: ... - def minus(self, a: _Decimal) -> Decimal: ... - def multiply(self, a: _Decimal, b: _Decimal) -> Decimal: ... - def next_minus(self, a: _Decimal) -> Decimal: ... - def next_plus(self, a: _Decimal) -> Decimal: ... - def next_toward(self, a: _Decimal, b: _Decimal) -> Decimal: ... - def normalize(self, a: _Decimal) -> Decimal: ... - def number_class(self, a: _Decimal) -> str: ... - def plus(self, a: _Decimal) -> Decimal: ... + def create_decimal(self, __num: _DecimalNew = ...) -> Decimal: ... + def create_decimal_from_float(self, __f: float) -> Decimal: ... + def abs(self, __x: _Decimal) -> Decimal: ... + def add(self, __x: _Decimal, __y: _Decimal) -> Decimal: ... + def canonical(self, __x: Decimal) -> Decimal: ... + def compare(self, __x: _Decimal, __y: _Decimal) -> Decimal: ... + def compare_signal(self, __x: _Decimal, __y: _Decimal) -> Decimal: ... + def compare_total(self, __x: _Decimal, __y: _Decimal) -> Decimal: ... + def compare_total_mag(self, __x: _Decimal, __y: _Decimal) -> Decimal: ... + def copy_abs(self, __x: _Decimal) -> Decimal: ... + def copy_decimal(self, __x: _Decimal) -> Decimal: ... + def copy_negate(self, __x: _Decimal) -> Decimal: ... + def copy_sign(self, __x: _Decimal, __y: _Decimal) -> Decimal: ... + def divide(self, __x: _Decimal, __y: _Decimal) -> Decimal: ... + def divide_int(self, __x: _Decimal, __y: _Decimal) -> Decimal: ... + def divmod(self, __x: _Decimal, __y: _Decimal) -> Tuple[Decimal, Decimal]: ... + def exp(self, __x: _Decimal) -> Decimal: ... + def fma(self, __x: _Decimal, __y: _Decimal, __z: _Decimal) -> Decimal: ... + def is_canonical(self, __x: _Decimal) -> bool: ... + def is_finite(self, __x: _Decimal) -> bool: ... + def is_infinite(self, __x: _Decimal) -> bool: ... + def is_nan(self, __x: _Decimal) -> bool: ... + def is_normal(self, __x: _Decimal) -> bool: ... + def is_qnan(self, __x: _Decimal) -> bool: ... + def is_signed(self, __x: _Decimal) -> bool: ... + def is_snan(self, __x: _Decimal) -> bool: ... + def is_subnormal(self, __x: _Decimal) -> bool: ... + def is_zero(self, __x: _Decimal) -> bool: ... + def ln(self, __x: _Decimal) -> Decimal: ... + def log10(self, __x: _Decimal) -> Decimal: ... + def logb(self, __x: _Decimal) -> Decimal: ... + def logical_and(self, __x: _Decimal, __y: _Decimal) -> Decimal: ... + def logical_invert(self, __x: _Decimal) -> Decimal: ... + def logical_or(self, __x: _Decimal, __y: _Decimal) -> Decimal: ... + def logical_xor(self, __x: _Decimal, __y: _Decimal) -> Decimal: ... + def max(self, __x: _Decimal, __y: _Decimal) -> Decimal: ... + def max_mag(self, __x: _Decimal, __y: _Decimal) -> Decimal: ... + def min(self, __x: _Decimal, __y: _Decimal) -> Decimal: ... + def min_mag(self, __x: _Decimal, __y: _Decimal) -> Decimal: ... + def minus(self, __x: _Decimal) -> Decimal: ... + def multiply(self, __x: _Decimal, __y: _Decimal) -> Decimal: ... + def next_minus(self, __x: _Decimal) -> Decimal: ... + def next_plus(self, __x: _Decimal) -> Decimal: ... + def next_toward(self, __x: _Decimal, __y: _Decimal) -> Decimal: ... + def normalize(self, __x: _Decimal) -> Decimal: ... + def number_class(self, __x: _Decimal) -> str: ... + def plus(self, __x: _Decimal) -> Decimal: ... def power(self, a: _Decimal, b: _Decimal, modulo: Optional[_Decimal] = ...) -> Decimal: ... - def quantize(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def quantize(self, __x: _Decimal, __y: _Decimal) -> Decimal: ... def radix(self) -> Decimal: ... - def remainder(self, a: _Decimal, b: _Decimal) -> Decimal: ... - def remainder_near(self, a: _Decimal, b: _Decimal) -> Decimal: ... - def rotate(self, a: _Decimal, b: _Decimal) -> Decimal: ... - def same_quantum(self, a: _Decimal, b: _Decimal) -> bool: ... - def scaleb(self, a: _Decimal, b: _Decimal) -> Decimal: ... - def shift(self, a: _Decimal, b: _Decimal) -> Decimal: ... - def sqrt(self, a: _Decimal) -> Decimal: ... - def subtract(self, a: _Decimal, b: _Decimal) -> Decimal: ... - def to_eng_string(self, a: _Decimal) -> str: ... - def to_sci_string(self, a: _Decimal) -> str: ... - def to_integral_exact(self, a: _Decimal) -> Decimal: ... - def to_integral_value(self, a: _Decimal) -> Decimal: ... - def to_integral(self, a: _Decimal) -> Decimal: ... + def remainder(self, __x: _Decimal, __y: _Decimal) -> Decimal: ... + def remainder_near(self, __x: _Decimal, __y: _Decimal) -> Decimal: ... + def rotate(self, __x: _Decimal, __y: _Decimal) -> Decimal: ... + def same_quantum(self, __x: _Decimal, __y: _Decimal) -> bool: ... + def scaleb(self, __x: _Decimal, __y: _Decimal) -> Decimal: ... + def shift(self, __x: _Decimal, __y: _Decimal) -> Decimal: ... + def sqrt(self, __x: _Decimal) -> Decimal: ... + def subtract(self, __x: _Decimal, __y: _Decimal) -> Decimal: ... + def to_eng_string(self, __x: _Decimal) -> str: ... + def to_sci_string(self, __x: _Decimal) -> str: ... + def to_integral_exact(self, __x: _Decimal) -> Decimal: ... + def to_integral_value(self, __x: _Decimal) -> Decimal: ... + def to_integral(self, __x: _Decimal) -> Decimal: ... DefaultContext: Context BasicContext: Context diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/difflib.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/difflib.pyi old mode 100755 new mode 100644 index 197c5d03..572972cc --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/difflib.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/difflib.pyi @@ -1,18 +1,32 @@ -# Based on https://docs.python.org/2.7/library/difflib.html and https://docs.python.org/3.2/library/difflib.html - import sys from typing import ( - TypeVar, Callable, Iterable, Iterator, List, NamedTuple, Sequence, Tuple, - Generic, Optional, Text, Union, AnyStr + Any, + AnyStr, + Callable, + Generic, + Iterable, + Iterator, + List, + NamedTuple, + Optional, + Sequence, + Text, + Tuple, + TypeVar, + Union, + overload, ) -_T = TypeVar('_T') +if sys.version_info >= (3, 9): + from types import GenericAlias + +_T = TypeVar("_T") if sys.version_info >= (3,): _StrType = Text else: # Aliases can't point to type vars, so we need to redeclare AnyStr - _StrType = TypeVar('_StrType', Text, bytes) + _StrType = TypeVar("_StrType", Text, bytes) _JunkCallback = Union[Callable[[Text], bool], Callable[[str], bool]] @@ -22,53 +36,106 @@ class Match(NamedTuple): size: int class SequenceMatcher(Generic[_T]): - def __init__(self, isjunk: Optional[Callable[[_T], bool]] = ..., - a: Sequence[_T] = ..., b: Sequence[_T] = ..., - autojunk: bool = ...) -> None: ... + def __init__( + self, isjunk: Optional[Callable[[_T], bool]] = ..., a: Sequence[_T] = ..., b: Sequence[_T] = ..., autojunk: bool = ... + ) -> None: ... def set_seqs(self, a: Sequence[_T], b: Sequence[_T]) -> None: ... def set_seq1(self, a: Sequence[_T]) -> None: ... def set_seq2(self, b: Sequence[_T]) -> None: ... - def find_longest_match(self, alo: int, ahi: int, blo: int, - bhi: int) -> Match: ... + if sys.version_info >= (3, 9): + def find_longest_match( + self, alo: int = ..., ahi: Optional[int] = ..., blo: int = ..., bhi: Optional[int] = ... + ) -> Match: ... + else: + def find_longest_match(self, alo: int, ahi: int, blo: int, bhi: int) -> Match: ... def get_matching_blocks(self) -> List[Match]: ... def get_opcodes(self) -> List[Tuple[str, int, int, int, int]]: ... - def get_grouped_opcodes(self, n: int = ... - ) -> Iterable[List[Tuple[str, int, int, int, int]]]: ... + def get_grouped_opcodes(self, n: int = ...) -> Iterable[List[Tuple[str, int, int, int, int]]]: ... def ratio(self) -> float: ... def quick_ratio(self) -> float: ... def real_quick_ratio(self) -> float: ... + if sys.version_info >= (3, 9): + def __class_getitem__(cls, item: Any) -> GenericAlias: ... -def get_close_matches(word: Sequence[_T], possibilities: Iterable[Sequence[_T]], - n: int = ..., cutoff: float = ...) -> List[Sequence[_T]]: ... +# mypy thinks the signatures of the overloads overlap, but the types still work fine +@overload +def get_close_matches( # type: ignore + word: AnyStr, possibilities: Iterable[AnyStr], n: int = ..., cutoff: float = ... +) -> List[AnyStr]: ... +@overload +def get_close_matches( + word: Sequence[_T], possibilities: Iterable[Sequence[_T]], n: int = ..., cutoff: float = ... +) -> List[Sequence[_T]]: ... class Differ: - def __init__(self, linejunk: _JunkCallback = ..., charjunk: _JunkCallback = ...) -> None: ... + def __init__(self, linejunk: Optional[_JunkCallback] = ..., charjunk: Optional[_JunkCallback] = ...) -> None: ... def compare(self, a: Sequence[_StrType], b: Sequence[_StrType]) -> Iterator[_StrType]: ... -def IS_LINE_JUNK(line: _StrType) -> bool: ... -def IS_CHARACTER_JUNK(line: _StrType) -> bool: ... -def unified_diff(a: Sequence[_StrType], b: Sequence[_StrType], fromfile: _StrType = ..., - tofile: _StrType = ..., fromfiledate: _StrType = ..., tofiledate: _StrType = ..., - n: int = ..., lineterm: _StrType = ...) -> Iterator[_StrType]: ... -def context_diff(a: Sequence[_StrType], b: Sequence[_StrType], fromfile: _StrType = ..., - tofile: _StrType = ..., fromfiledate: _StrType = ..., tofiledate: _StrType = ..., - n: int = ..., lineterm: _StrType = ...) -> Iterator[_StrType]: ... -def ndiff(a: Sequence[_StrType], b: Sequence[_StrType], - linejunk: _JunkCallback = ..., - charjunk: _JunkCallback = ... - ) -> Iterator[_StrType]: ... +def IS_LINE_JUNK(line: _StrType, pat: Any = ...) -> bool: ... # pat is undocumented +def IS_CHARACTER_JUNK(ch: _StrType, ws: _StrType = ...) -> bool: ... # ws is undocumented +def unified_diff( + a: Sequence[_StrType], + b: Sequence[_StrType], + fromfile: _StrType = ..., + tofile: _StrType = ..., + fromfiledate: _StrType = ..., + tofiledate: _StrType = ..., + n: int = ..., + lineterm: _StrType = ..., +) -> Iterator[_StrType]: ... +def context_diff( + a: Sequence[_StrType], + b: Sequence[_StrType], + fromfile: _StrType = ..., + tofile: _StrType = ..., + fromfiledate: _StrType = ..., + tofiledate: _StrType = ..., + n: int = ..., + lineterm: _StrType = ..., +) -> Iterator[_StrType]: ... +def ndiff( + a: Sequence[_StrType], b: Sequence[_StrType], linejunk: Optional[_JunkCallback] = ..., charjunk: Optional[_JunkCallback] = ... +) -> Iterator[_StrType]: ... class HtmlDiff(object): - def __init__(self, tabsize: int = ..., wrapcolumn: int = ..., - linejunk: _JunkCallback = ..., - charjunk: _JunkCallback = ... - ) -> None: ... - def make_file(self, fromlines: Sequence[_StrType], tolines: Sequence[_StrType], - fromdesc: _StrType = ..., todesc: _StrType = ..., context: bool = ..., - numlines: int = ...) -> _StrType: ... - def make_table(self, fromlines: Sequence[_StrType], tolines: Sequence[_StrType], - fromdesc: _StrType = ..., todesc: _StrType = ..., context: bool = ..., - numlines: int = ...) -> _StrType: ... + def __init__( + self, + tabsize: int = ..., + wrapcolumn: Optional[int] = ..., + linejunk: Optional[_JunkCallback] = ..., + charjunk: Optional[_JunkCallback] = ..., + ) -> None: ... + if sys.version_info >= (3, 5): + def make_file( + self, + fromlines: Sequence[_StrType], + tolines: Sequence[_StrType], + fromdesc: _StrType = ..., + todesc: _StrType = ..., + context: bool = ..., + numlines: int = ..., + *, + charset: str = ..., + ) -> _StrType: ... + else: + def make_file( + self, + fromlines: Sequence[_StrType], + tolines: Sequence[_StrType], + fromdesc: _StrType = ..., + todesc: _StrType = ..., + context: bool = ..., + numlines: int = ..., + ) -> _StrType: ... + def make_table( + self, + fromlines: Sequence[_StrType], + tolines: Sequence[_StrType], + fromdesc: _StrType = ..., + todesc: _StrType = ..., + context: bool = ..., + numlines: int = ..., + ) -> _StrType: ... def restore(delta: Iterable[_StrType], which: int) -> Iterator[_StrType]: ... @@ -82,5 +149,5 @@ if sys.version_info >= (3, 5): fromfiledate: bytes = ..., tofiledate: bytes = ..., n: int = ..., - lineterm: bytes = ... + lineterm: bytes = ..., ) -> Iterator[bytes]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/dis.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/dis.pyi old mode 100755 new mode 100644 index 22630a5b..b52d0ed6 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/dis.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/dis.pyi @@ -1,12 +1,20 @@ -from typing import Callable, List, Union, Iterator, Tuple, Optional, Any, IO, NamedTuple, Dict - import sys import types - -from opcode import (hasconst as hasconst, hasname as hasname, hasjrel as hasjrel, - hasjabs as hasjabs, haslocal as haslocal, hascompare as hascompare, - hasfree as hasfree, cmp_op as cmp_op, opname as opname, opmap as opmap, - HAVE_ARGUMENT as HAVE_ARGUMENT, EXTENDED_ARG as EXTENDED_ARG) +from opcode import ( + EXTENDED_ARG as EXTENDED_ARG, + HAVE_ARGUMENT as HAVE_ARGUMENT, + cmp_op as cmp_op, + hascompare as hascompare, + hasconst as hasconst, + hasfree as hasfree, + hasjabs as hasjabs, + hasjrel as hasjrel, + haslocal as haslocal, + hasname as hasname, + opmap as opmap, + opname as opname, +) +from typing import IO, Any, Callable, Dict, Iterator, List, NamedTuple, Optional, Tuple, Union if sys.version_info >= (3, 4): from opcode import stack_effect as stack_effect @@ -19,7 +27,6 @@ if sys.version_info >= (3, 6): _have_code = Union[types.MethodType, types.FunctionType, types.CodeType, type, Callable[..., Any]] _have_code_or_string = Union[_have_code, str, bytes] - if sys.version_info >= (3, 4): class Instruction(NamedTuple): opname: str @@ -30,24 +37,21 @@ if sys.version_info >= (3, 4): offset: int starts_line: Optional[int] is_jump_target: bool - class Bytecode: codeobj: types.CodeType first_line: int - def __init__(self, x: _have_code_or_string, *, first_line: Optional[int] = ..., - current_offset: Optional[int] = ...) -> None: ... + def __init__( + self, x: _have_code_or_string, *, first_line: Optional[int] = ..., current_offset: Optional[int] = ... + ) -> None: ... def __iter__(self) -> Iterator[Instruction]: ... def __repr__(self) -> str: ... def info(self) -> str: ... def dis(self) -> str: ... - @classmethod def from_traceback(cls, tb: types.TracebackType) -> Bytecode: ... - COMPILER_FLAG_NAMES: Dict[int, str] - def findlabels(code: _have_code) -> List[int]: ... def findlinestarts(code: _have_code) -> Iterator[Tuple[int, int]]: ... @@ -55,19 +59,25 @@ if sys.version_info >= (3, 0): def pretty_flags(flags: int) -> str: ... def code_info(x: _have_code_or_string) -> str: ... +if sys.version_info >= (3, 7): + def dis(x: Optional[_have_code_or_string] = ..., *, file: Optional[IO[str]] = ..., depth: Optional[int] = ...) -> None: ... + +elif sys.version_info >= (3, 4): + def dis(x: Optional[_have_code_or_string] = ..., *, file: Optional[IO[str]] = ...) -> None: ... + +else: + def dis(x: _have_code_or_string = ...) -> None: ... + if sys.version_info >= (3, 4): - def dis(x: _have_code_or_string = ..., *, file: Optional[IO[str]] = ...) -> None: ... def distb(tb: Optional[types.TracebackType] = ..., *, file: Optional[IO[str]] = ...) -> None: ... def disassemble(co: _have_code, lasti: int = ..., *, file: Optional[IO[str]] = ...) -> None: ... def disco(co: _have_code, lasti: int = ..., *, file: Optional[IO[str]] = ...) -> None: ... def show_code(co: _have_code, *, file: Optional[IO[str]] = ...) -> None: ... - def get_instructions(x: _have_code, *, first_line: Optional[int] = ...) -> Iterator[Instruction]: ... + else: - def dis(x: _have_code_or_string = ...) -> None: ... def distb(tb: types.TracebackType = ...) -> None: ... def disassemble(co: _have_code, lasti: int = ...) -> None: ... def disco(co: _have_code, lasti: int = ...) -> None: ... - if sys.version_info >= (3, 0): def show_code(co: _have_code) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/archive_util.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/archive_util.pyi deleted file mode 100755 index 12172f3f..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/archive_util.pyi +++ /dev/null @@ -1,12 +0,0 @@ -# Stubs for distutils.archive_util - -from typing import Optional - - -def make_archive(base_name: str, format: str, root_dir: Optional[str] = ..., - base_dir: Optional[str] = ..., verbose: int = ..., - dry_run: int = ...) -> str: ... -def make_tarball(base_name: str, base_dir: str, compress: Optional[str] = ..., - verbose: int = ..., dry_run: int = ...) -> str: ... -def make_zipfile(base_name: str, base_dir: str, verbose: int = ..., - dry_run: int = ...) -> str: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/ccompiler.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/ccompiler.pyi deleted file mode 100755 index 94fad8ba..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/ccompiler.pyi +++ /dev/null @@ -1,119 +0,0 @@ -# Stubs for distutils.ccompiler - -from typing import Any, Callable, List, Optional, Tuple, Union - - -_Macro = Union[Tuple[str], Tuple[str, str]] - - -def gen_lib_options(compiler: CCompiler, library_dirs: List[str], - runtime_library_dirs: List[str], - libraries: List[str]) -> List[str]: ... -def gen_preprocess_options(macros: List[_Macro], - include_dirs: List[str]) -> List[str]: ... -def get_default_compiler(osname: Optional[str] = ..., - platform: Optional[str] = ...) -> str: ... -def new_compiler(plat: Optional[str] = ..., compiler: Optional[str] = ..., - verbose: int = ..., dry_run: int = ..., - force: int = ...) -> CCompiler: ... -def show_compilers() -> None: ... - -class CCompiler: - def __init__(self, verbose: int = ..., dry_run: int = ..., - force: int = ...) -> None: ... - def add_include_dir(self, dir: str) -> None: ... - def set_include_dirs(self, dirs: List[str]) -> None: ... - def add_library(self, libname: str) -> None: ... - def set_libraries(self, libnames: List[str]) -> None: ... - def add_library_dir(self, dir: str) -> None: ... - def set_library_dirs(self, dirs: List[str]) -> None: ... - def add_runtime_library_dir(self, dir: str) -> None: ... - def set_runtime_library_dirs(self, dirs: List[str]) -> None: ... - def define_macro(self, name: str, value: Optional[str] = ...) -> None: ... - def undefine_macro(self, name: str) -> None: ... - def add_link_object(self, object: str) -> None: ... - def set_link_objects(self, objects: List[str]) -> None: ... - def detect_language(self, sources: Union[str, List[str]]) -> Optional[str]: ... - def find_library_file(self, dirs: List[str], lib: str, - debug: bool = ...) -> Optional[str]: ... - def has_function(self, funcname: str, includes: Optional[List[str]] = ..., - include_dirs: Optional[List[str]] = ..., - libraries: Optional[List[str]] = ..., - library_dirs: Optional[List[str]] = ...) -> bool: ... - def library_dir_option(self, dir: str) -> str: ... - def library_option(self, lib: str) -> str: ... - def runtime_library_dir_option(self, dir: str) -> str: ... - def set_executables(self, **args: str) -> None: ... - def compile(self, sources: List[str], output_dir: Optional[str] = ..., - macros: Optional[_Macro] = ..., - include_dirs: Optional[List[str]] = ..., debug: bool = ..., - extra_preargs: Optional[List[str]] = ..., - extra_postargs: Optional[List[str]] = ..., - depends: Optional[List[str]] = ...) -> List[str]: ... - def create_static_lib(self, objects: List[str], output_libname: str, - output_dir: Optional[str] = ..., debug: bool = ..., - target_lang: Optional[str] = ...) -> None: ... - def link(self, target_desc: str, objects: List[str], output_filename: str, - output_dir: Optional[str] = ..., - libraries: Optional[List[str]] = ..., - library_dirs: Optional[List[str]] = ..., - runtime_library_dirs: Optional[List[str]] = ..., - export_symbols: Optional[List[str]] = ..., debug: bool = ..., - extra_preargs: Optional[List[str]] = ..., - extra_postargs: Optional[List[str]] = ..., - build_temp: Optional[str] = ..., - target_lang: Optional[str] = ...) -> None: ... - def link_executable(self, objects: List[str], output_progname: str, - output_dir: Optional[str] = ..., - libraries: Optional[List[str]] = ..., - library_dirs: Optional[List[str]] = ..., - runtime_library_dirs: Optional[List[str]] = ..., - debug: bool = ..., - extra_preargs: Optional[List[str]] = ..., - extra_postargs: Optional[List[str]] = ..., - target_lang: Optional[str] = ...) -> None: ... - def link_shared_lib(self, objects: List[str], output_libname: str, - output_dir: Optional[str] = ..., - libraries: Optional[List[str]] = ..., - library_dirs: Optional[List[str]] = ..., - runtime_library_dirs: Optional[List[str]] = ..., - export_symbols: Optional[List[str]] = ..., - debug: bool = ..., - extra_preargs: Optional[List[str]] = ..., - extra_postargs: Optional[List[str]] = ..., - build_temp: Optional[str] = ..., - target_lang: Optional[str] = ...) -> None: ... - def link_shared_object(self, objects: List[str], output_filename: str, - output_dir: Optional[str] = ..., - libraries: Optional[List[str]] = ..., - library_dirs: Optional[List[str]] = ..., - runtime_library_dirs: Optional[List[str]] = ..., - export_symbols: Optional[List[str]] = ..., - debug: bool = ..., - extra_preargs: Optional[List[str]] = ..., - extra_postargs: Optional[List[str]] = ..., - build_temp: Optional[str] = ..., - target_lang: Optional[str] = ...) -> None: ... - def preprocess(self, source: str, output_file: Optional[str] = ..., - macros: Optional[List[_Macro]] = ..., - include_dirs: Optional[List[str]] = ..., - extra_preargs: Optional[List[str]] = ..., - extra_postargs: Optional[List[str]] = ...) -> None: ... - def executable_filename(self, basename: str, strip_dir: int = ..., - output_dir: str = ...) -> str: ... - def library_filename(self, libname: str, lib_type: str = ..., - strip_dir: int = ..., - output_dir: str = ...) -> str: ... - def object_filenames(self, source_filenames: List[str], - strip_dir: int = ..., - output_dir: str = ...) -> List[str]: ... - def shared_object_filename(self, basename: str, strip_dir: int = ..., - output_dir: str = ...) -> str: ... - def execute(self, func: Callable[..., None], args: Tuple[Any, ...], - msg: Optional[str] = ..., level: int = ...) -> None: ... - def spawn(self, cmd: List[str]) -> None: ... - def mkpath(self, name: str, mode: int = ...) -> None: ... - def move_file(self, src: str, dst: str) -> str: ... - def announce(self, msg: str, level: int = ...) -> None: ... - def warn(self, msg: str) -> None: ... - def debug_print(self, msg: str) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/build_py.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/build_py.pyi deleted file mode 100755 index 34753e4a..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/command/build_py.pyi +++ /dev/null @@ -1,10 +0,0 @@ -from distutils.cmd import Command -import sys - -if sys.version_info >= (3,): - class build_py(Command): - def initialize_options(self) -> None: ... - def finalize_options(self) -> None: ... - def run(self) -> None: ... - - class build_py_2to3(build_py): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/core.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/core.pyi deleted file mode 100755 index 125b7999..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/core.pyi +++ /dev/null @@ -1,50 +0,0 @@ -# Stubs for distutils.core - -from typing import Any, List, Mapping, Optional, Tuple, Type, Union -from distutils.cmd import Command as Command -from distutils.dist import Distribution as Distribution -from distutils.extension import Extension as Extension - -def setup(name: str = ..., - version: str = ..., - description: str = ..., - long_description: str = ..., - author: str = ..., - author_email: str = ..., - maintainer: str = ..., - maintainer_email: str = ..., - url: str = ..., - download_url: str = ..., - packages: List[str] = ..., - py_modules: List[str] = ..., - scripts: List[str] = ..., - ext_modules: List[Extension] = ..., - classifiers: List[str] = ..., - distclass: Type[Distribution] = ..., - script_name: str = ..., - script_args: List[str] = ..., - options: Mapping[str, Any] = ..., - license: str = ..., - keywords: Union[List[str], str] = ..., - platforms: Union[List[str], str] = ..., - cmdclass: Mapping[str, Type[Command]] = ..., - data_files: List[Tuple[str, List[str]]] = ..., - package_dir: Mapping[str, str] = ..., - obsoletes: List[str] = ..., - provides: List[str] = ..., - requires: List[str] = ..., - command_packages: List[str] = ..., - command_options: Mapping[str, Mapping[str, Tuple[Any, Any]]] = ..., - package_data: Mapping[str, List[str]] = ..., - include_package_data: bool = ..., - libraries: List[str] = ..., - headers: List[str] = ..., - ext_package: str = ..., - include_dirs: List[str] = ..., - password: str = ..., - fullname: str = ..., - **attrs: Any) -> None: ... - -def run_setup(script_name: str, - script_args: Optional[List[str]] = ..., - stop_after: str = ...) -> Distribution: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/debug.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/debug.pyi deleted file mode 100755 index 76de4477..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/debug.pyi +++ /dev/null @@ -1,3 +0,0 @@ -# Stubs for distutils.debug - -DEBUG: bool diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/dir_util.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/dir_util.pyi deleted file mode 100755 index 667ac2fe..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/dir_util.pyi +++ /dev/null @@ -1,15 +0,0 @@ -# Stubs for distutils.dir_util - -from typing import List - - -def mkpath(name: str, mode: int = ..., verbose: int = ..., - dry_run: int = ...) -> List[str]: ... -def create_tree(base_dir: str, files: List[str], mode: int = ..., - verbose: int = ..., dry_run: int = ...) -> None: ... -def copy_tree(src: str, dst: str, preserve_mode: int = ..., - preserve_times: int = ..., preserve_symlinks: int = ..., - update: int = ..., verbose: int = ..., - dry_run: int = ...) -> List[str]: ... -def remove_tree(directory: str, verbose: int = ..., - dry_run: int = ...) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/extension.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/extension.pyi deleted file mode 100755 index 5aa070e4..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/extension.pyi +++ /dev/null @@ -1,39 +0,0 @@ -# Stubs for distutils.extension - -from typing import List, Optional, Tuple -import sys - -class Extension: - if sys.version_info >= (3,): - def __init__(self, - name: str, - sources: List[str], - include_dirs: List[str] = ..., - define_macros: List[Tuple[str, Optional[str]]] = ..., - undef_macros: List[str] = ..., - library_dirs: List[str] = ..., - libraries: List[str] = ..., - runtime_library_dirs: List[str] = ..., - extra_objects: List[str] = ..., - extra_compile_args: List[str] = ..., - extra_link_args: List[str] = ..., - export_symbols: List[str] = ..., - depends: List[str] = ..., - language: str = ..., - optional: bool = ...) -> None: ... - else: - def __init__(self, - name: str, - sources: List[str], - include_dirs: List[str] = ..., - define_macros: List[Tuple[str, Optional[str]]] = ..., - undef_macros: List[str] = ..., - library_dirs: List[str] = ..., - libraries: List[str] = ..., - runtime_library_dirs: List[str] = ..., - extra_objects: List[str] = ..., - extra_compile_args: List[str] = ..., - extra_link_args: List[str] = ..., - export_symbols: List[str] = ..., - depends: List[str] = ..., - language: str = ...) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/file_util.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/file_util.pyi deleted file mode 100755 index 6324d63d..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/file_util.pyi +++ /dev/null @@ -1,12 +0,0 @@ -# Stubs for distutils.file_util - -from typing import Optional, Sequence, Tuple - - -def copy_file(src: str, dst: str, preserve_mode: bool = ..., - preserve_times: bool = ..., update: bool = ..., - link: Optional[str] = ..., verbose: bool = ..., - dry_run: bool = ...) -> Tuple[str, str]: ... -def move_file(src: str, dst: str, verbose: bool = ..., - dry_run: bool = ...) -> str: ... -def write_file(filename: str, contents: Sequence[str]) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/filelist.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/filelist.pyi deleted file mode 100755 index 4ecaebaf..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/filelist.pyi +++ /dev/null @@ -1,3 +0,0 @@ -# Stubs for distutils.filelist - -class FileList: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/spawn.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/spawn.pyi deleted file mode 100755 index 8df9ebab..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/spawn.pyi +++ /dev/null @@ -1,8 +0,0 @@ -# Stubs for distutils.spawn - -from typing import List, Optional - -def spawn(cmd: List[str], search_path: bool = ..., - verbose: bool = ..., dry_run: bool = ...) -> None: ... -def find_executable(executable: str, - path: Optional[str] = ...) -> Optional[str]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/text_file.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/text_file.pyi deleted file mode 100755 index 8f90d41d..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/text_file.pyi +++ /dev/null @@ -1,18 +0,0 @@ -# Stubs for distutils.text_file - -from typing import IO, List, Optional, Tuple, Union - -class TextFile: - def __init__(self, filename: Optional[str] = ..., - file: Optional[IO[str]] = ..., - *, strip_comments: bool = ..., - lstrip_ws: bool = ..., rstrip_ws: bool = ..., - skip_blanks: bool = ..., join_lines: bool = ..., - collapse_join: bool = ...) -> None: ... - def open(self, filename: str) -> None: ... - def close(self) -> None: ... - def warn(self, msg: str, - line: Union[List[int], Tuple[int, int], int] = ...) -> None: ... - def readline(self) -> Optional[str]: ... - def readlines(self) -> List[str]: ... - def unreadline(self, line: str) -> str: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/util.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/util.pyi deleted file mode 100755 index 942886d7..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/util.pyi +++ /dev/null @@ -1,20 +0,0 @@ -# Stubs for distutils.util - -from typing import Any, Callable, List, Mapping, Optional, Tuple - - -def get_platform() -> str: ... -def convert_path(pathname: str) -> str: ... -def change_root(new_root: str, pathname: str) -> str: ... -def check_environ() -> None: ... -def subst_vars(s: str, local_vars: Mapping[str, str]) -> None: ... -def split_quoted(s: str) -> List[str]: ... -def execute(func: Callable[..., None], args: Tuple[Any, ...], - msg: Optional[str] = ..., verbose: bool = ..., - dry_run: bool = ...) -> None: ... -def strtobool(val: str) -> bool: ... -def byte_compile(py_files: List[str], optimize: int = ..., force: bool = ..., - prefix: Optional[str] = ..., base_dir: Optional[str] = ..., - verbose: bool = ..., dry_run: bool = ..., - direct: Optional[bool] = ...) -> None: ... -def rfc822_escape(header: str) -> str: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/version.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/version.pyi deleted file mode 100755 index 36ee4b84..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/distutils/version.pyi +++ /dev/null @@ -1,54 +0,0 @@ -import sys -from abc import abstractmethod -from typing import Any, Optional, TypeVar, Union, Pattern, Text, Tuple - -_T = TypeVar('_T', bound=Version) - -class Version: - def __repr__(self) -> str: ... - - if sys.version_info >= (3,): - def __eq__(self, other: object) -> bool: ... - def __lt__(self: _T, other: Union[_T, str]) -> bool: ... - def __le__(self: _T, other: Union[_T, str]) -> bool: ... - def __gt__(self: _T, other: Union[_T, str]) -> bool: ... - def __ge__(self: _T, other: Union[_T, str]) -> bool: ... - - @abstractmethod - def __init__(self, vstring: Optional[Text] = ...) -> None: ... - @abstractmethod - def parse(self: _T, vstring: Text) -> _T: ... - @abstractmethod - def __str__(self) -> str: ... - if sys.version_info >= (3,): - @abstractmethod - def _cmp(self: _T, other: Union[_T, str]) -> bool: ... - else: - @abstractmethod - def __cmp__(self: _T, other: Union[_T, str]) -> bool: ... - -class StrictVersion(Version): - version_re: Pattern[str] - version: Tuple[int, int, int] - prerelease: Optional[Tuple[Text, int]] - - def __init__(self, vstring: Optional[Text] = ...) -> None: ... - def parse(self: _T, vstring: Text) -> _T: ... - def __str__(self) -> str: ... - if sys.version_info >= (3,): - def _cmp(self: _T, other: Union[_T, str]) -> bool: ... - else: - def __cmp__(self: _T, other: Union[_T, str]) -> bool: ... - -class LooseVersion(Version): - component_re: Pattern[str] - vstring: Text - version: Tuple[Union[Text, int], ...] - - def __init__(self, vstring: Optional[Text] = ...) -> None: ... - def parse(self: _T, vstring: Text) -> _T: ... - def __str__(self) -> str: ... - if sys.version_info >= (3,): - def _cmp(self: _T, other: Union[_T, str]) -> bool: ... - else: - def __cmp__(self: _T, other: Union[_T, str]) -> bool: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/doctest.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/doctest.pyi old mode 100755 new mode 100644 index 54a8c874..ae84c2c2 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/doctest.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/doctest.pyi @@ -1,15 +1,16 @@ -from typing import Any, Callable, Dict, List, NamedTuple, Optional, Tuple, Type, Union - import sys import types import unittest +from typing import Any, Callable, Dict, List, NamedTuple, Optional, Tuple, Type, Union class TestResults(NamedTuple): failed: int attempted: int OPTIONFLAGS_BY_NAME: Dict[str, int] + def register_optionflag(name: str) -> int: ... + DONT_ACCEPT_TRUE_FOR_1: int DONT_ACCEPT_BLANKLINE: int NORMALIZE_WHITESPACE: int @@ -38,8 +39,15 @@ class Example: lineno: int indent: int options: Dict[int, bool] - def __init__(self, source: str, want: str, exc_msg: Optional[str] = ..., lineno: int = ..., indent: int = ..., - options: Optional[Dict[int, bool]] = ...) -> None: ... + def __init__( + self, + source: str, + want: str, + exc_msg: Optional[str] = ..., + lineno: int = ..., + indent: int = ..., + options: Optional[Dict[int, bool]] = ..., + ) -> None: ... def __hash__(self) -> int: ... class DocTest: @@ -49,20 +57,37 @@ class DocTest: filename: Optional[str] lineno: Optional[int] docstring: Optional[str] - def __init__(self, examples: List[Example], globs: Dict[str, Any], name: str, filename: Optional[str], lineno: Optional[int], docstring: Optional[str]) -> None: ... + def __init__( + self, + examples: List[Example], + globs: Dict[str, Any], + name: str, + filename: Optional[str], + lineno: Optional[int], + docstring: Optional[str], + ) -> None: ... def __hash__(self) -> int: ... def __lt__(self, other: DocTest) -> bool: ... class DocTestParser: def parse(self, string: str, name: str = ...) -> List[Union[str, Example]]: ... - def get_doctest(self, string: str, globs: Dict[str, Any], name: str, filename: Optional[str], lineno: Optional[int]) -> DocTest: ... + def get_doctest( + self, string: str, globs: Dict[str, Any], name: str, filename: Optional[str], lineno: Optional[int] + ) -> DocTest: ... def get_examples(self, string: str, name: str = ...) -> List[Example]: ... class DocTestFinder: - def __init__(self, verbose: bool = ..., parser: DocTestParser = ..., - recurse: bool = ..., exclude_empty: bool = ...) -> None: ... - def find(self, obj: object, name: Optional[str] = ..., module: Union[None, bool, types.ModuleType] = ..., - globs: Optional[Dict[str, Any]] = ..., extraglobs: Optional[Dict[str, Any]] = ...) -> List[DocTest]: ... + def __init__( + self, verbose: bool = ..., parser: DocTestParser = ..., recurse: bool = ..., exclude_empty: bool = ... + ) -> None: ... + def find( + self, + obj: object, + name: Optional[str] = ..., + module: Union[None, bool, types.ModuleType] = ..., + globs: Optional[Dict[str, Any]] = ..., + extraglobs: Optional[Dict[str, Any]] = ..., + ) -> List[DocTest]: ... _Out = Callable[[str], Any] _ExcInfo = Tuple[Type[BaseException], BaseException, types.TracebackType] @@ -74,13 +99,14 @@ class DocTestRunner: tries: int failures: int test: DocTest - def __init__(self, checker: Optional[OutputChecker] = ..., verbose: Optional[bool] = ..., optionflags: int = ...) -> None: ... def report_start(self, out: _Out, test: DocTest, example: Example) -> None: ... def report_success(self, out: _Out, test: DocTest, example: Example, got: str) -> None: ... def report_failure(self, out: _Out, test: DocTest, example: Example, got: str) -> None: ... def report_unexpected_exception(self, out: _Out, test: DocTest, example: Example, exc_info: _ExcInfo) -> None: ... - def run(self, test: DocTest, compileflags: Optional[int] = ..., out: Optional[_Out] = ..., clear_globs: bool = ...) -> TestResults: ... + def run( + self, test: DocTest, compileflags: Optional[int] = ..., out: Optional[_Out] = ..., clear_globs: bool = ... + ) -> TestResults: ... def summarize(self, verbose: Optional[bool] = ...) -> TestResults: ... def merge(self, other: DocTestRunner) -> None: ... @@ -92,35 +118,62 @@ class DocTestFailure(Exception): test: DocTest example: Example got: str - def __init__(self, test: DocTest, example: Example, got: str) -> None: ... class UnexpectedException(Exception): test: DocTest example: Example exc_info: _ExcInfo - def __init__(self, test: DocTest, example: Example, exc_info: _ExcInfo) -> None: ... class DebugRunner(DocTestRunner): ... master: Optional[DocTestRunner] -def testmod(m: Optional[types.ModuleType] = ..., name: Optional[str] = ..., globs: Dict[str, Any] = ..., verbose: Optional[bool] = ..., - report: bool = ..., optionflags: int = ..., extraglobs: Dict[str, Any] = ..., - raise_on_error: bool = ..., exclude_empty: bool = ...) -> TestResults: ... -def testfile(filename: str, module_relative: bool = ..., name: Optional[str] = ..., package: Union[None, str, types.ModuleType] = ..., - globs: Optional[Dict[str, Any]] = ..., verbose: Optional[bool] = ..., report: bool = ..., optionflags: int = ..., - extraglobs: Optional[Dict[str, Any]] = ..., raise_on_error: bool = ..., parser: DocTestParser = ..., - encoding: Optional[str] = ...) -> TestResults: ... -def run_docstring_examples(f: object, globs: Dict[str, Any], verbose: bool = ..., name: str = ..., - compileflags: Optional[int] = ..., optionflags: int = ...) -> None: ... +def testmod( + m: Optional[types.ModuleType] = ..., + name: Optional[str] = ..., + globs: Optional[Dict[str, Any]] = ..., + verbose: Optional[bool] = ..., + report: bool = ..., + optionflags: int = ..., + extraglobs: Optional[Dict[str, Any]] = ..., + raise_on_error: bool = ..., + exclude_empty: bool = ..., +) -> TestResults: ... +def testfile( + filename: str, + module_relative: bool = ..., + name: Optional[str] = ..., + package: Union[None, str, types.ModuleType] = ..., + globs: Optional[Dict[str, Any]] = ..., + verbose: Optional[bool] = ..., + report: bool = ..., + optionflags: int = ..., + extraglobs: Optional[Dict[str, Any]] = ..., + raise_on_error: bool = ..., + parser: DocTestParser = ..., + encoding: Optional[str] = ..., +) -> TestResults: ... +def run_docstring_examples( + f: object, + globs: Dict[str, Any], + verbose: bool = ..., + name: str = ..., + compileflags: Optional[int] = ..., + optionflags: int = ..., +) -> None: ... def set_unittest_reportflags(flags: int) -> int: ... class DocTestCase(unittest.TestCase): - def __init__(self, test: DocTest, optionflags: int = ..., setUp: Optional[Callable[[DocTest], Any]] = ..., - tearDown: Optional[Callable[[DocTest], Any]] = ..., - checker: Optional[OutputChecker] = ...) -> None: ... + def __init__( + self, + test: DocTest, + optionflags: int = ..., + setUp: Optional[Callable[[DocTest], Any]] = ..., + tearDown: Optional[Callable[[DocTest], Any]] = ..., + checker: Optional[OutputChecker] = ..., + ) -> None: ... def setUp(self) -> None: ... def tearDown(self) -> None: ... def runTest(self) -> None: ... @@ -138,20 +191,31 @@ class SkipDocTestCase(DocTestCase): if sys.version_info >= (3, 4): class _DocTestSuite(unittest.TestSuite): ... + else: _DocTestSuite = unittest.TestSuite -def DocTestSuite(module: Union[None, str, types.ModuleType] = ..., globs: Optional[Dict[str, Any]] = ..., - extraglobs: Optional[Dict[str, Any]] = ..., test_finder: Optional[DocTestFinder] = ..., - **options: Any) -> _DocTestSuite: ... +def DocTestSuite( + module: Union[None, str, types.ModuleType] = ..., + globs: Optional[Dict[str, Any]] = ..., + extraglobs: Optional[Dict[str, Any]] = ..., + test_finder: Optional[DocTestFinder] = ..., + **options: Any, +) -> _DocTestSuite: ... class DocFileCase(DocTestCase): def id(self) -> str: ... def format_failure(self, err: str) -> str: ... -def DocFileTest(path: str, module_relative: bool = ..., package: Union[None, str, types.ModuleType] = ..., - globs: Optional[Dict[str, Any]] = ..., parser: DocTestParser = ..., - encoding: Optional[str] = ..., **options: Any) -> DocFileCase: ... +def DocFileTest( + path: str, + module_relative: bool = ..., + package: Union[None, str, types.ModuleType] = ..., + globs: Optional[Dict[str, Any]] = ..., + parser: DocTestParser = ..., + encoding: Optional[str] = ..., + **options: Any, +) -> DocFileCase: ... def DocFileSuite(*paths: str, **kw: Any) -> _DocTestSuite: ... def script_from_examples(s: str) -> str: ... def testsource(module: Union[None, str, types.ModuleType], name: str) -> str: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/dummy_threading.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/dummy_threading.pyi new file mode 100644 index 00000000..757cb8d4 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/dummy_threading.pyi @@ -0,0 +1,2 @@ +from _dummy_threading import * +from _dummy_threading import __all__ as __all__ diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/ensurepip/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/ensurepip/__init__.pyi old mode 100755 new mode 100644 index 10634f2b..a411dbb4 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/ensurepip/__init__.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/ensurepip/__init__.pyi @@ -1,10 +1,25 @@ - -from typing import Optional import sys - +from typing import Optional def version() -> str: ... + if sys.version_info >= (3, 0): - def bootstrap(*, root: Optional[str] = ..., upgrade: bool = ..., user: bool = ..., altinstall: bool = ..., default_pip: bool = ..., verbosity: int = ...) -> None: ... + def bootstrap( + *, + root: Optional[str] = ..., + upgrade: bool = ..., + user: bool = ..., + altinstall: bool = ..., + default_pip: bool = ..., + verbosity: int = ..., + ) -> None: ... + else: - def bootstrap(root: Optional[str] = ..., upgrade: bool = ..., user: bool = ..., altinstall: bool = ..., default_pip: bool = ..., verbosity: int = ...) -> None: ... + def bootstrap( + root: Optional[str] = ..., + upgrade: bool = ..., + user: bool = ..., + altinstall: bool = ..., + default_pip: bool = ..., + verbosity: int = ..., + ) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/errno.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/errno.pyi old mode 100755 new mode 100644 index 731681f1..b053604f --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/errno.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/errno.pyi @@ -1,7 +1,4 @@ -# Stubs for errno - from typing import Mapping -import sys errorcode: Mapping[int, str] diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/filecmp.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/filecmp.pyi old mode 100755 new mode 100644 index 57a88466..b05eebac --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/filecmp.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/filecmp.pyi @@ -1,23 +1,48 @@ -# Stubs for filecmp (Python 2/3) import sys -from typing import AnyStr, Callable, Dict, Generic, Iterable, List, Optional, Sequence, Tuple, Union, Text +from typing import Any, AnyStr, Callable, Dict, Generic, Iterable, List, Optional, Sequence, Text, Tuple, Union + +if sys.version_info >= (3, 6): + from os import PathLike + +if sys.version_info >= (3, 9): + from types import GenericAlias DEFAULT_IGNORES: List[str] -def cmp(f1: Union[bytes, Text], f2: Union[bytes, Text], shallow: Union[int, bool] = ...) -> bool: ... -def cmpfiles(a: AnyStr, b: AnyStr, common: Iterable[AnyStr], - shallow: Union[int, bool] = ...) -> Tuple[List[AnyStr], List[AnyStr], List[AnyStr]]: ... +if sys.version_info >= (3, 6): + def cmp( + f1: Union[bytes, Text, PathLike[AnyStr]], f2: Union[bytes, Text, PathLike[AnyStr]], shallow: Union[int, bool] = ... + ) -> bool: ... + def cmpfiles( + a: Union[AnyStr, PathLike[AnyStr]], + b: Union[AnyStr, PathLike[AnyStr]], + common: Iterable[AnyStr], + shallow: Union[int, bool] = ..., + ) -> Tuple[List[AnyStr], List[AnyStr], List[AnyStr]]: ... -class dircmp(Generic[AnyStr]): - def __init__(self, a: AnyStr, b: AnyStr, - ignore: Optional[Sequence[AnyStr]] = ..., - hide: Optional[Sequence[AnyStr]] = ...) -> None: ... +else: + def cmp(f1: Union[bytes, Text], f2: Union[bytes, Text], shallow: Union[int, bool] = ...) -> bool: ... + def cmpfiles( + a: AnyStr, b: AnyStr, common: Iterable[AnyStr], shallow: Union[int, bool] = ... + ) -> Tuple[List[AnyStr], List[AnyStr], List[AnyStr]]: ... +class dircmp(Generic[AnyStr]): + if sys.version_info >= (3, 6): + def __init__( + self, + a: Union[AnyStr, PathLike[AnyStr]], + b: Union[AnyStr, PathLike[AnyStr]], + ignore: Optional[Sequence[AnyStr]] = ..., + hide: Optional[Sequence[AnyStr]] = ..., + ) -> None: ... + else: + def __init__( + self, a: AnyStr, b: AnyStr, ignore: Optional[Sequence[AnyStr]] = ..., hide: Optional[Sequence[AnyStr]] = ... + ) -> None: ... left: AnyStr right: AnyStr hide: Sequence[AnyStr] ignore: Sequence[AnyStr] - # These properties are created at runtime by __getattr__ subdirs: Dict[AnyStr, dircmp[AnyStr]] same_files: List[AnyStr] @@ -31,11 +56,9 @@ class dircmp(Generic[AnyStr]): right_only: List[AnyStr] left_list: List[AnyStr] right_list: List[AnyStr] - def report(self) -> None: ... def report_partial_closure(self) -> None: ... def report_full_closure(self) -> None: ... - methodmap: Dict[str, Callable[[], None]] def phase0(self) -> None: ... def phase1(self) -> None: ... @@ -43,6 +66,8 @@ class dircmp(Generic[AnyStr]): def phase3(self) -> None: ... def phase4(self) -> None: ... def phase4_closure(self) -> None: ... + if sys.version_info >= (3, 9): + def __class_getitem__(cls, item: Any) -> GenericAlias: ... if sys.version_info >= (3,): def clear_cache() -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/fileinput.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/fileinput.pyi old mode 100755 new mode 100644 index e5c20e52..fbb602b3 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/fileinput.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/fileinput.pyi @@ -1,30 +1,25 @@ -from typing import Iterable, Callable, IO, AnyStr, Generic, Any, Text, Union, Iterator, Optional - -import os import sys - -if sys.version_info >= (3, 6): - _Path = Union[Text, bytes, os.PathLike[Any]] -else: - _Path = Union[Text, bytes] +from _typeshed import AnyPath +from typing import IO, Any, AnyStr, Callable, Generic, Iterable, Iterator, Optional, Union if sys.version_info >= (3, 8): def input( - files: Union[_Path, Iterable[_Path], None] = ..., + files: Union[AnyPath, Iterable[AnyPath], None] = ..., inplace: bool = ..., backup: str = ..., *, mode: str = ..., - openhook: Callable[[_Path, str], IO[AnyStr]] = ..., + openhook: Callable[[AnyPath, str], IO[AnyStr]] = ..., ) -> FileInput[AnyStr]: ... + else: def input( - files: Union[_Path, Iterable[_Path], None] = ..., + files: Union[AnyPath, Iterable[AnyPath], None] = ..., inplace: bool = ..., backup: str = ..., bufsize: int = ..., mode: str = ..., - openhook: Callable[[_Path, str], IO[AnyStr]] = ..., + openhook: Callable[[AnyPath, str], IO[AnyStr]] = ..., ) -> FileInput[AnyStr]: ... def close() -> None: ... @@ -40,24 +35,23 @@ class FileInput(Iterable[AnyStr], Generic[AnyStr]): if sys.version_info >= (3, 8): def __init__( self, - files: Union[None, _Path, Iterable[_Path]] = ..., + files: Union[None, AnyPath, Iterable[AnyPath]] = ..., inplace: bool = ..., backup: str = ..., *, mode: str = ..., - openhook: Callable[[_Path, str], IO[AnyStr]] = ... + openhook: Callable[[AnyPath, str], IO[AnyStr]] = ..., ) -> None: ... else: def __init__( self, - files: Union[None, _Path, Iterable[_Path]] = ..., + files: Union[None, AnyPath, Iterable[AnyPath]] = ..., inplace: bool = ..., backup: str = ..., bufsize: int = ..., mode: str = ..., - openhook: Callable[[_Path, str], IO[AnyStr]] = ... + openhook: Callable[[AnyPath, str], IO[AnyStr]] = ..., ) -> None: ... - def __del__(self) -> None: ... def close(self) -> None: ... if sys.version_info >= (3, 2): @@ -75,8 +69,10 @@ class FileInput(Iterable[AnyStr], Generic[AnyStr]): def isfirstline(self) -> bool: ... def isstdin(self) -> bool: ... -def hook_compressed(filename: _Path, mode: str) -> IO[Any]: ... +def hook_compressed(filename: AnyPath, mode: str) -> IO[Any]: ... + if sys.version_info >= (3, 6): - def hook_encoded(encoding: str, errors: Optional[str] = ...) -> Callable[[_Path, str], IO[Any]]: ... + def hook_encoded(encoding: str, errors: Optional[str] = ...) -> Callable[[AnyPath, str], IO[Any]]: ... + else: - def hook_encoded(encoding: str) -> Callable[[_Path, str], IO[Any]]: ... + def hook_encoded(encoding: str) -> Callable[[AnyPath, str], IO[Any]]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/formatter.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/formatter.pyi old mode 100755 new mode 100644 index bda4c790..31c45592 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/formatter.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/formatter.pyi @@ -1,6 +1,4 @@ -# Source: https://hg.python.org/cpython/file/2.7/Lib/formatter.py -# and https://github.com/python/cpython/blob/master/Lib/formatter.py -from typing import Any, IO, List, Optional, Tuple +from typing import IO, Any, Iterable, List, Optional, Tuple AS_IS: None _FontType = Tuple[str, bool, bool, bool] @@ -11,8 +9,8 @@ class NullFormatter: def __init__(self, writer: Optional[NullWriter] = ...) -> None: ... def end_paragraph(self, blankline: int) -> None: ... def add_line_break(self) -> None: ... - def add_hor_rule(self, *args, **kw) -> None: ... - def add_label_data(self, format, counter: int, blankline: Optional[int] = ...) -> None: ... + def add_hor_rule(self, *args: Any, **kw: Any) -> None: ... + def add_label_data(self, format: str, counter: int, blankline: Optional[int] = ...) -> None: ... def add_flowing_data(self, data: str) -> None: ... def add_literal_data(self, data: str) -> None: ... def flush_softspace(self) -> None: ... @@ -44,9 +42,9 @@ class AbstractFormatter: def __init__(self, writer: NullWriter) -> None: ... def end_paragraph(self, blankline: int) -> None: ... def add_line_break(self) -> None: ... - def add_hor_rule(self, *args, **kw) -> None: ... - def add_label_data(self, format, counter: int, blankline: Optional[int] = ...) -> None: ... - def format_counter(self, format, counter: int) -> str: ... + def add_hor_rule(self, *args: Any, **kw: Any) -> None: ... + def add_label_data(self, format: str, counter: int, blankline: Optional[int] = ...) -> None: ... + def format_counter(self, format: Iterable[str], counter: int) -> str: ... def format_letter(self, case: str, counter: int) -> str: ... def format_roman(self, case: str, counter: int) -> str: ... def add_flowing_data(self, data: str) -> None: ... @@ -70,10 +68,10 @@ class NullWriter: def new_font(self, font: _FontType) -> None: ... def new_margin(self, margin: int, level: int) -> None: ... def new_spacing(self, spacing: Optional[str]) -> None: ... - def new_styles(self, styles) -> None: ... + def new_styles(self, styles: Tuple[Any, ...]) -> None: ... def send_paragraph(self, blankline: int) -> None: ... def send_line_break(self) -> None: ... - def send_hor_rule(self, *args, **kw) -> None: ... + def send_hor_rule(self, *args: Any, **kw: Any) -> None: ... def send_label_data(self, data: str) -> None: ... def send_flowing_data(self, data: str) -> None: ... def send_literal_data(self, data: str) -> None: ... @@ -83,10 +81,10 @@ class AbstractWriter(NullWriter): def new_font(self, font: _FontType) -> None: ... def new_margin(self, margin: int, level: int) -> None: ... def new_spacing(self, spacing: Optional[str]) -> None: ... - def new_styles(self, styles) -> None: ... + def new_styles(self, styles: Tuple[Any, ...]) -> None: ... def send_paragraph(self, blankline: int) -> None: ... def send_line_break(self) -> None: ... - def send_hor_rule(self, *args, **kw) -> None: ... + def send_hor_rule(self, *args: Any, **kw: Any) -> None: ... def send_label_data(self, data: str) -> None: ... def send_flowing_data(self, data: str) -> None: ... def send_literal_data(self, data: str) -> None: ... @@ -98,7 +96,7 @@ class DumbWriter(NullWriter): def reset(self) -> None: ... def send_paragraph(self, blankline: int) -> None: ... def send_line_break(self) -> None: ... - def send_hor_rule(self, *args, **kw) -> None: ... + def send_hor_rule(self, *args: Any, **kw: Any) -> None: ... def send_literal_data(self, data: str) -> None: ... def send_flowing_data(self, data: str) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/fractions.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/fractions.pyi old mode 100755 new mode 100644 index ce3f89f8..dd9c77ed --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/fractions.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/fractions.pyi @@ -1,74 +1,134 @@ -# Stubs for fractions -# See https://docs.python.org/3/library/fractions.html -# -# Note: these stubs are incomplete. The more complex type -# signatures are currently omitted. Also see numbers.pyi. - -from typing import Optional, TypeVar, Union, overload, Any, Tuple -from numbers import Real, Integral, Rational -from decimal import Decimal import sys +from decimal import Decimal +from numbers import Integral, Rational, Real +from typing import Optional, Tuple, Union, overload +from typing_extensions import Literal _ComparableNum = Union[int, float, Decimal, Real] - -@overload -def gcd(a: int, b: int) -> int: ... -@overload -def gcd(a: Integral, b: int) -> Integral: ... -@overload -def gcd(a: int, b: Integral) -> Integral: ... -@overload -def gcd(a: Integral, b: Integral) -> Integral: ... - - -class Fraction(Rational): +if sys.version_info < (3, 9): @overload - def __init__(self, - numerator: Union[int, Rational] = ..., - denominator: Optional[Union[int, Rational]] = ..., - *, - _normalize: bool = ...) -> None: ... + def gcd(a: int, b: int) -> int: ... @overload - def __init__(self, value: float, *, _normalize: bool = ...) -> None: ... + def gcd(a: Integral, b: int) -> Integral: ... @overload - def __init__(self, value: Decimal, *, _normalize: bool = ...) -> None: ... + def gcd(a: int, b: Integral) -> Integral: ... @overload - def __init__(self, value: str, *, _normalize: bool = ...) -> None: ... + def gcd(a: Integral, b: Integral) -> Integral: ... +class Fraction(Rational): + @overload + def __new__( + cls, numerator: Union[int, Rational] = ..., denominator: Optional[Union[int, Rational]] = ..., *, _normalize: bool = ... + ) -> Fraction: ... + @overload + def __new__(cls, __value: Union[float, Decimal, str], *, _normalize: bool = ...) -> Fraction: ... @classmethod def from_float(cls, f: float) -> Fraction: ... @classmethod def from_decimal(cls, dec: Decimal) -> Fraction: ... def limit_denominator(self, max_denominator: int = ...) -> Fraction: ... - if sys.version_info >= (3, 8): def as_integer_ratio(self) -> Tuple[int, int]: ... @property def numerator(self) -> int: ... @property def denominator(self) -> int: ... - - def __add__(self, other): ... - def __radd__(self, other): ... - def __sub__(self, other): ... - def __rsub__(self, other): ... - def __mul__(self, other): ... - def __rmul__(self, other): ... - def __truediv__(self, other): ... - def __rtruediv__(self, other): ... + @overload + def __add__(self, other: Union[int, Fraction]) -> Fraction: ... + @overload + def __add__(self, other: float) -> float: ... + @overload + def __add__(self, other: complex) -> complex: ... + @overload + def __radd__(self, other: Union[int, Fraction]) -> Fraction: ... + @overload + def __radd__(self, other: float) -> float: ... + @overload + def __radd__(self, other: complex) -> complex: ... + @overload + def __sub__(self, other: Union[int, Fraction]) -> Fraction: ... + @overload + def __sub__(self, other: float) -> float: ... + @overload + def __sub__(self, other: complex) -> complex: ... + @overload + def __rsub__(self, other: Union[int, Fraction]) -> Fraction: ... + @overload + def __rsub__(self, other: float) -> float: ... + @overload + def __rsub__(self, other: complex) -> complex: ... + @overload + def __mul__(self, other: Union[int, Fraction]) -> Fraction: ... + @overload + def __mul__(self, other: float) -> float: ... + @overload + def __mul__(self, other: complex) -> complex: ... + @overload + def __rmul__(self, other: Union[int, Fraction]) -> Fraction: ... + @overload + def __rmul__(self, other: float) -> float: ... + @overload + def __rmul__(self, other: complex) -> complex: ... + @overload + def __truediv__(self, other: Union[int, Fraction]) -> Fraction: ... + @overload + def __truediv__(self, other: float) -> float: ... + @overload + def __truediv__(self, other: complex) -> complex: ... + @overload + def __rtruediv__(self, other: Union[int, Fraction]) -> Fraction: ... + @overload + def __rtruediv__(self, other: float) -> float: ... + @overload + def __rtruediv__(self, other: complex) -> complex: ... if sys.version_info < (3, 0): - def __div__(self, other): ... - def __rdiv__(self, other): ... - def __floordiv__(self, other) -> int: ... - def __rfloordiv__(self, other) -> int: ... - def __mod__(self, other): ... - def __rmod__(self, other): ... - def __divmod__(self, other): ... - def __rdivmod__(self, other): ... - def __pow__(self, other): ... - def __rpow__(self, other): ... - + @overload + def __div__(self, other: Union[int, Fraction]) -> Fraction: ... + @overload + def __div__(self, other: float) -> float: ... + @overload + def __div__(self, other: complex) -> complex: ... + @overload + def __rdiv__(self, other: Union[int, Fraction]) -> Fraction: ... + @overload + def __rdiv__(self, other: float) -> float: ... + @overload + def __rdiv__(self, other: complex) -> complex: ... + @overload + def __floordiv__(self, other: Union[int, Fraction]) -> int: ... + @overload + def __floordiv__(self, other: float) -> float: ... + @overload + def __rfloordiv__(self, other: Union[int, Fraction]) -> int: ... + @overload + def __rfloordiv__(self, other: float) -> float: ... + @overload + def __mod__(self, other: Union[int, Fraction]) -> Fraction: ... + @overload + def __mod__(self, other: float) -> float: ... + @overload + def __rmod__(self, other: Union[int, Fraction]) -> Fraction: ... + @overload + def __rmod__(self, other: float) -> float: ... + @overload + def __divmod__(self, other: Union[int, Fraction]) -> Tuple[int, Fraction]: ... + @overload + def __divmod__(self, other: float) -> Tuple[float, Fraction]: ... + @overload + def __rdivmod__(self, other: Union[int, Fraction]) -> Tuple[int, Fraction]: ... + @overload + def __rdivmod__(self, other: float) -> Tuple[float, Fraction]: ... + @overload + def __pow__(self, other: int) -> Fraction: ... + @overload + def __pow__(self, other: Union[float, Fraction]) -> float: ... + @overload + def __pow__(self, other: complex) -> complex: ... + @overload + def __rpow__(self, other: Union[int, float, Fraction]) -> float: ... + @overload + def __rpow__(self, other: complex) -> complex: ... def __pos__(self) -> Fraction: ... def __neg__(self) -> Fraction: ... def __abs__(self) -> Fraction: ... @@ -76,8 +136,10 @@ class Fraction(Rational): if sys.version_info >= (3, 0): def __floor__(self) -> int: ... def __ceil__(self) -> int: ... - def __round__(self, ndigits: Optional[Any] = ...): ... - + @overload + def __round__(self, ndigits: None = ...) -> int: ... + @overload + def __round__(self, ndigits: int) -> Fraction: ... def __hash__(self) -> int: ... def __eq__(self, other: object) -> bool: ... def __lt__(self, other: _ComparableNum) -> bool: ... @@ -88,11 +150,10 @@ class Fraction(Rational): def __bool__(self) -> bool: ... else: def __nonzero__(self) -> bool: ... - # Not actually defined within fractions.py, but provides more useful # overrides @property def real(self) -> Fraction: ... @property - def imag(self) -> Fraction: ... + def imag(self) -> Literal[0]: ... def conjugate(self) -> Fraction: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/ftplib.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/ftplib.pyi old mode 100755 new mode 100644 index 9c303f5c..0661301c --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/ftplib.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/ftplib.pyi @@ -1,25 +1,10 @@ import sys -from typing import ( - Any, - BinaryIO, - Callable, - Dict, - Generic, - Iterable, - Iterator, - List, - Optional, - Protocol, - Text, - TextIO, - Tuple, - Type, - TypeVar, - Union, -) -from types import TracebackType +from _typeshed import SupportsRead, SupportsReadline from socket import socket from ssl import SSLContext +from types import TracebackType +from typing import Any, BinaryIO, Callable, Dict, Iterable, Iterator, List, Optional, Text, TextIO, Tuple, Type, TypeVar, Union +from typing_extensions import Literal _T = TypeVar("_T") _IntOrStr = Union[int, Text] @@ -37,13 +22,7 @@ class error_temp(Error): ... class error_perm(Error): ... class error_proto(Error): ... -all_errors = Tuple[Exception, ...] - -class _Readable(Protocol): - def read(self, __length: int) -> bytes: ... - -class _ReadLineable(Protocol): - def readline(self, _length: int) -> bytes: ... +all_errors = Tuple[Type[Exception], ...] class FTP: debugging: int @@ -118,13 +97,13 @@ class FTP: def storbinary( self, cmd: Text, - fp: _Readable, + fp: SupportsRead[bytes], blocksize: int = ..., callback: Optional[Callable[[bytes], Any]] = ..., rest: Optional[_IntOrStr] = ..., ) -> str: ... def retrlines(self, cmd: Text, callback: Optional[Callable[[str], Any]] = ...) -> str: ... - def storlines(self, cmd: Text, fp: _ReadLineable, callback: Optional[Callable[[bytes], Any]] = ...) -> str: ... + def storlines(self, cmd: Text, fp: SupportsReadline[bytes], callback: Optional[Callable[[bytes], Any]] = ...) -> str: ... def acct(self, password: Text) -> str: ... def nlst(self, *args: Text) -> List[str]: ... # Technically only the last arg can be a Callable but ... @@ -134,7 +113,7 @@ class FTP: def rename(self, fromname: Text, toname: Text) -> str: ... def delete(self, filename: Text) -> str: ... def cwd(self, dirname: Text) -> str: ... - def size(self, filename: Text) -> str: ... + def size(self, filename: Text) -> Optional[int]: ... def mkd(self, dirname: Text) -> str: ... def rmd(self, dirname: Text) -> str: ... def pwd(self) -> str: ... @@ -172,3 +151,15 @@ if sys.version_info < (3,): def get_account(self, host: Text) -> Tuple[Optional[str], Optional[str], Optional[str]]: ... def get_macros(self) -> List[str]: ... def get_macro(self, macro: Text) -> Tuple[str, ...]: ... + +def parse150(resp: str) -> Optional[int]: ... # undocumented +def parse227(resp: str) -> Tuple[str, int]: ... # undocumented +def parse229(resp: str, peer: Any) -> Tuple[str, int]: ... # undocumented +def parse257(resp: str) -> str: ... # undocumented +def ftpcp( + source: FTP, + sourcename: str, + target: FTP, + targetname: str = ..., + type: Literal["A", "I"] = ..., +) -> None: ... # undocumented diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/genericpath.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/genericpath.pyi old mode 100755 new mode 100644 index e0b1c6de..8171354d --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/genericpath.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/genericpath.pyi @@ -1,12 +1,19 @@ -from typing import Sequence, AnyStr, Text import sys +from typing import AnyStr, Sequence, Text, Union if sys.version_info >= (3, 0): def commonprefix(m: Sequence[str]) -> str: ... + else: def commonprefix(m: Sequence[AnyStr]) -> AnyStr: ... -def exists(path: Text) -> bool: ... +if sys.version_info >= (3, 6): + from builtins import _PathLike + def exists(path: Union[AnyStr, _PathLike[AnyStr]]) -> bool: ... + +else: + def exists(path: Text) -> bool: ... + def isfile(path: Text) -> bool: ... def isdir(s: Text) -> bool: ... def getsize(filename: Text) -> int: ... @@ -14,7 +21,6 @@ def getmtime(filename: Text) -> float: ... def getatime(filename: Text) -> float: ... def getctime(filename: Text) -> float: ... - if sys.version_info >= (3, 4): def samestat(s1: str, s2: str) -> int: ... def samefile(f1: str, f2: str) -> int: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/grp.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/grp.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/hmac.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/hmac.pyi old mode 100755 new mode 100644 index 47bbc7ec..ca4013da --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/hmac.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/hmac.pyi @@ -1,22 +1,27 @@ -# Stubs for hmac - -from typing import Any, Callable, Optional, Union, overload, AnyStr -from types import ModuleType import sys - -_B = Union[bytes, bytearray] +from _typeshed import ReadableBuffer +from types import ModuleType +from typing import Any, AnyStr, Callable, Optional, Union, overload # TODO more precise type for object of hashlib _Hash = Any +_DigestMod = Union[str, Callable[[], _Hash], ModuleType] digest_size: None -if sys.version_info >= (3, 4): - def new(key: _B, msg: Optional[_B] = ..., - digestmod: Optional[Union[str, Callable[[], _Hash], ModuleType]] = ...) -> HMAC: ... +if sys.version_info >= (3, 8): + # In reality digestmod has a default value, but the function always throws an error + # if the argument is not given, so we pretend it is a required argument. + @overload + def new(key: bytes, msg: Optional[ReadableBuffer], digestmod: _DigestMod) -> HMAC: ... + @overload + def new(key: bytes, *, digestmod: _DigestMod) -> HMAC: ... + +elif sys.version_info >= (3, 4): + def new(key: bytes, msg: Optional[ReadableBuffer] = ..., digestmod: Optional[_DigestMod] = ...) -> HMAC: ... + else: - def new(key: _B, msg: Optional[_B] = ..., - digestmod: Optional[Union[Callable[[], _Hash], ModuleType]] = ...) -> HMAC: ... + def new(key: bytes, msg: Optional[ReadableBuffer] = ..., digestmod: Optional[_DigestMod] = ...) -> HMAC: ... class HMAC: if sys.version_info >= (3,): @@ -24,15 +29,16 @@ class HMAC: if sys.version_info >= (3, 4): block_size: int name: str - def update(self, msg: _B) -> None: ... + def __init__(self, key: bytes, msg: Optional[ReadableBuffer] = ..., digestmod: _DigestMod = ...) -> None: ... + def update(self, msg: ReadableBuffer) -> None: ... def digest(self) -> bytes: ... def hexdigest(self) -> str: ... def copy(self) -> HMAC: ... @overload -def compare_digest(a: bytearray, b: bytearray) -> bool: ... +def compare_digest(__a: ReadableBuffer, __b: ReadableBuffer) -> bool: ... @overload -def compare_digest(a: AnyStr, b: AnyStr) -> bool: ... +def compare_digest(__a: AnyStr, __b: AnyStr) -> bool: ... if sys.version_info >= (3, 7): - def digest(key: _B, msg: _B, digest: str) -> bytes: ... + def digest(key: bytes, msg: ReadableBuffer, digest: str) -> bytes: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/imaplib.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/imaplib.pyi old mode 100755 new mode 100644 index 07f770df..bb9e9c6d --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/imaplib.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/imaplib.pyi @@ -1,15 +1,17 @@ -# Stubs for imaplib (Python 2) - -import imaplib import subprocess import sys import time from socket import socket as _socket -from ssl import SSLSocket, SSLContext -from typing import Any, Callable, Dict, IO, List, Optional, Pattern, Text, Tuple, Type, Union +from ssl import SSLContext, SSLSocket +from types import TracebackType +from typing import IO, Any, Callable, Dict, List, Optional, Pattern, Text, Tuple, Type, Union +from typing_extensions import Literal -CommandResults = Tuple[str, List[Any]] +# TODO: Commands should use their actual return types, not this type alias. +# E.g. Tuple[Literal["OK"], List[bytes]] +_CommandResults = Tuple[str, List[Any]] +_AnyResponseData = Union[List[None], List[Union[bytes, Tuple[bytes, bytes]]]] class IMAP4: error: Type[Exception] = ... @@ -19,8 +21,8 @@ class IMAP4: debug: int = ... state: str = ... literal: Optional[Text] = ... - tagged_commands: Dict[str, str] = ... - untagged_responses: Dict[str, str] = ... + tagged_commands: Dict[bytes, Optional[List[bytes]]] + untagged_responses: Dict[str, List[Union[bytes, Tuple[bytes, bytes]]]] continuation_response: str = ... is_readonly: bool = ... tagnum: int = ... @@ -29,80 +31,108 @@ class IMAP4: welcome: bytes = ... capabilities: Tuple[str] = ... PROTOCOL_VERSION: str = ... - def __init__(self, host: str = ..., port: int = ...) -> None: ... + if sys.version_info >= (3, 9): + def __init__(self, host: str = ..., port: int = ..., timeout: Optional[float] = ...) -> None: ... + def open(self, host: str = ..., port: int = ..., timeout: Optional[float] = ...) -> None: ... + else: + def __init__(self, host: str = ..., port: int = ...) -> None: ... + def open(self, host: str = ..., port: int = ...) -> None: ... def __getattr__(self, attr: str) -> Any: ... host: str = ... port: int = ... sock: _socket = ... file: Union[IO[Text], IO[bytes]] = ... - def open(self, host: str = ..., port: int = ...) -> None: ... def read(self, size: int) -> bytes: ... def readline(self) -> bytes: ... def send(self, data: bytes) -> None: ... def shutdown(self) -> None: ... def socket(self) -> _socket: ... - def recent(self) -> CommandResults: ... - def response(self, code: str) -> CommandResults: ... + def recent(self) -> _CommandResults: ... + def response(self, code: str) -> _CommandResults: ... def append(self, mailbox: str, flags: str, date_time: str, message: str) -> str: ... def authenticate(self, mechanism: str, authobject: Callable[[bytes], Optional[bytes]]) -> Tuple[str, str]: ... - def capability(self) -> CommandResults: ... - def check(self) -> CommandResults: ... - def close(self) -> CommandResults: ... - def copy(self, message_set: str, new_mailbox: str) -> CommandResults: ... - def create(self, mailbox: str) -> CommandResults: ... - def delete(self, mailbox: str) -> CommandResults: ... - def deleteacl(self, mailbox: str, who: str) -> CommandResults: ... + def capability(self) -> _CommandResults: ... + def check(self) -> _CommandResults: ... + def close(self) -> _CommandResults: ... + def copy(self, message_set: str, new_mailbox: str) -> _CommandResults: ... + def create(self, mailbox: str) -> _CommandResults: ... + def delete(self, mailbox: str) -> _CommandResults: ... + def deleteacl(self, mailbox: str, who: str) -> _CommandResults: ... if sys.version_info >= (3, 5): - def enable(self, capability: str) -> CommandResults: ... + def enable(self, capability: str) -> _CommandResults: ... def __enter__(self) -> IMAP4: ... - def __exit__(self, *args) -> None: ... - def expunge(self) -> CommandResults: ... - def fetch(self, message_set: str, message_parts: str) -> CommandResults: ... - def getacl(self, mailbox: str) -> CommandResults: ... - def getannotation(self, mailbox: str, entry: str, attribute: str) -> CommandResults: ... - def getquota(self, root: str) -> CommandResults: ... - def getquotaroot(self, mailbox: str) -> CommandResults: ... - def list(self, directory: str = ..., pattern: str = ...) -> CommandResults: ... - def login(self, user: str, password: str) -> CommandResults: ... - def login_cram_md5(self, user: str, password: str) -> CommandResults: ... - def logout(self) -> CommandResults: ... - def lsub(self, directory: str = ..., pattern: str = ...) -> CommandResults: ... - def myrights(self, mailbox: str) -> CommandResults: ... - def namespace(self) -> CommandResults: ... - def noop(self) -> CommandResults: ... - def partial(self, message_num: str, message_part: str, start: str, length: str) -> CommandResults: ... - def proxyauth(self, user: str) -> CommandResults: ... - def rename(self, oldmailbox: str, newmailbox: str) -> CommandResults: ... - def search(self, charset: Optional[str], *criteria: str) -> CommandResults: ... - def select(self, mailbox: str = ..., readonly: bool = ...) -> CommandResults: ... - def setacl(self, mailbox: str, who: str, what: str) -> CommandResults: ... - def setannotation(self, *args: str) -> CommandResults: ... - def setquota(self, root: str, limits: str) -> CommandResults: ... - def sort(self, sort_criteria: str, charset: str, *search_criteria: str) -> CommandResults: ... + def __exit__(self, t: Optional[Type[BaseException]], v: Optional[BaseException], tb: Optional[TracebackType]) -> None: ... + def expunge(self) -> _CommandResults: ... + def fetch(self, message_set: str, message_parts: str) -> Tuple[str, _AnyResponseData]: ... + def getacl(self, mailbox: str) -> _CommandResults: ... + def getannotation(self, mailbox: str, entry: str, attribute: str) -> _CommandResults: ... + def getquota(self, root: str) -> _CommandResults: ... + def getquotaroot(self, mailbox: str) -> _CommandResults: ... + def list(self, directory: str = ..., pattern: str = ...) -> Tuple[str, _AnyResponseData]: ... + def login(self, user: str, password: str) -> Tuple[Literal["OK"], List[bytes]]: ... + def login_cram_md5(self, user: str, password: str) -> _CommandResults: ... + def logout(self) -> Tuple[str, _AnyResponseData]: ... + def lsub(self, directory: str = ..., pattern: str = ...) -> _CommandResults: ... + def myrights(self, mailbox: str) -> _CommandResults: ... + def namespace(self) -> _CommandResults: ... + def noop(self) -> Tuple[str, List[bytes]]: ... + def partial(self, message_num: str, message_part: str, start: str, length: str) -> _CommandResults: ... + def proxyauth(self, user: str) -> _CommandResults: ... + def rename(self, oldmailbox: str, newmailbox: str) -> _CommandResults: ... + def search(self, charset: Optional[str], *criteria: str) -> _CommandResults: ... + def select(self, mailbox: str = ..., readonly: bool = ...) -> Tuple[str, List[Optional[bytes]]]: ... + def setacl(self, mailbox: str, who: str, what: str) -> _CommandResults: ... + def setannotation(self, *args: str) -> _CommandResults: ... + def setquota(self, root: str, limits: str) -> _CommandResults: ... + def sort(self, sort_criteria: str, charset: str, *search_criteria: str) -> _CommandResults: ... if sys.version_info >= (3,): - def starttls(self, ssl_context: Optional[Any] = ...) -> CommandResults: ... - def status(self, mailbox: str, names: str) -> CommandResults: ... - def store(self, message_set: str, command: str, flags: str) -> CommandResults: ... - def subscribe(self, mailbox: str) -> CommandResults: ... - def thread(self, threading_algorithm: str, charset: str, *search_criteria: str) -> CommandResults: ... - def uid(self, command: str, *args: str) -> CommandResults: ... - def unsubscribe(self, mailbox: str) -> CommandResults: ... - def xatom(self, name: str, *args: str) -> CommandResults: ... + def starttls(self, ssl_context: Optional[Any] = ...) -> Tuple[Literal["OK"], List[None]]: ... + def status(self, mailbox: str, names: str) -> _CommandResults: ... + def store(self, message_set: str, command: str, flags: str) -> _CommandResults: ... + def subscribe(self, mailbox: str) -> _CommandResults: ... + def thread(self, threading_algorithm: str, charset: str, *search_criteria: str) -> _CommandResults: ... + def uid(self, command: str, *args: str) -> _CommandResults: ... + def unsubscribe(self, mailbox: str) -> _CommandResults: ... + if sys.version_info >= (3, 9): + def unselect(self) -> _CommandResults: ... + def xatom(self, name: str, *args: str) -> _CommandResults: ... def print_log(self) -> None: ... class IMAP4_SSL(IMAP4): keyfile: str = ... certfile: str = ... - if sys.version_info >= (3, 3): - def __init__(self, host: str = ..., port: int = ..., keyfile: Optional[str] = ..., certfile: Optional[str] = ..., ssl_context: Optional[SSLContext] = ...) -> None: ... + if sys.version_info >= (3, 9): + def __init__( + self, + host: str = ..., + port: int = ..., + keyfile: Optional[str] = ..., + certfile: Optional[str] = ..., + ssl_context: Optional[SSLContext] = ..., + timeout: Optional[float] = ..., + ) -> None: ... + elif sys.version_info >= (3, 3): + def __init__( + self, + host: str = ..., + port: int = ..., + keyfile: Optional[str] = ..., + certfile: Optional[str] = ..., + ssl_context: Optional[SSLContext] = ..., + ) -> None: ... else: - def __init__(self, host: str = ..., port: int = ..., keyfile: Optional[str] = ..., certfile: Optional[str] = ...) -> None: ... + def __init__( + self, host: str = ..., port: int = ..., keyfile: Optional[str] = ..., certfile: Optional[str] = ... + ) -> None: ... host: str = ... port: int = ... sock: _socket = ... sslobj: SSLSocket = ... file: IO[Any] = ... - def open(self, host: str = ..., port: Optional[int] = ...) -> None: ... + if sys.version_info >= (3, 9): + def open(self, host: str = ..., port: Optional[int] = ..., timeout: Optional[float] = ...) -> None: ... + else: + def open(self, host: str = ..., port: Optional[int] = ...) -> None: ... def read(self, size: int) -> bytes: ... def readline(self) -> bytes: ... def send(self, data: bytes) -> None: ... @@ -110,7 +140,6 @@ class IMAP4_SSL(IMAP4): def socket(self) -> _socket: ... def ssl(self) -> SSLSocket: ... - class IMAP4_stream(IMAP4): command: str = ... def __init__(self, command: str) -> None: ... @@ -121,7 +150,10 @@ class IMAP4_stream(IMAP4): process: subprocess.Popen[bytes] = ... writefile: IO[Any] = ... readfile: IO[Any] = ... - def open(self, host: str = ..., port: Optional[int] = ...) -> None: ... + if sys.version_info >= (3, 9): + def open(self, host: Optional[str] = ..., port: Optional[int] = ..., timeout: Optional[float] = ...) -> None: ... + else: + def open(self, host: Optional[str] = ..., port: Optional[int] = ...) -> None: ... def read(self, size: int) -> bytes: ... def readline(self) -> bytes: ... def send(self, data: bytes) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/imghdr.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/imghdr.pyi old mode 100755 new mode 100644 index b9d8d17e..ffdbbf20 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/imghdr.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/imghdr.pyi @@ -1,16 +1,20 @@ -from typing import overload, Union, Text, BinaryIO, Optional, Any, List, Callable -import sys import os +import sys +from typing import Any, BinaryIO, Callable, List, Optional, Protocol, Text, Union, overload +class _ReadableBinary(Protocol): + def tell(self) -> int: ... + def read(self, size: int) -> bytes: ... + def seek(self, offset: int) -> Any: ... if sys.version_info >= (3, 6): - _File = Union[Text, os.PathLike[Text], BinaryIO] + _File = Union[Text, os.PathLike[Text], _ReadableBinary] else: - _File = Union[Text, BinaryIO] - + _File = Union[Text, _ReadableBinary] @overload -def what(file: _File) -> Optional[str]: ... +def what(file: _File, h: None = ...) -> Optional[str]: ... @overload def what(file: Any, h: bytes) -> Optional[str]: ... -tests: List[Callable[[bytes, BinaryIO], Optional[str]]] + +tests: List[Callable[[bytes, Optional[BinaryIO]], Optional[str]]] diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/keyword.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/keyword.pyi old mode 100755 new mode 100644 index f9e3376e..3e095ed5 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/keyword.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/keyword.pyi @@ -1,6 +1,10 @@ -# Stubs for keyword +import sys +from typing import Sequence, Text -from typing import Sequence, Text, Union +def iskeyword(s: Text) -> bool: ... -def iskeyword(s: Union[Text, bytes]) -> bool: ... kwlist: Sequence[str] + +if sys.version_info >= (3, 9): + def issoftkeyword(s: str) -> bool: ... + softkwlist: Sequence[str] diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/__init__.pyi old mode 100755 new mode 100644 index 145e31b1..e69de29b --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/__init__.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/__init__.pyi @@ -1 +0,0 @@ -# Stubs for lib2to3 (Python 3.6) diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/__init__.pyi old mode 100755 new mode 100644 index 1adc82a6..e69de29b --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/__init__.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/__init__.pyi @@ -1,10 +0,0 @@ -# Stubs for lib2to3.pgen2 (Python 3.6) - -import os -import sys -from typing import Text, Union - -if sys.version_info >= (3, 6): - _Path = Union[Text, os.PathLike] -else: - _Path = Text diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/driver.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/driver.pyi old mode 100755 new mode 100644 index 56785f08..841b0e4b --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/driver.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/driver.pyi @@ -1,14 +1,8 @@ -# Stubs for lib2to3.pgen2.driver (Python 3.6) - -import os -import sys -from typing import Any, Callable, IO, Iterable, List, Optional, Text, Tuple, Union - -from logging import Logger -from lib2to3.pytree import _Convert, _NL -from lib2to3.pgen2 import _Path +from _typeshed import StrPath from lib2to3.pgen2.grammar import Grammar - +from lib2to3.pytree import _NL, _Convert +from logging import Logger +from typing import IO, Any, Iterable, Optional, Text class Driver: grammar: Grammar @@ -18,7 +12,9 @@ class Driver: def parse_tokens(self, tokens: Iterable[Any], debug: bool = ...) -> _NL: ... def parse_stream_raw(self, stream: IO[Text], debug: bool = ...) -> _NL: ... def parse_stream(self, stream: IO[Text], debug: bool = ...) -> _NL: ... - def parse_file(self, filename: _Path, encoding: Optional[Text] = ..., debug: bool = ...) -> _NL: ... + def parse_file(self, filename: StrPath, encoding: Optional[Text] = ..., debug: bool = ...) -> _NL: ... def parse_string(self, text: Text, debug: bool = ...) -> _NL: ... -def load_grammar(gt: Text = ..., gp: Optional[Text] = ..., save: bool = ..., force: bool = ..., logger: Optional[Logger] = ...) -> Grammar: ... +def load_grammar( + gt: Text = ..., gp: Optional[Text] = ..., save: bool = ..., force: bool = ..., logger: Optional[Logger] = ... +) -> Grammar: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/grammar.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/grammar.pyi old mode 100755 new mode 100644 index 122d771d..6ec97ce8 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/grammar.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/grammar.pyi @@ -1,10 +1,7 @@ -# Stubs for lib2to3.pgen2.grammar (Python 3.6) +from _typeshed import StrPath +from typing import Dict, List, Optional, Text, Tuple, TypeVar -from lib2to3.pgen2 import _Path - -from typing import Any, Dict, List, Optional, Text, Tuple, TypeVar - -_P = TypeVar('_P') +_P = TypeVar("_P") _Label = Tuple[int, Optional[Text]] _DFA = List[List[Tuple[int, int]]] _DFAS = Tuple[_DFA, Dict[int, int]] @@ -20,8 +17,8 @@ class Grammar: symbol2label: Dict[Text, int] start: int def __init__(self) -> None: ... - def dump(self, filename: _Path) -> None: ... - def load(self, filename: _Path) -> None: ... + def dump(self, filename: StrPath) -> None: ... + def load(self, filename: StrPath) -> None: ... def copy(self: _P) -> _P: ... def report(self) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/literals.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/literals.pyi old mode 100755 new mode 100644 index 3166ffbf..160d6fd7 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/literals.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/literals.pyi @@ -1,5 +1,3 @@ -# Stubs for lib2to3.pgen2.literals (Python 3.6) - from typing import Dict, Match, Text simple_escapes: Dict[Text, Text] diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/parse.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/parse.pyi old mode 100755 new mode 100644 index 101d4760..b7018cba --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/parse.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/parse.pyi @@ -1,9 +1,6 @@ -# Stubs for lib2to3.pgen2.parse (Python 3.6) - -from typing import Any, Dict, List, Optional, Sequence, Set, Text, Tuple - -from lib2to3.pgen2.grammar import Grammar, _DFAS +from lib2to3.pgen2.grammar import _DFAS, Grammar from lib2to3.pytree import _NL, _Convert, _RawNode +from typing import Any, List, Optional, Sequence, Set, Text, Tuple _Context = Sequence[Any] diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/pgen.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/pgen.pyi old mode 100755 new mode 100644 index 42d503b4..7920262f --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/pgen.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/pgen.pyi @@ -1,20 +1,16 @@ -# Stubs for lib2to3.pgen2.pgen (Python 3.6) - -from typing import ( - Any, Dict, IO, Iterable, Iterator, List, NoReturn, Optional, Text, Tuple -) - -from lib2to3.pgen2 import _Path, grammar +from _typeshed import StrPath +from lib2to3.pgen2 import grammar from lib2to3.pgen2.tokenize import _TokenInfo +from typing import IO, Any, Dict, Iterable, Iterator, List, NoReturn, Optional, Text, Tuple class PgenGrammar(grammar.Grammar): ... class ParserGenerator: - filename: _Path + filename: StrPath stream: IO[Text] generator: Iterator[_TokenInfo] first: Dict[Text, Dict[Text, int]] - def __init__(self, filename: _Path, stream: Optional[IO[Text]] = ...) -> None: ... + def __init__(self, filename: StrPath, stream: Optional[IO[Text]] = ...) -> None: ... def make_grammar(self) -> PgenGrammar: ... def make_first(self, c: PgenGrammar, name: Text) -> Dict[int, int]: ... def make_label(self, c: PgenGrammar, label: Text) -> int: ... @@ -47,4 +43,4 @@ class DFAState: def unifystate(self, old: DFAState, new: DFAState) -> None: ... def __eq__(self, other: Any) -> bool: ... -def generate_grammar(filename: _Path = ...) -> PgenGrammar: ... +def generate_grammar(filename: StrPath = ...) -> PgenGrammar: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/token.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/token.pyi old mode 100755 new mode 100644 index c256af8f..19660cb0 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/token.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/token.pyi @@ -1,5 +1,3 @@ -# Stubs for lib2to3.pgen2.token (Python 3.6) - import sys from typing import Dict, Text diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/tokenize.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/tokenize.pyi old mode 100755 new mode 100644 index c10305ff..477341c1 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/tokenize.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/tokenize.pyi @@ -1,15 +1,10 @@ -# Stubs for lib2to3.pgen2.tokenize (Python 3.6) -# NOTE: Only elements from __all__ are present. - -from typing import Callable, Iterable, Iterator, List, Text, Tuple from lib2to3.pgen2.token import * # noqa - +from typing import Callable, Iterable, Iterator, List, Text, Tuple _Coord = Tuple[int, int] _TokenEater = Callable[[int, Text, _Coord, _Coord, Text], None] _TokenInfo = Tuple[int, Text, _Coord, _Coord, Text] - class TokenError(Exception): ... class StopTokenizing(Exception): ... @@ -25,6 +20,4 @@ class Untokenizer: def compat(self, token: Tuple[int, Text], iterable: Iterable[_TokenInfo]) -> None: ... def untokenize(iterable: Iterable[_TokenInfo]) -> Text: ... -def generate_tokens( - readline: Callable[[], Text] -) -> Iterator[_TokenInfo]: ... +def generate_tokens(readline: Callable[[], Text]) -> Iterator[_TokenInfo]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pygram.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pygram.pyi old mode 100755 new mode 100644 index aeb7b93b..bf96a55c --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pygram.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pygram.pyi @@ -1,6 +1,3 @@ -# Stubs for lib2to3.pygram (Python 3.6) - -from typing import Any from lib2to3.pgen2.grammar import Grammar class Symbols: diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pytree.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pytree.pyi old mode 100755 new mode 100644 index 06a7c122..95576358 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pytree.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pytree.pyi @@ -1,11 +1,8 @@ -# Stubs for lib2to3.pytree (Python 3.6) - import sys -from typing import Any, Callable, Dict, Iterator, List, Optional, Text, Tuple, TypeVar, Union - from lib2to3.pgen2.grammar import Grammar +from typing import Any, Callable, Dict, Iterator, List, Optional, Text, Tuple, TypeVar, Union -_P = TypeVar('_P') +_P = TypeVar("_P") _NL = Union[Node, Leaf] _Context = Tuple[Text, int, int] _Results = Dict[Text, _NL] @@ -45,7 +42,14 @@ class Base: class Node(Base): fixers_applied: List[Any] - def __init__(self, type: int, children: List[_NL], context: Optional[Any] = ..., prefix: Optional[Text] = ..., fixers_applied: Optional[List[Any]] = ...) -> None: ... + def __init__( + self, + type: int, + children: List[_NL], + context: Optional[Any] = ..., + prefix: Optional[Text] = ..., + fixers_applied: Optional[List[Any]] = ..., + ) -> None: ... def set_child(self, i: int, child: _NL) -> None: ... def insert_child(self, i: int, child: _NL) -> None: ... def append_child(self, child: _NL) -> None: ... @@ -55,7 +59,14 @@ class Leaf(Base): column: int value: Text fixers_applied: List[Any] - def __init__(self, type: int, value: Text, context: Optional[_Context] = ..., prefix: Optional[Text] = ..., fixers_applied: List[Any] = ...) -> None: ... + def __init__( + self, + type: int, + value: Text, + context: Optional[_Context] = ..., + prefix: Optional[Text] = ..., + fixers_applied: List[Any] = ..., + ) -> None: ... def convert(gr: Grammar, raw_node: _RawNode) -> _NL: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/linecache.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/linecache.pyi old mode 100755 new mode 100644 index 3f35f469..f52267bd --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/linecache.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/linecache.pyi @@ -8,5 +8,6 @@ def clearcache() -> None: ... def getlines(filename: Text, module_globals: Optional[_ModuleGlobals] = ...) -> List[str]: ... def checkcache(filename: Optional[Text] = ...) -> None: ... def updatecache(filename: Text, module_globals: Optional[_ModuleGlobals] = ...) -> List[str]: ... + if sys.version_info >= (3, 5): def lazycache(filename: Text, module_globals: _ModuleGlobals) -> bool: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/locale.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/locale.pyi old mode 100755 new mode 100644 index a0d7383a..c5e25c95 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/locale.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/locale.pyi @@ -1,8 +1,6 @@ -# Stubs for locale - -from decimal import Decimal -from typing import Any, Dict, Iterable, List, Mapping, Optional, Sequence, Tuple, Union import sys +from decimal import Decimal +from typing import Any, Callable, Dict, Iterable, List, Mapping, Optional, Sequence, Tuple, Union # workaround for mypy#2010 if sys.version_info < (3,): @@ -81,8 +79,7 @@ CHAR_MAX: int class Error(Exception): ... -def setlocale(category: int, - locale: Union[_str, Iterable[_str], None] = ...) -> _str: ... +def setlocale(category: int, locale: Union[_str, Iterable[_str], None] = ...) -> _str: ... def localeconv() -> Mapping[_str, Union[int, _str, List[int]]]: ... def nl_langinfo(option: int) -> _str: ... def getdefaultlocale(envvars: Tuple[_str, ...] = ...) -> Tuple[Optional[_str], Optional[_str]]: ... @@ -92,21 +89,22 @@ def normalize(localename: _str) -> _str: ... def resetlocale(category: int = ...) -> None: ... def strcoll(string1: _str, string2: _str) -> int: ... def strxfrm(string: _str) -> _str: ... -def format(format: _str, val: Union[float, Decimal], grouping: bool = ..., - monetary: bool = ...) -> _str: ... +def format(percent: _str, value: Union[float, Decimal], grouping: bool = ..., monetary: bool = ..., *additional: Any) -> _str: ... + if sys.version_info >= (3, 7): - def format_string(format: _str, val: Any, - grouping: bool = ..., monetary: bool = ...) -> _str: ... + def format_string(f: _str, val: Any, grouping: bool = ..., monetary: bool = ...) -> _str: ... + else: - def format_string(format: _str, val: Any, - grouping: bool = ...) -> _str: ... -def currency(val: Union[int, float, Decimal], symbol: bool = ..., grouping: bool = ..., - international: bool = ...) -> _str: ... + def format_string(f: _str, val: Any, grouping: bool = ...) -> _str: ... + +def currency(val: Union[int, float, Decimal], symbol: bool = ..., grouping: bool = ..., international: bool = ...) -> _str: ... + if sys.version_info >= (3, 5): - def delocalize(string: _str) -> None: ... -def atof(string: _str) -> float: ... + def delocalize(string: _str) -> _str: ... + +def atof(string: _str, func: Callable[[_str], float] = ...) -> float: ... def atoi(string: _str) -> int: ... -def str(float: float) -> _str: ... +def str(val: float) -> _str: ... locale_alias: Dict[_str, _str] # undocumented locale_encoding_alias: Dict[_str, _str] # undocumented diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/logging/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/logging/__init__.pyi old mode 100755 new mode 100644 index 13117947..865c527a --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/logging/__init__.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/logging/__init__.pyi @@ -1,17 +1,27 @@ -# Stubs for logging (Python 3.7) - -from typing import ( - Any, Callable, Dict, Iterable, List, Mapping, MutableMapping, Optional, IO, - Tuple, Text, Union, overload, -) -from string import Template -from time import struct_time -from types import TracebackType, FrameType import sys import threading +from _typeshed import StrPath +from string import Template +from time import struct_time +from types import FrameType, TracebackType +from typing import ( + IO, + Any, + Callable, + Dict, + Iterable, + List, + Mapping, + MutableMapping, + Optional, + Sequence, + Text, + Tuple, + Union, + overload, +) -_SysExcInfoType = Union[Tuple[type, BaseException, Optional[TracebackType]], - Tuple[None, None, None]] +_SysExcInfoType = Union[Tuple[type, BaseException, Optional[TracebackType]], Tuple[None, None, None]] if sys.version_info >= (3, 5): _ExcInfoType = Union[None, bool, _SysExcInfoType, BaseException] else: @@ -19,16 +29,12 @@ else: _ArgsType = Union[Tuple[Any, ...], Mapping[str, Any]] _FilterType = Union[Filter, Callable[[LogRecord], int]] _Level = Union[int, Text] -if sys.version_info >= (3, 6): - from os import PathLike - _Path = Union[str, PathLike[str]] -else: - _Path = str raiseExceptions: bool logThreads: bool logMultiprocessing: bool logProcesses: bool +_srcfile: Optional[str] def currentframe() -> FrameType: ... @@ -41,8 +47,8 @@ else: class Filterer(object): filters: List[Filter] def __init__(self) -> None: ... - def addFilter(self, filter: Filter) -> None: ... - def removeFilter(self, filter: Filter) -> None: ... + def addFilter(self, filter: _FilterType) -> None: ... + def removeFilter(self, filter: _FilterType) -> None: ... def filter(self, record: LogRecord) -> bool: ... class Logger(Filterer): @@ -57,84 +63,260 @@ class Logger(Filterer): def isEnabledFor(self, level: int) -> bool: ... def getEffectiveLevel(self) -> int: ... def getChild(self, suffix: str) -> Logger: ... - if sys.version_info >= (3,): - def debug(self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., - stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., - **kwargs: Any) -> None: ... - def info(self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., - stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., - **kwargs: Any) -> None: ... - def warning(self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., - stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., - **kwargs: Any) -> None: ... - def warn(self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., - stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., - **kwargs: Any) -> None: ... - def error(self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., - stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., - **kwargs: Any) -> None: ... - def critical(self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., - stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., - **kwargs: Any) -> None: ... + if sys.version_info >= (3, 8): + def debug( + self, + msg: Any, + *args: Any, + exc_info: _ExcInfoType = ..., + stack_info: bool = ..., + stacklevel: int = ..., + extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any, + ) -> None: ... + def info( + self, + msg: Any, + *args: Any, + exc_info: _ExcInfoType = ..., + stack_info: bool = ..., + stacklevel: int = ..., + extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any, + ) -> None: ... + def warning( + self, + msg: Any, + *args: Any, + exc_info: _ExcInfoType = ..., + stack_info: bool = ..., + stacklevel: int = ..., + extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any, + ) -> None: ... + def warn( + self, + msg: Any, + *args: Any, + exc_info: _ExcInfoType = ..., + stack_info: bool = ..., + stacklevel: int = ..., + extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any, + ) -> None: ... + def error( + self, + msg: Any, + *args: Any, + exc_info: _ExcInfoType = ..., + stack_info: bool = ..., + stacklevel: int = ..., + extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any, + ) -> None: ... + def exception( + self, + msg: Any, + *args: Any, + exc_info: _ExcInfoType = ..., + stack_info: bool = ..., + stacklevel: int = ..., + extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any, + ) -> None: ... + def critical( + self, + msg: Any, + *args: Any, + exc_info: _ExcInfoType = ..., + stack_info: bool = ..., + stacklevel: int = ..., + extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any, + ) -> None: ... + def log( + self, + level: int, + msg: Any, + *args: Any, + exc_info: _ExcInfoType = ..., + stack_info: bool = ..., + stacklevel: int = ..., + extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any, + ) -> None: ... + def _log( + self, + level: int, + msg: Any, + args: _ArgsType, + exc_info: Optional[_ExcInfoType] = ..., + extra: Optional[Dict[str, Any]] = ..., + stack_info: bool = ..., + stacklevel: int = ..., + ) -> None: ... # undocumented + elif sys.version_info >= (3,): + def debug( + self, + msg: Any, + *args: Any, + exc_info: _ExcInfoType = ..., + stack_info: bool = ..., + extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any, + ) -> None: ... + def info( + self, + msg: Any, + *args: Any, + exc_info: _ExcInfoType = ..., + stack_info: bool = ..., + extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any, + ) -> None: ... + def warning( + self, + msg: Any, + *args: Any, + exc_info: _ExcInfoType = ..., + stack_info: bool = ..., + extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any, + ) -> None: ... + def warn( + self, + msg: Any, + *args: Any, + exc_info: _ExcInfoType = ..., + stack_info: bool = ..., + extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any, + ) -> None: ... + def error( + self, + msg: Any, + *args: Any, + exc_info: _ExcInfoType = ..., + stack_info: bool = ..., + extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any, + ) -> None: ... + def critical( + self, + msg: Any, + *args: Any, + exc_info: _ExcInfoType = ..., + stack_info: bool = ..., + extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any, + ) -> None: ... fatal = critical - def log(self, level: int, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., - stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., - **kwargs: Any) -> None: ... - def exception(self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., - stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., - **kwargs: Any) -> None: ... + def log( + self, + level: int, + msg: Any, + *args: Any, + exc_info: _ExcInfoType = ..., + stack_info: bool = ..., + extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any, + ) -> None: ... + def exception( + self, + msg: Any, + *args: Any, + exc_info: _ExcInfoType = ..., + stack_info: bool = ..., + extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any, + ) -> None: ... + def _log( + self, + level: int, + msg: Any, + args: _ArgsType, + exc_info: Optional[_ExcInfoType] = ..., + extra: Optional[Dict[str, Any]] = ..., + stack_info: bool = ..., + ) -> None: ... # undocumented else: - def debug(self, - msg: Any, *args: Any, exc_info: _ExcInfoType = ..., - extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... - def info(self, - msg: Any, *args: Any, exc_info: _ExcInfoType = ..., - extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... - def warning(self, - msg: Any, *args: Any, exc_info: _ExcInfoType = ..., - extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... + def debug( + self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., extra: Optional[Dict[str, Any]] = ..., **kwargs: Any + ) -> None: ... + def info( + self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., extra: Optional[Dict[str, Any]] = ..., **kwargs: Any + ) -> None: ... + def warning( + self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., extra: Optional[Dict[str, Any]] = ..., **kwargs: Any + ) -> None: ... warn = warning - def error(self, - msg: Any, *args: Any, exc_info: _ExcInfoType = ..., - extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... - def critical(self, - msg: Any, *args: Any, exc_info: _ExcInfoType = ..., - extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... + def error( + self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., extra: Optional[Dict[str, Any]] = ..., **kwargs: Any + ) -> None: ... + def critical( + self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., extra: Optional[Dict[str, Any]] = ..., **kwargs: Any + ) -> None: ... fatal = critical - def log(self, - level: int, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., - extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... - def exception(self, - msg: Any, *args: Any, exc_info: _ExcInfoType = ..., - extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... - def addFilter(self, filt: _FilterType) -> None: ... - def removeFilter(self, filt: _FilterType) -> None: ... + def log( + self, + level: int, + msg: Any, + *args: Any, + exc_info: _ExcInfoType = ..., + extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any, + ) -> None: ... + def exception( + self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., extra: Optional[Dict[str, Any]] = ..., **kwargs: Any + ) -> None: ... + def _log( + self, + level: int, + msg: Any, + args: _ArgsType, + exc_info: Optional[_ExcInfoType] = ..., + extra: Optional[Dict[str, Any]] = ..., + ) -> None: ... # undocumented def filter(self, record: LogRecord) -> bool: ... def addHandler(self, hdlr: Handler) -> None: ... def removeHandler(self, hdlr: Handler) -> None: ... - if sys.version_info >= (3,): + if sys.version_info >= (3, 8): + def findCaller(self, stack_info: bool = ..., stacklevel: int = ...) -> Tuple[str, int, str, Optional[str]]: ... + elif sys.version_info >= (3,): def findCaller(self, stack_info: bool = ...) -> Tuple[str, int, str, Optional[str]]: ... else: def findCaller(self) -> Tuple[str, int, str]: ... def handle(self, record: LogRecord) -> None: ... if sys.version_info >= (3,): - def makeRecord(self, name: str, level: int, fn: str, lno: int, msg: Any, - args: _ArgsType, - exc_info: Optional[_SysExcInfoType], - func: Optional[str] = ..., - extra: Optional[Mapping[str, Any]] = ..., - sinfo: Optional[str] = ...) -> LogRecord: ... + def makeRecord( + self, + name: str, + level: int, + fn: str, + lno: int, + msg: Any, + args: _ArgsType, + exc_info: Optional[_SysExcInfoType], + func: Optional[str] = ..., + extra: Optional[Mapping[str, Any]] = ..., + sinfo: Optional[str] = ..., + ) -> LogRecord: ... else: - def makeRecord(self, - name: str, level: int, fn: str, lno: int, msg: Any, - args: _ArgsType, - exc_info: Optional[_SysExcInfoType], - func: Optional[str] = ..., - extra: Optional[Mapping[str, Any]] = ...) -> LogRecord: ... + def makeRecord( + self, + name: str, + level: int, + fn: str, + lno: int, + msg: Any, + args: _ArgsType, + exc_info: Optional[_SysExcInfoType], + func: Optional[str] = ..., + extra: Optional[Mapping[str, Any]] = ..., + ) -> LogRecord: ... if sys.version_info >= (3,): def hasHandlers(self) -> bool: ... - CRITICAL: int FATAL: int ERROR: int @@ -144,7 +326,6 @@ INFO: int DEBUG: int NOTSET: int - class Handler(Filterer): level: int # undocumented formatter: Optional[Formatter] # undocumented @@ -156,8 +337,6 @@ class Handler(Filterer): def release(self) -> None: ... def setLevel(self, level: _Level) -> None: ... def setFormatter(self, fmt: Formatter) -> None: ... - def addFilter(self, filt: _FilterType) -> None: ... - def removeFilter(self, filt: _FilterType) -> None: ... def filter(self, record: LogRecord) -> bool: ... def flush(self) -> None: ... def close(self) -> None: ... @@ -166,7 +345,6 @@ class Handler(Filterer): def format(self, record: LogRecord) -> str: ... def emit(self, record: LogRecord) -> None: ... - class Formatter: converter: Callable[[Optional[float]], struct_time] _fmt: Optional[str] @@ -176,27 +354,24 @@ class Formatter: default_time_format: str default_msec_format: str - if sys.version_info >= (3,): - def __init__(self, fmt: Optional[str] = ..., - datefmt: Optional[str] = ..., - style: str = ...) -> None: ... + if sys.version_info >= (3, 8): + def __init__( + self, fmt: Optional[str] = ..., datefmt: Optional[str] = ..., style: str = ..., validate: bool = ... + ) -> None: ... + elif sys.version_info >= (3,): + def __init__(self, fmt: Optional[str] = ..., datefmt: Optional[str] = ..., style: str = ...) -> None: ... else: - def __init__(self, - fmt: Optional[str] = ..., - datefmt: Optional[str] = ...) -> None: ... - + def __init__(self, fmt: Optional[str] = ..., datefmt: Optional[str] = ...) -> None: ... def format(self, record: LogRecord) -> str: ... def formatTime(self, record: LogRecord, datefmt: Optional[str] = ...) -> str: ... - def formatException(self, exc_info: _SysExcInfoType) -> str: ... + def formatException(self, ei: _SysExcInfoType) -> str: ... if sys.version_info >= (3,): def formatMessage(self, record: LogRecord) -> str: ... # undocumented def formatStack(self, stack_info: str) -> str: ... - class Filter: def __init__(self, name: str = ...) -> None: ... - def filter(self, record: LogRecord) -> int: ... - + def filter(self, record: LogRecord) -> bool: ... class LogRecord: args: _ArgsType @@ -223,165 +398,480 @@ class LogRecord: thread: int threadName: str if sys.version_info >= (3,): - def __init__(self, name: str, level: int, pathname: str, lineno: int, - msg: Any, args: _ArgsType, - exc_info: Optional[_SysExcInfoType], - func: Optional[str] = ..., - sinfo: Optional[str] = ...) -> None: ... + def __init__( + self, + name: str, + level: int, + pathname: str, + lineno: int, + msg: Any, + args: _ArgsType, + exc_info: Optional[_SysExcInfoType], + func: Optional[str] = ..., + sinfo: Optional[str] = ..., + ) -> None: ... else: - def __init__(self, - name: str, level: int, pathname: str, lineno: int, - msg: Any, args: _ArgsType, - exc_info: Optional[_SysExcInfoType], - func: Optional[str] = ...) -> None: ... + def __init__( + self, + name: str, + level: int, + pathname: str, + lineno: int, + msg: Any, + args: _ArgsType, + exc_info: Optional[_SysExcInfoType], + func: Optional[str] = ..., + ) -> None: ... def getMessage(self) -> str: ... - class LoggerAdapter: logger: Logger extra: Mapping[str, Any] def __init__(self, logger: Logger, extra: Mapping[str, Any]) -> None: ... def process(self, msg: Any, kwargs: MutableMapping[str, Any]) -> Tuple[Any, MutableMapping[str, Any]]: ... - if sys.version_info >= (3,): - def debug(self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., - stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., - **kwargs: Any) -> None: ... - def info(self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., - stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., - **kwargs: Any) -> None: ... - def warning(self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., - stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., - **kwargs: Any) -> None: ... - def warn(self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., - stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., - **kwargs: Any) -> None: ... - def error(self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., - stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., - **kwargs: Any) -> None: ... - def exception(self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., - stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., - **kwargs: Any) -> None: ... - def critical(self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., - stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., - **kwargs: Any) -> None: ... - def log(self, level: int, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., - stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., - **kwargs: Any) -> None: ... + if sys.version_info >= (3, 8): + def debug( + self, + msg: Any, + *args: Any, + exc_info: _ExcInfoType = ..., + stack_info: bool = ..., + stacklevel: int = ..., + extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any, + ) -> None: ... + def info( + self, + msg: Any, + *args: Any, + exc_info: _ExcInfoType = ..., + stack_info: bool = ..., + stacklevel: int = ..., + extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any, + ) -> None: ... + def warning( + self, + msg: Any, + *args: Any, + exc_info: _ExcInfoType = ..., + stack_info: bool = ..., + stacklevel: int = ..., + extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any, + ) -> None: ... + def warn( + self, + msg: Any, + *args: Any, + exc_info: _ExcInfoType = ..., + stack_info: bool = ..., + stacklevel: int = ..., + extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any, + ) -> None: ... + def error( + self, + msg: Any, + *args: Any, + exc_info: _ExcInfoType = ..., + stack_info: bool = ..., + stacklevel: int = ..., + extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any, + ) -> None: ... + def exception( + self, + msg: Any, + *args: Any, + exc_info: _ExcInfoType = ..., + stack_info: bool = ..., + stacklevel: int = ..., + extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any, + ) -> None: ... + def critical( + self, + msg: Any, + *args: Any, + exc_info: _ExcInfoType = ..., + stack_info: bool = ..., + stacklevel: int = ..., + extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any, + ) -> None: ... + def log( + self, + level: int, + msg: Any, + *args: Any, + exc_info: _ExcInfoType = ..., + stack_info: bool = ..., + stacklevel: int = ..., + extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any, + ) -> None: ... + elif sys.version_info >= (3,): + def debug( + self, + msg: Any, + *args: Any, + exc_info: _ExcInfoType = ..., + stack_info: bool = ..., + extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any, + ) -> None: ... + def info( + self, + msg: Any, + *args: Any, + exc_info: _ExcInfoType = ..., + stack_info: bool = ..., + extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any, + ) -> None: ... + def warning( + self, + msg: Any, + *args: Any, + exc_info: _ExcInfoType = ..., + stack_info: bool = ..., + extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any, + ) -> None: ... + def warn( + self, + msg: Any, + *args: Any, + exc_info: _ExcInfoType = ..., + stack_info: bool = ..., + extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any, + ) -> None: ... + def error( + self, + msg: Any, + *args: Any, + exc_info: _ExcInfoType = ..., + stack_info: bool = ..., + extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any, + ) -> None: ... + def exception( + self, + msg: Any, + *args: Any, + exc_info: _ExcInfoType = ..., + stack_info: bool = ..., + extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any, + ) -> None: ... + def critical( + self, + msg: Any, + *args: Any, + exc_info: _ExcInfoType = ..., + stack_info: bool = ..., + extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any, + ) -> None: ... + def log( + self, + level: int, + msg: Any, + *args: Any, + exc_info: _ExcInfoType = ..., + stack_info: bool = ..., + extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any, + ) -> None: ... else: - def debug(self, - msg: Any, *args: Any, exc_info: _ExcInfoType = ..., - extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... - def info(self, - msg: Any, *args: Any, exc_info: _ExcInfoType = ..., - extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... - def warning(self, - msg: Any, *args: Any, exc_info: _ExcInfoType = ..., - extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... - def error(self, - msg: Any, *args: Any, exc_info: _ExcInfoType = ..., - extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... - def exception(self, - msg: Any, *args: Any, exc_info: _ExcInfoType = ..., - extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... - def critical(self, - msg: Any, *args: Any, exc_info: _ExcInfoType = ..., - extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... - def log(self, - level: int, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., - extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... - def isEnabledFor(self, lvl: int) -> bool: ... + def debug( + self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., extra: Optional[Dict[str, Any]] = ..., **kwargs: Any + ) -> None: ... + def info( + self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., extra: Optional[Dict[str, Any]] = ..., **kwargs: Any + ) -> None: ... + def warning( + self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., extra: Optional[Dict[str, Any]] = ..., **kwargs: Any + ) -> None: ... + def error( + self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., extra: Optional[Dict[str, Any]] = ..., **kwargs: Any + ) -> None: ... + def exception( + self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., extra: Optional[Dict[str, Any]] = ..., **kwargs: Any + ) -> None: ... + def critical( + self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., extra: Optional[Dict[str, Any]] = ..., **kwargs: Any + ) -> None: ... + def log( + self, + level: int, + msg: Any, + *args: Any, + exc_info: _ExcInfoType = ..., + extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any, + ) -> None: ... + def isEnabledFor(self, level: int) -> bool: ... if sys.version_info >= (3,): def getEffectiveLevel(self) -> int: ... - def setLevel(self, lvl: Union[int, str]) -> None: ... + def setLevel(self, level: Union[int, str]) -> None: ... def hasHandlers(self) -> bool: ... - + if sys.version_info >= (3, 6): + def _log( + self, + level: int, + msg: Any, + args: _ArgsType, + exc_info: Optional[_ExcInfoType] = ..., + extra: Optional[Dict[str, Any]] = ..., + stack_info: bool = ..., + ) -> None: ... # undocumented if sys.version_info >= (3,): def getLogger(name: Optional[str] = ...) -> Logger: ... + else: @overload def getLogger() -> Logger: ... @overload def getLogger(name: Union[Text, str]) -> Logger: ... + def getLoggerClass() -> type: ... + if sys.version_info >= (3,): def getLogRecordFactory() -> Callable[..., LogRecord]: ... -if sys.version_info >= (3,): - def debug(msg: Any, *args: Any, exc_info: _ExcInfoType = ..., - stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., - **kwargs: Any) -> None: ... - def info(msg: Any, *args: Any, exc_info: _ExcInfoType = ..., - stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., - **kwargs: Any) -> None: ... - def warning(msg: Any, *args: Any, exc_info: _ExcInfoType = ..., - stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., - **kwargs: Any) -> None: ... - def warn(msg: Any, *args: Any, exc_info: _ExcInfoType = ..., - stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., - **kwargs: Any) -> None: ... - def error(msg: Any, *args: Any, exc_info: _ExcInfoType = ..., - stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., - **kwargs: Any) -> None: ... - def critical(msg: Any, *args: Any, exc_info: _ExcInfoType = ..., - stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., - **kwargs: Any) -> None: ... - def exception(msg: Any, *args: Any, exc_info: _ExcInfoType = ..., - stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., - **kwargs: Any) -> None: ... - def log(level: int, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., - stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., - **kwargs: Any) -> None: ... +if sys.version_info >= (3, 8): + def debug( + msg: Any, + *args: Any, + exc_info: _ExcInfoType = ..., + stack_info: bool = ..., + stacklevel: int = ..., + extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any, + ) -> None: ... + def info( + msg: Any, + *args: Any, + exc_info: _ExcInfoType = ..., + stack_info: bool = ..., + stacklevel: int = ..., + extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any, + ) -> None: ... + def warning( + msg: Any, + *args: Any, + exc_info: _ExcInfoType = ..., + stack_info: bool = ..., + stacklevel: int = ..., + extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any, + ) -> None: ... + def warn( + msg: Any, + *args: Any, + exc_info: _ExcInfoType = ..., + stack_info: bool = ..., + stacklevel: int = ..., + extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any, + ) -> None: ... + def error( + msg: Any, + *args: Any, + exc_info: _ExcInfoType = ..., + stack_info: bool = ..., + stacklevel: int = ..., + extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any, + ) -> None: ... + def critical( + msg: Any, + *args: Any, + exc_info: _ExcInfoType = ..., + stack_info: bool = ..., + stacklevel: int = ..., + extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any, + ) -> None: ... + def exception( + msg: Any, + *args: Any, + exc_info: _ExcInfoType = ..., + stack_info: bool = ..., + stacklevel: int = ..., + extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any, + ) -> None: ... + def log( + level: int, + msg: Any, + *args: Any, + exc_info: _ExcInfoType = ..., + stack_info: bool = ..., + stacklevel: int = ..., + extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any, + ) -> None: ... + +elif sys.version_info >= (3,): + def debug( + msg: Any, + *args: Any, + exc_info: _ExcInfoType = ..., + stack_info: bool = ..., + extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any, + ) -> None: ... + def info( + msg: Any, + *args: Any, + exc_info: _ExcInfoType = ..., + stack_info: bool = ..., + extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any, + ) -> None: ... + def warning( + msg: Any, + *args: Any, + exc_info: _ExcInfoType = ..., + stack_info: bool = ..., + extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any, + ) -> None: ... + def warn( + msg: Any, + *args: Any, + exc_info: _ExcInfoType = ..., + stack_info: bool = ..., + extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any, + ) -> None: ... + def error( + msg: Any, + *args: Any, + exc_info: _ExcInfoType = ..., + stack_info: bool = ..., + extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any, + ) -> None: ... + def critical( + msg: Any, + *args: Any, + exc_info: _ExcInfoType = ..., + stack_info: bool = ..., + extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any, + ) -> None: ... + def exception( + msg: Any, + *args: Any, + exc_info: _ExcInfoType = ..., + stack_info: bool = ..., + extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any, + ) -> None: ... + def log( + level: int, + msg: Any, + *args: Any, + exc_info: _ExcInfoType = ..., + stack_info: bool = ..., + extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any, + ) -> None: ... + else: - def debug(msg: Any, *args: Any, exc_info: _ExcInfoType = ..., - extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... - def info(msg: Any, *args: Any, exc_info: _ExcInfoType = ..., - extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... - def warning(msg: Any, *args: Any, exc_info: _ExcInfoType = ..., - extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... + def debug( + msg: Any, *args: Any, exc_info: _ExcInfoType = ..., extra: Optional[Dict[str, Any]] = ..., **kwargs: Any + ) -> None: ... + def info( + msg: Any, *args: Any, exc_info: _ExcInfoType = ..., extra: Optional[Dict[str, Any]] = ..., **kwargs: Any + ) -> None: ... + def warning( + msg: Any, *args: Any, exc_info: _ExcInfoType = ..., extra: Optional[Dict[str, Any]] = ..., **kwargs: Any + ) -> None: ... warn = warning - def error(msg: Any, *args: Any, exc_info: _ExcInfoType = ..., - extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... - def critical(msg: Any, *args: Any, exc_info: _ExcInfoType = ..., - extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... - def exception(msg: Any, *args: Any, exc_info: _ExcInfoType = ..., - extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... - def log(level: int, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., - extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... + def error( + msg: Any, *args: Any, exc_info: _ExcInfoType = ..., extra: Optional[Dict[str, Any]] = ..., **kwargs: Any + ) -> None: ... + def critical( + msg: Any, *args: Any, exc_info: _ExcInfoType = ..., extra: Optional[Dict[str, Any]] = ..., **kwargs: Any + ) -> None: ... + def exception( + msg: Any, *args: Any, exc_info: _ExcInfoType = ..., extra: Optional[Dict[str, Any]] = ..., **kwargs: Any + ) -> None: ... + def log( + level: int, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., extra: Optional[Dict[str, Any]] = ..., **kwargs: Any + ) -> None: ... + fatal = critical -def disable(lvl: int) -> None: ... -def addLevelName(lvl: int, levelName: str) -> None: ... -def getLevelName(lvl: Union[int, str]) -> Any: ... +if sys.version_info >= (3, 7): + def disable(level: int = ...) -> None: ... -def makeLogRecord(attrdict: Mapping[str, Any]) -> LogRecord: ... +else: + def disable(level: int) -> None: ... + +def addLevelName(level: int, levelName: str) -> None: ... +def getLevelName(level: Union[int, str]) -> Any: ... +def makeLogRecord(dict: Mapping[str, Any]) -> LogRecord: ... + +if sys.version_info >= (3, 8): + def basicConfig( + *, + filename: Optional[StrPath] = ..., + filemode: str = ..., + format: str = ..., + datefmt: Optional[str] = ..., + style: str = ..., + level: Optional[_Level] = ..., + stream: Optional[IO[str]] = ..., + handlers: Optional[Iterable[Handler]] = ..., + force: bool = ..., + ) -> None: ... + +elif sys.version_info >= (3,): + def basicConfig( + *, + filename: Optional[StrPath] = ..., + filemode: str = ..., + format: str = ..., + datefmt: Optional[str] = ..., + style: str = ..., + level: Optional[_Level] = ..., + stream: Optional[IO[str]] = ..., + handlers: Optional[Iterable[Handler]] = ..., + ) -> None: ... -if sys.version_info >= (3,): - def basicConfig(*, filename: Optional[_Path] = ..., filemode: str = ..., - format: str = ..., datefmt: Optional[str] = ..., style: str = ..., - level: Optional[_Level] = ..., stream: Optional[IO[str]] = ..., - handlers: Optional[Iterable[Handler]] = ...) -> None: ... else: @overload def basicConfig() -> None: ... @overload - def basicConfig(*, filename: Optional[str] = ..., filemode: str = ..., - format: str = ..., datefmt: Optional[str] = ..., - level: Optional[_Level] = ..., stream: IO[str] = ...) -> None: ... -def shutdown() -> None: ... - + def basicConfig( + *, + filename: Optional[str] = ..., + filemode: str = ..., + format: str = ..., + datefmt: Optional[str] = ..., + level: Optional[_Level] = ..., + stream: IO[str] = ..., + ) -> None: ... + +def shutdown(handlerList: Sequence[Any] = ...) -> None: ... # handlerList is undocumented def setLoggerClass(klass: type) -> None: ... - def captureWarnings(capture: bool) -> None: ... if sys.version_info >= (3,): def setLogRecordFactory(factory: Callable[..., LogRecord]) -> None: ... - if sys.version_info >= (3,): lastResort: Optional[StreamHandler] - class StreamHandler(Handler): stream: IO[str] # undocumented if sys.version_info >= (3, 2): @@ -390,49 +880,39 @@ class StreamHandler(Handler): if sys.version_info >= (3, 7): def setStream(self, stream: IO[str]) -> Optional[IO[str]]: ... - class FileHandler(StreamHandler): baseFilename: str # undocumented mode: str # undocumented encoding: Optional[str] # undocumented delay: bool # undocumented - def __init__(self, filename: _Path, mode: str = ..., - encoding: Optional[str] = ..., delay: bool = ...) -> None: ... - + def __init__(self, filename: StrPath, mode: str = ..., encoding: Optional[str] = ..., delay: bool = ...) -> None: ... + def _open(self) -> IO[Any]: ... class NullHandler(Handler): ... - class PlaceHolder: def __init__(self, alogger: Logger) -> None: ... def append(self, alogger: Logger) -> None: ... - # Below aren't in module docs but still visible -class RootLogger(Logger): ... +class RootLogger(Logger): + def __init__(self, level: int) -> None: ... root: RootLogger - if sys.version_info >= (3,): class PercentStyle(object): default_format: str asctime_format: str asctime_search: str _fmt: str - def __init__(self, fmt: str) -> None: ... def usesTime(self) -> bool: ... def format(self, record: Any) -> str: ... - - class StrFormatStyle(PercentStyle): - ... - + class StrFormatStyle(PercentStyle): ... class StringTemplateStyle(PercentStyle): _tpl: Template - _STYLES: Dict[str, Tuple[PercentStyle, str]] - BASIC_FORMAT: str diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/logging/config.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/logging/config.pyi old mode 100755 new mode 100644 index c8dbfdff..535d583d --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/logging/config.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/logging/config.pyi @@ -1,33 +1,32 @@ -# Stubs for logging.config (Python 3.4) - -from typing import Any, Callable, Dict, Optional, IO, Union -from threading import Thread import sys +from _typeshed import AnyPath, StrPath +from threading import Thread +from typing import IO, Any, Callable, Dict, Optional, Union + if sys.version_info >= (3,): from configparser import RawConfigParser else: from ConfigParser import RawConfigParser -if sys.version_info >= (3, 6): - from os import PathLike if sys.version_info >= (3, 7): - _Path = Union[str, bytes, PathLike[str]] -elif sys.version_info >= (3, 6): - _Path = Union[str, PathLike[str]] + _Path = AnyPath else: - _Path = str - + _Path = StrPath def dictConfig(config: Dict[str, Any]) -> None: ... + if sys.version_info >= (3, 4): - def fileConfig(fname: Union[_Path, IO[str], RawConfigParser], - defaults: Optional[Dict[str, str]] = ..., - disable_existing_loggers: bool = ...) -> None: ... - def listen(port: int = ..., - verify: Optional[Callable[[bytes], Optional[bytes]]] = ...) -> Thread: ... + def fileConfig( + fname: Union[_Path, IO[str], RawConfigParser], + defaults: Optional[Dict[str, str]] = ..., + disable_existing_loggers: bool = ..., + ) -> None: ... + def listen(port: int = ..., verify: Optional[Callable[[bytes], Optional[bytes]]] = ...) -> Thread: ... + else: - def fileConfig(fname: Union[str, IO[str]], - defaults: Optional[Dict[str, str]] = ..., - disable_existing_loggers: bool = ...) -> None: ... + def fileConfig( + fname: Union[str, IO[str]], defaults: Optional[Dict[str, str]] = ..., disable_existing_loggers: bool = ... + ) -> None: ... def listen(port: int = ...) -> Thread: ... + def stopListening() -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/logging/handlers.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/logging/handlers.pyi old mode 100755 new mode 100644 index 161eb609..3c726fc2 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/logging/handlers.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/logging/handlers.pyi @@ -1,26 +1,18 @@ -# Stubs for logging.handlers (Python 2.4) - import datetime -from logging import Handler, FileHandler, LogRecord -from socket import SocketType import ssl import sys -from typing import Any, Callable, Dict, List, Optional, Tuple, Union, overload +from _typeshed import StrPath +from logging import FileHandler, Handler, LogRecord +from socket import SocketKind, SocketType +from typing import Any, Callable, ClassVar, Dict, List, Optional, Tuple, Union + if sys.version_info >= (3, 7): - from queue import SimpleQueue, Queue + from queue import Queue, SimpleQueue elif sys.version_info >= (3,): from queue import Queue else: from Queue import Queue -# TODO update socket stubs to add SocketKind -_SocketKind = int -if sys.version_info >= (3, 6): - from os import PathLike - _Path = Union[str, PathLike[str]] -else: - _Path = str - DEFAULT_TCP_LOGGING_PORT: int DEFAULT_UDP_LOGGING_PORT: int DEFAULT_HTTP_LOGGING_PORT: int @@ -29,59 +21,87 @@ SYSLOG_UDP_PORT: int SYSLOG_TCP_PORT: int class WatchedFileHandler(FileHandler): - def __init__(self, filename: _Path, mode: str = ..., encoding: Optional[str] = ..., - delay: bool = ...) -> None: ... - + dev: int + ino: int + def __init__(self, filename: StrPath, mode: str = ..., encoding: Optional[str] = ..., delay: bool = ...) -> None: ... + def _statstream(self) -> None: ... if sys.version_info >= (3,): class BaseRotatingHandler(FileHandler): terminator: str namer: Optional[Callable[[str], str]] rotator: Optional[Callable[[str, str], None]] - def __init__(self, filename: _Path, mode: str, - encoding: Optional[str] = ..., - delay: bool = ...) -> None: ... + def __init__(self, filename: StrPath, mode: str, encoding: Optional[str] = ..., delay: bool = ...) -> None: ... def rotation_filename(self, default_name: str) -> None: ... def rotate(self, source: str, dest: str) -> None: ... - if sys.version_info >= (3,): class RotatingFileHandler(BaseRotatingHandler): - def __init__(self, filename: _Path, mode: str = ..., maxBytes: int = ..., - backupCount: int = ..., encoding: Optional[str] = ..., - delay: bool = ...) -> None: ... + def __init__( + self, + filename: StrPath, + mode: str = ..., + maxBytes: int = ..., + backupCount: int = ..., + encoding: Optional[str] = ..., + delay: bool = ..., + ) -> None: ... def doRollover(self) -> None: ... + else: class RotatingFileHandler(Handler): - def __init__(self, filename: str, mode: str = ..., maxBytes: int = ..., - backupCount: int = ..., encoding: Optional[str] = ..., - delay: bool = ...) -> None: ... + def __init__( + self, + filename: str, + mode: str = ..., + maxBytes: int = ..., + backupCount: int = ..., + encoding: Optional[str] = ..., + delay: bool = ..., + ) -> None: ... def doRollover(self) -> None: ... - if sys.version_info >= (3,): class TimedRotatingFileHandler(BaseRotatingHandler): if sys.version_info >= (3, 4): - def __init__(self, filename: _Path, when: str = ..., - interval: int = ..., - backupCount: int = ..., encoding: Optional[str] = ..., - delay: bool = ..., utc: bool = ..., - atTime: Optional[datetime.datetime] = ...) -> None: ... + def __init__( + self, + filename: StrPath, + when: str = ..., + interval: int = ..., + backupCount: int = ..., + encoding: Optional[str] = ..., + delay: bool = ..., + utc: bool = ..., + atTime: Optional[datetime.datetime] = ..., + ) -> None: ... else: - def __init__(self, - filename: str, when: str = ..., interval: int = ..., - backupCount: int = ..., encoding: Optional[str] = ..., - delay: bool = ..., utc: bool = ...) -> None: ... + def __init__( + self, + filename: str, + when: str = ..., + interval: int = ..., + backupCount: int = ..., + encoding: Optional[str] = ..., + delay: bool = ..., + utc: bool = ..., + ) -> None: ... def doRollover(self) -> None: ... + else: class TimedRotatingFileHandler(Handler): - def __init__(self, - filename: str, when: str = ..., interval: int = ..., - backupCount: int = ..., encoding: Optional[str] = ..., - delay: bool = ..., utc: bool = ...) -> None: ... + def __init__( + self, + filename: str, + when: str = ..., + interval: int = ..., + backupCount: int = ..., + encoding: Optional[str] = ..., + delay: bool = ..., + utc: bool = ..., + ) -> None: ... def doRollover(self) -> None: ... - class SocketHandler(Handler): retryStart: float retryFactor: float @@ -90,36 +110,43 @@ class SocketHandler(Handler): def __init__(self, host: str, port: Optional[int]) -> None: ... else: def __init__(self, host: str, port: int) -> None: ... - def makeSocket(self) -> SocketType: ... + def makeSocket(self, timeout: float = ...) -> SocketType: ... # timeout is undocumented def makePickle(self, record: LogRecord) -> bytes: ... - def send(self, packet: bytes) -> None: ... + def send(self, s: bytes) -> None: ... def createSocket(self) -> None: ... - -class DatagramHandler(SocketHandler): ... - +class DatagramHandler(SocketHandler): + def makeSocket(self) -> SocketType: ... # type: ignore class SysLogHandler(Handler): + LOG_EMERG: int LOG_ALERT: int LOG_CRIT: int - LOG_DEBUG: int - LOG_EMERG: int LOG_ERR: int - LOG_INFO: int - LOG_NOTICE: int LOG_WARNING: int - LOG_AUTH: int - LOG_AUTHPRIV: int - LOG_CRON: int - LOG_DAEMON: int - LOG_FTP: int + LOG_NOTICE: int + LOG_INFO: int + LOG_DEBUG: int + LOG_KERN: int - LOG_LPR: int + LOG_USER: int LOG_MAIL: int - LOG_NEWS: int + LOG_DAEMON: int + LOG_AUTH: int LOG_SYSLOG: int - LOG_USER: int + LOG_LPR: int + LOG_NEWS: int LOG_UUCP: int + LOG_CRON: int + LOG_AUTHPRIV: int + LOG_FTP: int + + if sys.version_info >= (3, 9): + LOG_NTP: int + LOG_SECURITY: int + LOG_CONSOLE: int + LOG_SOLCRON: int + LOG_LOCAL0: int LOG_LOCAL1: int LOG_LOCAL2: int @@ -128,66 +155,85 @@ class SysLogHandler(Handler): LOG_LOCAL5: int LOG_LOCAL6: int LOG_LOCAL7: int - def __init__(self, address: Union[Tuple[str, int], str] = ..., - facility: int = ..., socktype: _SocketKind = ...) -> None: ... - def encodePriority(self, facility: Union[int, str], - priority: Union[int, str]) -> int: ... + unixsocket: bool # undocumented + socktype: SocketKind # undocumented + if sys.version_info >= (3,): + ident: str # undocumented + facility: int # undocumented + priority_names: ClassVar[Dict[str, int]] # undocumented + facility_names: ClassVar[Dict[str, int]] # undocumented + priority_map: ClassVar[Dict[str, str]] # undocumented + def __init__( + self, address: Union[Tuple[str, int], str] = ..., facility: int = ..., socktype: Optional[SocketKind] = ... + ) -> None: ... + def encodePriority(self, facility: Union[int, str], priority: Union[int, str]) -> int: ... def mapPriority(self, levelName: str) -> str: ... - class NTEventLogHandler(Handler): - def __init__(self, appname: str, dllname: str = ..., - logtype: str = ...) -> None: ... + def __init__(self, appname: str, dllname: Optional[str] = ..., logtype: str = ...) -> None: ... def getEventCategory(self, record: LogRecord) -> int: ... # TODO correct return value? def getEventType(self, record: LogRecord) -> int: ... def getMessageID(self, record: LogRecord) -> int: ... - class SMTPHandler(Handler): # TODO `secure` can also be an empty tuple if sys.version_info >= (3,): - def __init__(self, mailhost: Union[str, Tuple[str, int]], fromaddr: str, - toaddrs: List[str], subject: str, - credentials: Optional[Tuple[str, str]] = ..., - secure: Union[Tuple[str], Tuple[str, str], None] = ..., - timeout: float = ...) -> None: ... + def __init__( + self, + mailhost: Union[str, Tuple[str, int]], + fromaddr: str, + toaddrs: List[str], + subject: str, + credentials: Optional[Tuple[str, str]] = ..., + secure: Union[Tuple[str], Tuple[str, str], None] = ..., + timeout: float = ..., + ) -> None: ... else: - def __init__(self, - mailhost: Union[str, Tuple[str, int]], fromaddr: str, - toaddrs: List[str], subject: str, - credentials: Optional[Tuple[str, str]] = ..., - secure: Union[Tuple[str], Tuple[str, str], None] = ...) -> None: ... + def __init__( + self, + mailhost: Union[str, Tuple[str, int]], + fromaddr: str, + toaddrs: List[str], + subject: str, + credentials: Optional[Tuple[str, str]] = ..., + secure: Union[Tuple[str], Tuple[str, str], None] = ..., + ) -> None: ... def getSubject(self, record: LogRecord) -> str: ... - class BufferingHandler(Handler): buffer: List[LogRecord] def __init__(self, capacity: int) -> None: ... def shouldFlush(self, record: LogRecord) -> bool: ... class MemoryHandler(BufferingHandler): - def __init__(self, capacity: int, flushLevel: int = ..., - target: Optional[Handler] = ...) -> None: ... + if sys.version_info >= (3, 6): + def __init__( + self, capacity: int, flushLevel: int = ..., target: Optional[Handler] = ..., flushOnClose: bool = ... + ) -> None: ... + else: + def __init__(self, capacity: int, flushLevel: int = ..., target: Optional[Handler] = ...) -> None: ... def setTarget(self, target: Handler) -> None: ... - class HTTPHandler(Handler): if sys.version_info >= (3, 5): - def __init__(self, host: str, url: str, method: str = ..., - secure: bool = ..., - credentials: Optional[Tuple[str, str]] = ..., - context: Optional[ssl.SSLContext] = ...) -> None: ... + def __init__( + self, + host: str, + url: str, + method: str = ..., + secure: bool = ..., + credentials: Optional[Tuple[str, str]] = ..., + context: Optional[ssl.SSLContext] = ..., + ) -> None: ... elif sys.version_info >= (3,): - def __init__(self, - host: str, url: str, method: str = ..., secure: bool = ..., - credentials: Optional[Tuple[str, str]] = ...) -> None: ... + def __init__( + self, host: str, url: str, method: str = ..., secure: bool = ..., credentials: Optional[Tuple[str, str]] = ... + ) -> None: ... else: - def __init__(self, - host: str, url: str, method: str = ...) -> None: ... + def __init__(self, host: str, url: str, method: str = ...) -> None: ... def mapLogRecord(self, record: LogRecord) -> Dict[str, Any]: ... - if sys.version_info >= (3,): class QueueHandler(Handler): if sys.version_info >= (3, 7): @@ -196,18 +242,15 @@ if sys.version_info >= (3,): def __init__(self, queue: Queue[Any]) -> None: ... def prepare(self, record: LogRecord) -> Any: ... def enqueue(self, record: LogRecord) -> None: ... - class QueueListener: if sys.version_info >= (3, 7): - def __init__(self, queue: Union[SimpleQueue[Any], Queue[Any]], - *handlers: Handler, - respect_handler_level: bool = ...) -> None: ... + def __init__( + self, queue: Union[SimpleQueue[Any], Queue[Any]], *handlers: Handler, respect_handler_level: bool = ... + ) -> None: ... elif sys.version_info >= (3, 5): - def __init__(self, queue: Queue[Any], *handlers: Handler, - respect_handler_level: bool = ...) -> None: ... + def __init__(self, queue: Queue[Any], *handlers: Handler, respect_handler_level: bool = ...) -> None: ... else: - def __init__(self, - queue: Queue, *handlers: Handler) -> None: ... + def __init__(self, queue: Queue, *handlers: Handler) -> None: ... def dequeue(self, block: bool) -> LogRecord: ... def prepare(self, record: LogRecord) -> Any: ... def start(self) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/macpath.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/macpath.pyi old mode 100755 new mode 100644 index 324fc7b3..0b5ccbf0 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/macpath.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/macpath.pyi @@ -1,22 +1,13 @@ -# Stubs for os.path -# Ron Murawski - import os import sys -from typing import overload, List, Any, AnyStr, Sequence, Tuple, TypeVar, Union, Text, Callable, Optional +from _typeshed import AnyPath, BytesPath, StrPath +from typing import Any, AnyStr, Callable, List, Optional, Sequence, Text, Tuple, TypeVar, Union, overload if sys.version_info < (3, 8): - _T = TypeVar('_T') + _T = TypeVar("_T") if sys.version_info >= (3, 6): from builtins import _PathLike - _PathType = Union[bytes, Text, _PathLike] - _StrPath = Union[Text, _PathLike[Text]] - _BytesPath = Union[bytes, _PathLike[bytes]] - else: - _PathType = Union[bytes, Text] - _StrPath = Text - _BytesPath = bytes # ----- os.path variables ----- supports_unicode_filenames: bool @@ -38,13 +29,13 @@ if sys.version_info < (3, 8): @overload def abspath(path: AnyStr) -> AnyStr: ... @overload - def basename(path: _PathLike[AnyStr]) -> AnyStr: ... + def basename(s: _PathLike[AnyStr]) -> AnyStr: ... @overload - def basename(path: AnyStr) -> AnyStr: ... + def basename(s: AnyStr) -> AnyStr: ... @overload - def dirname(path: _PathLike[AnyStr]) -> AnyStr: ... + def dirname(s: _PathLike[AnyStr]) -> AnyStr: ... @overload - def dirname(path: AnyStr) -> AnyStr: ... + def dirname(s: AnyStr) -> AnyStr: ... @overload def expanduser(path: _PathLike[AnyStr]) -> AnyStr: ... @overload @@ -58,64 +49,42 @@ if sys.version_info < (3, 8): @overload def normcase(path: AnyStr) -> AnyStr: ... @overload - def normpath(path: _PathLike[AnyStr]) -> AnyStr: ... - @overload - def normpath(path: AnyStr) -> AnyStr: ... - if sys.platform == 'win32': - @overload - def realpath(path: _PathLike[AnyStr]) -> AnyStr: ... - @overload - def realpath(path: AnyStr) -> AnyStr: ... - else: - @overload - def realpath(filename: _PathLike[AnyStr]) -> AnyStr: ... - @overload - def realpath(filename: AnyStr) -> AnyStr: ... - + def normpath(s: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def normpath(s: AnyStr) -> AnyStr: ... + @overload + def realpath(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def realpath(path: AnyStr) -> AnyStr: ... else: def abspath(path: AnyStr) -> AnyStr: ... - def basename(path: AnyStr) -> AnyStr: ... - def dirname(path: AnyStr) -> AnyStr: ... + def basename(s: AnyStr) -> AnyStr: ... + def dirname(s: AnyStr) -> AnyStr: ... def expanduser(path: AnyStr) -> AnyStr: ... def expandvars(path: AnyStr) -> AnyStr: ... def normcase(path: AnyStr) -> AnyStr: ... - def normpath(path: AnyStr) -> AnyStr: ... - if sys.platform == 'win32': - def realpath(path: AnyStr) -> AnyStr: ... - else: - def realpath(filename: AnyStr) -> AnyStr: ... - - if sys.version_info >= (3, 6): - # In reality it returns str for sequences of _StrPath and bytes for sequences - # of _BytesPath, but mypy does not accept such a signature. - def commonpath(paths: Sequence[_PathType]) -> Any: ... - elif sys.version_info >= (3, 5): - def commonpath(paths: Sequence[AnyStr]) -> AnyStr: ... - + def normpath(s: AnyStr) -> AnyStr: ... + def realpath(path: AnyStr) -> AnyStr: ... # NOTE: Empty lists results in '' (str) regardless of contained type. # Also, in Python 2 mixed sequences of Text and bytes results in either Text or bytes # So, fall back to Any - def commonprefix(list: Sequence[_PathType]) -> Any: ... - + def commonprefix(m: Sequence[AnyPath]) -> Any: ... if sys.version_info >= (3, 3): - def exists(path: Union[_PathType, int]) -> bool: ... + def exists(path: Union[AnyPath, int]) -> bool: ... else: - def exists(path: _PathType) -> bool: ... - def lexists(path: _PathType) -> bool: ... - + def exists(path: AnyPath) -> bool: ... + def lexists(path: AnyPath) -> bool: ... # These return float if os.stat_float_times() == True, # but int is a subclass of float. - def getatime(path: _PathType) -> float: ... - def getmtime(path: _PathType) -> float: ... - def getctime(path: _PathType) -> float: ... - - def getsize(path: _PathType) -> int: ... - def isabs(path: _PathType) -> bool: ... - def isfile(path: _PathType) -> bool: ... - def isdir(path: _PathType) -> bool: ... - def islink(path: _PathType) -> bool: ... - def ismount(path: _PathType) -> bool: ... - + def getatime(filename: AnyPath) -> float: ... + def getmtime(filename: AnyPath) -> float: ... + def getctime(filename: AnyPath) -> float: ... + def getsize(filename: AnyPath) -> int: ... + def isabs(s: AnyPath) -> bool: ... + def isfile(path: AnyPath) -> bool: ... + def isdir(s: AnyPath) -> bool: ... + def islink(s: AnyPath) -> bool: ... + def ismount(s: AnyPath) -> bool: ... if sys.version_info < (3, 0): # Make sure signatures are disjunct, and allow combinations of bytes and unicode. # (Since Python 2 allows that, too) @@ -124,48 +93,40 @@ if sys.version_info < (3, 8): @overload def join(__p1: bytes, *p: bytes) -> bytes: ... @overload - def join(__p1: bytes, __p2: bytes, __p3: bytes, __p4: Text, *p: _PathType) -> Text: ... + def join(__p1: bytes, __p2: bytes, __p3: bytes, __p4: Text, *p: AnyPath) -> Text: ... @overload - def join(__p1: bytes, __p2: bytes, __p3: Text, *p: _PathType) -> Text: ... + def join(__p1: bytes, __p2: bytes, __p3: Text, *p: AnyPath) -> Text: ... @overload - def join(__p1: bytes, __p2: Text, *p: _PathType) -> Text: ... + def join(__p1: bytes, __p2: Text, *p: AnyPath) -> Text: ... @overload - def join(__p1: Text, *p: _PathType) -> Text: ... + def join(__p1: Text, *p: AnyPath) -> Text: ... elif sys.version_info >= (3, 6): - # Mypy complains that the signatures overlap (same for relpath below), but things seem to behave correctly anyway. + # Mypy complains that the signatures overlap, but things seem to behave correctly anyway. @overload - def join(path: _StrPath, *paths: _StrPath) -> Text: ... + def join(s: StrPath, *paths: StrPath) -> Text: ... @overload - def join(path: _BytesPath, *paths: _BytesPath) -> bytes: ... + def join(s: BytesPath, *paths: BytesPath) -> bytes: ... else: - def join(path: AnyStr, *paths: AnyStr) -> AnyStr: ... - - @overload - def relpath(path: _BytesPath, start: Optional[_BytesPath] = ...) -> bytes: ... - @overload - def relpath(path: _StrPath, start: Optional[_StrPath] = ...) -> Text: ... - - def samefile(path1: _PathType, path2: _PathType) -> bool: ... + def join(s: AnyStr, *paths: AnyStr) -> AnyStr: ... + def samefile(f1: AnyPath, f2: AnyPath) -> bool: ... def sameopenfile(fp1: int, fp2: int) -> bool: ... - def samestat(stat1: os.stat_result, stat2: os.stat_result) -> bool: ... - + def samestat(s1: os.stat_result, s2: os.stat_result) -> bool: ... if sys.version_info >= (3, 6): @overload - def split(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... + def split(s: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... @overload - def split(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + def split(s: AnyStr) -> Tuple[AnyStr, AnyStr]: ... @overload - def splitdrive(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... + def splitdrive(p: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... @overload - def splitdrive(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + def splitdrive(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ... @overload - def splitext(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... + def splitext(p: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... @overload - def splitext(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + def splitext(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ... else: - def split(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... - def splitdrive(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... - def splitext(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... - + def split(s: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + def splitdrive(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + def splitext(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ... if sys.version_info < (3,): def walk(path: AnyStr, visit: Callable[[_T, AnyStr, List[AnyStr]], Any], arg: _T) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/mailbox.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/mailbox.pyi old mode 100755 new mode 100644 index 0793f27f..27377f8c --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/mailbox.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/mailbox.pyi @@ -1,19 +1,32 @@ - -from typing import Optional, Union, Text, AnyStr, Callable, IO, Any, Iterator, List, Tuple, TypeVar, Protocol, Dict, Sequence, Iterable, Generic, Type, Mapping, overload -from types import TracebackType +import email.message import sys -import email - -if sys.version_info >= (3, 8): - from typing import Literal -else: - from typing_extensions import Literal - -if sys.version_info >= (3, 6): - from builtins import _PathLike - _PathType = Union[bytes, Text, _PathLike] -else: - _PathType = Union[bytes, Text] +from _typeshed import AnyPath +from types import TracebackType +from typing import ( + IO, + Any, + AnyStr, + Callable, + Dict, + Generic, + Iterable, + Iterator, + List, + Mapping, + Optional, + Protocol, + Sequence, + Text, + Tuple, + Type, + TypeVar, + Union, + overload, +) +from typing_extensions import Literal + +if sys.version_info >= (3, 9): + from types import GenericAlias _T = TypeVar("_T") _MessageType = TypeVar("_MessageType", bound=Message) @@ -31,8 +44,7 @@ class Mailbox(Generic[_MessageType]): _path: Union[bytes, str] # undocumented _factory: Optional[Callable[[IO[Any]], _MessageType]] # undocumented - - def __init__(self, path: _PathType, factory: Optional[Callable[[IO[Any]], _MessageType]] = ..., create: bool = ...) -> None: ... + def __init__(self, path: AnyPath, factory: Optional[Callable[[IO[Any]], _MessageType]] = ..., create: bool = ...) -> None: ... def add(self, message: _MessageData) -> str: ... def remove(self, key: str) -> None: ... def __delitem__(self, key: str) -> None: ... @@ -68,14 +80,16 @@ class Mailbox(Generic[_MessageType]): def lock(self) -> None: ... def unlock(self) -> None: ... def close(self) -> None: ... + if sys.version_info >= (3, 9): + def __class_getitem__(cls, item: Any) -> GenericAlias: ... class Maildir(Mailbox[MaildirMessage]): colon: str - - def __init__(self, dirname: _PathType, factory: Optional[Callable[[IO[Any]], MaildirMessage]] = ..., create: bool = ...) -> None: ... + def __init__( + self, dirname: AnyPath, factory: Optional[Callable[[IO[Any]], MaildirMessage]] = ..., create: bool = ... + ) -> None: ... def get_file(self, key: str) -> _ProxyFile[bytes]: ... - def list_folders(self) -> List[str]: ... def get_folder(self, folder: Text) -> Maildir: ... def add_folder(self, folder: Text) -> Maildir: ... @@ -86,43 +100,40 @@ class Maildir(Mailbox[MaildirMessage]): class _singlefileMailbox(Mailbox[_MessageType]): ... class _mboxMMDF(_singlefileMailbox[_MessageType]): - def get_file(self, key: str) -> _PartialFile[bytes]: ... class mbox(_mboxMMDF[mboxMessage]): - - def __init__(self, dirname: _PathType, factory: Optional[Callable[[IO[Any]], mboxMessage]] = ..., create: bool = ...) -> None: ... + def __init__( + self, dirname: AnyPath, factory: Optional[Callable[[IO[Any]], mboxMessage]] = ..., create: bool = ... + ) -> None: ... class MMDF(_mboxMMDF[MMDFMessage]): - - def __init__(self, dirname: _PathType, factory: Optional[Callable[[IO[Any]], MMDFMessage]] = ..., create: bool = ...) -> None: ... + def __init__( + self, dirname: AnyPath, factory: Optional[Callable[[IO[Any]], MMDFMessage]] = ..., create: bool = ... + ) -> None: ... class MH(Mailbox[MHMessage]): - - def __init__(self, dirname: _PathType, factory: Optional[Callable[[IO[Any]], MHMessage]] = ..., create: bool = ...) -> None: ... + def __init__(self, dirname: AnyPath, factory: Optional[Callable[[IO[Any]], MHMessage]] = ..., create: bool = ...) -> None: ... def get_file(self, key: str) -> _ProxyFile[bytes]: ... - def list_folders(self) -> List[str]: ... - def get_folder(self, folder: _PathType) -> MH: ... - def add_folder(self, folder: _PathType) -> MH: ... - def remove_folder(self, folder: _PathType) -> None: ... + def get_folder(self, folder: AnyPath) -> MH: ... + def add_folder(self, folder: AnyPath) -> MH: ... + def remove_folder(self, folder: AnyPath) -> None: ... def get_sequences(self) -> Dict[str, List[int]]: ... def set_sequences(self, sequences: Mapping[str, Sequence[int]]) -> None: ... def pack(self) -> None: ... class Babyl(_singlefileMailbox[BabylMessage]): - - def __init__(self, dirname: _PathType, factory: Optional[Callable[[IO[Any]], BabylMessage]] = ..., create: bool = ...) -> None: ... - + def __init__( + self, dirname: AnyPath, factory: Optional[Callable[[IO[Any]], BabylMessage]] = ..., create: bool = ... + ) -> None: ... def get_file(self, key: str) -> IO[bytes]: ... def get_labels(self) -> List[str]: ... class Message(email.message.Message): - def __init__(self, message: Optional[_MessageData] = ...) -> None: ... class MaildirMessage(Message): - def get_subdir(self) -> str: ... def set_subdir(self, subdir: Literal["new", "cur"]) -> None: ... def get_flags(self) -> str: ... @@ -130,14 +141,15 @@ class MaildirMessage(Message): def add_flag(self, flag: str) -> None: ... def remove_flag(self, flag: str) -> None: ... def get_date(self) -> int: ... - def set_date(self, date: int) -> None: ... + def set_date(self, date: float) -> None: ... def get_info(self) -> str: ... def set_info(self, info: str) -> None: ... class _mboxMMDFMessage(Message): - def get_from(self) -> str: ... - def set_from(self, from_: str, time_: Optional[Union[bool, Tuple[int, int, int, int, int, int, int, int, int]]] = ...) -> None: ... + def set_from( + self, from_: str, time_: Optional[Union[bool, Tuple[int, int, int, int, int, int, int, int, int]]] = ... + ) -> None: ... def get_flags(self) -> str: ... def set_flags(self, flags: Iterable[str]) -> None: ... def add_flag(self, flag: str) -> None: ... @@ -146,14 +158,12 @@ class _mboxMMDFMessage(Message): class mboxMessage(_mboxMMDFMessage): ... class MHMessage(Message): - def get_sequences(self) -> List[str]: ... def set_sequences(self, sequences: Iterable[str]) -> None: ... def add_sequence(self, sequence: str) -> None: ... def remove_sequence(self, sequence: str) -> None: ... class BabylMessage(Message): - def get_labels(self) -> List[str]: ... def set_labels(self, labels: Iterable[str]) -> None: ... def add_label(self, label: str) -> None: ... @@ -165,7 +175,6 @@ class BabylMessage(Message): class MMDFMessage(_mboxMMDFMessage): ... class _ProxyFile(Generic[AnyStr]): - def __init__(self, f: IO[AnyStr], pos: Optional[int] = ...) -> None: ... def read(self, size: Optional[int] = ...) -> AnyStr: ... def read1(self, size: Optional[int] = ...) -> AnyStr: ... @@ -176,24 +185,23 @@ class _ProxyFile(Generic[AnyStr]): def seek(self, offset: int, whence: int = ...) -> None: ... def close(self) -> None: ... def __enter__(self) -> _ProxyFile[AnyStr]: ... - def __exit__(self, exc_type: Optional[Type[BaseException]], exc: Optional[BaseException], tb: Optional[TracebackType]) -> None: ... + def __exit__( + self, exc_type: Optional[Type[BaseException]], exc: Optional[BaseException], tb: Optional[TracebackType] + ) -> None: ... def readable(self) -> bool: ... def writable(self) -> bool: ... def seekable(self) -> bool: ... def flush(self) -> None: ... @property def closed(self) -> bool: ... + if sys.version_info >= (3, 9): + def __class_getitem__(cls, item: Any) -> GenericAlias: ... class _PartialFile(_ProxyFile[AnyStr]): - def __init__(self, f: IO[AnyStr], start: Optional[int] = ..., stop: Optional[int] = ...) -> None: ... class Error(Exception): ... - class NoSuchMailboxError(Error): ... - class NotEmptyError(Error): ... - class ExternalClashError(Error): ... - class FormatError(Error): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/mailcap.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/mailcap.pyi old mode 100755 new mode 100644 index 8f9689d9..a65cc3a3 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/mailcap.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/mailcap.pyi @@ -1,7 +1,8 @@ - -from typing import Sequence, Dict, List, Union, Tuple, Optional, Mapping +from typing import Dict, List, Mapping, Optional, Sequence, Tuple, Union _Cap = Dict[str, Union[str, int]] -def findmatch(caps: Mapping[str, List[_Cap]], MIMEtype: str, key: str = ..., filename: str = ..., plist: Sequence[str] = ...) -> Tuple[Optional[str], Optional[_Cap]]: ... +def findmatch( + caps: Mapping[str, List[_Cap]], MIMEtype: str, key: str = ..., filename: str = ..., plist: Sequence[str] = ... +) -> Tuple[Optional[str], Optional[_Cap]]: ... def getcaps() -> Dict[str, List[_Cap]]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/marshal.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/marshal.pyi old mode 100755 new mode 100644 index 9848f775..b2fde674 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/marshal.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/marshal.pyi @@ -1,8 +1,8 @@ -from typing import Any, IO +from typing import IO, Any version: int -def dump(value: Any, file: IO[Any], version: int = ...) -> None: ... -def load(file: IO[Any]) -> Any: ... -def dumps(value: Any, version: int = ...) -> bytes: ... -def loads(string: bytes) -> Any: ... +def dump(__value: Any, __file: IO[Any], __version: int = ...) -> None: ... +def load(__file: IO[Any]) -> Any: ... +def dumps(__value: Any, __version: int = ...) -> bytes: ... +def loads(__bytes: bytes) -> Any: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/math.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/math.pyi old mode 100755 new mode 100644 index aa8b191a..6f9a8999 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/math.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/math.pyi @@ -1,9 +1,5 @@ -# Stubs for math -# See: http://docs.python.org/2/library/math.html - -from typing import Tuple, Iterable, SupportsFloat, SupportsInt, overload - import sys +from typing import Iterable, Optional, SupportsFloat, SupportsInt, Tuple, overload e: float pi: float @@ -13,71 +9,113 @@ if sys.version_info >= (3, 5): if sys.version_info >= (3, 6): tau: float -def acos(x: SupportsFloat) -> float: ... -def acosh(x: SupportsFloat) -> float: ... -def asin(x: SupportsFloat) -> float: ... -def asinh(x: SupportsFloat) -> float: ... -def atan(x: SupportsFloat) -> float: ... -def atan2(y: SupportsFloat, x: SupportsFloat) -> float: ... -def atanh(x: SupportsFloat) -> float: ... +def acos(__x: SupportsFloat) -> float: ... +def acosh(__x: SupportsFloat) -> float: ... +def asin(__x: SupportsFloat) -> float: ... +def asinh(__x: SupportsFloat) -> float: ... +def atan(__x: SupportsFloat) -> float: ... +def atan2(__y: SupportsFloat, __x: SupportsFloat) -> float: ... +def atanh(__x: SupportsFloat) -> float: ... + if sys.version_info >= (3,): - def ceil(x: SupportsFloat) -> int: ... + def ceil(__x: SupportsFloat) -> int: ... + else: - def ceil(x: SupportsFloat) -> float: ... -def copysign(x: SupportsFloat, y: SupportsFloat) -> float: ... -def cos(x: SupportsFloat) -> float: ... -def cosh(x: SupportsFloat) -> float: ... -def degrees(x: SupportsFloat) -> float: ... + def ceil(__x: SupportsFloat) -> float: ... + +if sys.version_info >= (3, 8): + def comb(__n: int, __k: int) -> int: ... + +def copysign(__x: SupportsFloat, __y: SupportsFloat) -> float: ... +def cos(__x: SupportsFloat) -> float: ... +def cosh(__x: SupportsFloat) -> float: ... +def degrees(__x: SupportsFloat) -> float: ... + if sys.version_info >= (3, 8): def dist(__p: Iterable[SupportsFloat], __q: Iterable[SupportsFloat]) -> float: ... -def erf(x: SupportsFloat) -> float: ... -def erfc(x: SupportsFloat) -> float: ... -def exp(x: SupportsFloat) -> float: ... -def expm1(x: SupportsFloat) -> float: ... -def fabs(x: SupportsFloat) -> float: ... -def factorial(x: SupportsInt) -> int: ... + +def erf(__x: SupportsFloat) -> float: ... +def erfc(__x: SupportsFloat) -> float: ... +def exp(__x: SupportsFloat) -> float: ... +def expm1(__x: SupportsFloat) -> float: ... +def fabs(__x: SupportsFloat) -> float: ... +def factorial(__x: SupportsInt) -> int: ... + if sys.version_info >= (3,): - def floor(x: SupportsFloat) -> int: ... + def floor(__x: SupportsFloat) -> int: ... + else: - def floor(x: SupportsFloat) -> float: ... -def fmod(x: SupportsFloat, y: SupportsFloat) -> float: ... -def frexp(x: SupportsFloat) -> Tuple[float, int]: ... -def fsum(iterable: Iterable[float]) -> float: ... -def gamma(x: SupportsFloat) -> float: ... -if sys.version_info >= (3, 5): - def gcd(a: int, b: int) -> int: ... + def floor(__x: SupportsFloat) -> float: ... + +def fmod(__x: SupportsFloat, __y: SupportsFloat) -> float: ... +def frexp(__x: SupportsFloat) -> Tuple[float, int]: ... +def fsum(__seq: Iterable[float]) -> float: ... +def gamma(__x: SupportsFloat) -> float: ... + +if sys.version_info >= (3, 9): + def gcd(*integers: int) -> int: ... + +elif sys.version_info >= (3, 5): + def gcd(__x: int, __y: int) -> int: ... + if sys.version_info >= (3, 8): def hypot(*coordinates: SupportsFloat) -> float: ... + else: def hypot(__x: SupportsFloat, __y: SupportsFloat) -> float: ... + if sys.version_info >= (3, 5): - def isclose(a: SupportsFloat, b: SupportsFloat, rel_tol: SupportsFloat = ..., abs_tol: SupportsFloat = ...) -> bool: ... -def isinf(x: SupportsFloat) -> bool: ... + def isclose(a: SupportsFloat, b: SupportsFloat, *, rel_tol: SupportsFloat = ..., abs_tol: SupportsFloat = ...) -> bool: ... + +def isinf(__x: SupportsFloat) -> bool: ... + if sys.version_info >= (3,): - def isfinite(x: SupportsFloat) -> bool: ... -def isnan(x: SupportsFloat) -> bool: ... + def isfinite(__x: SupportsFloat) -> bool: ... + +def isnan(__x: SupportsFloat) -> bool: ... + if sys.version_info >= (3, 8): def isqrt(__n: int) -> int: ... -def ldexp(x: SupportsFloat, i: int) -> float: ... -def lgamma(x: SupportsFloat) -> float: ... + +if sys.version_info >= (3, 9): + def lcm(*integers: int) -> int: ... + +def ldexp(__x: SupportsFloat, __i: int) -> float: ... +def lgamma(__x: SupportsFloat) -> float: ... def log(x: SupportsFloat, base: SupportsFloat = ...) -> float: ... -def log10(x: SupportsFloat) -> float: ... -def log1p(x: SupportsFloat) -> float: ... +def log10(__x: SupportsFloat) -> float: ... +def log1p(__x: SupportsFloat) -> float: ... + if sys.version_info >= (3, 3): - def log2(x: SupportsFloat) -> float: ... -def modf(x: SupportsFloat) -> Tuple[float, float]: ... -def pow(x: SupportsFloat, y: SupportsFloat) -> float: ... + def log2(__x: SupportsFloat) -> float: ... + +def modf(__x: SupportsFloat) -> Tuple[float, float]: ... + +if sys.version_info >= (3, 9): + def nextafter(__x: SupportsFloat, __y: SupportsFloat) -> float: ... + +if sys.version_info >= (3, 8): + def perm(__n: int, __k: Optional[int] = ...) -> int: ... + +def pow(__x: SupportsFloat, __y: SupportsFloat) -> float: ... + if sys.version_info >= (3, 8): @overload def prod(__iterable: Iterable[int], *, start: int = ...) -> int: ... # type: ignore @overload def prod(__iterable: Iterable[SupportsFloat], *, start: SupportsFloat = ...) -> float: ... -def radians(x: SupportsFloat) -> float: ... + +def radians(__x: SupportsFloat) -> float: ... + if sys.version_info >= (3, 7): - def remainder(x: SupportsFloat, y: SupportsFloat) -> float: ... -def sin(x: SupportsFloat) -> float: ... -def sinh(x: SupportsFloat) -> float: ... -def sqrt(x: SupportsFloat) -> float: ... -def tan(x: SupportsFloat) -> float: ... -def tanh(x: SupportsFloat) -> float: ... -def trunc(x: SupportsFloat) -> int: ... + def remainder(__x: SupportsFloat, __y: SupportsFloat) -> float: ... + +def sin(__x: SupportsFloat) -> float: ... +def sinh(__x: SupportsFloat) -> float: ... +def sqrt(__x: SupportsFloat) -> float: ... +def tan(__x: SupportsFloat) -> float: ... +def tanh(__x: SupportsFloat) -> float: ... +def trunc(__x: SupportsFloat) -> int: ... + +if sys.version_info >= (3, 9): + def ulp(__x: SupportsFloat) -> float: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/mimetypes.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/mimetypes.pyi old mode 100755 new mode 100644 index eb830279..43f27dda --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/mimetypes.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/mimetypes.pyi @@ -1,13 +1,15 @@ -# Stubs for mimetypes - -from typing import Dict, IO, List, Optional, Sequence, Text, Tuple import sys +from typing import IO, Dict, List, Optional, Sequence, Text, Tuple, Union + +if sys.version_info >= (3, 8): + from os import PathLike + def guess_type(url: Union[Text, PathLike[str]], strict: bool = ...) -> Tuple[Optional[str], Optional[str]]: ... + +else: + def guess_type(url: Text, strict: bool = ...) -> Tuple[Optional[str], Optional[str]]: ... -def guess_type(url: Text, - strict: bool = ...) -> Tuple[Optional[str], Optional[str]]: ... def guess_all_extensions(type: str, strict: bool = ...) -> List[str]: ... def guess_extension(type: str, strict: bool = ...) -> Optional[str]: ... - def init(files: Optional[Sequence[str]] = ...) -> None: ... def read_mime_types(filename: str) -> Optional[Dict[str, str]]: ... def add_type(type: str, ext: str, strict: bool = ...) -> None: ... @@ -24,15 +26,11 @@ class MimeTypes: encodings_map: Dict[str, str] types_map: Tuple[Dict[str, str], Dict[str, str]] types_map_inv: Tuple[Dict[str, str], Dict[str, str]] - def __init__(self, filenames: Tuple[str, ...] = ..., - strict: bool = ...) -> None: ... - def guess_extension(self, type: str, - strict: bool = ...) -> Optional[str]: ... - def guess_type(self, url: str, - strict: bool = ...) -> Tuple[Optional[str], Optional[str]]: ... - def guess_all_extensions(self, type: str, - strict: bool = ...) -> List[str]: ... + def __init__(self, filenames: Tuple[str, ...] = ..., strict: bool = ...) -> None: ... + def guess_extension(self, type: str, strict: bool = ...) -> Optional[str]: ... + def guess_type(self, url: str, strict: bool = ...) -> Tuple[Optional[str], Optional[str]]: ... + def guess_all_extensions(self, type: str, strict: bool = ...) -> List[str]: ... def read(self, filename: str, strict: bool = ...) -> None: ... def readfp(self, fp: IO[str], strict: bool = ...) -> None: ... - if sys.platform == 'win32': + if sys.platform == "win32": def read_windows_registry(self, strict: bool = ...) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/mmap.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/mmap.pyi old mode 100755 new mode 100644 index aff41b9b..7039e3da --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/mmap.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/mmap.pyi @@ -1,6 +1,6 @@ import sys -from typing import (Optional, Sequence, Union, Generic, overload, - Iterable, Iterator, Sized, ContextManager, AnyStr) +from _typeshed import ReadableBuffer +from typing import AnyStr, ContextManager, Generic, Iterable, Iterator, Optional, Sequence, Sized, Union, overload ACCESS_DEFAULT: int ACCESS_READ: int @@ -9,7 +9,7 @@ ACCESS_COPY: int ALLOCATIONGRANULARITY: int -if sys.platform != 'win32': +if sys.platform != "win32": MAP_ANON: int MAP_ANONYMOUS: int MAP_DENYWRITE: int @@ -23,40 +23,41 @@ if sys.platform != 'win32': PAGESIZE: int class _mmap(Generic[AnyStr]): - if sys.platform == 'win32': - def __init__(self, fileno: int, length: int, - tagname: Optional[str] = ..., access: int = ..., - offset: int = ...) -> None: ... + if sys.platform == "win32": + def __init__( + self, fileno: int, length: int, tagname: Optional[str] = ..., access: int = ..., offset: int = ... + ) -> None: ... else: - def __init__(self, - fileno: int, length: int, flags: int = ..., - prot: int = ..., access: int = ..., - offset: int = ...) -> None: ... + def __init__( + self, fileno: int, length: int, flags: int = ..., prot: int = ..., access: int = ..., offset: int = ... + ) -> None: ... def close(self) -> None: ... - def find(self, sub: AnyStr, - start: int = ..., end: int = ...) -> int: ... if sys.version_info >= (3, 8): def flush(self, offset: int = ..., size: int = ...) -> None: ... else: def flush(self, offset: int = ..., size: int = ...) -> int: ... def move(self, dest: int, src: int, count: int) -> None: ... - def read(self, n: int = ...) -> AnyStr: ... def read_byte(self) -> AnyStr: ... def readline(self) -> AnyStr: ... def resize(self, newsize: int) -> None: ... def seek(self, pos: int, whence: int = ...) -> None: ... def size(self) -> int: ... def tell(self) -> int: ... - def write(self, bytes: AnyStr) -> None: ... def write_byte(self, byte: AnyStr) -> None: ... def __len__(self) -> int: ... if sys.version_info >= (3,): class mmap(_mmap[bytes], ContextManager[mmap], Iterable[bytes], Sized): closed: bool - if sys.version_info >= (3, 8): + if sys.version_info >= (3, 8) and sys.platform != "win32": def madvise(self, option: int, start: int = ..., length: int = ...) -> None: ... - def rfind(self, sub: bytes, start: int = ..., stop: int = ...) -> int: ... + def find(self, sub: ReadableBuffer, start: int = ..., stop: int = ...) -> int: ... + def rfind(self, sub: ReadableBuffer, start: int = ..., stop: int = ...) -> int: ... + def read(self, n: Optional[int] = ...) -> bytes: ... + if sys.version_info >= (3, 6): + def write(self, bytes: ReadableBuffer) -> int: ... + else: + def write(self, bytes: ReadableBuffer) -> None: ... @overload def __getitem__(self, index: int) -> int: ... @overload @@ -69,9 +70,13 @@ if sys.version_info >= (3,): # Doesn't actually exist, but the object is actually iterable because it has __getitem__ and # __len__, so we claim that there is also an __iter__ to help type checkers. def __iter__(self) -> Iterator[bytes]: ... + else: class mmap(_mmap[bytes], Sequence[bytes]): + def find(self, string: bytes, start: int = ..., end: int = ...) -> int: ... def rfind(self, string: bytes, start: int = ..., stop: int = ...) -> int: ... + def read(self, num: int) -> bytes: ... + def write(self, string: bytes) -> None: ... def __getitem__(self, index: Union[int, slice]) -> bytes: ... def __getslice__(self, i: Optional[int], j: Optional[int]) -> bytes: ... def __delitem__(self, index: Union[int, slice]) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/modulefinder.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/modulefinder.pyi old mode 100755 new mode 100644 index da99f29f..89119b60 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/modulefinder.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/modulefinder.pyi @@ -1,6 +1,6 @@ - -from typing import Optional, Container, Dict, Sequence, Tuple, List, Any, Iterator, IO, Iterable +import sys from types import CodeType +from typing import IO, Any, Container, Dict, Iterable, Iterator, List, Optional, Sequence, Tuple LOAD_CONST: int # undocumented IMPORT_NAME: int # undocumented @@ -10,26 +10,51 @@ STORE_OPS: Tuple[int, int] # undocumented EXTENDED_ARG: int # undocumented packagePathMap: Dict[str, List[str]] # undocumented + def AddPackagePath(packagename: str, path: str) -> None: ... + replacePackageMap: Dict[str, str] # undocumented + def ReplacePackage(oldname: str, newname: str) -> None: ... class Module: # undocumented - def __init__(self, name: str, file: Optional[str] = ..., path: Optional[str] = ...) -> None: ... def __repr__(self) -> str: ... class ModuleFinder: modules: Dict[str, Module] + path: List[str] # undocumented + badmodules: Dict[str, Dict[str, int]] # undocumented + debug: int # undocumented + indent: int # undocumented + excludes: Container[str] # undocumented + replace_paths: Sequence[Tuple[str, str]] # undocumented - def __init__(self, path: Optional[List[str]] = ..., debug: int = ..., excludes: Container[str] = ..., replace_paths: Sequence[Tuple[str, str]] = ...) -> None: ... + if sys.version_info >= (3, 8): + def __init__( + self, + path: Optional[List[str]] = ..., + debug: int = ..., + excludes: Optional[Container[str]] = ..., + replace_paths: Optional[Sequence[Tuple[str, str]]] = ..., + ) -> None: ... + else: + def __init__( + self, + path: Optional[List[str]] = ..., + debug: int = ..., + excludes: Container[str] = ..., + replace_paths: Sequence[Tuple[str, str]] = ..., + ) -> None: ... def msg(self, level: int, str: str, *args: Any) -> None: ... # undocumented def msgin(self, *args: Any) -> None: ... # undocumented def msgout(self, *args: Any) -> None: ... # undocumented def run_script(self, pathname: str) -> None: ... def load_file(self, pathname: str) -> None: ... # undocumented - def import_hook(self, name: str, caller: Optional[Module] = ..., fromlist: Optional[List[str]] = ..., level: int = ...) -> Optional[Module]: ... # undocumented + def import_hook( + self, name: str, caller: Optional[Module] = ..., fromlist: Optional[List[str]] = ..., level: int = ... + ) -> Optional[Module]: ... # undocumented def determine_parent(self, caller: Optional[Module], level: int = ...) -> Optional[Module]: ... # undocumented def find_head_package(self, parent: Module, name: str) -> Tuple[Module, str]: ... # undocumented def load_tail(self, q: Module, tail: str) -> Module: ... # undocumented @@ -37,11 +62,14 @@ class ModuleFinder: def find_all_submodules(self, m: Module) -> Iterable[str]: ... # undocumented def import_module(self, partname: str, fqname: str, parent: Module) -> Optional[Module]: ... # undocumented def load_module(self, fqname: str, fp: IO[str], pathname: str, file_info: Tuple[str, str, str]) -> Module: ... # undocumented - def scan_opcodes(self, co: CodeType) -> Iterator[Tuple[str, Tuple[Any, ...]]]: ... # undocumented + if sys.version_info >= (3, 6): + def scan_opcodes(self, co: CodeType) -> Iterator[Tuple[str, Tuple[Any, ...]]]: ... # undocumented def scan_code(self, co: CodeType, m: Module) -> None: ... # undocumented def load_package(self, fqname: str, pathname: str) -> Module: ... # undocumented def add_module(self, fqname: str) -> Module: ... # undocumented - def find_module(self, name: str, path: Optional[str], parent: Optional[Module] = ...) -> Tuple[Optional[IO[Any]], Optional[str], Tuple[str, str, int]]: ... # undocumented + def find_module( + self, name: str, path: Optional[str], parent: Optional[Module] = ... + ) -> Tuple[Optional[IO[Any]], Optional[str], Tuple[str, str, int]]: ... # undocumented def report(self) -> None: ... def any_missing(self) -> List[str]: ... # undocumented def any_missing_maybe(self) -> Tuple[List[str], List[str]]: ... # undocumented diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/msilib/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/msilib/__init__.pyi new file mode 100644 index 00000000..0442ffaa --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/msilib/__init__.pyi @@ -0,0 +1,196 @@ +import sys +from types import ModuleType +from typing import Any, Container, Dict, Iterable, List, Optional, Sequence, Set, Tuple, Type, Union +from typing_extensions import Literal + +if sys.platform == "win32": + from _msi import _Database + + AMD64: bool + if sys.version_info < (3, 7): + Itanium: bool + Win64: bool + + datasizemask: Literal[0x00FF] + type_valid: Literal[0x0100] + type_localizable: Literal[0x0200] + typemask: Literal[0x0C00] + type_long: Literal[0x0000] + type_short: Literal[0x0400] + type_string: Literal[0x0C00] + type_binary: Literal[0x0800] + type_nullable: Literal[0x1000] + type_key: Literal[0x2000] + knownbits: Literal[0x3FFF] + class Table: + + name: str + fields: List[Tuple[int, str, int]] + def __init__(self, name: str) -> None: ... + def add_field(self, index: int, name: str, type: int) -> None: ... + def sql(self) -> str: ... + def create(self, db: _Database) -> None: ... + class _Unspecified: ... + def change_sequence( + seq: Sequence[Tuple[str, Optional[str], int]], + action: str, + seqno: Union[int, Type[_Unspecified]] = ..., + cond: Union[str, Type[_Unspecified]] = ..., + ) -> None: ... + def add_data(db: _Database, table: str, values: Iterable[Tuple[Any, ...]]) -> None: ... + def add_stream(db: _Database, name: str, path: str) -> None: ... + def init_database( + name: str, schema: ModuleType, ProductName: str, ProductCode: str, ProductVersion: str, Manufacturer: str + ) -> _Database: ... + def add_tables(db: _Database, module: ModuleType) -> None: ... + def make_id(str: str) -> str: ... + def gen_uuid() -> str: ... + class CAB: + + name: str + files: List[Tuple[str, str]] + filenames: Set[str] + index: int + def __init__(self, name: str) -> None: ... + def gen_id(self, file: str) -> str: ... + def append(self, full: str, file: str, logical: str) -> Tuple[int, str]: ... + def commit(self, db: _Database) -> None: ... + _directories: Set[str] + class Directory: + + db: _Database + cab: CAB + basedir: str + physical: str + logical: str + component: Optional[str] + short_names: Set[str] + ids: Set[str] + keyfiles: Dict[str, str] + componentflags: Optional[int] + absolute: str + def __init__( + self, + db: _Database, + cab: CAB, + basedir: str, + physical: str, + _logical: str, + default: str, + componentflags: Optional[int] = ..., + ) -> None: ... + def start_component( + self, + component: Optional[str] = ..., + feature: Optional[Feature] = ..., + flags: Optional[int] = ..., + keyfile: Optional[str] = ..., + uuid: Optional[str] = ..., + ) -> None: ... + def make_short(self, file: str) -> str: ... + def add_file( + self, file: str, src: Optional[str] = ..., version: Optional[str] = ..., language: Optional[str] = ... + ) -> str: ... + def glob(self, pattern: str, exclude: Optional[Container[str]] = ...) -> List[str]: ... + def remove_pyc(self) -> None: ... + class Binary: + + name: str + def __init__(self, fname: str) -> None: ... + def __repr__(self) -> str: ... + class Feature: + + id: str + def __init__( + self, + db: _Database, + id: str, + title: str, + desc: str, + display: int, + level: int = ..., + parent: Optional[Feature] = ..., + directory: Optional[str] = ..., + attributes: int = ..., + ) -> None: ... + def set_current(self) -> None: ... + class Control: + + dlg: Dialog + name: str + def __init__(self, dlg: Dialog, name: str) -> None: ... + def event(self, event: str, argument: str, condition: str = ..., ordering: Optional[int] = ...) -> None: ... + def mapping(self, event: str, attribute: str) -> None: ... + def condition(self, action: str, condition: str) -> None: ... + class RadioButtonGroup(Control): + + property: str + index: int + def __init__(self, dlg: Dialog, name: str, property: str) -> None: ... + def add(self, name: str, x: int, y: int, w: int, h: int, text: str, value: Optional[str] = ...) -> None: ... + class Dialog: + + db: _Database + name: str + x: int + y: int + w: int + h: int + def __init__( + self, + db: _Database, + name: str, + x: int, + y: int, + w: int, + h: int, + attr: int, + title: str, + first: str, + default: str, + cancel: str, + ) -> None: ... + def control( + self, + name: str, + type: str, + x: int, + y: int, + w: int, + h: int, + attr: int, + prop: Optional[str], + text: Optional[str], + next: Optional[str], + help: Optional[str], + ) -> Control: ... + def text(self, name: str, x: int, y: int, w: int, h: int, attr: int, text: Optional[str]) -> Control: ... + def bitmap(self, name: str, x: int, y: int, w: int, h: int, text: Optional[str]) -> Control: ... + def line(self, name: str, x: int, y: int, w: int, h: int) -> Control: ... + def pushbutton( + self, name: str, x: int, y: int, w: int, h: int, attr: int, text: Optional[str], next: Optional[str] + ) -> Control: ... + def radiogroup( + self, + name: str, + x: int, + y: int, + w: int, + h: int, + attr: int, + prop: Optional[str], + text: Optional[str], + next: Optional[str], + ) -> RadioButtonGroup: ... + def checkbox( + self, + name: str, + x: int, + y: int, + w: int, + h: int, + attr: int, + prop: Optional[str], + text: Optional[str], + next: Optional[str], + ) -> Control: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/msilib/schema.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/msilib/schema.pyi new file mode 100644 index 00000000..10b65088 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/msilib/schema.pyi @@ -0,0 +1,97 @@ +import sys +from typing import List, Optional, Tuple + +if sys.platform == "win32": + from . import Table + + _Validation: Table + ActionText: Table + AdminExecuteSequence: Table + Condition: Table + AdminUISequence: Table + AdvtExecuteSequence: Table + AdvtUISequence: Table + AppId: Table + AppSearch: Table + Property: Table + BBControl: Table + Billboard: Table + Feature: Table + Binary: Table + BindImage: Table + File: Table + CCPSearch: Table + CheckBox: Table + Class: Table + Component: Table + Icon: Table + ProgId: Table + ComboBox: Table + CompLocator: Table + Complus: Table + Directory: Table + Control: Table + Dialog: Table + ControlCondition: Table + ControlEvent: Table + CreateFolder: Table + CustomAction: Table + DrLocator: Table + DuplicateFile: Table + Environment: Table + Error: Table + EventMapping: Table + Extension: Table + MIME: Table + FeatureComponents: Table + FileSFPCatalog: Table + SFPCatalog: Table + Font: Table + IniFile: Table + IniLocator: Table + InstallExecuteSequence: Table + InstallUISequence: Table + IsolatedComponent: Table + LaunchCondition: Table + ListBox: Table + ListView: Table + LockPermissions: Table + Media: Table + MoveFile: Table + MsiAssembly: Table + MsiAssemblyName: Table + MsiDigitalCertificate: Table + MsiDigitalSignature: Table + MsiFileHash: Table + MsiPatchHeaders: Table + ODBCAttribute: Table + ODBCDriver: Table + ODBCDataSource: Table + ODBCSourceAttribute: Table + ODBCTranslator: Table + Patch: Table + PatchPackage: Table + PublishComponent: Table + RadioButton: Table + Registry: Table + RegLocator: Table + RemoveFile: Table + RemoveIniFile: Table + RemoveRegistry: Table + ReserveCost: Table + SelfReg: Table + ServiceControl: Table + ServiceInstall: Table + Shortcut: Table + Signature: Table + TextStyle: Table + TypeLib: Table + UIText: Table + Upgrade: Table + Verb: Table + + tables: List[Table] + + _Validation_records: List[ + Tuple[str, str, str, Optional[int], Optional[int], Optional[str], Optional[int], Optional[str], Optional[str], str] + ] diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/msilib/sequence.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/msilib/sequence.pyi new file mode 100644 index 00000000..e4f400d3 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/msilib/sequence.pyi @@ -0,0 +1,14 @@ +import sys +from typing import List, Optional, Tuple + +if sys.platform == "win32": + + _SequenceType = List[Tuple[str, Optional[str], int]] + + AdminExecuteSequence: _SequenceType + AdminUISequence: _SequenceType + AdvtExecuteSequence: _SequenceType + InstallExecuteSequence: _SequenceType + InstallUISequence: _SequenceType + + tables: List[str] diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/msilib/text.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/msilib/text.pyi new file mode 100644 index 00000000..e338b8b5 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/msilib/text.pyi @@ -0,0 +1,9 @@ +import sys +from typing import List, Optional, Tuple + +if sys.platform == "win32": + + ActionText: List[Tuple[str, str, Optional[str]]] + UIText: List[Tuple[str, Optional[str]]] + + tables: List[str] diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/msvcrt.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/msvcrt.pyi new file mode 100644 index 00000000..ede80c9f --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/msvcrt.pyi @@ -0,0 +1,24 @@ +import sys +from typing import Text + +# This module is only available on Windows +if sys.platform == "win32": + LK_LOCK: int + LK_NBLCK: int + LK_NBRLCK: int + LK_RLCK: int + LK_UNLCK: int + def locking(__fd: int, __mode: int, __nbytes: int) -> None: ... + def setmode(__fd: int, __mode: int) -> int: ... + def open_osfhandle(__handle: int, __flags: int) -> int: ... + def get_osfhandle(__fd: int) -> int: ... + def kbhit() -> bool: ... + def getch() -> bytes: ... + def getwch() -> Text: ... + def getche() -> bytes: ... + def getwche() -> Text: ... + def putch(__char: bytes) -> None: ... + def putwch(__unicode_char: Text) -> None: ... + def ungetch(__char: bytes) -> None: ... + def ungetwch(__unicode_char: Text) -> None: ... + def heapmin() -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/netrc.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/netrc.pyi old mode 100755 new mode 100644 index 3ceae889..50fe3c0e --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/netrc.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/netrc.pyi @@ -1,19 +1,15 @@ -from typing import AnyStr, Dict, List, Optional, Tuple, overload - +from typing import Dict, List, Optional, Tuple class NetrcParseError(Exception): filename: Optional[str] lineno: Optional[int] msg: str - # (login, account, password) tuple _NetrcTuple = Tuple[str, Optional[str], Optional[str]] - class netrc: hosts: Dict[str, _NetrcTuple] macros: Dict[str, List[str]] - def __init__(self, file: str = ...) -> None: ... def authenticators(self, host: str) -> Optional[_NetrcTuple]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/nis.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/nis.pyi old mode 100755 new mode 100644 index 87223caf..bc6c2bc0 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/nis.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/nis.pyi @@ -1,10 +1,9 @@ import sys from typing import Dict, List -if sys.platform != 'win32': +if sys.platform != "win32": def cat(map: str, domain: str = ...) -> Dict[str, str]: ... def get_default_domain() -> str: ... def maps(domain: str = ...) -> List[str]: ... def match(key: str, map: str, domain: str = ...) -> str: ... - class error(Exception): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/ntpath.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/ntpath.pyi deleted file mode 100755 index 42409c0e..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/ntpath.pyi +++ /dev/null @@ -1,177 +0,0 @@ -# NB: path.pyi and stdlib/2 and stdlib/3 must remain consistent! -# Stubs for os.path -# Ron Murawski - -import os -import sys -from typing import overload, List, Any, AnyStr, Sequence, Tuple, TypeVar, Union, Text, Callable, Optional - -_T = TypeVar('_T') - -if sys.version_info >= (3, 6): - from builtins import _PathLike - _PathType = Union[bytes, Text, _PathLike] - _StrPath = Union[Text, _PathLike[Text]] - _BytesPath = Union[bytes, _PathLike[bytes]] -else: - _PathType = Union[bytes, Text] - _StrPath = Text - _BytesPath = bytes - -# ----- os.path variables ----- -supports_unicode_filenames: bool -# aliases (also in os) -curdir: str -pardir: str -sep: str -if sys.platform == 'win32': - altsep: str -else: - altsep: Optional[str] -extsep: str -pathsep: str -defpath: str -devnull: str - -# ----- os.path function stubs ----- -if sys.version_info >= (3, 6): - # Overloads are necessary to work around python/mypy#3644. - @overload - def abspath(path: _PathLike[AnyStr]) -> AnyStr: ... - @overload - def abspath(path: AnyStr) -> AnyStr: ... - @overload - def basename(path: _PathLike[AnyStr]) -> AnyStr: ... - @overload - def basename(path: AnyStr) -> AnyStr: ... - @overload - def dirname(path: _PathLike[AnyStr]) -> AnyStr: ... - @overload - def dirname(path: AnyStr) -> AnyStr: ... - @overload - def expanduser(path: _PathLike[AnyStr]) -> AnyStr: ... - @overload - def expanduser(path: AnyStr) -> AnyStr: ... - @overload - def expandvars(path: _PathLike[AnyStr]) -> AnyStr: ... - @overload - def expandvars(path: AnyStr) -> AnyStr: ... - @overload - def normcase(path: _PathLike[AnyStr]) -> AnyStr: ... - @overload - def normcase(path: AnyStr) -> AnyStr: ... - @overload - def normpath(path: _PathLike[AnyStr]) -> AnyStr: ... - @overload - def normpath(path: AnyStr) -> AnyStr: ... - if sys.platform == 'win32': - @overload - def realpath(path: _PathLike[AnyStr]) -> AnyStr: ... - @overload - def realpath(path: AnyStr) -> AnyStr: ... - else: - @overload - def realpath(filename: _PathLike[AnyStr]) -> AnyStr: ... - @overload - def realpath(filename: AnyStr) -> AnyStr: ... - -else: - def abspath(path: AnyStr) -> AnyStr: ... - def basename(path: AnyStr) -> AnyStr: ... - def dirname(path: AnyStr) -> AnyStr: ... - def expanduser(path: AnyStr) -> AnyStr: ... - def expandvars(path: AnyStr) -> AnyStr: ... - def normcase(path: AnyStr) -> AnyStr: ... - def normpath(path: AnyStr) -> AnyStr: ... - if sys.platform == 'win32': - def realpath(path: AnyStr) -> AnyStr: ... - else: - def realpath(filename: AnyStr) -> AnyStr: ... - -if sys.version_info >= (3, 6): - # In reality it returns str for sequences of _StrPath and bytes for sequences - # of _BytesPath, but mypy does not accept such a signature. - def commonpath(paths: Sequence[_PathType]) -> Any: ... -elif sys.version_info >= (3, 5): - def commonpath(paths: Sequence[AnyStr]) -> AnyStr: ... - -# NOTE: Empty lists results in '' (str) regardless of contained type. -# Also, in Python 2 mixed sequences of Text and bytes results in either Text or bytes -# So, fall back to Any -def commonprefix(list: Sequence[_PathType]) -> Any: ... - -if sys.version_info >= (3, 3): - def exists(path: Union[_PathType, int]) -> bool: ... -else: - def exists(path: _PathType) -> bool: ... -def lexists(path: _PathType) -> bool: ... - -# These return float if os.stat_float_times() == True, -# but int is a subclass of float. -def getatime(path: _PathType) -> float: ... -def getmtime(path: _PathType) -> float: ... -def getctime(path: _PathType) -> float: ... - -def getsize(path: _PathType) -> int: ... -def isabs(path: _PathType) -> bool: ... -def isfile(path: _PathType) -> bool: ... -def isdir(path: _PathType) -> bool: ... -def islink(path: _PathType) -> bool: ... -def ismount(path: _PathType) -> bool: ... - -if sys.version_info < (3, 0): - # Make sure signatures are disjunct, and allow combinations of bytes and unicode. - # (Since Python 2 allows that, too) - # Note that e.g. os.path.join("a", "b", "c", "d", u"e") will still result in - # a type error. - @overload - def join(__p1: bytes, *p: bytes) -> bytes: ... - @overload - def join(__p1: bytes, __p2: bytes, __p3: bytes, __p4: Text, *p: _PathType) -> Text: ... - @overload - def join(__p1: bytes, __p2: bytes, __p3: Text, *p: _PathType) -> Text: ... - @overload - def join(__p1: bytes, __p2: Text, *p: _PathType) -> Text: ... - @overload - def join(__p1: Text, *p: _PathType) -> Text: ... -elif sys.version_info >= (3, 6): - # Mypy complains that the signatures overlap (same for relpath below), but things seem to behave correctly anyway. - @overload - def join(path: _StrPath, *paths: _StrPath) -> Text: ... - @overload - def join(path: _BytesPath, *paths: _BytesPath) -> bytes: ... -else: - def join(path: AnyStr, *paths: AnyStr) -> AnyStr: ... - -@overload -def relpath(path: _BytesPath, start: Optional[_BytesPath] = ...) -> bytes: ... -@overload -def relpath(path: _StrPath, start: Optional[_StrPath] = ...) -> Text: ... - -def samefile(path1: _PathType, path2: _PathType) -> bool: ... -def sameopenfile(fp1: int, fp2: int) -> bool: ... -def samestat(stat1: os.stat_result, stat2: os.stat_result) -> bool: ... - -if sys.version_info >= (3, 6): - @overload - def split(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... - @overload - def split(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... - @overload - def splitdrive(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... - @overload - def splitdrive(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... - @overload - def splitext(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... - @overload - def splitext(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... -else: - def split(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... - def splitdrive(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... - def splitext(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... - -if sys.platform == 'win32': - def splitunc(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... # deprecated - -if sys.version_info < (3,): - def walk(path: AnyStr, visit: Callable[[_T, AnyStr, List[AnyStr]], Any], arg: _T) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/numbers.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/numbers.pyi old mode 100755 new mode 100644 index befe7d53..4f8a5a5d --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/numbers.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/numbers.pyi @@ -1,13 +1,9 @@ -# Stubs for numbers (Python 3.5) -# See https://docs.python.org/2.7/library/numbers.html -# and https://docs.python.org/3/library/numbers.html -# # Note: these stubs are incomplete. The more complex type # signatures are currently omitted. -from typing import Any, Optional, SupportsFloat, overload -from abc import ABCMeta, abstractmethod import sys +from abc import ABCMeta, abstractmethod +from typing import Any, Optional, SupportsFloat, overload class Number(metaclass=ABCMeta): @abstractmethod @@ -22,42 +18,42 @@ class Complex(Number): def __nonzero__(self) -> bool: ... @property @abstractmethod - def real(self): ... + def real(self) -> Any: ... @property @abstractmethod - def imag(self): ... + def imag(self) -> Any: ... @abstractmethod - def __add__(self, other): ... + def __add__(self, other: Any) -> Any: ... @abstractmethod - def __radd__(self, other): ... + def __radd__(self, other: Any) -> Any: ... @abstractmethod - def __neg__(self): ... + def __neg__(self) -> Any: ... @abstractmethod - def __pos__(self): ... - def __sub__(self, other): ... - def __rsub__(self, other): ... + def __pos__(self) -> Any: ... + def __sub__(self, other: Any) -> Any: ... + def __rsub__(self, other: Any) -> Any: ... @abstractmethod - def __mul__(self, other): ... + def __mul__(self, other: Any) -> Any: ... @abstractmethod - def __rmul__(self, other): ... + def __rmul__(self, other: Any) -> Any: ... if sys.version_info < (3, 0): @abstractmethod def __div__(self, other): ... @abstractmethod def __rdiv__(self, other): ... @abstractmethod - def __truediv__(self, other): ... + def __truediv__(self, other: Any) -> Any: ... @abstractmethod - def __rtruediv__(self, other): ... + def __rtruediv__(self, other: Any) -> Any: ... @abstractmethod - def __pow__(self, exponent): ... + def __pow__(self, exponent: Any) -> Any: ... @abstractmethod - def __rpow__(self, base): ... - def __abs__(self): ... - def conjugate(self): ... - def __eq__(self, other: object) -> bool: ... + def __rpow__(self, base: Any) -> Any: ... + def __abs__(self) -> Real: ... + def conjugate(self) -> Any: ... + def __eq__(self, other: Any) -> bool: ... if sys.version_info < (3, 0): - def __ne__(self, other: object) -> bool: ... + def __ne__(self, other: Any) -> bool: ... class Real(Complex, SupportsFloat): @abstractmethod @@ -71,30 +67,30 @@ class Real(Complex, SupportsFloat): def __ceil__(self) -> int: ... @abstractmethod @overload - def __round__(self, ndigits: None = ...): ... + def __round__(self, ndigits: None = ...) -> int: ... @abstractmethod @overload - def __round__(self, ndigits: int): ... - def __divmod__(self, other): ... - def __rdivmod__(self, other): ... + def __round__(self, ndigits: int) -> Any: ... + def __divmod__(self, other: Any) -> Any: ... + def __rdivmod__(self, other: Any) -> Any: ... @abstractmethod - def __floordiv__(self, other): ... + def __floordiv__(self, other: Any) -> int: ... @abstractmethod - def __rfloordiv__(self, other): ... + def __rfloordiv__(self, other: Any) -> int: ... @abstractmethod - def __mod__(self, other): ... + def __mod__(self, other: Any) -> Any: ... @abstractmethod - def __rmod__(self, other): ... + def __rmod__(self, other: Any) -> Any: ... @abstractmethod - def __lt__(self, other) -> bool: ... + def __lt__(self, other: Any) -> bool: ... @abstractmethod - def __le__(self, other) -> bool: ... + def __le__(self, other: Any) -> bool: ... def __complex__(self) -> complex: ... @property - def real(self): ... + def real(self) -> Any: ... @property - def imag(self): ... - def conjugate(self): ... + def imag(self) -> Any: ... + def conjugate(self) -> Any: ... class Rational(Real): @property @@ -114,29 +110,29 @@ class Integral(Rational): def __long__(self) -> long: ... def __index__(self) -> int: ... @abstractmethod - def __pow__(self, exponent, modulus: Optional[Any] = ...): ... + def __pow__(self, exponent: Any, modulus: Optional[Any] = ...) -> Any: ... @abstractmethod - def __lshift__(self, other): ... + def __lshift__(self, other: Any) -> Any: ... @abstractmethod - def __rlshift__(self, other): ... + def __rlshift__(self, other: Any) -> Any: ... @abstractmethod - def __rshift__(self, other): ... + def __rshift__(self, other: Any) -> Any: ... @abstractmethod - def __rrshift__(self, other): ... + def __rrshift__(self, other: Any) -> Any: ... @abstractmethod - def __and__(self, other): ... + def __and__(self, other: Any) -> Any: ... @abstractmethod - def __rand__(self, other): ... + def __rand__(self, other: Any) -> Any: ... @abstractmethod - def __xor__(self, other): ... + def __xor__(self, other: Any) -> Any: ... @abstractmethod - def __rxor__(self, other): ... + def __rxor__(self, other: Any) -> Any: ... @abstractmethod - def __or__(self, other): ... + def __or__(self, other: Any) -> Any: ... @abstractmethod - def __ror__(self, other): ... + def __ror__(self, other: Any) -> Any: ... @abstractmethod - def __invert__(self): ... + def __invert__(self) -> Any: ... def __float__(self) -> float: ... @property def numerator(self) -> int: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/opcode.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/opcode.pyi old mode 100755 new mode 100644 index 34350e74..6307c280 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/opcode.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/opcode.pyi @@ -1,6 +1,5 @@ -from typing import List, Dict, Optional, Sequence - import sys +from typing import Dict, List, Optional, Sequence cmp_op: Sequence[str] hasconst: List[int] @@ -16,8 +15,11 @@ opmap: Dict[str, int] HAVE_ARGUMENT: int EXTENDED_ARG: int -if sys.version_info >= (3, 4): - def stack_effect(opcode: int, oparg: Optional[int] = ...) -> int: ... +if sys.version_info >= (3, 8): + def stack_effect(__opcode: int, __oparg: Optional[int] = ..., *, jump: Optional[bool] = ...) -> int: ... + +elif sys.version_info >= (3, 4): + def stack_effect(__opcode: int, __oparg: Optional[int] = ...) -> int: ... if sys.version_info >= (3, 6): hasnargs: List[int] diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/operator.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/operator.pyi old mode 100755 new mode 100644 index 3a70b47e..f82d4c66 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/operator.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/operator.pyi @@ -1,226 +1,205 @@ -# Stubs for operator - +import sys from typing import ( - Any, Callable, Container, Mapping, MutableMapping, MutableSequence, Sequence, SupportsAbs, Tuple, - TypeVar, overload, + Any, + Callable, + Container, + Mapping, + MutableMapping, + MutableSequence, + Sequence, + SupportsAbs, + Tuple, + TypeVar, + overload, ) -import sys - -_T = TypeVar('_T') -_K = TypeVar('_K') -_V = TypeVar('_V') +_T = TypeVar("_T") +_K = TypeVar("_K") +_V = TypeVar("_V") - -def lt(a: Any, b: Any) -> Any: ... -def le(a: Any, b: Any) -> Any: ... -def eq(a: Any, b: Any) -> Any: ... -def ne(a: Any, b: Any) -> Any: ... -def ge(a: Any, b: Any) -> Any: ... -def gt(a: Any, b: Any) -> Any: ... +def lt(__a: Any, __b: Any) -> Any: ... +def le(__a: Any, __b: Any) -> Any: ... +def eq(__a: Any, __b: Any) -> Any: ... +def ne(__a: Any, __b: Any) -> Any: ... +def ge(__a: Any, __b: Any) -> Any: ... +def gt(__a: Any, __b: Any) -> Any: ... def __lt__(a: Any, b: Any) -> Any: ... def __le__(a: Any, b: Any) -> Any: ... def __eq__(a: Any, b: Any) -> Any: ... def __ne__(a: Any, b: Any) -> Any: ... def __ge__(a: Any, b: Any) -> Any: ... def __gt__(a: Any, b: Any) -> Any: ... - -def not_(obj: Any) -> bool: ... -def __not__(obj: Any) -> bool: ... - -def truth(x: Any) -> bool: ... - -def is_(a: Any, b: Any) -> bool: ... - -def is_not(a: Any, b: Any) -> bool: ... - -def abs(x: SupportsAbs[_T]) -> _T: ... +def not_(__a: Any) -> bool: ... +def __not__(a: Any) -> bool: ... +def truth(__a: Any) -> bool: ... +def is_(__a: Any, __b: Any) -> bool: ... +def is_not(__a: Any, __b: Any) -> bool: ... +def abs(__a: SupportsAbs[_T]) -> _T: ... def __abs__(a: SupportsAbs[_T]) -> _T: ... - -def add(a: Any, b: Any) -> Any: ... +def add(__a: Any, __b: Any) -> Any: ... def __add__(a: Any, b: Any) -> Any: ... - -def and_(a: Any, b: Any) -> Any: ... +def and_(__a: Any, __b: Any) -> Any: ... def __and__(a: Any, b: Any) -> Any: ... -if sys.version_info < (3, ): +if sys.version_info < (3,): def div(a: Any, b: Any) -> Any: ... def __div__(a: Any, b: Any) -> Any: ... -def floordiv(a: Any, b: Any) -> Any: ... +def floordiv(__a: Any, __b: Any) -> Any: ... def __floordiv__(a: Any, b: Any) -> Any: ... - -def index(a: Any) -> int: ... +def index(__a: Any) -> int: ... def __index__(a: Any) -> int: ... - -def inv(obj: Any) -> Any: ... -def invert(obj: Any) -> Any: ... -def __inv__(obj: Any) -> Any: ... -def __invert__(obj: Any) -> Any: ... - -def lshift(a: Any, b: Any) -> Any: ... +def inv(__a: Any) -> Any: ... +def invert(__a: Any) -> Any: ... +def __inv__(a: Any) -> Any: ... +def __invert__(a: Any) -> Any: ... +def lshift(__a: Any, __b: Any) -> Any: ... def __lshift__(a: Any, b: Any) -> Any: ... - -def mod(a: Any, b: Any) -> Any: ... +def mod(__a: Any, __b: Any) -> Any: ... def __mod__(a: Any, b: Any) -> Any: ... - -def mul(a: Any, b: Any) -> Any: ... +def mul(__a: Any, __b: Any) -> Any: ... def __mul__(a: Any, b: Any) -> Any: ... if sys.version_info >= (3, 5): - def matmul(a: Any, b: Any) -> Any: ... + def matmul(__a: Any, __b: Any) -> Any: ... def __matmul__(a: Any, b: Any) -> Any: ... -def neg(obj: Any) -> Any: ... -def __neg__(obj: Any) -> Any: ... - -def or_(a: Any, b: Any) -> Any: ... +def neg(__a: Any) -> Any: ... +def __neg__(a: Any) -> Any: ... +def or_(__a: Any, __b: Any) -> Any: ... def __or__(a: Any, b: Any) -> Any: ... - -def pos(obj: Any) -> Any: ... -def __pos__(obj: Any) -> Any: ... - -def pow(a: Any, b: Any) -> Any: ... +def pos(__a: Any) -> Any: ... +def __pos__(a: Any) -> Any: ... +def pow(__a: Any, __b: Any) -> Any: ... def __pow__(a: Any, b: Any) -> Any: ... - -def rshift(a: Any, b: Any) -> Any: ... +def rshift(__a: Any, __b: Any) -> Any: ... def __rshift__(a: Any, b: Any) -> Any: ... - -def sub(a: Any, b: Any) -> Any: ... +def sub(__a: Any, __b: Any) -> Any: ... def __sub__(a: Any, b: Any) -> Any: ... - -def truediv(a: Any, b: Any) -> Any: ... +def truediv(__a: Any, __b: Any) -> Any: ... def __truediv__(a: Any, b: Any) -> Any: ... - -def xor(a: Any, b: Any) -> Any: ... +def xor(__a: Any, __b: Any) -> Any: ... def __xor__(a: Any, b: Any) -> Any: ... - -def concat(a: Sequence[_T], b: Sequence[_T]) -> Sequence[_T]: ... +def concat(__a: Sequence[_T], __b: Sequence[_T]) -> Sequence[_T]: ... def __concat__(a: Sequence[_T], b: Sequence[_T]) -> Sequence[_T]: ... - -def contains(a: Container[Any], b: Any) -> bool: ... +def contains(__a: Container[Any], __b: Any) -> bool: ... def __contains__(a: Container[Any], b: Any) -> bool: ... - -def countOf(a: Container[Any], b: Any) -> int: ... - +def countOf(__a: Container[Any], __b: Any) -> int: ... @overload -def delitem(a: MutableSequence[_T], b: int) -> None: ... +def delitem(__a: MutableSequence[_T], __b: int) -> None: ... @overload -def delitem(a: MutableMapping[_K, _V], b: _K) -> None: ... +def delitem(__a: MutableSequence[_T], __b: slice) -> None: ... +@overload +def delitem(__a: MutableMapping[_K, _V], __b: _K) -> None: ... @overload def __delitem__(a: MutableSequence[_T], b: int) -> None: ... @overload +def __delitem__(a: MutableSequence[_T], b: slice) -> None: ... +@overload def __delitem__(a: MutableMapping[_K, _V], b: _K) -> None: ... -if sys.version_info < (3, ): +if sys.version_info < (3,): def delslice(a: MutableSequence[Any], b: int, c: int) -> None: ... def __delslice__(a: MutableSequence[Any], b: int, c: int) -> None: ... @overload -def getitem(a: Sequence[_T], b: int) -> _T: ... +def getitem(__a: Sequence[_T], __b: int) -> _T: ... +@overload +def getitem(__a: Sequence[_T], __b: slice) -> Sequence[_T]: ... @overload -def getitem(a: Mapping[_K, _V], b: _K) -> _V: ... +def getitem(__a: Mapping[_K, _V], __b: _K) -> _V: ... @overload def __getitem__(a: Sequence[_T], b: int) -> _T: ... @overload +def __getitem__(a: Sequence[_T], b: slice) -> Sequence[_T]: ... +@overload def __getitem__(a: Mapping[_K, _V], b: _K) -> _V: ... -if sys.version_info < (3, ): +if sys.version_info < (3,): def getslice(a: Sequence[_T], b: int, c: int) -> Sequence[_T]: ... def __getslice__(a: Sequence[_T], b: int, c: int) -> Sequence[_T]: ... -def indexOf(a: Sequence[_T], b: _T) -> int: ... +def indexOf(__a: Sequence[_T], __b: _T) -> int: ... -if sys.version_info < (3, ): +if sys.version_info < (3,): def repeat(a: Any, b: int) -> Any: ... def __repeat__(a: Any, b: int) -> Any: ... -if sys.version_info < (3, ): +if sys.version_info < (3,): def sequenceIncludes(a: Container[Any], b: Any) -> bool: ... @overload -def setitem(a: MutableSequence[_T], b: int, c: _T) -> None: ... +def setitem(__a: MutableSequence[_T], __b: int, __c: _T) -> None: ... +@overload +def setitem(__a: MutableSequence[_T], __b: slice, __c: Sequence[_T]) -> None: ... @overload -def setitem(a: MutableMapping[_K, _V], b: _K, c: _V) -> None: ... +def setitem(__a: MutableMapping[_K, _V], __b: _K, __c: _V) -> None: ... @overload def __setitem__(a: MutableSequence[_T], b: int, c: _T) -> None: ... @overload +def __setitem__(a: MutableSequence[_T], b: slice, c: Sequence[_T]) -> None: ... +@overload def __setitem__(a: MutableMapping[_K, _V], b: _K, c: _V) -> None: ... -if sys.version_info < (3, ): +if sys.version_info < (3,): def setslice(a: MutableSequence[_T], b: int, c: int, v: Sequence[_T]) -> None: ... def __setslice__(a: MutableSequence[_T], b: int, c: int, v: Sequence[_T]) -> None: ... - if sys.version_info >= (3, 4): - def length_hint(obj: Any, default: int = ...) -> int: ... + def length_hint(__obj: Any, __default: int = ...) -> int: ... @overload def attrgetter(attr: str) -> Callable[[Any], Any]: ... @overload def attrgetter(*attrs: str) -> Callable[[Any], Tuple[Any, ...]]: ... - @overload def itemgetter(item: Any) -> Callable[[Any], Any]: ... @overload def itemgetter(*items: Any) -> Callable[[Any], Tuple[Any, ...]]: ... - -def methodcaller(name: str, *args: Any, **kwargs: Any) -> Callable[..., Any]: ... - - -def iadd(a: Any, b: Any) -> Any: ... +def methodcaller(__name: str, *args: Any, **kwargs: Any) -> Callable[..., Any]: ... +def iadd(__a: Any, __b: Any) -> Any: ... def __iadd__(a: Any, b: Any) -> Any: ... - -def iand(a: Any, b: Any) -> Any: ... +def iand(__a: Any, __b: Any) -> Any: ... def __iand__(a: Any, b: Any) -> Any: ... - -def iconcat(a: Any, b: Any) -> Any: ... +def iconcat(__a: Any, __b: Any) -> Any: ... def __iconcat__(a: Any, b: Any) -> Any: ... -if sys.version_info < (3, ): +if sys.version_info < (3,): def idiv(a: Any, b: Any) -> Any: ... def __idiv__(a: Any, b: Any) -> Any: ... -def ifloordiv(a: Any, b: Any) -> Any: ... +def ifloordiv(__a: Any, __b: Any) -> Any: ... def __ifloordiv__(a: Any, b: Any) -> Any: ... - -def ilshift(a: Any, b: Any) -> Any: ... +def ilshift(__a: Any, __b: Any) -> Any: ... def __ilshift__(a: Any, b: Any) -> Any: ... - -def imod(a: Any, b: Any) -> Any: ... +def imod(__a: Any, __b: Any) -> Any: ... def __imod__(a: Any, b: Any) -> Any: ... - -def imul(a: Any, b: Any) -> Any: ... +def imul(__a: Any, __b: Any) -> Any: ... def __imul__(a: Any, b: Any) -> Any: ... if sys.version_info >= (3, 5): - def imatmul(a: Any, b: Any) -> Any: ... + def imatmul(__a: Any, __b: Any) -> Any: ... def __imatmul__(a: Any, b: Any) -> Any: ... -def ior(a: Any, b: Any) -> Any: ... +def ior(__a: Any, __b: Any) -> Any: ... def __ior__(a: Any, b: Any) -> Any: ... - -def ipow(a: Any, b: Any) -> Any: ... +def ipow(__a: Any, __b: Any) -> Any: ... def __ipow__(a: Any, b: Any) -> Any: ... -if sys.version_info < (3, ): +if sys.version_info < (3,): def irepeat(a: Any, b: int) -> Any: ... def __irepeat__(a: Any, b: int) -> Any: ... -def irshift(a: Any, b: Any) -> Any: ... +def irshift(__a: Any, __b: Any) -> Any: ... def __irshift__(a: Any, b: Any) -> Any: ... - -def isub(a: Any, b: Any) -> Any: ... +def isub(__a: Any, __b: Any) -> Any: ... def __isub__(a: Any, b: Any) -> Any: ... - -def itruediv(a: Any, b: Any) -> Any: ... +def itruediv(__a: Any, __b: Any) -> Any: ... def __itruediv__(a: Any, b: Any) -> Any: ... - -def ixor(a: Any, b: Any) -> Any: ... +def ixor(__a: Any, __b: Any) -> Any: ... def __ixor__(a: Any, b: Any) -> Any: ... - -if sys.version_info < (3, ): +if sys.version_info < (3,): def isCallable(x: Any) -> bool: ... def isMappingType(x: Any) -> bool: ... def isNumberType(x: Any) -> bool: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/optparse.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/optparse.pyi old mode 100755 new mode 100644 index e3fe3142..76f7be47 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/optparse.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/optparse.pyi @@ -1,6 +1,5 @@ -# Generated by pytype, with only minor tweaks. Might be incomplete. import sys -from typing import Any, AnyStr, Callable, Dict, IO, Iterable, List, Mapping, Optional, Sequence, Tuple, Union +from typing import IO, Any, AnyStr, Callable, Dict, Iterable, List, Mapping, Optional, Sequence, Tuple, Type, Union, overload # See https://groups.google.com/forum/#!topic/python-ideas/gA1gdj3RZ5g if sys.version_info >= (3,): @@ -14,6 +13,7 @@ SUPPRESS_USAGE: _Text def check_builtin(option: Option, opt: Any, value: _Text) -> Any: ... def check_choice(option: Option, opt: Any, value: _Text) -> Any: ... + if sys.version_info < (3,): def isbasestring(x: Any) -> bool: ... @@ -35,10 +35,8 @@ class OptionError(OptParseError): def __init__(self, msg: _Text, option: Option) -> None: ... class OptionConflictError(OptionError): ... - class OptionValueError(OptParseError): ... - class HelpFormatter: NO_DEFAULT_VALUE: _Text _long_opt_fmt: _Text @@ -59,7 +57,7 @@ class HelpFormatter: def dedent(self) -> None: ... def expand_default(self, option: Option) -> _Text: ... def format_description(self, description: _Text) -> _Text: ... - def format_epilog(self, epilog) -> _Text: ... + def format_epilog(self, epilog: _Text) -> _Text: ... def format_heading(self, heading: Any) -> _Text: ... def format_option(self, option: OptionParser) -> _Text: ... def format_option_strings(self, option: OptionParser) -> Any: ... @@ -71,20 +69,16 @@ class HelpFormatter: def store_option_strings(self, parser: OptionParser) -> None: ... class IndentedHelpFormatter(HelpFormatter): - def __init__(self, - indent_increment: int = ..., - max_help_position: int = ..., - width: Optional[int] = ..., - short_first: int = ...) -> None: ... + def __init__( + self, indent_increment: int = ..., max_help_position: int = ..., width: Optional[int] = ..., short_first: int = ... + ) -> None: ... def format_heading(self, heading: _Text) -> _Text: ... def format_usage(self, usage: _Text) -> _Text: ... class TitledHelpFormatter(HelpFormatter): - def __init__(self, - indent_increment: int = ..., - max_help_position: int = ..., - width: Optional[int] = ..., - short_first: int = ...) -> None: ... + def __init__( + self, indent_increment: int = ..., max_help_position: int = ..., width: Optional[int] = ..., short_first: int = ... + ) -> None: ... def format_heading(self, heading: _Text) -> _Text: ... def format_usage(self, usage: _Text) -> _Text: ... @@ -104,17 +98,17 @@ class Option: dest: Optional[_Text] nargs: int type: Any - def __init__(self, *opts, **attrs) -> None: ... + def __init__(self, *opts: Optional[_Text], **attrs: Any) -> None: ... def _check_action(self) -> None: ... def _check_callback(self) -> None: ... def _check_choice(self) -> None: ... def _check_const(self) -> None: ... def _check_dest(self) -> None: ... def _check_nargs(self) -> None: ... - def _check_opt_strings(self, opts: Optional[_Text]) -> Any: ... + def _check_opt_strings(self, opts: Iterable[Optional[_Text]]) -> List[_Text]: ... def _check_type(self) -> None: ... def _set_attrs(self, attrs: Dict[_Text, Any]) -> None: ... - def _set_opt_strings(self, opts: _Text) -> None: ... + def _set_opt_strings(self, opts: Iterable[_Text]) -> None: ... def check_value(self, opt: Any, value: Any) -> Any: ... def convert_value(self, opt: Any, value: Any) -> Any: ... def get_opt_string(self) -> _Text: ... @@ -130,12 +124,15 @@ class OptionContainer: conflict_handler: _Text defaults: Dict[_Text, Any] description: Any - option_class: Any - def __init__(self, option_class: Option, conflict_handler: Any, description: Any) -> None: ... + option_class: Type[Option] + def __init__(self, option_class: Type[Option], conflict_handler: Any, description: Any) -> None: ... def _check_conflict(self, option: Any) -> None: ... def _create_option_mappings(self) -> None: ... def _share_option_mappings(self, parser: OptionParser) -> None: ... - def add_option(self, *args, **kwargs) -> Any: ... + @overload + def add_option(self, opt: Option) -> Option: ... + @overload + def add_option(self, *args: Optional[_Text], **kwargs: Any) -> Any: ... def add_options(self, option_list: Iterable[Option]) -> None: ... def destroy(self) -> None: ... def format_description(self, formatter: Optional[HelpFormatter]) -> Any: ... @@ -181,17 +178,19 @@ class OptionParser(OptionContainer): usage: Optional[_Text] values: Optional[Values] version: _Text - def __init__(self, - usage: Optional[_Text] = ..., - option_list: Iterable[Option] = ..., - option_class: Option = ..., - version: Optional[_Text] = ..., - conflict_handler: _Text = ..., - description: Optional[_Text] = ..., - formatter: Optional[HelpFormatter] = ..., - add_help_option: bool = ..., - prog: Optional[_Text] = ..., - epilog: Optional[_Text] = ...) -> None: ... + def __init__( + self, + usage: Optional[_Text] = ..., + option_list: Iterable[Option] = ..., + option_class: Type[Option] = ..., + version: Optional[_Text] = ..., + conflict_handler: _Text = ..., + description: Optional[_Text] = ..., + formatter: Optional[HelpFormatter] = ..., + add_help_option: bool = ..., + prog: Optional[_Text] = ..., + epilog: Optional[_Text] = ..., + ) -> None: ... def _add_help_option(self) -> None: ... def _add_version_option(self) -> None: ... def _create_option_list(self) -> None: ... @@ -203,7 +202,10 @@ class OptionParser(OptionContainer): def _process_args(self, largs: List[Any], rargs: List[Any], values: Values) -> None: ... def _process_long_opt(self, rargs: List[Any], values: Any) -> None: ... def _process_short_opts(self, rargs: List[Any], values: Any) -> None: ... - def add_option_group(self, *args, **kwargs) -> OptionParser: ... + @overload + def add_option_group(self, __opt_group: OptionGroup) -> OptionParser: ... + @overload + def add_option_group(self, *args: Any, **kwargs: Any) -> OptionParser: ... def check_values(self, values: Values, args: List[_Text]) -> Tuple[Values, List[_Text]]: ... def disable_interspersed_args(self) -> None: ... def enable_interspersed_args(self) -> None: ... @@ -218,11 +220,13 @@ class OptionParser(OptionContainer): def get_prog_name(self) -> _Text: ... def get_usage(self) -> _Text: ... def get_version(self) -> _Text: ... - def parse_args(self, args: Optional[Sequence[AnyStr]] = ..., values: Optional[Values] = ...) -> Tuple[Values, List[AnyStr]]: ... + def parse_args( + self, args: Optional[Sequence[AnyStr]] = ..., values: Optional[Values] = ... + ) -> Tuple[Values, List[AnyStr]]: ... def print_usage(self, file: Optional[IO[str]] = ...) -> None: ... def print_help(self, file: Optional[IO[str]] = ...) -> None: ... def print_version(self, file: Optional[IO[str]] = ...) -> None: ... def set_default(self, dest: Any, value: Any) -> None: ... - def set_defaults(self, **kwargs) -> None: ... + def set_defaults(self, **kwargs: Any) -> None: ... def set_process_default_values(self, process: Any) -> None: ... def set_usage(self, usage: _Text) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/parser.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/parser.pyi new file mode 100644 index 00000000..799f25cf --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/parser.pyi @@ -0,0 +1,22 @@ +from _typeshed import AnyPath +from types import CodeType +from typing import Any, List, Sequence, Text, Tuple + +def expr(source: Text) -> STType: ... +def suite(source: Text) -> STType: ... +def sequence2st(sequence: Sequence[Any]) -> STType: ... +def tuple2st(sequence: Sequence[Any]) -> STType: ... +def st2list(st: STType, line_info: bool = ..., col_info: bool = ...) -> List[Any]: ... +def st2tuple(st: STType, line_info: bool = ..., col_info: bool = ...) -> Tuple[Any]: ... +def compilest(st: STType, filename: AnyPath = ...) -> CodeType: ... +def isexpr(st: STType) -> bool: ... +def issuite(st: STType) -> bool: ... + +class ParserError(Exception): ... + +class STType: + def compile(self, filename: AnyPath = ...) -> CodeType: ... + def isexpr(self) -> bool: ... + def issuite(self) -> bool: ... + def tolist(self, line_info: bool = ..., col_info: bool = ...) -> List[Any]: ... + def totuple(self, line_info: bool = ..., col_info: bool = ...) -> Tuple[Any]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/pdb.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/pdb.pyi old mode 100755 new mode 100644 index e403c36c..2750e9ea --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/pdb.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/pdb.pyi @@ -1,30 +1,51 @@ -# NOTE: This stub is incomplete - only contains some global functions - -from cmd import Cmd +import signal import sys -from types import FrameType -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar +from bdb import Bdb +from cmd import Cmd +from inspect import _SourceObjectType +from types import CodeType, FrameType, TracebackType +from typing import IO, Any, Callable, ClassVar, Dict, Iterable, List, Mapping, Optional, Sequence, Tuple, TypeVar, Union + +_T = TypeVar("_T") -_T = TypeVar('_T') +line_prefix: str # undocumented class Restart(Exception): ... -def run(statement: str, globals: Optional[Dict[str, Any]] = ..., - locals: Optional[Dict[str, Any]] = ...) -> None: ... -def runeval(expression: str, globals: Optional[Dict[str, Any]] = ..., - locals: Optional[Dict[str, Any]] = ...) -> Any: ... -def runctx(statement: str, globals: Dict[str, Any], locals: Dict[str, Any]) -> None: ... -def runcall(*args: Any, **kwds: Any) -> Any: ... +def run(statement: str, globals: Optional[Dict[str, Any]] = ..., locals: Optional[Mapping[str, Any]] = ...) -> None: ... +def runeval(expression: str, globals: Optional[Dict[str, Any]] = ..., locals: Optional[Mapping[str, Any]] = ...) -> Any: ... +def runctx(statement: str, globals: Dict[str, Any], locals: Mapping[str, Any]) -> None: ... +def runcall(func: Callable[..., _T], *args: Any, **kwds: Any) -> Optional[_T]: ... if sys.version_info >= (3, 7): def set_trace(*, header: Optional[str] = ...) -> None: ... + else: def set_trace() -> None: ... -def post_mortem(t: Optional[Any] = ...) -> None: ... +def post_mortem(t: Optional[TracebackType] = ...) -> None: ... def pm() -> None: ... -class Pdb(Cmd): +class Pdb(Bdb, Cmd): + # Everything here is undocumented, except for __init__ + + commands_resuming: ClassVar[List[str]] + + aliases: Dict[str, str] + mainpyfile: str + _wait_for_mainpyfile: bool + rcLines: List[str] + commands: Dict[int, List[str]] + commands_doprompt: Dict[int, bool] + commands_silent: Dict[int, bool] + commands_defining: bool + commands_bnum: Optional[int] + lineno: Optional[int] + stack: List[Tuple[FrameType, int]] + curindex: int + curframe: Optional[FrameType] + curframe_locals: Mapping[str, Any] + if sys.version_info >= (3, 6): def __init__( self, @@ -52,11 +73,178 @@ class Pdb(Cmd): stdout: Optional[IO[str]] = ..., skip: Optional[Iterable[str]] = ..., ) -> None: ... - # TODO: The run* and set_trace() methods are actually defined on bdb.Bdb, from which Pdb inherits. - # Move these methods there once we have a bdb stub. - def run(self, statement: str, globals: Optional[Dict[str, Any]] = ..., - locals: Optional[Dict[str, Any]] = ...) -> None: ... - def runeval(self, expression: str, globals: Optional[Dict[str, Any]] = ..., - locals: Optional[Dict[str, Any]] = ...) -> Any: ... - def runcall(self, func: Callable[..., _T], *args: Any, **kwds: Any) -> Optional[_T]: ... - def set_trace(self, frame: Optional[FrameType] = ...) -> None: ... + def forget(self) -> None: ... + def setup(self, f: Optional[FrameType], tb: Optional[TracebackType]) -> None: ... + def execRcLines(self) -> None: ... + def bp_commands(self, frame: FrameType) -> bool: ... + def interaction(self, frame: Optional[FrameType], traceback: Optional[TracebackType]) -> None: ... + def displayhook(self, obj: object) -> None: ... + def handle_command_def(self, line: str) -> bool: ... + def defaultFile(self) -> str: ... + def lineinfo(self, identifier: str) -> Union[Tuple[None, None, None], Tuple[str, str, int]]: ... + def checkline(self, filename: str, lineno: int) -> int: ... + def _getval(self, arg: str) -> object: ... + def print_stack_trace(self) -> None: ... + def print_stack_entry(self, frame_lineno: Tuple[FrameType, int], prompt_prefix: str = ...) -> None: ... + def lookupmodule(self, filename: str) -> Optional[str]: ... + def _runscript(self, filename: str) -> None: ... + def do_commands(self, arg: str) -> Optional[bool]: ... + def do_break(self, arg: str, temporary: bool = ...) -> Optional[bool]: ... + def do_tbreak(self, arg: str) -> Optional[bool]: ... + def do_enable(self, arg: str) -> Optional[bool]: ... + def do_disable(self, arg: str) -> Optional[bool]: ... + def do_condition(self, arg: str) -> Optional[bool]: ... + def do_ignore(self, arg: str) -> Optional[bool]: ... + def do_clear(self, arg: str) -> Optional[bool]: ... + def do_where(self, arg: str) -> Optional[bool]: ... + def do_up(self, arg: str) -> Optional[bool]: ... + def do_down(self, arg: str) -> Optional[bool]: ... + def do_until(self, arg: str) -> Optional[bool]: ... + def do_step(self, arg: str) -> Optional[bool]: ... + def do_next(self, arg: str) -> Optional[bool]: ... + def do_run(self, arg: str) -> Optional[bool]: ... + def do_return(self, arg: str) -> Optional[bool]: ... + def do_continue(self, arg: str) -> Optional[bool]: ... + def do_jump(self, arg: str) -> Optional[bool]: ... + def do_debug(self, arg: str) -> Optional[bool]: ... + def do_quit(self, arg: str) -> Optional[bool]: ... + def do_EOF(self, arg: str) -> Optional[bool]: ... + def do_args(self, arg: str) -> Optional[bool]: ... + def do_retval(self, arg: str) -> Optional[bool]: ... + def do_p(self, arg: str) -> Optional[bool]: ... + def do_pp(self, arg: str) -> Optional[bool]: ... + def do_list(self, arg: str) -> Optional[bool]: ... + def do_whatis(self, arg: str) -> Optional[bool]: ... + def do_alias(self, arg: str) -> Optional[bool]: ... + def do_unalias(self, arg: str) -> Optional[bool]: ... + def do_help(self, arg: str) -> Optional[bool]: ... + do_b = do_break + do_cl = do_clear + do_w = do_where + do_bt = do_where + do_u = do_up + do_d = do_down + do_unt = do_until + do_s = do_step + do_n = do_next + do_restart = do_run + do_r = do_return + do_c = do_continue + do_cont = do_continue + do_j = do_jump + do_q = do_quit + do_exit = do_quit + do_a = do_args + do_rv = do_retval + do_l = do_list + do_h = do_help + def help_exec(self) -> None: ... + def help_pdb(self) -> None: ... + if sys.version_info < (3, 2): + def help_help(self) -> None: ... + def help_h(self) -> None: ... + def help_where(self) -> None: ... + def help_w(self) -> None: ... + def help_down(self) -> None: ... + def help_d(self) -> None: ... + def help_up(self) -> None: ... + def help_u(self) -> None: ... + def help_break(self) -> None: ... + def help_b(self) -> None: ... + def help_clear(self) -> None: ... + def help_cl(self) -> None: ... + def help_tbreak(self) -> None: ... + def help_enable(self) -> None: ... + def help_disable(self) -> None: ... + def help_ignore(self) -> None: ... + def help_condition(self) -> None: ... + def help_step(self) -> None: ... + def help_s(self) -> None: ... + def help_until(self) -> None: ... + def help_unt(self) -> None: ... + def help_next(self) -> None: ... + def help_n(self) -> None: ... + def help_return(self) -> None: ... + def help_r(self) -> None: ... + def help_continue(self) -> None: ... + def help_cont(self) -> None: ... + def help_c(self) -> None: ... + def help_jump(self) -> None: ... + def help_j(self) -> None: ... + def help_debug(self) -> None: ... + def help_list(self) -> None: ... + def help_l(self) -> None: ... + def help_args(self) -> None: ... + def help_a(self) -> None: ... + def help_p(self) -> None: ... + def help_pp(self) -> None: ... + def help_run(self) -> None: ... + def help_quit(self) -> None: ... + def help_q(self) -> None: ... + def help_whatis(self) -> None: ... + def help_EOF(self) -> None: ... + def help_alias(self) -> None: ... + def help_unalias(self) -> None: ... + def help_commands(self) -> None: ... + help_bt = help_w + help_restart = help_run + help_exit = help_q + + if sys.version_info >= (3, 2): + def sigint_handler(self, signum: signal.Signals, frame: FrameType) -> None: ... + def message(self, msg: str) -> None: ... + def error(self, msg: str) -> None: ... + def _select_frame(self, number: int) -> None: ... + def _getval_except(self, arg: str, frame: Optional[FrameType] = ...) -> object: ... + def _print_lines( + self, lines: Sequence[str], start: int, breaks: Sequence[int] = ..., frame: Optional[FrameType] = ... + ) -> None: ... + def _cmdloop(self) -> None: ... + def do_display(self, arg: str) -> Optional[bool]: ... + def do_interact(self, arg: str) -> Optional[bool]: ... + def do_longlist(self, arg: str) -> Optional[bool]: ... + def do_source(self, arg: str) -> Optional[bool]: ... + def do_undisplay(self, arg: str) -> Optional[bool]: ... + do_ll = do_longlist + + if sys.version_info >= (3, 3): + def _complete_location(self, text: str, line: str, begidx: int, endidx: int) -> List[str]: ... + def _complete_bpnumber(self, text: str, line: str, begidx: int, endidx: int) -> List[str]: ... + def _complete_expression(self, text: str, line: str, begidx: int, endidx: int) -> List[str]: ... + def complete_undisplay(self, text: str, line: str, begidx: int, endidx: int) -> List[str]: ... + def complete_unalias(self, text: str, line: str, begidx: int, endidx: int) -> List[str]: ... + complete_commands = _complete_bpnumber + complete_break = _complete_location + complete_b = _complete_location + complete_tbreak = _complete_location + complete_enable = _complete_bpnumber + complete_disable = _complete_bpnumber + complete_condition = _complete_bpnumber + complete_ignore = _complete_bpnumber + complete_clear = _complete_location + complete_cl = _complete_location + complete_debug = _complete_expression + complete_print = _complete_expression + complete_p = _complete_expression + complete_pp = _complete_expression + complete_source = _complete_expression + complete_whatis = _complete_expression + complete_display = _complete_expression + + if sys.version_info >= (3, 7): + def _runmodule(self, module_name: str) -> None: ... + if sys.version_info >= (3,) and sys.version_info < (3, 4): + do_print = do_p + +# undocumented + +def find_function(funcname: str, filename: str) -> Optional[Tuple[str, str, int]]: ... +def main() -> None: ... +def help() -> None: ... + +if sys.version_info >= (3, 2): + def getsourcelines(obj: _SourceObjectType) -> Tuple[List[str], int]: ... + def lasti2lineno(code: CodeType, lasti: int) -> int: ... + +class _rstr(str): + def __repr__(self) -> _rstr: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/pickle.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/pickle.pyi old mode 100755 new mode 100644 index ec9353f6..ddf8a440 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/pickle.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/pickle.pyi @@ -1,20 +1,49 @@ import sys -from typing import Any, IO, Mapping, Union, Tuple, Callable, Optional, Iterator +from typing import IO, Any, Callable, Iterable, Iterator, Mapping, Optional, Tuple, Type, Union HIGHEST_PROTOCOL: int if sys.version_info >= (3, 0): DEFAULT_PROTOCOL: int +bytes_types: Tuple[Type[Any], ...] # undocumented + +if sys.version_info >= (3, 8): + # TODO: holistic design for buffer interface (typing.Buffer?) + class PickleBuffer: + # buffer must be a buffer-providing object + def __init__(self, buffer: Any) -> None: ... + def raw(self) -> memoryview: ... + def release(self) -> None: ... + _BufferCallback = Optional[Callable[[PickleBuffer], Any]] + def dump( + obj: Any, + file: IO[bytes], + protocol: Optional[int] = ..., + *, + fix_imports: bool = ..., + buffer_callback: _BufferCallback = ..., + ) -> None: ... + def dumps( + obj: Any, protocol: Optional[int] = ..., *, fix_imports: bool = ..., buffer_callback: _BufferCallback = ... + ) -> bytes: ... + def load( + file: IO[bytes], + *, + fix_imports: bool = ..., + encoding: str = ..., + errors: str = ..., + buffers: Optional[Iterable[Any]] = ..., + ) -> Any: ... + def loads( + __data: bytes, *, fix_imports: bool = ..., encoding: str = ..., errors: str = ..., buffers: Optional[Iterable[Any]] = ... + ) -> Any: ... + +elif sys.version_info >= (3, 0): + def dump(obj: Any, file: IO[bytes], protocol: Optional[int] = ..., *, fix_imports: bool = ...) -> None: ... + def dumps(obj: Any, protocol: Optional[int] = ..., *, fix_imports: bool = ...) -> bytes: ... + def load(file: IO[bytes], *, fix_imports: bool = ..., encoding: str = ..., errors: str = ...) -> Any: ... + def loads(data: bytes, *, fix_imports: bool = ..., encoding: str = ..., errors: str = ...) -> Any: ... -if sys.version_info >= (3, 0): - def dump(obj: Any, file: IO[bytes], protocol: Optional[int] = ..., *, - fix_imports: bool = ...) -> None: ... - def dumps(obj: Any, protocol: Optional[int] = ..., *, - fix_imports: bool = ...) -> bytes: ... - def loads(bytes_object: bytes, *, fix_imports: bool = ..., - encoding: str = ..., errors: str = ...) -> Any: ... - def load(file: IO[bytes], *, fix_imports: bool = ..., encoding: str = ..., - errors: str = ...) -> Any: ... else: def dump(obj: Any, file: IO[bytes], protocol: Optional[int] = ...) -> None: ... def dumps(obj: Any, protocol: Optional[int] = ...) -> bytes: ... @@ -25,41 +54,54 @@ class PickleError(Exception): ... class PicklingError(PickleError): ... class UnpicklingError(PickleError): ... -_reducedtype = Union[str, - Tuple[Callable[..., Any], Tuple[Any, ...]], - Tuple[Callable[..., Any], Tuple[Any, ...], Any], - Tuple[Callable[..., Any], Tuple[Any, ...], Any, - Optional[Iterator]], - Tuple[Callable[..., Any], Tuple[Any, ...], Any, - Optional[Iterator], Optional[Iterator]]] - +_reducedtype = Union[ + str, + Tuple[Callable[..., Any], Tuple[Any, ...]], + Tuple[Callable[..., Any], Tuple[Any, ...], Any], + Tuple[Callable[..., Any], Tuple[Any, ...], Any, Optional[Iterator[Any]]], + Tuple[Callable[..., Any], Tuple[Any, ...], Any, Optional[Iterator[Any]], Optional[Iterator[Any]]], +] class Pickler: fast: bool if sys.version_info >= (3, 3): dispatch_table: Mapping[type, Callable[[Any], _reducedtype]] - if sys.version_info >= (3, 0): - def __init__(self, file: IO[bytes], protocol: Optional[int] = ..., *, - fix_imports: bool = ...) -> None: ... + if sys.version_info >= (3, 8): + def __init__( + self, + file: IO[bytes], + protocol: Optional[int] = ..., + *, + fix_imports: bool = ..., + buffer_callback: _BufferCallback = ..., + ) -> None: ... + def reducer_override(self, obj: Any) -> Any: ... + elif sys.version_info >= (3, 0): + def __init__(self, file: IO[bytes], protocol: Optional[int] = ..., *, fix_imports: bool = ...) -> None: ... else: def __init__(self, file: IO[bytes], protocol: Optional[int] = ...) -> None: ... - - def dump(self, obj: Any) -> None: ... + def dump(self, __obj: Any) -> None: ... def clear_memo(self) -> None: ... def persistent_id(self, obj: Any) -> Any: ... - if sys.version_info >= (3, 8): - def reducer_override(self, obj: Any) -> Any: ... class Unpickler: - if sys.version_info >= (3, 0): - def __init__(self, file: IO[bytes], *, fix_imports: bool = ..., - encoding: str = ..., errors: str = ...) -> None: ... + if sys.version_info >= (3, 8): + def __init__( + self, + file: IO[bytes], + *, + fix_imports: bool = ..., + encoding: str = ..., + errors: str = ..., + buffers: Optional[Iterable[Any]] = ..., + ) -> None: ... + elif sys.version_info >= (3, 0): + def __init__(self, file: IO[bytes], *, fix_imports: bool = ..., encoding: str = ..., errors: str = ...) -> None: ... else: def __init__(self, file: IO[bytes]) -> None: ... - def load(self) -> Any: ... - def find_class(self, module: str, name: str) -> Any: ... + def find_class(self, __module_name: str, __global_name: str) -> Any: ... if sys.version_info >= (3, 0): def persistent_load(self, pid: Any) -> Any: ... @@ -139,3 +181,6 @@ if sys.version_info >= (3, 4): STACK_GLOBAL: bytes MEMOIZE: bytes FRAME: bytes + +def encode_long(x: int) -> bytes: ... # undocumented +def decode_long(data: bytes) -> int: ... # undocumented diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/pickletools.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/pickletools.pyi old mode 100755 new mode 100644 index c0366469..ec279524 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/pickletools.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/pickletools.pyi @@ -1,6 +1,5 @@ -# Stubs for pickletools (Python 2 and 3) import sys -from typing import Any, Callable, IO, Iterator, List, MutableMapping, Optional, Text, Tuple, Type, Union +from typing import IO, Any, Callable, Iterator, List, MutableMapping, Optional, Text, Tuple, Type, Union _Reader = Callable[[IO[bytes]], Any] @@ -23,12 +22,15 @@ class ArgumentDescriptor(object): def __init__(self, name: str, n: int, reader: _Reader, doc: str) -> None: ... def read_uint1(f: IO[bytes]) -> int: ... + uint1: ArgumentDescriptor def read_uint2(f: IO[bytes]) -> int: ... + uint2: ArgumentDescriptor def read_int4(f: IO[bytes]) -> int: ... + int4: ArgumentDescriptor if sys.version_info >= (3, 3): @@ -40,24 +42,28 @@ if sys.version_info >= (3, 5): uint8: ArgumentDescriptor def read_stringnl(f: IO[bytes], decode: bool = ..., stripquotes: bool = ...) -> Union[bytes, Text]: ... + stringnl: ArgumentDescriptor def read_stringnl_noescape(f: IO[bytes]) -> str: ... + stringnl_noescape: ArgumentDescriptor def read_stringnl_noescape_pair(f: IO[bytes]) -> Text: ... + stringnl_noescape_pair: ArgumentDescriptor def read_string1(f: IO[bytes]) -> str: ... + string1: ArgumentDescriptor def read_string4(f: IO[bytes]) -> str: ... + string4: ArgumentDescriptor if sys.version_info >= (3, 3): def read_bytes1(f: IO[bytes]) -> bytes: ... bytes1: ArgumentDescriptor - def read_bytes4(f: IO[bytes]) -> bytes: ... bytes4: ArgumentDescriptor @@ -66,6 +72,7 @@ if sys.version_info >= (3, 4): bytes8: ArgumentDescriptor def read_unicodestringnl(f: IO[bytes]) -> Text: ... + unicodestringnl: ArgumentDescriptor if sys.version_info >= (3, 4): @@ -73,6 +80,7 @@ if sys.version_info >= (3, 4): unicodestring1: ArgumentDescriptor def read_unicodestring4(f: IO[bytes]) -> Text: ... + unicodestring4: ArgumentDescriptor if sys.version_info >= (3, 4): @@ -81,19 +89,24 @@ if sys.version_info >= (3, 4): def read_decimalnl_short(f: IO[bytes]) -> int: ... def read_decimalnl_long(f: IO[bytes]) -> int: ... + decimalnl_short: ArgumentDescriptor decimalnl_long: ArgumentDescriptor def read_floatnl(f: IO[bytes]) -> float: ... + floatnl: ArgumentDescriptor def read_float8(f: IO[bytes]) -> float: ... + float8: ArgumentDescriptor def read_long1(f: IO[bytes]) -> int: ... + long1: ArgumentDescriptor def read_long4(f: IO[bytes]) -> int: ... + long4: ArgumentDescriptor class StackObject(object): @@ -132,14 +145,35 @@ class OpcodeInfo(object): stack_after: List[StackObject] proto: int doc: str - def __init__(self, name: str, code: str, arg: Optional[ArgumentDescriptor], - stack_before: List[StackObject], stack_after: List[StackObject], proto: int, doc: str) -> None: ... + def __init__( + self, + name: str, + code: str, + arg: Optional[ArgumentDescriptor], + stack_before: List[StackObject], + stack_after: List[StackObject], + proto: int, + doc: str, + ) -> None: ... opcodes: List[OpcodeInfo] def genops(pickle: Union[bytes, IO[bytes]]) -> Iterator[Tuple[OpcodeInfo, Optional[Any], Optional[int]]]: ... def optimize(p: Union[bytes, IO[bytes]]) -> bytes: ... + if sys.version_info >= (3, 2): - def dis(pickle: Union[bytes, IO[bytes]], out: Optional[IO[str]] = ..., memo: Optional[MutableMapping[int, Any]] = ..., indentlevel: int = ..., annotate: int = ...) -> None: ... + def dis( + pickle: Union[bytes, IO[bytes]], + out: Optional[IO[str]] = ..., + memo: Optional[MutableMapping[int, Any]] = ..., + indentlevel: int = ..., + annotate: int = ..., + ) -> None: ... + else: - def dis(pickle: Union[bytes, IO[bytes]], out: Optional[IO[str]] = ..., memo: Optional[MutableMapping[int, Any]] = ..., indentlevel: int = ...) -> None: ... + def dis( + pickle: Union[bytes, IO[bytes]], + out: Optional[IO[str]] = ..., + memo: Optional[MutableMapping[int, Any]] = ..., + indentlevel: int = ..., + ) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/pkgutil.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/pkgutil.pyi old mode 100755 new mode 100644 index 138a0f8b..5fd02541 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/pkgutil.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/pkgutil.pyi @@ -1,22 +1,22 @@ -# Stubs for pkgutil - -from typing import Any, Callable, Generator, IO, Iterable, Optional, Tuple, NamedTuple import sys +from _typeshed import SupportsRead +from typing import IO, Any, Callable, Iterable, Iterator, NamedTuple, Optional, Tuple, Union if sys.version_info >= (3,): - from importlib.abc import Loader + from importlib.abc import Loader, MetaPathFinder, PathEntryFinder else: Loader = Any + MetaPathFinder = Any + PathEntryFinder = Any if sys.version_info >= (3, 6): class ModuleInfo(NamedTuple): - module_finder: Any + module_finder: Union[MetaPathFinder, PathEntryFinder] name: str ispkg: bool - _YMFNI = Generator[ModuleInfo, None, None] + _ModuleInfoLike = ModuleInfo else: - _YMFNI = Generator[Tuple[Any, str, bool], None, None] - + _ModuleInfoLike = Tuple[Union[MetaPathFinder, PathEntryFinder], str, bool] def extend_path(path: Iterable[str], name: str) -> Iterable[str]: ... @@ -24,15 +24,15 @@ class ImpImporter: def __init__(self, dirname: Optional[str] = ...) -> None: ... class ImpLoader: - def __init__(self, fullname: str, file: IO[str], filename: str, - etc: Tuple[str, str, int]) -> None: ... + def __init__(self, fullname: str, file: IO[str], filename: str, etc: Tuple[str, str, int]) -> None: ... def find_loader(fullname: str) -> Optional[Loader]: ... -def get_importer(path_item: str) -> Any: ... # TODO precise type +def get_importer(path_item: str) -> Optional[PathEntryFinder]: ... def get_loader(module_or_name: str) -> Loader: ... -def iter_importers(fullname: str = ...) -> Generator[Any, None, None]: ... # TODO precise type -def iter_modules(path: Optional[Iterable[str]] = ..., - prefix: str = ...) -> _YMFNI: ... # TODO precise type -def walk_packages(path: Optional[Iterable[str]] = ..., prefix: str = ..., - onerror: Optional[Callable[[str], None]] = ...) -> _YMFNI: ... +def iter_importers(fullname: str = ...) -> Iterator[Union[MetaPathFinder, PathEntryFinder]]: ... +def iter_modules(path: Optional[Iterable[str]] = ..., prefix: str = ...) -> Iterator[_ModuleInfoLike]: ... +def read_code(stream: SupportsRead[bytes]) -> Any: ... # undocumented +def walk_packages( + path: Optional[Iterable[str]] = ..., prefix: str = ..., onerror: Optional[Callable[[str], None]] = ... +) -> Iterator[_ModuleInfoLike]: ... def get_data(package: str, resource: str) -> Optional[bytes]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/plistlib.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/plistlib.pyi old mode 100755 new mode 100644 index 5b840980..5aadae9f --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/plistlib.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/plistlib.pyi @@ -1,49 +1,52 @@ -# Stubs for plistlib - -from typing import ( - Any, IO, Mapping, MutableMapping, Optional, Union, - Type, TypeVar, -) -from typing import Dict as DictT import sys +from typing import IO, Any, Dict as DictT, Mapping, MutableMapping, Optional, Text, Type, Union + if sys.version_info >= (3,): from enum import Enum - class PlistFormat(Enum): FMT_XML: int FMT_BINARY: int FMT_XML = PlistFormat.FMT_XML FMT_BINARY = PlistFormat.FMT_BINARY -mm = MutableMapping[str, Any] -_D = TypeVar('_D', bound=mm) -if sys.version_info >= (3,): - _Path = str -else: - _Path = Union[str, unicode] +_Path = Union[str, Text] + +if sys.version_info >= (3, 9): + def load(fp: IO[bytes], *, fmt: Optional[PlistFormat] = ..., dict_type: Type[MutableMapping[str, Any]] = ...) -> Any: ... + def loads(value: bytes, *, fmt: Optional[PlistFormat] = ..., dict_type: Type[MutableMapping[str, Any]] = ...) -> Any: ... + +elif sys.version_info >= (3, 4): + def load( + fp: IO[bytes], + *, + fmt: Optional[PlistFormat] = ..., + use_builtin_types: bool = ..., + dict_type: Type[MutableMapping[str, Any]] = ..., + ) -> Any: ... + def loads( + value: bytes, + *, + fmt: Optional[PlistFormat] = ..., + use_builtin_types: bool = ..., + dict_type: Type[MutableMapping[str, Any]] = ..., + ) -> Any: ... if sys.version_info >= (3, 4): - def load(fp: IO[bytes], *, fmt: Optional[PlistFormat] = ..., - use_builtin_types: bool = ..., dict_type: Type[_D] = ...) -> _D: ... - def loads(data: bytes, *, fmt: Optional[PlistFormat] = ..., - use_builtin_types: bool = ..., dict_type: Type[_D] = ...) -> _D: ... - def dump(value: Mapping[str, Any], fp: IO[bytes], *, - fmt: PlistFormat = ..., sort_keys: bool = ..., - skipkeys: bool = ...) -> None: ... - def dumps(value: Mapping[str, Any], *, fmt: PlistFormat = ..., - skipkeys: bool = ..., sort_keys: bool = ...) -> bytes: ... + def dump( + value: Mapping[str, Any], fp: IO[bytes], *, fmt: PlistFormat = ..., sort_keys: bool = ..., skipkeys: bool = ... + ) -> None: ... + def dumps(value: Mapping[str, Any], *, fmt: PlistFormat = ..., skipkeys: bool = ..., sort_keys: bool = ...) -> bytes: ... + +if sys.version_info < (3, 9): + def readPlist(pathOrFile: Union[_Path, IO[bytes]]) -> Any: ... + def writePlist(value: Mapping[str, Any], pathOrFile: Union[_Path, IO[bytes]]) -> None: ... + def readPlistFromBytes(data: bytes) -> Any: ... + def writePlistToBytes(value: Mapping[str, Any]) -> bytes: ... -def readPlist(pathOrFile: Union[_Path, IO[bytes]]) -> DictT[str, Any]: ... -def writePlist(value: Mapping[str, Any], pathOrFile: Union[_Path, IO[bytes]]) -> None: ... -def readPlistFromBytes(data: bytes) -> DictT[str, Any]: ... -def writePlistToBytes(value: Mapping[str, Any]) -> bytes: ... if sys.version_info < (3,): - def readPlistFromResource(path: _Path, restype: str = ..., - resid: int = ...) -> DictT[str, Any]: ... - def writePlistToResource(rootObject: Mapping[str, Any], path: _Path, - restype: str = ..., - resid: int = ...) -> None: ... - def readPlistFromString(data: str) -> DictT[str, Any]: ... + def readPlistFromResource(path: _Path, restype: str = ..., resid: int = ...) -> Any: ... + def writePlistToResource(rootObject: Mapping[str, Any], path: _Path, restype: str = ..., resid: int = ...) -> None: ... + def readPlistFromString(data: str) -> Any: ... def writePlistToString(rootObject: Mapping[str, Any]) -> str: ... if sys.version_info < (3, 7): @@ -52,9 +55,10 @@ if sys.version_info < (3, 7): def __setattr__(self, attr: str, value: Any) -> None: ... def __delattr__(self, attr: str) -> None: ... -class Data: - data: bytes - def __init__(self, data: bytes) -> None: ... +if sys.version_info < (3, 9): + class Data: + data: bytes + def __init__(self, data: bytes) -> None: ... if sys.version_info >= (3, 8): class UID: @@ -63,3 +67,6 @@ if sys.version_info >= (3, 8): def __index__(self) -> int: ... def __reduce__(self) -> Any: ... def __hash__(self) -> int: ... + +class InvalidFileException(ValueError): + def __init__(self, message: str = ...) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/poplib.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/poplib.pyi old mode 100755 new mode 100644 index d2b7dab6..2c08f358 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/poplib.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/poplib.pyi @@ -1,12 +1,7 @@ -# Stubs for poplib (Python 2 and 3) - import socket import ssl import sys -from typing import ( - Any, BinaryIO, Dict, List, NoReturn, Optional, overload, Pattern, Text, - Tuple, -) +from typing import Any, BinaryIO, Dict, List, Optional, Pattern, Text, Tuple, overload _LongResp = Tuple[bytes, List[bytes], int] @@ -18,7 +13,6 @@ CR: bytes LF: bytes CRLF: bytes - class POP3: if sys.version_info >= (3, 0): encoding: Text @@ -28,7 +22,6 @@ class POP3: sock: socket.socket file: BinaryIO welcome: bytes - def __init__(self, host: Text, port: int = ..., timeout: float = ...) -> None: ... def getwelcome(self) -> bytes: ... def set_debuglevel(self, level: int) -> None: ... @@ -43,7 +36,6 @@ class POP3: def quit(self) -> bytes: ... def close(self) -> None: ... def rpop(self, user: Text) -> bytes: ... - timestamp: Pattern[Text] if sys.version_info < (3, 0): @@ -51,27 +43,31 @@ class POP3: else: def apop(self, user: Text, password: Text) -> bytes: ... def top(self, which: Any, howmuch: int) -> _LongResp: ... - @overload def uidl(self) -> _LongResp: ... @overload def uidl(self, which: Any) -> bytes: ... - if sys.version_info >= (3, 5): def utf8(self) -> bytes: ... if sys.version_info >= (3, 4): def capa(self) -> Dict[Text, List[Text]]: ... def stls(self, context: Optional[ssl.SSLContext] = ...) -> bytes: ... - class POP3_SSL(POP3): if sys.version_info >= (3, 0): - def __init__(self, host: Text, port: int = ..., keyfile: Optional[Text] = ..., certfile: Optional[Text] = ..., - timeout: float = ..., context: Optional[ssl.SSLContext] = ...) -> None: ... + def __init__( + self, + host: Text, + port: int = ..., + keyfile: Optional[Text] = ..., + certfile: Optional[Text] = ..., + timeout: float = ..., + context: Optional[ssl.SSLContext] = ..., + ) -> None: ... else: - def __init__(self, host: Text, port: int = ..., keyfile: Optional[Text] = ..., certfile: Optional[Text] = ..., - timeout: float = ...) -> None: ... - + def __init__( + self, host: Text, port: int = ..., keyfile: Optional[Text] = ..., certfile: Optional[Text] = ..., timeout: float = ... + ) -> None: ... if sys.version_info >= (3, 4): # "context" is actually the last argument, but that breaks LSP and it doesn't really matter because all the arguments are ignored def stls(self, context: Any = ..., keyfile: Any = ..., certfile: Any = ...) -> bytes: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/posixpath.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/posixpath.pyi deleted file mode 100755 index 42409c0e..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/posixpath.pyi +++ /dev/null @@ -1,177 +0,0 @@ -# NB: path.pyi and stdlib/2 and stdlib/3 must remain consistent! -# Stubs for os.path -# Ron Murawski - -import os -import sys -from typing import overload, List, Any, AnyStr, Sequence, Tuple, TypeVar, Union, Text, Callable, Optional - -_T = TypeVar('_T') - -if sys.version_info >= (3, 6): - from builtins import _PathLike - _PathType = Union[bytes, Text, _PathLike] - _StrPath = Union[Text, _PathLike[Text]] - _BytesPath = Union[bytes, _PathLike[bytes]] -else: - _PathType = Union[bytes, Text] - _StrPath = Text - _BytesPath = bytes - -# ----- os.path variables ----- -supports_unicode_filenames: bool -# aliases (also in os) -curdir: str -pardir: str -sep: str -if sys.platform == 'win32': - altsep: str -else: - altsep: Optional[str] -extsep: str -pathsep: str -defpath: str -devnull: str - -# ----- os.path function stubs ----- -if sys.version_info >= (3, 6): - # Overloads are necessary to work around python/mypy#3644. - @overload - def abspath(path: _PathLike[AnyStr]) -> AnyStr: ... - @overload - def abspath(path: AnyStr) -> AnyStr: ... - @overload - def basename(path: _PathLike[AnyStr]) -> AnyStr: ... - @overload - def basename(path: AnyStr) -> AnyStr: ... - @overload - def dirname(path: _PathLike[AnyStr]) -> AnyStr: ... - @overload - def dirname(path: AnyStr) -> AnyStr: ... - @overload - def expanduser(path: _PathLike[AnyStr]) -> AnyStr: ... - @overload - def expanduser(path: AnyStr) -> AnyStr: ... - @overload - def expandvars(path: _PathLike[AnyStr]) -> AnyStr: ... - @overload - def expandvars(path: AnyStr) -> AnyStr: ... - @overload - def normcase(path: _PathLike[AnyStr]) -> AnyStr: ... - @overload - def normcase(path: AnyStr) -> AnyStr: ... - @overload - def normpath(path: _PathLike[AnyStr]) -> AnyStr: ... - @overload - def normpath(path: AnyStr) -> AnyStr: ... - if sys.platform == 'win32': - @overload - def realpath(path: _PathLike[AnyStr]) -> AnyStr: ... - @overload - def realpath(path: AnyStr) -> AnyStr: ... - else: - @overload - def realpath(filename: _PathLike[AnyStr]) -> AnyStr: ... - @overload - def realpath(filename: AnyStr) -> AnyStr: ... - -else: - def abspath(path: AnyStr) -> AnyStr: ... - def basename(path: AnyStr) -> AnyStr: ... - def dirname(path: AnyStr) -> AnyStr: ... - def expanduser(path: AnyStr) -> AnyStr: ... - def expandvars(path: AnyStr) -> AnyStr: ... - def normcase(path: AnyStr) -> AnyStr: ... - def normpath(path: AnyStr) -> AnyStr: ... - if sys.platform == 'win32': - def realpath(path: AnyStr) -> AnyStr: ... - else: - def realpath(filename: AnyStr) -> AnyStr: ... - -if sys.version_info >= (3, 6): - # In reality it returns str for sequences of _StrPath and bytes for sequences - # of _BytesPath, but mypy does not accept such a signature. - def commonpath(paths: Sequence[_PathType]) -> Any: ... -elif sys.version_info >= (3, 5): - def commonpath(paths: Sequence[AnyStr]) -> AnyStr: ... - -# NOTE: Empty lists results in '' (str) regardless of contained type. -# Also, in Python 2 mixed sequences of Text and bytes results in either Text or bytes -# So, fall back to Any -def commonprefix(list: Sequence[_PathType]) -> Any: ... - -if sys.version_info >= (3, 3): - def exists(path: Union[_PathType, int]) -> bool: ... -else: - def exists(path: _PathType) -> bool: ... -def lexists(path: _PathType) -> bool: ... - -# These return float if os.stat_float_times() == True, -# but int is a subclass of float. -def getatime(path: _PathType) -> float: ... -def getmtime(path: _PathType) -> float: ... -def getctime(path: _PathType) -> float: ... - -def getsize(path: _PathType) -> int: ... -def isabs(path: _PathType) -> bool: ... -def isfile(path: _PathType) -> bool: ... -def isdir(path: _PathType) -> bool: ... -def islink(path: _PathType) -> bool: ... -def ismount(path: _PathType) -> bool: ... - -if sys.version_info < (3, 0): - # Make sure signatures are disjunct, and allow combinations of bytes and unicode. - # (Since Python 2 allows that, too) - # Note that e.g. os.path.join("a", "b", "c", "d", u"e") will still result in - # a type error. - @overload - def join(__p1: bytes, *p: bytes) -> bytes: ... - @overload - def join(__p1: bytes, __p2: bytes, __p3: bytes, __p4: Text, *p: _PathType) -> Text: ... - @overload - def join(__p1: bytes, __p2: bytes, __p3: Text, *p: _PathType) -> Text: ... - @overload - def join(__p1: bytes, __p2: Text, *p: _PathType) -> Text: ... - @overload - def join(__p1: Text, *p: _PathType) -> Text: ... -elif sys.version_info >= (3, 6): - # Mypy complains that the signatures overlap (same for relpath below), but things seem to behave correctly anyway. - @overload - def join(path: _StrPath, *paths: _StrPath) -> Text: ... - @overload - def join(path: _BytesPath, *paths: _BytesPath) -> bytes: ... -else: - def join(path: AnyStr, *paths: AnyStr) -> AnyStr: ... - -@overload -def relpath(path: _BytesPath, start: Optional[_BytesPath] = ...) -> bytes: ... -@overload -def relpath(path: _StrPath, start: Optional[_StrPath] = ...) -> Text: ... - -def samefile(path1: _PathType, path2: _PathType) -> bool: ... -def sameopenfile(fp1: int, fp2: int) -> bool: ... -def samestat(stat1: os.stat_result, stat2: os.stat_result) -> bool: ... - -if sys.version_info >= (3, 6): - @overload - def split(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... - @overload - def split(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... - @overload - def splitdrive(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... - @overload - def splitdrive(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... - @overload - def splitext(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... - @overload - def splitext(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... -else: - def split(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... - def splitdrive(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... - def splitext(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... - -if sys.platform == 'win32': - def splitunc(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... # deprecated - -if sys.version_info < (3,): - def walk(path: AnyStr, visit: Callable[[_T, AnyStr, List[AnyStr]], Any], arg: _T) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/pprint.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/pprint.pyi old mode 100755 new mode 100644 index 3b15d731..6c1133aa --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/pprint.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/pprint.pyi @@ -1,40 +1,97 @@ -# Stubs for pprint +import sys +from typing import IO, Any, Dict, Optional, Tuple -# Based on http://docs.python.org/2/library/pprint.html -# Based on http://docs.python.org/3/library/pprint.html +if sys.version_info >= (3, 8): + def pformat( + object: object, + indent: int = ..., + width: int = ..., + depth: Optional[int] = ..., + *, + compact: bool = ..., + sort_dicts: bool = ..., + ) -> str: ... -import sys -from typing import Any, Dict, Tuple, IO, Optional +elif sys.version_info >= (3, 4): + def pformat( + object: object, indent: int = ..., width: int = ..., depth: Optional[int] = ..., *, compact: bool = ... + ) -> str: ... -if sys.version_info >= (3, 4): - def pformat(o: object, indent: int = ..., width: int = ..., - depth: Optional[int] = ..., compact: bool = ...) -> str: ... else: - def pformat(o: object, indent: int = ..., width: int = ..., - depth: Optional[int] = ...) -> str: ... + def pformat(object: object, indent: int = ..., width: int = ..., depth: Optional[int] = ...) -> str: ... + +if sys.version_info >= (3, 8): + def pp( + object: object, + stream: Optional[IO[str]] = ..., + indent: int = ..., + width: int = ..., + depth: Optional[int] = ..., + *, + compact: bool = ..., + sort_dicts: bool = ..., + ) -> None: ... + +if sys.version_info >= (3, 8): + def pprint( + object: object, + stream: Optional[IO[str]] = ..., + indent: int = ..., + width: int = ..., + depth: Optional[int] = ..., + *, + compact: bool = ..., + sort_dicts: bool = ..., + ) -> None: ... + +elif sys.version_info >= (3, 4): + def pprint( + object: object, + stream: Optional[IO[str]] = ..., + indent: int = ..., + width: int = ..., + depth: Optional[int] = ..., + *, + compact: bool = ..., + ) -> None: ... -if sys.version_info >= (3, 4): - def pprint(o: object, stream: Optional[IO[str]] = ..., indent: int = ..., width: int = ..., - depth: Optional[int] = ..., compact: bool = ...) -> None: ... else: - def pprint(o: object, stream: Optional[IO[str]] = ..., indent: int = ..., width: int = ..., - depth: Optional[int] = ...) -> None: ... + def pprint( + object: object, stream: Optional[IO[str]] = ..., indent: int = ..., width: int = ..., depth: Optional[int] = ... + ) -> None: ... -def isreadable(o: object) -> bool: ... -def isrecursive(o: object) -> bool: ... -def saferepr(o: object) -> str: ... +def isreadable(object: object) -> bool: ... +def isrecursive(object: object) -> bool: ... +def saferepr(object: object) -> str: ... class PrettyPrinter: - if sys.version_info >= (3, 4): - def __init__(self, indent: int = ..., width: int = ..., depth: Optional[int] = ..., - stream: Optional[IO[str]] = ..., compact: bool = ...) -> None: ... + if sys.version_info >= (3, 8): + def __init__( + self, + indent: int = ..., + width: int = ..., + depth: Optional[int] = ..., + stream: Optional[IO[str]] = ..., + *, + compact: bool = ..., + sort_dicts: bool = ..., + ) -> None: ... + elif sys.version_info >= (3, 4): + def __init__( + self, + indent: int = ..., + width: int = ..., + depth: Optional[int] = ..., + stream: Optional[IO[str]] = ..., + *, + compact: bool = ..., + ) -> None: ... else: - def __init__(self, indent: int = ..., width: int = ..., depth: Optional[int] = ..., - stream: Optional[IO[str]] = ...) -> None: ... - - def pformat(self, o: object) -> str: ... - def pprint(self, o: object) -> None: ... - def isreadable(self, o: object) -> bool: ... - def isrecursive(self, o: object) -> bool: ... - def format(self, o: object, context: Dict[int, Any], maxlevels: int, - level: int) -> Tuple[str, bool, bool]: ... + def __init__( + self, indent: int = ..., width: int = ..., depth: Optional[int] = ..., stream: Optional[IO[str]] = ... + ) -> None: ... + def pformat(self, object: object) -> str: ... + def pprint(self, object: object) -> None: ... + def isreadable(self, object: object) -> bool: ... + def isrecursive(self, object: object) -> bool: ... + def format(self, object: object, context: Dict[int, Any], maxlevels: int, level: int) -> Tuple[str, bool, bool]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/profile.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/profile.pyi old mode 100755 new mode 100644 index b511cbc2..d5f4bd4d --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/profile.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/profile.pyi @@ -1,27 +1,25 @@ -import os -import sys -from typing import Any, Callable, Dict, Optional, Text, TypeVar, Union +from _typeshed import AnyPath +from typing import Any, Callable, Dict, Optional, TypeVar, Union def run(statement: str, filename: Optional[str] = ..., sort: Union[str, int] = ...) -> None: ... -def runctx(statement: str, globals: Dict[str, Any], locals: Dict[str, Any], filename: Optional[str] = ..., sort: Union[str, int] = ...) -> None: ... +def runctx( + statement: str, globals: Dict[str, Any], locals: Dict[str, Any], filename: Optional[str] = ..., sort: Union[str, int] = ... +) -> None: ... -_SelfT = TypeVar('_SelfT', bound=Profile) -_T = TypeVar('_T') -if sys.version_info >= (3, 6): - _Path = Union[bytes, Text, os.PathLike[Any]] -else: - _Path = Union[bytes, Text] +_SelfT = TypeVar("_SelfT", bound=Profile) +_T = TypeVar("_T") class Profile: + bias: int def __init__(self, timer: Optional[Callable[[], float]] = ..., bias: Optional[int] = ...) -> None: ... def set_cmd(self, cmd: str) -> None: ... def simulate_call(self, name: str) -> None: ... def simulate_cmd_complete(self) -> None: ... def print_stats(self, sort: Union[str, int] = ...) -> None: ... - def dump_stats(self, file: _Path) -> None: ... + def dump_stats(self, file: AnyPath) -> None: ... def create_stats(self) -> None: ... def snapshot_stats(self) -> None: ... def run(self: _SelfT, cmd: str) -> _SelfT: ... def runctx(self: _SelfT, cmd: str, globals: Dict[str, Any], locals: Dict[str, Any]) -> _SelfT: ... - def runcall(self, func: Callable[..., _T], *args: Any, **kw: Any) -> _T: ... + def runcall(self, __func: Callable[..., _T], *args: Any, **kw: Any) -> _T: ... def calibrate(self, m: int, verbose: int = ...) -> float: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/pstats.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/pstats.pyi old mode 100755 new mode 100644 index 5c1bb2a3..9c74aeb9 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/pstats.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/pstats.pyi @@ -1,25 +1,38 @@ -from profile import Profile -from cProfile import Profile as _cProfile -import os import sys -from typing import Any, Dict, IO, Iterable, List, Text, Tuple, TypeVar, Union, overload +from _typeshed import AnyPath +from cProfile import Profile as _cProfile +from profile import Profile +from typing import IO, Any, Dict, Iterable, List, Optional, Text, Tuple, TypeVar, Union, overload _Selector = Union[str, float, int] -_T = TypeVar('_T', bound=Stats) -if sys.version_info >= (3, 6): - _Path = Union[bytes, Text, os.PathLike[Any]] -else: - _Path = Union[bytes, Text] +_T = TypeVar("_T", bound=Stats) + +if sys.version_info >= (3, 7): + from enum import Enum + class SortKey(str, Enum): + CALLS: str + CUMULATIVE: str + FILENAME: str + LINE: str + NAME: str + NFL: str + PCALLS: str + STDNAME: str + TIME: str class Stats: - def __init__(self: _T, __arg: Union[None, str, Text, Profile, _cProfile] = ..., - *args: Union[None, str, Text, Profile, _cProfile, _T], - stream: IO[Any] = ...) -> None: ... + sort_arg_dict_default: Dict[str, Tuple[Any, str]] + def __init__( + self: _T, + __arg: Union[None, str, Text, Profile, _cProfile] = ..., + *args: Union[None, str, Text, Profile, _cProfile, _T], + stream: Optional[IO[Any]] = ..., + ) -> None: ... def init(self, arg: Union[None, str, Text, Profile, _cProfile]) -> None: ... def load_stats(self, arg: Union[None, str, Text, Profile, _cProfile]) -> None: ... def get_top_level_stats(self) -> None: ... def add(self: _T, *arg_list: Union[None, str, Text, Profile, _cProfile, _T]) -> _T: ... - def dump_stats(self, filename: _Path) -> None: ... + def dump_stats(self, filename: AnyPath) -> None: ... def get_sort_arg_defs(self) -> Dict[str, Tuple[Tuple[Tuple[int, int], ...], str]]: ... @overload def sort_stats(self: _T, field: int) -> _T: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/pty.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/pty.pyi old mode 100755 new mode 100644 index 3931bb0a..f31e2c61 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/pty.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/pty.pyi @@ -1,4 +1,3 @@ -# Stubs for pty (Python 2 and 3) import sys from typing import Callable, Iterable, Tuple, Union @@ -14,7 +13,9 @@ def openpty() -> Tuple[int, int]: ... def master_open() -> Tuple[int, str]: ... def slave_open(tty_name: str) -> int: ... def fork() -> Tuple[int, int]: ... + if sys.version_info >= (3, 4): def spawn(argv: Union[str, Iterable[str]], master_read: _Reader = ..., stdin_read: _Reader = ...) -> int: ... + else: def spawn(argv: Union[str, Iterable[str]], master_read: _Reader = ..., stdin_read: _Reader = ...) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/pwd.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/pwd.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/py_compile.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/py_compile.pyi old mode 100755 new mode 100644 index 4b57f0d3..7f6815b3 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/py_compile.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/py_compile.pyi @@ -1,8 +1,6 @@ -# Stubs for py_compile (Python 2 and 3) import enum import sys - -from typing import Optional, List, Text, AnyStr, Union, Type +from typing import AnyStr, List, Optional, Text, Type, Union _EitherStr = Union[bytes, Text] @@ -19,10 +17,36 @@ if sys.version_info >= (3, 7): CHECKED_HASH: int = ... UNCHECKED_HASH: int = ... def _get_default_invalidation_mode() -> PycInvalidationMode: ... - def compile(file: AnyStr, cfile: Optional[AnyStr] = ..., dfile: Optional[AnyStr] = ..., doraise: bool = ..., optimize: int = ..., invalidation_mode: Optional[PycInvalidationMode] = ...) -> Optional[AnyStr]: ... + +if sys.version_info >= (3, 8): + def compile( + file: AnyStr, + cfile: Optional[AnyStr] = ..., + dfile: Optional[AnyStr] = ..., + doraise: bool = ..., + optimize: int = ..., + invalidation_mode: Optional[PycInvalidationMode] = ..., + quiet: int = ..., + ) -> Optional[AnyStr]: ... + +elif sys.version_info >= (3, 7): + def compile( + file: AnyStr, + cfile: Optional[AnyStr] = ..., + dfile: Optional[AnyStr] = ..., + doraise: bool = ..., + optimize: int = ..., + invalidation_mode: Optional[PycInvalidationMode] = ..., + ) -> Optional[AnyStr]: ... + elif sys.version_info >= (3, 2): - def compile(file: AnyStr, cfile: Optional[AnyStr] = ..., dfile: Optional[AnyStr] = ..., doraise: bool = ..., optimize: int = ...) -> Optional[AnyStr]: ... + def compile( + file: AnyStr, cfile: Optional[AnyStr] = ..., dfile: Optional[AnyStr] = ..., doraise: bool = ..., optimize: int = ... + ) -> Optional[AnyStr]: ... + else: - def compile(file: _EitherStr, cfile: Optional[_EitherStr] = ..., dfile: Optional[_EitherStr] = ..., doraise: bool = ...) -> None: ... + def compile( + file: _EitherStr, cfile: Optional[_EitherStr] = ..., dfile: Optional[_EitherStr] = ..., doraise: bool = ... + ) -> None: ... def main(args: Optional[List[Text]] = ...) -> int: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/pyclbr.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/pyclbr.pyi old mode 100755 new mode 100644 index efecf329..665ea43c --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/pyclbr.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/pyclbr.pyi @@ -1,5 +1,5 @@ -from typing import List, Union, Sequence, Optional, Dict - +import sys +from typing import Dict, List, Optional, Sequence, Union class Class: module: str @@ -9,13 +9,18 @@ class Class: file: int lineno: int - def __init__(self, - module: str, - name: str, - super: Optional[List[Union[Class, str]]], - file: str, - lineno: int) -> None: ... - + if sys.version_info >= (3, 7): + def __init__( + self, + module: str, + name: str, + super: Optional[List[Union[Class, str]]], + file: str, + lineno: int, + parent: Optional[Class] = ..., + ) -> None: ... + else: + def __init__(self, module: str, name: str, super: Optional[List[Union[Class, str]]], file: str, lineno: int) -> None: ... class Function: module: str @@ -23,18 +28,10 @@ class Function: file: int lineno: int - def __init__(self, - module: str, - name: str, - file: str, - lineno: int) -> None: ... - - -def readmodule(module: str, - path: Optional[Sequence[str]] = ... - ) -> Dict[str, Class]: ... - + if sys.version_info >= (3, 7): + def __init__(self, module: str, name: str, file: str, lineno: int, parent: Optional[Function] = ...) -> None: ... + else: + def __init__(self, module: str, name: str, file: str, lineno: int) -> None: ... -def readmodule_ex(module: str, - path: Optional[Sequence[str]] = ... - ) -> Dict[str, Union[Class, Function, List[str]]]: ... +def readmodule(module: str, path: Optional[Sequence[str]] = ...) -> Dict[str, Class]: ... +def readmodule_ex(module: str, path: Optional[Sequence[str]] = ...) -> Dict[str, Union[Class, Function, List[str]]]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/pydoc.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/pydoc.pyi old mode 100755 new mode 100644 index 6a238505..39252dd9 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/pydoc.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/pydoc.pyi @@ -1,6 +1,24 @@ import sys -from typing import Any, AnyStr, Callable, Container, Dict, IO, List, Mapping, MutableMapping, NoReturn, Optional, Text, Tuple, Type, Union -from types import FunctionType, MethodType, ModuleType, TracebackType +from _typeshed import SupportsWrite +from types import MethodType, ModuleType, TracebackType +from typing import ( + IO, + Any, + AnyStr, + Callable, + Container, + Dict, + List, + Mapping, + MutableMapping, + NoReturn, + Optional, + Text, + Tuple, + Type, + Union, +) + if sys.version_info >= (3,): from reprlib import Repr else: @@ -25,7 +43,6 @@ def stripid(text: str) -> str: ... def allmethods(cl: type) -> MutableMapping[str, MethodType]: ... def visiblename(name: str, all: Optional[Container[str]] = ..., obj: Optional[object] = ...) -> bool: ... def classify_class_attrs(object: object) -> List[Tuple[str, str, type, str]]: ... - def ispackage(path: str) -> bool: ... def source_synopsis(file: IO[AnyStr]) -> Optional[AnyStr]: ... def synopsis(filename: str, cache: MutableMapping[str, Tuple[int, str]] = ...) -> Optional[str]: ... @@ -41,6 +58,7 @@ def importfile(path: str) -> ModuleType: ... def safeimport(path: str, forceload: bool = ..., cache: MutableMapping[str, ModuleType] = ...) -> ModuleType: ... class Doc: + PYTHONDOCS: str def document(self, object: object, name: Optional[str] = ..., *args: Any) -> str: ... def fail(self, object: object, name: Optional[str] = ..., *args: Any) -> NoReturn: ... def docmodule(self, object: object, name: Optional[str] = ..., *args: Any) -> str: ... @@ -49,7 +67,7 @@ class Doc: def docother(self, object: object, name: Optional[str] = ..., *args: Any) -> str: ... def docproperty(self, object: object, name: Optional[str] = ..., *args: Any) -> str: ... def docdata(self, object: object, name: Optional[str] = ..., *args: Any) -> str: ... - def getdocloc(self, object: object) -> Optional[str]: ... + def getdocloc(self, object: object, basedir: str = ...) -> Optional[str]: ... class HTMLRepr(Repr): maxlist: int @@ -67,29 +85,71 @@ class HTMLRepr(Repr): def repr_unicode(self, x: AnyStr, level: complex) -> str: ... class HTMLDoc(Doc): - def repr(self, object: object) -> str: ... - def escape(self, test: str) -> str: ... + repr: Callable[[object], str] + escape: Callable[[str], str] def page(self, title: str, contents: str) -> str: ... def heading(self, title: str, fgcol: str, bgcol: str, extras: str = ...) -> str: ... - def section(self, title: str, fgcol: str, bgcol: str, contents: str, width: int = ..., prelude: str = ..., marginalia: Optional[str] = ..., gap: str = ...) -> str: ... - def bigsection(self, title: str, *args) -> str: ... + def section( + self, + title: str, + fgcol: str, + bgcol: str, + contents: str, + width: int = ..., + prelude: str = ..., + marginalia: Optional[str] = ..., + gap: str = ..., + ) -> str: ... + def bigsection(self, title: str, *args: Any) -> str: ... def preformat(self, text: str) -> str: ... def multicolumn(self, list: List[Any], format: Callable[[Any], str], cols: int = ...) -> str: ... def grey(self, text: str) -> str: ... def namelink(self, name: str, *dicts: MutableMapping[str, str]) -> str: ... def classlink(self, object: object, modname: str) -> str: ... def modulelink(self, object: object) -> str: ... - def modpkglink(self, data: Tuple[str, str, bool, bool]) -> str: ... - def markup(self, text: str, escape: Optional[Callable[[str], str]] = ..., funcs: Mapping[str, str] = ..., classes: Mapping[str, str] = ..., methods: Mapping[str, str] = ...) -> str: ... - def formattree(self, tree: List[Union[Tuple[type, Tuple[type, ...]], List[Any]]], modname: str, parent: Optional[type] = ...) -> str: ... - def docmodule(self, object: object, name: Optional[str] = ..., mod: Optional[str] = ..., *ignored) -> str: ... - def docclass(self, object: object, name: Optional[str] = ..., mod: Optional[str] = ..., funcs: Mapping[str, str] = ..., classes: Mapping[str, str] = ..., *ignored) -> str: ... + def modpkglink(self, modpkginfo: Tuple[str, str, bool, bool]) -> str: ... + def markup( + self, + text: str, + escape: Optional[Callable[[str], str]] = ..., + funcs: Mapping[str, str] = ..., + classes: Mapping[str, str] = ..., + methods: Mapping[str, str] = ..., + ) -> str: ... + def formattree( + self, tree: List[Union[Tuple[type, Tuple[type, ...]], List[Any]]], modname: str, parent: Optional[type] = ... + ) -> str: ... + def docmodule(self, object: object, name: Optional[str] = ..., mod: Optional[str] = ..., *ignored: Any) -> str: ... + def docclass( + self, + object: object, + name: Optional[str] = ..., + mod: Optional[str] = ..., + funcs: Mapping[str, str] = ..., + classes: Mapping[str, str] = ..., + *ignored: Any, + ) -> str: ... def formatvalue(self, object: object) -> str: ... - def docroutine(self, object: object, name: Optional[str] = ..., mod: Optional[str] = ..., funcs: Mapping[str, str] = ..., classes: Mapping[str, str] = ..., methods: Mapping[str, str] = ..., cl: Optional[type] = ..., *ignored) -> str: ... - def docproperty(self, object: object, name: Optional[str] = ..., mod: Optional[str] = ..., cl: Optional[Any] = ..., *ignored) -> str: ... - def docother(self, object: object, name: Optional[str] = ..., mod: Optional[Any] = ..., *ignored) -> str: ... - def docdata(self, object: object, name: Optional[str] = ..., mod: Optional[Any] = ..., cl: Optional[Any] = ..., *ignored) -> str: ... + def docroutine( + self, + object: object, + name: Optional[str] = ..., + mod: Optional[str] = ..., + funcs: Mapping[str, str] = ..., + classes: Mapping[str, str] = ..., + methods: Mapping[str, str] = ..., + cl: Optional[type] = ..., + *ignored: Any, + ) -> str: ... + def docproperty( + self, object: object, name: Optional[str] = ..., mod: Optional[str] = ..., cl: Optional[Any] = ..., *ignored: Any + ) -> str: ... + def docother(self, object: object, name: Optional[str] = ..., mod: Optional[Any] = ..., *ignored: Any) -> str: ... + def docdata( + self, object: object, name: Optional[str] = ..., mod: Optional[Any] = ..., cl: Optional[Any] = ..., *ignored: Any + ) -> str: ... def index(self, dir: str, shadowed: Optional[MutableMapping[str, bool]] = ...) -> str: ... + def filelink(self, url: str, path: str) -> str: ... class TextRepr(Repr): maxlist: int @@ -104,18 +164,39 @@ class TextRepr(Repr): def repr_instance(self, x: object, level: complex) -> str: ... class TextDoc(Doc): - def repr(self, object: object) -> str: ... + repr: Callable[[object], str] def bold(self, text: str) -> str: ... def indent(self, text: str, prefix: str = ...) -> str: ... def section(self, title: str, contents: str) -> str: ... - def formattree(self, tree: List[Union[Tuple[type, Tuple[type, ...]], List[Any]]], modname: str, parent: Optional[type] = ..., prefix: str = ...) -> str: ... - def docmodule(self, object: object, name: Optional[str] = ..., mod: Optional[Any] = ..., *ignored) -> str: ... - def docclass(self, object: object, name: Optional[str] = ..., mod: Optional[str] = ..., *ignored) -> str: ... + def formattree( + self, + tree: List[Union[Tuple[type, Tuple[type, ...]], List[Any]]], + modname: str, + parent: Optional[type] = ..., + prefix: str = ..., + ) -> str: ... + def docmodule(self, object: object, name: Optional[str] = ..., mod: Optional[Any] = ..., *ignored: Any) -> str: ... + def docclass(self, object: object, name: Optional[str] = ..., mod: Optional[str] = ..., *ignored: Any) -> str: ... def formatvalue(self, object: object) -> str: ... - def docroutine(self, object: object, name: Optional[str] = ..., mod: Optional[str] = ..., cl: Optional[Any] = ..., *ignored) -> str: ... - def docproperty(self, object: object, name: Optional[str] = ..., mod: Optional[Any] = ..., cl: Optional[Any] = ..., *ignored) -> str: ... - def docdata(self, object: object, name: Optional[str] = ..., mod: Optional[str] = ..., cl: Optional[Any] = ..., *ignored) -> str: ... - def docother(self, object: object, name: Optional[str] = ..., mod: Optional[str] = ..., parent: Optional[str] = ..., maxlen: Optional[int] = ..., doc: Optional[Any] = ..., *ignored) -> str: ... + def docroutine( + self, object: object, name: Optional[str] = ..., mod: Optional[str] = ..., cl: Optional[Any] = ..., *ignored: Any + ) -> str: ... + def docproperty( + self, object: object, name: Optional[str] = ..., mod: Optional[Any] = ..., cl: Optional[Any] = ..., *ignored: Any + ) -> str: ... + def docdata( + self, object: object, name: Optional[str] = ..., mod: Optional[str] = ..., cl: Optional[Any] = ..., *ignored: Any + ) -> str: ... + def docother( + self, + object: object, + name: Optional[str] = ..., + mod: Optional[str] = ..., + parent: Optional[str] = ..., + maxlen: Optional[int] = ..., + doc: Optional[Any] = ..., + *ignored: Any, + ) -> str: ... def pager(text: str) -> None: ... def getpager() -> Callable[[str], None]: ... @@ -133,8 +214,10 @@ html: HTMLDoc class _OldStyleClass: ... def resolve(thing: Union[str, object], forceload: bool = ...) -> Optional[Tuple[object, str]]: ... -def render_doc(thing: Union[str, object], title: str = ..., forceload: bool = ...) -> str: ... -def doc(thing: Union[str, object], title: str = ..., forceload: bool = ...) -> None: ... +def render_doc(thing: Union[str, object], title: str = ..., forceload: bool = ..., renderer: Optional[Doc] = ...) -> str: ... +def doc( + thing: Union[str, object], title: str = ..., forceload: bool = ..., output: Optional[SupportsWrite[str]] = ... +) -> None: ... def writedoc(thing: Union[str, object], forceload: bool = ...) -> None: ... def writedocs(dir: str, pkgpath: str = ..., done: Optional[Any] = ...) -> None: ... @@ -171,10 +254,20 @@ help: Helper class ModuleScanner: quit: bool - def run(self, callback: Callable[[Optional[str], str, str], None], key: Optional[Any] = ..., completer: Optional[Callable[[], None]] = ..., onerror: Optional[Callable[[str], None]] = ...) -> None: ... + def run( + self, + callback: Callable[[Optional[str], str, str], None], + key: Optional[Any] = ..., + completer: Optional[Callable[[], None]] = ..., + onerror: Optional[Callable[[str], None]] = ..., + ) -> None: ... def apropos(key: str) -> None: ... -def serve(port: int, callback: Optional[Callable[[Any], None]] = ..., completer: Optional[Callable[[], None]] = ...) -> None: ... -def gui() -> None: ... def ispath(x: Any) -> bool: ... def cli() -> None: ... + +if sys.version_info < (3,): + def serve( + port: int, callback: Optional[Callable[[Any], None]] = ..., completer: Optional[Callable[[], None]] = ... + ) -> None: ... + def gui() -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/pydoc_data/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/pydoc_data/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/pydoc_data/topics.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/pydoc_data/topics.pyi new file mode 100644 index 00000000..1c48f402 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/pydoc_data/topics.pyi @@ -0,0 +1,3 @@ +from typing import Dict + +topics: Dict[str, str] diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/pyexpat/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/pyexpat/__init__.pyi old mode 100755 new mode 100644 index 670e5610..c8305567 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/pyexpat/__init__.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/pyexpat/__init__.pyi @@ -1,7 +1,7 @@ -from typing import List, Tuple, Optional, Callable, Any, Protocol, Union, Dict, Text - import pyexpat.errors as errors import pyexpat.model as model +from _typeshed import SupportsRead +from typing import Any, Callable, Dict, List, Optional, Text, Tuple, Union EXPAT_VERSION: str # undocumented version_info: Tuple[int, int, int] # undocumented @@ -15,9 +15,6 @@ class ExpatError(Exception): error = ExpatError -class _Reader(Protocol): - def read(self, length: int) -> bytes: ... - XML_PARAM_ENTITY_PARSING_NEVER: int XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE: int XML_PARAM_ENTITY_PARSING_ALWAYS: int @@ -25,14 +22,14 @@ XML_PARAM_ENTITY_PARSING_ALWAYS: int _Model = Tuple[int, int, Optional[str], tuple] class XMLParserType(object): - def Parse(self, data: Union[Text, bytes], isfinal: bool = ...) -> int: ... - def ParseFile(self, file: _Reader) -> int: ... - def SetBase(self, base: Text) -> None: ... + def Parse(self, __data: Union[Text, bytes], __isfinal: bool = ...) -> int: ... + def ParseFile(self, __file: SupportsRead[bytes]) -> int: ... + def SetBase(self, __base: Text) -> None: ... def GetBase(self) -> Optional[str]: ... def GetInputContext(self) -> Optional[bytes]: ... - def ExternalEntityParserCreate(self, context: Optional[Text], encoding: Text = ...) -> XMLParserType: ... - def SetParamEntityParsing(self, flag: int) -> int: ... - def UseForeignDTD(self, flag: bool = ...) -> None: ... + def ExternalEntityParserCreate(self, __context: Optional[Text], __encoding: Text = ...) -> XMLParserType: ... + def SetParamEntityParsing(self, __flag: int) -> int: ... + def UseForeignDTD(self, __flag: bool = ...) -> None: ... buffer_size: int buffer_text: bool buffer_used: int @@ -51,10 +48,13 @@ class XMLParserType(object): EndDoctypeDeclHandler: Optional[Callable[[], Any]] ElementDeclHandler: Optional[Callable[[str, _Model], Any]] AttlistDeclHandler: Optional[Callable[[str, str, str, Optional[str], bool], Any]] - StartElementHandler: Optional[Union[ - Callable[[str, Dict[str, str]], Any], - Callable[[str, List[str]], Any], - Callable[[str, Union[Dict[str, str]], List[str]], Any]]] + StartElementHandler: Optional[ + Union[ + Callable[[str, Dict[str, str]], Any], + Callable[[str, List[str]], Any], + Callable[[str, Union[Dict[str, str]], List[str]], Any], + ] + ] EndElementHandler: Optional[Callable[[str], Any]] ProcessingInstructionHandler: Optional[Callable[[str, str], Any]] CharacterDataHandler: Optional[Callable[[str], Any]] @@ -71,5 +71,9 @@ class XMLParserType(object): NotStandaloneHandler: Optional[Callable[[], int]] ExternalEntityRefHandler: Optional[Callable[[str, Optional[str], Optional[str], Optional[str]], int]] -def ErrorString(errno: int) -> str: ... -def ParserCreate(encoding: Optional[Text] = ..., namespace_separator: Optional[Text] = ...) -> XMLParserType: ... +def ErrorString(__code: int) -> str: ... + +# intern is undocumented +def ParserCreate( + encoding: Optional[Text] = ..., namespace_separator: Optional[Text] = ..., intern: Optional[Dict[str, Any]] = ... +) -> XMLParserType: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/pyexpat/errors.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/pyexpat/errors.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/pyexpat/model.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/pyexpat/model.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/quopri.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/quopri.pyi old mode 100755 new mode 100644 index 2823f8c4..c2ffabe7 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/quopri.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/quopri.pyi @@ -1,5 +1,3 @@ -# Stubs for quopri (Python 2 and 3) - from typing import BinaryIO def encode(input: BinaryIO, output: BinaryIO, quotetabs: int, header: int = ...) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/readline.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/readline.pyi old mode 100755 new mode 100644 index aff2debf..9b8e05f0 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/readline.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/readline.pyi @@ -1,26 +1,22 @@ -# Stubs for readline - -from typing import Callable, Optional, Sequence import sys +from typing import Callable, Optional, Sequence _CompleterT = Optional[Callable[[str, int], Optional[str]]] _CompDispT = Optional[Callable[[str, Sequence[str], int], None]] - def parse_and_bind(string: str) -> None: ... def read_init_file(filename: str = ...) -> None: ... - def get_line_buffer() -> str: ... def insert_text(string: str) -> None: ... def redisplay() -> None: ... - def read_history_file(filename: str = ...) -> None: ... def write_history_file(filename: str = ...) -> None: ... + if sys.version_info >= (3, 5): def append_history_file(nelements: int, filename: str = ...) -> None: ... + def get_history_length() -> int: ... def set_history_length(length: int) -> None: ... - def clear_history() -> None: ... def get_current_history_length() -> int: ... def get_history_item(index: int) -> str: ... @@ -28,9 +24,11 @@ def remove_history_item(pos: int) -> None: ... def replace_history_item(pos: int, line: str) -> None: ... def add_history(string: str) -> None: ... +if sys.version_info >= (3, 6): + def set_auto_history(enabled: bool) -> None: ... + def set_startup_hook(function: Optional[Callable[[], None]] = ...) -> None: ... def set_pre_input_hook(function: Optional[Callable[[], None]] = ...) -> None: ... - def set_completer(function: _CompleterT = ...) -> None: ... def get_completer() -> _CompleterT: ... def get_completion_type() -> int: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/rlcompleter.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/rlcompleter.pyi old mode 100755 new mode 100644 index 3db9d0c4..3733cc13 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/rlcompleter.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/rlcompleter.pyi @@ -1,14 +1,11 @@ -# Stubs for rlcompleter - -from typing import Any, Dict, Optional, Union import sys +from typing import Any, Dict, Optional, Union if sys.version_info >= (3,): _Text = str else: _Text = Union[str, unicode] - class Completer: def __init__(self, namespace: Optional[Dict[str, Any]] = ...) -> None: ... def complete(self, text: _Text, state: int) -> Optional[str]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/sched.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/sched.pyi old mode 100755 new mode 100644 index 6a820c83..21d81e16 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/sched.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/sched.pyi @@ -11,15 +11,28 @@ class Event(NamedTuple): class scheduler: if sys.version_info >= (3, 3): def __init__(self, timefunc: Callable[[], float] = ..., delayfunc: Callable[[float], None] = ...) -> None: ... - def enterabs(self, time: float, priority: Any, action: Callable[..., Any], argument: Tuple[Any, ...] = ..., kwargs: Dict[str, Any] = ...) -> Event: ... - def enter(self, delay: float, priority: Any, action: Callable[..., Any], argument: Tuple[Any, ...] = ..., kwargs: Dict[str, Any] = ...) -> Event: ... + def enterabs( + self, + time: float, + priority: Any, + action: Callable[..., Any], + argument: Tuple[Any, ...] = ..., + kwargs: Dict[str, Any] = ..., + ) -> Event: ... + def enter( + self, + delay: float, + priority: Any, + action: Callable[..., Any], + argument: Tuple[Any, ...] = ..., + kwargs: Dict[str, Any] = ..., + ) -> Event: ... def run(self, blocking: bool = ...) -> Optional[float]: ... else: def __init__(self, timefunc: Callable[[], float], delayfunc: Callable[[float], None]) -> None: ... def enterabs(self, time: float, priority: Any, action: Callable[..., Any], argument: Tuple[Any, ...]) -> Event: ... def enter(self, delay: float, priority: Any, action: Callable[..., Any], argument: Tuple[Any, ...]) -> Event: ... def run(self) -> None: ... - def cancel(self, event: Event) -> None: ... def empty(self) -> bool: ... @property diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/select.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/select.pyi old mode 100755 new mode 100644 index 6387f52c..e0cf3bdd --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/select.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/select.pyi @@ -1,138 +1,152 @@ import sys -from typing import Any, Iterable, List, Optional, Protocol, Tuple, Union +from _typeshed import FileDescriptorLike +from types import TracebackType +from typing import Any, Iterable, List, Optional, Tuple, Type -class _HasFileno(Protocol): - def fileno(self) -> int: ... - -_FileDescriptor = Union[int, _HasFileno] - -EPOLLERR: int -EPOLLET: int -EPOLLHUP: int -EPOLLIN: int -EPOLLMSG: int -EPOLLONESHOT: int -EPOLLOUT: int -EPOLLPRI: int -EPOLLRDBAND: int -EPOLLRDNORM: int -EPOLLWRBAND: int -EPOLLWRNORM: int -EPOLL_RDHUP: int -KQ_EV_ADD: int -KQ_EV_CLEAR: int -KQ_EV_DELETE: int -KQ_EV_DISABLE: int -KQ_EV_ENABLE: int -KQ_EV_EOF: int -KQ_EV_ERROR: int -KQ_EV_FLAG1: int -KQ_EV_ONESHOT: int -KQ_EV_SYSFLAGS: int -KQ_FILTER_AIO: int -KQ_FILTER_NETDEV: int -KQ_FILTER_PROC: int -KQ_FILTER_READ: int -KQ_FILTER_SIGNAL: int -KQ_FILTER_TIMER: int -KQ_FILTER_VNODE: int -KQ_FILTER_WRITE: int -KQ_NOTE_ATTRIB: int -KQ_NOTE_CHILD: int -KQ_NOTE_DELETE: int -KQ_NOTE_EXEC: int -KQ_NOTE_EXIT: int -KQ_NOTE_EXTEND: int -KQ_NOTE_FORK: int -KQ_NOTE_LINK: int -KQ_NOTE_LINKDOWN: int -KQ_NOTE_LINKINV: int -KQ_NOTE_LINKUP: int -KQ_NOTE_LOWAT: int -KQ_NOTE_PCTRLMASK: int -KQ_NOTE_PDATAMASK: int -KQ_NOTE_RENAME: int -KQ_NOTE_REVOKE: int -KQ_NOTE_TRACK: int -KQ_NOTE_TRACKERR: int -KQ_NOTE_WRITE: int -PIPE_BUF: int -POLLERR: int -POLLHUP: int -POLLIN: int -POLLMSG: int -POLLNVAL: int -POLLOUT: int -POLLPRI: int -POLLRDBAND: int -POLLRDNORM: int -POLLWRBAND: int -POLLWRNORM: int +if sys.platform != "win32": + PIPE_BUF: int + POLLERR: int + POLLHUP: int + POLLIN: int + POLLMSG: int + POLLNVAL: int + POLLOUT: int + POLLPRI: int + POLLRDBAND: int + POLLRDNORM: int + POLLWRBAND: int + POLLWRNORM: int class poll: def __init__(self) -> None: ... - def register(self, fd: _FileDescriptor, eventmask: int = ...) -> None: ... - def modify(self, fd: _FileDescriptor, eventmask: int) -> None: ... - def unregister(self, fd: _FileDescriptor) -> None: ... + def register(self, fd: FileDescriptorLike, eventmask: int = ...) -> None: ... + def modify(self, fd: FileDescriptorLike, eventmask: int) -> None: ... + def unregister(self, fd: FileDescriptorLike) -> None: ... def poll(self, timeout: Optional[float] = ...) -> List[Tuple[int, int]]: ... -def select(rlist: Iterable[Any], wlist: Iterable[Any], xlist: Iterable[Any], - timeout: Optional[float] = ...) -> Tuple[List[Any], - List[Any], - List[Any]]: ... +def select( + __rlist: Iterable[Any], __wlist: Iterable[Any], __xlist: Iterable[Any], __timeout: Optional[float] = ... +) -> Tuple[List[Any], List[Any], List[Any]]: ... if sys.version_info >= (3, 3): error = OSError else: class error(Exception): ... -# BSD only -class kevent(object): - data: Any - fflags: int - filter: int - flags: int - ident: int - udata: Any - def __init__(self, ident: _FileDescriptor, filter: int = ..., flags: int = ..., fflags: int = ..., data: Any = ..., udata: Any = ...) -> None: ... +if sys.platform != "linux" and sys.platform != "win32": + # BSD only + class kevent(object): + data: Any + fflags: int + filter: int + flags: int + ident: int + udata: Any + def __init__( + self, + ident: FileDescriptorLike, + filter: int = ..., + flags: int = ..., + fflags: int = ..., + data: Any = ..., + udata: Any = ..., + ) -> None: ... + # BSD only + class kqueue(object): + closed: bool + def __init__(self) -> None: ... + def close(self) -> None: ... + def control( + self, __changelist: Optional[Iterable[kevent]], __maxevents: int, __timeout: Optional[float] = ... + ) -> List[kevent]: ... + def fileno(self) -> int: ... + @classmethod + def fromfd(cls, __fd: FileDescriptorLike) -> kqueue: ... + KQ_EV_ADD: int + KQ_EV_CLEAR: int + KQ_EV_DELETE: int + KQ_EV_DISABLE: int + KQ_EV_ENABLE: int + KQ_EV_EOF: int + KQ_EV_ERROR: int + KQ_EV_FLAG1: int + KQ_EV_ONESHOT: int + KQ_EV_SYSFLAGS: int + KQ_FILTER_AIO: int + KQ_FILTER_NETDEV: int + KQ_FILTER_PROC: int + KQ_FILTER_READ: int + KQ_FILTER_SIGNAL: int + KQ_FILTER_TIMER: int + KQ_FILTER_VNODE: int + KQ_FILTER_WRITE: int + KQ_NOTE_ATTRIB: int + KQ_NOTE_CHILD: int + KQ_NOTE_DELETE: int + KQ_NOTE_EXEC: int + KQ_NOTE_EXIT: int + KQ_NOTE_EXTEND: int + KQ_NOTE_FORK: int + KQ_NOTE_LINK: int + if sys.platform != "darwin": + KQ_NOTE_LINKDOWN: int + KQ_NOTE_LINKINV: int + KQ_NOTE_LINKUP: int + KQ_NOTE_LOWAT: int + KQ_NOTE_PCTRLMASK: int + KQ_NOTE_PDATAMASK: int + KQ_NOTE_RENAME: int + KQ_NOTE_REVOKE: int + KQ_NOTE_TRACK: int + KQ_NOTE_TRACKERR: int + KQ_NOTE_WRITE: int -# BSD only -class kqueue(object): - closed: bool - def __init__(self) -> None: ... - def close(self) -> None: ... - def control(self, changelist: Optional[Iterable[kevent]], max_events: int, timeout: float = ...) -> List[kevent]: ... - def fileno(self) -> int: ... - @classmethod - def fromfd(cls, fd: _FileDescriptor) -> kqueue: ... +if sys.platform == "linux": + class epoll(object): + if sys.version_info >= (3, 3): + def __init__(self, sizehint: int = ..., flags: int = ...) -> None: ... + else: + def __init__(self, sizehint: int = ...) -> None: ... + if sys.version_info >= (3, 4): + def __enter__(self) -> epoll: ... + def __exit__( + self, + exc_type: Optional[Type[BaseException]] = ..., + exc_val: Optional[BaseException] = ..., + exc_tb: Optional[TracebackType] = ..., + ) -> None: ... + def close(self) -> None: ... + closed: bool + def fileno(self) -> int: ... + def register(self, fd: FileDescriptorLike, eventmask: int = ...) -> None: ... + def modify(self, fd: FileDescriptorLike, eventmask: int) -> None: ... + def unregister(self, fd: FileDescriptorLike) -> None: ... + def poll(self, timeout: Optional[float] = ..., maxevents: int = ...) -> List[Tuple[int, int]]: ... + @classmethod + def fromfd(cls, __fd: FileDescriptorLike) -> epoll: ... + EPOLLERR: int + EPOLLET: int + EPOLLHUP: int + EPOLLIN: int + EPOLLMSG: int + EPOLLONESHOT: int + EPOLLOUT: int + EPOLLPRI: int + EPOLLRDBAND: int + EPOLLRDNORM: int + EPOLLWRBAND: int + EPOLLWRNORM: int + EPOLL_RDHUP: int -# Linux only -class epoll(object): +if sys.platform != "linux" and sys.platform != "darwin" and sys.platform != "win32": if sys.version_info >= (3, 3): - def __init__(self, sizehint: int = ..., flags: int = ...) -> None: ... - else: - def __init__(self, sizehint: int = ...) -> None: ... - if sys.version_info >= (3, 4): - def __enter__(self) -> epoll: ... - def __exit__(self, *args: Any) -> None: ... - def close(self) -> None: ... - closed: bool - def fileno(self) -> int: ... - def register(self, fd: _FileDescriptor, eventmask: int = ...) -> None: ... - def modify(self, fd: _FileDescriptor, eventmask: int) -> None: ... - def unregister(self, fd: _FileDescriptor) -> None: ... - def poll(self, timeout: float = ..., maxevents: int = ...) -> List[Tuple[int, int]]: ... - @classmethod - def fromfd(cls, fd: _FileDescriptor) -> epoll: ... - -if sys.version_info >= (3, 3): - # Solaris only - class devpoll: - if sys.version_info >= (3, 4): - def close(self) -> None: ... - closed: bool - def fileno(self) -> int: ... - def register(self, fd: _FileDescriptor, eventmask: int = ...) -> None: ... - def modify(self, fd: _FileDescriptor, eventmask: int = ...) -> None: ... - def unregister(self, fd: _FileDescriptor) -> None: ... - def poll(self, timeout: Optional[float] = ...) -> List[Tuple[int, int]]: ... + # Solaris only + class devpoll: + if sys.version_info >= (3, 4): + def close(self) -> None: ... + closed: bool + def fileno(self) -> int: ... + def register(self, fd: FileDescriptorLike, eventmask: int = ...) -> None: ... + def modify(self, fd: FileDescriptorLike, eventmask: int = ...) -> None: ... + def unregister(self, fd: FileDescriptorLike) -> None: ... + def poll(self, timeout: Optional[float] = ...) -> List[Tuple[int, int]]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/shutil.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/shutil.pyi old mode 100755 new mode 100644 index b4c6cc12..b814112a --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/shutil.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/shutil.pyi @@ -1,29 +1,34 @@ import os import sys - -# 'bytes' paths are not properly supported: they don't work with all functions, -# sometimes they only work partially (broken exception messages), and the test -# cases don't use them. - +from _typeshed import StrPath, SupportsRead, SupportsWrite from typing import ( - List, Iterable, Callable, Any, Tuple, Sequence, NamedTuple, IO, - AnyStr, Optional, Union, Set, TypeVar, overload, Type, Protocol, Text + Any, + AnyStr, + Callable, + Iterable, + List, + NamedTuple, + Optional, + Sequence, + Set, + Tuple, + Type, + TypeVar, + Union, + overload, ) if sys.version_info >= (3, 6): - _Path = Union[str, os.PathLike[str]] _AnyStr = str _AnyPath = TypeVar("_AnyPath", str, os.PathLike[str]) # Return value of some functions that may either return a path-like object that was passed in or # a string _PathReturn = Any elif sys.version_info >= (3,): - _Path = str _AnyStr = str _AnyPath = str _PathReturn = str else: - _Path = Text _AnyStr = TypeVar("_AnyStr", str, unicode) _AnyPath = TypeVar("_AnyPath", str, unicode) _PathReturn = Type[None] @@ -35,114 +40,127 @@ if sys.version_info >= (3,): class ExecError(OSError): ... class ReadError(OSError): ... class RegistryError(Exception): ... + else: class Error(EnvironmentError): ... class SpecialFileError(EnvironmentError): ... class ExecError(EnvironmentError): ... -_S_co = TypeVar("_S_co", covariant=True) -_S_contra = TypeVar("_S_contra", contravariant=True) - -class _Reader(Protocol[_S_co]): - def read(self, length: int) -> _S_co: ... - -class _Writer(Protocol[_S_contra]): - def write(self, data: _S_contra) -> Any: ... - -def copyfileobj(fsrc: _Reader[AnyStr], fdst: _Writer[AnyStr], - length: int = ...) -> None: ... +def copyfileobj(fsrc: SupportsRead[AnyStr], fdst: SupportsWrite[AnyStr], length: int = ...) -> None: ... if sys.version_info >= (3,): - def copyfile(src: _Path, dst: _AnyPath, *, - follow_symlinks: bool = ...) -> _AnyPath: ... - def copymode(src: _Path, dst: _Path, *, - follow_symlinks: bool = ...) -> None: ... - def copystat(src: _Path, dst: _Path, *, - follow_symlinks: bool = ...) -> None: ... - def copy(src: _Path, dst: _Path, *, - follow_symlinks: bool = ...) -> _PathReturn: ... - def copy2(src: _Path, dst: _Path, *, - follow_symlinks: bool = ...) -> _PathReturn: ... + def copyfile(src: StrPath, dst: _AnyPath, *, follow_symlinks: bool = ...) -> _AnyPath: ... + def copymode(src: StrPath, dst: StrPath, *, follow_symlinks: bool = ...) -> None: ... + def copystat(src: StrPath, dst: StrPath, *, follow_symlinks: bool = ...) -> None: ... + def copy(src: StrPath, dst: StrPath, *, follow_symlinks: bool = ...) -> _PathReturn: ... + def copy2(src: StrPath, dst: StrPath, *, follow_symlinks: bool = ...) -> _PathReturn: ... + else: - def copyfile(src: _Path, dst: _Path) -> None: ... - def copymode(src: _Path, dst: _Path) -> None: ... - def copystat(src: _Path, dst: _Path) -> None: ... - def copy(src: _Path, dst: _Path) -> _PathReturn: ... - def copy2(src: _Path, dst: _Path) -> _PathReturn: ... + def copyfile(src: StrPath, dst: StrPath) -> None: ... + def copymode(src: StrPath, dst: StrPath) -> None: ... + def copystat(src: StrPath, dst: StrPath) -> None: ... + def copy(src: StrPath, dst: StrPath) -> _PathReturn: ... + def copy2(src: StrPath, dst: StrPath) -> _PathReturn: ... -def ignore_patterns(*patterns: _Path) -> Callable[[Any, List[_AnyStr]], Set[_AnyStr]]: ... +def ignore_patterns(*patterns: StrPath) -> Callable[[Any, List[_AnyStr]], Set[_AnyStr]]: ... if sys.version_info >= (3, 8): def copytree( - src: _Path, - dst: _Path, + src: StrPath, + dst: StrPath, symlinks: bool = ..., - ignore: Union[None, Callable[[str, List[str]], Iterable[str]], Callable[[_Path, List[str]], Iterable[str]]] = ..., + ignore: Union[None, Callable[[str, List[str]], Iterable[str]], Callable[[StrPath, List[str]], Iterable[str]]] = ..., copy_function: Callable[[str, str], None] = ..., ignore_dangling_symlinks: bool = ..., dirs_exist_ok: bool = ..., ) -> _PathReturn: ... + elif sys.version_info >= (3,): - def copytree(src: _Path, dst: _Path, symlinks: bool = ..., - ignore: Union[None, - Callable[[str, List[str]], Iterable[str]], - Callable[[_Path, List[str]], Iterable[str]]] = ..., - copy_function: Callable[[str, str], None] = ..., - ignore_dangling_symlinks: bool = ...) -> _PathReturn: ... + def copytree( + src: StrPath, + dst: StrPath, + symlinks: bool = ..., + ignore: Union[None, Callable[[str, List[str]], Iterable[str]], Callable[[StrPath, List[str]], Iterable[str]]] = ..., + copy_function: Callable[[str, str], None] = ..., + ignore_dangling_symlinks: bool = ..., + ) -> _PathReturn: ... + else: - def copytree(src: AnyStr, dst: AnyStr, symlinks: bool = ..., - ignore: Union[None, - Callable[[AnyStr, List[AnyStr]], - Iterable[AnyStr]]] = ...) -> _PathReturn: ... + def copytree( + src: AnyStr, + dst: AnyStr, + symlinks: bool = ..., + ignore: Union[None, Callable[[AnyStr, List[AnyStr]], Iterable[AnyStr]]] = ..., + ) -> _PathReturn: ... if sys.version_info >= (3,): - @overload - def rmtree(path: bytes, ignore_errors: bool = ..., - onerror: Optional[Callable[[Any, str, Any], Any]] = ...) -> None: ... - @overload - def rmtree(path: _AnyPath, ignore_errors: bool = ..., - onerror: Optional[Callable[[Any, _AnyPath, Any], Any]] = ...) -> None: ... + def rmtree( + path: Union[bytes, StrPath], ignore_errors: bool = ..., onerror: Optional[Callable[[Any, Any, Any], Any]] = ... + ) -> None: ... + else: - def rmtree(path: _AnyPath, ignore_errors: bool = ..., - onerror: Optional[Callable[[Any, _AnyPath, Any], Any]] = ...) -> None: ... + def rmtree( + path: _AnyPath, ignore_errors: bool = ..., onerror: Optional[Callable[[Any, _AnyPath, Any], Any]] = ... + ) -> None: ... + +_CopyFn = Union[Callable[[str, str], None], Callable[[StrPath, StrPath], None]] + +if sys.version_info >= (3, 9): + def move(src: StrPath, dst: StrPath, copy_function: _CopyFn = ...) -> _PathReturn: ... + +elif sys.version_info >= (3, 5): + # See https://bugs.python.org/issue32689 + def move(src: str, dst: StrPath, copy_function: _CopyFn = ...) -> _PathReturn: ... -if sys.version_info >= (3, 5): - _CopyFn = Union[Callable[[str, str], None], Callable[[_Path, _Path], None]] - def move(src: _Path, dst: _Path, - copy_function: _CopyFn = ...) -> _PathReturn: ... else: - def move(src: _Path, dst: _Path) -> _PathReturn: ... + def move(src: StrPath, dst: StrPath) -> _PathReturn: ... if sys.version_info >= (3,): class _ntuple_diskusage(NamedTuple): total: int used: int free: int - def disk_usage(path: _Path) -> _ntuple_diskusage: ... - def chown(path: _Path, user: Optional[str] = ..., - group: Optional[str] = ...) -> None: ... - def which(cmd: _Path, mode: int = ..., - path: Optional[_Path] = ...) -> Optional[str]: ... - -def make_archive(base_name: _AnyStr, format: str, root_dir: Optional[_Path] = ..., - base_dir: Optional[_Path] = ..., verbose: bool = ..., - dry_run: bool = ..., owner: Optional[str] = ..., group: Optional[str] = ..., - logger: Optional[Any] = ...) -> _AnyStr: ... -def get_archive_formats() -> List[Tuple[str, str]]: ... + def disk_usage(path: StrPath) -> _ntuple_diskusage: ... + def chown(path: StrPath, user: Optional[Union[str, int]] = ..., group: Optional[Union[str, int]] = ...) -> None: ... -def register_archive_format(name: str, function: Callable[..., Any], - extra_args: Optional[Sequence[Union[Tuple[str, Any], List[Any]]]] = ..., - description: str = ...) -> None: ... +if sys.version_info >= (3, 8): + @overload + def which(cmd: StrPath, mode: int = ..., path: Optional[StrPath] = ...) -> Optional[str]: ... + @overload + def which(cmd: bytes, mode: int = ..., path: Optional[StrPath] = ...) -> Optional[bytes]: ... + +elif sys.version_info >= (3,): + def which(cmd: StrPath, mode: int = ..., path: Optional[StrPath] = ...) -> Optional[str]: ... + +def make_archive( + base_name: _AnyStr, + format: str, + root_dir: Optional[StrPath] = ..., + base_dir: Optional[StrPath] = ..., + verbose: bool = ..., + dry_run: bool = ..., + owner: Optional[str] = ..., + group: Optional[str] = ..., + logger: Optional[Any] = ..., +) -> _AnyStr: ... +def get_archive_formats() -> List[Tuple[str, str]]: ... +def register_archive_format( + name: str, + function: Callable[..., Any], + extra_args: Optional[Sequence[Union[Tuple[str, Any], List[Any]]]] = ..., + description: str = ..., +) -> None: ... def unregister_archive_format(name: str) -> None: ... if sys.version_info >= (3,): - # Should be _Path once http://bugs.python.org/issue30218 is fixed - def unpack_archive(filename: str, extract_dir: Optional[_Path] = ..., - format: Optional[str] = ...) -> None: ... - def register_unpack_format(name: str, extensions: List[str], function: Any, - extra_args: Sequence[Tuple[str, Any]] = ..., - description: str = ...) -> None: ... + if sys.version_info >= (3, 7): + def unpack_archive(filename: StrPath, extract_dir: Optional[StrPath] = ..., format: Optional[str] = ...) -> None: ... + else: + # See http://bugs.python.org/issue30218 + def unpack_archive(filename: str, extract_dir: Optional[StrPath] = ..., format: Optional[str] = ...) -> None: ... + def register_unpack_format( + name: str, extensions: List[str], function: Any, extra_args: Sequence[Tuple[str, Any]] = ..., description: str = ... + ) -> None: ... def unregister_unpack_format(name: str) -> None: ... def get_unpack_formats() -> List[Tuple[str, List[str], str]]: ... - def get_terminal_size(fallback: Tuple[int, int] = ...) -> os.terminal_size: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/site.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/site.pyi old mode 100755 new mode 100644 index 4fdbad8e..e91176ac --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/site.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/site.pyi @@ -1,7 +1,5 @@ -# Stubs for site - -from typing import List, Iterable, Optional import sys +from typing import Iterable, List, Optional PREFIXES: List[str] ENABLE_USER_SITE: Optional[bool] @@ -10,8 +8,8 @@ USER_BASE: Optional[str] if sys.version_info < (3,): def main() -> None: ... -def addsitedir(sitedir: str, - known_paths: Optional[Iterable[str]] = ...) -> None: ... + +def addsitedir(sitedir: str, known_paths: Optional[Iterable[str]] = ...) -> None: ... def getsitepackages(prefixes: Optional[Iterable[str]] = ...) -> List[str]: ... def getuserbase() -> str: ... def getusersitepackages() -> str: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/smtpd.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/smtpd.pyi old mode 100755 new mode 100644 index 870a5014..051fe72e --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/smtpd.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/smtpd.pyi @@ -1,14 +1,11 @@ -# Stubs for smtpd (Python 2 and 3) -import sys -import socket -import asyncore import asynchat - +import asyncore +import socket +import sys from typing import Any, DefaultDict, List, Optional, Text, Tuple, Type _Address = Tuple[str, int] # (host, port) - class SMTPChannel(asynchat.async_chat): COMMAND: int DATA: int @@ -31,13 +28,19 @@ class SMTPChannel(asynchat.async_chat): data_size_limit: int enable_SMTPUTF8: bool - @property def max_command_size_limit(self) -> int: ... - if sys.version_info >= (3,): - def __init__(self, server: SMTPServer, conn: socket.socket, addr: Any, data_size_limit: int = ..., - map: Optional[asyncore._maptype] = ..., enable_SMTPUTF8: bool = ..., decode_data: bool = ...) -> None: ... + def __init__( + self, + server: SMTPServer, + conn: socket.socket, + addr: Any, + data_size_limit: int = ..., + map: Optional[asyncore._maptype] = ..., + enable_SMTPUTF8: bool = ..., + decode_data: bool = ..., + ) -> None: ... else: def __init__(self, server: SMTPServer, conn: socket.socket, addr: Any, data_size_limit: int = ...) -> None: ... # base asynchat.async_chat.push() accepts bytes @@ -64,12 +67,17 @@ class SMTPServer(asyncore.dispatcher): enable_SMTPUTF8: bool if sys.version_info >= (3,): - def __init__(self, localaddr: _Address, remoteaddr: _Address, - data_size_limit: int = ..., map: Optional[asyncore._maptype] = ..., - enable_SMTPUTF8: bool = ..., decode_data: bool = ...) -> None: ... + def __init__( + self, + localaddr: _Address, + remoteaddr: _Address, + data_size_limit: int = ..., + map: Optional[asyncore._maptype] = ..., + enable_SMTPUTF8: bool = ..., + decode_data: bool = ..., + ) -> None: ... else: - def __init__(self, localaddr: _Address, remoteaddr: _Address, - data_size_limit: int = ...) -> None: ... + def __init__(self, localaddr: _Address, remoteaddr: _Address, data_size_limit: int = ...) -> None: ... def handle_accepted(self, conn: socket.socket, addr: Any) -> None: ... def process_message(self, peer: _Address, mailfrom: str, rcpttos: List[Text], data: str, **kwargs: Any) -> Optional[str]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/sndhdr.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/sndhdr.pyi old mode 100755 new mode 100644 index 7b742c0a..ef025ac5 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/sndhdr.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/sndhdr.pyi @@ -1,8 +1,6 @@ -# Stubs for sndhdr (Python 2 and 3) - -import os import sys -from typing import Any, NamedTuple, Optional, Tuple, Union +from _typeshed import AnyPath +from typing import NamedTuple, Optional, Tuple, Union if sys.version_info >= (3, 5): class SndHeaders(NamedTuple): @@ -15,10 +13,5 @@ if sys.version_info >= (3, 5): else: _SndHeaders = Tuple[str, int, int, int, Union[int, str]] -if sys.version_info >= (3, 6): - _Path = Union[str, bytes, os.PathLike[Any]] -else: - _Path = Union[str, bytes] - -def what(filename: _Path) -> Optional[_SndHeaders]: ... -def whathdr(filename: _Path) -> Optional[_SndHeaders]: ... +def what(filename: AnyPath) -> Optional[_SndHeaders]: ... +def whathdr(filename: AnyPath) -> Optional[_SndHeaders]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/socket.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/socket.pyi old mode 100755 new mode 100644 index ec853416..da8fbcf5 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/socket.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/socket.pyi @@ -1,27 +1,6 @@ -"""Stub for the socket module - -This file is organized to mirror the module's documentation, with a very small -number of exceptions. - -To avoid requiring tests on all platforms, platform checks are included only -where the documentation notes platform availability (as opposed to following -actual availability), with one or two exceptions. - -Module documentation: https://docs.python.org/3/library/socket.html -CPython module source: https://github.com/python/cpython/blob/master/Lib/socket.py -CPython C source: https://github.com/python/cpython/blob/master/Modules/socketmodule.c -""" -# Authorship from original mypy stubs (not in typeshed git history): -# Ron Murawski -# adapted for Python 2.7 by Michal Pokorny import sys from typing import Any, BinaryIO, Iterable, List, Optional, Text, TextIO, Tuple, TypeVar, Union, overload - -if sys.version_info >= (3, 8): - from typing import Literal -else: - from typing_extensions import Literal - +from typing_extensions import Literal # ----- Constants ----- # Some socket families are listed in the "Socket families" section of the docs, @@ -56,7 +35,7 @@ SOCK_RAW: SocketKind SOCK_RDM: SocketKind SOCK_SEQPACKET: SocketKind -if sys.platform == 'linux' and sys.version_info >= (3,): +if sys.platform == "linux" and sys.version_info >= (3,): SOCK_CLOEXEC: SocketKind SOCK_NONBLOCK: SocketKind @@ -98,7 +77,7 @@ AI_NUMERICSERV: AddressInfo AI_PASSIVE: AddressInfo AI_V4MAPPED: AddressInfo AI_V4MAPPED_CFG: AddressInfo -EAIEAI_ADDRFAMILY: int +EAI_ADDRFAMILY: int EAI_AGAIN: int EAI_BADFLAGS: int EAI_BADHINTS: int @@ -289,7 +268,7 @@ if sys.version_info >= (3, 7): # Specifically-documented constants -if sys.platform == 'linux' and sys.version_info >= (3,): +if sys.platform == "linux" and sys.version_info >= (3,): AF_CAN: AddressFamily PF_CAN: int SOL_CAN_BASE: int @@ -322,10 +301,56 @@ if sys.platform == 'linux' and sys.version_info >= (3,): CAN_RAW_FD_FRAMES: int -if sys.platform == 'linux' and sys.version_info >= (3, 7): +if sys.platform == "linux" and sys.version_info >= (3, 8): + CAN_BCM_SETTIMER: int + CAN_BCM_STARTTIMER: int + CAN_BCM_TX_COUNTEVT: int + CAN_BCM_TX_ANNOUNCE: int + CAN_BCM_TX_CP_CAN_ID: int + CAN_BCM_RX_FILTER_ID: int + CAN_BCM_RX_CHECK_DLC: int + CAN_BCM_RX_NO_AUTOTIMER: int + CAN_BCM_RX_ANNOUNCE_RESUME: int + CAN_BCM_TX_RESET_MULTI_IDX: int + CAN_BCM_RX_RTR_FRAME: int + CAN_BCM_CAN_FD_FRAME: int + +if sys.platform == "linux" and sys.version_info >= (3, 7): CAN_ISOTP: int -if sys.platform == 'linux': +if sys.platform == "linux" and sys.version_info >= (3, 9): + CAN_J1939: int + + J1939_MAX_UNICAST_ADDR: int + J1939_IDLE_ADDR: int + J1939_NO_ADDR: int + J1939_NO_NAME: int + J1939_PGN_REQUEST: int + J1939_PGN_ADDRESS_CLAIMED: int + J1939_PGN_ADDRESS_COMMANDED: int + J1939_PGN_PDU1_MAX: int + J1939_PGN_MAX: int + J1939_NO_PGN: int + + SO_J1939_FILTER: int + SO_J1939_PROMISC: int + SO_J1939_SEND_PRIO: int + SO_J1939_ERRQUEUE: int + + SCM_J1939_DEST_ADDR: int + SCM_J1939_DEST_NAME: int + SCM_J1939_PRIO: int + SCM_J1939_ERRQUEUE: int + + J1939_NLA_PAD: int + J1939_NLA_BYTES_ACKED: int + + J1939_EE_INFO_NONE: int + J1939_EE_INFO_TX_ABORT: int + + J1939_FILTER_MAX: int + +if sys.platform == "linux": AF_PACKET: AddressFamily PF_PACKET: int PACKET_BROADCAST: int @@ -336,7 +361,7 @@ if sys.platform == 'linux': PACKET_OTHERHOST: int PACKET_OUTGOING: int -if sys.platform == 'linux' and sys.version_info >= (3,): +if sys.platform == "linux" and sys.version_info >= (3,): AF_RDS: AddressFamily PF_RDS: int SOL_RDS: int @@ -359,7 +384,7 @@ if sys.platform == 'linux' and sys.version_info >= (3,): RDS_RDMA_USE_ONCE: int RDS_RECVERR: int -if sys.platform == 'win32': +if sys.platform == "win32": SIO_RCVALL: int SIO_KEEPALIVE_VALS: int if sys.version_info >= (3, 6): @@ -370,7 +395,7 @@ if sys.platform == 'win32': RCVALL_ON: int RCVALL_SOCKETLEVELONLY: int -if sys.platform == 'linux': +if sys.platform == "linux": AF_TIPC: AddressFamily SOL_TIPC: int TIPC_ADDR_ID: int @@ -397,7 +422,7 @@ if sys.platform == 'linux': TIPC_WITHDRAWN: int TIPC_ZONE_SCOPE: int -if sys.platform == 'linux' and sys.version_info >= (3, 6): +if sys.platform == "linux" and sys.version_info >= (3, 6): AF_ALG: AddressFamily SOL_ALG: int ALG_OP_DECRYPT: int @@ -411,7 +436,7 @@ if sys.platform == 'linux' and sys.version_info >= (3, 6): ALG_SET_OP: int ALG_SET_PUBKEY: int -if sys.platform == 'linux' and sys.version_info >= (3, 7): +if sys.platform == "linux" and sys.version_info >= (3, 7): AF_VSOCK: AddressFamily IOCTL_VM_SOCKETS_GET_LOCAL_CID: int VMADDR_CID_ANY: int @@ -434,14 +459,13 @@ if sys.version_info >= (3, 6): TCP_CONGESTION: int TCP_USER_TIMEOUT: int -if sys.platform == 'linux' and sys.version_info >= (3, 8): +if sys.platform == "linux" and sys.version_info >= (3, 8): AF_QIPCRTR: AddressFamily - # Semi-documented constants # (Listed under "Socket families" in the docs, but not "Constants") -if sys.platform == 'linux': +if sys.platform == "linux": # Netlink is defined by Linux AF_NETLINK: AddressFamily NETLINK_ARPD: int @@ -459,7 +483,7 @@ if sys.platform == 'linux': NETLINK_W1: int NETLINK_XFRM: int -if sys.platform != 'win32' and sys.platform != 'darwin': +if sys.platform != "win32" and sys.platform != "darwin": # Linux and some BSD support is explicit in the docs # Windows and macOS do not support in practice AF_BLUETOOTH: AddressFamily @@ -476,16 +500,14 @@ if sys.platform != 'win32' and sys.platform != 'darwin': HCI_TIME_STAMP: int HCI_DATA_DIR: int -if sys.platform == 'darwin': +if sys.platform == "darwin": # PF_SYSTEM is defined by macOS PF_SYSTEM: int SYSPROTO_CONTROL: int - # enum versions of above flags if sys.version_info >= (3, 4): from enum import IntEnum - class AddressFamily(IntEnum): AF_UNIX: int AF_INET: int @@ -524,7 +546,6 @@ if sys.version_info >= (3, 4): AF_VSOCK: int AF_WANPIPE: int AF_X25: int - class SocketKind(IntEnum): SOCK_STREAM: int SOCK_DGRAM: int @@ -533,13 +554,13 @@ if sys.version_info >= (3, 4): SOCK_SEQPACKET: int SOCK_CLOEXEC: int SOCK_NONBLOCK: int + else: AddressFamily = int SocketKind = int if sys.version_info >= (3, 6): from enum import IntFlag - class AddressInfo(IntFlag): AI_ADDRCONFIG: int AI_ALL: int @@ -548,7 +569,6 @@ if sys.version_info >= (3, 6): AI_NUMERICSERV: int AI_PASSIVE: int AI_V4MAPPED: int - class MsgFlag(IntFlag): MSG_CTRUNC: int MSG_DONTROUTE: int @@ -558,15 +578,16 @@ if sys.version_info >= (3, 6): MSG_PEEK: int MSG_TRUNC: int MSG_WAITALL: int + else: AddressInfo = int MsgFlag = int - # ----- Exceptions ----- if sys.version_info < (3,): class error(IOError): ... + else: error = OSError @@ -579,7 +600,6 @@ class gaierror(error): class timeout(error): def __init__(self, error: int = ..., string: str = ...) -> None: ... - # ----- Classes ----- # Addresses can be either tuples of varying lengths (AF_INET, AF_INET6, @@ -591,7 +611,7 @@ _RetAddress = Any _WriteBuffer = Union[bytearray, memoryview] _CMSG = Tuple[int, int, bytes] -_SelfT = TypeVar('_SelfT', bound=socket) +_SelfT = TypeVar("_SelfT", bound=socket) class socket: family: int @@ -604,7 +624,6 @@ class socket: def __init__(self, family: int = ..., type: int = ..., proto: int = ..., fileno: Optional[int] = ...) -> None: ... def __enter__(self: _SelfT) -> _SelfT: ... def __exit__(self, *args: Any) -> None: ... - # --- methods --- def accept(self) -> Tuple[socket, _RetAddress]: ... def bind(self, address: Union[_Address, bytes]) -> None: ... @@ -618,53 +637,53 @@ class socket: def get_inheritable(self) -> bool: ... def getpeername(self) -> _RetAddress: ... def getsockname(self) -> _RetAddress: ... - @overload def getsockopt(self, level: int, optname: int) -> int: ... @overload def getsockopt(self, level: int, optname: int, buflen: int) -> bytes: ... - if sys.version_info >= (3, 7): def getblocking(self) -> bool: ... def gettimeout(self) -> Optional[float]: ... - - if sys.platform == 'win32': - def ioctl(self, control: object, option: Tuple[int, int, int]) -> None: ... - + if sys.platform == "win32" and sys.version_info >= (3, 6): + def ioctl(self, control: int, option: Union[int, Tuple[int, int, int], bool]) -> None: ... + elif sys.platform == "win32": + def ioctl(self, control: int, option: Union[int, Tuple[int, int, int]]) -> None: ... if sys.version_info >= (3, 5): def listen(self, __backlog: int = ...) -> None: ... else: def listen(self, __backlog: int) -> None: ... # Note that the makefile's documented windows-specific behavior is not represented - if sys.version_info < (3,): - def makefile(self, mode: unicode = ..., buffering: int = ...) -> BinaryIO: ... - else: + if sys.version_info >= (3,): # mode strings with duplicates are intentionally excluded @overload - def makefile(self, - mode: Literal['r', 'w', 'rw', 'wr', ''], - buffering: Optional[int] = ..., - *, - encoding: Optional[str] = ..., - errors: Optional[str] = ..., - newline: Optional[str] = ...) -> TextIO: ... + def makefile( + self, + mode: Literal["r", "w", "rw", "wr", ""] = ..., + buffering: Optional[int] = ..., + *, + encoding: Optional[str] = ..., + errors: Optional[str] = ..., + newline: Optional[str] = ..., + ) -> TextIO: ... @overload - def makefile(self, - mode: Literal['b', 'rb', 'br', 'wb', 'bw', 'rwb', 'rbw', 'wrb', 'wbr', 'brw', 'bwr'] = ..., - buffering: Optional[int] = ..., - *, - encoding: Optional[str] = ..., - errors: Optional[str] = ..., - newline: Optional[str] = ...) -> BinaryIO: ... + def makefile( + self, + mode: Literal["b", "rb", "br", "wb", "bw", "rwb", "rbw", "wrb", "wbr", "brw", "bwr"], + buffering: Optional[int] = ..., + *, + encoding: Optional[str] = ..., + errors: Optional[str] = ..., + newline: Optional[str] = ..., + ) -> BinaryIO: ... + else: + def makefile(self, mode: unicode = ..., buffering: int = ...) -> BinaryIO: ... def recv(self, bufsize: int, flags: int = ...) -> bytes: ... def recvfrom(self, bufsize: int, flags: int = ...) -> Tuple[bytes, _RetAddress]: ... - - if sys.version_info >= (3, 3): + if sys.version_info >= (3, 3) and sys.platform != "win32": def recvmsg(self, __bufsize: int, __ancbufsize: int = ..., __flags: int = ...) -> Tuple[bytes, List[_CMSG], int, Any]: ... - def recvmsg_into(self, - __buffers: Iterable[_WriteBuffer], - __ancbufsize: int = ..., - __flags: int = ...) -> Tuple[int, List[_CMSG], int, Any]: ... + def recvmsg_into( + self, __buffers: Iterable[_WriteBuffer], __ancbufsize: int = ..., __flags: int = ... + ) -> Tuple[int, List[_CMSG], int, Any]: ... def recvfrom_into(self, buffer: _WriteBuffer, nbytes: int = ..., flags: int = ...) -> Tuple[int, _RetAddress]: ... def recv_into(self, buffer: _WriteBuffer, nbytes: int = ..., flags: int = ...) -> int: ... def send(self, data: bytes, flags: int = ...) -> int: ... @@ -673,23 +692,19 @@ class socket: def sendto(self, data: bytes, address: _Address) -> int: ... @overload def sendto(self, data: bytes, flags: int, address: _Address) -> int: ... - if sys.version_info >= (3, 3): - def sendmsg(self, - __buffers: Iterable[bytes], - __ancdata: Iterable[_CMSG] = ..., - __flags: int = ..., - __address: _Address = ...) -> int: ... - if sys.platform == 'linux' and sys.version_info >= (3, 6): - # TODO add the parameter types for sendmsg_afalg - def sendmsg_afalg(self, msg=..., *, op, iv=..., assoclen=..., flags=...) -> int: ... - + if sys.version_info >= (3, 3) and sys.platform != "win32": + def sendmsg( + self, __buffers: Iterable[bytes], __ancdata: Iterable[_CMSG] = ..., __flags: int = ..., __address: _Address = ... + ) -> int: ... + if sys.platform == "linux" and sys.version_info >= (3, 6): + def sendmsg_afalg( + self, msg: Iterable[bytes] = ..., *, op: int, iv: Any = ..., assoclen: int = ..., flags: int = ... + ) -> int: ... if sys.version_info >= (3,): - # TODO determine legal types for file parameter - def sendfile(self, file, offset: int = ..., count: Optional[int] = ...) -> int: ... + def sendfile(self, file: BinaryIO, offset: int = ..., count: Optional[int] = ...) -> int: ... def set_inheritable(self, inheritable: bool) -> None: ... def setblocking(self, flag: bool) -> None: ... def settimeout(self, value: Optional[float]) -> None: ... - if sys.version_info < (3, 6): def setsockopt(self, level: int, optname: int, value: Union[int, bytes]) -> None: ... else: @@ -697,52 +712,59 @@ class socket: def setsockopt(self, level: int, optname: int, value: Union[int, bytes]) -> None: ... @overload def setsockopt(self, level: int, optname: int, value: None, optlen: int) -> None: ... - - if sys.platform == 'win32': + if sys.platform == "win32": def share(self, process_id: int) -> bytes: ... - def shutdown(self, how: int) -> None: ... - # ----- Functions ----- if sys.version_info >= (3, 7): def close(fd: int) -> None: ... -def create_connection(address: Tuple[Optional[str], int], - timeout: Optional[float] = ..., - source_address: Tuple[Union[bytearray, bytes, Text], int] = ...) -> socket: ... +def create_connection( + address: Tuple[Optional[str], int], + timeout: Optional[float] = ..., + source_address: Optional[Tuple[Union[bytearray, bytes, Text], int]] = ..., +) -> socket: ... if sys.version_info >= (3, 8): - def create_server(address: _Address, - *, - family: int = ..., - backlog: Optional[int] = ..., - reuse_port: bool = ..., - dualstack_ipv6: bool = ...) -> socket: ... + def create_server( + address: _Address, *, family: int = ..., backlog: Optional[int] = ..., reuse_port: bool = ..., dualstack_ipv6: bool = ... + ) -> socket: ... def has_dualstack_ipv6() -> bool: ... def fromfd(fd: int, family: int, type: int, proto: int = ...) -> socket: ... -if sys.platform == 'win32' and sys.version_info >= (3, 3): - def fromshare(data: bytes) -> socket: ... +if sys.platform == "win32" and sys.version_info >= (3, 3): + def fromshare(info: bytes) -> socket: ... # the 5th tuple item is an address -# TODO the "Tuple[Any, ...]" should be "Union[Tuple[str, int], Tuple[str, int, int, int]]" but that triggers -# https://github.com/python/mypy/issues/2509 -def getaddrinfo(host: Optional[Union[bytearray, bytes, Text]], - port: Union[str, int, None], - family: int = ..., - socktype: int = ..., - proto: int = ..., - flags: int = ...) -> List[Tuple[AddressFamily, SocketKind, int, str, Tuple[Any, ...]]]: ... +if sys.version_info >= (3,): + def getaddrinfo( + host: Optional[Union[bytearray, bytes, Text]], + port: Union[str, int, None], + family: int = ..., + type: int = ..., + proto: int = ..., + flags: int = ..., + ) -> List[Tuple[AddressFamily, SocketKind, int, str, Union[Tuple[str, int], Tuple[str, int, int, int]]]]: ... + +else: + def getaddrinfo( + host: Optional[Union[bytearray, bytes, Text]], + port: Union[str, int, None], + family: int = ..., + socktype: int = ..., + proto: int = ..., + flags: int = ..., + ) -> List[Tuple[AddressFamily, SocketKind, int, str, Tuple[Any, ...]]]: ... def getfqdn(name: str = ...) -> str: ... def gethostbyname(hostname: str) -> str: ... def gethostbyname_ex(hostname: str) -> Tuple[str, List[str], List[str]]: ... def gethostname() -> str: ... def gethostbyaddr(ip_address: str) -> Tuple[str, List[str], List[str]]: ... -def getnameinfo(sockaddr: Union[Tuple[str, int], Tuple[str, int, int, int]], flags: int) -> Tuple[str, int]: ... +def getnameinfo(sockaddr: Union[Tuple[str, int], Tuple[str, int, int, int]], flags: int) -> Tuple[str, str]: ... def getprotobyname(protocolname: str) -> int: ... def getservbyname(servicename: str, protocolname: str = ...) -> int: ... def getservbyport(port: int, protocolname: str = ...) -> str: ... @@ -755,13 +777,27 @@ def inet_aton(ip_string: str) -> bytes: ... # ret val 4 bytes in length def inet_ntoa(packed_ip: bytes) -> str: ... def inet_pton(address_family: int, ip_string: str) -> bytes: ... def inet_ntop(address_family: int, packed_ip: bytes) -> str: ... + +if sys.version_info >= (3, 9): + if sys.platform != "win32": + # flags and address appear to be unused in send_fds and recv_fds + def send_fds( + sock: socket, buffers: Iterable[bytes], fds: Union[bytes, Iterable[int]], flags: int = ..., address: None = ... + ) -> int: ... + def recv_fds(sock: socket, bufsize: int, maxfds: int, flags: int = ...) -> Tuple[bytes, List[int], int, Any]: ... + if sys.version_info >= (3, 3): def CMSG_LEN(length: int) -> int: ... def CMSG_SPACE(length: int) -> int: ... + def getdefaulttimeout() -> Optional[float]: ... def setdefaulttimeout(timeout: Optional[float]) -> None: ... + if sys.version_info >= (3, 3): - def sethostname(name: str) -> None: ... - def if_nameindex() -> List[Tuple[int, str]]: ... - def if_nametoindex(name: str) -> int: ... - def if_indextoname(index: int) -> str: ... + if sys.platform != "win32": + def sethostname(name: str) -> None: ... + # Windows added these in 3.8, but didn't have them before + if sys.platform != "win32" or sys.version_info >= (3, 8): + def if_nameindex() -> List[Tuple[int, str]]: ... + def if_nametoindex(name: str) -> int: ... + def if_indextoname(index: int) -> str: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/sqlite3/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/sqlite3/__init__.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/sqlite3/dbapi2.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/sqlite3/dbapi2.pyi old mode 100755 new mode 100644 index 45c5c210..ae3b01bf --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/sqlite3/dbapi2.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/sqlite3/dbapi2.pyi @@ -1,12 +1,9 @@ -# Filip Hron -# based heavily on Andrey Vlasovskikh's python-skeletons https://github.com/JetBrains/python-skeletons/blob/master/sqlite3.py - import os import sys -from typing import Any, Callable, Iterable, Iterator, List, Optional, Text, Tuple, Type, TypeVar, Union -from datetime import date, time, datetime +from datetime import date, datetime, time +from typing import Any, Callable, Generator, Iterable, Iterator, List, Optional, Text, Tuple, Type, TypeVar, Union -_T = TypeVar('_T') +_T = TypeVar("_T") paramstyle: str threadsafety: int @@ -15,9 +12,9 @@ Date = date Time = time Timestamp = datetime -def DateFromTicks(ticks): ... -def TimeFromTicks(ticks): ... -def TimestampFromTicks(ticks): ... +def DateFromTicks(ticks: float) -> Date: ... +def TimeFromTicks(ticks: float) -> Time: ... +def TimestampFromTicks(ticks: float) -> Timestamp: ... version_info: str sqlite_version_info: Tuple[int, int, int] @@ -26,8 +23,6 @@ if sys.version_info >= (3,): else: Binary = buffer -def register_adapters_and_converters(): ... - # The remaining definitions are imported from _sqlite3. PARSE_COLNAMES: int @@ -71,32 +66,42 @@ version: str # TODO: adapt needs to get probed def adapt(obj, protocol, alternate): ... def complete_statement(sql: str) -> bool: ... + if sys.version_info >= (3, 7): - def connect(database: Union[bytes, Text, os.PathLike[Text]], - timeout: float = ..., - detect_types: int = ..., - isolation_level: Optional[str] = ..., - check_same_thread: bool = ..., - factory: Optional[Type[Connection]] = ..., - cached_statements: int = ..., - uri: bool = ...) -> Connection: ... + def connect( + database: Union[bytes, Text, os.PathLike[Text]], + timeout: float = ..., + detect_types: int = ..., + isolation_level: Optional[str] = ..., + check_same_thread: bool = ..., + factory: Optional[Type[Connection]] = ..., + cached_statements: int = ..., + uri: bool = ..., + ) -> Connection: ... + elif sys.version_info >= (3, 4): - def connect(database: Union[bytes, Text], - timeout: float = ..., - detect_types: int = ..., - isolation_level: Optional[str] = ..., - check_same_thread: bool = ..., - factory: Optional[Type[Connection]] = ..., - cached_statements: int = ..., - uri: bool = ...) -> Connection: ... + def connect( + database: Union[bytes, Text], + timeout: float = ..., + detect_types: int = ..., + isolation_level: Optional[str] = ..., + check_same_thread: bool = ..., + factory: Optional[Type[Connection]] = ..., + cached_statements: int = ..., + uri: bool = ..., + ) -> Connection: ... + else: - def connect(database: Union[bytes, Text], - timeout: float = ..., - detect_types: int = ..., - isolation_level: Optional[str] = ..., - check_same_thread: bool = ..., - factory: Optional[Type[Connection]] = ..., - cached_statements: int = ...) -> Connection: ... + def connect( + database: Union[bytes, Text], + timeout: float = ..., + detect_types: int = ..., + isolation_level: Optional[str] = ..., + check_same_thread: bool = ..., + factory: Optional[Type[Connection]] = ..., + cached_statements: int = ..., + ) -> Connection: ... + def enable_callback_tracebacks(flag: bool) -> None: ... def enable_shared_cache(do_enable: int) -> None: ... def register_adapter(type: Type[_T], callable: Callable[[_T], Union[int, float, str, bytes]]) -> None: ... @@ -124,38 +129,47 @@ class Connection(object): row_factory: Any text_factory: Any total_changes: Any - def __init__(self, *args, **kwargs): ... + def __init__(self, *args: Any, **kwargs: Any) -> None: ... def close(self) -> None: ... def commit(self) -> None: ... def create_aggregate(self, name: str, num_params: int, aggregate_class: type) -> None: ... def create_collation(self, name: str, callable: Any) -> None: ... - def create_function(self, name: str, num_params: int, func: Any) -> None: ... + if sys.version_info >= (3, 8): + def create_function(self, name: str, num_params: int, func: Any, *, deterministic: bool = ...) -> None: ... + else: + def create_function(self, name: str, num_params: int, func: Any) -> None: ... def cursor(self, cursorClass: Optional[type] = ...) -> Cursor: ... def execute(self, sql: str, parameters: Iterable[Any] = ...) -> Cursor: ... # TODO: please check in executemany() if seq_of_parameters type is possible like this def executemany(self, sql: str, seq_of_parameters: Iterable[Iterable[Any]]) -> Cursor: ... def executescript(self, sql_script: Union[bytes, Text]) -> Cursor: ... - def interrupt(self, *args, **kwargs) -> None: ... - def iterdump(self, *args, **kwargs) -> None: ... - def rollback(self, *args, **kwargs) -> None: ... + def interrupt(self, *args: Any, **kwargs: Any) -> None: ... + def iterdump(self, *args: Any, **kwargs: Any) -> Generator[str, None, None]: ... + def rollback(self, *args: Any, **kwargs: Any) -> None: ... # TODO: set_authorizer(authorzer_callback) # see https://docs.python.org/2/library/sqlite3.html#sqlite3.Connection.set_authorizer # returns [SQLITE_OK, SQLITE_DENY, SQLITE_IGNORE] so perhaps int - def set_authorizer(self, *args, **kwargs) -> None: ... + def set_authorizer(self, *args: Any, **kwargs: Any) -> None: ... # set_progress_handler(handler, n) -> see https://docs.python.org/2/library/sqlite3.html#sqlite3.Connection.set_progress_handler - def set_progress_handler(self, *args, **kwargs) -> None: ... - def set_trace_callback(self, *args, **kwargs): ... + def set_progress_handler(self, *args: Any, **kwargs: Any) -> None: ... + def set_trace_callback(self, *args: Any, **kwargs: Any) -> None: ... # enable_load_extension and load_extension is not available on python distributions compiled # without sqlite3 loadable extension support. see footnotes https://docs.python.org/3/library/sqlite3.html#f1 def enable_load_extension(self, enabled: bool) -> None: ... def load_extension(self, path: str) -> None: ... if sys.version_info >= (3, 7): - def backup(self, target: Connection, *, pages: int = ..., - progress: Optional[Callable[[int, int, int], object]] = ..., name: str = ..., - sleep: float = ...) -> None: ... - def __call__(self, *args, **kwargs): ... - def __enter__(self, *args, **kwargs) -> Connection: ... - def __exit__(self, *args, **kwargs): ... + def backup( + self, + target: Connection, + *, + pages: int = ..., + progress: Optional[Callable[[int, int, int], object]] = ..., + name: str = ..., + sleep: float = ..., + ) -> None: ... + def __call__(self, *args: Any, **kwargs: Any) -> Any: ... + def __enter__(self) -> Connection: ... + def __exit__(self, t: Optional[type] = ..., exc: Optional[BaseException] = ..., tb: Optional[Any] = ...) -> None: ... class Cursor(Iterator[Any]): arraysize: Any @@ -167,112 +181,107 @@ class Cursor(Iterator[Any]): # TODO: Cursor class accepts exactly 1 argument # required type is sqlite3.Connection (which is imported as _Connection) # however, the name of the __init__ variable is unknown - def __init__(self, *args, **kwargs) -> None: ... - def close(self, *args, **kwargs) -> None: ... + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + def close(self, *args: Any, **kwargs: Any) -> None: ... def execute(self, sql: str, parameters: Iterable[Any] = ...) -> Cursor: ... def executemany(self, sql: str, seq_of_parameters: Iterable[Iterable[Any]]) -> Cursor: ... def executescript(self, sql_script: Union[bytes, Text]) -> Cursor: ... def fetchall(self) -> List[Any]: ... def fetchmany(self, size: Optional[int] = ...) -> List[Any]: ... def fetchone(self) -> Any: ... - def setinputsizes(self, *args, **kwargs) -> None: ... - def setoutputsize(self, *args, **kwargs) -> None: ... + def setinputsizes(self, *args: Any, **kwargs: Any) -> None: ... + def setoutputsize(self, *args: Any, **kwargs: Any) -> None: ... def __iter__(self) -> Cursor: ... if sys.version_info >= (3, 0): def __next__(self) -> Any: ... else: def next(self) -> Any: ... - class DataError(DatabaseError): ... - class DatabaseError(Error): ... - class Error(Exception): ... - class IntegrityError(DatabaseError): ... - class InterfaceError(Error): ... - class InternalError(DatabaseError): ... - class NotSupportedError(DatabaseError): ... - class OperationalError(DatabaseError): ... -class OptimizedUnicode(object): - maketrans: Any - def __init__(self, *args, **kwargs): ... - def capitalize(self, *args, **kwargs): ... - def casefold(self, *args, **kwargs): ... - def center(self, *args, **kwargs): ... - def count(self, *args, **kwargs): ... - def encode(self, *args, **kwargs): ... - def endswith(self, *args, **kwargs): ... - def expandtabs(self, *args, **kwargs): ... - def find(self, *args, **kwargs): ... - def format(self, *args, **kwargs): ... - def format_map(self, *args, **kwargs): ... - def index(self, *args, **kwargs): ... - def isalnum(self, *args, **kwargs): ... - def isalpha(self, *args, **kwargs): ... - def isdecimal(self, *args, **kwargs): ... - def isdigit(self, *args, **kwargs): ... - def isidentifier(self, *args, **kwargs): ... - def islower(self, *args, **kwargs): ... - def isnumeric(self, *args, **kwargs): ... - def isprintable(self, *args, **kwargs): ... - def isspace(self, *args, **kwargs): ... - def istitle(self, *args, **kwargs): ... - def isupper(self, *args, **kwargs): ... - def join(self, *args, **kwargs): ... - def ljust(self, *args, **kwargs): ... - def lower(self, *args, **kwargs): ... - def lstrip(self, *args, **kwargs): ... - def partition(self, *args, **kwargs): ... - def replace(self, *args, **kwargs): ... - def rfind(self, *args, **kwargs): ... - def rindex(self, *args, **kwargs): ... - def rjust(self, *args, **kwargs): ... - def rpartition(self, *args, **kwargs): ... - def rsplit(self, *args, **kwargs): ... - def rstrip(self, *args, **kwargs): ... - def split(self, *args, **kwargs): ... - def splitlines(self, *args, **kwargs): ... - def startswith(self, *args, **kwargs): ... - def strip(self, *args, **kwargs): ... - def swapcase(self, *args, **kwargs): ... - def title(self, *args, **kwargs): ... - def translate(self, *args, **kwargs): ... - def upper(self, *args, **kwargs): ... - def zfill(self, *args, **kwargs): ... - def __add__(self, other): ... - def __contains__(self, *args, **kwargs): ... - def __eq__(self, other): ... - def __format__(self, *args, **kwargs): ... - def __ge__(self, other): ... - def __getitem__(self, index): ... - def __getnewargs__(self, *args, **kwargs): ... - def __gt__(self, other): ... - def __hash__(self): ... - def __iter__(self): ... - def __le__(self, other): ... - def __len__(self, *args, **kwargs): ... - def __lt__(self, other): ... - def __mod__(self, other): ... - def __mul__(self, other): ... - def __ne__(self, other): ... - def __rmod__(self, other): ... - def __rmul__(self, other): ... +if sys.version_info >= (3,): + OptimizedUnicode = str +else: + class OptimizedUnicode(object): + maketrans: Any + def __init__(self, *args, **kwargs): ... + def capitalize(self, *args, **kwargs): ... + def casefold(self, *args, **kwargs): ... + def center(self, *args, **kwargs): ... + def count(self, *args, **kwargs): ... + def encode(self, *args, **kwargs): ... + def endswith(self, *args, **kwargs): ... + def expandtabs(self, *args, **kwargs): ... + def find(self, *args, **kwargs): ... + def format(self, *args, **kwargs): ... + def format_map(self, *args, **kwargs): ... + def index(self, *args, **kwargs): ... + def isalnum(self, *args, **kwargs): ... + def isalpha(self, *args, **kwargs): ... + def isdecimal(self, *args, **kwargs): ... + def isdigit(self, *args, **kwargs): ... + def isidentifier(self, *args, **kwargs): ... + def islower(self, *args, **kwargs): ... + def isnumeric(self, *args, **kwargs): ... + def isprintable(self, *args, **kwargs): ... + def isspace(self, *args, **kwargs): ... + def istitle(self, *args, **kwargs): ... + def isupper(self, *args, **kwargs): ... + def join(self, *args, **kwargs): ... + def ljust(self, *args, **kwargs): ... + def lower(self, *args, **kwargs): ... + def lstrip(self, *args, **kwargs): ... + def partition(self, *args, **kwargs): ... + def replace(self, *args, **kwargs): ... + def rfind(self, *args, **kwargs): ... + def rindex(self, *args, **kwargs): ... + def rjust(self, *args, **kwargs): ... + def rpartition(self, *args, **kwargs): ... + def rsplit(self, *args, **kwargs): ... + def rstrip(self, *args, **kwargs): ... + def split(self, *args, **kwargs): ... + def splitlines(self, *args, **kwargs): ... + def startswith(self, *args, **kwargs): ... + def strip(self, *args, **kwargs): ... + def swapcase(self, *args, **kwargs): ... + def title(self, *args, **kwargs): ... + def translate(self, *args, **kwargs): ... + def upper(self, *args, **kwargs): ... + def zfill(self, *args, **kwargs): ... + def __add__(self, other): ... + def __contains__(self, *args, **kwargs): ... + def __eq__(self, other): ... + def __format__(self, *args, **kwargs): ... + def __ge__(self, other): ... + def __getitem__(self, index): ... + def __getnewargs__(self, *args, **kwargs): ... + def __gt__(self, other): ... + def __hash__(self): ... + def __iter__(self): ... + def __le__(self, other): ... + def __len__(self, *args, **kwargs): ... + def __lt__(self, other): ... + def __mod__(self, other): ... + def __mul__(self, other): ... + def __ne__(self, other): ... + def __rmod__(self, other): ... + def __rmul__(self, other): ... class PrepareProtocol(object): - def __init__(self, *args, **kwargs): ... + def __init__(self, *args: Any, **kwargs: Any) -> None: ... class ProgrammingError(DatabaseError): ... class Row(object): - def __init__(self, *args, **kwargs): ... - def keys(self, *args, **kwargs): ... + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + def keys(self, *args: Any, **kwargs: Any): ... def __eq__(self, other): ... def __ge__(self, other): ... def __getitem__(self, index): ... @@ -280,7 +289,7 @@ class Row(object): def __hash__(self): ... def __iter__(self): ... def __le__(self, other): ... - def __len__(self, *args, **kwargs): ... + def __len__(self, *args: Any, **kwargs: Any): ... def __lt__(self, other): ... def __ne__(self, other): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/sre_compile.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/sre_compile.pyi old mode 100755 new mode 100644 index e6036e20..9b50b75d --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/sre_compile.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/sre_compile.pyi @@ -1,9 +1,22 @@ -# Source: https://hg.python.org/cpython/file/2.7/Lib/sre_compile.py -# and https://github.com/python/cpython/blob/master/Lib/sre_compile.py - import sys +from sre_constants import ( + SRE_FLAG_DEBUG as SRE_FLAG_DEBUG, + SRE_FLAG_DOTALL as SRE_FLAG_DOTALL, + SRE_FLAG_IGNORECASE as SRE_FLAG_IGNORECASE, + SRE_FLAG_LOCALE as SRE_FLAG_LOCALE, + SRE_FLAG_MULTILINE as SRE_FLAG_MULTILINE, + SRE_FLAG_TEMPLATE as SRE_FLAG_TEMPLATE, + SRE_FLAG_UNICODE as SRE_FLAG_UNICODE, + SRE_FLAG_VERBOSE as SRE_FLAG_VERBOSE, + SRE_INFO_CHARSET as SRE_INFO_CHARSET, + SRE_INFO_LITERAL as SRE_INFO_LITERAL, + SRE_INFO_PREFIX as SRE_INFO_PREFIX, +) from sre_parse import SubPattern -from typing import Any, List, Pattern, Tuple, Type, TypeVar, Union +from typing import Any, List, Pattern, Tuple, Type, Union + +if sys.version_info >= (3,): + from sre_constants import SRE_FLAG_ASCII as SRE_FLAG_ASCII MAXCODE: int if sys.version_info < (3, 0): diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/ssl.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/ssl.pyi old mode 100755 new mode 100644 index 3dd685ff..36656f55 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/ssl.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/ssl.pyi @@ -1,12 +1,9 @@ -# Stubs for ssl - -from typing import ( - Any, Callable, ClassVar, Dict, List, NamedTuple, Optional, Set, Text, Type, Tuple, Union, -) import enum import socket import sys -import os +from _typeshed import StrPath +from typing import Any, Callable, ClassVar, Dict, Iterable, List, NamedTuple, Optional, Set, Text, Tuple, Type, Union, overload +from typing_extensions import Literal _PCTRTT = Tuple[Tuple[str, str], ...] _PCTRTTT = Tuple[_PCTRTT, ...] @@ -15,11 +12,6 @@ _PeerCertRetType = Union[_PeerCertRetDictType, bytes, None] _EnumRetType = List[Tuple[bytes, str, Union[Set[str], bool]]] _PasswordType = Union[Callable[[], Union[str, bytes]], str, bytes] -if sys.version_info < (3, 6): - _Path = Text -else: - _Path = Union[str, os.PathLike[Any]] - if sys.version_info >= (3, 5): _SC1ArgT = Union[SSLSocket, SSLObject] else: @@ -29,6 +21,7 @@ _SrvnmeCbType = Callable[[_SC1ArgT, Optional[str], SSLSocket], Optional[int]] class SSLError(OSError): library: str reason: str + class SSLZeroReturnError(SSLError): ... class SSLWantReadError(SSLError): ... class SSLWantWriteError(SSLError): ... @@ -39,54 +32,69 @@ if sys.version_info >= (3, 7): class SSLCertVerificationError(SSLError, ValueError): verify_code: int verify_message: str - CertificateError = SSLCertVerificationError else: class CertificateError(ValueError): ... - -def wrap_socket(sock: socket.socket, keyfile: Optional[str] = ..., - certfile: Optional[str] = ..., server_side: bool = ..., - cert_reqs: int = ..., ssl_version: int = ..., - ca_certs: Optional[str] = ..., - do_handshake_on_connect: bool = ..., - suppress_ragged_eofs: bool = ..., - ciphers: Optional[str] = ...) -> SSLSocket: ... - - +def wrap_socket( + sock: socket.socket, + keyfile: Optional[str] = ..., + certfile: Optional[str] = ..., + server_side: bool = ..., + cert_reqs: int = ..., + ssl_version: int = ..., + ca_certs: Optional[str] = ..., + do_handshake_on_connect: bool = ..., + suppress_ragged_eofs: bool = ..., + ciphers: Optional[str] = ..., +) -> SSLSocket: ... def create_default_context( - purpose: Any = ..., - *, - cafile: Optional[str] = ..., - capath: Optional[str] = ..., - cadata: Union[Text, bytes, None] = ..., + purpose: Any = ..., *, cafile: Optional[str] = ..., capath: Optional[str] = ..., cadata: Union[Text, bytes, None] = ... ) -> SSLContext: ... -def _create_unverified_context(protocol: int = ..., *, - cert_reqs: int = ..., - check_hostname: bool = ..., - purpose: Any = ..., - certfile: Optional[str] = ..., - keyfile: Optional[str] = ..., - cafile: Optional[str] = ..., - capath: Optional[str] = ..., - cadata: Union[Text, bytes, None] = ...) -> SSLContext: ... +if sys.version_info >= (3, 7): + def _create_unverified_context( + protocol: int = ..., + *, + cert_reqs: int = ..., + check_hostname: bool = ..., + purpose: Any = ..., + certfile: Optional[str] = ..., + keyfile: Optional[str] = ..., + cafile: Optional[str] = ..., + capath: Optional[str] = ..., + cadata: Union[Text, bytes, None] = ..., + ) -> SSLContext: ... + +else: + def _create_unverified_context( + protocol: int = ..., + *, + cert_reqs: Optional[int] = ..., + check_hostname: bool = ..., + purpose: Any = ..., + certfile: Optional[str] = ..., + keyfile: Optional[str] = ..., + cafile: Optional[str] = ..., + capath: Optional[str] = ..., + cadata: Union[Text, bytes, None] = ..., + ) -> SSLContext: ... + _create_default_https_context: Callable[..., SSLContext] if sys.version_info >= (3, 3): - def RAND_bytes(num: int) -> bytes: ... - def RAND_pseudo_bytes(num: int) -> Tuple[bytes, bool]: ... + def RAND_bytes(__num: int) -> bytes: ... + def RAND_pseudo_bytes(__num: int) -> Tuple[bytes, bool]: ... + def RAND_status() -> bool: ... def RAND_egd(path: str) -> None: ... -def RAND_add(bytes: bytes, entropy: float) -> None: ... - - +def RAND_add(__s: bytes, __entropy: float) -> None: ... def match_hostname(cert: _PeerCertRetType, hostname: str) -> None: ... def cert_time_to_seconds(cert_time: str) -> int: ... -def get_server_certificate(addr: Tuple[str, int], ssl_version: int = ..., - ca_certs: Optional[str] = ...) -> str: ... +def get_server_certificate(addr: Tuple[str, int], ssl_version: int = ..., ca_certs: Optional[str] = ...) -> str: ... def DER_cert_to_PEM_cert(der_cert_bytes: bytes) -> str: ... def PEM_cert_to_DER_cert(pem_cert_string: str) -> bytes: ... + class DefaultVerifyPaths(NamedTuple): cafile: str capath: str @@ -94,13 +102,13 @@ class DefaultVerifyPaths(NamedTuple): openssl_cafile: str openssl_capath_env: str openssl_capath: str + def get_default_verify_paths() -> DefaultVerifyPaths: ... -if sys.platform == 'win32': +if sys.platform == "win32": def enum_certificates(store_name: str) -> _EnumRetType: ... def enum_crls(store_name: str) -> _EnumRetType: ... - CERT_NONE: int CERT_OPTIONAL: int CERT_REQUIRED: int @@ -117,26 +125,66 @@ PROTOCOL_SSLv3: int PROTOCOL_TLSv1: int PROTOCOL_TLSv1_1: int PROTOCOL_TLSv1_2: int -if sys.version_info >= (3, 5): - PROTOCOL_TLS: int +PROTOCOL_TLS: int if sys.version_info >= (3, 6): PROTOCOL_TLS_CLIENT: int PROTOCOL_TLS_SERVER: int -OP_ALL: int -OP_NO_SSLv2: int -OP_NO_SSLv3: int -OP_NO_TLSv1: int -OP_NO_TLSv1_1: int -OP_NO_TLSv1_2: int -OP_CIPHER_SERVER_PREFERENCE: int -OP_SINGLE_DH_USE: int -OP_SINGLE_ECDH_USE: int -OP_NO_COMPRESSION: int if sys.version_info >= (3, 6): - OP_NO_TICKET: int + class Options(enum.IntFlag): + OP_ALL: int + OP_NO_SSLv2: int + OP_NO_SSLv3: int + OP_NO_TLSv1: int + OP_NO_TLSv1_1: int + OP_NO_TLSv1_2: int + OP_CIPHER_SERVER_PREFERENCE: int + OP_SINGLE_DH_USE: int + OP_SINGLE_ECDH_USE: int + OP_NO_COMPRESSION: int + OP_NO_TICKET: int + if sys.version_info >= (3, 7): + OP_NO_RENEGOTIATION: int + OP_NO_TLSv1_3: int + if sys.version_info >= (3, 8): + OP_ENABLE_MIDDLEBOX_COMPAT: int + OP_ALL: Options + OP_NO_SSLv2: Options + OP_NO_SSLv3: Options + OP_NO_TLSv1: Options + OP_NO_TLSv1_1: Options + OP_NO_TLSv1_2: Options + OP_CIPHER_SERVER_PREFERENCE: Options + OP_SINGLE_DH_USE: Options + OP_SINGLE_ECDH_USE: Options + OP_NO_COMPRESSION: Options + OP_NO_TICKET: Options + if sys.version_info >= (3, 7): + OP_NO_RENEGOTIATION: Options + OP_NO_TLSv1_3: Options + if sys.version_info >= (3, 8): + OP_ENABLE_MIDDLEBOX_COMPAT: Options +else: + OP_ALL: int + OP_NO_SSLv2: int + OP_NO_SSLv3: int + OP_NO_TLSv1: int + OP_NO_TLSv1_1: int + OP_NO_TLSv1_2: int + OP_CIPHER_SERVER_PREFERENCE: int + OP_SINGLE_DH_USE: int + OP_SINGLE_ECDH_USE: int + OP_NO_COMPRESSION: int -HAS_ALPN: int +if sys.version_info >= (3, 7): + HAS_NEVER_CHECK_COMMON_NAME: bool + HAS_SSLv2: bool + HAS_SSLv3: bool + HAS_TLSv1: bool + HAS_TLSv1_1: bool + HAS_TLSv1_2: bool + HAS_TLSv1_3: bool +HAS_ALPN: bool HAS_ECDH: bool HAS_SNI: bool HAS_NPN: bool @@ -179,10 +227,12 @@ class _ASN1Object(NamedTuple): shortname: str longname: str oid: str + if sys.version_info < (3,): class Purpose(_ASN1Object): SERVER_AUTH: ClassVar[Purpose] CLIENT_AUTH: ClassVar[Purpose] + else: class Purpose(_ASN1Object, enum.Enum): SERVER_AUTH: _ASN1Object @@ -195,19 +245,23 @@ class SSLSocket(socket.socket): if sys.version_info >= (3, 6): session: Optional[SSLSession] session_reused: Optional[bool] - - def read(self, len: int = ..., - buffer: Optional[bytearray] = ...) -> bytes: ... - def write(self, buf: bytes) -> int: ... - def do_handshake(self) -> None: ... - def getpeercert(self, binary_form: bool = ...) -> _PeerCertRetType: ... - def cipher(self) -> Tuple[str, int, int]: ... + def read(self, len: int = ..., buffer: Optional[bytearray] = ...) -> bytes: ... + def write(self, data: bytes) -> int: ... + def do_handshake(self, block: bool = ...) -> None: ... # block is undocumented + @overload + def getpeercert(self, binary_form: Literal[False] = ...) -> Optional[_PeerCertRetDictType]: ... + @overload + def getpeercert(self, binary_form: Literal[True]) -> Optional[bytes]: ... + @overload + def getpeercert(self, binary_form: bool) -> _PeerCertRetType: ... + def cipher(self) -> Optional[Tuple[str, str, int]]: ... if sys.version_info >= (3, 5): - def shared_cipher(self) -> Optional[List[Tuple[str, int, int]]]: ... + def shared_ciphers(self) -> Optional[List[Tuple[str, str, int]]]: ... def compression(self) -> Optional[str]: ... def get_channel_binding(self, cb_type: str = ...) -> Optional[bytes]: ... def selected_alpn_protocol(self) -> Optional[str]: ... def selected_npn_protocol(self) -> Optional[str]: ... + def accept(self) -> Tuple[SSLSocket, socket._RetAddress]: ... def unwrap(self) -> socket.socket: ... def version(self) -> Optional[str]: ... def pending(self) -> int: ... @@ -226,7 +280,10 @@ if sys.version_info >= (3, 7): class SSLContext: check_hostname: bool - options: int + if sys.version_info >= (3, 6): + options: Options + else: + options: int if sys.version_info >= (3, 8): post_handshake_auth: bool @property @@ -238,41 +295,65 @@ class SSLContext: else: def __init__(self, protocol: int) -> None: ... def cert_store_stats(self) -> Dict[str, int]: ... - def load_cert_chain(self, certfile: _Path, keyfile: Optional[_Path] = ..., - password: _PasswordType = ...) -> None: ... + def load_cert_chain( + self, certfile: StrPath, keyfile: Optional[StrPath] = ..., password: Optional[_PasswordType] = ... + ) -> None: ... def load_default_certs(self, purpose: Purpose = ...) -> None: ... def load_verify_locations( - self, - cafile: Optional[str] = ..., - capath: Optional[str] = ..., - cadata: Union[Text, bytes, None] = ..., + self, cafile: Optional[StrPath] = ..., capath: Optional[StrPath] = ..., cadata: Union[Text, bytes, None] = ... ) -> None: ... def get_ca_certs(self, binary_form: bool = ...) -> Union[List[_PeerCertRetDictType], List[bytes]]: ... def set_default_verify_paths(self) -> None: ... - def set_ciphers(self, ciphers: str) -> None: ... - def set_alpn_protocols(self, protocols: List[str]) -> None: ... + def set_ciphers(self, __cipherlist: str) -> None: ... + def set_alpn_protocols(self, alpn_protocols: Iterable[str]) -> None: ... if sys.version_info >= (3, 7): sni_callback: Optional[Callable[[SSLObject, str, SSLContext], Union[None, int]]] sslobject_class: Type[SSLObject] - def set_npn_protocols(self, protocols: List[str]) -> None: ... - def set_servername_callback(self, - server_name_callback: Optional[_SrvnmeCbType]) -> None: ... - def load_dh_params(self, dhfile: str) -> None: ... - def set_ecdh_curve(self, curve_name: str) -> None: ... - def wrap_socket(self, sock: socket.socket, server_side: bool = ..., - do_handshake_on_connect: bool = ..., - suppress_ragged_eofs: bool = ..., - server_hostname: Optional[str] = ...) -> SSLSocket: ... - if sys.version_info >= (3, 5): - def wrap_bio(self, incoming: MemoryBIO, outgoing: MemoryBIO, - server_side: bool = ..., - server_hostname: Optional[str] = ...) -> SSLObject: ... + def set_npn_protocols(self, npn_protocols: Iterable[str]) -> None: ... + if sys.version_info >= (3, 7): + def set_servername_callback(self, server_name_callback: Optional[_SrvnmeCbType]) -> None: ... + else: + def set_servername_callback(self, __method: Optional[_SrvnmeCbType]) -> None: ... + def load_dh_params(self, __path: str) -> None: ... + def set_ecdh_curve(self, __name: str) -> None: ... + if sys.version_info >= (3, 6): + def wrap_socket( + self, + sock: socket.socket, + server_side: bool = ..., + do_handshake_on_connect: bool = ..., + suppress_ragged_eofs: bool = ..., + server_hostname: Optional[str] = ..., + session: Optional[SSLSession] = ..., + ) -> SSLSocket: ... + else: + def wrap_socket( + self, + sock: socket.socket, + server_side: bool = ..., + do_handshake_on_connect: bool = ..., + suppress_ragged_eofs: bool = ..., + server_hostname: Optional[str] = ..., + ) -> SSLSocket: ... + if sys.version_info >= (3, 6): + def wrap_bio( + self, + incoming: MemoryBIO, + outgoing: MemoryBIO, + server_side: bool = ..., + server_hostname: Optional[str] = ..., + session: Optional[SSLSession] = ..., + ) -> SSLObject: ... + elif sys.version_info >= (3, 5): + def wrap_bio( + self, incoming: MemoryBIO, outgoing: MemoryBIO, server_side: bool = ..., server_hostname: Optional[str] = ... + ) -> SSLObject: ... def session_stats(self) -> Dict[str, int]: ... if sys.version_info >= (3, 7): + hostname_checks_common_name: bool maximum_version: TLSVersion minimum_version: TLSVersion - if sys.version_info >= (3, 5): class SSLObject: context: SSLContext @@ -281,26 +362,31 @@ if sys.version_info >= (3, 5): if sys.version_info >= (3, 6): session: Optional[SSLSession] session_reused: bool - def read(self, len: int = ..., - buffer: Optional[bytearray] = ...) -> bytes: ... - def write(self, buf: bytes) -> int: ... - def getpeercert(self, binary_form: bool = ...) -> _PeerCertRetType: ... + def read(self, len: int = ..., buffer: Optional[bytearray] = ...) -> bytes: ... + def write(self, data: bytes) -> int: ... + @overload + def getpeercert(self, binary_form: Literal[False] = ...) -> Optional[_PeerCertRetDictType]: ... + @overload + def getpeercert(self, binary_form: Literal[True]) -> Optional[bytes]: ... + @overload + def getpeercert(self, binary_form: bool) -> _PeerCertRetType: ... + def selected_alpn_protocol(self) -> Optional[str]: ... def selected_npn_protocol(self) -> Optional[str]: ... - def cipher(self) -> Tuple[str, int, int]: ... - def shared_cipher(self) -> Optional[List[Tuple[str, int, int]]]: ... + def cipher(self) -> Optional[Tuple[str, str, int]]: ... + def shared_ciphers(self) -> Optional[List[Tuple[str, str, int]]]: ... def compression(self) -> Optional[str]: ... def pending(self) -> int: ... def do_handshake(self) -> None: ... def unwrap(self) -> None: ... + def version(self) -> Optional[str]: ... def get_channel_binding(self, cb_type: str = ...) -> Optional[bytes]: ... if sys.version_info >= (3, 8): def verify_client_post_handshake(self) -> None: ... - class MemoryBIO: pending: int eof: bool - def read(self, n: int = ...) -> bytes: ... - def write(self, buf: bytes) -> int: ... + def read(self, __size: int = ...) -> bytes: ... + def write(self, __buf: bytes) -> int: ... def write_eof(self) -> None: ... if sys.version_info >= (3, 6): @@ -310,14 +396,12 @@ if sys.version_info >= (3, 6): timeout: int ticket_lifetime_hint: int has_ticket: bool - class VerifyFlags(enum.IntFlag): VERIFY_DEFAULT: int VERIFY_CRL_CHECK_LEAF: int VERIFY_CRL_CHECK_CHAIN: int VERIFY_X509_STRICT: int VERIFY_X509_TRUSTED_FIRST: int - class VerifyMode(enum.IntEnum): CERT_NONE: int CERT_OPTIONAL: int diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/stringprep.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/stringprep.pyi old mode 100755 new mode 100644 index e3b7e9dc..604fd2f2 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/stringprep.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/stringprep.pyi @@ -1,5 +1,3 @@ -# Stubs for stringprep (Python 2 and 3) - from typing import Text def in_table_a1(code: Text) -> bool: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/struct.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/struct.pyi old mode 100755 new mode 100644 index 552ee227..9edf6842 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/struct.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/struct.pyi @@ -1,12 +1,7 @@ -# Stubs for struct - -# Based on http://docs.python.org/3.2/library/struct.html -# Based on http://docs.python.org/2/library/struct.html - import sys -from typing import Any, Tuple, Text, Union, Iterator from array import array from mmap import mmap +from typing import Any, Iterator, Text, Tuple, Union class error(Exception): ... @@ -20,12 +15,13 @@ else: def pack(fmt: _FmtType, *v: Any) -> bytes: ... def pack_into(fmt: _FmtType, buffer: _WriteBufferType, offset: int, *v: Any) -> None: ... -def unpack(fmt: _FmtType, buffer: _BufferType) -> Tuple[Any, ...]: ... -def unpack_from(fmt: _FmtType, buffer: _BufferType, offset: int = ...) -> Tuple[Any, ...]: ... +def unpack(__format: _FmtType, __buffer: _BufferType) -> Tuple[Any, ...]: ... +def unpack_from(__format: _FmtType, buffer: _BufferType, offset: int = ...) -> Tuple[Any, ...]: ... + if sys.version_info >= (3, 4): - def iter_unpack(fmt: _FmtType, buffer: _BufferType) -> Iterator[Tuple[Any, ...]]: ... + def iter_unpack(__format: _FmtType, __buffer: _BufferType) -> Iterator[Tuple[Any, ...]]: ... -def calcsize(fmt: _FmtType) -> int: ... +def calcsize(__format: _FmtType) -> int: ... class Struct: if sys.version_info >= (3, 7): @@ -33,12 +29,10 @@ class Struct: else: format: bytes size: int - def __init__(self, format: _FmtType) -> None: ... - def pack(self, *v: Any) -> bytes: ... def pack_into(self, buffer: _WriteBufferType, offset: int, *v: Any) -> None: ... - def unpack(self, buffer: _BufferType) -> Tuple[Any, ...]: ... + def unpack(self, __buffer: _BufferType) -> Tuple[Any, ...]: ... def unpack_from(self, buffer: _BufferType, offset: int = ...) -> Tuple[Any, ...]: ... if sys.version_info >= (3, 4): - def iter_unpack(self, buffer: _BufferType) -> Iterator[Tuple[Any, ...]]: ... + def iter_unpack(self, __buffer: _BufferType) -> Iterator[Tuple[Any, ...]]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/sunau.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/sunau.pyi old mode 100755 new mode 100644 index b957f580..b9475937 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/sunau.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/sunau.pyi @@ -1,7 +1,5 @@ -# Stubs for sunau (Python 2 and 3) - import sys -from typing import Any, NamedTuple, NoReturn, Optional, Text, IO, Union, Tuple +from typing import IO, Any, NamedTuple, NoReturn, Optional, Text, Tuple, Union _File = Union[Text, IO[bytes]] @@ -83,4 +81,6 @@ class Au_write: # Returns a Au_read if mode is rb and Au_write if mode is wb def open(f: _File, mode: Optional[str] = ...) -> Any: ... -openfp = open + +if sys.version_info < (3, 9): + openfp = open diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/symtable.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/symtable.pyi old mode 100755 new mode 100644 index fd8b9ad7..9fe53402 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/symtable.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/symtable.pyi @@ -1,5 +1,5 @@ import sys -from typing import List, Sequence, Tuple, Text +from typing import List, Sequence, Text, Tuple def symtable(code: Text, filename: Text, compile_type: Text) -> SymbolTable: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/sysconfig.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/sysconfig.pyi old mode 100755 new mode 100644 index 5d6c9cb1..ed0aa6d5 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/sysconfig.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/sysconfig.pyi @@ -1,12 +1,10 @@ -# Stubs for sysconfig - -from typing import overload, Any, Dict, IO, List, Optional, Tuple, Union +from typing import IO, Any, Dict, List, Optional, Tuple, overload +def get_config_var(name: str) -> Optional[str]: ... @overload def get_config_vars() -> Dict[str, Any]: ... @overload def get_config_vars(arg: str, *args: str) -> List[Any]: ... -def get_config_var(name: str) -> Optional[str]: ... def get_scheme_names() -> Tuple[str, ...]: ... def get_path_names() -> Tuple[str, ...]: ... def get_path(name: str, scheme: str = ..., vars: Optional[Dict[str, Any]] = ..., expand: bool = ...) -> Optional[str]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/syslog.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/syslog.pyi old mode 100755 new mode 100644 index 1237a6b0..49169f40 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/syslog.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/syslog.pyi @@ -37,7 +37,6 @@ def LOG_UPTO(a: int) -> int: ... def closelog() -> None: ... def openlog(ident: str = ..., logoption: int = ..., facility: int = ...) -> None: ... def setlogmask(x: int) -> int: ... - @overload def syslog(priority: int, message: str) -> None: ... @overload diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/tabnanny.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/tabnanny.pyi old mode 100755 new mode 100644 index cbc83533..7784c9fc --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/tabnanny.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/tabnanny.pyi @@ -1,13 +1,5 @@ -# Stubs for tabnanny (Python 2 and 3) - -import os -import sys -from typing import Iterable, Tuple, Union - -if sys.version_info >= (3, 6): - _Path = Union[str, bytes, os.PathLike] -else: - _Path = Union[str, bytes] +from _typeshed import AnyPath +from typing import Iterable, Tuple verbose: int filename_only: int @@ -18,5 +10,5 @@ class NannyNag(Exception): def get_msg(self) -> str: ... def get_line(self) -> str: ... -def check(file: _Path) -> None: ... +def check(file: AnyPath) -> None: ... def process_tokens(tokens: Iterable[Tuple[int, str, Tuple[int, int], Tuple[int, int], str]]) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/tarfile.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/tarfile.pyi old mode 100755 new mode 100644 index 98523fc4..a2e9a10e --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/tarfile.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/tarfile.pyi @@ -1,59 +1,83 @@ -# Stubs for tarfile - -from typing import ( - Callable, IO, Iterable, Iterator, List, Mapping, Optional, Type, - Union, -) -import os import sys +from _typeshed import AnyPath, StrPath from types import TracebackType +from typing import IO, Callable, Dict, Iterable, Iterator, List, Mapping, Optional, Set, Tuple, Type, Union -if sys.version_info >= (3, 6): - _Path = Union[bytes, str, os.PathLike] -elif sys.version_info >= (3,): - _Path = Union[bytes, str] -else: - _Path = Union[str, unicode] - -ENCODING: str +# tar constants +NUL: bytes +BLOCKSIZE: int +RECORDSIZE: int +GNU_MAGIC: bytes +POSIX_MAGIC: bytes -USTAR_FORMAT: int -GNU_FORMAT: int -PAX_FORMAT: int -DEFAULT_FORMAT: int +LENGTH_NAME: int +LENGTH_LINK: int +LENGTH_PREFIX: int REGTYPE: bytes AREGTYPE: bytes LNKTYPE: bytes SYMTYPE: bytes +CONTTYPE: bytes +BLKTYPE: bytes DIRTYPE: bytes FIFOTYPE: bytes -CONTTYPE: bytes CHRTYPE: bytes -BLKTYPE: bytes + +GNUTYPE_LONGNAME: bytes +GNUTYPE_LONGLINK: bytes GNUTYPE_SPARSE: bytes +XHDTYPE: bytes +XGLTYPE: bytes +SOLARIS_XHDTYPE: bytes + +USTAR_FORMAT: int +GNU_FORMAT: int +PAX_FORMAT: int +DEFAULT_FORMAT: int + +# tarfile constants + +SUPPORTED_TYPES: Tuple[bytes, ...] +REGULAR_TYPES: Tuple[bytes, ...] +GNU_TYPES: Tuple[bytes, ...] +PAX_FIELDS: Tuple[str, ...] +PAX_NUMBER_FIELDS: Dict[str, type] + +if sys.version_info >= (3,): + PAX_NAME_FIELDS: Set[str] + +ENCODING: str + if sys.version_info < (3,): TAR_PLAIN: int TAR_GZIPPED: int -def open(name: Optional[_Path] = ..., mode: str = ..., - fileobj: Optional[IO[bytes]] = ..., bufsize: int = ..., - *, format: Optional[int] = ..., tarinfo: Optional[TarInfo] = ..., - dereference: Optional[bool] = ..., - ignore_zeros: Optional[bool] = ..., - encoding: Optional[str] = ..., errors: str = ..., - pax_headers: Optional[Mapping[str, str]] = ..., - debug: Optional[int] = ..., - errorlevel: Optional[int] = ..., - compresslevel: Optional[int] = ...) -> TarFile: ... +def open( + name: Optional[AnyPath] = ..., + mode: str = ..., + fileobj: Optional[IO[bytes]] = ..., + bufsize: int = ..., + *, + format: Optional[int] = ..., + tarinfo: Optional[Type[TarInfo]] = ..., + dereference: Optional[bool] = ..., + ignore_zeros: Optional[bool] = ..., + encoding: Optional[str] = ..., + errors: str = ..., + pax_headers: Optional[Mapping[str, str]] = ..., + debug: Optional[int] = ..., + errorlevel: Optional[int] = ..., + compresslevel: Optional[int] = ..., +) -> TarFile: ... class TarFile(Iterable[TarInfo]): - name: Optional[_Path] + name: Optional[AnyPath] mode: str fileobj: Optional[IO[bytes]] format: Optional[int] - tarinfo: Optional[TarInfo] + tarinfo: Type[TarInfo] dereference: Optional[bool] ignore_zeros: Optional[bool] encoding: Optional[str] @@ -63,87 +87,124 @@ class TarFile(Iterable[TarInfo]): errorlevel: Optional[int] if sys.version_info < (3,): posix: bool - def __init__(self, name: Optional[_Path] = ..., mode: str = ..., - fileobj: Optional[IO[bytes]] = ..., - format: Optional[int] = ..., tarinfo: Optional[TarInfo] = ..., - dereference: Optional[bool] = ..., - ignore_zeros: Optional[bool] = ..., - encoding: Optional[str] = ..., errors: str = ..., - pax_headers: Optional[Mapping[str, str]] = ..., - debug: Optional[int] = ..., - errorlevel: Optional[int] = ..., - compresslevel: Optional[int] = ...) -> None: ... + def __init__( + self, + name: Optional[AnyPath] = ..., + mode: str = ..., + fileobj: Optional[IO[bytes]] = ..., + format: Optional[int] = ..., + tarinfo: Optional[Type[TarInfo]] = ..., + dereference: Optional[bool] = ..., + ignore_zeros: Optional[bool] = ..., + encoding: Optional[str] = ..., + errors: str = ..., + pax_headers: Optional[Mapping[str, str]] = ..., + debug: Optional[int] = ..., + errorlevel: Optional[int] = ..., + copybufsize: Optional[int] = ..., # undocumented + ) -> None: ... def __enter__(self) -> TarFile: ... - def __exit__(self, - exc_type: Optional[Type[BaseException]], - exc_val: Optional[BaseException], - exc_tb: Optional[TracebackType]) -> None: ... + def __exit__( + self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType] + ) -> None: ... def __iter__(self) -> Iterator[TarInfo]: ... @classmethod - def open(cls, name: Optional[_Path] = ..., mode: str = ..., - fileobj: Optional[IO[bytes]] = ..., bufsize: int = ..., - *, format: Optional[int] = ..., tarinfo: Optional[TarInfo] = ..., - dereference: Optional[bool] = ..., - ignore_zeros: Optional[bool] = ..., - encoding: Optional[str] = ..., errors: str = ..., - pax_headers: Optional[Mapping[str, str]] = ..., - debug: Optional[int] = ..., - errorlevel: Optional[int] = ...) -> TarFile: ... + def open( + cls, + name: Optional[AnyPath] = ..., + mode: str = ..., + fileobj: Optional[IO[bytes]] = ..., + bufsize: int = ..., + *, + format: Optional[int] = ..., + tarinfo: Optional[Type[TarInfo]] = ..., + dereference: Optional[bool] = ..., + ignore_zeros: Optional[bool] = ..., + encoding: Optional[str] = ..., + errors: str = ..., + pax_headers: Optional[Mapping[str, str]] = ..., + debug: Optional[int] = ..., + errorlevel: Optional[int] = ..., + ) -> TarFile: ... def getmember(self, name: str) -> TarInfo: ... def getmembers(self) -> List[TarInfo]: ... def getnames(self) -> List[str]: ... if sys.version_info >= (3, 5): - def list(self, verbose: bool = ..., - *, members: Optional[List[TarInfo]] = ...) -> None: ... + def list(self, verbose: bool = ..., *, members: Optional[List[TarInfo]] = ...) -> None: ... else: def list(self, verbose: bool = ...) -> None: ... def next(self) -> Optional[TarInfo]: ... if sys.version_info >= (3, 5): - def extractall(self, path: _Path = ..., - members: Optional[List[TarInfo]] = ..., - *, numeric_owner: bool = ...) -> None: ... + def extractall( + self, path: AnyPath = ..., members: Optional[List[TarInfo]] = ..., *, numeric_owner: bool = ... + ) -> None: ... else: - def extractall(self, path: _Path = ..., - members: Optional[List[TarInfo]] = ...) -> None: ... + def extractall(self, path: AnyPath = ..., members: Optional[List[TarInfo]] = ...) -> None: ... if sys.version_info >= (3, 5): - def extract(self, member: Union[str, TarInfo], path: _Path = ..., - set_attrs: bool = ..., - *, numeric_owner: bool = ...) -> None: ... + def extract( + self, member: Union[str, TarInfo], path: AnyPath = ..., set_attrs: bool = ..., *, numeric_owner: bool = ... + ) -> None: ... else: - def extract(self, member: Union[str, TarInfo], - path: _Path = ...) -> None: ... - def extractfile(self, - member: Union[str, TarInfo]) -> Optional[IO[bytes]]: ... + def extract(self, member: Union[str, TarInfo], path: AnyPath = ...) -> None: ... + def extractfile(self, member: Union[str, TarInfo]) -> Optional[IO[bytes]]: ... + def makedir(self, tarinfo: TarInfo, targetpath: AnyPath) -> None: ... # undocumented + def makefile(self, tarinfo: TarInfo, targetpath: AnyPath) -> None: ... # undocumented + def makeunknown(self, tarinfo: TarInfo, targetpath: AnyPath) -> None: ... # undocumented + def makefifo(self, tarinfo: TarInfo, targetpath: AnyPath) -> None: ... # undocumented + def makedev(self, tarinfo: TarInfo, targetpath: AnyPath) -> None: ... # undocumented + def makelink(self, tarinfo: TarInfo, targetpath: AnyPath) -> None: ... # undocumented + if sys.version_info >= (3, 5): + def chown(self, tarinfo: TarInfo, targetpath: AnyPath, numeric_owner: bool) -> None: ... # undocumented + else: + def chown(self, tarinfo: TarInfo, targetpath: AnyPath) -> None: ... # undocumented + def chmod(self, tarinfo: TarInfo, targetpath: AnyPath) -> None: ... # undocumented + def utime(self, tarinfo: TarInfo, targetpath: AnyPath) -> None: ... # undocumented if sys.version_info >= (3, 7): - def add(self, name: str, arcname: Optional[str] = ..., - recursive: bool = ..., *, - filter: Optional[Callable[[TarInfo], Optional[TarInfo]]] = ...) -> None: ... + def add( + self, + name: StrPath, + arcname: Optional[StrPath] = ..., + recursive: bool = ..., + *, + filter: Optional[Callable[[TarInfo], Optional[TarInfo]]] = ..., + ) -> None: ... elif sys.version_info >= (3,): - def add(self, name: str, arcname: Optional[str] = ..., - recursive: bool = ..., - exclude: Optional[Callable[[str], bool]] = ..., *, - filter: Optional[Callable[[TarInfo], Optional[TarInfo]]] = ...) -> None: ... + def add( + self, + name: StrPath, + arcname: Optional[StrPath] = ..., + recursive: bool = ..., + exclude: Optional[Callable[[str], bool]] = ..., + *, + filter: Optional[Callable[[TarInfo], Optional[TarInfo]]] = ..., + ) -> None: ... else: - def add(self, name: str, arcname: Optional[str] = ..., - recursive: bool = ..., - exclude: Optional[Callable[[str], bool]] = ..., - filter: Optional[Callable[[TarInfo], Optional[TarInfo]]] = ...) -> None: ... - def addfile(self, tarinfo: TarInfo, - fileobj: Optional[IO[bytes]] = ...) -> None: ... - def gettarinfo(self, name: Optional[str] = ..., - arcname: Optional[str] = ..., - fileobj: Optional[IO[bytes]] = ...) -> TarInfo: ... + def add( + self, + name: str, + arcname: Optional[str] = ..., + recursive: bool = ..., + exclude: Optional[Callable[[str], bool]] = ..., + filter: Optional[Callable[[TarInfo], Optional[TarInfo]]] = ..., + ) -> None: ... + def addfile(self, tarinfo: TarInfo, fileobj: Optional[IO[bytes]] = ...) -> None: ... + def gettarinfo( + self, name: Optional[str] = ..., arcname: Optional[str] = ..., fileobj: Optional[IO[bytes]] = ... + ) -> TarInfo: ... def close(self) -> None: ... -def is_tarfile(name: str) -> bool: ... +if sys.version_info >= (3, 9): + def is_tarfile(name: Union[AnyPath, IO[bytes]]) -> bool: ... + +else: + def is_tarfile(name: AnyPath) -> bool: ... if sys.version_info < (3, 8): def filemode(mode: int) -> str: ... # undocumented if sys.version_info < (3,): class TarFileCompat: - def __init__(self, filename: str, mode: str = ..., - compression: int = ...) -> None: ... + def __init__(self, filename: str, mode: str = ..., compression: int = ...) -> None: ... class TarError(Exception): ... class ReadError(TarError): ... @@ -173,8 +234,7 @@ class TarInfo: def frombuf(cls, buf: bytes) -> TarInfo: ... @classmethod def fromtarfile(cls, tarfile: TarFile) -> TarInfo: ... - def tobuf(self, format: Optional[int] = ..., - encoding: Optional[str] = ..., errors: str = ...) -> bytes: ... + def tobuf(self, format: Optional[int] = ..., encoding: Optional[str] = ..., errors: str = ...) -> bytes: ... def isfile(self) -> bool: ... def isreg(self) -> bool: ... def isdir(self) -> bool: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/telnetlib.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/telnetlib.pyi old mode 100755 new mode 100644 index 50b90b58..a8e37f64 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/telnetlib.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/telnetlib.pyi @@ -1,5 +1,3 @@ -# Stubs for telnetlib (Python 2 and 3) - import socket import sys from typing import Any, Callable, Match, Optional, Pattern, Sequence, Tuple, Union @@ -84,8 +82,7 @@ EXOPL: bytes NOOPT: bytes class Telnet: - def __init__(self, host: Optional[str] = ..., port: int = ..., - timeout: int = ...) -> None: ... + def __init__(self, host: Optional[str] = ..., port: int = ..., timeout: int = ...) -> None: ... def open(self, host: str, port: int = ..., timeout: int = ...) -> None: ... def msg(self, msg: str, *args: Any) -> None: ... def set_debuglevel(self, debuglevel: int) -> None: ... @@ -109,7 +106,9 @@ class Telnet: def interact(self) -> None: ... def mt_interact(self) -> None: ... def listener(self) -> None: ... - def expect(self, list: Sequence[Union[Pattern[bytes], bytes]], timeout: Optional[int] = ...) -> Tuple[int, Optional[Match[bytes]], bytes]: ... + def expect( + self, list: Sequence[Union[Pattern[bytes], bytes]], timeout: Optional[int] = ... + ) -> Tuple[int, Optional[Match[bytes]], bytes]: ... if sys.version_info >= (3, 6): def __enter__(self) -> Telnet: ... def __exit__(self, type: Any, value: Any, traceback: Any) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/termios.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/termios.pyi old mode 100755 new mode 100644 index d788e163..9eecbf68 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/termios.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/termios.pyi @@ -1,9 +1,7 @@ -# Stubs for termios +from _typeshed import FileDescriptorLike +from typing import Any, List, Union -from typing import IO, List, Union - -_FD = Union[int, IO[str]] -_Attr = List[Union[int, List[bytes]]] +_Attr = List[Union[int, List[Union[bytes, int]]]] # TODO constants not really documented B0: int @@ -238,11 +236,11 @@ VWERASE: int XCASE: int XTABS: int -def tcgetattr(fd: _FD) -> _Attr: ... -def tcsetattr(fd: _FD, when: int, attributes: _Attr) -> None: ... -def tcsendbreak(fd: _FD, duration: int) -> None: ... -def tcdrain(fd: _FD) -> None: ... -def tcflush(fd: _FD, queue: int) -> None: ... -def tcflow(fd: _FD, action: int) -> None: ... +def tcgetattr(fd: FileDescriptorLike) -> List[Any]: ... +def tcsetattr(fd: FileDescriptorLike, when: int, attributes: _Attr) -> None: ... +def tcsendbreak(fd: FileDescriptorLike, duration: int) -> None: ... +def tcdrain(fd: FileDescriptorLike) -> None: ... +def tcflush(fd: FileDescriptorLike, queue: int) -> None: ... +def tcflow(fd: FileDescriptorLike, action: int) -> None: ... class error(Exception): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/this.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/this.pyi new file mode 100644 index 00000000..0687a667 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/this.pyi @@ -0,0 +1,4 @@ +from typing import Dict + +s: str +d: Dict[str, str] diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/threading.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/threading.pyi old mode 100755 new mode 100644 index ca1b0fd2..625ec7b5 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/threading.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/threading.pyi @@ -1,20 +1,17 @@ -# Stubs for threading - -from typing import ( - Any, Callable, Iterable, List, Mapping, Optional, Tuple, Type, Union, - TypeVar, -) -from types import FrameType, TracebackType import sys +from types import FrameType, TracebackType +from typing import Any, Callable, Iterable, List, Mapping, Optional, Text, Type, TypeVar, Union # TODO recursive type _TF = Callable[[FrameType, str, Any], Optional[Callable[..., Any]]] _PF = Callable[[FrameType, str, Any], None] -_T = TypeVar('_T') +_T = TypeVar("_T") +__all__: List[str] def active_count() -> int: ... + if sys.version_info < (3,): def activeCount() -> int: ... @@ -41,53 +38,57 @@ if sys.version_info >= (3,): class ThreadError(Exception): ... - class local(object): def __getattribute__(self, name: str) -> Any: ... def __setattr__(self, name: str, value: Any) -> None: ... def __delattr__(self, name: str) -> None: ... - class Thread: name: str ident: Optional[int] daemon: bool if sys.version_info >= (3,): - def __init__(self, group: None = ..., - target: Optional[Callable[..., Any]] = ..., - name: Optional[str] = ..., - args: Iterable[Any] = ..., - kwargs: Mapping[str, Any] = ..., - *, daemon: Optional[bool] = ...) -> None: ... + def __init__( + self, + group: None = ..., + target: Optional[Callable[..., Any]] = ..., + name: Optional[str] = ..., + args: Iterable[Any] = ..., + kwargs: Mapping[str, Any] = ..., + *, + daemon: Optional[bool] = ..., + ) -> None: ... else: - def __init__(self, group: None = ..., - target: Optional[Callable[..., Any]] = ..., - name: Optional[str] = ..., - args: Iterable[Any] = ..., - kwargs: Mapping[str, Any] = ...) -> None: ... + def __init__( + self, + group: None = ..., + target: Optional[Callable[..., Any]] = ..., + name: Optional[Text] = ..., + args: Iterable[Any] = ..., + kwargs: Mapping[Text, Any] = ..., + ) -> None: ... def start(self) -> None: ... def run(self) -> None: ... def join(self, timeout: Optional[float] = ...) -> None: ... def getName(self) -> str: ... - def setName(self, name: str) -> None: ... + def setName(self, name: Text) -> None: ... if sys.version_info >= (3, 8): @property def native_id(self) -> Optional[int]: ... # only available on some platforms def is_alive(self) -> bool: ... - def isAlive(self) -> bool: ... + if sys.version_info < (3, 9): + def isAlive(self) -> bool: ... def isDaemon(self) -> bool: ... def setDaemon(self, daemonic: bool) -> None: ... - class _DummyThread(Thread): ... - class Lock: def __init__(self) -> None: ... def __enter__(self) -> bool: ... - def __exit__(self, exc_type: Optional[Type[BaseException]], - exc_val: Optional[BaseException], - exc_tb: Optional[TracebackType]) -> Optional[bool]: ... + def __exit__( + self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType] + ) -> Optional[bool]: ... if sys.version_info >= (3,): def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ... else: @@ -95,29 +96,26 @@ class Lock: def release(self) -> None: ... def locked(self) -> bool: ... - class _RLock: def __init__(self) -> None: ... def __enter__(self) -> bool: ... - def __exit__(self, exc_type: Optional[Type[BaseException]], - exc_val: Optional[BaseException], - exc_tb: Optional[TracebackType]) -> Optional[bool]: ... + def __exit__( + self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType] + ) -> Optional[bool]: ... if sys.version_info >= (3,): def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ... else: def acquire(self, blocking: bool = ...) -> bool: ... def release(self) -> None: ... - RLock = _RLock - class Condition: def __init__(self, lock: Union[Lock, _RLock, None] = ...) -> None: ... def __enter__(self) -> bool: ... - def __exit__(self, exc_type: Optional[Type[BaseException]], - exc_val: Optional[BaseException], - exc_tb: Optional[TracebackType]) -> Optional[bool]: ... + def __exit__( + self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType] + ) -> Optional[bool]: ... if sys.version_info >= (3,): def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ... else: @@ -125,37 +123,27 @@ class Condition: def release(self) -> None: ... def wait(self, timeout: Optional[float] = ...) -> bool: ... if sys.version_info >= (3,): - def wait_for(self, predicate: Callable[[], _T], - timeout: Optional[float] = ...) -> _T: ... + def wait_for(self, predicate: Callable[[], _T], timeout: Optional[float] = ...) -> _T: ... def notify(self, n: int = ...) -> None: ... def notify_all(self) -> None: ... def notifyAll(self) -> None: ... - class Semaphore: def __init__(self, value: int = ...) -> None: ... def __enter__(self) -> bool: ... - def __exit__(self, exc_type: Optional[Type[BaseException]], - exc_val: Optional[BaseException], - exc_tb: Optional[TracebackType]) -> Optional[bool]: ... + def __exit__( + self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType] + ) -> Optional[bool]: ... if sys.version_info >= (3,): def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ... else: def acquire(self, blocking: bool = ...) -> bool: ... - def release(self) -> None: ... - -class BoundedSemaphore: - def __init__(self, value: int = ...) -> None: ... - def __enter__(self) -> bool: ... - def __exit__(self, exc_type: Optional[Type[BaseException]], - exc_val: Optional[BaseException], - exc_tb: Optional[TracebackType]) -> Optional[bool]: ... - if sys.version_info >= (3,): - def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ... + if sys.version_info >= (3, 9): + def release(self, n: int = ...) -> None: ... else: - def acquire(self, blocking: bool = ...) -> bool: ... - def release(self) -> None: ... + def release(self) -> None: ... +class BoundedSemaphore(Semaphore): ... class Event: def __init__(self) -> None: ... @@ -167,30 +155,33 @@ class Event: def wait(self, timeout: Optional[float] = ...) -> bool: ... if sys.version_info >= (3, 8): - from _thread import _ExceptHookArgs as ExceptHookArgs, ExceptHookArgs as _ExceptHookArgs # don't ask - excepthook: Callable[[_ExceptHookArgs], Any] + from _thread import _excepthook, _ExceptHookArgs + + excepthook = _excepthook + ExceptHookArgs = _ExceptHookArgs class Timer(Thread): if sys.version_info >= (3,): - def __init__(self, interval: float, function: Callable[..., None], - args: Optional[Iterable[Any]] = ..., - kwargs: Optional[Mapping[str, Any]] = ...) -> None: ... + def __init__( + self, + interval: float, + function: Callable[..., Any], + args: Optional[Iterable[Any]] = ..., + kwargs: Optional[Mapping[str, Any]] = ..., + ) -> None: ... else: - def __init__(self, interval: float, function: Callable[..., None], - args: Iterable[Any] = ..., - kwargs: Mapping[str, Any] = ...) -> None: ... + def __init__( + self, interval: float, function: Callable[..., Any], args: Iterable[Any] = ..., kwargs: Mapping[str, Any] = ... + ) -> None: ... def cancel(self) -> None: ... - if sys.version_info >= (3,): class Barrier: parties: int n_waiting: int broken: bool - def __init__(self, parties: int, action: Optional[Callable[[], None]] = ..., - timeout: Optional[float] = ...) -> None: ... + def __init__(self, parties: int, action: Optional[Callable[[], None]] = ..., timeout: Optional[float] = ...) -> None: ... def wait(self, timeout: Optional[float] = ...) -> int: ... def reset(self) -> None: ... def abort(self) -> None: ... - class BrokenBarrierError(RuntimeError): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/time.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/time.pyi old mode 100755 new mode 100644 index 0c2370ad..e3315733 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/time.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/time.pyi @@ -1,8 +1,6 @@ -"""Stub file for the 'time' module.""" -# See https://docs.python.org/3/library/time.html - import sys -from typing import Any, NamedTuple, Tuple, Union, Optional +from typing import Any, NamedTuple, Optional, Tuple, Union + if sys.version_info >= (3, 3): from types import SimpleNamespace @@ -15,12 +13,12 @@ daylight: int timezone: int tzname: Tuple[str, str] -if sys.version_info >= (3, 7) and sys.platform != 'win32': +if sys.version_info >= (3, 7) and sys.platform != "win32": CLOCK_BOOTTIME: int # Linux CLOCK_PROF: int # FreeBSD, NetBSD, OpenBSD CLOCK_UPTIME: int # FreeBSD, OpenBSD -if sys.version_info >= (3, 3) and sys.platform != 'win32': +if sys.version_info >= (3, 3) and sys.platform != "win32": CLOCK_HIGHRES: int # Solaris only CLOCK_MONOTONIC: int # Unix only CLOCK_MONOTONIC_RAW: int # Linux 2.6.28 or later @@ -31,26 +29,31 @@ if sys.version_info >= (3, 3) and sys.platform != 'win32': if sys.version_info >= (3, 8) and sys.platform == "darwin": CLOCK_UPTIME_RAW: int +class _struct_time(NamedTuple): + tm_year: int + tm_mon: int + tm_mday: int + tm_hour: int + tm_min: int + tm_sec: int + tm_wday: int + tm_yday: int + tm_isdst: int + @property + def n_fields(self) -> int: ... + @property + def n_sequence_fields(self) -> int: ... + @property + def n_unnamed_fields(self) -> int: ... + if sys.version_info >= (3, 3): - class _struct_time(NamedTuple): - tm_year: int - tm_mon: int - tm_mday: int - tm_hour: int - tm_min: int - tm_sec: int - tm_wday: int - tm_yday: int - tm_isdst: int - tm_zone: str - tm_gmtoff: int class struct_time(_struct_time): def __init__( self, o: Union[ Tuple[int, int, int, int, int, int, int, int, int], Tuple[int, int, int, int, int, int, int, int, int, str], - Tuple[int, int, int, int, int, int, int, int, int, str, int] + Tuple[int, int, int, int, int, int, int, int, int, str, int], ], _arg: Any = ..., ) -> None: ... @@ -59,28 +62,26 @@ if sys.version_info >= (3, 3): o: Union[ Tuple[int, int, int, int, int, int, int, int, int], Tuple[int, int, int, int, int, int, int, int, int, str], - Tuple[int, int, int, int, int, int, int, int, int, str, int] + Tuple[int, int, int, int, int, int, int, int, int, str, int], ], _arg: Any = ..., ) -> struct_time: ... + if sys.version_info >= (3, 6) or sys.platform != "win32": + @property + def tm_zone(self) -> str: ... + @property + def tm_gmtoff(self) -> int: ... + else: - class _struct_time(NamedTuple): - tm_year: int - tm_mon: int - tm_mday: int - tm_hour: int - tm_min: int - tm_sec: int - tm_wday: int - tm_yday: int - tm_isdst: int class struct_time(_struct_time): def __init__(self, o: _TimeTuple, _arg: Any = ...) -> None: ... def __new__(cls, o: _TimeTuple, _arg: Any = ...) -> struct_time: ... def asctime(t: Union[_TimeTuple, struct_time] = ...) -> str: ... + if sys.version_info < (3, 8): def clock() -> float: ... + def ctime(secs: Optional[float] = ...) -> str: ... def gmtime(secs: Optional[float] = ...) -> struct_time: ... def localtime(secs: Optional[float] = ...) -> struct_time: ... @@ -89,7 +90,8 @@ def sleep(secs: float) -> None: ... def strftime(format: str, t: Union[_TimeTuple, struct_time] = ...) -> str: ... def strptime(string: str, format: str = ...) -> struct_time: ... def time() -> float: ... -if sys.platform != 'win32': + +if sys.platform != "win32": def tzset() -> None: ... # Unix only if sys.version_info >= (3, 3): @@ -97,14 +99,15 @@ if sys.version_info >= (3, 3): def monotonic() -> float: ... def perf_counter() -> float: ... def process_time() -> float: ... - if sys.platform != 'win32': + if sys.platform != "win32": def clock_getres(clk_id: int) -> float: ... # Unix only def clock_gettime(clk_id: int) -> float: ... # Unix only def clock_settime(clk_id: int, time: float) -> None: ... # Unix only if sys.version_info >= (3, 7): - def clock_gettime_ns(clock_id: int) -> int: ... - def clock_settime_ns(clock_id: int, time: int) -> int: ... + if sys.platform != "win32": + def clock_gettime_ns(clock_id: int) -> int: ... + def clock_settime_ns(clock_id: int, time: int) -> int: ... def monotonic_ns() -> int: ... def perf_counter_ns() -> int: ... def process_time_ns() -> int: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/timeit.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/timeit.pyi old mode 100755 new mode 100644 index bc4cbba8..336dd5c6 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/timeit.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/timeit.pyi @@ -1,7 +1,5 @@ -# Stubs for timeit (Python 2 and 3) - import sys -from typing import Any, Callable, Dict, IO, List, Optional, Sequence, Text, Tuple, Union +from typing import IO, Any, Callable, Dict, List, Optional, Sequence, Text, Tuple, Union _str = Union[str, Text] _Timer = Callable[[], float] @@ -11,8 +9,9 @@ default_timer: _Timer class Timer: if sys.version_info >= (3, 5): - def __init__(self, stmt: _stmt = ..., setup: _stmt = ..., timer: _Timer = ..., - globals: Optional[Dict[str, Any]] = ...) -> None: ... + def __init__( + self, stmt: _stmt = ..., setup: _stmt = ..., timer: _Timer = ..., globals: Optional[Dict[str, Any]] = ... + ) -> None: ... else: def __init__(self, stmt: _stmt = ..., setup: _stmt = ..., timer: _Timer = ...) -> None: ... def print_exc(self, file: Optional[IO[str]] = ...) -> None: ... @@ -22,13 +21,22 @@ class Timer: def autorange(self, callback: Optional[Callable[[int, float], Any]] = ...) -> Tuple[int, float]: ... if sys.version_info >= (3, 5): - def timeit(stmt: _stmt = ..., setup: _stmt = ..., timer: _Timer = ..., - number: int = ..., globals: Optional[Dict[str, Any]] = ...) -> float: ... - def repeat(stmt: _stmt = ..., setup: _stmt = ..., timer: _Timer = ..., - repeat: int = ..., number: int = ..., globals: Optional[Dict[str, Any]] = ...) -> List[float]: ... + def timeit( + stmt: _stmt = ..., setup: _stmt = ..., timer: _Timer = ..., number: int = ..., globals: Optional[Dict[str, Any]] = ... + ) -> float: ... + def repeat( + stmt: _stmt = ..., + setup: _stmt = ..., + timer: _Timer = ..., + repeat: int = ..., + number: int = ..., + globals: Optional[Dict[str, Any]] = ..., + ) -> List[float]: ... + else: - def timeit(stmt: _stmt = ..., setup: _stmt = ..., timer: _Timer = ..., - number: int = ...) -> float: ... - def repeat(stmt: _stmt = ..., setup: _stmt = ..., timer: _Timer = ..., - repeat: int = ..., number: int = ...) -> List[float]: ... + def timeit(stmt: _stmt = ..., setup: _stmt = ..., timer: _Timer = ..., number: int = ...) -> float: ... + def repeat( + stmt: _stmt = ..., setup: _stmt = ..., timer: _Timer = ..., repeat: int = ..., number: int = ... + ) -> List[float]: ... + def main(args: Optional[Sequence[str]]) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/token.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/token.pyi old mode 100755 new mode 100644 index c75f865e..a806a466 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/token.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/token.pyi @@ -58,6 +58,11 @@ if sys.version_info >= (3,): ELLIPSIS: int if sys.version_info >= (3, 5): ATEQUAL: int + if sys.version_info < (3, 7): + # These were removed in Python 3.7 but added back in Python 3.8 + AWAIT: int + ASYNC: int +if sys.version_info >= (3, 8): AWAIT: int ASYNC: int OP: int @@ -69,6 +74,11 @@ if sys.version_info >= (3, 7): COMMENT: int NL: int ENCODING: int +if sys.version_info >= (3, 8): + TYPE_COMMENT: int + TYPE_IGNORE: int + COLONEQUAL: int + EXACT_TOKEN_TYPES: Dict[str, int] def ISTERMINAL(x: int) -> bool: ... def ISNONTERMINAL(x: int) -> bool: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/trace.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/trace.pyi old mode 100755 new mode 100644 index af06d39c..6cdb537b --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/trace.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/trace.pyi @@ -1,29 +1,37 @@ -# Stubs for trace (Python 2 and 3) - -import os -import sys import types -from typing import Any, Callable, Mapping, Optional, Sequence, Text, Tuple, TypeVar, Union +from _typeshed import StrPath +from typing import Any, Callable, Mapping, Optional, Sequence, Tuple, TypeVar, Union -_T = TypeVar('_T') +_T = TypeVar("_T") _localtrace = Callable[[types.FrameType, str, Any], Callable[..., Any]] -if sys.version_info >= (3, 6): - _Path = Union[Text, os.PathLike] -else: - _Path = Text - class CoverageResults: def update(self, other: CoverageResults) -> None: ... - def write_results(self, show_missing: bool = ..., summary: bool = ..., coverdir: Optional[_Path] = ...) -> None: ... - def write_results_file(self, path: _Path, lines: Sequence[str], lnotab: Any, lines_hit: Mapping[int, int], encoding: Optional[str] = ...) -> Tuple[int, int]: ... + def write_results(self, show_missing: bool = ..., summary: bool = ..., coverdir: Optional[StrPath] = ...) -> None: ... + def write_results_file( + self, path: StrPath, lines: Sequence[str], lnotab: Any, lines_hit: Mapping[int, int], encoding: Optional[str] = ... + ) -> Tuple[int, int]: ... class Trace: - def __init__(self, count: int = ..., trace: int = ..., countfuncs: int = ..., countcallers: int = ..., - ignoremods: Sequence[str] = ..., ignoredirs: Sequence[str] = ..., infile: Optional[_Path] = ..., - outfile: Optional[_Path] = ..., timing: bool = ...) -> None: ... + def __init__( + self, + count: int = ..., + trace: int = ..., + countfuncs: int = ..., + countcallers: int = ..., + ignoremods: Sequence[str] = ..., + ignoredirs: Sequence[str] = ..., + infile: Optional[StrPath] = ..., + outfile: Optional[StrPath] = ..., + timing: bool = ..., + ) -> None: ... def run(self, cmd: Union[str, types.CodeType]) -> None: ... - def runctx(self, cmd: Union[str, types.CodeType], globals: Optional[Mapping[str, Any]] = ..., locals: Optional[Mapping[str, Any]] = ...) -> None: ... + def runctx( + self, + cmd: Union[str, types.CodeType], + globals: Optional[Mapping[str, Any]] = ..., + locals: Optional[Mapping[str, Any]] = ..., + ) -> None: ... def runfunc(self, func: Callable[..., _T], *args: Any, **kw: Any) -> _T: ... def file_module_function_of(self, frame: types.FrameType) -> Tuple[str, Optional[str], str]: ... def globaltrace_trackcallers(self, frame: types.FrameType, why: str, arg: Any) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/traceback.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/traceback.pyi old mode 100755 new mode 100644 index e6744007..3972ca87 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/traceback.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/traceback.pyi @@ -1,75 +1,83 @@ -# Stubs for traceback - -from typing import Any, Dict, Generator, IO, Iterator, List, Mapping, Optional, Protocol, Tuple, Type, Iterable -from types import FrameType, TracebackType import sys +from _typeshed import SupportsWrite +from types import FrameType, TracebackType +from typing import IO, Any, Dict, Generator, Iterable, Iterator, List, Mapping, Optional, Tuple, Type _PT = Tuple[str, int, str, Optional[str]] +def print_tb(tb: Optional[TracebackType], limit: Optional[int] = ..., file: Optional[IO[str]] = ...) -> None: ... -def print_tb(tb: Optional[TracebackType], limit: Optional[int] = ..., - file: Optional[IO[str]] = ...) -> None: ... if sys.version_info >= (3,): - def print_exception(etype: Optional[Type[BaseException]], - value: Optional[BaseException], - tb: Optional[TracebackType], limit: Optional[int] = ..., - file: Optional[IO[str]] = ..., - chain: bool = ...) -> None: ... - def print_exc(limit: Optional[int] = ..., file: Optional[IO[str]] = ..., - chain: bool = ...) -> None: ... - def print_last(limit: Optional[int] = ..., file: Optional[IO[str]] = ..., - chain: bool = ...) -> None: ... + def print_exception( + etype: Optional[Type[BaseException]], + value: Optional[BaseException], + tb: Optional[TracebackType], + limit: Optional[int] = ..., + file: Optional[IO[str]] = ..., + chain: bool = ..., + ) -> None: ... + def print_exc(limit: Optional[int] = ..., file: Optional[IO[str]] = ..., chain: bool = ...) -> None: ... + def print_last(limit: Optional[int] = ..., file: Optional[IO[str]] = ..., chain: bool = ...) -> None: ... + else: - def print_exception(etype: Optional[Type[BaseException]], - value: Optional[BaseException], - tb: Optional[TracebackType], limit: Optional[int] = ..., - file: Optional[IO[str]] = ...) -> None: ... - def print_exc(limit: Optional[int] = ..., - file: Optional[IO[str]] = ...) -> None: ... - def print_last(limit: Optional[int] = ..., - file: Optional[IO[str]] = ...) -> None: ... -def print_stack(f: Optional[FrameType] = ..., limit: Optional[int] = ..., - file: Optional[IO[str]] = ...) -> None: ... + def print_exception( + etype: Optional[Type[BaseException]], + value: Optional[BaseException], + tb: Optional[TracebackType], + limit: Optional[int] = ..., + file: Optional[IO[str]] = ..., + ) -> None: ... + def print_exc(limit: Optional[int] = ..., file: Optional[IO[str]] = ...) -> None: ... + def print_last(limit: Optional[int] = ..., file: Optional[IO[str]] = ...) -> None: ... + +def print_stack(f: Optional[FrameType] = ..., limit: Optional[int] = ..., file: Optional[IO[str]] = ...) -> None: ... if sys.version_info >= (3, 5): def extract_tb(tb: Optional[TracebackType], limit: Optional[int] = ...) -> StackSummary: ... - def extract_stack(f: Optional[FrameType] = ..., - limit: Optional[int] = ...) -> StackSummary: ... + def extract_stack(f: Optional[FrameType] = ..., limit: Optional[int] = ...) -> StackSummary: ... def format_list(extracted_list: List[FrameSummary]) -> List[str]: ... - class _Writer(Protocol): - def write(self, s: str) -> Any: ... # undocumented - def print_list(extracted_list: List[FrameSummary], file: Optional[_Writer] = ...) -> None: ... + def print_list(extracted_list: List[FrameSummary], file: Optional[SupportsWrite[str]] = ...) -> None: ... + else: def extract_tb(tb: Optional[TracebackType], limit: Optional[int] = ...) -> List[_PT]: ... - def extract_stack(f: Optional[FrameType] = ..., - limit: Optional[int] = ...) -> List[_PT]: ... + def extract_stack(f: Optional[FrameType] = ..., limit: Optional[int] = ...) -> List[_PT]: ... def format_list(extracted_list: List[_PT]) -> List[str]: ... -def format_exception_only(etype: Optional[Type[BaseException]], - value: Optional[BaseException]) -> List[str]: ... + +def format_exception_only(etype: Optional[Type[BaseException]], value: Optional[BaseException]) -> List[str]: ... + if sys.version_info >= (3,): - def format_exception(etype: Optional[Type[BaseException]], value: Optional[BaseException], - tb: Optional[TracebackType], limit: Optional[int] = ..., - chain: bool = ...) -> List[str]: ... + def format_exception( + etype: Optional[Type[BaseException]], + value: Optional[BaseException], + tb: Optional[TracebackType], + limit: Optional[int] = ..., + chain: bool = ..., + ) -> List[str]: ... def format_exc(limit: Optional[int] = ..., chain: bool = ...) -> str: ... + else: - def format_exception(etype: Optional[Type[BaseException]], - value: Optional[BaseException], - tb: Optional[TracebackType], - limit: Optional[int] = ...) -> List[str]: ... + def format_exception( + etype: Optional[Type[BaseException]], + value: Optional[BaseException], + tb: Optional[TracebackType], + limit: Optional[int] = ..., + ) -> List[str]: ... def format_exc(limit: Optional[int] = ...) -> str: ... + def format_tb(tb: Optional[TracebackType], limit: Optional[int] = ...) -> List[str]: ... -def format_stack(f: Optional[FrameType] = ..., - limit: Optional[int] = ...) -> List[str]: ... +def format_stack(f: Optional[FrameType] = ..., limit: Optional[int] = ...) -> List[str]: ... + if sys.version_info >= (3, 4): def clear_frames(tb: TracebackType) -> None: ... + if sys.version_info >= (3, 5): def walk_stack(f: Optional[FrameType]) -> Iterator[Tuple[FrameType, int]]: ... def walk_tb(tb: Optional[TracebackType]) -> Iterator[Tuple[FrameType, int]]: ... + if sys.version_info < (3,): def tb_lineno(tb: TracebackType) -> int: ... - if sys.version_info >= (3, 5): class TracebackException: __cause__: TracebackException @@ -82,39 +90,51 @@ if sys.version_info >= (3, 5): text: str offset: int msg: str - def __init__(self, exc_type: Type[BaseException], - exc_value: BaseException, exc_traceback: TracebackType, - *, limit: Optional[int] = ..., lookup_lines: bool = ..., - capture_locals: bool = ...) -> None: ... + def __init__( + self, + exc_type: Type[BaseException], + exc_value: BaseException, + exc_traceback: TracebackType, + *, + limit: Optional[int] = ..., + lookup_lines: bool = ..., + capture_locals: bool = ..., + ) -> None: ... @classmethod - def from_exception(cls, exc: BaseException, - *, limit: Optional[int] = ..., - lookup_lines: bool = ..., - capture_locals: bool = ...) -> TracebackException: ... + def from_exception( + cls, exc: BaseException, *, limit: Optional[int] = ..., lookup_lines: bool = ..., capture_locals: bool = ... + ) -> TracebackException: ... def format(self, *, chain: bool = ...) -> Generator[str, None, None]: ... def format_exception_only(self) -> Generator[str, None, None]: ... - class FrameSummary(Iterable[Any]): filename: str lineno: int name: str line: str locals: Optional[Dict[str, str]] - def __init__(self, filename: str, lineno: int, name: str, - lookup_line: bool = ..., - locals: Optional[Mapping[str, str]] = ..., - line: Optional[str] = ...) -> None: ... + def __init__( + self, + filename: str, + lineno: int, + name: str, + lookup_line: bool = ..., + locals: Optional[Mapping[str, str]] = ..., + line: Optional[str] = ..., + ) -> None: ... # TODO: more precise typing for __getitem__ and __iter__, # for a namedtuple-like view on (filename, lineno, name, str). def __getitem__(self, i: int) -> Any: ... def __iter__(self) -> Iterator[Any]: ... - class StackSummary(List[FrameSummary]): @classmethod - def extract(cls, - frame_gen: Generator[Tuple[FrameType, int], None, None], - *, limit: Optional[int] = ..., lookup_lines: bool = ..., - capture_locals: bool = ...) -> StackSummary: ... + def extract( + cls, + frame_gen: Generator[Tuple[FrameType, int], None, None], + *, + limit: Optional[int] = ..., + lookup_lines: bool = ..., + capture_locals: bool = ..., + ) -> StackSummary: ... @classmethod def from_list(cls, a_list: List[_PT]) -> StackSummary: ... def format(self) -> List[str]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/tty.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/tty.pyi old mode 100755 new mode 100644 index 2bce1eca..c0dc418e --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/tty.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/tty.pyi @@ -1,5 +1,3 @@ -# Stubs for tty (Python 3.6) - from typing import IO, Union _FD = Union[int, IO[str]] diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/turtle.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/turtle.pyi old mode 100755 new mode 100644 index c9d9d90f..eee60182 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/turtle.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/turtle.pyi @@ -1,5 +1,6 @@ -from typing import Tuple, overload, Optional, Union, Dict, Any, Sequence, TypeVar, List, Callable, Text import sys +from typing import Any, Callable, Dict, List, Optional, Sequence, Text, Tuple, TypeVar, Union, overload + if sys.version_info >= (3,): from tkinter import Canvas, PhotoImage else: @@ -34,7 +35,14 @@ class TurtleScreenBase(object): if sys.version_info >= (3,): def mainloop(self) -> None: ... def textinput(self, title: str, prompt: str) -> Optional[str]: ... - def numinput(self, title: str, prompt: str, default: Optional[float] = ..., minval: Optional[float] = ..., maxval: Optional[float] = ...) -> Optional[float]: ... + def numinput( + self, + title: str, + prompt: str, + default: Optional[float] = ..., + minval: Optional[float] = ..., + maxval: Optional[float] = ..., + ) -> Optional[float]: ... class Terminator(Exception): ... class TurtleGraphicsError(Exception): ... @@ -47,13 +55,13 @@ class TurtleScreen(TurtleScreenBase): def __init__(self, cv: Canvas, mode: str = ..., colormode: float = ..., delay: int = ...) -> None: ... def clear(self) -> None: ... @overload - def mode(self) -> str: ... + def mode(self, mode: None = ...) -> str: ... @overload def mode(self, mode: str) -> None: ... def setworldcoordinates(self, llx: float, lly: float, urx: float, ury: float) -> None: ... def register_shape(self, name: str, shape: Union[_PolygonCoords, Shape, None] = ...) -> None: ... @overload - def colormode(self) -> float: ... + def colormode(self, cmode: None = ...) -> float: ... @overload def colormode(self, cmode: float) -> None: ... def reset(self) -> None: ... @@ -65,11 +73,11 @@ class TurtleScreen(TurtleScreenBase): @overload def bgcolor(self, r: float, g: float, b: float) -> None: ... @overload - def tracer(self) -> int: ... + def tracer(self, n: None = ...) -> int: ... @overload def tracer(self, n: int, delay: Optional[int] = ...) -> None: ... @overload - def delay(self) -> int: ... + def delay(self, delay: None = ...) -> int: ... @overload def delay(self, delay: int) -> None: ... def update(self) -> None: ... @@ -82,11 +90,12 @@ class TurtleScreen(TurtleScreenBase): def listen(self, xdummy: Optional[float] = ..., ydummy: Optional[float] = ...) -> None: ... def ontimer(self, fun: Callable[[], Any], t: int = ...) -> None: ... @overload - def bgpic(self) -> str: ... + def bgpic(self, picname: None = ...) -> str: ... @overload def bgpic(self, picname: str) -> None: ... @overload - def screensize(self) -> Tuple[int, int]: ... + def screensize(self, canvwidth: None = ..., canvheight: None = ..., bg: None = ...) -> Tuple[int, int]: ... + # Looks like if self.cv is not a ScrolledCanvas, this could return a tuple as well @overload def screensize(self, canvwidth: int, canvheight: int, bg: Optional[_Color] = ...) -> None: ... onscreenclick = onclick @@ -114,18 +123,18 @@ class TNavigator(object): def xcor(self) -> float: ... def ycor(self) -> float: ... @overload - def goto(self, x: Tuple[float, float]) -> None: ... + def goto(self, x: Tuple[float, float], y: None = ...) -> None: ... @overload def goto(self, x: float, y: float) -> None: ... def home(self) -> None: ... def setx(self, x: float) -> None: ... def sety(self, y: float) -> None: ... @overload - def distance(self, x: Union[TNavigator, Tuple[float, float]]) -> float: ... + def distance(self, x: Union[TNavigator, Tuple[float, float]], y: None = ...) -> float: ... @overload def distance(self, x: float, y: float) -> float: ... @overload - def towards(self, x: Union[TNavigator, Tuple[float, float]]) -> float: ... + def towards(self, x: Union[TNavigator, Tuple[float, float]], y: None = ...) -> float: ... @overload def towards(self, x: float, y: float) -> float: ... def heading(self) -> float: ... @@ -141,22 +150,21 @@ class TNavigator(object): setposition = goto seth = setheading - class TPen(object): def __init__(self, resizemode: str = ...) -> None: ... @overload - def resizemode(self) -> str: ... + def resizemode(self, rmode: None = ...) -> str: ... @overload def resizemode(self, rmode: str) -> None: ... @overload - def pensize(self) -> int: ... + def pensize(self, width: None = ...) -> int: ... @overload def pensize(self, width: int) -> None: ... def penup(self) -> None: ... def pendown(self) -> None: ... def isdown(self) -> bool: ... @overload - def speed(self) -> int: ... + def speed(self, speed: None = ...) -> int: ... @overload def speed(self, speed: _Speed) -> None: ... @overload @@ -186,10 +194,21 @@ class TPen(object): @overload def pen(self) -> _PenState: ... # type: ignore @overload - def pen(self, pen: Optional[_PenState] = ..., *, - shown: bool = ..., pendown: bool = ..., pencolor: _Color = ..., fillcolor: _Color = ..., - pensize: int = ..., speed: int = ..., resizemode: str = ..., stretchfactor: Tuple[float, float] = ..., - outline: int = ..., tilt: float = ...) -> None: ... + def pen( + self, + pen: Optional[_PenState] = ..., + *, + shown: bool = ..., + pendown: bool = ..., + pencolor: _Color = ..., + fillcolor: _Color = ..., + pensize: int = ..., + speed: int = ..., + resizemode: str = ..., + stretchfactor: Tuple[float, float] = ..., + outline: int = ..., + tilt: float = ..., + ) -> None: ... width = pensize up = penup pu = penup @@ -198,38 +217,44 @@ class TPen(object): st = showturtle ht = hideturtle -_T = TypeVar('_T') +_T = TypeVar("_T") class RawTurtle(TPen, TNavigator): - def __init__(self, canvas: Union[Canvas, TurtleScreen, None] = ..., shape: str = ..., undobuffersize: int = ..., visible: bool = ...) -> None: ... + def __init__( + self, canvas: Union[Canvas, TurtleScreen, None] = ..., shape: str = ..., undobuffersize: int = ..., visible: bool = ... + ) -> None: ... def reset(self) -> None: ... def setundobuffer(self, size: Optional[int]) -> None: ... def undobufferentries(self) -> int: ... def clear(self) -> None: ... def clone(self: _T) -> _T: ... @overload - def shape(self) -> str: ... + def shape(self, name: None = ...) -> str: ... @overload def shape(self, name: str) -> None: ... # Unsafely overlaps when no arguments are provided @overload def shapesize(self) -> Tuple[float, float, float]: ... # type: ignore @overload - def shapesize(self, stretch_wid: Optional[float] = ..., stretch_len: Optional[float] = ..., outline: Optional[float] = ...) -> None: ... + def shapesize( + self, stretch_wid: Optional[float] = ..., stretch_len: Optional[float] = ..., outline: Optional[float] = ... + ) -> None: ... if sys.version_info >= (3,): @overload - def shearfactor(self) -> float: ... + def shearfactor(self, shear: None = ...) -> float: ... @overload def shearfactor(self, shear: float) -> None: ... # Unsafely overlaps when no arguments are provided @overload def shapetransform(self) -> Tuple[float, float, float, float]: ... # type: ignore @overload - def shapetransform(self, t11: Optional[float] = ..., t12: Optional[float] = ..., t21: Optional[float] = ..., t22: Optional[float] = ...) -> None: ... + def shapetransform( + self, t11: Optional[float] = ..., t12: Optional[float] = ..., t21: Optional[float] = ..., t22: Optional[float] = ... + ) -> None: ... def get_shapepoly(self) -> Optional[_PolygonCoords]: ... def settiltangle(self, angle: float) -> None: ... @overload - def tiltangle(self) -> float: ... + def tiltangle(self, angle: None = ...) -> float: ... @overload def tiltangle(self, angle: float) -> None: ... def tilt(self, angle: float) -> None: ... @@ -258,7 +283,14 @@ class RawTurtle(TPen, TNavigator): class _Screen(TurtleScreen): def __init__(self) -> None: ... - def setup(self, width: int = ..., height: int = ..., startx: int = ..., starty: int = ...) -> None: ... + # Note int and float are interpreted differently, hence the Union instead of just float + def setup( + self, + width: Union[int, float] = ..., + height: Union[int, float] = ..., + startx: Optional[int] = ..., + starty: Optional[int] = ..., + ) -> None: ... def title(self, titlestring: str) -> None: ... def bye(self) -> None: ... def exitonclick(self) -> None: ... @@ -271,7 +303,7 @@ class Turtle(RawTurtle): RawPen = RawTurtle Pen = Turtle -def write_docstringdict(filename: str) -> None: ... +def write_docstringdict(filename: str = ...) -> None: ... # Note: it's somewhat unfortunate that we have to copy the function signatures. # It would be nice if we could partially reduce the redundancy by doing something @@ -287,21 +319,24 @@ def write_docstringdict(filename: str) -> None: ... # Note: mainloop() was always present in the global scope, but was added to # TurtleScreenBase in Python 3.0 def mainloop() -> None: ... + if sys.version_info >= (3,): def textinput(title: str, prompt: str) -> Optional[str]: ... - def numinput(title: str, prompt: str, default: Optional[float] = ..., minval: Optional[float] = ..., maxval: Optional[float] = ...) -> Optional[float]: ... + def numinput( + title: str, prompt: str, default: Optional[float] = ..., minval: Optional[float] = ..., maxval: Optional[float] = ... + ) -> Optional[float]: ... # Functions copied from TurtleScreen: def clear() -> None: ... @overload -def mode() -> str: ... +def mode(mode: None = ...) -> str: ... @overload def mode(mode: str) -> None: ... def setworldcoordinates(llx: float, lly: float, urx: float, ury: float) -> None: ... def register_shape(name: str, shape: Union[_PolygonCoords, Shape, None] = ...) -> None: ... @overload -def colormode() -> float: ... +def colormode(cmode: None = ...) -> float: ... @overload def colormode(cmode: float) -> None: ... def reset() -> None: ... @@ -313,11 +348,11 @@ def bgcolor(color: _Color) -> None: ... @overload def bgcolor(r: float, g: float, b: float) -> None: ... @overload -def tracer() -> int: ... +def tracer(n: None = ...) -> int: ... @overload def tracer(n: int, delay: Optional[int] = ...) -> None: ... @overload -def delay() -> int: ... +def delay(delay: None = ...) -> int: ... @overload def delay(delay: int) -> None: ... def update() -> None: ... @@ -330,13 +365,14 @@ def onkey(fun: Callable[[], Any], key: str) -> None: ... def listen(xdummy: Optional[float] = ..., ydummy: Optional[float] = ...) -> None: ... def ontimer(fun: Callable[[], Any], t: int = ...) -> None: ... @overload -def bgpic() -> str: ... +def bgpic(picname: None = ...) -> str: ... @overload def bgpic(picname: str) -> None: ... @overload -def screensize() -> Tuple[int, int]: ... +def screensize(canvwidth: None = ..., canvheight: None = ..., bg: None = ...) -> Tuple[int, int]: ... @overload def screensize(canvwidth: int, canvheight: int, bg: Optional[_Color] = ...) -> None: ... + onscreenclick = onclick resetscreen = reset clearscreen = clear @@ -357,23 +393,24 @@ def pos() -> Vec2D: ... def xcor() -> float: ... def ycor() -> float: ... @overload -def goto(x: Tuple[float, float]) -> None: ... +def goto(x: Tuple[float, float], y: None = ...) -> None: ... @overload def goto(x: float, y: float) -> None: ... def home() -> None: ... def setx(x: float) -> None: ... def sety(y: float) -> None: ... @overload -def distance(x: Union[TNavigator, Tuple[float, float]]) -> float: ... +def distance(x: Union[TNavigator, Tuple[float, float]], y: None = ...) -> float: ... @overload def distance(x: float, y: float) -> float: ... @overload -def towards(x: Union[TNavigator, Tuple[float, float]]) -> float: ... +def towards(x: Union[TNavigator, Tuple[float, float]], y: None = ...) -> float: ... @overload def towards(x: float, y: float) -> float: ... def heading() -> float: ... def setheading(to_angle: float) -> None: ... def circle(radius: float, extent: Optional[float] = ..., steps: Optional[int] = ...) -> None: ... + fd = forward bk = back backward = back @@ -385,20 +422,19 @@ setposition = goto seth = setheading # Functions copied from TPen: - @overload -def resizemode() -> str: ... +def resizemode(rmode: None = ...) -> str: ... @overload def resizemode(rmode: str) -> None: ... @overload -def pensize() -> int: ... +def pensize(width: None = ...) -> int: ... @overload def pensize(width: int) -> None: ... def penup() -> None: ... def pendown() -> None: ... def isdown() -> bool: ... @overload -def speed() -> int: ... +def speed(speed: None = ...) -> int: ... @overload def speed(speed: _Speed) -> None: ... @overload @@ -424,14 +460,26 @@ def color(color1: _Color, color2: _Color) -> None: ... def showturtle() -> None: ... def hideturtle() -> None: ... def isvisible() -> bool: ... + # Note: signatures 1 and 2 overlap unsafely when no arguments are provided @overload def pen() -> _PenState: ... # type: ignore @overload -def pen(pen: Optional[_PenState] = ..., *, - shown: bool = ..., pendown: bool = ..., pencolor: _Color = ..., fillcolor: _Color = ..., - pensize: int = ..., speed: int = ..., resizemode: str = ..., stretchfactor: Tuple[float, float] = ..., - outline: int = ..., tilt: float = ...) -> None: ... +def pen( + pen: Optional[_PenState] = ..., + *, + shown: bool = ..., + pendown: bool = ..., + pencolor: _Color = ..., + fillcolor: _Color = ..., + pensize: int = ..., + speed: int = ..., + resizemode: str = ..., + stretchfactor: Tuple[float, float] = ..., + outline: int = ..., + tilt: float = ..., +) -> None: ... + width = pensize up = penup pu = penup @@ -445,31 +493,37 @@ ht = hideturtle def setundobuffer(size: Optional[int]) -> None: ... def undobufferentries() -> int: ... @overload -def shape() -> str: ... +def shape(name: None = ...) -> str: ... @overload def shape(name: str) -> None: ... + # Unsafely overlaps when no arguments are provided @overload def shapesize() -> Tuple[float, float, float]: ... # type: ignore @overload def shapesize(stretch_wid: Optional[float] = ..., stretch_len: Optional[float] = ..., outline: Optional[float] = ...) -> None: ... + if sys.version_info >= (3,): @overload - def shearfactor() -> float: ... + def shearfactor(shear: None = ...) -> float: ... @overload def shearfactor(shear: float) -> None: ... # Unsafely overlaps when no arguments are provided @overload def shapetransform() -> Tuple[float, float, float, float]: ... # type: ignore @overload - def shapetransform(t11: Optional[float] = ..., t12: Optional[float] = ..., t21: Optional[float] = ..., t22: Optional[float] = ...) -> None: ... + def shapetransform( + t11: Optional[float] = ..., t12: Optional[float] = ..., t21: Optional[float] = ..., t22: Optional[float] = ... + ) -> None: ... def get_shapepoly() -> Optional[_PolygonCoords]: ... + def settiltangle(angle: float) -> None: ... @overload -def tiltangle() -> float: ... +def tiltangle(angle: None = ...) -> float: ... @overload def tiltangle(angle: float) -> None: ... def tilt(angle: float) -> None: ... + # Can return either 'int' or Tuple[int, ...] based on if the stamp is # a compound stamp or not. So, as per the "no Union return" policy, # we return Any. @@ -486,10 +540,13 @@ def end_poly() -> None: ... def get_poly() -> Optional[_PolygonCoords]: ... def getscreen() -> TurtleScreen: ... def getturtle() -> Turtle: ... + getpen = getturtle + def onrelease(fun: Callable[[float, float], Any], btn: int = ..., add: Optional[Any] = ...) -> None: ... def ondrag(fun: Callable[[float, float], Any], btn: int = ..., add: Optional[Any] = ...) -> None: ... def undo() -> None: ... + turtlesize = shapesize # Functions copied from RawTurtle with a few tweaks: diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/unicodedata.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/unicodedata.pyi old mode 100755 new mode 100644 index ddd10136..1aa9ffb9 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/unicodedata.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/unicodedata.pyi @@ -5,7 +5,7 @@ ucd_3_2_0: UCD ucnhash_CAPI: Any unidata_version: str -_default = TypeVar('_default') +_default = TypeVar("_default") def bidirectional(__chr: Text) -> Text: ... def category(__chr: Text) -> Text: ... @@ -14,8 +14,10 @@ def decimal(__chr: Text, __default: _default = ...) -> Union[int, _default]: ... def decomposition(__chr: Text) -> Text: ... def digit(__chr: Text, __default: _default = ...) -> Union[int, _default]: ... def east_asian_width(__chr: Text) -> Text: ... + if sys.version_info >= (3, 8): def is_normalized(__form: str, __unistr: str) -> bool: ... + def lookup(__name: Union[Text, bytes]) -> Text: ... def mirrored(__chr: Text) -> int: ... def name(__chr: Text, __default: _default = ...) -> Union[Text, _default]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/uu.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/uu.pyi old mode 100755 new mode 100644 index c926dbba..2bb2c2a1 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/uu.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/uu.pyi @@ -1,13 +1,16 @@ -# Stubs for uu (Python 2 and 3) import sys -from typing import BinaryIO, Union, Optional, Text +from typing import BinaryIO, Optional, Text, Union _File = Union[Text, BinaryIO] class Error(Exception): ... if sys.version_info >= (3, 7): - def encode(in_file: _File, out_file: _File, name: Optional[str] = ..., mode: Optional[int] = ..., backtick: bool = ...) -> None: ... + def encode( + in_file: _File, out_file: _File, name: Optional[str] = ..., mode: Optional[int] = ..., *, backtick: bool = ... + ) -> None: ... + else: def encode(in_file: _File, out_file: _File, name: Optional[str] = ..., mode: Optional[int] = ...) -> None: ... + def decode(in_file: _File, out_file: Optional[_File] = ..., mode: Optional[int] = ..., quiet: int = ...) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/uuid.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/uuid.pyi old mode 100755 new mode 100644 index 9c009d92..68b23516 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/uuid.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/uuid.pyi @@ -1,20 +1,43 @@ -# Stubs for uuid - import sys -from typing import Tuple, Optional, Any, Text +from typing import Any, Optional, Text, Tuple # Because UUID has properties called int and bytes we need to rename these temporarily. _Int = int _Bytes = bytes _FieldsType = Tuple[int, int, int, int, int, int] +if sys.version_info >= (3, 7): + from enum import Enum + class SafeUUID(Enum): + safe: int + unsafe: int + unknown: None + class UUID: - def __init__(self, hex: Optional[Text] = ..., - bytes: Optional[_Bytes] = ..., - bytes_le: Optional[_Bytes] = ..., - fields: Optional[_FieldsType] = ..., - int: Optional[_Int] = ..., - version: Optional[_Int] = ...) -> None: ... + if sys.version_info >= (3, 7): + def __init__( + self, + hex: Optional[Text] = ..., + bytes: Optional[_Bytes] = ..., + bytes_le: Optional[_Bytes] = ..., + fields: Optional[_FieldsType] = ..., + int: Optional[_Int] = ..., + version: Optional[_Int] = ..., + *, + is_safe: SafeUUID = ..., + ) -> None: ... + @property + def is_safe(self) -> SafeUUID: ... + else: + def __init__( + self, + hex: Optional[Text] = ..., + bytes: Optional[_Bytes] = ..., + bytes_le: Optional[_Bytes] = ..., + fields: Optional[_FieldsType] = ..., + int: Optional[_Int] = ..., + version: Optional[_Int] = ..., + ) -> None: ... @property def bytes(self) -> _Bytes: ... @property @@ -47,9 +70,7 @@ class UUID: def variant(self) -> str: ... @property def version(self) -> Optional[_Int]: ... - def __int__(self) -> _Int: ... - if sys.version_info >= (3,): def __eq__(self, other: Any) -> bool: ... def __lt__(self, other: Any) -> bool: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/warnings.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/warnings.pyi old mode 100755 new mode 100644 index 71be4895..0e64ec57 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/warnings.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/warnings.pyi @@ -1,26 +1,58 @@ -from typing import List, NamedTuple, Optional, overload, TextIO, Type +import sys from types import ModuleType, TracebackType +from typing import Any, List, Optional, TextIO, Type, Union, overload from typing_extensions import Literal from _warnings import warn as warn, warn_explicit as warn_explicit def showwarning( - message: str, category: Type[Warning], filename: str, lineno: int, file: Optional[TextIO] = ..., line: Optional[str] = ... + message: Union[Warning, str], + category: Type[Warning], + filename: str, + lineno: int, + file: Optional[TextIO] = ..., + line: Optional[str] = ..., ) -> None: ... -def formatwarning(message: str, category: Type[Warning], filename: str, lineno: int, line: Optional[str] = ...) -> str: ... +def formatwarning( + message: Union[Warning, str], category: Type[Warning], filename: str, lineno: int, line: Optional[str] = ... +) -> str: ... def filterwarnings( action: str, message: str = ..., category: Type[Warning] = ..., module: str = ..., lineno: int = ..., append: bool = ... ) -> None: ... def simplefilter(action: str, category: Type[Warning] = ..., lineno: int = ..., append: bool = ...) -> None: ... def resetwarnings() -> None: ... -class _Record(NamedTuple): - message: str +class _OptionError(Exception): ... + +class WarningMessage: + message: Union[Warning, str] category: Type[Warning] filename: str lineno: int file: Optional[TextIO] line: Optional[str] + if sys.version_info >= (3, 6): + source: Optional[Any] + def __init__( + self, + message: Union[Warning, str], + category: Type[Warning], + filename: str, + lineno: int, + file: Optional[TextIO] = ..., + line: Optional[str] = ..., + source: Optional[Any] = ..., + ) -> None: ... + else: + def __init__( + self, + message: Union[Warning, str], + category: Type[Warning], + filename: str, + lineno: int, + file: Optional[TextIO] = ..., + line: Optional[str] = ..., + ) -> None: ... class catch_warnings: @overload @@ -29,7 +61,7 @@ class catch_warnings: def __new__(cls, *, record: Literal[True], module: Optional[ModuleType] = ...) -> _catch_warnings_with_records: ... @overload def __new__(cls, *, record: bool, module: Optional[ModuleType] = ...) -> catch_warnings: ... - def __enter__(self) -> Optional[List[_Record]]: ... + def __enter__(self) -> Optional[List[WarningMessage]]: ... def __exit__( self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType] ) -> None: ... @@ -38,4 +70,4 @@ class _catch_warnings_without_records(catch_warnings): def __enter__(self) -> None: ... class _catch_warnings_with_records(catch_warnings): - def __enter__(self) -> List[_Record]: ... + def __enter__(self) -> List[WarningMessage]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/wave.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/wave.pyi old mode 100755 new mode 100644 index 52bc9b15..c89ba628 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/wave.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/wave.pyi @@ -1,11 +1,7 @@ -# Stubs for wave (Python 2 and 3) - import sys -from typing import ( - Any, NamedTuple, NoReturn, Optional, Text, BinaryIO, Union, Tuple -) +from typing import IO, Any, BinaryIO, NamedTuple, NoReturn, Optional, Text, Tuple, Union -_File = Union[Text, BinaryIO] +_File = Union[Text, IO[bytes]] class Error(Exception): ... @@ -72,4 +68,6 @@ class Wave_write: # Returns a Wave_read if mode is rb and Wave_write if mode is wb def open(f: _File, mode: Optional[str] = ...) -> Any: ... -openfp = open + +if sys.version_info < (3, 9): + openfp = open diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/weakref.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/weakref.pyi old mode 100755 new mode 100644 index e3ddbf27..9dc72338 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/weakref.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/weakref.pyi @@ -1,27 +1,41 @@ import sys import types +from _weakrefset import WeakSet as WeakSet from typing import ( - TypeVar, Generic, Any, Callable, overload, Mapping, Iterator, Tuple, - Iterable, Optional, Type, MutableMapping, Union, List, Dict + Any, + Callable, + Dict, + Generic, + Iterable, + Iterator, + List, + Mapping, + MutableMapping, + Optional, + Tuple, + Type, + TypeVar, + Union, + overload, ) from _weakref import ( + CallableProxyType as CallableProxyType, + ProxyType as ProxyType, + ReferenceType as ReferenceType, getweakrefcount as getweakrefcount, getweakrefs as getweakrefs, - ref as ref, proxy as proxy, - CallableProxyType as CallableProxyType, - ProxyType as ProxyType, - ReferenceType as ReferenceType) -from _weakrefset import WeakSet as WeakSet + ref as ref, +) if sys.version_info < (3, 0): from exceptions import ReferenceError as ReferenceError -_S = TypeVar('_S') -_T = TypeVar('_T') -_KT = TypeVar('_KT') -_VT = TypeVar('_VT') +_S = TypeVar("_S") +_T = TypeVar("_T") +_KT = TypeVar("_KT") +_VT = TypeVar("_VT") ProxyTypes: Tuple[Type[Any], ...] @@ -34,8 +48,7 @@ class WeakValueDictionary(MutableMapping[_KT, _VT]): @overload def __init__(self) -> None: ... @overload - def __init__(self, __map: Union[Mapping[_KT, _VT], Iterable[Tuple[_KT, _VT]]], **kwargs: _VT) -> None: ... - + def __init__(self, __other: Union[Mapping[_KT, _VT], Iterable[Tuple[_KT, _VT]]], **kwargs: _VT) -> None: ... def __len__(self) -> int: ... def __getitem__(self, k: _KT) -> _VT: ... def __setitem__(self, k: _KT, v: _VT) -> None: ... @@ -45,9 +58,7 @@ class WeakValueDictionary(MutableMapping[_KT, _VT]): def __contains__(self, o: object) -> bool: ... def __iter__(self) -> Iterator[_KT]: ... def __str__(self) -> str: ... - def copy(self) -> WeakValueDictionary[_KT, _VT]: ... - if sys.version_info < (3, 0): def keys(self) -> List[_KT]: ... def values(self) -> List[_VT]: ... @@ -65,14 +76,14 @@ class WeakValueDictionary(MutableMapping[_KT, _VT]): class KeyedRef(ref[_T], Generic[_KT, _T]): key: _KT + def __new__(type, ob: _T, callback: Callable[[_T], Any], key: _KT) -> KeyedRef: ... def __init__(self, ob: _T, callback: Callable[[_T], Any], key: _KT) -> None: ... class WeakKeyDictionary(MutableMapping[_KT, _VT]): @overload - def __init__(self) -> None: ... + def __init__(self, dict: None = ...) -> None: ... @overload - def __init__(self, __map: Union[Mapping[_KT, _VT], Iterable[Tuple[_KT, _VT]]], **kwargs: _VT) -> None: ... - + def __init__(self, dict: Union[Mapping[_KT, _VT], Iterable[Tuple[_KT, _VT]]]) -> None: ... def __len__(self) -> int: ... def __getitem__(self, k: _KT) -> _VT: ... def __setitem__(self, k: _KT, v: _VT) -> None: ... @@ -82,9 +93,7 @@ class WeakKeyDictionary(MutableMapping[_KT, _VT]): def __contains__(self, o: object) -> bool: ... def __iter__(self) -> Iterator[_KT]: ... def __str__(self) -> str: ... - def copy(self) -> WeakKeyDictionary[_KT, _VT]: ... - if sys.version_info < (3, 0): def keys(self) -> List[_KT]: ... def values(self) -> List[_VT]: ... @@ -102,7 +111,7 @@ class WeakKeyDictionary(MutableMapping[_KT, _VT]): if sys.version_info >= (3, 4): class finalize: - def __init__(self, obj: _S, func: Callable[..., _T], *args: Any, **kwargs: Any) -> None: ... + def __init__(self, __obj: _S, __func: Callable[..., _T], *args: Any, **kwargs: Any) -> None: ... def __call__(self, _: Any = ...) -> Optional[_T]: ... def detach(self) -> Optional[Tuple[_S, _T, Tuple[Any, ...], Dict[str, Any]]]: ... def peek(self) -> Optional[Tuple[_S, _T, Tuple[Any, ...], Dict[str, Any]]]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/webbrowser.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/webbrowser.pyi old mode 100755 new mode 100644 index 11103757..e29238ee --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/webbrowser.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/webbrowser.pyi @@ -1,12 +1,18 @@ import sys -from typing import Any, Optional, Callable, List, Text, Union, Sequence +from typing import Callable, List, Optional, Sequence, Text, Union class Error(Exception): ... if sys.version_info >= (3, 7): - def register(name: Text, klass: Optional[Callable[[], BaseBrowser]], instance: BaseBrowser = ..., *, preferred: bool = ...) -> None: ... + def register( + name: Text, klass: Optional[Callable[[], BaseBrowser]], instance: Optional[BaseBrowser] = ..., *, preferred: bool = ... + ) -> None: ... + else: - def register(name: Text, klass: Optional[Callable[[], BaseBrowser]], instance: BaseBrowser = ..., update_tryorder: int = ...) -> None: ... + def register( + name: Text, klass: Optional[Callable[[], BaseBrowser]], instance: Optional[BaseBrowser] = ..., update_tryorder: int = ... + ) -> None: ... + def get(using: Optional[Text] = ...) -> BaseBrowser: ... def open(url: Text, new: int = ..., autoraise: bool = ...) -> bool: ... def open_new(url: Text) -> bool: ... @@ -85,14 +91,15 @@ class Konqueror(BaseBrowser): class Grail(BaseBrowser): def open(self, url: Text, new: int = ..., autoraise: bool = ...) -> bool: ... -class WindowsDefault(BaseBrowser): - def open(self, url: Text, new: int = ..., autoraise: bool = ...) -> bool: ... - -class MacOSX(BaseBrowser): - name: str - def __init__(self, name: Text) -> None: ... - def open(self, url: Text, new: int = ..., autoraise: bool = ...) -> bool: ... - -class MacOSXOSAScript(BaseBrowser): - def __init__(self, name: Text) -> None: ... - def open(self, url: Text, new: int = ..., autoraise: bool = ...) -> bool: ... +if sys.platform == "win32": + class WindowsDefault(BaseBrowser): + def open(self, url: Text, new: int = ..., autoraise: bool = ...) -> bool: ... + +if sys.platform == "darwin": + class MacOSX(BaseBrowser): + name: str + def __init__(self, name: Text) -> None: ... + def open(self, url: Text, new: int = ..., autoraise: bool = ...) -> bool: ... + class MacOSXOSAScript(BaseBrowser): + def __init__(self, name: Text) -> None: ... + def open(self, url: Text, new: int = ..., autoraise: bool = ...) -> bool: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/winsound.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/winsound.pyi new file mode 100644 index 00000000..be9a8c66 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/winsound.pyi @@ -0,0 +1,27 @@ +import sys +from typing import Optional, Union, overload +from typing_extensions import Literal + +if sys.platform == "win32": + SND_FILENAME: int + SND_ALIAS: int + SND_LOOP: int + SND_MEMORY: int + SND_PURGE: int + SND_ASYNC: int + SND_NODEFAULT: int + SND_NOSTOP: int + SND_NOWAIT: int + + MB_ICONASTERISK: int + MB_ICONEXCLAMATION: int + MB_ICONHAND: int + MB_ICONQUESTION: int + MB_OK: int + def Beep(frequency: int, duration: int) -> None: ... + # Can actually accept anything ORed with 4, and if not it's definitely str, but that's inexpressible + @overload + def PlaySound(sound: Optional[bytes], flags: Literal[4]) -> None: ... + @overload + def PlaySound(sound: Optional[Union[str, bytes]], flags: int) -> None: ... + def MessageBeep(type: int = ...) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/wsgiref/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/wsgiref/__init__.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/wsgiref/handlers.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/wsgiref/handlers.pyi old mode 100755 new mode 100644 index 3271c881..ff764e43 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/wsgiref/handlers.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/wsgiref/handlers.pyi @@ -1,17 +1,16 @@ import sys from abc import abstractmethod from types import TracebackType -from typing import Optional, Dict, MutableMapping, Type, Text, Callable, List, Tuple, IO +from typing import IO, Callable, Dict, List, MutableMapping, Optional, Text, Tuple, Type from .headers import Headers -from .types import WSGIApplication, WSGIEnvironment, StartResponse, InputStream, ErrorStream -from .util import FileWrapper, guess_scheme +from .types import ErrorStream, InputStream, StartResponse, WSGIApplication, WSGIEnvironment +from .util import FileWrapper -_exc_info = Tuple[Optional[Type[BaseException]], - Optional[BaseException], - Optional[TracebackType]] +_exc_info = Tuple[Optional[Type[BaseException]], Optional[BaseException], Optional[TracebackType]] def format_date_time(timestamp: Optional[float]) -> str: ... # undocumented + if sys.version_info >= (3, 2): def read_environ() -> Dict[str, str]: ... @@ -34,15 +33,15 @@ class BaseHandler: error_status: str error_headers: List[Tuple[Text, Text]] error_body: bytes - def run(self, application: WSGIApplication) -> None: ... - def setup_environ(self) -> None: ... def finish_response(self) -> None: ... def get_scheme(self) -> str: ... def set_content_length(self) -> None: ... def cleanup_headers(self) -> None: ... - def start_response(self, status: Text, headers: List[Tuple[Text, Text]], exc_info: Optional[_exc_info] = ...) -> Callable[[bytes], None]: ... + def start_response( + self, status: Text, headers: List[Tuple[Text, Text]], exc_info: Optional[_exc_info] = ... + ) -> Callable[[bytes], None]: ... def send_preamble(self) -> None: ... def write(self, data: bytes) -> None: ... def sendfile(self) -> bool: ... @@ -54,7 +53,6 @@ class BaseHandler: def log_exception(self, exc_info: _exc_info) -> None: ... def handle_error(self) -> None: ... def error_output(self, environ: WSGIEnvironment, start_response: StartResponse) -> List[bytes]: ... - @abstractmethod def _write(self, data: bytes) -> None: ... @abstractmethod @@ -71,7 +69,15 @@ class SimpleHandler(BaseHandler): stdout: IO[bytes] stderr: ErrorStream base_env: MutableMapping[str, str] - def __init__(self, stdin: InputStream, stdout: IO[bytes], stderr: ErrorStream, environ: MutableMapping[str, str], multithread: bool = ..., multiprocess: bool = ...) -> None: ... + def __init__( + self, + stdin: InputStream, + stdout: IO[bytes], + stderr: ErrorStream, + environ: MutableMapping[str, str], + multithread: bool = ..., + multiprocess: bool = ..., + ) -> None: ... def get_stdin(self) -> InputStream: ... def get_stderr(self) -> ErrorStream: ... def add_cgi_vars(self) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/wsgiref/headers.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/wsgiref/headers.pyi old mode 100755 new mode 100644 index 85392252..c3e94320 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/wsgiref/headers.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/wsgiref/headers.pyi @@ -1,5 +1,5 @@ import sys -from typing import overload, Pattern, Optional, List, Tuple +from typing import List, Optional, Pattern, Tuple, overload _HeaderList = List[Tuple[str, str]] diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/wsgiref/simple_server.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/wsgiref/simple_server.pyi old mode 100755 new mode 100644 index 50b8377e..66cd94fa --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/wsgiref/simple_server.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/wsgiref/simple_server.pyi @@ -1,13 +1,13 @@ import sys -from typing import Optional, List, Type, TypeVar, overload +from typing import List, Optional, Type, TypeVar, overload from .handlers import SimpleHandler -from .types import WSGIApplication, WSGIEnvironment, StartResponse, ErrorStream +from .types import ErrorStream, StartResponse, WSGIApplication, WSGIEnvironment if sys.version_info < (3,): from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer else: - from http.server import HTTPServer, BaseHTTPRequestHandler + from http.server import BaseHTTPRequestHandler, HTTPServer server_version: str # undocumented sys_version: str # undocumented @@ -33,8 +33,9 @@ class WSGIRequestHandler(BaseHTTPRequestHandler): def demo_app(environ: WSGIEnvironment, start_response: StartResponse) -> List[bytes]: ... _S = TypeVar("_S", bound=WSGIServer) - @overload def make_server(host: str, port: int, app: WSGIApplication, *, handler_class: Type[WSGIRequestHandler] = ...) -> WSGIServer: ... @overload -def make_server(host: str, port: int, app: WSGIApplication, server_class: Type[_S], handler_class: Type[WSGIRequestHandler] = ...) -> _S: ... +def make_server( + host: str, port: int, app: WSGIApplication, server_class: Type[_S], handler_class: Type[WSGIRequestHandler] = ... +) -> _S: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/wsgiref/types.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/wsgiref/types.pyi old mode 100755 new mode 100644 index 39a913ee..c272ae67 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/wsgiref/types.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/wsgiref/types.pyi @@ -1,44 +1,3 @@ -# Type declaration for a WSGI Function -# -# wsgiref/types.py doesn't exist and neither do the types defined in this -# file. They are provided for type checking purposes. -# -# This means you cannot simply import wsgiref.types in your code. Instead, -# use the `TYPE_CHECKING` flag from the typing module: -# -# from typing import TYPE_CHECKING -# -# if TYPE_CHECKING: -# from wsgiref.types import WSGIApplication -# -# This import is now only taken into account by the type checker. Consequently, -# you need to use 'WSGIApplication' and not simply WSGIApplication when type -# hinting your code. Otherwise Python will raise NameErrors. +# Obsolete, use _typeshed.wsgi directly. -from sys import _OptExcInfo -from typing import Callable, Dict, Iterable, List, Any, Text, Protocol, Tuple, Optional - -class StartResponse(Protocol): - def __call__(self, status: str, headers: List[Tuple[str, str]], exc_info: Optional[_OptExcInfo] = ...) -> Callable[[bytes], Any]: ... - -WSGIEnvironment = Dict[Text, Any] -WSGIApplication = Callable[[WSGIEnvironment, StartResponse], Iterable[bytes]] - -# WSGI input streams per PEP 3333 -class InputStream(Protocol): - def read(self, size: int = ...) -> bytes: ... - def readline(self, size: int = ...) -> bytes: ... - def readlines(self, hint: int = ...) -> List[bytes]: ... - def __iter__(self) -> Iterable[bytes]: ... - -# WSGI error streams per PEP 3333 -class ErrorStream(Protocol): - def flush(self) -> None: ... - def write(self, s: str) -> None: ... - def writelines(self, seq: List[str]) -> None: ... - -class _Readable(Protocol): - def read(self, size: int = ...) -> bytes: ... -# Optional file wrapper in wsgi.file_wrapper -class FileWrapper(Protocol): - def __call__(self, file: _Readable, block_size: int = ...) -> Iterable[bytes]: ... +from _typeshed.wsgi import * diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/wsgiref/util.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/wsgiref/util.pyi old mode 100755 new mode 100644 index 501ddcd5..0382fc28 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/wsgiref/util.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/wsgiref/util.pyi @@ -1,19 +1,19 @@ import sys -from typing import IO, Any, Optional +from typing import IO, Any, Callable, Optional from .types import WSGIEnvironment class FileWrapper: filelike: IO[bytes] blksize: int - def __init__(self, filelike: IO[bytes], bklsize: int = ...) -> None: ... + close: Callable[[], None] # only exists if filelike.close exists + def __init__(self, filelike: IO[bytes], blksize: int = ...) -> None: ... def __getitem__(self, key: Any) -> bytes: ... def __iter__(self) -> FileWrapper: ... if sys.version_info < (3,): def next(self) -> bytes: ... else: def __next__(self) -> bytes: ... - def close(self) -> None: ... # only exists if filelike.close exists def guess_scheme(environ: WSGIEnvironment) -> str: ... def application_uri(environ: WSGIEnvironment) -> str: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/wsgiref/validate.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/wsgiref/validate.pyi old mode 100755 new mode 100644 index c7fa699f..570546e6 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/wsgiref/validate.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/wsgiref/validate.pyi @@ -1,7 +1,6 @@ import sys -from typing import Any, Iterable, Iterator, Optional, NoReturn, Callable - -from wsgiref.types import WSGIApplication, InputStream, ErrorStream +from _typeshed.wsgi import ErrorStream, InputStream, WSGIApplication +from typing import Any, Callable, Iterable, Iterator, NoReturn, Optional class WSGIWarning(Warning): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xdrlib.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xdrlib.pyi old mode 100755 new mode 100644 index 864aced9..378504c3 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xdrlib.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xdrlib.pyi @@ -1,7 +1,6 @@ -# Structs for xdrlib (Python 2 and 3) from typing import Callable, List, Sequence, TypeVar -_T = TypeVar('_T') +_T = TypeVar("_T") class Error(Exception): msg: str diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/__init__.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/dom/NodeFilter.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/dom/NodeFilter.pyi new file mode 100644 index 00000000..80fb73d2 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/dom/NodeFilter.pyi @@ -0,0 +1,19 @@ +class NodeFilter: + FILTER_ACCEPT: int + FILTER_REJECT: int + FILTER_SKIP: int + + SHOW_ALL: int + SHOW_ELEMENT: int + SHOW_ATTRIBUTE: int + SHOW_TEXT: int + SHOW_CDATA_SECTION: int + SHOW_ENTITY_REFERENCE: int + SHOW_ENTITY: int + SHOW_PROCESSING_INSTRUCTION: int + SHOW_COMMENT: int + SHOW_DOCUMENT: int + SHOW_DOCUMENT_TYPE: int + SHOW_DOCUMENT_FRAGMENT: int + SHOW_NOTATION: int + def acceptNode(self, node) -> int: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/dom/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/dom/__init__.pyi new file mode 100644 index 00000000..c5766c32 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/dom/__init__.pyi @@ -0,0 +1,68 @@ +from typing import Any + +from .domreg import getDOMImplementation as getDOMImplementation, registerDOMImplementation as registerDOMImplementation + +class Node: + ELEMENT_NODE: int + ATTRIBUTE_NODE: int + TEXT_NODE: int + CDATA_SECTION_NODE: int + ENTITY_REFERENCE_NODE: int + ENTITY_NODE: int + PROCESSING_INSTRUCTION_NODE: int + COMMENT_NODE: int + DOCUMENT_NODE: int + DOCUMENT_TYPE_NODE: int + DOCUMENT_FRAGMENT_NODE: int + NOTATION_NODE: int + +# ExceptionCode +INDEX_SIZE_ERR: int +DOMSTRING_SIZE_ERR: int +HIERARCHY_REQUEST_ERR: int +WRONG_DOCUMENT_ERR: int +INVALID_CHARACTER_ERR: int +NO_DATA_ALLOWED_ERR: int +NO_MODIFICATION_ALLOWED_ERR: int +NOT_FOUND_ERR: int +NOT_SUPPORTED_ERR: int +INUSE_ATTRIBUTE_ERR: int +INVALID_STATE_ERR: int +SYNTAX_ERR: int +INVALID_MODIFICATION_ERR: int +NAMESPACE_ERR: int +INVALID_ACCESS_ERR: int +VALIDATION_ERR: int + +class DOMException(Exception): + code: int + def __init__(self, *args: Any, **kw: Any) -> None: ... + def _get_code(self) -> int: ... + +class IndexSizeErr(DOMException): ... +class DomstringSizeErr(DOMException): ... +class HierarchyRequestErr(DOMException): ... +class WrongDocumentErr(DOMException): ... +class NoDataAllowedErr(DOMException): ... +class NoModificationAllowedErr(DOMException): ... +class NotFoundErr(DOMException): ... +class NotSupportedErr(DOMException): ... +class InuseAttributeErr(DOMException): ... +class InvalidStateErr(DOMException): ... +class SyntaxErr(DOMException): ... +class InvalidModificationErr(DOMException): ... +class NamespaceErr(DOMException): ... +class InvalidAccessErr(DOMException): ... +class ValidationErr(DOMException): ... + +class UserDataHandler: + NODE_CLONED: int + NODE_IMPORTED: int + NODE_DELETED: int + NODE_RENAMED: int + +XML_NAMESPACE: str +XMLNS_NAMESPACE: str +XHTML_NAMESPACE: str +EMPTY_NAMESPACE: None +EMPTY_PREFIX: None diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/dom/domreg.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/dom/domreg.pyi new file mode 100644 index 00000000..6f479b09 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/dom/domreg.pyi @@ -0,0 +1,10 @@ +from _typeshed.xml import DOMImplementation +from typing import Any, Callable, Dict, Iterable, Optional, Tuple, Union + +well_known_implementations: Dict[str, str] +registered: Dict[str, Callable[[], DOMImplementation]] + +def registerDOMImplementation(name: str, factory: Callable[[], DOMImplementation]) -> None: ... +def getDOMImplementation( + name: Optional[str] = ..., features: Union[str, Iterable[Tuple[str, Optional[str]]]] = ... +) -> DOMImplementation: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/dom/expatbuilder.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/dom/expatbuilder.pyi new file mode 100644 index 00000000..964e6fa3 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/dom/expatbuilder.pyi @@ -0,0 +1,3 @@ +from typing import Any + +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/dom/minicompat.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/dom/minicompat.pyi new file mode 100644 index 00000000..964e6fa3 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/dom/minicompat.pyi @@ -0,0 +1,3 @@ +from typing import Any + +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/dom/minidom.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/dom/minidom.pyi new file mode 100644 index 00000000..cb53e949 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/dom/minidom.pyi @@ -0,0 +1,6 @@ +from typing import Any, Optional +from xml.sax.xmlreader import XMLReader + +def parse(file: str, parser: Optional[XMLReader] = ..., bufsize: Optional[int] = ...): ... +def parseString(string: str, parser: Optional[XMLReader] = ...): ... +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/dom/pulldom.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/dom/pulldom.pyi new file mode 100644 index 00000000..964e6fa3 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/dom/pulldom.pyi @@ -0,0 +1,3 @@ +from typing import Any + +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/dom/xmlbuilder.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/dom/xmlbuilder.pyi new file mode 100644 index 00000000..964e6fa3 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/dom/xmlbuilder.pyi @@ -0,0 +1,3 @@ +from typing import Any + +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/etree/ElementInclude.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/etree/ElementInclude.pyi old mode 100755 new mode 100644 index e8c3cd56..4aa0173f --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/etree/ElementInclude.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/etree/ElementInclude.pyi @@ -1,6 +1,5 @@ -# Stubs for xml.etree.ElementInclude (Python 3.4) - -from typing import Union, Optional, Callable +import sys +from typing import Callable, Optional, Union from xml.etree.ElementTree import Element XINCLUDE: str @@ -14,4 +13,13 @@ def default_loader(href: Union[str, bytes, int], parse: str, encoding: Optional[ # TODO: loader is of type default_loader ie it takes a callable that has the # same signature as default_loader. But default_loader has a keyword argument # Which can't be represented using Callable... -def include(elem: Element, loader: Optional[Callable[..., Union[str, Element]]] = ...) -> None: ... +if sys.version_info >= (3, 9): + def include( + elem: Element, + loader: Optional[Callable[..., Union[str, Element]]] = ..., + base_url: Optional[str] = ..., + max_depth: Optional[int] = ..., + ) -> None: ... + +else: + def include(elem: Element, loader: Optional[Callable[..., Union[str, Element]]] = ...) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/etree/ElementPath.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/etree/ElementPath.pyi old mode 100755 new mode 100644 index 1250f0da..0f269b4e --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/etree/ElementPath.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/etree/ElementPath.pyi @@ -1,6 +1,4 @@ -# Stubs for xml.etree.ElementPath (Python 3.4) - -from typing import Pattern, Dict, Generator, Tuple, List, Union, TypeVar, Callable, Optional +from typing import Callable, Dict, Generator, List, Optional, Pattern, Tuple, TypeVar, Union from xml.etree.ElementTree import Element xpath_tokenizer_re: Pattern[str] @@ -25,9 +23,11 @@ class _SelectorContext: root: Element def __init__(self, root: Element) -> None: ... -_T = TypeVar('_T') +_T = TypeVar("_T") def iterfind(elem: Element, path: str, namespaces: Optional[Dict[str, str]] = ...) -> List[Element]: ... def find(elem: Element, path: str, namespaces: Optional[Dict[str, str]] = ...) -> Optional[Element]: ... def findall(elem: Element, path: str, namespaces: Optional[Dict[str, str]] = ...) -> List[Element]: ... -def findtext(elem: Element, path: str, default: Optional[_T] = ..., namespaces: Optional[Dict[str, str]] = ...) -> Union[_T, str]: ... +def findtext( + elem: Element, path: str, default: Optional[_T] = ..., namespaces: Optional[Dict[str, str]] = ... +) -> Union[_T, str]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/etree/ElementTree.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/etree/ElementTree.pyi old mode 100755 new mode 100644 index 025b4749..b2e2edbe --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/etree/ElementTree.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/etree/ElementTree.pyi @@ -1,11 +1,11 @@ -# Stubs for xml.etree.ElementTree - +import sys +from _typeshed import AnyPath, FileDescriptor, SupportsWrite from typing import ( + IO, Any, Callable, Dict, Generator, - IO, ItemsView, Iterable, Iterator, @@ -13,7 +13,6 @@ from typing import ( List, MutableSequence, Optional, - Protocol, Sequence, Text, Tuple, @@ -21,13 +20,7 @@ from typing import ( Union, overload, ) -import io -import sys - -if sys.version_info < (3,) or sys.version_info >= (3, 8): - from typing import Literal -else: - from typing_extensions import Literal +from typing_extensions import Literal VERSION: str @@ -37,7 +30,7 @@ class ParseError(SyntaxError): def iselement(element: object) -> bool: ... -_T = TypeVar('_T') +_T = TypeVar("_T") # Type for parser inputs. Parser will accept any unicode/str/bytes and coerce, # and this is true in py2 and py3 (even fromstringlist() in python3 can be @@ -63,12 +56,9 @@ else: # _fixtext function in the source). Client code knows best: _str_result_type = Any -_file_or_filename = Union[str, bytes, int, IO[Any]] +_file_or_filename = Union[AnyPath, FileDescriptor, IO[Any]] if sys.version_info >= (3, 8): - class _Writeable(Protocol): - def write(self, __s: str) -> Any: ... - @overload def canonicalize( xml_data: Optional[_parser_input_type] = ..., @@ -87,7 +77,7 @@ if sys.version_info >= (3, 8): def canonicalize( xml_data: Optional[_parser_input_type] = ..., *, - out: _Writeable, + out: SupportsWrite[str], from_file: Optional[_file_or_filename] = ..., with_comments: bool = ..., strip_text: bool = ..., @@ -103,36 +93,50 @@ class Element(MutableSequence[Element]): attrib: Dict[_str_result_type, _str_result_type] text: Optional[_str_result_type] tail: Optional[_str_result_type] - def __init__(self, tag: Union[_str_argument_type, Callable[..., Element]], attrib: Dict[_str_argument_type, _str_argument_type] = ..., **extra: _str_argument_type) -> None: ... - def append(self, subelement: Element) -> None: ... + def __init__( + self, + tag: Union[_str_argument_type, Callable[..., Element]], + attrib: Dict[_str_argument_type, _str_argument_type] = ..., + **extra: _str_argument_type, + ) -> None: ... + def append(self, __subelement: Element) -> None: ... def clear(self) -> None: ... - def copy(self) -> Element: ... - def extend(self, elements: Iterable[Element]) -> None: ... - def find(self, path: _str_argument_type, namespaces: Optional[Dict[_str_argument_type, _str_argument_type]] = ...) -> Optional[Element]: ... - def findall(self, path: _str_argument_type, namespaces: Optional[Dict[_str_argument_type, _str_argument_type]] = ...) -> List[Element]: ... + def extend(self, __elements: Iterable[Element]) -> None: ... + def find( + self, path: _str_argument_type, namespaces: Optional[Dict[_str_argument_type, _str_argument_type]] = ... + ) -> Optional[Element]: ... + def findall( + self, path: _str_argument_type, namespaces: Optional[Dict[_str_argument_type, _str_argument_type]] = ... + ) -> List[Element]: ... @overload - def findtext(self, path: _str_argument_type, *, namespaces: Optional[Dict[_str_argument_type, _str_argument_type]] = ...) -> Optional[_str_result_type]: ... + def findtext( + self, + path: _str_argument_type, + default: None = ..., + namespaces: Optional[Dict[_str_argument_type, _str_argument_type]] = ..., + ) -> Optional[_str_result_type]: ... @overload - def findtext(self, path: _str_argument_type, default: _T, namespaces: Optional[Dict[_str_argument_type, _str_argument_type]] = ...) -> Union[_T, _str_result_type]: ... + def findtext( + self, path: _str_argument_type, default: _T, namespaces: Optional[Dict[_str_argument_type, _str_argument_type]] = ... + ) -> Union[_T, _str_result_type]: ... @overload - def get(self, key: _str_argument_type) -> Optional[_str_result_type]: ... + def get(self, key: _str_argument_type, default: None = ...) -> Optional[_str_result_type]: ... @overload def get(self, key: _str_argument_type, default: _T) -> Union[_str_result_type, _T]: ... - def getchildren(self) -> List[Element]: ... - def getiterator(self, tag: Optional[_str_argument_type] = ...) -> List[Element]: ... if sys.version_info >= (3, 2): - def insert(self, index: int, subelement: Element) -> None: ... + def insert(self, __index: int, __subelement: Element) -> None: ... else: - def insert(self, index: int, element: Element) -> None: ... + def insert(self, __index: int, __element: Element) -> None: ... def items(self) -> ItemsView[_str_result_type, _str_result_type]: ... def iter(self, tag: Optional[_str_argument_type] = ...) -> Generator[Element, None, None]: ... - def iterfind(self, path: _str_argument_type, namespaces: Optional[Dict[_str_argument_type, _str_argument_type]] = ...) -> List[Element]: ... + def iterfind( + self, path: _str_argument_type, namespaces: Optional[Dict[_str_argument_type, _str_argument_type]] = ... + ) -> List[Element]: ... def itertext(self) -> Generator[_str_result_type, None, None]: ... def keys(self) -> KeysView[_str_result_type]: ... - def makeelement(self, tag: _str_argument_type, attrib: Dict[_str_argument_type, _str_argument_type]) -> Element: ... - def remove(self, subelement: Element) -> None: ... - def set(self, key: _str_argument_type, value: _str_argument_type) -> None: ... - def __bool__(self) -> bool: ... + def makeelement(self, __tag: _str_argument_type, __attrib: Dict[_str_argument_type, _str_argument_type]) -> Element: ... + def remove(self, __subelement: Element) -> None: ... + def set(self, __key: _str_argument_type, __value: _str_argument_type) -> None: ... def __delitem__(self, i: Union[int, slice]) -> None: ... @overload def __getitem__(self, i: int) -> Element: ... @@ -143,9 +147,16 @@ class Element(MutableSequence[Element]): def __setitem__(self, i: int, o: Element) -> None: ... @overload def __setitem__(self, s: slice, o: Iterable[Element]) -> None: ... + if sys.version_info < (3, 9): + def getchildren(self) -> List[Element]: ... + def getiterator(self, tag: Optional[_str_argument_type] = ...) -> List[Element]: ... - -def SubElement(parent: Element, tag: _str_argument_type, attrib: Dict[_str_argument_type, _str_argument_type] = ..., **extra: _str_argument_type) -> Element: ... +def SubElement( + parent: Element, + tag: _str_argument_type, + attrib: Dict[_str_argument_type, _str_argument_type] = ..., + **extra: _str_argument_type, +) -> Element: ... def Comment(text: Optional[_str_argument_type] = ...) -> Element: ... def ProcessingInstruction(target: _str_argument_type, text: Optional[_str_argument_type] = ...) -> Element: ... @@ -160,40 +171,147 @@ class ElementTree: def getroot(self) -> Element: ... def parse(self, source: _file_or_filename, parser: Optional[XMLParser] = ...) -> Element: ... def iter(self, tag: Optional[_str_argument_type] = ...) -> Generator[Element, None, None]: ... - def getiterator(self, tag: Optional[_str_argument_type] = ...) -> List[Element]: ... - def find(self, path: _str_argument_type, namespaces: Optional[Dict[_str_argument_type, _str_argument_type]] = ...) -> Optional[Element]: ... + if sys.version_info < (3, 9): + def getiterator(self, tag: Optional[_str_argument_type] = ...) -> List[Element]: ... + def find( + self, path: _str_argument_type, namespaces: Optional[Dict[_str_argument_type, _str_argument_type]] = ... + ) -> Optional[Element]: ... @overload - def findtext(self, path: _str_argument_type, *, namespaces: Optional[Dict[_str_argument_type, _str_argument_type]] = ...) -> Optional[_str_result_type]: ... + def findtext( + self, + path: _str_argument_type, + default: None = ..., + namespaces: Optional[Dict[_str_argument_type, _str_argument_type]] = ..., + ) -> Optional[_str_result_type]: ... @overload - def findtext(self, path: _str_argument_type, default: _T, namespaces: Optional[Dict[_str_argument_type, _str_argument_type]] = ...) -> Union[_T, _str_result_type]: ... - def findall(self, path: _str_argument_type, namespaces: Optional[Dict[_str_argument_type, _str_argument_type]] = ...) -> List[Element]: ... - def iterfind(self, path: _str_argument_type, namespaces: Optional[Dict[_str_argument_type, _str_argument_type]] = ...) -> List[Element]: ... + def findtext( + self, path: _str_argument_type, default: _T, namespaces: Optional[Dict[_str_argument_type, _str_argument_type]] = ... + ) -> Union[_T, _str_result_type]: ... + def findall( + self, path: _str_argument_type, namespaces: Optional[Dict[_str_argument_type, _str_argument_type]] = ... + ) -> List[Element]: ... + def iterfind( + self, path: _str_argument_type, namespaces: Optional[Dict[_str_argument_type, _str_argument_type]] = ... + ) -> List[Element]: ... if sys.version_info >= (3, 4): - def write(self, file_or_filename: _file_or_filename, encoding: Optional[str] = ..., xml_declaration: Optional[bool] = ..., default_namespace: Optional[_str_argument_type] = ..., method: Optional[str] = ..., *, short_empty_elements: bool = ...) -> None: ... + def write( + self, + file_or_filename: _file_or_filename, + encoding: Optional[str] = ..., + xml_declaration: Optional[bool] = ..., + default_namespace: Optional[_str_argument_type] = ..., + method: Optional[str] = ..., + *, + short_empty_elements: bool = ..., + ) -> None: ... else: - def write(self, file_or_filename: _file_or_filename, encoding: Optional[str] = ..., xml_declaration: Optional[bool] = ..., default_namespace: Optional[_str_argument_type] = ..., method: Optional[str] = ...) -> None: ... + def write( + self, + file_or_filename: _file_or_filename, + encoding: Optional[str] = ..., + xml_declaration: Optional[bool] = ..., + default_namespace: Optional[_str_argument_type] = ..., + method: Optional[str] = ..., + ) -> None: ... def write_c14n(self, file: _file_or_filename) -> None: ... def register_namespace(prefix: _str_argument_type, uri: _str_argument_type) -> None: ... -if sys.version_info >= (3,): + +if sys.version_info >= (3, 8): @overload - def tostring(element: Element, encoding: None = ..., method: Optional[str] = ..., *, short_empty_elements: bool = ...) -> bytes: ... + def tostring( + element: Element, + encoding: None = ..., + method: Optional[str] = ..., + *, + xml_declaration: Optional[bool] = ..., + default_namespace: Optional[_str_argument_type] = ..., + short_empty_elements: bool = ..., + ) -> bytes: ... @overload - def tostring(element: Element, encoding: Literal["unicode"], method: Optional[str] = ..., *, short_empty_elements: bool = ...) -> str: ... + def tostring( + element: Element, + encoding: Literal["unicode"], + method: Optional[str] = ..., + *, + xml_declaration: Optional[bool] = ..., + default_namespace: Optional[_str_argument_type] = ..., + short_empty_elements: bool = ..., + ) -> str: ... + @overload + def tostring( + element: Element, + encoding: str, + method: Optional[str] = ..., + *, + xml_declaration: Optional[bool] = ..., + default_namespace: Optional[_str_argument_type] = ..., + short_empty_elements: bool = ..., + ) -> Any: ... + @overload + def tostringlist( + element: Element, + encoding: None = ..., + method: Optional[str] = ..., + *, + xml_declaration: Optional[bool] = ..., + default_namespace: Optional[_str_argument_type] = ..., + short_empty_elements: bool = ..., + ) -> List[bytes]: ... + @overload + def tostringlist( + element: Element, + encoding: Literal["unicode"], + method: Optional[str] = ..., + *, + xml_declaration: Optional[bool] = ..., + default_namespace: Optional[_str_argument_type] = ..., + short_empty_elements: bool = ..., + ) -> List[str]: ... + @overload + def tostringlist( + element: Element, + encoding: str, + method: Optional[str] = ..., + *, + xml_declaration: Optional[bool] = ..., + default_namespace: Optional[_str_argument_type] = ..., + short_empty_elements: bool = ..., + ) -> List[Any]: ... + +elif sys.version_info >= (3,): + @overload + def tostring( + element: Element, encoding: None = ..., method: Optional[str] = ..., *, short_empty_elements: bool = ... + ) -> bytes: ... + @overload + def tostring( + element: Element, encoding: Literal["unicode"], method: Optional[str] = ..., *, short_empty_elements: bool = ... + ) -> str: ... @overload def tostring(element: Element, encoding: str, method: Optional[str] = ..., *, short_empty_elements: bool = ...) -> Any: ... @overload - def tostringlist(element: Element, encoding: None = ..., method: Optional[str] = ..., *, short_empty_elements: bool = ...) -> List[bytes]: ... + def tostringlist( + element: Element, encoding: None = ..., method: Optional[str] = ..., *, short_empty_elements: bool = ... + ) -> List[bytes]: ... @overload - def tostringlist(element: Element, encoding: Literal["unicode"], method: Optional[str] = ..., *, short_empty_elements: bool = ...) -> List[str]: ... + def tostringlist( + element: Element, encoding: Literal["unicode"], method: Optional[str] = ..., *, short_empty_elements: bool = ... + ) -> List[str]: ... @overload - def tostringlist(element: Element, encoding: str, method: Optional[str] = ..., *, short_empty_elements: bool = ...) -> List[Any]: ... + def tostringlist( + element: Element, encoding: str, method: Optional[str] = ..., *, short_empty_elements: bool = ... + ) -> List[Any]: ... + else: def tostring(element: Element, encoding: Optional[str] = ..., method: Optional[str] = ...) -> bytes: ... def tostringlist(element: Element, encoding: Optional[str] = ..., method: Optional[str] = ...) -> List[bytes]: ... + def dump(elem: Element) -> None: ... def parse(source: _file_or_filename, parser: Optional[XMLParser] = ...) -> ElementTree: ... -def iterparse(source: _file_or_filename, events: Optional[Sequence[str]] = ..., parser: Optional[XMLParser] = ...) -> Iterator[Tuple[str, Any]]: ... +def iterparse( + source: _file_or_filename, events: Optional[Sequence[str]] = ..., parser: Optional[XMLParser] = ... +) -> Iterator[Tuple[str, Any]]: ... if sys.version_info >= (3, 4): class XMLPullParser: @@ -224,9 +342,9 @@ _ElementFactory = Callable[[Any, Dict[Any, Any]], Element] class TreeBuilder: def __init__(self, element_factory: Optional[_ElementFactory] = ...) -> None: ... def close(self) -> Element: ... - def data(self, data: _parser_input_type) -> None: ... - def start(self, tag: _parser_input_type, attrs: Dict[_parser_input_type, _parser_input_type]) -> Element: ... - def end(self, tag: _parser_input_type) -> Element: ... + def data(self, __data: _parser_input_type) -> None: ... + def start(self, __tag: _parser_input_type, __attrs: Dict[_parser_input_type, _parser_input_type]) -> Element: ... + def end(self, __tag: _parser_input_type) -> Element: ... if sys.version_info >= (3, 8): class C14NWriterTarget: @@ -243,17 +361,16 @@ if sys.version_info >= (3, 8): exclude_tags: Optional[Iterable[str]] = ..., ) -> None: ... - class XMLParser: parser: Any - target: TreeBuilder + target: Any # TODO-what is entity used for??? entity: Any version: str if sys.version_info >= (3, 8): - def __init__(self, *, target: Optional[TreeBuilder] = ..., encoding: Optional[str] = ...) -> None: ... + def __init__(self, *, target: Any = ..., encoding: Optional[str] = ...) -> None: ... else: - def __init__(self, html: int = ..., target: Optional[TreeBuilder] = ..., encoding: Optional[str] = ...) -> None: ... - def doctype(self, name: str, pubid: str, system: str) -> None: ... - def close(self) -> Element: ... - def feed(self, data: _parser_input_type) -> None: ... + def __init__(self, html: int = ..., target: Any = ..., encoding: Optional[str] = ...) -> None: ... + def doctype(self, __name: str, __pubid: str, __system: str) -> None: ... + def close(self) -> Any: ... + def feed(self, __data: _parser_input_type) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/etree/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/etree/__init__.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/etree/cElementTree.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/etree/cElementTree.pyi old mode 100755 new mode 100644 index c384968d..c41e2bee --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/etree/cElementTree.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/etree/cElementTree.pyi @@ -1,3 +1 @@ -# Stubs for xml.etree.cElementTree (Python 3.4) - from xml.etree.ElementTree import * # noqa: F403 diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/parsers/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/parsers/__init__.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/parsers/expat/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/parsers/expat/__init__.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/parsers/expat/errors.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/parsers/expat/errors.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/parsers/expat/model.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/parsers/expat/model.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/sax/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/sax/__init__.pyi old mode 100755 new mode 100644 index 6edf12da..a95fde10 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/sax/__init__.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/sax/__init__.pyi @@ -1,8 +1,7 @@ -from typing import Any, List, NoReturn, Optional, Text, Union, IO - -import xml.sax -from xml.sax.xmlreader import InputSource, Locator +import sys +from typing import IO, Any, Iterable, List, NoReturn, Optional, Text, Union from xml.sax.handler import ContentHandler, ErrorHandler +from xml.sax.xmlreader import Locator, XMLReader class SAXException(Exception): def __init__(self, msg: str, exception: Optional[Exception] = ...) -> None: ... @@ -23,12 +22,12 @@ class SAXReaderNotAvailable(SAXNotSupportedException): ... default_parser_list: List[str] -def make_parser(parser_list: List[str] = ...) -> xml.sax.xmlreader.XMLReader: ... - -def parse(source: Union[str, IO[str]], handler: xml.sax.handler.ContentHandler, - errorHandler: xml.sax.handler.ErrorHandler = ...) -> None: ... +if sys.version_info >= (3, 8): + def make_parser(parser_list: Iterable[str] = ...) -> XMLReader: ... -def parseString(string: Union[bytes, Text], handler: xml.sax.handler.ContentHandler, - errorHandler: Optional[xml.sax.handler.ErrorHandler] = ...) -> None: ... +else: + def make_parser(parser_list: List[str] = ...) -> XMLReader: ... -def _create_parser(parser_name: str) -> xml.sax.xmlreader.XMLReader: ... +def parse(source: Union[str, IO[str], IO[bytes]], handler: ContentHandler, errorHandler: ErrorHandler = ...) -> None: ... +def parseString(string: Union[bytes, Text], handler: ContentHandler, errorHandler: Optional[ErrorHandler] = ...) -> None: ... +def _create_parser(parser_name: str) -> XMLReader: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/sax/handler.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/sax/handler.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/sax/saxutils.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/sax/saxutils.pyi old mode 100755 new mode 100644 index 342d6ed8..8ae2b80d --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/sax/saxutils.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/sax/saxutils.pyi @@ -1,8 +1,9 @@ import sys -from typing import Mapping, Text - -from xml.sax import handler -from xml.sax import xmlreader +from _typeshed import SupportsWrite +from codecs import StreamReaderWriter, StreamWriter +from io import RawIOBase, TextIOBase +from typing import Mapping, Optional, Text, Union +from xml.sax import handler, xmlreader def escape(data: Text, entities: Mapping[Text, Text] = ...) -> Text: ... def unescape(data: Text, entities: Mapping[Text, Text] = ...) -> Text: ... @@ -10,9 +11,18 @@ def quoteattr(data: Text, entities: Mapping[Text, Text] = ...) -> Text: ... class XMLGenerator(handler.ContentHandler): if sys.version_info >= (3, 0): - def __init__(self, out=..., encoding=..., short_empty_elements: bool = ...) -> None: ... + def __init__( + self, + out: Optional[Union[TextIOBase, RawIOBase, StreamWriter, StreamReaderWriter, SupportsWrite[str]]] = ..., + encoding: str = ..., + short_empty_elements: bool = ..., + ) -> None: ... else: - def __init__(self, out=..., encoding=...) -> None: ... + def __init__( + self, + out: Optional[Union[TextIOBase, RawIOBase, StreamWriter, StreamReaderWriter, SupportsWrite[str]]] = ..., + encoding: Text = ..., + ) -> None: ... def startDocument(self): ... def endDocument(self): ... def startPrefixMapping(self, prefix, uri): ... @@ -26,7 +36,7 @@ class XMLGenerator(handler.ContentHandler): def processingInstruction(self, target, data): ... class XMLFilterBase(xmlreader.XMLReader): - def __init__(self, parent=...) -> None: ... + def __init__(self, parent: Optional[xmlreader.XMLReader] = ...) -> None: ... def error(self, exception): ... def fatalError(self, exception): ... def warning(self, exception): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/sax/xmlreader.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/sax/xmlreader.pyi old mode 100755 new mode 100644 index fbc1ac1e..de0d1169 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/sax/xmlreader.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/xml/sax/xmlreader.pyi @@ -1,3 +1,5 @@ +from typing import Mapping, Optional, Tuple + class XMLReader: def __init__(self) -> None: ... def parse(self, source): ... @@ -16,7 +18,7 @@ class XMLReader: def setProperty(self, name, value): ... class IncrementalParser(XMLReader): - def __init__(self, bufsize=...) -> None: ... + def __init__(self, bufsize: int = ...) -> None: ... def parse(self, source): ... def feed(self, data): ... def prepareParser(self, source): ... @@ -30,7 +32,7 @@ class Locator: def getSystemId(self): ... class InputSource: - def __init__(self, system_id=...) -> None: ... + def __init__(self, system_id: Optional[str] = ...) -> None: ... def setPublicId(self, public_id): ... def getPublicId(self): ... def setSystemId(self, system_id): ... @@ -43,7 +45,7 @@ class InputSource: def getCharacterStream(self): ... class AttributesImpl: - def __init__(self, attrs) -> None: ... + def __init__(self, attrs: Mapping[str, str]) -> None: ... def getLength(self): ... def getType(self, name): ... def getValue(self, name): ... @@ -63,7 +65,7 @@ class AttributesImpl: def values(self): ... class AttributesNSImpl(AttributesImpl): - def __init__(self, attrs, qnames) -> None: ... + def __init__(self, attrs: Mapping[Tuple[str, str], str], qnames: Mapping[Tuple[str, str], str]) -> None: ... def getValueByQName(self, name): ... def getNameByQName(self, name): ... def getQNameByName(self, name): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/zipfile.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/zipfile.pyi old mode 100755 new mode 100644 index 72021f35..8c02e4a8 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/zipfile.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/zipfile.pyi @@ -1,15 +1,25 @@ -# Stubs for zipfile - -from typing import Callable, Dict, IO, Iterable, List, Optional, Text, Tuple, Type, Union, Sequence, Pattern -from types import TracebackType import io -import os import sys +from _typeshed import StrPath +from types import TracebackType +from typing import ( + IO, + Any, + Callable, + Dict, + Iterable, + Iterator, + List, + Optional, + Pattern, + Protocol, + Sequence, + Text, + Tuple, + Type, + Union, +) -if sys.version_info >= (3, 6): - _Path = Union[os.PathLike[str], str] -else: - _Path = Text _SZI = Union[Text, ZipInfo] _DT = Tuple[int, int, int, int, int, int] @@ -36,31 +46,39 @@ class ZipExtFile(io.BufferedIOBase): newlines: Optional[List[bytes]] mode: str name: str - def __init__( - self, - fileobj: IO[bytes], - mode: str, - zipinfo: ZipInfo, - decrypter: Optional[Callable[[Sequence[int]], bytes]] = ..., - close_fileobj: bool = ..., - ) -> None: ... + if sys.version_info >= (3, 7): + def __init__( + self, fileobj: IO[bytes], mode: str, zipinfo: ZipInfo, pwd: Optional[bytes] = ..., close_fileobj: bool = ... + ) -> None: ... + else: + def __init__( + self, + fileobj: IO[bytes], + mode: str, + zipinfo: ZipInfo, + decrypter: Optional[Callable[[Sequence[int]], bytes]] = ..., + close_fileobj: bool = ..., + ) -> None: ... def __repr__(self) -> str: ... def peek(self, n: int = ...) -> bytes: ... def read1(self, n: Optional[int]) -> bytes: ... # type: ignore +class _Writer(Protocol): + def write(self, __s: str) -> Any: ... + class ZipFile: filename: Optional[Text] debug: int comment: bytes filelist: List[ZipInfo] - fp: IO[bytes] + fp: Optional[IO[bytes]] NameToInfo: Dict[Text, ZipInfo] start_dir: int # undocumented if sys.version_info >= (3, 8): def __init__( self, - file: Union[_Path, IO[bytes]], - mode: Text = ..., + file: Union[StrPath, IO[bytes]], + mode: str = ..., compression: int = ..., allowZip64: bool = ..., compresslevel: Optional[int] = ..., @@ -70,15 +88,15 @@ class ZipFile: elif sys.version_info >= (3, 7): def __init__( self, - file: Union[_Path, IO[bytes]], - mode: Text = ..., + file: Union[StrPath, IO[bytes]], + mode: str = ..., compression: int = ..., allowZip64: bool = ..., compresslevel: Optional[int] = ..., ) -> None: ... else: def __init__( - self, file: Union[_Path, IO[bytes]], mode: Text = ..., compression: int = ..., allowZip64: bool = ... + self, file: Union[StrPath, IO[bytes]], mode: Text = ..., compression: int = ..., allowZip64: bool = ... ) -> None: ... def __enter__(self) -> ZipFile: ... def __exit__( @@ -88,17 +106,37 @@ class ZipFile: def getinfo(self, name: Text) -> ZipInfo: ... def infolist(self) -> List[ZipInfo]: ... def namelist(self) -> List[Text]: ... - def open(self, name: _SZI, mode: Text = ..., pwd: Optional[bytes] = ...) -> IO[bytes]: ... - def extract(self, member: _SZI, path: Optional[_SZI] = ..., pwd: bytes = ...) -> str: ... + def open(self, name: _SZI, mode: Text = ..., pwd: Optional[bytes] = ..., *, force_zip64: bool = ...) -> IO[bytes]: ... + def extract(self, member: _SZI, path: Optional[StrPath] = ..., pwd: Optional[bytes] = ...) -> str: ... def extractall( - self, path: Optional[_Path] = ..., members: Optional[Iterable[Text]] = ..., pwd: Optional[bytes] = ... + self, path: Optional[StrPath] = ..., members: Optional[Iterable[Text]] = ..., pwd: Optional[bytes] = ... ) -> None: ... - def printdir(self) -> None: ... + if sys.version_info >= (3,): + def printdir(self, file: Optional[_Writer] = ...) -> None: ... + else: + def printdir(self) -> None: ... def setpassword(self, pwd: bytes) -> None: ... def read(self, name: _SZI, pwd: Optional[bytes] = ...) -> bytes: ... def testzip(self) -> Optional[str]: ... - def write(self, filename: _Path, arcname: Optional[_Path] = ..., compress_type: Optional[int] = ...) -> None: ... - if sys.version_info >= (3,): + if sys.version_info >= (3, 7): + def write( + self, + filename: StrPath, + arcname: Optional[StrPath] = ..., + compress_type: Optional[int] = ..., + compresslevel: Optional[int] = ..., + ) -> None: ... + else: + def write(self, filename: StrPath, arcname: Optional[StrPath] = ..., compress_type: Optional[int] = ...) -> None: ... + if sys.version_info >= (3, 7): + def writestr( + self, + zinfo_or_arcname: _SZI, + data: Union[bytes, str], + compress_type: Optional[int] = ..., + compresslevel: Optional[int] = ..., + ) -> None: ... + elif sys.version_info >= (3,): def writestr(self, zinfo_or_arcname: _SZI, data: Union[bytes, str], compress_type: Optional[int] = ...) -> None: ... else: def writestr(self, zinfo_or_arcname: _SZI, bytes: bytes, compress_type: Optional[int] = ...) -> None: ... @@ -106,7 +144,12 @@ class ZipFile: class PyZipFile(ZipFile): if sys.version_info >= (3,): def __init__( - self, file: Union[str, IO[bytes]], mode: str = ..., compression: int = ..., allowZip64: bool = ..., opimize: int = ... + self, + file: Union[str, IO[bytes]], + mode: str = ..., + compression: int = ..., + allowZip64: bool = ..., + optimize: int = ..., ) -> None: ... def writepy(self, pathname: str, basename: str = ..., filterfunc: Optional[Callable[[str], bool]] = ...) -> None: ... else: @@ -131,16 +174,47 @@ class ZipInfo: compress_size: int file_size: int def __init__(self, filename: Optional[Text] = ..., date_time: Optional[_DT] = ...) -> None: ... + if sys.version_info >= (3, 8): + @classmethod + def from_file(cls, filename: StrPath, arcname: Optional[StrPath] = ..., *, strict_timestamps: bool = ...) -> ZipInfo: ... + elif sys.version_info >= (3, 6): + @classmethod + def from_file(cls, filename: StrPath, arcname: Optional[StrPath] = ...) -> ZipInfo: ... if sys.version_info >= (3, 6): def is_dir(self) -> bool: ... - @classmethod - def from_file(cls, filename: _Path, arcname: Optional[_Path] = ...) -> ZipInfo: ... def FileHeader(self, zip64: Optional[bool] = ...) -> bytes: ... -def is_zipfile(filename: Union[_Path, IO[bytes]]) -> bool: ... +if sys.version_info >= (3, 8): + class Path: + @property + def name(self) -> str: ... + @property + def parent(self) -> Path: ... # undocumented + def __init__(self, root: Union[ZipFile, StrPath, IO[bytes]], at: str = ...) -> None: ... + def open(self, mode: str = ..., pwd: Optional[bytes] = ..., *, force_zip64: bool = ...) -> IO[bytes]: ... + def iterdir(self) -> Iterator[Path]: ... + def is_dir(self) -> bool: ... + def is_file(self) -> bool: ... + def exists(self) -> bool: ... + def read_text( + self, + encoding: Optional[str] = ..., + errors: Optional[str] = ..., + newline: Optional[str] = ..., + line_buffering: bool = ..., + write_through: bool = ..., + ) -> str: ... + def read_bytes(self) -> bytes: ... + def joinpath(self, add: StrPath) -> Path: ... # undocumented + def __truediv__(self, add: StrPath) -> Path: ... + +def is_zipfile(filename: Union[StrPath, IO[bytes]]) -> bool: ... ZIP_STORED: int ZIP_DEFLATED: int +ZIP64_LIMIT: int +ZIP_FILECOUNT_LIMIT: int +ZIP_MAX_COMMENT: int if sys.version_info >= (3, 3): ZIP_BZIP2: int ZIP_LZMA: int diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/zipimport.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/zipimport.pyi old mode 100755 new mode 100644 index c22531a9..0d1a3309 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/zipimport.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/zipimport.pyi @@ -1,18 +1,30 @@ -"""Stub file for the 'zipimport' module.""" - -from typing import Optional +import os +import sys from types import CodeType, ModuleType +from typing import Any, List, Optional, Tuple, Union + +if sys.version_info >= (3, 7): + from importlib.abc import ResourceReader class ZipImportError(ImportError): ... class zipimporter(object): archive: str prefix: str - def __init__(self, archivepath: str) -> None: ... - def find_module(self, fullname: str, path: str = ...) -> Optional[zipimporter]: ... + if sys.version_info >= (3, 6): + def __init__(self, path: Union[str, bytes, os.PathLike[Any]]) -> None: ... + else: + def __init__(self, path: Union[str, bytes]) -> None: ... + if sys.version_info >= (3,): + def find_loader( + self, fullname: str, path: Optional[str] = ... + ) -> Tuple[Optional[zipimporter], List[str]]: ... # undocumented + def find_module(self, fullname: str, path: Optional[str] = ...) -> Optional[zipimporter]: ... def get_code(self, fullname: str) -> CodeType: ... def get_data(self, pathname: str) -> str: ... def get_filename(self, fullname: str) -> str: ... + if sys.version_info >= (3, 7): + def get_resource_reader(self, fullname: str) -> Optional[ResourceReader]: ... # undocumented def get_source(self, fullname: str) -> Optional[str]: ... def is_package(self, fullname: str) -> bool: ... def load_module(self, fullname: str) -> ModuleType: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/zlib.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/zlib.pyi old mode 100755 new mode 100644 index 4ea53721..36757846 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/zlib.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/2and3/zlib.pyi @@ -1,5 +1,6 @@ -# Stubs for zlib import sys +from array import array +from typing import Any, Union DEFLATED: int DEF_MEM_LEVEL: int @@ -21,13 +22,11 @@ if sys.version_info >= (3,): class error(Exception): ... - class _Compress: def compress(self, data: bytes) -> bytes: ... def flush(self, mode: int = ...) -> bytes: ... def copy(self) -> _Compress: ... - class _Decompress: unused_data: bytes unconsumed_tail: bytes @@ -37,19 +36,24 @@ class _Decompress: def flush(self, length: int = ...) -> bytes: ... def copy(self) -> _Decompress: ... +def adler32(__data: bytes, __value: int = ...) -> int: ... +def compress(__data: bytes, level: int = ...) -> bytes: ... -def adler32(data: bytes, value: int = ...) -> int: ... -def compress(data: bytes, level: int = ...) -> bytes: ... if sys.version_info >= (3,): - def compressobj(level: int = ..., method: int = ..., wbits: int = ..., - memLevel: int = ..., strategy: int = ..., - zdict: bytes = ...) -> _Compress: ... + def compressobj( + level: int = ..., method: int = ..., wbits: int = ..., memLevel: int = ..., strategy: int = ..., zdict: bytes = ... + ) -> _Compress: ... + else: - def compressobj(level: int = ..., method: int = ..., wbits: int = ..., - memlevel: int = ..., strategy: int = ...) -> _Compress: ... -def crc32(data: bytes, value: int = ...) -> int: ... -def decompress(data: bytes, wbits: int = ..., bufsize: int = ...) -> bytes: ... + def compressobj( + level: int = ..., method: int = ..., wbits: int = ..., memlevel: int = ..., strategy: int = ... + ) -> _Compress: ... + +def crc32(__data: Union[array[Any], bytes], __value: int = ...) -> int: ... +def decompress(__data: bytes, wbits: int = ..., bufsize: int = ...) -> bytes: ... + if sys.version_info >= (3,): def decompressobj(wbits: int = ..., zdict: bytes = ...) -> _Decompress: ... + else: def decompressobj(wbits: int = ...) -> _Decompress: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3.7/_py_abc.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3.7/_py_abc.pyi new file mode 100644 index 00000000..9b0812d6 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3.7/_py_abc.pyi @@ -0,0 +1,10 @@ +from typing import Any, Dict, Tuple, Type, TypeVar + +_T = TypeVar("_T") + +# TODO: Change the return into a NewType bound to int after pytype/#597 +def get_cache_token() -> object: ... + +class ABCMeta(type): + def __new__(__mcls, __name: str, __bases: Tuple[Type[Any], ...], __namespace: Dict[str, Any]) -> ABCMeta: ... + def register(cls, subclass: Type[_T]) -> Type[_T]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3.7/contextvars.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3.7/contextvars.pyi old mode 100755 new mode 100644 index a90c2a8b..810b699b --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3.7/contextvars.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3.7/contextvars.pyi @@ -1,14 +1,24 @@ -from typing import Any, Callable, ClassVar, Generic, Iterator, Mapping, TypeVar +import sys +from typing import Any, Callable, ClassVar, Generic, Iterator, Mapping, TypeVar, Union, overload -_T = TypeVar('_T') +if sys.version_info >= (3, 9): + from types import GenericAlias + +_T = TypeVar("_T") +_D = TypeVar("_D") class ContextVar(Generic[_T]): def __init__(self, name: str, *, default: _T = ...) -> None: ... @property def name(self) -> str: ... - def get(self, default: _T = ...) -> _T: ... + @overload + def get(self) -> _T: ... + @overload + def get(self, default: Union[_D, _T]) -> Union[_D, _T]: ... def set(self, value: _T) -> Token[_T]: ... def reset(self, token: Token[_T]) -> None: ... + if sys.version_info >= (3, 9): + def __class_getitem__(cls, item: Any) -> GenericAlias: ... class Token(Generic[_T]): @property @@ -16,6 +26,8 @@ class Token(Generic[_T]): @property def old_value(self) -> Any: ... # returns either _T or MISSING, but that's hard to express MISSING: ClassVar[object] + if sys.version_info >= (3, 9): + def __class_getitem__(cls, item: Any) -> GenericAlias: ... def copy_context() -> Context: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3.7/dataclasses.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3.7/dataclasses.pyi old mode 100755 new mode 100644 index e3bf1d13..1f5b6b4d --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3.7/dataclasses.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3.7/dataclasses.pyi @@ -1,29 +1,30 @@ -from typing import overload, Any, Callable, Dict, Generic, Iterable, List, Mapping, Optional, Tuple, Type, TypeVar, Union +import sys +from typing import Any, Callable, Dict, Generic, Iterable, List, Mapping, Optional, Tuple, Type, TypeVar, Union, overload +if sys.version_info >= (3, 9): + from types import GenericAlias -_T = TypeVar('_T') +_T = TypeVar("_T") class _MISSING_TYPE: ... -MISSING: _MISSING_TYPE +MISSING: _MISSING_TYPE @overload def asdict(obj: Any) -> Dict[str, Any]: ... @overload def asdict(obj: Any, *, dict_factory: Callable[[List[Tuple[str, Any]]], _T]) -> _T: ... - @overload def astuple(obj: Any) -> Tuple[Any, ...]: ... @overload def astuple(obj: Any, *, tuple_factory: Callable[[List[Any]], _T]) -> _T: ... - - @overload def dataclass(_cls: Type[_T]) -> Type[_T]: ... - @overload -def dataclass(*, init: bool = ..., repr: bool = ..., eq: bool = ..., order: bool = ..., - unsafe_hash: bool = ..., frozen: bool = ...) -> Callable[[Type[_T]], Type[_T]]: ... - +def dataclass(_cls: None) -> Callable[[Type[_T]], Type[_T]]: ... +@overload +def dataclass( + *, init: bool = ..., repr: bool = ..., eq: bool = ..., order: bool = ..., unsafe_hash: bool = ..., frozen: bool = ... +) -> Callable[[Type[_T]], Type[_T]]: ... class Field(Generic[_T]): name: str @@ -35,37 +36,60 @@ class Field(Generic[_T]): init: bool compare: bool metadata: Mapping[str, Any] - + if sys.version_info >= (3, 9): + def __class_getitem__(cls, item: Any) -> GenericAlias: ... # NOTE: Actual return type is 'Field[_T]', but we want to help type checkers # to understand the magic that happens at runtime. @overload # `default` and `default_factory` are optional and mutually exclusive. -def field(*, default: _T, - init: bool = ..., repr: bool = ..., hash: Optional[bool] = ..., compare: bool = ..., - metadata: Optional[Mapping[str, Any]] = ...) -> _T: ... - +def field( + *, + default: _T, + init: bool = ..., + repr: bool = ..., + hash: Optional[bool] = ..., + compare: bool = ..., + metadata: Optional[Mapping[str, Any]] = ..., +) -> _T: ... @overload -def field(*, default_factory: Callable[[], _T], - init: bool = ..., repr: bool = ..., hash: Optional[bool] = ..., compare: bool = ..., - metadata: Optional[Mapping[str, Any]] = ...) -> _T: ... - +def field( + *, + default_factory: Callable[[], _T], + init: bool = ..., + repr: bool = ..., + hash: Optional[bool] = ..., + compare: bool = ..., + metadata: Optional[Mapping[str, Any]] = ..., +) -> _T: ... @overload -def field(*, - init: bool = ..., repr: bool = ..., hash: Optional[bool] = ..., compare: bool = ..., - metadata: Optional[Mapping[str, Any]] = ...) -> Any: ... - - +def field( + *, + init: bool = ..., + repr: bool = ..., + hash: Optional[bool] = ..., + compare: bool = ..., + metadata: Optional[Mapping[str, Any]] = ..., +) -> Any: ... def fields(class_or_instance: Any) -> Tuple[Field[Any], ...]: ... - def is_dataclass(obj: Any) -> bool: ... class FrozenInstanceError(AttributeError): ... -class InitVar(Generic[_T]): ... - -def make_dataclass(cls_name: str, fields: Iterable[Union[str, Tuple[str, type], Tuple[str, type, Field[Any]]]], *, - bases: Tuple[type, ...] = ..., namespace: Optional[Dict[str, Any]] = ..., - init: bool = ..., repr: bool = ..., eq: bool = ..., order: bool = ..., hash: bool = ..., - frozen: bool = ...): ... - +class InitVar(Generic[_T]): + if sys.version_info >= (3, 9): + def __class_getitem__(cls, type: Any) -> GenericAlias: ... + +def make_dataclass( + cls_name: str, + fields: Iterable[Union[str, Tuple[str, type], Tuple[str, type, Field[Any]]]], + *, + bases: Tuple[type, ...] = ..., + namespace: Optional[Dict[str, Any]] = ..., + init: bool = ..., + repr: bool = ..., + eq: bool = ..., + order: bool = ..., + unsafe_hash: bool = ..., + frozen: bool = ..., +) -> type: ... def replace(obj: _T, **changes: Any) -> _T: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3.9/graphlib.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3.9/graphlib.pyi new file mode 100644 index 00000000..ca21b423 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3.9/graphlib.pyi @@ -0,0 +1,16 @@ +from _typeshed import SupportsItems +from typing import Generic, Iterable, Optional, Tuple, TypeVar + +_T = TypeVar("_T") + +class TopologicalSorter(Generic[_T]): + def __init__(self, graph: Optional[SupportsItems[_T, Iterable[_T]]] = ...) -> None: ... + def add(self, node: _T, *predecessors: _T) -> None: ... + def prepare(self) -> None: ... + def is_active(self) -> bool: ... + def __bool__(self) -> bool: ... + def done(self, *nodes: _T) -> None: ... + def get_ready(self) -> Tuple[_T, ...]: ... + def static_order(self) -> Iterable[_T]: ... + +class CycleError(ValueError): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3.9/zoneinfo/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3.9/zoneinfo/__init__.pyi new file mode 100644 index 00000000..46cd6b87 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3.9/zoneinfo/__init__.pyi @@ -0,0 +1,32 @@ +import os +import typing +from datetime import tzinfo +from typing import Any, AnyStr, Iterable, Optional, Protocol, Sequence, Set, Type, Union + +_T = typing.TypeVar("_T", bound="ZoneInfo") + +class _IOBytes(Protocol): + def read(self, __size: int) -> bytes: ... + def seek(self, __size: int, __whence: int = ...) -> Any: ... + +class ZoneInfo(tzinfo): + @property + def key(self) -> str: ... + def __init__(self, key: str) -> None: ... + @classmethod + def no_cache(cls: Type[_T], key: str) -> _T: ... + @classmethod + def from_file(cls: Type[_T], __fobj: _IOBytes, key: Optional[str] = ...) -> _T: ... + @classmethod + def clear_cache(cls, *, only_keys: Iterable[str] = ...) -> None: ... + +# Note: Both here and in clear_cache, the types allow the use of `str` where +# a sequence of strings is required. This should be remedied if a solution +# to this typing bug is found: https://github.com/python/typing/issues/256 +def reset_tzpath(to: Optional[Sequence[Union[os.PathLike[AnyStr], str]]] = ...) -> None: ... +def available_timezones() -> Set[str]: ... + +TZPATH: Sequence[str] + +class ZoneInfoNotFoundError(KeyError): ... +class InvalidTZPathWarning(RuntimeWarning): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_ast.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_ast.pyi old mode 100755 new mode 100644 index da9ac361..15556529 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_ast.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_ast.pyi @@ -1,6 +1,6 @@ import sys import typing -from typing import Any, Optional, ClassVar +from typing import Any, ClassVar, Optional PyCF_ONLY_AST: int if sys.version_info >= (3, 8): @@ -21,22 +21,17 @@ class AST: end_col_offset: Optional[int] type_comment: Optional[str] -class mod(AST): - ... +class mod(AST): ... if sys.version_info >= (3, 8): class type_ignore(AST): ... - class TypeIgnore(type_ignore): ... - class FunctionType(mod): argtypes: typing.List[expr] returns: expr class Module(mod): body: typing.List[stmt] - if sys.version_info >= (3, 7): - docstring: Optional[str] if sys.version_info >= (3, 8): type_ignores: typing.List[TypeIgnore] @@ -46,10 +41,6 @@ class Interactive(mod): class Expression(mod): body: expr -class Suite(mod): - body: typing.List[stmt] - - class stmt(AST): ... class FunctionDef(stmt): @@ -58,8 +49,6 @@ class FunctionDef(stmt): body: typing.List[stmt] decorator_list: typing.List[expr] returns: Optional[expr] - if sys.version_info >= (3, 7): - docstring: Optional[str] class AsyncFunctionDef(stmt): name: _identifier @@ -67,8 +56,6 @@ class AsyncFunctionDef(stmt): body: typing.List[stmt] decorator_list: typing.List[expr] returns: Optional[expr] - if sys.version_info >= (3, 7): - docstring: Optional[str] class ClassDef(stmt): name: _identifier @@ -76,8 +63,6 @@ class ClassDef(stmt): keywords: typing.List[keyword] body: typing.List[stmt] decorator_list: typing.List[expr] - if sys.version_info >= (3, 7): - docstring: Optional[str] class Return(stmt): value: Optional[expr] @@ -94,12 +79,11 @@ class AugAssign(stmt): op: operator value: expr -if sys.version_info >= (3, 6): - class AnnAssign(stmt): - target: expr - annotation: expr - value: Optional[expr] - simple: int +class AnnAssign(stmt): + target: expr + annotation: expr + value: Optional[expr] + simple: int class For(stmt): target: expr @@ -165,25 +149,6 @@ class Expr(stmt): class Pass(stmt): ... class Break(stmt): ... class Continue(stmt): ... - - -class slice(AST): - ... - -_slice = slice # this lets us type the variable named 'slice' below - -class Slice(slice): - lower: Optional[expr] - upper: Optional[expr] - step: Optional[expr] - -class ExtSlice(slice): - dims: typing.List[slice] - -class Index(slice): - value: expr - - class expr(AST): ... class BoolOp(expr): @@ -251,50 +216,62 @@ class Call(expr): args: typing.List[expr] keywords: typing.List[keyword] -class Num(expr): # Deprecated in 3.8; use Constant - n: complex - -class Str(expr): # Deprecated in 3.8; use Constant - s: str - -if sys.version_info >= (3, 6): - class FormattedValue(expr): - value: expr - conversion: Optional[int] - format_spec: Optional[expr] - - class JoinedStr(expr): - values: typing.List[expr] - -class Bytes(expr): # Deprecated in 3.8; use Constant - s: bytes +class FormattedValue(expr): + value: expr + conversion: Optional[int] + format_spec: Optional[expr] -class NameConstant(expr): - value: Any +class JoinedStr(expr): + values: typing.List[expr] -if sys.version_info >= (3, 6): - class Constant(expr): - value: Any # None, str, bytes, bool, int, float, complex, Ellipsis - kind: Optional[str] - # Aliases for value, for backwards compatibility - s: Any +if sys.version_info < (3, 8): + class Num(expr): # Deprecated in 3.8; use Constant n: complex + class Str(expr): # Deprecated in 3.8; use Constant + s: str + class Bytes(expr): # Deprecated in 3.8; use Constant + s: bytes + class NameConstant(expr): # Deprecated in 3.8; use Constant + value: Any + class Ellipsis(expr): ... # Deprecated in 3.8; use Constant + +class Constant(expr): + value: Any # None, str, bytes, bool, int, float, complex, Ellipsis + kind: Optional[str] + # Aliases for value, for backwards compatibility + s: Any + n: complex if sys.version_info >= (3, 8): class NamedExpr(expr): target: expr value: expr -class Ellipsis(expr): ... - class Attribute(expr): value: expr attr: _identifier ctx: expr_context +if sys.version_info >= (3, 9): + _SliceT = expr +else: + class slice(AST): ... + _SliceT = slice + +class Slice(_SliceT): + lower: Optional[expr] + upper: Optional[expr] + step: Optional[expr] + +if sys.version_info < (3, 9): + class ExtSlice(slice): + dims: typing.List[slice] + class Index(slice): + value: expr + class Subscript(expr): value: expr - slice: _slice + slice: _SliceT ctx: expr_context class Starred(expr): @@ -313,27 +290,22 @@ class Tuple(expr): elts: typing.List[expr] ctx: expr_context +class expr_context(AST): ... -class expr_context(AST): - ... +if sys.version_info < (3, 9): + class AugLoad(expr_context): ... + class AugStore(expr_context): ... + class Param(expr_context): ... + class Suite(mod): + body: typing.List[stmt] -class AugLoad(expr_context): ... -class AugStore(expr_context): ... class Del(expr_context): ... class Load(expr_context): ... -class Param(expr_context): ... class Store(expr_context): ... - - -class boolop(AST): - ... - +class boolop(AST): ... class And(boolop): ... class Or(boolop): ... - -class operator(AST): - ... - +class operator(AST): ... class Add(operator): ... class BitAnd(operator): ... class BitOr(operator): ... @@ -347,18 +319,12 @@ class MatMult(operator): ... class Pow(operator): ... class RShift(operator): ... class Sub(operator): ... - -class unaryop(AST): - ... - +class unaryop(AST): ... class Invert(unaryop): ... class Not(unaryop): ... class UAdd(unaryop): ... class USub(unaryop): ... - -class cmpop(AST): - ... - +class cmpop(AST): ... class Eq(cmpop): ... class Gt(cmpop): ... class GtE(cmpop): ... @@ -370,31 +336,26 @@ class LtE(cmpop): ... class NotEq(cmpop): ... class NotIn(cmpop): ... - class comprehension(AST): target: expr iter: expr ifs: typing.List[expr] - if sys.version_info >= (3, 6): - is_async: int - + is_async: int -class excepthandler(AST): - ... +class excepthandler(AST): ... class ExceptHandler(excepthandler): type: Optional[expr] name: Optional[_identifier] body: typing.List[stmt] - class arguments(AST): if sys.version_info >= (3, 8): posonlyargs: typing.List[arg] args: typing.List[arg] vararg: Optional[arg] kwonlyargs: typing.List[arg] - kw_defaults: typing.List[expr] + kw_defaults: typing.List[Optional[expr]] kwarg: Optional[arg] defaults: typing.List[expr] diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_bootlocale.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_bootlocale.pyi new file mode 100644 index 00000000..ee2d8934 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_bootlocale.pyi @@ -0,0 +1 @@ +def getpreferredencoding(do_setlocale: bool = ...) -> str: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_compat_pickle.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_compat_pickle.pyi new file mode 100644 index 00000000..5be4c9b9 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_compat_pickle.pyi @@ -0,0 +1,10 @@ +from typing import Dict, Tuple + +IMPORT_MAPPING: Dict[str, str] +NAME_MAPPING: Dict[Tuple[str, str], Tuple[str, str]] +PYTHON2_EXCEPTIONS: Tuple[str, ...] +MULTIPROCESSING_EXCEPTIONS: Tuple[str, ...] +REVERSE_IMPORT_MAPPING: Dict[str, str] +REVERSE_NAME_MAPPING: Dict[Tuple[str, str], Tuple[str, str]] +PYTHON3_OSERROR_EXCEPTIONS: Tuple[str, ...] +PYTHON3_IMPORTERROR_EXCEPTIONS: Tuple[str, ...] diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_compression.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_compression.pyi old mode 100755 new mode 100644 index bf474e6b..ac44d6d6 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_compression.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_compression.pyi @@ -1,16 +1,23 @@ -from typing import Any -import io +from _typeshed import WriteableBuffer +from io import BufferedIOBase, RawIOBase +from typing import Any, Callable, Tuple, Type, Union BUFFER_SIZE: Any -class BaseStream(io.BufferedIOBase): ... +class BaseStream(BufferedIOBase): ... -class DecompressReader(io.RawIOBase): - def readable(self): ... - def __init__(self, fp, decomp_factory, trailing_error=..., **decomp_args): ... - def close(self): ... - def seekable(self): ... - def readinto(self, b): ... - def read(self, size: int = ...): ... - def seek(self, offset, whence=...): ... - def tell(self): ... +class DecompressReader(RawIOBase): + def __init__( + self, + fp: RawIOBase, + decomp_factory: Callable[..., object], + trailing_error: Union[Type[Exception], Tuple[Type[Exception], ...]] = ..., + **decomp_args: Any, + ) -> None: ... + def readable(self) -> bool: ... + def close(self) -> None: ... + def seekable(self) -> bool: ... + def readinto(self, b: WriteableBuffer) -> int: ... + def read(self, size: int = ...) -> bytes: ... + def seek(self, offset: int, whence: int = ...) -> int: ... + def tell(self) -> int: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_decimal.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_decimal.pyi new file mode 100644 index 00000000..e5880585 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_decimal.pyi @@ -0,0 +1 @@ +from decimal import * diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_dummy_thread.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_dummy_thread.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_imp.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_imp.pyi old mode 100755 new mode 100644 index f3c3945b..bfc4d42c --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_imp.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_imp.pyi @@ -1,20 +1,17 @@ -# Stubs for _imp (Python 3.6) - import types -from typing import Any, List - from importlib.machinery import ModuleSpec -def create_builtin(spec: ModuleSpec) -> types.ModuleType: ... -def create_dynamic(spec: ModuleSpec, file: Any = ...) -> None: ... +from typing import Any, List +def create_builtin(__spec: ModuleSpec) -> types.ModuleType: ... +def create_dynamic(__spec: ModuleSpec, __file: Any = ...) -> None: ... def acquire_lock() -> None: ... -def exec_builtin(mod: types.ModuleType) -> int: ... -def exec_dynamic(mod: types.ModuleType) -> int: ... +def exec_builtin(__mod: types.ModuleType) -> int: ... +def exec_dynamic(__mod: types.ModuleType) -> int: ... def extension_suffixes() -> List[str]: ... -def get_frozen_object(name: str) -> types.CodeType: ... -def init_frozen(name: str) -> types.ModuleType: ... -def is_builtin(name: str) -> int: ... -def is_frozen(name: str) -> bool: ... -def is_frozen_package(name: str) -> bool: ... +def get_frozen_object(__name: str) -> types.CodeType: ... +def init_frozen(__name: str) -> types.ModuleType: ... +def is_builtin(__name: str) -> int: ... +def is_frozen(__name: str) -> bool: ... +def is_frozen_package(__name: str) -> bool: ... def lock_held() -> bool: ... def release_lock() -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_importlib_modulespec.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_importlib_modulespec.pyi old mode 100755 new mode 100644 index 026dab8d..114b78e1 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_importlib_modulespec.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_importlib_modulespec.pyi @@ -14,9 +14,15 @@ class _Loader(Protocol): def load_module(self, fullname: str) -> ModuleType: ... class ModuleSpec: - def __init__(self, name: str, loader: Optional[Loader], *, - origin: Optional[str] = ..., loader_state: Any = ..., - is_package: Optional[bool] = ...) -> None: ... + def __init__( + self, + name: str, + loader: Optional[Loader], + *, + origin: Optional[str] = ..., + loader_state: Any = ..., + is_package: Optional[bool] = ..., + ) -> None: ... name: str loader: Optional[_Loader] origin: Optional[str] diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_json.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_json.pyi old mode 100755 new mode 100644 index 217fadd1..af2b024a --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_json.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_json.pyi @@ -1,6 +1,4 @@ -"""Stub file for the '_json' module.""" - -from typing import Any, Tuple +from typing import Any, Callable, Dict, Optional, Tuple class make_encoder: sort_keys: Any @@ -11,9 +9,19 @@ class make_encoder: default: Any encoder: Any item_separator: Any - def __init__(self, markers, default, encoder, indent, key_separator, - item_separator, sort_keys, skipkeys, allow_nan) -> None: ... - def __call__(self, *args, **kwargs) -> Any: ... + def __init__( + self, + markers: Optional[Dict[int, Any]], + default: Callable[[Any], Any], + encoder: Callable[[str], str], + indent: Optional[int], + key_separator: str, + item_separator: str, + sort_keys: bool, + skipkeys: bool, + allow_nan: bool, + ) -> None: ... + def __call__(self, obj: object, _current_indent_level: int) -> Any: ... class make_scanner: object_hook: Any diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_markupbase.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_markupbase.pyi old mode 100755 new mode 100644 index 09f69c74..d8bc79f3 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_markupbase.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_markupbase.pyi @@ -5,5 +5,4 @@ class ParserBase: def error(self, message: str) -> None: ... def reset(self) -> None: ... def getpos(self) -> Tuple[int, int]: ... - def unknown_decl(self, data: str) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_operator.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_operator.pyi old mode 100755 new mode 100644 index e968fb7d..bea43886 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_operator.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_operator.pyi @@ -1,63 +1,60 @@ -# Stubs for _operator (Python 3.5) - -from typing import AnyStr - # In reality the import is the other way around, but this way we can keep the operator stub in 2and3 from operator import ( - truth as truth, + abs as abs, + add as add, + and_ as and_, + attrgetter as attrgetter, + concat as concat, contains as contains, - indexOf as indexOf, countOf as countOf, - is_ as is_, - is_not as is_not, - index as index, - add as add, - sub as sub, - mul as mul, + delitem as delitem, + eq as eq, floordiv as floordiv, - truediv as truediv, - mod as mod, - neg as neg, - pos as pos, - abs as abs, - inv as inv, - invert as invert, - length_hint as length_hint, - lshift as lshift, - rshift as rshift, - not_ as not_, - and_ as and_, - xor as xor, - or_ as or_, + ge as ge, + getitem as getitem, + gt as gt, iadd as iadd, - isub as isub, - imul as imul, + iand as iand, + iconcat as iconcat, ifloordiv as ifloordiv, - itruediv as itruediv, - imod as imod, ilshift as ilshift, - irshift as irshift, - iand as iand, - ixor as ixor, + imatmul as imatmul, + imod as imod, + imul as imul, + index as index, + indexOf as indexOf, + inv as inv, + invert as invert, ior as ior, - concat as concat, - iconcat as iconcat, - getitem as getitem, - setitem as setitem, - delitem as delitem, - pow as pow, ipow as ipow, - eq as eq, - ne as ne, - lt as lt, - le as le, - gt as gt, - ge as ge, + irshift as irshift, + is_ as is_, + is_not as is_not, + isub as isub, itemgetter as itemgetter, - attrgetter as attrgetter, - methodcaller as methodcaller, + itruediv as itruediv, + ixor as ixor, + le as le, + length_hint as length_hint, + lshift as lshift, + lt as lt, matmul as matmul, - imatmul as imatmul, + methodcaller as methodcaller, + mod as mod, + mul as mul, + ne as ne, + neg as neg, + not_ as not_, + or_ as or_, + pos as pos, + pow as pow, + rshift as rshift, + setitem as setitem, + sub as sub, + truediv as truediv, + truth as truth, + xor as xor, ) +from typing import AnyStr -def _compare_digest(a: AnyStr, b: AnyStr) -> bool: ... +def _compare_digest(__a: AnyStr, __b: AnyStr) -> bool: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_osx_support.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_osx_support.pyi new file mode 100644 index 00000000..5d67d996 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_osx_support.pyi @@ -0,0 +1,33 @@ +from typing import Dict, Iterable, List, Optional, Sequence, Tuple, TypeVar, Union + +_T = TypeVar("_T") +_K = TypeVar("_K") +_V = TypeVar("_V") + +__all__: List[str] + +_UNIVERSAL_CONFIG_VARS: Tuple[str, ...] # undocumented +_COMPILER_CONFIG_VARS: Tuple[str, ...] # undocumented +_INITPRE: str # undocumented + +def _find_executable(executable: str, path: Optional[str] = ...) -> Optional[str]: ... # undocumented +def _read_output(commandstring: str) -> Optional[str]: ... # undocumented +def _find_build_tool(toolname: str) -> str: ... # undocumented + +_SYSTEM_VERSION: Optional[str] # undocumented + +def _get_system_version() -> str: ... # undocumented +def _remove_original_values(_config_vars: Dict[str, str]) -> None: ... # undocumented +def _save_modified_value(_config_vars: Dict[str, str], cv: str, newvalue: str) -> None: ... # undocumented +def _supports_universal_builds() -> bool: ... # undocumented +def _find_appropriate_compiler(_config_vars: Dict[str, str]) -> Dict[str, str]: ... # undocumented +def _remove_universal_flags(_config_vars: Dict[str, str]) -> Dict[str, str]: ... # undocumented +def _remove_unsupported_archs(_config_vars: Dict[str, str]) -> Dict[str, str]: ... # undocumented +def _override_all_archs(_config_vars: Dict[str, str]) -> Dict[str, str]: ... # undocumented +def _check_for_unavailable_sdk(_config_vars: Dict[str, str]) -> Dict[str, str]: ... # undocumented +def compiler_fixup(compiler_so: Iterable[str], cc_args: Sequence[str]) -> List[str]: ... +def customize_config_vars(_config_vars: Dict[str, str]) -> Dict[str, str]: ... +def customize_compiler(_config_vars: Dict[str, str]) -> Dict[str, str]: ... +def get_platform_osx( + _config_vars: Dict[str, str], osname: _T, release: _K, machine: _V +) -> Tuple[Union[str, _T], Union[str, _K], Union[str, _V]]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_posixsubprocess.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_posixsubprocess.pyi old mode 100755 new mode 100644 index 67b7d7cc..05209ba0 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_posixsubprocess.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_posixsubprocess.pyi @@ -1,14 +1,24 @@ -# Stubs for _posixsubprocess - # NOTE: These are incomplete! -from typing import Tuple, Sequence, Callable +from typing import Callable, Sequence, Tuple def cloexec_pipe() -> Tuple[int, int]: ... -def fork_exec(args: Sequence[str], - executable_list: Sequence[bytes], close_fds: bool, fds_to_keep: Sequence[int], - cwd: str, env_list: Sequence[bytes], - p2cread: int, p2cwrite: int, c2pred: int, c2pwrite: int, - errread: int, errwrite: int, errpipe_read: int, - errpipe_write: int, restore_signals: int, start_new_session: int, - preexec_fn: Callable[[], None]) -> int: ... +def fork_exec( + args: Sequence[str], + executable_list: Sequence[bytes], + close_fds: bool, + fds_to_keep: Sequence[int], + cwd: str, + env_list: Sequence[bytes], + p2cread: int, + p2cwrite: int, + c2pred: int, + c2pwrite: int, + errread: int, + errwrite: int, + errpipe_read: int, + errpipe_write: int, + restore_signals: int, + start_new_session: int, + preexec_fn: Callable[[], None], +) -> int: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_pydecimal.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_pydecimal.pyi new file mode 100644 index 00000000..56fbddff --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_pydecimal.pyi @@ -0,0 +1,3 @@ +# This is a slight lie, the implementations aren't exactly identical +# However, in all likelihood, the differences are inconsequential +from decimal import * diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_sitebuiltins.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_sitebuiltins.pyi new file mode 100644 index 00000000..e0e9316a --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_sitebuiltins.pyi @@ -0,0 +1,16 @@ +from typing import ClassVar, Iterable, NoReturn, Optional +from typing_extensions import Literal + +class Quitter: + name: str + eof: str + def __init__(self, name: str, eof: str) -> None: ... + def __call__(self, code: Optional[int] = ...) -> NoReturn: ... + +class _Printer: + MAXLINES: ClassVar[Literal[23]] + def __init__(self, name: str, data: str, files: Iterable[str] = ..., dirs: Iterable[str] = ...) -> None: ... + def __call__(self) -> None: ... + +class _Helper: + def __call__(self, request: object) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_stat.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_stat.pyi old mode 100755 new mode 100644 index ffd28cb8..634f7da0 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_stat.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_stat.pyi @@ -1,5 +1,3 @@ -"""Stub file for the '_stat' module.""" - SF_APPEND: int SF_ARCHIVED: int SF_IMMUTABLE: int @@ -54,7 +52,6 @@ UF_OPAQUE: int def S_IMODE(mode: int) -> int: ... def S_IFMT(mode: int) -> int: ... - def S_ISBLK(mode: int) -> bool: ... def S_ISCHR(mode: int) -> bool: ... def S_ISDIR(mode: int) -> bool: ... @@ -65,5 +62,4 @@ def S_ISPORT(mode: int) -> bool: ... def S_ISREG(mode: int) -> bool: ... def S_ISSOCK(mode: int) -> bool: ... def S_ISWHT(mode: int) -> bool: ... - def filemode(mode: int) -> str: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_subprocess.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_subprocess.pyi deleted file mode 100755 index 555a8d79..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_subprocess.pyi +++ /dev/null @@ -1,38 +0,0 @@ -# Stubs for _subprocess - -# NOTE: These are incomplete! - -from typing import Mapping, Any, Tuple - -CREATE_NEW_CONSOLE: int -CREATE_NEW_PROCESS_GROUP: int -STD_INPUT_HANDLE: int -STD_OUTPUT_HANDLE: int -STD_ERROR_HANDLE: int -SW_HIDE: int -STARTF_USESTDHANDLES: int -STARTF_USESHOWWINDOW: int -INFINITE: int -DUPLICATE_SAME_ACCESS: int -WAIT_OBJECT_0: int - -# TODO not exported by the Python module -class Handle: - def Close(self) -> None: ... - -def GetVersion() -> int: ... -def GetExitCodeProcess(handle: Handle) -> int: ... -def WaitForSingleObject(handle: Handle, timeout: int) -> int: ... -def CreateProcess(executable: str, cmd_line: str, - proc_attrs, thread_attrs, - inherit: int, flags: int, - env_mapping: Mapping[str, str], - curdir: str, - startupinfo: Any) -> Tuple[Any, Handle, int, int]: ... -def GetModuleFileName(module: int) -> str: ... -def GetCurrentProcess() -> Handle: ... -def DuplicateHandle(source_proc: Handle, source: Handle, target_proc: Handle, - target: Any, access: int, inherit: int) -> int: ... -def CreatePipe(pipe_attrs, size: int) -> Tuple[Handle, Handle]: ... -def GetStdHandle(arg: int) -> int: ... -def TerminateProcess(handle: Handle, exit_code: int) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_thread.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_thread.pyi old mode 100755 new mode 100644 index 051edefb..51367849 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_thread.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_thread.pyi @@ -1,9 +1,7 @@ -# Stubs for _thread - import sys from threading import Thread from types import TracebackType -from typing import Any, Callable, Dict, NamedTuple, NoReturn, Optional, Tuple, Type +from typing import Any, Callable, Dict, NoReturn, Optional, Tuple, Type error = RuntimeError @@ -17,10 +15,7 @@ class LockType: def locked(self) -> bool: ... def __enter__(self) -> bool: ... def __exit__( - self, - type: Optional[Type[BaseException]], - value: Optional[BaseException], - traceback: Optional[TracebackType], + self, type: Optional[Type[BaseException]], value: Optional[BaseException], traceback: Optional[TracebackType] ) -> None: ... def start_new_thread(function: Callable[..., Any], args: Tuple[Any, ...], kwargs: Dict[str, Any] = ...) -> int: ... @@ -30,15 +25,17 @@ def allocate_lock() -> LockType: ... def get_ident() -> int: ... def stack_size(size: int = ...) -> int: ... -TIMEOUT_MAX: int +TIMEOUT_MAX: float if sys.version_info >= (3, 8): def get_native_id() -> int: ... # only available on some platforms - - class ExceptHookArgs(NamedTuple): - exc_type: Type[BaseException] - exc_value: Optional[BaseException] - exc_traceback: Optional[TracebackType] - thread: Optional[Thread] - def _ExceptHookArgs(args) -> ExceptHookArgs: ... - _excepthook: Callable[[ExceptHookArgs], Any] + class _ExceptHookArgs(Tuple[Type[BaseException], Optional[BaseException], Optional[TracebackType], Optional[Thread]]): + @property + def exc_type(self) -> Type[BaseException]: ... + @property + def exc_value(self) -> Optional[BaseException]: ... + @property + def exc_traceback(self) -> Optional[TracebackType]: ... + @property + def thread(self) -> Optional[Thread]: ... + _excepthook: Callable[[_ExceptHookArgs], Any] diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_threading_local.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_threading_local.pyi old mode 100755 new mode 100644 index 426496b1..ed6eb8d9 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_threading_local.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_threading_local.pyi @@ -1,4 +1,3 @@ -# Source: https://github.com/python/cpython/blob/master/Lib/_threading_local.py from typing import Any, Dict, Tuple from weakref import ReferenceType diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_tkinter.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_tkinter.pyi new file mode 100644 index 00000000..bc42dbf8 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_tkinter.pyi @@ -0,0 +1,93 @@ +from typing import Any, Tuple, Union + +# _tkinter is meant to be only used internally by tkinter, but some tkinter +# functions e.g. return _tkinter.Tcl_Obj objects. Tcl_Obj represents a Tcl +# object that hasn't been converted to a string. +# +# There are not many ways to get Tcl_Objs from tkinter, and I'm not sure if the +# only existing ways are supposed to return Tcl_Objs as opposed to returning +# strings. Here's one of these things that return Tcl_Objs: +# +# >>> import tkinter +# >>> text = tkinter.Text() +# >>> text.tag_add('foo', '1.0', 'end') +# >>> text.tag_ranges('foo') +# (, ) +class Tcl_Obj: + string: str # str(tclobj) returns this + typename: str + +class TclError(Exception): ... + +# This class allows running Tcl code. Tkinter uses it internally a lot, and +# it's often handy to drop a piece of Tcl code into a tkinter program. Example: +# +# >>> import tkinter, _tkinter +# >>> tkapp = tkinter.Tk().tk +# >>> isinstance(tkapp, _tkinter.TkappType) +# True +# >>> tkapp.call('set', 'foo', (1,2,3)) +# (1, 2, 3) +# >>> tkapp.eval('return $foo') +# '1 2 3' +# >>> +# +# call args can be pretty much anything. Also, call(some_tuple) is same as call(*some_tuple). +# +# eval always returns str because _tkinter_tkapp_eval_impl in _tkinter.c calls +# Tkapp_UnicodeResult, and it returns a string when it succeeds. +class TkappType: + # Please keep in sync with tkinter.Tk + def call(self, __command: Union[str, Tuple[Any, ...]], *args: Any) -> Any: ... + def eval(self, __script: str) -> str: ... + adderrorinfo: Any + createcommand: Any + createfilehandler: Any + createtimerhandler: Any + deletecommand: Any + deletefilehandler: Any + dooneevent: Any + evalfile: Any + exprboolean: Any + exprdouble: Any + exprlong: Any + exprstring: Any + getboolean: Any + getdouble: Any + getint: Any + getvar: Any + globalgetvar: Any + globalsetvar: Any + globalunsetvar: Any + interpaddr: Any + loadtk: Any + mainloop: Any + quit: Any + record: Any + setvar: Any + split: Any + splitlist: Any + unsetvar: Any + wantobjects: Any + willdispatch: Any + +ALL_EVENTS: int +FILE_EVENTS: int +IDLE_EVENTS: int +TIMER_EVENTS: int +WINDOW_EVENTS: int + +DONT_WAIT: int +EXCEPTION: int +READABLE: int +WRITABLE: int + +TCL_VERSION: str +TK_VERSION: str + +# TODO: figure out what these are (with e.g. help()) and get rid of Any +TkttType: Any +_flatten: Any +create: Any +getbusywaitinterval: Any +setbusywaitinterval: Any diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_tracemalloc.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_tracemalloc.pyi old mode 100755 new mode 100644 index e8a7168a..4319ed46 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_tracemalloc.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_tracemalloc.pyi @@ -1,16 +1,17 @@ -"""Stub file for the '_tracemalloc' module.""" -# This is an autogenerated file. It serves as a starting point -# for a more precise manual annotation of this module. -# Feel free to edit the source below, but remove this header when you do. +import sys +from tracemalloc import _FrameTupleT, _TraceTupleT +from typing import Optional, Sequence, Tuple -from typing import Any, Tuple - -def _get_object_traceback(*args, **kwargs) -> Any: ... -def _get_traces() -> Any: ... +def _get_object_traceback(__obj: object) -> Optional[Sequence[_FrameTupleT]]: ... +def _get_traces() -> Sequence[_TraceTupleT]: ... def clear_traces() -> None: ... def get_traceback_limit() -> int: ... -def get_traced_memory() -> Tuple[Any, ...]: ... -def get_tracemalloc_memory() -> Any: ... +def get_traced_memory() -> Tuple[int, int]: ... +def get_tracemalloc_memory() -> int: ... def is_tracing() -> bool: ... -def start(*args, **kwargs) -> None: ... + +if sys.version_info >= (3, 9): + def reset_peak() -> None: ... + +def start(__nframe: int = ...) -> None: ... def stop() -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_winapi.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_winapi.pyi old mode 100755 new mode 100644 index 18a1ee93..09245b52 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_winapi.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/_winapi.pyi @@ -1,10 +1,6 @@ import sys -from typing import Any, Union, Tuple, Optional, overload, Dict, NoReturn, Sequence - -if sys.version_info >= (3, 8): - from typing import Literal -else: - from typing_extensions import Literal +from typing import Any, Dict, NoReturn, Optional, Sequence, Tuple, Union, overload +from typing_extensions import Literal CREATE_NEW_CONSOLE: int CREATE_NEW_PROCESS_GROUP: int @@ -50,54 +46,89 @@ WAIT_ABANDONED_0: int WAIT_OBJECT_0: int WAIT_TIMEOUT: int -def CloseHandle(handle: int) -> None: ... - +def CloseHandle(__handle: int) -> None: ... @overload def ConnectNamedPipe(handle: int, overlapped: Literal[True]) -> Overlapped: ... @overload def ConnectNamedPipe(handle: int, overlapped: Literal[False] = ...) -> None: ... @overload -def ConnectNamedPipe(handle: int, overlapped: bool) -> Any: ... +def ConnectNamedPipe(handle: int, overlapped: bool) -> Optional[Overlapped]: ... +def CreateFile( + __file_name: str, + __desired_access: int, + __share_mode: int, + __security_attributes: int, + __creation_disposition: int, + __flags_and_attributes: int, + __template_file: int, +) -> int: ... +def CreateJunction(__src_path: str, __dst_path: str) -> None: ... +def CreateNamedPipe( + __name: str, + __open_mode: int, + __pipe_mode: int, + __max_instances: int, + __out_buffer_size: int, + __in_buffer_size: int, + __default_timeout: int, + __security_attributes: int, +) -> int: ... +def CreatePipe(__pipe_attrs: Any, __size: int) -> Tuple[int, int]: ... +def CreateProcess( + __application_name: Optional[str], + __command_line: Optional[str], + __proc_attrs: Any, + __thread_attrs: Any, + __inherit_handles: bool, + __creation_flags: int, + __env_mapping: Dict[str, str], + __current_directory: Optional[str], + __startup_info: Any, +) -> Tuple[int, int, int, int]: ... +def DuplicateHandle( + __source_process_handle: int, + __source_handle: int, + __target_process_handle: int, + __desired_access: int, + __inherit_handle: bool, + __options: int = ..., +) -> int: ... +def ExitProcess(__ExitCode: int) -> NoReturn: ... + +if sys.version_info >= (3, 7): + def GetACP() -> int: ... + def GetFileType(handle: int) -> int: ... -def CreateFile(file_name: str, desired_access: int, share_mode: int, security_attributes: int, creation_disposition: int, flags_and_attributes: int, template_file: int) -> int: ... -def CreateJunction(src_path: str, dest_path: str) -> None: ... -def CreateNamedPipe(name: str, open_mode: int, pipe_mode: int, max_instances: int, out_buffer_size: int, in_buffer_size: int, default_timeout: int, security_attributes: int) -> int: ... -def CreatePipe(pipe_attrs: Any, size: int) -> Tuple[int, int]: ... -def CreateProcess(application_name: Optional[str], command_line: Optional[str], proc_attrs: Any, thread_attrs: Any, inherit_handles: bool, creation_flags: int, env_mapping: Dict[str, str], cwd: Optional[str], startup_info: Any) -> Tuple[int, int, int, int]: ... -def DuplicateHandle(source_process_handle: int, source_handle: int, target_process_handle: int, desired_access: int, inherit_handle: bool, options: int = ...) -> int: ... -def ExitProcess(ExitCode: int) -> NoReturn: ... -def GetACP() -> int: ... -def GetFileType(handle: int) -> int: ... def GetCurrentProcess() -> int: ... -def GetExitCodeProcess(process: int) -> int: ... +def GetExitCodeProcess(__process: int) -> int: ... def GetLastError() -> int: ... -def GetModuleFileName(module_handle: int) -> str: ... -def GetStdHandle(std_handle: int) -> int: ... +def GetModuleFileName(__module_handle: int) -> str: ... +def GetStdHandle(__std_handle: int) -> int: ... def GetVersion() -> int: ... -def OpenProcess(desired_access: int, inherit_handle: bool, process_id: int) -> int: ... -def PeekNamedPipe(handle: int, size: int = ...) -> Union[Tuple[int, int], Tuple[bytes, int, int]]: ... - -# TODO: once literal types are supported, overload with Literal[True/False] +def OpenProcess(__desired_access: int, __inherit_handle: bool, __process_id: int) -> int: ... +def PeekNamedPipe(__handle: int, __size: int = ...) -> Union[Tuple[int, int], Tuple[bytes, int, int]]: ... @overload -def ReadFile(handle: int, size: int, overlapped: Union[int, bool]) -> Any: ... +def ReadFile(handle: int, size: int, overlapped: Literal[True]) -> Tuple[Overlapped, int]: ... @overload -def ReadFile(handle: int, size: int) -> Tuple[int, int]: ... - -def SetNamedPipeHandleState(named_pipe: int, mode: Optional[int], max_collection_count: Optional[int], collect_data_timeout: Optional[int]) -> None: ... -def TerminateProcess(handle: int, exit_code: int) -> None: ... -def WaitForMultipleObjects(handle_seq: Sequence[int], wait_flag: bool, milliseconds: int = ...) -> int: ... -def WaitForSingleObject(handle: int, milliseconds: int) -> int: ... -def WaitNamedPipe(name: str, timeout: int) -> None: ... - -# TODO: once literal types are supported, overload with Literal[True/False] +def ReadFile(handle: int, size: int, overlapped: Literal[False] = ...) -> Tuple[bytes, int]: ... @overload -def WriteFile(handle: int, buffer: bytes, overlapped: Union[int, bool]) -> Any: ... +def ReadFile(handle: int, size: int, overlapped: Union[int, bool]) -> Tuple[Any, int]: ... +def SetNamedPipeHandleState( + __named_pipe: int, __mode: Optional[int], __max_collection_count: Optional[int], __collect_data_timeout: Optional[int] +) -> None: ... +def TerminateProcess(__handle: int, __exit_code: int) -> None: ... +def WaitForMultipleObjects(__handle_seq: Sequence[int], __wait_flag: bool, __milliseconds: int = ...) -> int: ... +def WaitForSingleObject(__handle: int, __milliseconds: int) -> int: ... +def WaitNamedPipe(__name: str, __timeout: int) -> None: ... @overload -def WriteFile(handle: int, buffer: bytes) -> Tuple[bytes, int]: ... - +def WriteFile(handle: int, buffer: bytes, overlapped: Literal[True]) -> Tuple[Overlapped, int]: ... +@overload +def WriteFile(handle: int, buffer: bytes, overlapped: Literal[False] = ...) -> Tuple[int, int]: ... +@overload +def WriteFile(handle: int, buffer: bytes, overlapped: Union[int, bool]) -> Tuple[Any, int]: ... class Overlapped: event: int = ... - def GetOverlappedResult(self, wait: bool) -> Tuple[int, int]: ... + def GetOverlappedResult(self, __wait: bool) -> Tuple[int, int]: ... def cancel(self) -> None: ... def getbuffer(self) -> Optional[bytes]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/abc.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/abc.pyi old mode 100755 new mode 100644 index e9c530d2..6be75c3b --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/abc.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/abc.pyi @@ -1,15 +1,16 @@ from typing import Any, Callable, Type, TypeVar -# Stubs for abc. -_T = TypeVar('_T') -_FuncT = TypeVar('_FuncT', bound=Callable[..., Any]) +_T = TypeVar("_T") +_FuncT = TypeVar("_FuncT", bound=Callable[..., Any]) -# Thesee definitions have special processing in mypy +# These definitions have special processing in mypy class ABCMeta(type): def register(cls: ABCMeta, subclass: Type[_T]) -> Type[_T]: ... def abstractmethod(callable: _FuncT) -> _FuncT: ... + class abstractproperty(property): ... + # These two are deprecated and not supported by mypy def abstractstaticmethod(callable: _FuncT) -> _FuncT: ... def abstractclassmethod(callable: _FuncT) -> _FuncT: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/ast.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/ast.pyi old mode 100755 new mode 100644 index c517aa6e..ff1cd00c --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/ast.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/ast.pyi @@ -1,27 +1,157 @@ -import sys # Rename typing to _typing, as not to conflict with typing imported # from _ast below when loaded in an unorthodox way by the Dropbox # internal Bazel integration. -import typing as _typing -from typing import Any, Iterator, Optional, TypeVar, Union, overload # The same unorthodox Bazel integration causes issues with sys, which # is imported in both modules. unfortunately we can't just rename sys, # since mypy only supports version checks with a sys that is named # sys. +import sys +import typing as _typing +from typing import Any, Iterator, Optional, TypeVar, Union, overload +from typing_extensions import Literal + from _ast import * # type: ignore if sys.version_info >= (3, 8): - from typing import Literal -else: - from typing_extensions import Literal + class Num(Constant): + value: complex + class Str(Constant): + value: str + # Aliases for value, for backwards compatibility + s: str + class Bytes(Constant): + value: bytes + # Aliases for value, for backwards compatibility + s: bytes + class NameConstant(Constant): ... + class Ellipsis(Constant): ... + +if sys.version_info >= (3, 9): + class slice(AST): ... + class ExtSlice(slice): ... + class Index(slice): ... + class Suite(mod): ... + class AugLoad(expr_context): ... + class AugStore(expr_context): ... + class Param(expr_context): ... class NodeVisitor: def visit(self, node: AST) -> Any: ... def generic_visit(self, node: AST) -> Any: ... + def visit_Module(self, node: Module) -> Any: ... + def visit_Interactive(self, node: Interactive) -> Any: ... + def visit_Expression(self, node: Expression) -> Any: ... + def visit_FunctionDef(self, node: FunctionDef) -> Any: ... + def visit_AsyncFunctionDef(self, node: AsyncFunctionDef) -> Any: ... + def visit_ClassDef(self, node: ClassDef) -> Any: ... + def visit_Return(self, node: Return) -> Any: ... + def visit_Delete(self, node: Delete) -> Any: ... + def visit_Assign(self, node: Assign) -> Any: ... + def visit_AugAssign(self, node: AugAssign) -> Any: ... + def visit_AnnAssign(self, node: AnnAssign) -> Any: ... + def visit_For(self, node: For) -> Any: ... + def visit_AsyncFor(self, node: AsyncFor) -> Any: ... + def visit_While(self, node: While) -> Any: ... + def visit_If(self, node: If) -> Any: ... + def visit_With(self, node: With) -> Any: ... + def visit_AsyncWith(self, node: AsyncWith) -> Any: ... + def visit_Raise(self, node: Raise) -> Any: ... + def visit_Try(self, node: Try) -> Any: ... + def visit_Assert(self, node: Assert) -> Any: ... + def visit_Import(self, node: Import) -> Any: ... + def visit_ImportFrom(self, node: ImportFrom) -> Any: ... + def visit_Global(self, node: Global) -> Any: ... + def visit_Nonlocal(self, node: Nonlocal) -> Any: ... + def visit_Expr(self, node: Expr) -> Any: ... + def visit_Pass(self, node: Pass) -> Any: ... + def visit_Break(self, node: Break) -> Any: ... + def visit_Continue(self, node: Continue) -> Any: ... + def visit_Slice(self, node: Slice) -> Any: ... + def visit_BoolOp(self, node: BoolOp) -> Any: ... + def visit_BinOp(self, node: BinOp) -> Any: ... + def visit_UnaryOp(self, node: UnaryOp) -> Any: ... + def visit_Lambda(self, node: Lambda) -> Any: ... + def visit_IfExp(self, node: IfExp) -> Any: ... + def visit_Dict(self, node: Dict) -> Any: ... + def visit_Set(self, node: Set) -> Any: ... + def visit_ListComp(self, node: ListComp) -> Any: ... + def visit_SetComp(self, node: SetComp) -> Any: ... + def visit_DictComp(self, node: DictComp) -> Any: ... + def visit_GeneratorExp(self, node: GeneratorExp) -> Any: ... + def visit_Await(self, node: Await) -> Any: ... + def visit_Yield(self, node: Yield) -> Any: ... + def visit_YieldFrom(self, node: YieldFrom) -> Any: ... + def visit_Compare(self, node: Compare) -> Any: ... + def visit_Call(self, node: Call) -> Any: ... + def visit_FormattedValue(self, node: FormattedValue) -> Any: ... + def visit_JoinedStr(self, node: JoinedStr) -> Any: ... + def visit_Constant(self, node: Constant) -> Any: ... + if sys.version_info >= (3, 8): + def visit_NamedExpr(self, node: NamedExpr) -> Any: ... + def visit_Attribute(self, node: Attribute) -> Any: ... + def visit_Subscript(self, node: Subscript) -> Any: ... + def visit_Starred(self, node: Starred) -> Any: ... + def visit_Name(self, node: Name) -> Any: ... + def visit_List(self, node: List) -> Any: ... + def visit_Tuple(self, node: Tuple) -> Any: ... + def visit_Del(self, node: Del) -> Any: ... + def visit_Load(self, node: Load) -> Any: ... + def visit_Store(self, node: Store) -> Any: ... + def visit_And(self, node: And) -> Any: ... + def visit_Or(self, node: Or) -> Any: ... + def visit_Add(self, node: Add) -> Any: ... + def visit_BitAnd(self, node: BitAnd) -> Any: ... + def visit_BitOr(self, node: BitOr) -> Any: ... + def visit_BitXor(self, node: BitXor) -> Any: ... + def visit_Div(self, node: Div) -> Any: ... + def visit_FloorDiv(self, node: FloorDiv) -> Any: ... + def visit_LShift(self, node: LShift) -> Any: ... + def visit_Mod(self, node: Mod) -> Any: ... + def visit_Mult(self, node: Mult) -> Any: ... + def visit_MatMult(self, node: MatMult) -> Any: ... + def visit_Pow(self, node: Pow) -> Any: ... + def visit_RShift(self, node: RShift) -> Any: ... + def visit_Sub(self, node: Sub) -> Any: ... + def visit_Invert(self, node: Invert) -> Any: ... + def visit_Not(self, node: Not) -> Any: ... + def visit_UAdd(self, node: UAdd) -> Any: ... + def visit_USub(self, node: USub) -> Any: ... + def visit_Eq(self, node: Eq) -> Any: ... + def visit_Gt(self, node: Gt) -> Any: ... + def visit_GtE(self, node: GtE) -> Any: ... + def visit_In(self, node: In) -> Any: ... + def visit_Is(self, node: Is) -> Any: ... + def visit_IsNot(self, node: IsNot) -> Any: ... + def visit_Lt(self, node: Lt) -> Any: ... + def visit_LtE(self, node: LtE) -> Any: ... + def visit_NotEq(self, node: NotEq) -> Any: ... + def visit_NotIn(self, node: NotIn) -> Any: ... + def visit_comprehension(self, node: comprehension) -> Any: ... + def visit_ExceptHandler(self, node: ExceptHandler) -> Any: ... + def visit_arguments(self, node: arguments) -> Any: ... + def visit_arg(self, node: arg) -> Any: ... + def visit_keyword(self, node: keyword) -> Any: ... + def visit_alias(self, node: alias) -> Any: ... + def visit_withitem(self, node: withitem) -> Any: ... + # visit methods for deprecated nodes + def visit_ExtSlice(self, node: ExtSlice) -> Any: ... + def visit_Index(self, node: Index) -> Any: ... + def visit_Suite(self, node: Suite) -> Any: ... + def visit_AugLoad(self, node: AugLoad) -> Any: ... + def visit_AugStore(self, node: AugStore) -> Any: ... + def visit_Param(self, node: Param) -> Any: ... + def visit_Num(self, node: Num) -> Any: ... + def visit_Str(self, node: Str) -> Any: ... + def visit_Bytes(self, node: Bytes) -> Any: ... + def visit_NameConstant(self, node: NameConstant) -> Any: ... + def visit_Ellipsis(self, node: Ellipsis) -> Any: ... class NodeTransformer(NodeVisitor): - def generic_visit(self, node: AST) -> Optional[AST]: ... + def generic_visit(self, node: AST) -> AST: ... + # TODO: Override the visit_* methods with better return types. + # The usual return type is Optional[AST], but Iterable[AST] + # is also allowed in some cases -- this needs to be mapped. _T = TypeVar("_T", bound=AST) @@ -31,6 +161,7 @@ if sys.version_info >= (3, 8): source: Union[str, bytes], filename: Union[str, bytes] = ..., mode: Literal["exec"] = ..., + *, type_comments: bool = ..., feature_version: Union[None, int, _typing.Tuple[int, int]] = ..., ) -> Module: ... @@ -39,6 +170,7 @@ if sys.version_info >= (3, 8): source: Union[str, bytes], filename: Union[str, bytes] = ..., mode: str = ..., + *, type_comments: bool = ..., feature_version: Union[None, int, _typing.Tuple[int, int]] = ..., ) -> AST: ... @@ -49,13 +181,27 @@ else: @overload def parse(source: Union[str, bytes], filename: Union[str, bytes] = ..., mode: str = ...) -> AST: ... +if sys.version_info >= (3, 9): + def unparse(ast_obj: AST) -> str: ... + def copy_location(new_node: _T, old_node: AST) -> _T: ... -def dump(node: AST, annotate_fields: bool = ..., include_attributes: bool = ...) -> str: ... + +if sys.version_info >= (3, 9): + def dump( + node: AST, annotate_fields: bool = ..., include_attributes: bool = ..., *, indent: Union[int, str, None] = ... + ) -> str: ... + +else: + def dump(node: AST, annotate_fields: bool = ..., include_attributes: bool = ...) -> str: ... + def fix_missing_locations(node: _T) -> _T: ... -def get_docstring(node: AST, clean: bool = ...) -> str: ... +def get_docstring(node: AST, clean: bool = ...) -> Optional[str]: ... def increment_lineno(node: _T, n: int = ...) -> _T: ... def iter_child_nodes(node: AST) -> Iterator[AST]: ... def iter_fields(node: AST) -> Iterator[_typing.Tuple[str, Any]]: ... def literal_eval(node_or_string: Union[str, AST]) -> Any: ... -def get_source_segment(source: str, node: AST, *, padded: bool = ...) -> Optional[str]: ... + +if sys.version_info >= (3, 8): + def get_source_segment(source: str, node: AST, *, padded: bool = ...) -> Optional[str]: ... + def walk(node: AST) -> Iterator[AST]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/__init__.pyi old mode 100755 new mode 100644 index 57747efb..42e7aa9b --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/__init__.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/__init__.pyi @@ -1,44 +1,58 @@ import sys from typing import Type -from asyncio.coroutines import ( - coroutine as coroutine, - iscoroutinefunction as iscoroutinefunction, - iscoroutine as iscoroutine, +from .base_events import BaseEventLoop as BaseEventLoop +from .coroutines import coroutine as coroutine, iscoroutine as iscoroutine, iscoroutinefunction as iscoroutinefunction +from .events import ( + AbstractEventLoop as AbstractEventLoop, + AbstractEventLoopPolicy as AbstractEventLoopPolicy, + AbstractServer as AbstractServer, + Handle as Handle, + TimerHandle as TimerHandle, + _get_running_loop as _get_running_loop, + _set_running_loop as _set_running_loop, + get_child_watcher as get_child_watcher, + get_event_loop as get_event_loop, + get_event_loop_policy as get_event_loop_policy, + new_event_loop as new_event_loop, + set_child_watcher as set_child_watcher, + set_event_loop as set_event_loop, + set_event_loop_policy as set_event_loop_policy, +) +from .futures import Future as Future, isfuture as isfuture, wrap_future as wrap_future +from .locks import ( + BoundedSemaphore as BoundedSemaphore, + Condition as Condition, + Event as Event, + Lock as Lock, + Semaphore as Semaphore, ) -from asyncio.protocols import ( +from .protocols import ( BaseProtocol as BaseProtocol, - Protocol as Protocol, DatagramProtocol as DatagramProtocol, + Protocol as Protocol, SubprocessProtocol as SubprocessProtocol, ) -from asyncio.streams import ( +from .queues import ( + LifoQueue as LifoQueue, + PriorityQueue as PriorityQueue, + Queue as Queue, + QueueEmpty as QueueEmpty, + QueueFull as QueueFull, +) +from .streams import ( StreamReader as StreamReader, - StreamWriter as StreamWriter, StreamReaderProtocol as StreamReaderProtocol, + StreamWriter as StreamWriter, open_connection as open_connection, start_server as start_server, ) -from asyncio.subprocess import ( - create_subprocess_exec as create_subprocess_exec, - create_subprocess_shell as create_subprocess_shell, -) -from asyncio.transports import ( - BaseTransport as BaseTransport, - ReadTransport as ReadTransport, - WriteTransport as WriteTransport, - Transport as Transport, - DatagramTransport as DatagramTransport, - SubprocessTransport as SubprocessTransport, -) -from asyncio.futures import ( - Future as Future, - wrap_future as wrap_future, -) -from asyncio.tasks import ( +from .subprocess import create_subprocess_exec as create_subprocess_exec, create_subprocess_shell as create_subprocess_shell +from .tasks import ( + ALL_COMPLETED as ALL_COMPLETED, FIRST_COMPLETED as FIRST_COMPLETED, FIRST_EXCEPTION as FIRST_EXCEPTION, - ALL_COMPLETED as ALL_COMPLETED, + Task as Task, as_completed as as_completed, ensure_future as ensure_future, gather as gather, @@ -47,76 +61,20 @@ from asyncio.tasks import ( sleep as sleep, wait as wait, wait_for as wait_for, - Task as Task, -) -from asyncio.base_events import ( - BaseEventLoop as BaseEventLoop, - Server as Server -) -from asyncio.events import ( - AbstractEventLoopPolicy as AbstractEventLoopPolicy, - AbstractEventLoop as AbstractEventLoop, - AbstractServer as AbstractServer, - Handle as Handle, - TimerHandle as TimerHandle, - get_event_loop_policy as get_event_loop_policy, - set_event_loop_policy as set_event_loop_policy, - get_event_loop as get_event_loop, - set_event_loop as set_event_loop, - new_event_loop as new_event_loop, - get_child_watcher as get_child_watcher, - set_child_watcher as set_child_watcher, -) -from asyncio.queues import ( - Queue as Queue, - PriorityQueue as PriorityQueue, - LifoQueue as LifoQueue, - QueueFull as QueueFull, - QueueEmpty as QueueEmpty, -) -from asyncio.locks import ( - Lock as Lock, - Event as Event, - Condition as Condition, - Semaphore as Semaphore, - BoundedSemaphore as BoundedSemaphore, ) - -from asyncio.futures import isfuture as isfuture -from asyncio.events import ( - _set_running_loop as _set_running_loop, - _get_running_loop as _get_running_loop, +from .transports import ( + BaseTransport as BaseTransport, + DatagramTransport as DatagramTransport, + ReadTransport as ReadTransport, + SubprocessTransport as SubprocessTransport, + Transport as Transport, + WriteTransport as WriteTransport, ) -if sys.platform == 'win32': - from asyncio.windows_events import * -else: - from asyncio.streams import ( - open_unix_connection as open_unix_connection, - start_unix_server as start_unix_server, - ) - DefaultEventLoopPolicy: Type[AbstractEventLoopPolicy] if sys.version_info >= (3, 7): - from asyncio.events import ( - get_running_loop as get_running_loop, - ) - from asyncio.tasks import ( - all_tasks as all_tasks, - create_task as create_task, - current_task as current_task, - ) - from asyncio.runners import ( - run as run, - ) - -if sys.platform != 'win32': - # This is already imported above on Windows. - SelectorEventLoop: Type[AbstractEventLoop] - -# TODO: AbstractChildWatcher (UNIX only) - + from .events import get_running_loop as get_running_loop if sys.version_info >= (3, 8): - from asyncio.exceptions import ( + from .exceptions import ( CancelledError as CancelledError, IncompleteReadError as IncompleteReadError, InvalidStateError as InvalidStateError, @@ -125,15 +83,34 @@ if sys.version_info >= (3, 8): TimeoutError as TimeoutError, ) else: - from asyncio.events import ( - SendfileNotAvailableError as SendfileNotAvailableError - ) - from asyncio.futures import ( - CancelledError as CancelledError, - TimeoutError as TimeoutError, - InvalidStateError as InvalidStateError, - ) - from asyncio.streams import ( - IncompleteReadError as IncompleteReadError, - LimitOverrunError as LimitOverrunError, + if sys.version_info >= (3, 7): + from .events import SendfileNotAvailableError as SendfileNotAvailableError + from .futures import CancelledError as CancelledError, InvalidStateError as InvalidStateError, TimeoutError as TimeoutError + from .streams import IncompleteReadError as IncompleteReadError, LimitOverrunError as LimitOverrunError + +if sys.version_info >= (3, 7): + from .protocols import BufferedProtocol as BufferedProtocol + +if sys.version_info >= (3, 7): + from .runners import run as run + +if sys.version_info >= (3, 7): + from .tasks import all_tasks as all_tasks, create_task as create_task, current_task as current_task +if sys.version_info >= (3, 9): + from .threads import to_thread as to_thread + +DefaultEventLoopPolicy: Type[AbstractEventLoopPolicy] +if sys.platform == "win32": + from .windows_events import * + +if sys.platform != "win32": + from .streams import open_unix_connection as open_unix_connection, start_unix_server as start_unix_server + from .unix_events import ( + AbstractChildWatcher as AbstractChildWatcher, + FastChildWatcher as FastChildWatcher, + SafeChildWatcher as SafeChildWatcher, + SelectorEventLoop as SelectorEventLoop, ) + + if sys.version_info >= (3, 8): + from .unix_events import MultiLoopChildWatcher as MultiLoopChildWatcher, ThreadedChildWatcher as ThreadedChildWatcher diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/base_events.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/base_events.pyi old mode 100755 new mode 100644 index 3041c289..33c0f87d --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/base_events.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/base_events.pyi @@ -1,19 +1,20 @@ -import selectors -from socket import socket, _Address, _RetAddress import ssl import sys -from typing import Any, Awaitable, Callable, Dict, Generator, IO, List, Optional, Sequence, Tuple, TypeVar, Union, overload +from _typeshed import FileDescriptorLike from abc import ABCMeta -from asyncio.futures import Future from asyncio.events import AbstractEventLoop, AbstractServer, Handle, TimerHandle +from asyncio.futures import Future from asyncio.protocols import BaseProtocol from asyncio.tasks import Task from asyncio.transports import BaseTransport +from socket import AddressFamily, SocketKind, _Address, _RetAddress, socket +from typing import IO, Any, Awaitable, Callable, Dict, Generator, List, Optional, Sequence, Tuple, TypeVar, Union, overload +from typing_extensions import Literal if sys.version_info >= (3, 7): from contextvars import Context -_T = TypeVar('_T') +_T = TypeVar("_T") _Context = Dict[str, Any] _ExceptionHandler = Callable[[AbstractEventLoop, _Context], Any] _ProtocolFactory = Callable[[], BaseProtocol] @@ -24,27 +25,24 @@ class Server(AbstractServer): ... class BaseEventLoop(AbstractEventLoop, metaclass=ABCMeta): def run_forever(self) -> None: ... - # Can't use a union, see mypy issue # 1873. @overload def run_until_complete(self, future: Generator[Any, None, _T]) -> _T: ... @overload def run_until_complete(self, future: Awaitable[_T]) -> _T: ... - def stop(self) -> None: ... def is_running(self) -> bool: ... def is_closed(self) -> bool: ... def close(self) -> None: ... - if sys.version_info >= (3, 6): - async def shutdown_asyncgens(self) -> None: ... + async def shutdown_asyncgens(self) -> None: ... # Methods scheduling callbacks. All these return Handles. if sys.version_info >= (3, 7): def call_soon(self, callback: Callable[..., Any], *args: Any, context: Optional[Context] = ...) -> Handle: ... def call_later( - self, delay: float, callback: Callable[..., Any], *args: Any, context: Optional[Context] = ..., + self, delay: float, callback: Callable[..., Any], *args: Any, context: Optional[Context] = ... ) -> TimerHandle: ... def call_at( - self, when: float, callback: Callable[..., Any], *args: Any, context: Optional[Context] = ..., + self, when: float, callback: Callable[..., Any], *args: Any, context: Optional[Context] = ... ) -> TimerHandle: ... else: def call_soon(self, callback: Callable[..., Any], *args: Any) -> Handle: ... @@ -55,28 +53,34 @@ class BaseEventLoop(AbstractEventLoop, metaclass=ABCMeta): def create_future(self) -> Future[Any]: ... # Tasks methods if sys.version_info >= (3, 8): - def create_task( - self, coro: Union[Awaitable[_T], Generator[Any, None, _T]], *, name: Optional[str] = ..., - ) -> Task[_T]: ... + def create_task(self, coro: Union[Awaitable[_T], Generator[Any, None, _T]], *, name: Optional[str] = ...) -> Task[_T]: ... else: def create_task(self, coro: Union[Awaitable[_T], Generator[Any, None, _T]]) -> Task[_T]: ... - def set_task_factory(self, factory: Optional[Callable[[AbstractEventLoop, Generator[Any, None, _T]], Future[_T]]]) -> None: ... + def set_task_factory( + self, factory: Optional[Callable[[AbstractEventLoop, Generator[Any, None, _T]], Future[_T]]] + ) -> None: ... def get_task_factory(self) -> Optional[Callable[[AbstractEventLoop, Generator[Any, None, _T]], Future[_T]]]: ... # Methods for interacting with threads if sys.version_info >= (3, 7): def call_soon_threadsafe(self, callback: Callable[..., Any], *args: Any, context: Optional[Context] = ...) -> Handle: ... else: def call_soon_threadsafe(self, callback: Callable[..., Any], *args: Any) -> Handle: ... - async def run_in_executor(self, executor: Any, - func: Callable[..., _T], *args: Any) -> _T: ... + def run_in_executor(self, executor: Any, func: Callable[..., _T], *args: Any) -> Future[_T]: ... def set_default_executor(self, executor: Any) -> None: ... # Network I/O methods returning Futures. - # TODO the "Tuple[Any, ...]" should be "Union[Tuple[str, int], Tuple[str, int, int, int]]" but that triggers - # https://github.com/python/mypy/issues/2509 - async def getaddrinfo(self, host: Optional[str], port: Union[str, int, None], *, - family: int = ..., type: int = ..., proto: int = ..., - flags: int = ...) -> List[Tuple[int, int, int, str, Tuple[Any, ...]]]: ... - async def getnameinfo(self, sockaddr: Tuple[Any, ...], flags: int = ...) -> Tuple[str, int]: ... + async def getaddrinfo( + self, + host: Optional[str], + port: Union[str, int, None], + *, + family: int = ..., + type: int = ..., + proto: int = ..., + flags: int = ..., + ) -> List[Tuple[AddressFamily, SocketKind, int, str, Union[Tuple[str, int], Tuple[str, int, int, int]]]]: ... + async def getnameinfo( + self, sockaddr: Union[Tuple[str, int], Tuple[str, int, int, int]], flags: int = ... + ) -> Tuple[str, str]: ... if sys.version_info >= (3, 8): @overload async def create_connection( @@ -90,7 +94,7 @@ class BaseEventLoop(AbstractEventLoop, metaclass=ABCMeta): proto: int = ..., flags: int = ..., sock: None = ..., - local_addr: Optional[str] = ..., + local_addr: Optional[Tuple[str, int]] = ..., server_hostname: Optional[str] = ..., ssl_handshake_timeout: Optional[float] = ..., happy_eyeballs_delay: Optional[float] = ..., @@ -116,77 +120,213 @@ class BaseEventLoop(AbstractEventLoop, metaclass=ABCMeta): ) -> _TransProtPair: ... elif sys.version_info >= (3, 7): @overload - async def create_connection(self, protocol_factory: _ProtocolFactory, host: str = ..., port: int = ..., *, - ssl: _SSLContext = ..., family: int = ..., proto: int = ..., flags: int = ..., - sock: None = ..., local_addr: Optional[str] = ..., server_hostname: Optional[str] = ..., - ssl_handshake_timeout: Optional[float] = ...) -> _TransProtPair: ... + async def create_connection( + self, + protocol_factory: _ProtocolFactory, + host: str = ..., + port: int = ..., + *, + ssl: _SSLContext = ..., + family: int = ..., + proto: int = ..., + flags: int = ..., + sock: None = ..., + local_addr: Optional[Tuple[str, int]] = ..., + server_hostname: Optional[str] = ..., + ssl_handshake_timeout: Optional[float] = ..., + ) -> _TransProtPair: ... @overload - async def create_connection(self, protocol_factory: _ProtocolFactory, host: None = ..., port: None = ..., *, - ssl: _SSLContext = ..., family: int = ..., proto: int = ..., flags: int = ..., - sock: socket, local_addr: None = ..., server_hostname: Optional[str] = ..., - ssl_handshake_timeout: Optional[float] = ...) -> _TransProtPair: ... + async def create_connection( + self, + protocol_factory: _ProtocolFactory, + host: None = ..., + port: None = ..., + *, + ssl: _SSLContext = ..., + family: int = ..., + proto: int = ..., + flags: int = ..., + sock: socket, + local_addr: None = ..., + server_hostname: Optional[str] = ..., + ssl_handshake_timeout: Optional[float] = ..., + ) -> _TransProtPair: ... else: @overload - async def create_connection(self, protocol_factory: _ProtocolFactory, host: str = ..., port: int = ..., *, - ssl: _SSLContext = ..., family: int = ..., proto: int = ..., flags: int = ..., sock: None = ..., - local_addr: Optional[str] = ..., server_hostname: Optional[str] = ...) -> _TransProtPair: ... + async def create_connection( + self, + protocol_factory: _ProtocolFactory, + host: str = ..., + port: int = ..., + *, + ssl: _SSLContext = ..., + family: int = ..., + proto: int = ..., + flags: int = ..., + sock: None = ..., + local_addr: Optional[Tuple[str, int]] = ..., + server_hostname: Optional[str] = ..., + ) -> _TransProtPair: ... @overload - async def create_connection(self, protocol_factory: _ProtocolFactory, host: None = ..., port: None = ..., *, - ssl: _SSLContext = ..., family: int = ..., proto: int = ..., flags: int = ..., sock: socket, - local_addr: None = ..., server_hostname: Optional[str] = ...) -> _TransProtPair: ... + async def create_connection( + self, + protocol_factory: _ProtocolFactory, + host: None = ..., + port: None = ..., + *, + ssl: _SSLContext = ..., + family: int = ..., + proto: int = ..., + flags: int = ..., + sock: socket, + local_addr: None = ..., + server_hostname: Optional[str] = ..., + ) -> _TransProtPair: ... if sys.version_info >= (3, 7): - async def sock_sendfile(self, sock: socket, file: IO[bytes], offset: int = ..., count: Optional[int] = ..., *, - fallback: bool = ...) -> int: ... + async def sock_sendfile( + self, sock: socket, file: IO[bytes], offset: int = ..., count: Optional[int] = ..., *, fallback: bool = ... + ) -> int: ... @overload - async def create_server(self, protocol_factory: _ProtocolFactory, host: Optional[Union[str, Sequence[str]]] = ..., - port: int = ..., *, family: int = ..., flags: int = ..., sock: None = ..., backlog: int = ..., - ssl: _SSLContext = ..., reuse_address: Optional[bool] = ..., reuse_port: Optional[bool] = ..., - ssl_handshake_timeout: Optional[float] = ..., start_serving: bool = ...) -> Server: ... + async def create_server( + self, + protocol_factory: _ProtocolFactory, + host: Optional[Union[str, Sequence[str]]] = ..., + port: int = ..., + *, + family: int = ..., + flags: int = ..., + sock: None = ..., + backlog: int = ..., + ssl: _SSLContext = ..., + reuse_address: Optional[bool] = ..., + reuse_port: Optional[bool] = ..., + ssl_handshake_timeout: Optional[float] = ..., + start_serving: bool = ..., + ) -> Server: ... @overload - async def create_server(self, protocol_factory: _ProtocolFactory, host: None = ..., port: None = ..., *, - family: int = ..., flags: int = ..., sock: socket = ..., backlog: int = ..., - ssl: _SSLContext = ..., reuse_address: Optional[bool] = ..., reuse_port: Optional[bool] = ..., - ssl_handshake_timeout: Optional[float] = ..., start_serving: bool = ...) -> Server: ... - async def connect_accepted_socket(self, protocol_factory: _ProtocolFactory, sock: socket, *, ssl: _SSLContext = ..., - ssl_handshake_timeout: Optional[float] = ...) -> _TransProtPair: ... - async def sendfile(self, transport: BaseTransport, file: IO[bytes], offset: int = ..., count: Optional[int] = ..., *, - fallback: bool = ...) -> int: ... - async def start_tls(self, transport: BaseTransport, protocol: BaseProtocol, sslcontext: ssl.SSLContext, *, - server_side: bool = ..., server_hostname: Optional[str] = ..., - ssl_handshake_timeout: Optional[float] = ...) -> BaseTransport: ... + async def create_server( + self, + protocol_factory: _ProtocolFactory, + host: None = ..., + port: None = ..., + *, + family: int = ..., + flags: int = ..., + sock: socket = ..., + backlog: int = ..., + ssl: _SSLContext = ..., + reuse_address: Optional[bool] = ..., + reuse_port: Optional[bool] = ..., + ssl_handshake_timeout: Optional[float] = ..., + start_serving: bool = ..., + ) -> Server: ... + async def connect_accepted_socket( + self, + protocol_factory: _ProtocolFactory, + sock: socket, + *, + ssl: _SSLContext = ..., + ssl_handshake_timeout: Optional[float] = ..., + ) -> _TransProtPair: ... + async def sendfile( + self, + transport: BaseTransport, + file: IO[bytes], + offset: int = ..., + count: Optional[int] = ..., + *, + fallback: bool = ..., + ) -> int: ... + async def start_tls( + self, + transport: BaseTransport, + protocol: BaseProtocol, + sslcontext: ssl.SSLContext, + *, + server_side: bool = ..., + server_hostname: Optional[str] = ..., + ssl_handshake_timeout: Optional[float] = ..., + ) -> BaseTransport: ... else: @overload - async def create_server(self, protocol_factory: _ProtocolFactory, host: Optional[Union[str, Sequence[str]]] = ..., port: int = ..., *, - family: int = ..., flags: int = ..., - sock: None = ..., backlog: int = ..., ssl: _SSLContext = ..., - reuse_address: Optional[bool] = ..., - reuse_port: Optional[bool] = ...) -> Server: ... + async def create_server( + self, + protocol_factory: _ProtocolFactory, + host: Optional[Union[str, Sequence[str]]] = ..., + port: int = ..., + *, + family: int = ..., + flags: int = ..., + sock: None = ..., + backlog: int = ..., + ssl: _SSLContext = ..., + reuse_address: Optional[bool] = ..., + reuse_port: Optional[bool] = ..., + ) -> Server: ... @overload - async def create_server(self, protocol_factory: _ProtocolFactory, host: None = ..., port: None = ..., *, - family: int = ..., flags: int = ..., - sock: socket, backlog: int = ..., ssl: _SSLContext = ..., - reuse_address: Optional[bool] = ..., - reuse_port: Optional[bool] = ...) -> Server: ... - async def connect_accepted_socket(self, protocol_factory: _ProtocolFactory, sock: socket, *, ssl: _SSLContext = ...) -> _TransProtPair: ... - async def create_datagram_endpoint(self, protocol_factory: _ProtocolFactory, - local_addr: Optional[Tuple[str, int]] = ..., remote_addr: Optional[Tuple[str, int]] = ..., *, - family: int = ..., proto: int = ..., flags: int = ..., - reuse_address: Optional[bool] = ..., reuse_port: Optional[bool] = ..., - allow_broadcast: Optional[bool] = ..., - sock: Optional[socket] = ...) -> _TransProtPair: ... + async def create_server( + self, + protocol_factory: _ProtocolFactory, + host: None = ..., + port: None = ..., + *, + family: int = ..., + flags: int = ..., + sock: socket, + backlog: int = ..., + ssl: _SSLContext = ..., + reuse_address: Optional[bool] = ..., + reuse_port: Optional[bool] = ..., + ) -> Server: ... + async def connect_accepted_socket( + self, protocol_factory: _ProtocolFactory, sock: socket, *, ssl: _SSLContext = ... + ) -> _TransProtPair: ... + async def create_datagram_endpoint( + self, + protocol_factory: _ProtocolFactory, + local_addr: Optional[Tuple[str, int]] = ..., + remote_addr: Optional[Tuple[str, int]] = ..., + *, + family: int = ..., + proto: int = ..., + flags: int = ..., + reuse_address: Optional[bool] = ..., + reuse_port: Optional[bool] = ..., + allow_broadcast: Optional[bool] = ..., + sock: Optional[socket] = ..., + ) -> _TransProtPair: ... # Pipes and subprocesses. async def connect_read_pipe(self, protocol_factory: _ProtocolFactory, pipe: Any) -> _TransProtPair: ... async def connect_write_pipe(self, protocol_factory: _ProtocolFactory, pipe: Any) -> _TransProtPair: ... - async def subprocess_shell(self, protocol_factory: _ProtocolFactory, cmd: Union[bytes, str], *, stdin: Any = ..., - stdout: Any = ..., stderr: Any = ..., - **kwargs: Any) -> _TransProtPair: ... - async def subprocess_exec(self, protocol_factory: _ProtocolFactory, *args: Any, stdin: Any = ..., - stdout: Any = ..., stderr: Any = ..., - **kwargs: Any) -> _TransProtPair: ... - def add_reader(self, fd: selectors._FileObject, callback: Callable[..., Any], *args: Any) -> None: ... - def remove_reader(self, fd: selectors._FileObject) -> None: ... - def add_writer(self, fd: selectors._FileObject, callback: Callable[..., Any], *args: Any) -> None: ... - def remove_writer(self, fd: selectors._FileObject) -> None: ... + async def subprocess_shell( + self, + protocol_factory: _ProtocolFactory, + cmd: Union[bytes, str], + *, + stdin: Any = ..., + stdout: Any = ..., + stderr: Any = ..., + universal_newlines: Literal[False] = ..., + shell: Literal[True] = ..., + bufsize: Literal[0] = ..., + encoding: None = ..., + errors: None = ..., + text: Literal[False, None] = ..., + **kwargs: Any, + ) -> _TransProtPair: ... + async def subprocess_exec( + self, + protocol_factory: _ProtocolFactory, + *args: Any, + stdin: Any = ..., + stdout: Any = ..., + stderr: Any = ..., + **kwargs: Any, + ) -> _TransProtPair: ... + def add_reader(self, fd: FileDescriptorLike, callback: Callable[..., Any], *args: Any) -> None: ... + def remove_reader(self, fd: FileDescriptorLike) -> None: ... + def add_writer(self, fd: FileDescriptorLike, callback: Callable[..., Any], *args: Any) -> None: ... + def remove_writer(self, fd: FileDescriptorLike) -> None: ... # Completion based I/O methods returning Futures prior to 3.7 if sys.version_info >= (3, 7): async def sock_recv(self, sock: socket, nbytes: int) -> bytes: ... @@ -210,3 +350,5 @@ class BaseEventLoop(AbstractEventLoop, metaclass=ABCMeta): # Debug flag management. def get_debug(self) -> bool: ... def set_debug(self, enabled: bool) -> None: ... + if sys.version_info >= (3, 9): + async def shutdown_default_executor(self) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/base_futures.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/base_futures.pyi new file mode 100644 index 00000000..270a6968 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/base_futures.pyi @@ -0,0 +1,22 @@ +import sys +from typing import Any, Callable, List, Sequence, Tuple +from typing_extensions import Literal + +if sys.version_info >= (3, 7): + from contextvars import Context + +from . import futures + +_PENDING: Literal["PENDING"] # undocumented +_CANCELLED: Literal["CANCELLED"] # undocumented +_FINISHED: Literal["FINISHED"] # undocumented + +def isfuture(obj: object) -> bool: ... + +if sys.version_info >= (3, 7): + def _format_callbacks(cb: Sequence[Tuple[Callable[[futures.Future[Any]], None], Context]]) -> str: ... # undocumented + +else: + def _format_callbacks(cb: Sequence[Callable[[futures.Future[Any]], None]]) -> str: ... # undocumented + +def _future_repr_info(future: futures.Future[Any]) -> List[str]: ... # undocumented diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/base_subprocess.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/base_subprocess.pyi new file mode 100644 index 00000000..acdf9852 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/base_subprocess.pyi @@ -0,0 +1,72 @@ +import subprocess +from typing import IO, Any, Callable, Deque, Dict, List, Optional, Sequence, Tuple, Union + +from . import events, futures, protocols, transports + +_File = Optional[Union[int, IO[Any]]] + +class BaseSubprocessTransport(transports.SubprocessTransport): + + _closed: bool # undocumented + _protocol: protocols.SubprocessProtocol # undocumented + _loop: events.AbstractEventLoop # undocumented + _proc: Optional[subprocess.Popen[Any]] # undocumented + _pid: Optional[int] # undocumented + _returncode: Optional[int] # undocumented + _exit_waiters: List[futures.Future[Any]] # undocumented + _pending_calls: Deque[Tuple[Callable[..., Any], Tuple[Any, ...]]] # undocumented + _pipes: Dict[int, _File] # undocumented + _finished: bool # undocumented + def __init__( + self, + loop: events.AbstractEventLoop, + protocol: protocols.SubprocessProtocol, + args: Union[str, bytes, Sequence[Union[str, bytes]]], + shell: bool, + stdin: _File, + stdout: _File, + stderr: _File, + bufsize: int, + waiter: Optional[futures.Future[Any]] = ..., + extra: Optional[Any] = ..., + **kwargs: Any, + ) -> None: ... + def _start( + self, + args: Union[str, bytes, Sequence[Union[str, bytes]]], + shell: bool, + stdin: _File, + stdout: _File, + stderr: _File, + bufsize: int, + **kwargs: Any, + ) -> None: ... # undocumented + def set_protocol(self, protocol: protocols.BaseProtocol) -> None: ... + def get_protocol(self) -> protocols.BaseProtocol: ... + def is_closing(self) -> bool: ... + def close(self) -> None: ... + def get_pid(self) -> Optional[int]: ... # type: ignore + def get_returncode(self) -> Optional[int]: ... + def get_pipe_transport(self, fd: int) -> _File: ... # type: ignore + def _check_proc(self) -> None: ... # undocumented + def send_signal(self, signal: int) -> None: ... # type: ignore + def terminate(self) -> None: ... + def kill(self) -> None: ... + async def _connect_pipes(self, waiter: Optional[futures.Future[Any]]) -> None: ... # undocumented + def _call(self, cb: Callable[..., Any], *data: Any) -> None: ... # undocumented + def _pipe_connection_lost(self, fd: int, exc: Optional[BaseException]) -> None: ... # undocumented + def _pipe_data_received(self, fd: int, data: bytes) -> None: ... # undocumented + def _process_exited(self, returncode: int) -> None: ... # undocumented + async def _wait(self) -> int: ... # undocumented + def _try_finish(self) -> None: ... # undocumented + def _call_connection_lost(self, exc: Optional[BaseException]) -> None: ... # undocumented + +class WriteSubprocessPipeProto(protocols.BaseProtocol): # undocumented + def __init__(self, proc: BaseSubprocessTransport, fd: int) -> None: ... + def connection_made(self, transport: transports.BaseTransport) -> None: ... + def connection_lost(self, exc: Optional[BaseException]) -> None: ... + def pause_writing(self) -> None: ... + def resume_writing(self) -> None: ... + +class ReadSubprocessPipeProto(WriteSubprocessPipeProto, protocols.Protocol): # undocumented + def data_received(self, data: bytes) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/base_tasks.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/base_tasks.pyi new file mode 100644 index 00000000..fbe0a03e --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/base_tasks.pyi @@ -0,0 +1,9 @@ +from _typeshed import AnyPath +from types import FrameType +from typing import Any, List, Optional + +from . import tasks + +def _task_repr_info(task: tasks.Task[Any]) -> List[str]: ... # undocumented +def _task_get_stack(task: tasks.Task[Any], limit: Optional[int]) -> List[FrameType]: ... # undocumented +def _task_print_stack(task: tasks.Task[Any], limit: Optional[int], file: AnyPath) -> None: ... # undocumented diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/compat.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/compat.pyi new file mode 100644 index 00000000..2dbc03d5 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/compat.pyi @@ -0,0 +1,8 @@ +import sys +from typing import List + +if sys.version_info < (3, 7): + PY34: bool + PY35: bool + PY352: bool + def flatten_list_bytes(list_of_data: List[bytes]) -> bytes: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/constants.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/constants.pyi old mode 100755 new mode 100644 index f15ea4fe..14681f33 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/constants.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/constants.pyi @@ -1,11 +1,12 @@ - import enum +import sys LOG_THRESHOLD_FOR_CONNLOST_WRITES: int ACCEPT_RETRY_DELAY: int DEBUG_STACK_DEPTH: int -SSL_HANDSHAKE_TIMEOUT: float -SENDFILE_FALLBACK_READBUFFER_SIZE: int +if sys.version_info >= (3, 7): + SSL_HANDSHAKE_TIMEOUT: float + SENDFILE_FALLBACK_READBUFFER_SIZE: int class _SendfileMode(enum.Enum): UNSUPPORTED: int = ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/coroutines.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/coroutines.pyi old mode 100755 new mode 100644 index f75dfe5f..dea09068 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/coroutines.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/coroutines.pyi @@ -1,6 +1,6 @@ from typing import Any, Callable, TypeVar -_F = TypeVar('_F', bound=Callable[..., Any]) +_F = TypeVar("_F", bound=Callable[..., Any]) def coroutine(func: _F) -> _F: ... def iscoroutinefunction(func: Callable[..., Any]) -> bool: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/events.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/events.pyi old mode 100755 new mode 100644 index 84e61910..c61a96ee --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/events.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/events.pyi @@ -1,15 +1,19 @@ -import selectors -from socket import socket, _Address, _RetAddress import ssl import sys -from typing import Any, Awaitable, Callable, Dict, Generator, IO, List, Optional, Sequence, Tuple, TypeVar, Union, overload +from _typeshed import FileDescriptorLike from abc import ABCMeta, abstractmethod from asyncio.futures import Future from asyncio.protocols import BaseProtocol from asyncio.tasks import Task from asyncio.transports import BaseTransport +from asyncio.unix_events import AbstractChildWatcher +from socket import AddressFamily, SocketKind, _Address, _RetAddress, socket +from typing import IO, Any, Awaitable, Callable, Dict, Generator, List, Optional, Sequence, Tuple, TypeVar, Union, overload -_T = TypeVar('_T') +if sys.version_info >= (3, 7): + from contextvars import Context + +_T = TypeVar("_T") _Context = Dict[str, Any] _ExceptionHandler = Callable[[AbstractEventLoop, _Context], Any] _ProtocolFactory = Callable[[], BaseProtocol] @@ -18,8 +22,13 @@ _TransProtPair = Tuple[BaseTransport, BaseProtocol] class Handle: _cancelled = False - _args: List[Any] - def __init__(self, callback: Callable[..., Any], args: List[Any], loop: AbstractEventLoop) -> None: ... + _args: Sequence[Any] + if sys.version_info >= (3, 7): + def __init__( + self, callback: Callable[..., Any], args: Sequence[Any], loop: AbstractEventLoop, context: Optional[Context] = ... + ) -> None: ... + else: + def __init__(self, callback: Callable[..., Any], args: Sequence[Any], loop: AbstractEventLoop) -> None: ... def __repr__(self) -> str: ... def cancel(self) -> None: ... def _run(self) -> None: ... @@ -27,8 +36,17 @@ class Handle: def cancelled(self) -> bool: ... class TimerHandle(Handle): - def __init__(self, when: float, callback: Callable[..., Any], args: List[Any], - loop: AbstractEventLoop) -> None: ... + if sys.version_info >= (3, 7): + def __init__( + self, + when: float, + callback: Callable[..., Any], + args: Sequence[Any], + loop: AbstractEventLoop, + context: Optional[Context] = ..., + ) -> None: ... + else: + def __init__(self, when: float, callback: Callable[..., Any], args: Sequence[Any], loop: AbstractEventLoop) -> None: ... def __hash__(self) -> int: ... if sys.version_info >= (3, 7): def when(self) -> float: ... @@ -49,7 +67,6 @@ class AbstractEventLoop(metaclass=ABCMeta): slow_callback_duration: float = ... @abstractmethod def run_forever(self) -> None: ... - # Can't use a union, see mypy issue # 1873. @overload @abstractmethod @@ -57,7 +74,6 @@ class AbstractEventLoop(metaclass=ABCMeta): @overload @abstractmethod def run_until_complete(self, future: Awaitable[_T]) -> _T: ... - @abstractmethod def stop(self) -> None: ... @abstractmethod @@ -84,33 +100,39 @@ class AbstractEventLoop(metaclass=ABCMeta): # Tasks methods if sys.version_info >= (3, 8): @abstractmethod - def create_task( - self, coro: Union[Awaitable[_T], Generator[Any, None, _T]], *, name: Optional[str] = ..., - ) -> Task[_T]: ... + def create_task(self, coro: Union[Awaitable[_T], Generator[Any, None, _T]], *, name: Optional[str] = ...) -> Task[_T]: ... else: @abstractmethod def create_task(self, coro: Union[Awaitable[_T], Generator[Any, None, _T]]) -> Task[_T]: ... @abstractmethod - def set_task_factory(self, factory: Optional[Callable[[AbstractEventLoop, Generator[Any, None, _T]], Future[_T]]]) -> None: ... + def set_task_factory( + self, factory: Optional[Callable[[AbstractEventLoop, Generator[Any, None, _T]], Future[_T]]] + ) -> None: ... @abstractmethod def get_task_factory(self) -> Optional[Callable[[AbstractEventLoop, Generator[Any, None, _T]], Future[_T]]]: ... # Methods for interacting with threads @abstractmethod def call_soon_threadsafe(self, callback: Callable[..., Any], *args: Any) -> Handle: ... @abstractmethod - async def run_in_executor(self, executor: Any, - func: Callable[..., _T], *args: Any) -> _T: ... + def run_in_executor(self, executor: Any, func: Callable[..., _T], *args: Any) -> Awaitable[_T]: ... @abstractmethod def set_default_executor(self, executor: Any) -> None: ... # Network I/O methods returning Futures. @abstractmethod - # TODO the "Tuple[Any, ...]" should be "Union[Tuple[str, int], Tuple[str, int, int, int]]" but that triggers - # https://github.com/python/mypy/issues/2509 - async def getaddrinfo(self, host: Optional[str], port: Union[str, int, None], *, - family: int = ..., type: int = ..., proto: int = ..., - flags: int = ...) -> List[Tuple[int, int, int, str, Tuple[Any, ...]]]: ... - @abstractmethod - async def getnameinfo(self, sockaddr: Tuple[Any, ...], flags: int = ...) -> Tuple[str, int]: ... + async def getaddrinfo( + self, + host: Optional[str], + port: Union[str, int, None], + *, + family: int = ..., + type: int = ..., + proto: int = ..., + flags: int = ..., + ) -> List[Tuple[AddressFamily, SocketKind, int, str, Union[Tuple[str, int], Tuple[str, int, int, int]]]]: ... + @abstractmethod + async def getnameinfo( + self, sockaddr: Union[Tuple[str, int], Tuple[str, int, int, int]], flags: int = ... + ) -> Tuple[str, str]: ... if sys.version_info >= (3, 8): @overload @abstractmethod @@ -125,7 +147,7 @@ class AbstractEventLoop(metaclass=ABCMeta): proto: int = ..., flags: int = ..., sock: None = ..., - local_addr: Optional[str] = ..., + local_addr: Optional[Tuple[str, int]] = ..., server_hostname: Optional[str] = ..., ssl_handshake_timeout: Optional[float] = ..., happy_eyeballs_delay: Optional[float] = ..., @@ -153,113 +175,254 @@ class AbstractEventLoop(metaclass=ABCMeta): elif sys.version_info >= (3, 7): @overload @abstractmethod - async def create_connection(self, protocol_factory: _ProtocolFactory, host: str = ..., port: int = ..., *, - ssl: _SSLContext = ..., family: int = ..., proto: int = ..., flags: int = ..., - sock: None = ..., local_addr: Optional[str] = ..., server_hostname: Optional[str] = ..., - ssl_handshake_timeout: Optional[float] = ...) -> _TransProtPair: ... + async def create_connection( + self, + protocol_factory: _ProtocolFactory, + host: str = ..., + port: int = ..., + *, + ssl: _SSLContext = ..., + family: int = ..., + proto: int = ..., + flags: int = ..., + sock: None = ..., + local_addr: Optional[Tuple[str, int]] = ..., + server_hostname: Optional[str] = ..., + ssl_handshake_timeout: Optional[float] = ..., + ) -> _TransProtPair: ... @overload @abstractmethod - async def create_connection(self, protocol_factory: _ProtocolFactory, host: None = ..., port: None = ..., *, - ssl: _SSLContext = ..., family: int = ..., proto: int = ..., flags: int = ..., - sock: socket, local_addr: None = ..., server_hostname: Optional[str] = ..., - ssl_handshake_timeout: Optional[float] = ...) -> _TransProtPair: ... + async def create_connection( + self, + protocol_factory: _ProtocolFactory, + host: None = ..., + port: None = ..., + *, + ssl: _SSLContext = ..., + family: int = ..., + proto: int = ..., + flags: int = ..., + sock: socket, + local_addr: None = ..., + server_hostname: Optional[str] = ..., + ssl_handshake_timeout: Optional[float] = ..., + ) -> _TransProtPair: ... else: @overload @abstractmethod - async def create_connection(self, protocol_factory: _ProtocolFactory, host: str = ..., port: int = ..., *, - ssl: _SSLContext = ..., family: int = ..., proto: int = ..., flags: int = ..., sock: None = ..., - local_addr: Optional[str] = ..., server_hostname: Optional[str] = ...) -> _TransProtPair: ... + async def create_connection( + self, + protocol_factory: _ProtocolFactory, + host: str = ..., + port: int = ..., + *, + ssl: _SSLContext = ..., + family: int = ..., + proto: int = ..., + flags: int = ..., + sock: None = ..., + local_addr: Optional[Tuple[str, int]] = ..., + server_hostname: Optional[str] = ..., + ) -> _TransProtPair: ... @overload @abstractmethod - async def create_connection(self, protocol_factory: _ProtocolFactory, host: None = ..., port: None = ..., *, - ssl: _SSLContext = ..., family: int = ..., proto: int = ..., flags: int = ..., sock: socket, - local_addr: None = ..., server_hostname: Optional[str] = ...) -> _TransProtPair: ... + async def create_connection( + self, + protocol_factory: _ProtocolFactory, + host: None = ..., + port: None = ..., + *, + ssl: _SSLContext = ..., + family: int = ..., + proto: int = ..., + flags: int = ..., + sock: socket, + local_addr: None = ..., + server_hostname: Optional[str] = ..., + ) -> _TransProtPair: ... if sys.version_info >= (3, 7): @abstractmethod - async def sock_sendfile(self, sock: socket, file: IO[bytes], offset: int = ..., count: Optional[int] = ..., *, - fallback: bool = ...) -> int: ... + async def sock_sendfile( + self, sock: socket, file: IO[bytes], offset: int = ..., count: Optional[int] = ..., *, fallback: bool = ... + ) -> int: ... @overload @abstractmethod - async def create_server(self, protocol_factory: _ProtocolFactory, host: Optional[Union[str, Sequence[str]]] = ..., - port: int = ..., *, family: int = ..., flags: int = ..., sock: None = ..., backlog: int = ..., - ssl: _SSLContext = ..., reuse_address: Optional[bool] = ..., reuse_port: Optional[bool] = ..., - ssl_handshake_timeout: Optional[float] = ..., start_serving: bool = ...) -> AbstractServer: ... + async def create_server( + self, + protocol_factory: _ProtocolFactory, + host: Optional[Union[str, Sequence[str]]] = ..., + port: int = ..., + *, + family: int = ..., + flags: int = ..., + sock: None = ..., + backlog: int = ..., + ssl: _SSLContext = ..., + reuse_address: Optional[bool] = ..., + reuse_port: Optional[bool] = ..., + ssl_handshake_timeout: Optional[float] = ..., + start_serving: bool = ..., + ) -> AbstractServer: ... @overload @abstractmethod - async def create_server(self, protocol_factory: _ProtocolFactory, host: None = ..., port: None = ..., *, - family: int = ..., flags: int = ..., sock: socket = ..., backlog: int = ..., - ssl: _SSLContext = ..., reuse_address: Optional[bool] = ..., reuse_port: Optional[bool] = ..., - ssl_handshake_timeout: Optional[float] = ..., start_serving: bool = ...) -> AbstractServer: ... - @abstractmethod - async def create_unix_connection(self, protocol_factory: _ProtocolFactory, path: str, *, ssl: _SSLContext = ..., - sock: Optional[socket] = ..., server_hostname: str = ..., - ssl_handshake_timeout: Optional[float] = ...) -> _TransProtPair: ... - @abstractmethod - async def create_unix_server(self, protocol_factory: _ProtocolFactory, path: str, *, sock: Optional[socket] = ..., - backlog: int = ..., ssl: _SSLContext = ..., ssl_handshake_timeout: Optional[float] = ..., - start_serving: bool = ...) -> AbstractServer: ... - @abstractmethod - async def connect_accepted_socket(self, protocol_factory: _ProtocolFactory, sock: socket, *, ssl: _SSLContext = ..., - ssl_handshake_timeout: Optional[float] = ...) -> _TransProtPair: ... + async def create_server( + self, + protocol_factory: _ProtocolFactory, + host: None = ..., + port: None = ..., + *, + family: int = ..., + flags: int = ..., + sock: socket = ..., + backlog: int = ..., + ssl: _SSLContext = ..., + reuse_address: Optional[bool] = ..., + reuse_port: Optional[bool] = ..., + ssl_handshake_timeout: Optional[float] = ..., + start_serving: bool = ..., + ) -> AbstractServer: ... + async def create_unix_connection( + self, + protocol_factory: _ProtocolFactory, + path: Optional[str] = ..., + *, + ssl: _SSLContext = ..., + sock: Optional[socket] = ..., + server_hostname: Optional[str] = ..., + ssl_handshake_timeout: Optional[float] = ..., + ) -> _TransProtPair: ... + async def create_unix_server( + self, + protocol_factory: _ProtocolFactory, + path: Optional[str] = ..., + *, + sock: Optional[socket] = ..., + backlog: int = ..., + ssl: _SSLContext = ..., + ssl_handshake_timeout: Optional[float] = ..., + start_serving: bool = ..., + ) -> AbstractServer: ... @abstractmethod - async def sendfile(self, transport: BaseTransport, file: IO[bytes], offset: int = ..., count: Optional[int] = ..., *, - fallback: bool = ...) -> int: ... + async def sendfile( + self, + transport: BaseTransport, + file: IO[bytes], + offset: int = ..., + count: Optional[int] = ..., + *, + fallback: bool = ..., + ) -> int: ... @abstractmethod - async def start_tls(self, transport: BaseTransport, protocol: BaseProtocol, sslcontext: ssl.SSLContext, *, - server_side: bool = ..., server_hostname: Optional[str] = ..., - ssl_handshake_timeout: Optional[float] = ...) -> BaseTransport: ... + async def start_tls( + self, + transport: BaseTransport, + protocol: BaseProtocol, + sslcontext: ssl.SSLContext, + *, + server_side: bool = ..., + server_hostname: Optional[str] = ..., + ssl_handshake_timeout: Optional[float] = ..., + ) -> BaseTransport: ... else: @overload @abstractmethod - async def create_server(self, protocol_factory: _ProtocolFactory, host: Optional[Union[str, Sequence[str]]] = ..., port: int = ..., *, - family: int = ..., flags: int = ..., - sock: None = ..., backlog: int = ..., ssl: _SSLContext = ..., - reuse_address: Optional[bool] = ..., - reuse_port: Optional[bool] = ...) -> AbstractServer: ... + async def create_server( + self, + protocol_factory: _ProtocolFactory, + host: Optional[Union[str, Sequence[str]]] = ..., + port: int = ..., + *, + family: int = ..., + flags: int = ..., + sock: None = ..., + backlog: int = ..., + ssl: _SSLContext = ..., + reuse_address: Optional[bool] = ..., + reuse_port: Optional[bool] = ..., + ) -> AbstractServer: ... @overload @abstractmethod - async def create_server(self, protocol_factory: _ProtocolFactory, host: None = ..., port: None = ..., *, - family: int = ..., flags: int = ..., - sock: socket, backlog: int = ..., ssl: _SSLContext = ..., - reuse_address: Optional[bool] = ..., - reuse_port: Optional[bool] = ...) -> AbstractServer: ... - @abstractmethod - async def create_unix_connection(self, protocol_factory: _ProtocolFactory, path: str, *, - ssl: _SSLContext = ..., sock: Optional[socket] = ..., - server_hostname: str = ...) -> _TransProtPair: ... - @abstractmethod - async def create_unix_server(self, protocol_factory: _ProtocolFactory, path: str, *, - sock: Optional[socket] = ..., backlog: int = ..., ssl: _SSLContext = ...) -> AbstractServer: ... - @abstractmethod - async def connect_accepted_socket(self, protocol_factory: _ProtocolFactory, sock: socket, *, ssl: _SSLContext = ...) -> _TransProtPair: ... - @abstractmethod - async def create_datagram_endpoint(self, protocol_factory: _ProtocolFactory, - local_addr: Optional[Tuple[str, int]] = ..., remote_addr: Optional[Tuple[str, int]] = ..., *, - family: int = ..., proto: int = ..., flags: int = ..., - reuse_address: Optional[bool] = ..., reuse_port: Optional[bool] = ..., - allow_broadcast: Optional[bool] = ..., - sock: Optional[socket] = ...) -> _TransProtPair: ... + async def create_server( + self, + protocol_factory: _ProtocolFactory, + host: None = ..., + port: None = ..., + *, + family: int = ..., + flags: int = ..., + sock: socket, + backlog: int = ..., + ssl: _SSLContext = ..., + reuse_address: Optional[bool] = ..., + reuse_port: Optional[bool] = ..., + ) -> AbstractServer: ... + async def create_unix_connection( + self, + protocol_factory: _ProtocolFactory, + path: str, + *, + ssl: _SSLContext = ..., + sock: Optional[socket] = ..., + server_hostname: Optional[str] = ..., + ) -> _TransProtPair: ... + async def create_unix_server( + self, + protocol_factory: _ProtocolFactory, + path: str, + *, + sock: Optional[socket] = ..., + backlog: int = ..., + ssl: _SSLContext = ..., + ) -> AbstractServer: ... + @abstractmethod + async def create_datagram_endpoint( + self, + protocol_factory: _ProtocolFactory, + local_addr: Optional[Tuple[str, int]] = ..., + remote_addr: Optional[Tuple[str, int]] = ..., + *, + family: int = ..., + proto: int = ..., + flags: int = ..., + reuse_address: Optional[bool] = ..., + reuse_port: Optional[bool] = ..., + allow_broadcast: Optional[bool] = ..., + sock: Optional[socket] = ..., + ) -> _TransProtPair: ... # Pipes and subprocesses. @abstractmethod async def connect_read_pipe(self, protocol_factory: _ProtocolFactory, pipe: Any) -> _TransProtPair: ... @abstractmethod async def connect_write_pipe(self, protocol_factory: _ProtocolFactory, pipe: Any) -> _TransProtPair: ... @abstractmethod - async def subprocess_shell(self, protocol_factory: _ProtocolFactory, cmd: Union[bytes, str], *, stdin: Any = ..., - stdout: Any = ..., stderr: Any = ..., - **kwargs: Any) -> _TransProtPair: ... - @abstractmethod - async def subprocess_exec(self, protocol_factory: _ProtocolFactory, *args: Any, stdin: Any = ..., - stdout: Any = ..., stderr: Any = ..., - **kwargs: Any) -> _TransProtPair: ... - @abstractmethod - def add_reader(self, fd: selectors._FileObject, callback: Callable[..., Any], *args: Any) -> None: ... - @abstractmethod - def remove_reader(self, fd: selectors._FileObject) -> None: ... - @abstractmethod - def add_writer(self, fd: selectors._FileObject, callback: Callable[..., Any], *args: Any) -> None: ... - @abstractmethod - def remove_writer(self, fd: selectors._FileObject) -> None: ... + async def subprocess_shell( + self, + protocol_factory: _ProtocolFactory, + cmd: Union[bytes, str], + *, + stdin: Any = ..., + stdout: Any = ..., + stderr: Any = ..., + **kwargs: Any, + ) -> _TransProtPair: ... + @abstractmethod + async def subprocess_exec( + self, + protocol_factory: _ProtocolFactory, + *args: Any, + stdin: Any = ..., + stdout: Any = ..., + stderr: Any = ..., + **kwargs: Any, + ) -> _TransProtPair: ... + @abstractmethod + def add_reader(self, fd: FileDescriptorLike, callback: Callable[..., Any], *args: Any) -> None: ... + @abstractmethod + def remove_reader(self, fd: FileDescriptorLike) -> None: ... + @abstractmethod + def add_writer(self, fd: FileDescriptorLike, callback: Callable[..., Any], *args: Any) -> None: ... + @abstractmethod + def remove_writer(self, fd: FileDescriptorLike) -> None: ... # Completion based I/O methods returning Futures prior to 3.7 if sys.version_info >= (3, 7): @abstractmethod @@ -300,6 +463,9 @@ class AbstractEventLoop(metaclass=ABCMeta): def get_debug(self) -> bool: ... @abstractmethod def set_debug(self, enabled: bool) -> None: ... + if sys.version_info >= (3, 9): + @abstractmethod + async def shutdown_default_executor(self) -> None: ... class AbstractEventLoopPolicy(metaclass=ABCMeta): @abstractmethod @@ -310,9 +476,9 @@ class AbstractEventLoopPolicy(metaclass=ABCMeta): def new_event_loop(self) -> AbstractEventLoop: ... # Child processes handling (Unix only). @abstractmethod - def get_child_watcher(self) -> Any: ... # TODO: unix_events.AbstractChildWatcher + def get_child_watcher(self) -> AbstractChildWatcher: ... @abstractmethod - def set_child_watcher(self, watcher: Any) -> None: ... # TODO: unix_events.AbstractChildWatcher + def set_child_watcher(self, watcher: AbstractChildWatcher) -> None: ... class BaseDefaultEventLoopPolicy(AbstractEventLoopPolicy, metaclass=ABCMeta): def __init__(self) -> None: ... @@ -321,20 +487,16 @@ class BaseDefaultEventLoopPolicy(AbstractEventLoopPolicy, metaclass=ABCMeta): def new_event_loop(self) -> AbstractEventLoop: ... def get_event_loop_policy() -> AbstractEventLoopPolicy: ... -def set_event_loop_policy(policy: AbstractEventLoopPolicy) -> None: ... - +def set_event_loop_policy(policy: Optional[AbstractEventLoopPolicy]) -> None: ... def get_event_loop() -> AbstractEventLoop: ... def set_event_loop(loop: Optional[AbstractEventLoop]) -> None: ... def new_event_loop() -> AbstractEventLoop: ... - -def get_child_watcher() -> Any: ... # TODO: unix_events.AbstractChildWatcher -def set_child_watcher(watcher: Any) -> None: ... # TODO: unix_events.AbstractChildWatcher - -def _set_running_loop(loop: Optional[AbstractEventLoop]) -> None: ... +def get_child_watcher() -> AbstractChildWatcher: ... +def set_child_watcher(watcher: AbstractChildWatcher) -> None: ... +def _set_running_loop(__loop: Optional[AbstractEventLoop]) -> None: ... def _get_running_loop() -> AbstractEventLoop: ... if sys.version_info >= (3, 7): def get_running_loop() -> AbstractEventLoop: ... - -if sys.version_info < (3, 8): - class SendfileNotAvailableError(RuntimeError): ... + if sys.version_info < (3, 8): + class SendfileNotAvailableError(RuntimeError): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/exceptions.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/exceptions.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/format_helpers.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/format_helpers.pyi new file mode 100644 index 00000000..5f2baf7b --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/format_helpers.pyi @@ -0,0 +1,20 @@ +import functools +import sys +import traceback +from types import FrameType, FunctionType +from typing import Any, Dict, Iterable, Optional, Tuple, Union, overload + +class _HasWrapper: + __wrapper__: Union[_HasWrapper, FunctionType] + +_FuncType = Union[FunctionType, _HasWrapper, functools.partial, functools.partialmethod] + +if sys.version_info >= (3, 7): + @overload + def _get_function_source(func: _FuncType) -> Tuple[str, int]: ... + @overload + def _get_function_source(func: object) -> Optional[Tuple[str, int]]: ... + def _format_callback_source(func: object, args: Iterable[Any]) -> str: ... + def _format_args_and_kwargs(args: Iterable[Any], kwargs: Dict[str, Any]) -> str: ... + def _format_callback(func: object, args: Iterable[Any], kwargs: Dict[str, Any], suffix: str = ...) -> str: ... + def extract_stack(f: Optional[FrameType] = ..., limit: Optional[int] = ...) -> traceback.StackSummary: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/futures.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/futures.pyi old mode 100755 new mode 100644 index 824364a2..1252c02c --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/futures.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/futures.pyi @@ -1,29 +1,30 @@ import sys -from typing import Any, Union, Callable, TypeVar, Type, List, Iterable, Generator, Awaitable, Optional, Tuple +from concurrent.futures._base import Error, Future as _ConcurrentFuture +from typing import Any, Awaitable, Callable, Generator, Iterable, List, Optional, Tuple, TypeVar, Union + from .events import AbstractEventLoop -from concurrent.futures import ( - Future as _ConcurrentFuture, - Error, -) if sys.version_info < (3, 8): - from concurrent.futures import CancelledError as CancelledError - from concurrent.futures import TimeoutError as TimeoutError + from concurrent.futures import CancelledError as CancelledError, TimeoutError as TimeoutError class InvalidStateError(Error): ... if sys.version_info >= (3, 7): from contextvars import Context -_T = TypeVar('_T') -_S = TypeVar('_S') +if sys.version_info >= (3, 9): + from types import GenericAlias -class _TracebackLogger: - exc: BaseException - tb: List[str] - def __init__(self, exc: Any, loop: AbstractEventLoop) -> None: ... - def activate(self) -> None: ... - def clear(self) -> None: ... - def __del__(self) -> None: ... +_T = TypeVar("_T") +_S = TypeVar("_S") + +if sys.version_info < (3, 7): + class _TracebackLogger: + exc: BaseException + tb: List[str] + def __init__(self, exc: Any, loop: AbstractEventLoop) -> None: ... + def activate(self) -> None: ... + def clear(self) -> None: ... + def __del__(self) -> None: ... def isfuture(obj: object) -> bool: ... @@ -32,7 +33,6 @@ class Future(Awaitable[_T], Iterable[_T]): _exception: BaseException _blocking = False _log_traceback = False - _tb_logger: Type[_TracebackLogger] def __init__(self, *, loop: Optional[AbstractEventLoop] = ...) -> None: ... def __repr__(self) -> str: ... def __del__(self) -> None: ... @@ -44,19 +44,22 @@ class Future(Awaitable[_T], Iterable[_T]): @property def _callbacks(self: _S) -> List[Callable[[_S], Any]]: ... def add_done_callback(self: _S, __fn: Callable[[_S], Any]) -> None: ... - def cancel(self) -> bool: ... - def _schedule_callbacks(self) -> None: ... + if sys.version_info >= (3, 9): + def cancel(self, msg: Optional[str] = ...) -> bool: ... + else: + def cancel(self) -> bool: ... def cancelled(self) -> bool: ... def done(self) -> bool: ... def result(self) -> _T: ... - def exception(self) -> BaseException: ... - def remove_done_callback(self: _S, fn: Callable[[_S], Any]) -> int: ... - def set_result(self, result: _T) -> None: ... - def set_exception(self, exception: Union[type, BaseException]) -> None: ... - def _copy_state(self, other: Any) -> None: ... + def exception(self) -> Optional[BaseException]: ... + def remove_done_callback(self: _S, __fn: Callable[[_S], Any]) -> int: ... + def set_result(self, __result: _T) -> None: ... + def set_exception(self, __exception: Union[type, BaseException]) -> None: ... def __iter__(self) -> Generator[Any, None, _T]: ... def __await__(self) -> Generator[Any, None, _T]: ... @property def _loop(self) -> AbstractEventLoop: ... + if sys.version_info >= (3, 9): + def __class_getitem__(cls, item: Any) -> GenericAlias: ... -def wrap_future(f: Union[_ConcurrentFuture[_T], Future[_T]], *, loop: Optional[AbstractEventLoop] = ...) -> Future[_T]: ... +def wrap_future(future: Union[_ConcurrentFuture[_T], Future[_T]], *, loop: Optional[AbstractEventLoop] = ...) -> Future[_T]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/locks.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/locks.pyi old mode 100755 new mode 100644 index 19d47276..7480c339 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/locks.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/locks.pyi @@ -1,22 +1,36 @@ -from typing import Any, Callable, Type, TypeVar, Union, Optional, Awaitable +import sys +from types import TracebackType +from typing import Any, Awaitable, Callable, Deque, Generator, Optional, Type, TypeVar, Union from .events import AbstractEventLoop from .futures import Future -from types import TracebackType -_T = TypeVar('_T') +_T = TypeVar("_T") -class _ContextManager: - def __init__(self, lock: Union[Lock, Semaphore]) -> None: ... - def __enter__(self) -> object: ... - def __exit__(self, *args: Any) -> None: ... +if sys.version_info >= (3, 9): + class _ContextManagerMixin: + def __init__(self, lock: Union[Lock, Semaphore]) -> None: ... + def __aenter__(self) -> Awaitable[None]: ... + def __aexit__( + self, exc_type: Optional[Type[BaseException]], exc: Optional[BaseException], tb: Optional[TracebackType] + ) -> Awaitable[None]: ... -class _ContextManagerMixin(Future[_ContextManager]): - # Apparently this exists to *prohibit* use as a context manager. - def __enter__(self) -> object: ... - def __exit__(self, *args: Any) -> None: ... - def __aenter__(self) -> Awaitable[None]: ... - def __aexit__(self, exc_type: Optional[Type[BaseException]], exc: Optional[BaseException], tb: Optional[TracebackType]) -> Awaitable[None]: ... +else: + class _ContextManager: + def __init__(self, lock: Union[Lock, Semaphore]) -> None: ... + def __enter__(self) -> object: ... + def __exit__(self, *args: Any) -> None: ... + class _ContextManagerMixin: + def __init__(self, lock: Union[Lock, Semaphore]) -> None: ... + # Apparently this exists to *prohibit* use as a context manager. + def __enter__(self) -> object: ... + def __exit__(self, *args: Any) -> None: ... + def __iter__(self) -> Generator[Any, None, _ContextManager]: ... + def __await__(self) -> Generator[Any, None, _ContextManager]: ... + def __aenter__(self) -> Awaitable[None]: ... + def __aexit__( + self, exc_type: Optional[Type[BaseException]], exc: Optional[BaseException], tb: Optional[TracebackType] + ) -> Awaitable[None]: ... class Lock(_ContextManagerMixin): def __init__(self, *, loop: Optional[AbstractEventLoop] = ...) -> None: ... @@ -42,10 +56,13 @@ class Condition(_ContextManagerMixin): def notify_all(self) -> None: ... class Semaphore(_ContextManagerMixin): + _value: int + _waiters: Deque[Future[Any]] def __init__(self, value: int = ..., *, loop: Optional[AbstractEventLoop] = ...) -> None: ... def locked(self) -> bool: ... async def acquire(self) -> bool: ... def release(self) -> None: ... + def _wake_up_next(self) -> None: ... class BoundedSemaphore(Semaphore): def __init__(self, value: int = ..., *, loop: Optional[AbstractEventLoop] = ...) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/log.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/log.pyi new file mode 100644 index 00000000..e1de0b3b --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/log.pyi @@ -0,0 +1,3 @@ +import logging + +logger: logging.Logger diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/proactor_events.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/proactor_events.pyi old mode 100755 new mode 100644 index f7bc90db..e3ebeb50 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/proactor_events.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/proactor_events.pyi @@ -1,80 +1,73 @@ -import sys from socket import socket -from typing import Any, Mapping, Optional, Union +from typing import Any, Mapping, Optional +from typing_extensions import Literal from . import base_events, constants, events, futures, streams, transports -if sys.version_info >= (3, 7): - from os import PathLike - _Path = Union[str, PathLike[str]] -else: - _Path = str - -if sys.version_info >= (3, 8): - from typing import Literal -else: - from typing_extensions import Literal - class _ProactorBasePipeTransport(transports._FlowControlMixin, transports.BaseTransport): - - def __init__(self, loop: events.AbstractEventLoop, sock: socket, protocol: streams.StreamReaderProtocol, waiter: Optional[futures.Future[Any]] = ..., extra: Optional[Mapping[Any, Any]] = ..., server: Optional[events.AbstractServer] = ...) -> None: ... + def __init__( + self, + loop: events.AbstractEventLoop, + sock: socket, + protocol: streams.StreamReaderProtocol, + waiter: Optional[futures.Future[Any]] = ..., + extra: Optional[Mapping[Any, Any]] = ..., + server: Optional[events.AbstractServer] = ..., + ) -> None: ... def __repr__(self) -> str: ... def __del__(self) -> None: ... def get_write_buffer_size(self) -> int: ... class _ProactorReadPipeTransport(_ProactorBasePipeTransport, transports.ReadTransport): - - def __init__(self, loop: events.AbstractEventLoop, sock: socket, protocol: streams.StreamReaderProtocol, waiter: Optional[futures.Future[Any]] = ..., extra: Optional[Mapping[Any, Any]] = ..., server: Optional[events.AbstractServer] = ...) -> None: ... + def __init__( + self, + loop: events.AbstractEventLoop, + sock: socket, + protocol: streams.StreamReaderProtocol, + waiter: Optional[futures.Future[Any]] = ..., + extra: Optional[Mapping[Any, Any]] = ..., + server: Optional[events.AbstractServer] = ..., + ) -> None: ... class _ProactorBaseWritePipeTransport(_ProactorBasePipeTransport, transports.WriteTransport): - - def __init__(self, loop: events.AbstractEventLoop, sock: socket, protocol: streams.StreamReaderProtocol, waiter: Optional[futures.Future[Any]] = ..., extra: Optional[Mapping[Any, Any]] = ..., server: Optional[events.AbstractServer] = ...) -> None: ... + def __init__( + self, + loop: events.AbstractEventLoop, + sock: socket, + protocol: streams.StreamReaderProtocol, + waiter: Optional[futures.Future[Any]] = ..., + extra: Optional[Mapping[Any, Any]] = ..., + server: Optional[events.AbstractServer] = ..., + ) -> None: ... class _ProactorWritePipeTransport(_ProactorBaseWritePipeTransport): - - def __init__(self, loop: events.AbstractEventLoop, sock: socket, protocol: streams.StreamReaderProtocol, waiter: Optional[futures.Future[Any]] = ..., extra: Optional[Mapping[Any, Any]] = ..., server: Optional[events.AbstractServer] = ...) -> None: ... + def __init__( + self, + loop: events.AbstractEventLoop, + sock: socket, + protocol: streams.StreamReaderProtocol, + waiter: Optional[futures.Future[Any]] = ..., + extra: Optional[Mapping[Any, Any]] = ..., + server: Optional[events.AbstractServer] = ..., + ) -> None: ... class _ProactorDuplexPipeTransport(_ProactorReadPipeTransport, _ProactorBaseWritePipeTransport, transports.Transport): ... class _ProactorSocketTransport(_ProactorReadPipeTransport, _ProactorBaseWritePipeTransport, transports.Transport): _sendfile_compatible: constants._SendfileMode = ... - - def __init__(self, loop: events.AbstractEventLoop, sock: socket, protocol: streams.StreamReaderProtocol, waiter: Optional[futures.Future[Any]] = ..., extra: Optional[Mapping[Any, Any]] = ..., server: Optional[events.AbstractServer] = ...) -> None: ... + def __init__( + self, + loop: events.AbstractEventLoop, + sock: socket, + protocol: streams.StreamReaderProtocol, + waiter: Optional[futures.Future[Any]] = ..., + extra: Optional[Mapping[Any, Any]] = ..., + server: Optional[events.AbstractServer] = ..., + ) -> None: ... def _set_extra(self, sock: socket) -> None: ... def can_write_eof(self) -> Literal[True]: ... def write_eof(self) -> None: ... class BaseProactorEventLoop(base_events.BaseEventLoop): - def __init__(self, proactor: Any) -> None: ... - # The methods below don't actually exist directly, ProactorEventLoops do not implement them. However, they are - # needed to satisfy mypy - if sys.version_info >= (3, 7): - async def create_unix_connection( - self, - protocol_factory: events._ProtocolFactory, - path: _Path, - *, - ssl: events._SSLContext = ..., - sock: Optional[socket] = ..., - server_hostname: str = ..., - ssl_handshake_timeout: Optional[float] = ..., - ) -> events._TransProtPair: ... - async def create_unix_server( - self, - protocol_factory: events._ProtocolFactory, - path: _Path, - *, - sock: Optional[socket] = ..., - backlog: int = ..., - ssl: events._SSLContext = ..., - ssl_handshake_timeout: Optional[float] = ..., - start_serving: bool = ..., - ) -> events.AbstractServer: ... - else: - async def create_unix_connection(self, protocol_factory: events._ProtocolFactory, path: str, *, - ssl: events._SSLContext = ..., sock: Optional[socket] = ..., - server_hostname: str = ...) -> events._TransProtPair: ... - async def create_unix_server(self, protocol_factory: events._ProtocolFactory, path: str, *, - sock: Optional[socket] = ..., backlog: int = ..., ssl: events._SSLContext = ...) -> events.AbstractServer: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/protocols.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/protocols.pyi old mode 100755 new mode 100644 index e80f238d..ec89a299 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/protocols.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/protocols.pyi @@ -1,5 +1,6 @@ +import sys from asyncio import transports -from typing import Optional, Text, Tuple, Union +from typing import Optional, Tuple class BaseProtocol: def connection_made(self, transport: transports.BaseTransport) -> None: ... @@ -11,15 +12,16 @@ class Protocol(BaseProtocol): def data_received(self, data: bytes) -> None: ... def eof_received(self) -> Optional[bool]: ... -class BufferedProtocol(Protocol): - def get_buffer(self, sizehint: int) -> bytearray: ... - def buffer_updated(self, nbytes: int) -> None: ... +if sys.version_info >= (3, 7): + class BufferedProtocol(BaseProtocol): + def get_buffer(self, sizehint: int) -> bytearray: ... + def buffer_updated(self, nbytes: int) -> None: ... class DatagramProtocol(BaseProtocol): - def datagram_received(self, data: Union[bytes, Text], addr: Tuple[str, int]) -> None: ... + def datagram_received(self, data: bytes, addr: Tuple[str, int]) -> None: ... def error_received(self, exc: Exception) -> None: ... class SubprocessProtocol(BaseProtocol): - def pipe_data_received(self, fd: int, data: Union[bytes, Text]) -> None: ... + def pipe_data_received(self, fd: int, data: bytes) -> None: ... def pipe_connection_lost(self, fd: int, exc: Optional[Exception]) -> None: ... def process_exited(self) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/queues.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/queues.pyi old mode 100755 new mode 100644 index 420c67a9..2d4bada0 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/queues.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/queues.pyi @@ -1,10 +1,14 @@ +import sys from asyncio.events import AbstractEventLoop -from typing import Generic, TypeVar, Optional +from typing import Any, Generic, Optional, TypeVar + +if sys.version_info >= (3, 9): + from types import GenericAlias class QueueEmpty(Exception): ... class QueueFull(Exception): ... -_T = TypeVar('_T') +_T = TypeVar("_T") class Queue(Generic[_T]): def __init__(self, maxsize: int = ..., *, loop: Optional[AbstractEventLoop] = ...) -> None: ... @@ -14,8 +18,6 @@ class Queue(Generic[_T]): def __repr__(self) -> str: ... def __str__(self) -> str: ... def _format(self) -> str: ... - def _consume_done_getters(self) -> None: ... - def _consume_done_putters(self) -> None: ... def qsize(self) -> int: ... @property def maxsize(self) -> int: ... @@ -25,11 +27,10 @@ class Queue(Generic[_T]): def put_nowait(self, item: _T) -> None: ... async def get(self) -> _T: ... def get_nowait(self) -> _T: ... - async def join(self) -> bool: ... + async def join(self) -> None: ... def task_done(self) -> None: ... - + if sys.version_info >= (3, 9): + def __class_getitem__(cls, type: Any) -> GenericAlias: ... class PriorityQueue(Queue[_T]): ... - - class LifoQueue(Queue[_T]): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/runners.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/runners.pyi old mode 100755 new mode 100644 index 7d8c28c0..1628cb3e --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/runners.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/runners.pyi @@ -1,9 +1,10 @@ import sys - if sys.version_info >= (3, 7): - from typing import Awaitable, TypeVar - - _T = TypeVar('_T') + from typing import Awaitable, Optional, TypeVar - def run(main: Awaitable[_T], *, debug: bool = ...) -> _T: ... + _T = TypeVar("_T") + if sys.version_info >= (3, 8): + def run(main: Awaitable[_T], *, debug: Optional[bool] = ...) -> _T: ... + else: + def run(main: Awaitable[_T], *, debug: bool = ...) -> _T: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/selector_events.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/selector_events.pyi old mode 100755 new mode 100644 index 7c3f74fc..8946bb05 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/selector_events.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/selector_events.pyi @@ -1,44 +1,7 @@ import selectors -import sys -from socket import socket -from typing import Optional, Union +from typing import Optional -from . import base_events, events - -if sys.version_info >= (3, 7): - from os import PathLike - _Path = Union[str, PathLike[str]] -else: - _Path = str +from . import base_events class BaseSelectorEventLoop(base_events.BaseEventLoop): - - def __init__(self, selector: selectors.BaseSelector = ...) -> None: ... - if sys.version_info >= (3, 7): - async def create_unix_connection( - self, - protocol_factory: events._ProtocolFactory, - path: _Path, - *, - ssl: events._SSLContext = ..., - sock: Optional[socket] = ..., - server_hostname: str = ..., - ssl_handshake_timeout: Optional[float] = ..., - ) -> events._TransProtPair: ... - async def create_unix_server( - self, - protocol_factory: events._ProtocolFactory, - path: _Path, - *, - sock: Optional[socket] = ..., - backlog: int = ..., - ssl: events._SSLContext = ..., - ssl_handshake_timeout: Optional[float] = ..., - start_serving: bool = ..., - ) -> events.AbstractServer: ... - else: - async def create_unix_connection(self, protocol_factory: events._ProtocolFactory, path: str, *, - ssl: events._SSLContext = ..., sock: Optional[socket] = ..., - server_hostname: str = ...) -> events._TransProtPair: ... - async def create_unix_server(self, protocol_factory: events._ProtocolFactory, path: str, *, - sock: Optional[socket] = ..., backlog: int = ..., ssl: events._SSLContext = ...) -> events.AbstractServer: ... + def __init__(self, selector: Optional[selectors.BaseSelector] = ...) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/sslproto.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/sslproto.pyi new file mode 100644 index 00000000..8d1c44ae --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/sslproto.pyi @@ -0,0 +1,133 @@ +import ssl +import sys +from typing import Any, Callable, ClassVar, Deque, Dict, List, Optional, Tuple +from typing_extensions import Literal + +from . import constants, events, futures, protocols, transports + +def _create_transport_context(server_side: bool, server_hostname: Optional[str]) -> ssl.SSLContext: ... + +_UNWRAPPED: Literal["UNWRAPPED"] +_DO_HANDSHAKE: Literal["DO_HANDSHAKE"] +_WRAPPED: Literal["WRAPPED"] +_SHUTDOWN: Literal["SHUTDOWN"] + +class _SSLPipe: + + max_size: ClassVar[int] + + _context: ssl.SSLContext + _server_side: bool + _server_hostname: Optional[str] + _state: str + _incoming: ssl.MemoryBIO + _outgoing: ssl.MemoryBIO + _sslobj: Optional[ssl.SSLObject] + _need_ssldata: bool + _handshake_cb: Optional[Callable[[Optional[BaseException]], None]] + _shutdown_cb: Optional[Callable[[], None]] + def __init__(self, context: ssl.SSLContext, server_side: bool, server_hostname: Optional[str] = ...) -> None: ... + @property + def context(self) -> ssl.SSLContext: ... + @property + def ssl_object(self) -> Optional[ssl.SSLObject]: ... + @property + def need_ssldata(self) -> bool: ... + @property + def wrapped(self) -> bool: ... + def do_handshake(self, callback: Optional[Callable[[Optional[BaseException]], None]] = ...) -> List[bytes]: ... + def shutdown(self, callback: Optional[Callable[[], None]] = ...) -> List[bytes]: ... + def feed_eof(self) -> None: ... + def feed_ssldata(self, data: bytes, only_handshake: bool = ...) -> Tuple[List[bytes], List[bytes]]: ... + def feed_appdata(self, data: bytes, offset: int = ...) -> Tuple[List[bytes], int]: ... + +class _SSLProtocolTransport(transports._FlowControlMixin, transports.Transport): + + _sendfile_compatible: ClassVar[constants._SendfileMode] + + _loop: events.AbstractEventLoop + _ssl_protocol: SSLProtocol + _closed: bool + def __init__(self, loop: events.AbstractEventLoop, ssl_protocol: SSLProtocol) -> None: ... + def get_extra_info(self, name: str, default: Optional[Any] = ...) -> Dict[str, Any]: ... + def set_protocol(self, protocol: protocols.BaseProtocol) -> None: ... + def get_protocol(self) -> protocols.BaseProtocol: ... + def is_closing(self) -> bool: ... + def close(self) -> None: ... + if sys.version_info >= (3, 7): + def is_reading(self) -> bool: ... + def pause_reading(self) -> None: ... + def resume_reading(self) -> None: ... + def set_write_buffer_limits(self, high: Optional[int] = ..., low: Optional[int] = ...) -> None: ... + def get_write_buffer_size(self) -> int: ... + if sys.version_info >= (3, 7): + @property + def _protocol_paused(self) -> bool: ... + def write(self, data: bytes) -> None: ... + def can_write_eof(self) -> Literal[False]: ... + def abort(self) -> None: ... + +class SSLProtocol(protocols.Protocol): + + _server_side: bool + _server_hostname: Optional[str] + _sslcontext: ssl.SSLContext + _extra: Dict[str, Any] + _write_backlog: Deque[Tuple[bytes, int]] + _write_buffer_size: int + _waiter: futures.Future[Any] + _loop: events.AbstractEventLoop + _app_transport: _SSLProtocolTransport + _sslpipe: Optional[_SSLPipe] + _session_established: bool + _in_handshake: bool + _in_shutdown: bool + _transport: Optional[transports.BaseTransport] + _call_connection_made: bool + _ssl_handshake_timeout: Optional[int] + _app_protocol: protocols.BaseProtocol + _app_protocol_is_buffer: bool + + if sys.version_info >= (3, 7): + def __init__( + self, + loop: events.AbstractEventLoop, + app_protocol: protocols.BaseProtocol, + sslcontext: ssl.SSLContext, + waiter: futures.Future[Any], + server_side: bool = ..., + server_hostname: Optional[str] = ..., + call_connection_made: bool = ..., + ssl_handshake_timeout: Optional[int] = ..., + ) -> None: ... + else: + def __init__( + self, + loop: events.AbstractEventLoop, + app_protocol: protocols.BaseProtocol, + sslcontext: ssl.SSLContext, + waiter: futures.Future, + server_side: bool = ..., + server_hostname: Optional[str] = ..., + call_connection_made: bool = ..., + ) -> None: ... + if sys.version_info >= (3, 7): + def _set_app_protocol(self, app_protocol: protocols.BaseProtocol) -> None: ... + def _wakeup_waiter(self, exc: Optional[BaseException] = ...) -> None: ... + def connection_made(self, transport: transports.BaseTransport) -> None: ... + def connection_lost(self, exc: Optional[BaseException]) -> None: ... + def pause_writing(self) -> None: ... + def resume_writing(self) -> None: ... + def data_received(self, data: bytes) -> None: ... + def eof_received(self) -> None: ... + def _get_extra_info(self, name: str, default: Optional[Any] = ...) -> Any: ... + def _start_shutdown(self) -> None: ... + def _write_appdata(self, data: bytes) -> None: ... + def _start_handshake(self) -> None: ... + if sys.version_info >= (3, 7): + def _check_handshake_timeout(self) -> None: ... + def _on_handshake_complete(self, handshake_exc: Optional[BaseException]) -> None: ... + def _process_write_backlog(self) -> None: ... + def _fatal_error(self, exc: BaseException, message: str = ...) -> None: ... + def _finalize(self) -> None: ... + def _abort(self) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/staggered.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/staggered.pyi new file mode 100644 index 00000000..057883e0 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/staggered.pyi @@ -0,0 +1,12 @@ +import sys +from typing import Any, Awaitable, Callable, Iterable, List, Optional, Tuple + +from . import events + +if sys.version_info >= (3, 8): + async def staggered_race( + coro_fns: Iterable[Callable[[], Awaitable[Any]]], + delay: Optional[float], + *, + loop: Optional[events.AbstractEventLoop] = ..., + ) -> Tuple[Any, Optional[int], List[Optional[Exception]]]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/streams.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/streams.pyi old mode 100755 new mode 100644 index e8517008..36aafedd --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/streams.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/streams.pyi @@ -1,9 +1,7 @@ import sys -from typing import Any, Awaitable, Callable, Iterable, Optional, Tuple, Union +from typing import Any, AsyncIterator, Awaitable, Callable, Iterable, Optional, Tuple, Union -from . import events -from . import protocols -from . import transports +from . import events, protocols, transports _ClientConnectedCallback = Callable[[StreamReader, StreamWriter], Optional[Awaitable[None]]] @@ -12,21 +10,19 @@ if sys.version_info < (3, 8): expected: Optional[int] partial: bytes def __init__(self, partial: bytes, expected: Optional[int]) -> None: ... - class LimitOverrunError(Exception): consumed: int def __init__(self, message: str, consumed: int) -> None: ... async def open_connection( - host: str = ..., - port: Union[int, str] = ..., + host: Optional[str] = ..., + port: Optional[Union[int, str]] = ..., *, loop: Optional[events.AbstractEventLoop] = ..., limit: int = ..., ssl_handshake_timeout: Optional[float] = ..., - **kwds: Any + **kwds: Any, ) -> Tuple[StreamReader, StreamWriter]: ... - async def start_server( client_connected_cb: _ClientConnectedCallback, host: Optional[str] = ..., @@ -35,50 +31,50 @@ async def start_server( loop: Optional[events.AbstractEventLoop] = ..., limit: int = ..., ssl_handshake_timeout: Optional[float] = ..., - **kwds: Any + **kwds: Any, ) -> events.AbstractServer: ... -if sys.platform != 'win32': +if sys.platform != "win32": if sys.version_info >= (3, 7): from os import PathLike + _PathType = Union[str, PathLike[str]] else: _PathType = str - async def open_unix_connection( - path: _PathType = ..., - *, - loop: Optional[events.AbstractEventLoop] = ..., - limit: int = ..., - **kwds: Any + path: Optional[_PathType] = ..., *, loop: Optional[events.AbstractEventLoop] = ..., limit: int = ..., **kwds: Any ) -> Tuple[StreamReader, StreamWriter]: ... - async def start_unix_server( client_connected_cb: _ClientConnectedCallback, - path: _PathType = ..., + path: Optional[_PathType] = ..., *, loop: Optional[events.AbstractEventLoop] = ..., limit: int = ..., - **kwds: Any) -> events.AbstractServer: ... + **kwds: Any, + ) -> events.AbstractServer: ... class FlowControlMixin(protocols.Protocol): ... class StreamReaderProtocol(FlowControlMixin, protocols.Protocol): - def __init__(self, - stream_reader: StreamReader, - client_connected_cb: _ClientConnectedCallback = ..., - loop: Optional[events.AbstractEventLoop] = ...) -> None: ... + def __init__( + self, + stream_reader: StreamReader, + client_connected_cb: Optional[_ClientConnectedCallback] = ..., + loop: Optional[events.AbstractEventLoop] = ..., + ) -> None: ... def connection_made(self, transport: transports.BaseTransport) -> None: ... def connection_lost(self, exc: Optional[Exception]) -> None: ... def data_received(self, data: bytes) -> None: ... def eof_received(self) -> bool: ... class StreamWriter: - def __init__(self, - transport: transports.BaseTransport, - protocol: protocols.BaseProtocol, - reader: Optional[StreamReader], - loop: events.AbstractEventLoop) -> None: ... + def __init__( + self, + transport: transports.BaseTransport, + protocol: protocols.BaseProtocol, + reader: Optional[StreamReader], + loop: events.AbstractEventLoop, + ) -> None: ... @property def transport(self) -> transports.BaseTransport: ... def write(self, data: bytes) -> None: ... @@ -93,9 +89,7 @@ class StreamWriter: async def drain(self) -> None: ... class StreamReader: - def __init__(self, - limit: int = ..., - loop: Optional[events.AbstractEventLoop] = ...) -> None: ... + def __init__(self, limit: int = ..., loop: Optional[events.AbstractEventLoop] = ...) -> None: ... def exception(self) -> Exception: ... def set_exception(self, exc: Exception) -> None: ... def set_transport(self, transport: transports.BaseTransport) -> None: ... @@ -106,3 +100,5 @@ class StreamReader: async def readuntil(self, separator: bytes = ...) -> bytes: ... async def read(self, n: int = ...) -> bytes: ... async def readexactly(self, n: int) -> bytes: ... + def __aiter__(self) -> AsyncIterator[bytes]: ... + async def __anext__(self) -> bytes: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/subprocess.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/subprocess.pyi old mode 100755 new mode 100644 index 14137447..58e1bd40 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/subprocess.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/subprocess.pyi @@ -1,60 +1,60 @@ -from asyncio import events -from asyncio import protocols -from asyncio import streams -from asyncio import transports -from typing import Any, Optional, Text, Tuple, Union, IO +import sys +from asyncio import events, protocols, streams, transports +from typing import IO, Any, Optional, Tuple, Union + +if sys.version_info >= (3, 8): + from os import PathLike + + _ExecArg = Union[str, bytes, PathLike[str], PathLike[bytes]] +else: + _ExecArg = Union[str, bytes] # Union used instead of AnyStr due to mypy issue #1236 PIPE: int STDOUT: int DEVNULL: int -class SubprocessStreamProtocol(streams.FlowControlMixin, - protocols.SubprocessProtocol): +class SubprocessStreamProtocol(streams.FlowControlMixin, protocols.SubprocessProtocol): stdin: Optional[streams.StreamWriter] stdout: Optional[streams.StreamReader] stderr: Optional[streams.StreamReader] def __init__(self, limit: int, loop: events.AbstractEventLoop) -> None: ... def connection_made(self, transport: transports.BaseTransport) -> None: ... - def pipe_data_received(self, fd: int, data: Union[bytes, Text]) -> None: ... + def pipe_data_received(self, fd: int, data: Union[bytes, str]) -> None: ... def pipe_connection_lost(self, fd: int, exc: Optional[Exception]) -> None: ... def process_exited(self) -> None: ... - class Process: stdin: Optional[streams.StreamWriter] stdout: Optional[streams.StreamReader] stderr: Optional[streams.StreamReader] pid: int - def __init__(self, - transport: transports.BaseTransport, - protocol: protocols.BaseProtocol, - loop: events.AbstractEventLoop) -> None: ... + def __init__( + self, transport: transports.BaseTransport, protocol: protocols.BaseProtocol, loop: events.AbstractEventLoop + ) -> None: ... @property - def returncode(self) -> int: ... + def returncode(self) -> Optional[int]: ... async def wait(self) -> int: ... def send_signal(self, signal: int) -> None: ... def terminate(self) -> None: ... def kill(self) -> None: ... async def communicate(self, input: Optional[bytes] = ...) -> Tuple[bytes, bytes]: ... - async def create_subprocess_shell( - *Args: Union[str, bytes], # Union used instead of AnyStr due to mypy issue #1236 + cmd: Union[str, bytes], # Union used instead of AnyStr due to mypy issue #1236 stdin: Union[int, IO[Any], None] = ..., stdout: Union[int, IO[Any], None] = ..., stderr: Union[int, IO[Any], None] = ..., - loop: events.AbstractEventLoop = ..., + loop: Optional[events.AbstractEventLoop] = ..., limit: int = ..., - **kwds: Any + **kwds: Any, ) -> Process: ... - async def create_subprocess_exec( - program: Union[str, bytes], # Union used instead of AnyStr due to mypy issue #1236 - *args: Any, + program: _ExecArg, + *args: _ExecArg, stdin: Union[int, IO[Any], None] = ..., stdout: Union[int, IO[Any], None] = ..., stderr: Union[int, IO[Any], None] = ..., - loop: events.AbstractEventLoop = ..., + loop: Optional[events.AbstractEventLoop] = ..., limit: int = ..., - **kwds: Any + **kwds: Any, ) -> Process: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/tasks.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/tasks.pyi old mode 100755 new mode 100644 index 28614687..ed5db581 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/tasks.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/tasks.pyi @@ -1,33 +1,47 @@ import concurrent.futures import sys +from types import FrameType from typing import ( - Any, TypeVar, Set, List, TextIO, Union, Tuple, Generic, Generator, Iterable, Awaitable, overload, Iterator, Optional, + Any, + Awaitable, + Generator, + Generic, + Iterable, + Iterator, + List, + Optional, + Set, + TextIO, + Tuple, + TypeVar, + Union, + overload, ) -from types import FrameType +from typing_extensions import Literal + from .events import AbstractEventLoop from .futures import Future -if sys.version_info >= (3, 8): - from typing import Literal -else: - from typing_extensions import Literal +if sys.version_info >= (3, 9): + from types import GenericAlias -_T = TypeVar('_T') -_T1 = TypeVar('_T1') -_T2 = TypeVar('_T2') -_T3 = TypeVar('_T3') -_T4 = TypeVar('_T4') -_T5 = TypeVar('_T5') +_T = TypeVar("_T") +_T1 = TypeVar("_T1") +_T2 = TypeVar("_T2") +_T3 = TypeVar("_T3") +_T4 = TypeVar("_T4") +_T5 = TypeVar("_T5") _FutureT = Union[Future[_T], Generator[Any, None, _T], Awaitable[_T]] FIRST_EXCEPTION: str FIRST_COMPLETED: str ALL_COMPLETED: str -def as_completed(fs: Iterable[_FutureT[_T]], *, loop: Optional[AbstractEventLoop] = ..., - timeout: Optional[float] = ...) -> Iterator[Future[_T]]: ... -def ensure_future(coro_or_future: _FutureT[_T], - *, loop: Optional[AbstractEventLoop] = ...) -> Future[_T]: ... +def as_completed( + fs: Iterable[_FutureT[_T]], *, loop: Optional[AbstractEventLoop] = ..., timeout: Optional[float] = ... +) -> Iterator[Future[_T]]: ... +def ensure_future(coro_or_future: _FutureT[_T], *, loop: Optional[AbstractEventLoop] = ...) -> Future[_T]: ... + # Prior to Python 3.7 'async' was an alias for 'ensure_future'. # It became a keyword in 3.7. @@ -36,66 +50,120 @@ def ensure_future(coro_or_future: _FutureT[_T], # zip() because typing does not support variadic type variables. See # typing PR #1550 for discussion. @overload -def gather(coro_or_future1: _FutureT[_T1], - *, loop: Optional[AbstractEventLoop] = ..., return_exceptions: Literal[False] = ...) -> Future[Tuple[_T1]]: ... +def gather( + coro_or_future1: _FutureT[_T1], *, loop: Optional[AbstractEventLoop] = ..., return_exceptions: Literal[False] = ... +) -> Future[Tuple[_T1]]: ... @overload -def gather(coro_or_future1: _FutureT[_T1], coro_or_future2: _FutureT[_T2], - *, loop: Optional[AbstractEventLoop] = ..., return_exceptions: Literal[False] = ...) -> Future[Tuple[_T1, _T2]]: ... +def gather( + coro_or_future1: _FutureT[_T1], + coro_or_future2: _FutureT[_T2], + *, + loop: Optional[AbstractEventLoop] = ..., + return_exceptions: Literal[False] = ..., +) -> Future[Tuple[_T1, _T2]]: ... @overload -def gather(coro_or_future1: _FutureT[_T1], coro_or_future2: _FutureT[_T2], coro_or_future3: _FutureT[_T3], - *, loop: Optional[AbstractEventLoop] = ..., - return_exceptions: Literal[False] = ...) -> Future[Tuple[_T1, _T2, _T3]]: ... +def gather( + coro_or_future1: _FutureT[_T1], + coro_or_future2: _FutureT[_T2], + coro_or_future3: _FutureT[_T3], + *, + loop: Optional[AbstractEventLoop] = ..., + return_exceptions: Literal[False] = ..., +) -> Future[Tuple[_T1, _T2, _T3]]: ... @overload -def gather(coro_or_future1: _FutureT[_T1], coro_or_future2: _FutureT[_T2], coro_or_future3: _FutureT[_T3], - coro_or_future4: _FutureT[_T4], - *, loop: Optional[AbstractEventLoop] = ..., - return_exceptions: Literal[False] = ...) -> Future[Tuple[_T1, _T2, _T3, _T4]]: ... +def gather( + coro_or_future1: _FutureT[_T1], + coro_or_future2: _FutureT[_T2], + coro_or_future3: _FutureT[_T3], + coro_or_future4: _FutureT[_T4], + *, + loop: Optional[AbstractEventLoop] = ..., + return_exceptions: Literal[False] = ..., +) -> Future[Tuple[_T1, _T2, _T3, _T4]]: ... @overload -def gather(coro_or_future1: _FutureT[_T1], coro_or_future2: _FutureT[_T2], coro_or_future3: _FutureT[_T3], - coro_or_future4: _FutureT[_T4], coro_or_future5: _FutureT[_T5], - *, loop: Optional[AbstractEventLoop] = ..., - return_exceptions: Literal[False] = ...) -> Future[Tuple[_T1, _T2, _T3, _T4, _T5]]: ... +def gather( + coro_or_future1: _FutureT[_T1], + coro_or_future2: _FutureT[_T2], + coro_or_future3: _FutureT[_T3], + coro_or_future4: _FutureT[_T4], + coro_or_future5: _FutureT[_T5], + *, + loop: Optional[AbstractEventLoop] = ..., + return_exceptions: Literal[False] = ..., +) -> Future[Tuple[_T1, _T2, _T3, _T4, _T5]]: ... @overload -def gather(coro_or_future1: _FutureT[Any], coro_or_future2: _FutureT[Any], coro_or_future3: _FutureT[Any], - coro_or_future4: _FutureT[Any], coro_or_future5: _FutureT[Any], coro_or_future6: _FutureT[Any], - *coros_or_futures: _FutureT[Any], - loop: Optional[AbstractEventLoop] = ..., return_exceptions: bool = ...) -> Future[List[Any]]: ... +def gather( + coro_or_future1: _FutureT[Any], + coro_or_future2: _FutureT[Any], + coro_or_future3: _FutureT[Any], + coro_or_future4: _FutureT[Any], + coro_or_future5: _FutureT[Any], + coro_or_future6: _FutureT[Any], + *coros_or_futures: _FutureT[Any], + loop: Optional[AbstractEventLoop] = ..., + return_exceptions: bool = ..., +) -> Future[List[Any]]: ... @overload -def gather(coro_or_future1: _FutureT[_T1], - *, loop: Optional[AbstractEventLoop] = ..., - return_exceptions: bool = ...) -> Future[Tuple[Union[_T1, BaseException]]]: ... +def gather( + coro_or_future1: _FutureT[_T1], *, loop: Optional[AbstractEventLoop] = ..., return_exceptions: bool = ... +) -> Future[Tuple[Union[_T1, BaseException]]]: ... @overload -def gather(coro_or_future1: _FutureT[_T1], coro_or_future2: _FutureT[_T2], - *, loop: Optional[AbstractEventLoop] = ..., - return_exceptions: bool = ...) -> Future[Tuple[Union[_T1, BaseException], Union[_T2, BaseException]]]: ... +def gather( + coro_or_future1: _FutureT[_T1], + coro_or_future2: _FutureT[_T2], + *, + loop: Optional[AbstractEventLoop] = ..., + return_exceptions: bool = ..., +) -> Future[Tuple[Union[_T1, BaseException], Union[_T2, BaseException]]]: ... @overload -def gather(coro_or_future1: _FutureT[_T1], coro_or_future2: _FutureT[_T2], coro_or_future3: _FutureT[_T3], - *, loop: Optional[AbstractEventLoop] = ..., return_exceptions: bool = ...) -> Future[ - Tuple[Union[_T1, BaseException], Union[_T2, BaseException], Union[_T3, BaseException]]]: ... +def gather( + coro_or_future1: _FutureT[_T1], + coro_or_future2: _FutureT[_T2], + coro_or_future3: _FutureT[_T3], + *, + loop: Optional[AbstractEventLoop] = ..., + return_exceptions: bool = ..., +) -> Future[Tuple[Union[_T1, BaseException], Union[_T2, BaseException], Union[_T3, BaseException]]]: ... @overload -def gather(coro_or_future1: _FutureT[_T1], coro_or_future2: _FutureT[_T2], coro_or_future3: _FutureT[_T3], - coro_or_future4: _FutureT[_T4], - *, loop: Optional[AbstractEventLoop] = ..., return_exceptions: bool = ...) -> Future[ - Tuple[Union[_T1, BaseException], Union[_T2, BaseException], Union[_T3, BaseException], Union[_T4, BaseException]]]: ... +def gather( + coro_or_future1: _FutureT[_T1], + coro_or_future2: _FutureT[_T2], + coro_or_future3: _FutureT[_T3], + coro_or_future4: _FutureT[_T4], + *, + loop: Optional[AbstractEventLoop] = ..., + return_exceptions: bool = ..., +) -> Future[ + Tuple[Union[_T1, BaseException], Union[_T2, BaseException], Union[_T3, BaseException], Union[_T4, BaseException]] +]: ... @overload -def gather(coro_or_future1: _FutureT[_T1], coro_or_future2: _FutureT[_T2], coro_or_future3: _FutureT[_T3], - coro_or_future4: _FutureT[_T4], coro_or_future5: _FutureT[_T5], - *, loop: Optional[AbstractEventLoop] = ..., return_exceptions: bool = ...) -> Future[ - Tuple[Union[_T1, BaseException], Union[_T2, BaseException], Union[_T3, BaseException], Union[_T4, BaseException], Union[_T5, BaseException]]]: ... -def run_coroutine_threadsafe(coro: _FutureT[_T], - loop: AbstractEventLoop) -> concurrent.futures.Future[_T]: ... +def gather( + coro_or_future1: _FutureT[_T1], + coro_or_future2: _FutureT[_T2], + coro_or_future3: _FutureT[_T3], + coro_or_future4: _FutureT[_T4], + coro_or_future5: _FutureT[_T5], + *, + loop: Optional[AbstractEventLoop] = ..., + return_exceptions: bool = ..., +) -> Future[ + Tuple[ + Union[_T1, BaseException], + Union[_T2, BaseException], + Union[_T3, BaseException], + Union[_T4, BaseException], + Union[_T5, BaseException], + ] +]: ... +def run_coroutine_threadsafe(coro: _FutureT[_T], loop: AbstractEventLoop) -> concurrent.futures.Future[_T]: ... def shield(arg: _FutureT[_T], *, loop: Optional[AbstractEventLoop] = ...) -> Future[_T]: ... -def sleep(delay: float, result: _T = ..., loop: Optional[AbstractEventLoop] = ...) -> Future[_T]: ... -def wait(fs: Iterable[_FutureT[_T]], *, loop: Optional[AbstractEventLoop] = ..., timeout: Optional[float] = ..., - return_when: str = ...) -> Future[Tuple[Set[Future[_T]], Set[Future[_T]]]]: ... -def wait_for(fut: _FutureT[_T], timeout: Optional[float], - *, loop: Optional[AbstractEventLoop] = ...) -> Future[_T]: ... +def sleep(delay: float, result: _T = ..., *, loop: Optional[AbstractEventLoop] = ...) -> Future[_T]: ... +def wait( + fs: Iterable[_FutureT[_T]], *, loop: Optional[AbstractEventLoop] = ..., timeout: Optional[float] = ..., return_when: str = ... +) -> Future[Tuple[Set[Future[_T]], Set[Future[_T]]]]: ... +def wait_for(fut: _FutureT[_T], timeout: Optional[float], *, loop: Optional[AbstractEventLoop] = ...) -> Future[_T]: ... class Task(Future[_T], Generic[_T]): - @classmethod - def current_task(cls, loop: Optional[AbstractEventLoop] = ...) -> Task[Any]: ... - @classmethod - def all_tasks(cls, loop: Optional[AbstractEventLoop] = ...) -> Set[Task[Any]]: ... if sys.version_info >= (3, 8): def __init__( self, @@ -110,19 +178,27 @@ class Task(Future[_T], Generic[_T]): if sys.version_info >= (3, 8): def get_coro(self) -> Any: ... def get_name(self) -> str: ... - def set_name(self, value: object) -> None: ... + def set_name(self, __value: object) -> None: ... def get_stack(self, *, limit: int = ...) -> List[FrameType]: ... def print_stack(self, *, limit: int = ..., file: TextIO = ...) -> None: ... - def cancel(self) -> bool: ... - def _step(self, value: Any = ..., exc: Exception = ...) -> None: ... - def _wakeup(self, future: Future[Any]) -> None: ... + if sys.version_info >= (3, 9): + def cancel(self, msg: Optional[str] = ...) -> bool: ... + else: + def cancel(self) -> bool: ... + if sys.version_info < (3, 9): + @classmethod + def current_task(cls, loop: Optional[AbstractEventLoop] = ...) -> Optional[Task[Any]]: ... + @classmethod + def all_tasks(cls, loop: Optional[AbstractEventLoop] = ...) -> Set[Task[Any]]: ... + if sys.version_info < (3, 7): + def _wakeup(self, fut: Future[Any]) -> None: ... + if sys.version_info >= (3, 9): + def __class_getitem__(cls, item: Any) -> GenericAlias: ... if sys.version_info >= (3, 7): def all_tasks(loop: Optional[AbstractEventLoop] = ...) -> Set[Task[Any]]: ... if sys.version_info >= (3, 8): - def create_task( - coro: Union[Generator[Any, None, _T], Awaitable[_T]], *, name: Optional[str] = ..., - ) -> Task[Any]: ... + def create_task(coro: Union[Generator[Any, None, _T], Awaitable[_T]], *, name: Optional[str] = ...) -> Task[_T]: ... else: - def create_task(coro: Union[Generator[Any, None, _T], Awaitable[_T]]) -> Task[Any]: ... + def create_task(coro: Union[Generator[Any, None, _T], Awaitable[_T]]) -> Task[_T]: ... def current_task(loop: Optional[AbstractEventLoop] = ...) -> Optional[Task[Any]]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/threads.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/threads.pyi new file mode 100644 index 00000000..3f798d8a --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/threads.pyi @@ -0,0 +1,7 @@ +import sys +from typing import Any, Callable, TypeVar + +_T = TypeVar("_T") + +if sys.version_info >= (3, 9): + async def to_thread(__func: Callable[..., _T], *args: Any, **kwargs: Any) -> _T: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/transports.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/transports.pyi old mode 100755 new mode 100644 index df80beb4..636ac363 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/transports.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/transports.pyi @@ -1,16 +1,16 @@ import sys -from typing import Any, Mapping, List, Optional, Tuple -from asyncio.protocols import BaseProtocol from asyncio.events import AbstractEventLoop +from asyncio.protocols import BaseProtocol +from socket import _Address +from typing import Any, List, Mapping, Optional, Tuple class BaseTransport: - def __init__(self, extra: Mapping[Any, Any] = ...) -> None: ... + def __init__(self, extra: Optional[Mapping[Any, Any]] = ...) -> None: ... def get_extra_info(self, name: Any, default: Any = ...) -> Any: ... def is_closing(self) -> bool: ... def close(self) -> None: ... - if sys.version_info >= (3, 5): - def set_protocol(self, protocol: BaseProtocol) -> None: ... - def get_protocol(self) -> BaseProtocol: ... + def set_protocol(self, protocol: BaseProtocol) -> None: ... + def get_protocol(self) -> BaseProtocol: ... class ReadTransport(BaseTransport): if sys.version_info >= (3, 7): @@ -19,9 +19,7 @@ class ReadTransport(BaseTransport): def resume_reading(self) -> None: ... class WriteTransport(BaseTransport): - def set_write_buffer_limits( - self, high: int = ..., low: int = ... - ) -> None: ... + def set_write_buffer_limits(self, high: Optional[int] = ..., low: Optional[int] = ...) -> None: ... def get_write_buffer_size(self) -> int: ... def write(self, data: Any) -> None: ... def writelines(self, list_of_data: List[Any]) -> None: ... @@ -32,13 +30,13 @@ class WriteTransport(BaseTransport): class Transport(ReadTransport, WriteTransport): ... class DatagramTransport(BaseTransport): - def sendto(self, data: Any, addr: Optional[Tuple[str, int]] = ...) -> None: ... + def sendto(self, data: Any, addr: Optional[_Address] = ...) -> None: ... def abort(self) -> None: ... class SubprocessTransport(BaseTransport): def get_pid(self) -> int: ... - def get_returncode(self) -> int: ... - def get_pipe_transport(self, fd: int) -> BaseTransport: ... + def get_returncode(self) -> Optional[int]: ... + def get_pipe_transport(self, fd: int) -> Optional[BaseTransport]: ... def send_signal(self, signal: int) -> int: ... def terminate(self) -> None: ... def kill(self) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/trsock.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/trsock.pyi new file mode 100644 index 00000000..db9efb08 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/trsock.pyi @@ -0,0 +1,86 @@ +import socket +import sys +from types import TracebackType +from typing import Any, BinaryIO, Iterable, List, NoReturn, Optional, Tuple, Type, Union, overload + +if sys.version_info >= (3, 8): + # These are based in socket, maybe move them out into _typeshed.pyi or such + _Address = Union[tuple, str] + _RetAddress = Any + _WriteBuffer = Union[bytearray, memoryview] + _CMSG = Tuple[int, int, bytes] + class TransportSocket: + def __init__(self, sock: socket.socket) -> None: ... + def _na(self, what: str) -> None: ... + @property + def family(self) -> int: ... + @property + def type(self) -> int: ... + @property + def proto(self) -> int: ... + def __getstate__(self) -> NoReturn: ... + def fileno(self) -> int: ... + def dup(self) -> socket.socket: ... + def get_inheritable(self) -> bool: ... + def shutdown(self, how: int) -> None: ... + @overload + def getsockopt(self, level: int, optname: int) -> int: ... + @overload + def getsockopt(self, level: int, optname: int, buflen: int) -> bytes: ... + @overload + def setsockopt(self, level: int, optname: int, value: Union[int, bytes]) -> None: ... + @overload + def setsockopt(self, level: int, optname: int, value: None, optlen: int) -> None: ... + def getpeername(self) -> _RetAddress: ... + def getsockname(self) -> _RetAddress: ... + def getsockbyname(self) -> NoReturn: ... # This method doesn't exist on socket, yet is passed through? + def accept(self) -> Tuple[socket.socket, _RetAddress]: ... + def connect(self, address: Union[_Address, bytes]) -> None: ... + def connect_ex(self, address: Union[_Address, bytes]) -> int: ... + def bind(self, address: Union[_Address, bytes]) -> None: ... + if sys.platform == "win32": + def ioctl(self, control: int, option: Union[int, Tuple[int, int, int], bool]) -> None: ... + else: + def ioctl(self, control: int, option: Union[int, Tuple[int, int, int], bool]) -> NoReturn: ... + def listen(self, __backlog: int = ...) -> None: ... + def makefile(self) -> BinaryIO: ... + def sendfile(self, file: BinaryIO, offset: int = ..., count: Optional[int] = ...) -> int: ... + def close(self) -> None: ... + def detach(self) -> int: ... + if sys.platform == "linux": + def sendmsg_afalg( + self, msg: Iterable[bytes] = ..., *, op: int, iv: Any = ..., assoclen: int = ..., flags: int = ... + ) -> int: ... + else: + def sendmsg_afalg( + self, msg: Iterable[bytes] = ..., *, op: int, iv: Any = ..., assoclen: int = ..., flags: int = ... + ) -> NoReturn: ... + def sendmsg( + self, __buffers: Iterable[bytes], __ancdata: Iterable[_CMSG] = ..., __flags: int = ..., __address: _Address = ... + ) -> int: ... + @overload + def sendto(self, data: bytes, address: _Address) -> int: ... + @overload + def sendto(self, data: bytes, flags: int, address: _Address) -> int: ... + def send(self, data: bytes, flags: int = ...) -> int: ... + def sendall(self, data: bytes, flags: int = ...) -> None: ... + def set_inheritable(self, inheritable: bool) -> None: ... + if sys.platform == "win32": + def share(self, process_id: int) -> bytes: ... + else: + def share(self, process_id: int) -> NoReturn: ... + def recv_into(self, buffer: _WriteBuffer, nbytes: int = ..., flags: int = ...) -> int: ... + def recvfrom_into(self, buffer: _WriteBuffer, nbytes: int = ..., flags: int = ...) -> Tuple[int, _RetAddress]: ... + def recvmsg_into( + self, __buffers: Iterable[_WriteBuffer], __ancbufsize: int = ..., __flags: int = ... + ) -> Tuple[int, List[_CMSG], int, Any]: ... + def recvmsg(self, __bufsize: int, __ancbufsize: int = ..., __flags: int = ...) -> Tuple[bytes, List[_CMSG], int, Any]: ... + def recvfrom(self, bufsize: int, flags: int = ...) -> Tuple[bytes, _RetAddress]: ... + def recv(self, bufsize: int, flags: int = ...) -> bytes: ... + def settimeout(self, value: Optional[float]) -> None: ... + def gettimeout(self) -> Optional[float]: ... + def setblocking(self, flag: bool) -> None: ... + def __enter__(self) -> socket.socket: ... + def __exit__( + self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType] + ) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/unix_events.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/unix_events.pyi new file mode 100644 index 00000000..7d3c1b20 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/unix_events.pyi @@ -0,0 +1,57 @@ +import sys +import types +from typing import Any, Callable, Optional, Type, TypeVar + +from .events import AbstractEventLoop, BaseDefaultEventLoopPolicy +from .selector_events import BaseSelectorEventLoop + +_T1 = TypeVar("_T1", bound=AbstractChildWatcher) +_T2 = TypeVar("_T2", bound=SafeChildWatcher) +_T3 = TypeVar("_T3", bound=FastChildWatcher) + +class AbstractChildWatcher: + def add_child_handler(self, pid: int, callback: Callable[..., Any], *args: Any) -> None: ... + def remove_child_handler(self, pid: int) -> bool: ... + def attach_loop(self, loop: Optional[AbstractEventLoop]) -> None: ... + def close(self) -> None: ... + def __enter__(self: _T1) -> _T1: ... + def __exit__( + self, typ: Optional[Type[BaseException]], exc: Optional[BaseException], tb: Optional[types.TracebackType] + ) -> None: ... + if sys.version_info >= (3, 8): + def is_active(self) -> bool: ... + +class BaseChildWatcher(AbstractChildWatcher): + def __init__(self) -> None: ... + +class SafeChildWatcher(BaseChildWatcher): + def __enter__(self: _T2) -> _T2: ... + +class FastChildWatcher(BaseChildWatcher): + def __enter__(self: _T3) -> _T3: ... + +class _UnixSelectorEventLoop(BaseSelectorEventLoop): ... + +class _UnixDefaultEventLoopPolicy(BaseDefaultEventLoopPolicy): + def get_child_watcher(self) -> AbstractChildWatcher: ... + def set_child_watcher(self, watcher: Optional[AbstractChildWatcher]) -> None: ... + +SelectorEventLoop = _UnixSelectorEventLoop + +DefaultEventLoopPolicy = _UnixDefaultEventLoopPolicy + +if sys.version_info >= (3, 8): + + from typing import Protocol + + _T4 = TypeVar("_T4", bound=MultiLoopChildWatcher) + _T5 = TypeVar("_T5", bound=ThreadedChildWatcher) + class _Warn(Protocol): + def __call__( + self, message: str, category: Optional[Type[Warning]] = ..., stacklevel: int = ..., source: Optional[Any] = ... + ) -> None: ... + class MultiLoopChildWatcher(AbstractChildWatcher): + def __enter__(self: _T4) -> _T4: ... + class ThreadedChildWatcher(AbstractChildWatcher): + def __enter__(self: _T5) -> _T5: ... + def __del__(self, _warn: _Warn = ...) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/windows_events.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/windows_events.pyi old mode 100755 new mode 100644 index 1933f52d..8b12a9f3 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/windows_events.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/windows_events.pyi @@ -1,7 +1,17 @@ - -from typing import Callable, Tuple, List, IO, Any, Optional import socket -from . import proactor_events, events, futures, windows_utils, selector_events, streams +import sys +from typing import IO, Any, Callable, ClassVar, List, NoReturn, Optional, Tuple, Type + +from . import events, futures, proactor_events, selector_events, streams, windows_utils + +__all__ = [ + "SelectorEventLoop", + "ProactorEventLoop", + "IocpProactor", + "DefaultEventLoopPolicy", + "WindowsSelectorEventLoopPolicy", + "WindowsProactorEventLoopPolicy", +] NULL: int INFINITE: int @@ -11,7 +21,6 @@ CONNECT_PIPE_INIT_DELAY: float CONNECT_PIPE_MAX_DELAY: float class PipeServer: - def __init__(self, address: str) -> None: ... def __del__(self) -> None: ... def closed(self) -> bool: ... @@ -20,39 +29,48 @@ class PipeServer: class _WindowsSelectorEventLoop(selector_events.BaseSelectorEventLoop): ... class ProactorEventLoop(proactor_events.BaseProactorEventLoop): - def __init__(self, proactor: Optional[IocpProactor] = ...) -> None: ... - async def create_pipe_connection(self, protocol_factory: Callable[[], streams.StreamReaderProtocol], address: str) -> Tuple[proactor_events._ProactorDuplexPipeTransport, streams.StreamReaderProtocol]: ... - async def start_serving_pipe(self, protocol_factory: Callable[[], streams.StreamReaderProtocol], address: str) -> List[PipeServer]: ... + async def create_pipe_connection( + self, protocol_factory: Callable[[], streams.StreamReaderProtocol], address: str + ) -> Tuple[proactor_events._ProactorDuplexPipeTransport, streams.StreamReaderProtocol]: ... + async def start_serving_pipe( + self, protocol_factory: Callable[[], streams.StreamReaderProtocol], address: str + ) -> List[PipeServer]: ... class IocpProactor: - def __init__(self, concurrency: int = ...) -> None: ... def __repr__(self) -> str: ... def __del__(self) -> None: ... def set_loop(self, loop: events.AbstractEventLoop) -> None: ... def select(self, timeout: Optional[int] = ...) -> List[futures.Future[Any]]: ... def recv(self, conn: socket.socket, nbytes: int, flags: int = ...) -> futures.Future[bytes]: ... - def recv_into(self, conn: socket.socket, buf: socket._WriteBuffer, flags: int = ...) -> futures.Future[Any]: ... + if sys.version_info >= (3, 7): + def recv_into(self, conn: socket.socket, buf: socket._WriteBuffer, flags: int = ...) -> futures.Future[Any]: ... def send(self, conn: socket.socket, buf: socket._WriteBuffer, flags: int = ...) -> futures.Future[Any]: ... def accept(self, listener: socket.socket) -> futures.Future[Any]: ... def connect(self, conn: socket.socket, address: bytes) -> futures.Future[Any]: ... - def sendfile(self, sock: socket.socket, file: IO[bytes], offset: int, count: int) -> futures.Future[Any]: ... + if sys.version_info >= (3, 7): + def sendfile(self, sock: socket.socket, file: IO[bytes], offset: int, count: int) -> futures.Future[Any]: ... def accept_pipe(self, pipe: socket.socket) -> futures.Future[Any]: ... async def connect_pipe(self, address: bytes) -> windows_utils.PipeHandle: ... - def wait_for_handle(self, handle: windows_utils.PipeHandle, timeout: int = ...) -> bool: ... + def wait_for_handle(self, handle: windows_utils.PipeHandle, timeout: Optional[int] = ...) -> bool: ... def close(self) -> None: ... SelectorEventLoop = _WindowsSelectorEventLoop -class WindowsSelectorEventLoopPolicy(events.BaseDefaultEventLoopPolicy): - _loop_factory: events.AbstractEventLoop = ... - def get_child_watcher(self) -> Any: ... - def set_child_watcher(self, watcher: Any) -> None: ... - -class WindowsProactorEventLoopPolicy(events.BaseDefaultEventLoopPolicy): - _loop_factory: events.AbstractEventLoop = ... - def get_child_watcher(self) -> Any: ... - def set_child_watcher(self, watcher: Any) -> None: ... - -DefaultEventLoopPolicy = WindowsSelectorEventLoopPolicy +if sys.version_info >= (3, 7): + class WindowsSelectorEventLoopPolicy(events.BaseDefaultEventLoopPolicy): + _loop_factory: ClassVar[Type[SelectorEventLoop]] + def get_child_watcher(self) -> NoReturn: ... + def set_child_watcher(self, watcher: Any) -> NoReturn: ... + class WindowsProactorEventLoopPolicy(events.BaseDefaultEventLoopPolicy): + _loop_factory: ClassVar[Type[ProactorEventLoop]] + def get_child_watcher(self) -> NoReturn: ... + def set_child_watcher(self, watcher: Any) -> NoReturn: ... + DefaultEventLoopPolicy = WindowsSelectorEventLoopPolicy +else: + class _WindowsDefaultEventLoopPolicy(events.BaseDefaultEventLoopPolicy): + _loop_factory: ClassVar[Type[SelectorEventLoop]] + def get_child_watcher(self) -> NoReturn: ... + def set_child_watcher(self, watcher: Any) -> NoReturn: ... + DefaultEventLoopPolicy = _WindowsDefaultEventLoopPolicy diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/windows_utils.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/windows_utils.pyi old mode 100755 new mode 100644 index f29703f0..e6009d58 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/windows_utils.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/asyncio/windows_utils.pyi @@ -1,6 +1,9 @@ - -from typing import Tuple, Callable, Optional +import sys from types import TracebackType +from typing import Callable, Optional, Protocol, Tuple, Type + +class _WarnFunction(Protocol): + def __call__(self, message: str, category: Type[Warning] = ..., stacklevel: int = ..., source: PipeHandle = ...) -> None: ... BUFSIZE: int PIPE: int @@ -9,10 +12,12 @@ STDOUT: int def pipe(*, duplex: bool = ..., overlapped: Tuple[bool, bool] = ..., bufsize: int = ...) -> Tuple[int, int]: ... class PipeHandle: - def __init__(self, handle: int) -> None: ... def __repr__(self) -> str: ... - def __del__(self) -> None: ... + if sys.version_info >= (3, 8): + def __del__(self, _warn: _WarnFunction = ...) -> None: ... + else: + def __del__(self) -> None: ... def __enter__(self) -> PipeHandle: ... def __exit__(self, t: Optional[type], v: Optional[BaseException], tb: Optional[TracebackType]) -> None: ... @property diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/atexit.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/atexit.pyi old mode 100755 new mode 100644 index 24f93899..f068a3de --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/atexit.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/atexit.pyi @@ -1,5 +1,3 @@ -"""Stub file for the 'atexit' module.""" - from typing import Any, Callable def _clear() -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/builtins.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/builtins.pyi new file mode 100644 index 00000000..fdaab429 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/builtins.pyi @@ -0,0 +1,1387 @@ +import sys +from _typeshed import ( + AnyPath, + OpenBinaryMode, + OpenBinaryModeReading, + OpenBinaryModeUpdating, + OpenBinaryModeWriting, + OpenTextMode, + ReadableBuffer, + SupportsKeysAndGetItem, + SupportsLessThan, + SupportsLessThanT, + SupportsWrite, +) +from ast import AST, mod +from io import BufferedRandom, BufferedReader, BufferedWriter, FileIO, TextIOWrapper +from types import CodeType, TracebackType +from typing import ( + IO, + AbstractSet, + Any, + BinaryIO, + ByteString, + Callable, + Container, + Dict, + FrozenSet, + Generic, + ItemsView, + Iterable, + Iterator, + KeysView, + List, + Mapping, + MutableMapping, + MutableSequence, + MutableSet, + NoReturn, + Optional, + Protocol, + Reversible, + Sequence, + Set, + Sized, + SupportsAbs, + SupportsBytes, + SupportsComplex, + SupportsFloat, + SupportsInt, + SupportsRound, + Tuple, + Type, + TypeVar, + Union, + ValuesView, + overload, + runtime_checkable, +) +from typing_extensions import Literal + +if sys.version_info >= (3, 9): + from types import GenericAlias + +class _SupportsIndex(Protocol): + def __index__(self) -> int: ... + +class _SupportsTrunc(Protocol): + def __trunc__(self) -> int: ... + +_T = TypeVar("_T") +_T_co = TypeVar("_T_co", covariant=True) +_KT = TypeVar("_KT") +_VT = TypeVar("_VT") +_S = TypeVar("_S") +_T1 = TypeVar("_T1") +_T2 = TypeVar("_T2") +_T3 = TypeVar("_T3") +_T4 = TypeVar("_T4") +_T5 = TypeVar("_T5") +_TT = TypeVar("_TT", bound="type") +_TBE = TypeVar("_TBE", bound="BaseException") + +class object: + __doc__: Optional[str] + __dict__: Dict[str, Any] + __slots__: Union[str, Iterable[str]] + __module__: str + __annotations__: Dict[str, Any] + @property + def __class__(self: _T) -> Type[_T]: ... + @__class__.setter + def __class__(self, __type: Type[object]) -> None: ... # noqa: F811 + def __init__(self) -> None: ... + def __new__(cls) -> Any: ... + def __setattr__(self, name: str, value: Any) -> None: ... + def __eq__(self, o: object) -> bool: ... + def __ne__(self, o: object) -> bool: ... + def __str__(self) -> str: ... + def __repr__(self) -> str: ... + def __hash__(self) -> int: ... + def __format__(self, format_spec: str) -> str: ... + def __getattribute__(self, name: str) -> Any: ... + def __delattr__(self, name: str) -> None: ... + def __sizeof__(self) -> int: ... + def __reduce__(self) -> Union[str, Tuple[Any, ...]]: ... + def __reduce_ex__(self, protocol: int) -> Union[str, Tuple[Any, ...]]: ... + def __dir__(self) -> Iterable[str]: ... + def __init_subclass__(cls) -> None: ... + +class staticmethod(object): # Special, only valid as a decorator. + __func__: Callable[..., Any] + __isabstractmethod__: bool + def __init__(self, f: Callable[..., Any]) -> None: ... + def __new__(cls: Type[_T], *args: Any, **kwargs: Any) -> _T: ... + def __get__(self, obj: _T, type: Optional[Type[_T]] = ...) -> Callable[..., Any]: ... + +class classmethod(object): # Special, only valid as a decorator. + __func__: Callable[..., Any] + __isabstractmethod__: bool + def __init__(self, f: Callable[..., Any]) -> None: ... + def __new__(cls: Type[_T], *args: Any, **kwargs: Any) -> _T: ... + def __get__(self, obj: _T, type: Optional[Type[_T]] = ...) -> Callable[..., Any]: ... + +class type(object): + __base__: type + __bases__: Tuple[type, ...] + __basicsize__: int + __dict__: Dict[str, Any] + __dictoffset__: int + __flags__: int + __itemsize__: int + __module__: str + __mro__: Tuple[type, ...] + __name__: str + __qualname__: str + __text_signature__: Optional[str] + __weakrefoffset__: int + @overload + def __init__(self, o: object) -> None: ... + @overload + def __init__(self, name: str, bases: Tuple[type, ...], dict: Dict[str, Any]) -> None: ... + @overload + def __new__(cls, o: object) -> type: ... + @overload + def __new__(cls, name: str, bases: Tuple[type, ...], namespace: Dict[str, Any]) -> type: ... + def __call__(self, *args: Any, **kwds: Any) -> Any: ... + def __subclasses__(self: _TT) -> List[_TT]: ... + # Note: the documentation doesnt specify what the return type is, the standard + # implementation seems to be returning a list. + def mro(self) -> List[type]: ... + def __instancecheck__(self, instance: Any) -> bool: ... + def __subclasscheck__(self, subclass: type) -> bool: ... + @classmethod + def __prepare__(metacls, __name: str, __bases: Tuple[type, ...], **kwds: Any) -> Mapping[str, Any]: ... + +class super(object): + @overload + def __init__(self, t: Any, obj: Any) -> None: ... + @overload + def __init__(self, t: Any) -> None: ... + @overload + def __init__(self) -> None: ... + +class int: + @overload + def __new__(cls: Type[_T], x: Union[str, bytes, SupportsInt, _SupportsIndex, _SupportsTrunc] = ...) -> _T: ... + @overload + def __new__(cls: Type[_T], x: Union[str, bytes, bytearray], base: int) -> _T: ... + @overload + def __init__(self, x: Union[str, bytes, SupportsInt, _SupportsIndex, _SupportsTrunc] = ...) -> _T: ... + @overload + def __init__(self, x: Union[str, bytes, bytearray], base: int) -> _T: ... + if sys.version_info >= (3, 8): + def as_integer_ratio(self) -> Tuple[int, Literal[1]]: ... + @property + def real(self) -> int: ... + @property + def imag(self) -> int: ... + @property + def numerator(self) -> int: ... + @property + def denominator(self) -> int: ... + def conjugate(self) -> int: ... + def bit_length(self) -> int: ... + def to_bytes(self, length: int, byteorder: str, *, signed: bool = ...) -> bytes: ... + @classmethod + def from_bytes( + cls, bytes: Union[Iterable[int], SupportsBytes], byteorder: str, *, signed: bool = ... + ) -> int: ... # TODO buffer object argument + def __add__(self, x: int) -> int: ... + def __sub__(self, x: int) -> int: ... + def __mul__(self, x: int) -> int: ... + def __floordiv__(self, x: int) -> int: ... + def __truediv__(self, x: int) -> float: ... + def __mod__(self, x: int) -> int: ... + def __divmod__(self, x: int) -> Tuple[int, int]: ... + def __radd__(self, x: int) -> int: ... + def __rsub__(self, x: int) -> int: ... + def __rmul__(self, x: int) -> int: ... + def __rfloordiv__(self, x: int) -> int: ... + def __rtruediv__(self, x: int) -> float: ... + def __rmod__(self, x: int) -> int: ... + def __rdivmod__(self, x: int) -> Tuple[int, int]: ... + @overload + def __pow__(self, __x: Literal[2], __modulo: Optional[int] = ...) -> int: ... + @overload + def __pow__(self, __x: int, __modulo: Optional[int] = ...) -> Any: ... # Return type can be int or float, depending on x. + def __rpow__(self, x: int, mod: Optional[int] = ...) -> Any: ... + def __and__(self, n: int) -> int: ... + def __or__(self, n: int) -> int: ... + def __xor__(self, n: int) -> int: ... + def __lshift__(self, n: int) -> int: ... + def __rshift__(self, n: int) -> int: ... + def __rand__(self, n: int) -> int: ... + def __ror__(self, n: int) -> int: ... + def __rxor__(self, n: int) -> int: ... + def __rlshift__(self, n: int) -> int: ... + def __rrshift__(self, n: int) -> int: ... + def __neg__(self) -> int: ... + def __pos__(self) -> int: ... + def __invert__(self) -> int: ... + def __trunc__(self) -> int: ... + def __ceil__(self) -> int: ... + def __floor__(self) -> int: ... + def __round__(self, ndigits: Optional[int] = ...) -> int: ... + def __getnewargs__(self) -> Tuple[int]: ... + def __eq__(self, x: object) -> bool: ... + def __ne__(self, x: object) -> bool: ... + def __lt__(self, x: int) -> bool: ... + def __le__(self, x: int) -> bool: ... + def __gt__(self, x: int) -> bool: ... + def __ge__(self, x: int) -> bool: ... + def __str__(self) -> str: ... + def __float__(self) -> float: ... + def __int__(self) -> int: ... + def __abs__(self) -> int: ... + def __hash__(self) -> int: ... + def __bool__(self) -> bool: ... + def __index__(self) -> int: ... + +class float: + def __new__(cls: Type[_T], x: Union[SupportsFloat, _SupportsIndex, str, bytes, bytearray] = ...) -> _T: ... + def as_integer_ratio(self) -> Tuple[int, int]: ... + def hex(self) -> str: ... + def is_integer(self) -> bool: ... + @classmethod + def fromhex(cls, __s: str) -> float: ... + @property + def real(self) -> float: ... + @property + def imag(self) -> float: ... + def conjugate(self) -> float: ... + def __add__(self, x: float) -> float: ... + def __sub__(self, x: float) -> float: ... + def __mul__(self, x: float) -> float: ... + def __floordiv__(self, x: float) -> float: ... + def __truediv__(self, x: float) -> float: ... + def __mod__(self, x: float) -> float: ... + def __divmod__(self, x: float) -> Tuple[float, float]: ... + def __pow__( + self, x: float, mod: None = ... + ) -> float: ... # In Python 3, returns complex if self is negative and x is not whole + def __radd__(self, x: float) -> float: ... + def __rsub__(self, x: float) -> float: ... + def __rmul__(self, x: float) -> float: ... + def __rfloordiv__(self, x: float) -> float: ... + def __rtruediv__(self, x: float) -> float: ... + def __rmod__(self, x: float) -> float: ... + def __rdivmod__(self, x: float) -> Tuple[float, float]: ... + def __rpow__(self, x: float, mod: None = ...) -> float: ... + def __getnewargs__(self) -> Tuple[float]: ... + def __trunc__(self) -> int: ... + if sys.version_info >= (3, 9): + def __ceil__(self) -> int: ... + def __floor__(self) -> int: ... + @overload + def __round__(self, ndigits: None = ...) -> int: ... + @overload + def __round__(self, ndigits: int) -> float: ... + def __eq__(self, x: object) -> bool: ... + def __ne__(self, x: object) -> bool: ... + def __lt__(self, x: float) -> bool: ... + def __le__(self, x: float) -> bool: ... + def __gt__(self, x: float) -> bool: ... + def __ge__(self, x: float) -> bool: ... + def __neg__(self) -> float: ... + def __pos__(self) -> float: ... + def __str__(self) -> str: ... + def __int__(self) -> int: ... + def __float__(self) -> float: ... + def __abs__(self) -> float: ... + def __hash__(self) -> int: ... + def __bool__(self) -> bool: ... + +class complex: + @overload + def __new__(cls: Type[_T], real: float = ..., imag: float = ...) -> _T: ... + @overload + def __new__(cls: Type[_T], real: Union[str, SupportsComplex, _SupportsIndex]) -> _T: ... + @property + def real(self) -> float: ... + @property + def imag(self) -> float: ... + def conjugate(self) -> complex: ... + def __add__(self, x: complex) -> complex: ... + def __sub__(self, x: complex) -> complex: ... + def __mul__(self, x: complex) -> complex: ... + def __pow__(self, x: complex, mod: None = ...) -> complex: ... + def __truediv__(self, x: complex) -> complex: ... + def __radd__(self, x: complex) -> complex: ... + def __rsub__(self, x: complex) -> complex: ... + def __rmul__(self, x: complex) -> complex: ... + def __rpow__(self, x: complex, mod: None = ...) -> complex: ... + def __rtruediv__(self, x: complex) -> complex: ... + def __eq__(self, x: object) -> bool: ... + def __ne__(self, x: object) -> bool: ... + def __neg__(self) -> complex: ... + def __pos__(self) -> complex: ... + def __str__(self) -> str: ... + def __complex__(self) -> complex: ... + def __abs__(self) -> float: ... + def __hash__(self) -> int: ... + def __bool__(self) -> bool: ... + +class _FormatMapMapping(Protocol): + def __getitem__(self, __key: str) -> Any: ... + +class str(Sequence[str]): + @overload + def __new__(cls: Type[_T], o: object = ...) -> _T: ... + @overload + def __new__(cls: Type[_T], o: bytes, encoding: str = ..., errors: str = ...) -> _T: ... + @overload + def __init__(self, o: object = ...) -> _T: ... + @overload + def __init__(self, o: bytes, encoding: str = ..., errors: str = ...) -> _T: ... + def capitalize(self) -> str: ... + def casefold(self) -> str: ... + def center(self, __width: int, __fillchar: str = ...) -> str: ... + def count(self, x: str, __start: Optional[int] = ..., __end: Optional[int] = ...) -> int: ... + def encode(self, encoding: str = ..., errors: str = ...) -> bytes: ... + def endswith(self, suffix: Union[str, Tuple[str, ...]], start: Optional[int] = ..., end: Optional[int] = ...) -> bool: ... + def expandtabs(self, tabsize: int = ...) -> str: ... + def find(self, sub: str, __start: Optional[int] = ..., __end: Optional[int] = ...) -> int: ... + def format(self, *args: object, **kwargs: object) -> str: ... + def format_map(self, map: _FormatMapMapping) -> str: ... + def index(self, sub: str, __start: Optional[int] = ..., __end: Optional[int] = ...) -> int: ... + def isalnum(self) -> bool: ... + def isalpha(self) -> bool: ... + if sys.version_info >= (3, 7): + def isascii(self) -> bool: ... + def isdecimal(self) -> bool: ... + def isdigit(self) -> bool: ... + def isidentifier(self) -> bool: ... + def islower(self) -> bool: ... + def isnumeric(self) -> bool: ... + def isprintable(self) -> bool: ... + def isspace(self) -> bool: ... + def istitle(self) -> bool: ... + def isupper(self) -> bool: ... + def join(self, __iterable: Iterable[str]) -> str: ... + def ljust(self, __width: int, __fillchar: str = ...) -> str: ... + def lower(self) -> str: ... + def lstrip(self, __chars: Optional[str] = ...) -> str: ... + def partition(self, __sep: str) -> Tuple[str, str, str]: ... + def replace(self, __old: str, __new: str, __count: int = ...) -> str: ... + if sys.version_info >= (3, 9): + def removeprefix(self, __prefix: str) -> str: ... + def removesuffix(self, __suffix: str) -> str: ... + def rfind(self, sub: str, __start: Optional[int] = ..., __end: Optional[int] = ...) -> int: ... + def rindex(self, sub: str, __start: Optional[int] = ..., __end: Optional[int] = ...) -> int: ... + def rjust(self, __width: int, __fillchar: str = ...) -> str: ... + def rpartition(self, __sep: str) -> Tuple[str, str, str]: ... + def rsplit(self, sep: Optional[str] = ..., maxsplit: int = ...) -> List[str]: ... + def rstrip(self, __chars: Optional[str] = ...) -> str: ... + def split(self, sep: Optional[str] = ..., maxsplit: int = ...) -> List[str]: ... + def splitlines(self, keepends: bool = ...) -> List[str]: ... + def startswith(self, prefix: Union[str, Tuple[str, ...]], start: Optional[int] = ..., end: Optional[int] = ...) -> bool: ... + def strip(self, __chars: Optional[str] = ...) -> str: ... + def swapcase(self) -> str: ... + def title(self) -> str: ... + def translate(self, __table: Union[Mapping[int, Union[int, str, None]], Sequence[Union[int, str, None]]]) -> str: ... + def upper(self) -> str: ... + def zfill(self, __width: int) -> str: ... + @staticmethod + @overload + def maketrans(__x: Union[Dict[int, _T], Dict[str, _T], Dict[Union[str, int], _T]]) -> Dict[int, _T]: ... + @staticmethod + @overload + def maketrans(__x: str, __y: str, __z: Optional[str] = ...) -> Dict[int, Union[int, None]]: ... + def __add__(self, s: str) -> str: ... + # Incompatible with Sequence.__contains__ + def __contains__(self, o: str) -> bool: ... # type: ignore + def __eq__(self, x: object) -> bool: ... + def __ge__(self, x: str) -> bool: ... + def __getitem__(self, i: Union[int, slice]) -> str: ... + def __gt__(self, x: str) -> bool: ... + def __hash__(self) -> int: ... + def __iter__(self) -> Iterator[str]: ... + def __le__(self, x: str) -> bool: ... + def __len__(self) -> int: ... + def __lt__(self, x: str) -> bool: ... + def __mod__(self, x: Any) -> str: ... + def __mul__(self, n: int) -> str: ... + def __ne__(self, x: object) -> bool: ... + def __repr__(self) -> str: ... + def __rmul__(self, n: int) -> str: ... + def __str__(self) -> str: ... + def __getnewargs__(self) -> Tuple[str]: ... + +class bytes(ByteString): + @overload + def __new__(cls: Type[_T], ints: Iterable[int]) -> _T: ... + @overload + def __new__(cls: Type[_T], string: str, encoding: str, errors: str = ...) -> _T: ... + @overload + def __new__(cls: Type[_T], length: int) -> _T: ... + @overload + def __new__(cls: Type[_T]) -> _T: ... + @overload + def __new__(cls: Type[_T], o: SupportsBytes) -> _T: ... + def capitalize(self) -> bytes: ... + def center(self, __width: int, __fillchar: bytes = ...) -> bytes: ... + def count(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... + def decode(self, encoding: str = ..., errors: str = ...) -> str: ... + def endswith(self, suffix: Union[bytes, Tuple[bytes, ...]]) -> bool: ... + def expandtabs(self, tabsize: int = ...) -> bytes: ... + def find(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... + if sys.version_info >= (3, 8): + def hex(self, sep: Union[str, bytes] = ..., bytes_per_sep: int = ...) -> str: ... + else: + def hex(self) -> str: ... + def index(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... + def isalnum(self) -> bool: ... + def isalpha(self) -> bool: ... + if sys.version_info >= (3, 7): + def isascii(self) -> bool: ... + def isdigit(self) -> bool: ... + def islower(self) -> bool: ... + def isspace(self) -> bool: ... + def istitle(self) -> bool: ... + def isupper(self) -> bool: ... + def join(self, __iterable_of_bytes: Iterable[Union[ByteString, memoryview]]) -> bytes: ... + def ljust(self, __width: int, __fillchar: bytes = ...) -> bytes: ... + def lower(self) -> bytes: ... + def lstrip(self, __bytes: Optional[bytes] = ...) -> bytes: ... + def partition(self, __sep: bytes) -> Tuple[bytes, bytes, bytes]: ... + def replace(self, __old: bytes, __new: bytes, __count: int = ...) -> bytes: ... + if sys.version_info >= (3, 9): + def removeprefix(self, __prefix: bytes) -> bytes: ... + def removesuffix(self, __suffix: bytes) -> bytes: ... + def rfind(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... + def rindex(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... + def rjust(self, __width: int, __fillchar: bytes = ...) -> bytes: ... + def rpartition(self, __sep: bytes) -> Tuple[bytes, bytes, bytes]: ... + def rsplit(self, sep: Optional[bytes] = ..., maxsplit: int = ...) -> List[bytes]: ... + def rstrip(self, __bytes: Optional[bytes] = ...) -> bytes: ... + def split(self, sep: Optional[bytes] = ..., maxsplit: int = ...) -> List[bytes]: ... + def splitlines(self, keepends: bool = ...) -> List[bytes]: ... + def startswith( + self, prefix: Union[bytes, Tuple[bytes, ...]], start: Optional[int] = ..., end: Optional[int] = ... + ) -> bool: ... + def strip(self, __bytes: Optional[bytes] = ...) -> bytes: ... + def swapcase(self) -> bytes: ... + def title(self) -> bytes: ... + def translate(self, __table: Optional[bytes], delete: bytes = ...) -> bytes: ... + def upper(self) -> bytes: ... + def zfill(self, __width: int) -> bytes: ... + @classmethod + def fromhex(cls, __s: str) -> bytes: ... + @classmethod + def maketrans(cls, frm: bytes, to: bytes) -> bytes: ... + def __len__(self) -> int: ... + def __iter__(self) -> Iterator[int]: ... + def __str__(self) -> str: ... + def __repr__(self) -> str: ... + def __int__(self) -> int: ... + def __float__(self) -> float: ... + def __hash__(self) -> int: ... + @overload + def __getitem__(self, i: int) -> int: ... + @overload + def __getitem__(self, s: slice) -> bytes: ... + def __add__(self, s: bytes) -> bytes: ... + def __mul__(self, n: int) -> bytes: ... + def __rmul__(self, n: int) -> bytes: ... + def __mod__(self, value: Any) -> bytes: ... + # Incompatible with Sequence.__contains__ + def __contains__(self, o: Union[int, bytes]) -> bool: ... # type: ignore + def __eq__(self, x: object) -> bool: ... + def __ne__(self, x: object) -> bool: ... + def __lt__(self, x: bytes) -> bool: ... + def __le__(self, x: bytes) -> bool: ... + def __gt__(self, x: bytes) -> bool: ... + def __ge__(self, x: bytes) -> bool: ... + def __getnewargs__(self) -> Tuple[bytes]: ... + +class bytearray(MutableSequence[int], ByteString): + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, ints: Iterable[int]) -> None: ... + @overload + def __init__(self, string: str, encoding: str, errors: str = ...) -> None: ... + @overload + def __init__(self, length: int) -> None: ... + def capitalize(self) -> bytearray: ... + def center(self, __width: int, __fillchar: bytes = ...) -> bytearray: ... + def count(self, __sub: Union[bytes, int], __start: Optional[int] = ..., __end: Optional[int] = ...) -> int: ... + def copy(self) -> bytearray: ... + def decode(self, encoding: str = ..., errors: str = ...) -> str: ... + def endswith(self, __suffix: Union[bytes, Tuple[bytes, ...]]) -> bool: ... + def expandtabs(self, tabsize: int = ...) -> bytearray: ... + def find(self, __sub: Union[bytes, int], __start: Optional[int] = ..., __end: Optional[int] = ...) -> int: ... + def hex(self) -> str: ... + def index(self, __sub: Union[bytes, int], __start: Optional[int] = ..., __end: Optional[int] = ...) -> int: ... + def insert(self, __index: int, __item: int) -> None: ... + def isalnum(self) -> bool: ... + def isalpha(self) -> bool: ... + if sys.version_info >= (3, 7): + def isascii(self) -> bool: ... + def isdigit(self) -> bool: ... + def islower(self) -> bool: ... + def isspace(self) -> bool: ... + def istitle(self) -> bool: ... + def isupper(self) -> bool: ... + def join(self, __iterable_of_bytes: Iterable[Union[ByteString, memoryview]]) -> bytearray: ... + def ljust(self, __width: int, __fillchar: bytes = ...) -> bytearray: ... + def lower(self) -> bytearray: ... + def lstrip(self, __bytes: Optional[bytes] = ...) -> bytearray: ... + def partition(self, __sep: bytes) -> Tuple[bytearray, bytearray, bytearray]: ... + if sys.version_info >= (3, 9): + def removeprefix(self, __prefix: bytes) -> bytearray: ... + def removesuffix(self, __suffix: bytes) -> bytearray: ... + def replace(self, __old: bytes, __new: bytes, __count: int = ...) -> bytearray: ... + def rfind(self, __sub: Union[bytes, int], __start: Optional[int] = ..., __end: Optional[int] = ...) -> int: ... + def rindex(self, __sub: Union[bytes, int], __start: Optional[int] = ..., __end: Optional[int] = ...) -> int: ... + def rjust(self, __width: int, __fillchar: bytes = ...) -> bytearray: ... + def rpartition(self, __sep: bytes) -> Tuple[bytearray, bytearray, bytearray]: ... + def rsplit(self, sep: Optional[bytes] = ..., maxsplit: int = ...) -> List[bytearray]: ... + def rstrip(self, __bytes: Optional[bytes] = ...) -> bytearray: ... + def split(self, sep: Optional[bytes] = ..., maxsplit: int = ...) -> List[bytearray]: ... + def splitlines(self, keepends: bool = ...) -> List[bytearray]: ... + def startswith( + self, __prefix: Union[bytes, Tuple[bytes, ...]], __start: Optional[int] = ..., __end: Optional[int] = ... + ) -> bool: ... + def strip(self, __bytes: Optional[bytes] = ...) -> bytearray: ... + def swapcase(self) -> bytearray: ... + def title(self) -> bytearray: ... + def translate(self, __table: Optional[bytes], delete: bytes = ...) -> bytearray: ... + def upper(self) -> bytearray: ... + def zfill(self, __width: int) -> bytearray: ... + @classmethod + def fromhex(cls, __string: str) -> bytearray: ... + @classmethod + def maketrans(cls, __frm: bytes, __to: bytes) -> bytes: ... + def __len__(self) -> int: ... + def __iter__(self) -> Iterator[int]: ... + def __str__(self) -> str: ... + def __repr__(self) -> str: ... + def __int__(self) -> int: ... + def __float__(self) -> float: ... + __hash__: None # type: ignore + @overload + def __getitem__(self, i: int) -> int: ... + @overload + def __getitem__(self, s: slice) -> bytearray: ... + @overload + def __setitem__(self, i: int, x: int) -> None: ... + @overload + def __setitem__(self, s: slice, x: Union[Iterable[int], bytes]) -> None: ... + def __delitem__(self, i: Union[int, slice]) -> None: ... + def __add__(self, s: bytes) -> bytearray: ... + def __iadd__(self, s: Iterable[int]) -> bytearray: ... + def __mul__(self, n: int) -> bytearray: ... + def __rmul__(self, n: int) -> bytearray: ... + def __imul__(self, n: int) -> bytearray: ... + def __mod__(self, value: Any) -> bytes: ... + # Incompatible with Sequence.__contains__ + def __contains__(self, o: Union[int, bytes]) -> bool: ... # type: ignore + def __eq__(self, x: object) -> bool: ... + def __ne__(self, x: object) -> bool: ... + def __lt__(self, x: bytes) -> bool: ... + def __le__(self, x: bytes) -> bool: ... + def __gt__(self, x: bytes) -> bool: ... + def __ge__(self, x: bytes) -> bool: ... + +class memoryview(Sized, Container[int]): + format: str + itemsize: int + shape: Optional[Tuple[int, ...]] + strides: Optional[Tuple[int, ...]] + suboffsets: Optional[Tuple[int, ...]] + readonly: bool + ndim: int + + obj: Union[bytes, bytearray] + c_contiguous: bool + f_contiguous: bool + contiguous: bool + nbytes: int + def __init__(self, obj: ReadableBuffer) -> None: ... + def __enter__(self) -> memoryview: ... + def __exit__( + self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType] + ) -> None: ... + def cast(self, format: str, shape: Union[List[int], Tuple[int]] = ...) -> memoryview: ... + @overload + def __getitem__(self, i: int) -> int: ... + @overload + def __getitem__(self, s: slice) -> memoryview: ... + def __contains__(self, x: object) -> bool: ... + def __iter__(self) -> Iterator[int]: ... + def __len__(self) -> int: ... + @overload + def __setitem__(self, s: slice, o: memoryview) -> None: ... + @overload + def __setitem__(self, i: int, o: bytes) -> None: ... + @overload + def __setitem__(self, s: slice, o: Sequence[bytes]) -> None: ... + if sys.version_info >= (3, 8): + def tobytes(self, order: Optional[Literal["C", "F", "A"]] = ...) -> bytes: ... + else: + def tobytes(self) -> bytes: ... + def tolist(self) -> List[int]: ... + if sys.version_info >= (3, 8): + def toreadonly(self) -> memoryview: ... + def release(self) -> None: ... + def hex(self) -> str: ... + +class bool(int): + def __new__(cls: Type[_T], __o: object = ...) -> _T: ... + def __init__(self, o: object = ...): ... + @overload + def __and__(self, x: bool) -> bool: ... + @overload + def __and__(self, x: int) -> int: ... + @overload + def __or__(self, x: bool) -> bool: ... + @overload + def __or__(self, x: int) -> int: ... + @overload + def __xor__(self, x: bool) -> bool: ... + @overload + def __xor__(self, x: int) -> int: ... + @overload + def __rand__(self, x: bool) -> bool: ... + @overload + def __rand__(self, x: int) -> int: ... + @overload + def __ror__(self, x: bool) -> bool: ... + @overload + def __ror__(self, x: int) -> int: ... + @overload + def __rxor__(self, x: bool) -> bool: ... + @overload + def __rxor__(self, x: int) -> int: ... + def __getnewargs__(self) -> Tuple[int]: ... + +class slice(object): + start: Any + step: Any + stop: Any + @overload + def __init__(self, stop: Any) -> None: ... + @overload + def __init__(self, start: Any, stop: Any, step: Any = ...) -> None: ... + __hash__: None # type: ignore + def indices(self, len: int) -> Tuple[int, int, int]: ... + +class tuple(Sequence[_T_co], Generic[_T_co]): + def __new__(cls: Type[_T], iterable: Iterable[_T_co] = ...) -> _T: ... + def __init__(self, iterable: Iterable[_T_co] = ...): ... + def __len__(self) -> int: ... + def __contains__(self, x: object) -> bool: ... + @overload + def __getitem__(self, x: int) -> _T_co: ... + @overload + def __getitem__(self, x: slice) -> Tuple[_T_co, ...]: ... + def __iter__(self) -> Iterator[_T_co]: ... + def __lt__(self, x: Tuple[_T_co, ...]) -> bool: ... + def __le__(self, x: Tuple[_T_co, ...]) -> bool: ... + def __gt__(self, x: Tuple[_T_co, ...]) -> bool: ... + def __ge__(self, x: Tuple[_T_co, ...]) -> bool: ... + @overload + def __add__(self, x: Tuple[_T_co, ...]) -> Tuple[_T_co, ...]: ... + @overload + def __add__(self, x: Tuple[Any, ...]) -> Tuple[Any, ...]: ... + def __mul__(self, n: int) -> Tuple[_T_co, ...]: ... + def __rmul__(self, n: int) -> Tuple[_T_co, ...]: ... + def count(self, __value: Any) -> int: ... + def index(self, __value: Any, __start: int = ..., __stop: int = ...) -> int: ... + if sys.version_info >= (3, 9): + def __class_getitem__(cls, item: Any) -> GenericAlias: ... + +class list(MutableSequence[_T], Generic[_T]): + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, iterable: Iterable[_T]) -> None: ... + def clear(self) -> None: ... + def copy(self) -> List[_T]: ... + def append(self, __object: _T) -> None: ... + def extend(self, __iterable: Iterable[_T]) -> None: ... + def pop(self, __index: int = ...) -> _T: ... + def index(self, __value: _T, __start: int = ..., __stop: int = ...) -> int: ... + def count(self, __value: _T) -> int: ... + def insert(self, __index: int, __object: _T) -> None: ... + def remove(self, __value: _T) -> None: ... + def reverse(self) -> None: ... + @overload + def sort(self: List[SupportsLessThanT], *, key: None = ..., reverse: bool = ...) -> None: ... + @overload + def sort(self, *, key: Callable[[_T], SupportsLessThan], reverse: bool = ...) -> None: ... + def __len__(self) -> int: ... + def __iter__(self) -> Iterator[_T]: ... + def __str__(self) -> str: ... + __hash__: None # type: ignore + @overload + def __getitem__(self, i: int) -> _T: ... + @overload + def __getitem__(self, s: slice) -> List[_T]: ... + @overload + def __setitem__(self, i: int, o: _T) -> None: ... + @overload + def __setitem__(self, s: slice, o: Iterable[_T]) -> None: ... + def __delitem__(self, i: Union[int, slice]) -> None: ... + def __add__(self, x: List[_T]) -> List[_T]: ... + def __iadd__(self: _S, x: Iterable[_T]) -> _S: ... + def __mul__(self, n: int) -> List[_T]: ... + def __rmul__(self, n: int) -> List[_T]: ... + def __imul__(self: _S, n: int) -> _S: ... + def __contains__(self, o: object) -> bool: ... + def __reversed__(self) -> Iterator[_T]: ... + def __gt__(self, x: List[_T]) -> bool: ... + def __ge__(self, x: List[_T]) -> bool: ... + def __lt__(self, x: List[_T]) -> bool: ... + def __le__(self, x: List[_T]) -> bool: ... + if sys.version_info >= (3, 9): + def __class_getitem__(cls, item: Any) -> GenericAlias: ... + +class dict(MutableMapping[_KT, _VT], Generic[_KT, _VT]): + # NOTE: Keyword arguments are special. If they are used, _KT must include + # str, but we have no way of enforcing it here. + @overload + def __init__(self, **kwargs: _VT) -> None: ... + @overload + def __init__(self, map: Mapping[_KT, _VT], **kwargs: _VT) -> None: ... + @overload + def __init__(self, iterable: Iterable[Tuple[_KT, _VT]], **kwargs: _VT) -> None: ... + def __new__(cls: Type[_T1], *args: Any, **kwargs: Any) -> _T1: ... + def clear(self) -> None: ... + def copy(self) -> Dict[_KT, _VT]: ... + def popitem(self) -> Tuple[_KT, _VT]: ... + def setdefault(self, __key: _KT, __default: _VT = ...) -> _VT: ... + @overload + def update(self, __m: Mapping[_KT, _VT], **kwargs: _VT) -> None: ... + @overload + def update(self, __m: Iterable[Tuple[_KT, _VT]], **kwargs: _VT) -> None: ... + @overload + def update(self, **kwargs: _VT) -> None: ... + def keys(self) -> KeysView[_KT]: ... + def values(self) -> ValuesView[_VT]: ... + def items(self) -> ItemsView[_KT, _VT]: ... + @classmethod + @overload + def fromkeys(cls, __iterable: Iterable[_T]) -> Dict[_T, Any]: ... + @classmethod + @overload + def fromkeys(cls, __iterable: Iterable[_T], __value: _S) -> Dict[_T, _S]: ... + def __len__(self) -> int: ... + def __getitem__(self, k: _KT) -> _VT: ... + def __setitem__(self, k: _KT, v: _VT) -> None: ... + def __delitem__(self, v: _KT) -> None: ... + def __iter__(self) -> Iterator[_KT]: ... + if sys.version_info >= (3, 8): + def __reversed__(self) -> Iterator[_KT]: ... + def __str__(self) -> str: ... + __hash__: None # type: ignore + if sys.version_info >= (3, 9): + def __class_getitem__(cls, item: Any) -> GenericAlias: ... + def __or__(self, __value: Mapping[_KT, _VT]) -> Dict[_KT, _VT]: ... + def __ior__(self, __value: Mapping[_KT, _VT]) -> Dict[_KT, _VT]: ... + +class set(MutableSet[_T], Generic[_T]): + def __init__(self, iterable: Iterable[_T] = ...) -> None: ... + def add(self, element: _T) -> None: ... + def clear(self) -> None: ... + def copy(self) -> Set[_T]: ... + def difference(self, *s: Iterable[Any]) -> Set[_T]: ... + def difference_update(self, *s: Iterable[Any]) -> None: ... + def discard(self, element: _T) -> None: ... + def intersection(self, *s: Iterable[Any]) -> Set[_T]: ... + def intersection_update(self, *s: Iterable[Any]) -> None: ... + def isdisjoint(self, s: Iterable[Any]) -> bool: ... + def issubset(self, s: Iterable[Any]) -> bool: ... + def issuperset(self, s: Iterable[Any]) -> bool: ... + def pop(self) -> _T: ... + def remove(self, element: _T) -> None: ... + def symmetric_difference(self, s: Iterable[_T]) -> Set[_T]: ... + def symmetric_difference_update(self, s: Iterable[_T]) -> None: ... + def union(self, *s: Iterable[_T]) -> Set[_T]: ... + def update(self, *s: Iterable[_T]) -> None: ... + def __len__(self) -> int: ... + def __contains__(self, o: object) -> bool: ... + def __iter__(self) -> Iterator[_T]: ... + def __str__(self) -> str: ... + def __and__(self, s: AbstractSet[object]) -> Set[_T]: ... + def __iand__(self, s: AbstractSet[object]) -> Set[_T]: ... + def __or__(self, s: AbstractSet[_S]) -> Set[Union[_T, _S]]: ... + def __ior__(self, s: AbstractSet[_S]) -> Set[Union[_T, _S]]: ... + def __sub__(self, s: AbstractSet[Optional[_T]]) -> Set[_T]: ... + def __isub__(self, s: AbstractSet[Optional[_T]]) -> Set[_T]: ... + def __xor__(self, s: AbstractSet[_S]) -> Set[Union[_T, _S]]: ... + def __ixor__(self, s: AbstractSet[_S]) -> Set[Union[_T, _S]]: ... + def __le__(self, s: AbstractSet[object]) -> bool: ... + def __lt__(self, s: AbstractSet[object]) -> bool: ... + def __ge__(self, s: AbstractSet[object]) -> bool: ... + def __gt__(self, s: AbstractSet[object]) -> bool: ... + __hash__: None # type: ignore + if sys.version_info >= (3, 9): + def __class_getitem__(cls, item: Any) -> GenericAlias: ... + +class frozenset(AbstractSet[_T_co], Generic[_T_co]): + def __init__(self, iterable: Iterable[_T_co] = ...) -> None: ... + def copy(self) -> FrozenSet[_T_co]: ... + def difference(self, *s: Iterable[object]) -> FrozenSet[_T_co]: ... + def intersection(self, *s: Iterable[object]) -> FrozenSet[_T_co]: ... + def isdisjoint(self, s: Iterable[_T_co]) -> bool: ... + def issubset(self, s: Iterable[object]) -> bool: ... + def issuperset(self, s: Iterable[object]) -> bool: ... + def symmetric_difference(self, s: Iterable[_T_co]) -> FrozenSet[_T_co]: ... + def union(self, *s: Iterable[_T_co]) -> FrozenSet[_T_co]: ... + def __len__(self) -> int: ... + def __contains__(self, o: object) -> bool: ... + def __iter__(self) -> Iterator[_T_co]: ... + def __str__(self) -> str: ... + def __and__(self, s: AbstractSet[_T_co]) -> FrozenSet[_T_co]: ... + def __or__(self, s: AbstractSet[_S]) -> FrozenSet[Union[_T_co, _S]]: ... + def __sub__(self, s: AbstractSet[_T_co]) -> FrozenSet[_T_co]: ... + def __xor__(self, s: AbstractSet[_S]) -> FrozenSet[Union[_T_co, _S]]: ... + def __le__(self, s: AbstractSet[object]) -> bool: ... + def __lt__(self, s: AbstractSet[object]) -> bool: ... + def __ge__(self, s: AbstractSet[object]) -> bool: ... + def __gt__(self, s: AbstractSet[object]) -> bool: ... + if sys.version_info >= (3, 9): + def __class_getitem__(cls, item: Any) -> GenericAlias: ... + +class enumerate(Iterator[Tuple[int, _T]], Generic[_T]): + def __init__(self, iterable: Iterable[_T], start: int = ...) -> None: ... + def __iter__(self) -> Iterator[Tuple[int, _T]]: ... + def __next__(self) -> Tuple[int, _T]: ... + if sys.version_info >= (3, 9): + def __class_getitem__(cls, item: Any) -> GenericAlias: ... + +class range(Sequence[int]): + start: int + stop: int + step: int + @overload + def __init__(self, stop: int) -> None: ... + @overload + def __init__(self, start: int, stop: int, step: int = ...) -> None: ... + def count(self, value: int) -> int: ... + def index(self, value: int) -> int: ... # type: ignore + def __len__(self) -> int: ... + def __contains__(self, o: object) -> bool: ... + def __iter__(self) -> Iterator[int]: ... + @overload + def __getitem__(self, i: int) -> int: ... + @overload + def __getitem__(self, s: slice) -> range: ... + def __repr__(self) -> str: ... + def __reversed__(self) -> Iterator[int]: ... + +class property(object): + def __init__( + self, + fget: Optional[Callable[[Any], Any]] = ..., + fset: Optional[Callable[[Any, Any], None]] = ..., + fdel: Optional[Callable[[Any], None]] = ..., + doc: Optional[str] = ..., + ) -> None: ... + def getter(self, fget: Callable[[Any], Any]) -> property: ... + def setter(self, fset: Callable[[Any, Any], None]) -> property: ... + def deleter(self, fdel: Callable[[Any], None]) -> property: ... + def __get__(self, obj: Any, type: Optional[type] = ...) -> Any: ... + def __set__(self, obj: Any, value: Any) -> None: ... + def __delete__(self, obj: Any) -> None: ... + def fget(self) -> Any: ... + def fset(self, value: Any) -> None: ... + def fdel(self) -> None: ... + +class _NotImplementedType(Any): # type: ignore + # A little weird, but typing the __call__ as NotImplemented makes the error message + # for NotImplemented() much better + pass + +NotImplemented: _NotImplementedType + +def abs(__x: SupportsAbs[_T]) -> _T: ... +def all(__iterable: Iterable[object]) -> bool: ... +def any(__iterable: Iterable[object]) -> bool: ... +def ascii(__obj: object) -> str: ... +def bin(__number: Union[int, _SupportsIndex]) -> str: ... + +if sys.version_info >= (3, 7): + def breakpoint(*args: Any, **kws: Any) -> None: ... + +def callable(__obj: object) -> bool: ... +def chr(__i: int) -> str: ... + +# This class is to be exported as PathLike from os, +# but we define it here as _PathLike to avoid import cycle issues. +# See https://github.com/python/typeshed/pull/991#issuecomment-288160993 +_AnyStr_co = TypeVar("_AnyStr_co", str, bytes, covariant=True) +@runtime_checkable +class _PathLike(Protocol[_AnyStr_co]): + def __fspath__(self) -> _AnyStr_co: ... + +if sys.version_info >= (3, 8): + def compile( + source: Union[str, bytes, mod, AST], + filename: Union[str, bytes, _PathLike[Any]], + mode: str, + flags: int = ..., + dont_inherit: int = ..., + optimize: int = ..., + *, + _feature_version: int = ..., + ) -> Any: ... + +else: + def compile( + source: Union[str, bytes, mod, AST], + filename: Union[str, bytes, _PathLike[Any]], + mode: str, + flags: int = ..., + dont_inherit: int = ..., + optimize: int = ..., + ) -> Any: ... + +def copyright() -> None: ... +def credits() -> None: ... +def delattr(__obj: Any, __name: str) -> None: ... +def dir(__o: object = ...) -> List[str]: ... + +_N2 = TypeVar("_N2", int, float) + +def divmod(__x: _N2, __y: _N2) -> Tuple[_N2, _N2]: ... +def eval( + __source: Union[str, bytes, CodeType], __globals: Optional[Dict[str, Any]] = ..., __locals: Optional[Mapping[str, Any]] = ... +) -> Any: ... +def exec( + __source: Union[str, bytes, CodeType], + __globals: Optional[Dict[str, Any]] = ..., + __locals: Optional[Mapping[str, Any]] = ..., +) -> Any: ... +def exit(code: object = ...) -> NoReturn: ... +@overload +def filter(__function: None, __iterable: Iterable[Optional[_T]]) -> Iterator[_T]: ... +@overload +def filter(__function: Callable[[_T], Any], __iterable: Iterable[_T]) -> Iterator[_T]: ... +def format(__value: object, __format_spec: str = ...) -> str: ... # TODO unicode +def getattr(__o: Any, name: str, __default: Any = ...) -> Any: ... +def globals() -> Dict[str, Any]: ... +def hasattr(__obj: Any, __name: str) -> bool: ... +def hash(__obj: object) -> int: ... +def help(*args: Any, **kwds: Any) -> None: ... +def hex(__number: Union[int, _SupportsIndex]) -> str: ... +def id(__obj: object) -> int: ... +def input(__prompt: Any = ...) -> str: ... +@overload +def iter(__iterable: Iterable[_T]) -> Iterator[_T]: ... +@overload +def iter(__function: Callable[[], Optional[_T]], __sentinel: None) -> Iterator[_T]: ... +@overload +def iter(__function: Callable[[], _T], __sentinel: Any) -> Iterator[_T]: ... +def isinstance(__obj: object, __class_or_tuple: Union[type, Tuple[Union[type, Tuple[Any, ...]], ...]]) -> bool: ... +def issubclass(__cls: type, __class_or_tuple: Union[type, Tuple[Union[type, Tuple[Any, ...]], ...]]) -> bool: ... +def len(__obj: Sized) -> int: ... +def license() -> None: ... +def locals() -> Dict[str, Any]: ... +@overload +def map(__func: Callable[[_T1], _S], __iter1: Iterable[_T1]) -> Iterator[_S]: ... +@overload +def map(__func: Callable[[_T1, _T2], _S], __iter1: Iterable[_T1], __iter2: Iterable[_T2]) -> Iterator[_S]: ... +@overload +def map( + __func: Callable[[_T1, _T2, _T3], _S], __iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3] +) -> Iterator[_S]: ... +@overload +def map( + __func: Callable[[_T1, _T2, _T3, _T4], _S], + __iter1: Iterable[_T1], + __iter2: Iterable[_T2], + __iter3: Iterable[_T3], + __iter4: Iterable[_T4], +) -> Iterator[_S]: ... +@overload +def map( + __func: Callable[[_T1, _T2, _T3, _T4, _T5], _S], + __iter1: Iterable[_T1], + __iter2: Iterable[_T2], + __iter3: Iterable[_T3], + __iter4: Iterable[_T4], + __iter5: Iterable[_T5], +) -> Iterator[_S]: ... +@overload +def map( + __func: Callable[..., _S], + __iter1: Iterable[Any], + __iter2: Iterable[Any], + __iter3: Iterable[Any], + __iter4: Iterable[Any], + __iter5: Iterable[Any], + __iter6: Iterable[Any], + *iterables: Iterable[Any], +) -> Iterator[_S]: ... +@overload +def max( + __arg1: SupportsLessThanT, __arg2: SupportsLessThanT, *_args: SupportsLessThanT, key: None = ... +) -> SupportsLessThanT: ... +@overload +def max(__arg1: _T, __arg2: _T, *_args: _T, key: Callable[[_T], SupportsLessThanT]) -> _T: ... +@overload +def max(__iterable: Iterable[SupportsLessThanT], *, key: None = ...) -> SupportsLessThanT: ... +@overload +def max(__iterable: Iterable[_T], *, key: Callable[[_T], SupportsLessThanT]) -> _T: ... +@overload +def max(__iterable: Iterable[SupportsLessThanT], *, key: None = ..., default: _T) -> Union[SupportsLessThanT, _T]: ... +@overload +def max(__iterable: Iterable[_T1], *, key: Callable[[_T1], SupportsLessThanT], default: _T2) -> Union[_T1, _T2]: ... +@overload +def min( + __arg1: SupportsLessThanT, __arg2: SupportsLessThanT, *_args: SupportsLessThanT, key: None = ... +) -> SupportsLessThanT: ... +@overload +def min(__arg1: _T, __arg2: _T, *_args: _T, key: Callable[[_T], SupportsLessThanT]) -> _T: ... +@overload +def min(__iterable: Iterable[SupportsLessThanT], *, key: None = ...) -> SupportsLessThanT: ... +@overload +def min(__iterable: Iterable[_T], *, key: Callable[[_T], SupportsLessThanT]) -> _T: ... +@overload +def min(__iterable: Iterable[SupportsLessThanT], *, key: None = ..., default: _T) -> Union[SupportsLessThanT, _T]: ... +@overload +def min(__iterable: Iterable[_T1], *, key: Callable[[_T1], SupportsLessThanT], default: _T2) -> Union[_T1, _T2]: ... +@overload +def next(__i: Iterator[_T]) -> _T: ... +@overload +def next(__i: Iterator[_T], default: _VT) -> Union[_T, _VT]: ... +def oct(__number: Union[int, _SupportsIndex]) -> str: ... + +_OpenFile = Union[AnyPath, int] +_Opener = Callable[[str, int], int] + +# Text mode: always returns a TextIOWrapper +@overload +def open( + file: _OpenFile, + mode: OpenTextMode = ..., + buffering: int = ..., + encoding: Optional[str] = ..., + errors: Optional[str] = ..., + newline: Optional[str] = ..., + closefd: bool = ..., + opener: Optional[_Opener] = ..., +) -> TextIOWrapper: ... + +# Unbuffered binary mode: returns a FileIO +@overload +def open( + file: _OpenFile, + mode: OpenBinaryMode, + buffering: Literal[0], + encoding: None = ..., + errors: None = ..., + newline: None = ..., + closefd: bool = ..., + opener: Optional[_Opener] = ..., +) -> FileIO: ... + +# Buffering is on: return BufferedRandom, BufferedReader, or BufferedWriter +@overload +def open( + file: _OpenFile, + mode: OpenBinaryModeUpdating, + buffering: Literal[-1, 1] = ..., + encoding: None = ..., + errors: None = ..., + newline: None = ..., + closefd: bool = ..., + opener: Optional[_Opener] = ..., +) -> BufferedRandom: ... +@overload +def open( + file: _OpenFile, + mode: OpenBinaryModeWriting, + buffering: Literal[-1, 1] = ..., + encoding: None = ..., + errors: None = ..., + newline: None = ..., + closefd: bool = ..., + opener: Optional[_Opener] = ..., +) -> BufferedWriter: ... +@overload +def open( + file: _OpenFile, + mode: OpenBinaryModeReading, + buffering: Literal[-1, 1] = ..., + encoding: None = ..., + errors: None = ..., + newline: None = ..., + closefd: bool = ..., + opener: Optional[_Opener] = ..., +) -> BufferedReader: ... + +# Buffering cannot be determined: fall back to BinaryIO +@overload +def open( + file: _OpenFile, + mode: OpenBinaryMode, + buffering: int, + encoding: None = ..., + errors: None = ..., + newline: None = ..., + closefd: bool = ..., + opener: Optional[_Opener] = ..., +) -> BinaryIO: ... + +# Fallback if mode is not specified +@overload +def open( + file: _OpenFile, + mode: str, + buffering: int = ..., + encoding: Optional[str] = ..., + errors: Optional[str] = ..., + newline: Optional[str] = ..., + closefd: bool = ..., + opener: Optional[_Opener] = ..., +) -> IO[Any]: ... +def ord(__c: Union[str, bytes]) -> int: ... +def print( + *values: object, + sep: Optional[str] = ..., + end: Optional[str] = ..., + file: Optional[SupportsWrite[str]] = ..., + flush: bool = ..., +) -> None: ... + +_E = TypeVar("_E", contravariant=True) +_M = TypeVar("_M", contravariant=True) + +class _SupportsPow2(Protocol[_E, _T_co]): + def __pow__(self, __other: _E) -> _T_co: ... + +class _SupportsPow3(Protocol[_E, _M, _T_co]): + def __pow__(self, __other: _E, __modulo: _M) -> _T_co: ... + +if sys.version_info >= (3, 8): + @overload + def pow(base: int, exp: int, mod: None = ...) -> Any: ... # returns int or float depending on whether exp is non-negative + @overload + def pow(base: int, exp: int, mod: int) -> int: ... + @overload + def pow(base: float, exp: float, mod: None = ...) -> float: ... + @overload + def pow(base: _SupportsPow2[_E, _T_co], exp: _E) -> _T_co: ... + @overload + def pow(base: _SupportsPow3[_E, _M, _T_co], exp: _E, mod: _M) -> _T_co: ... + +else: + @overload + def pow( + __base: int, __exp: int, __mod: None = ... + ) -> Any: ... # returns int or float depending on whether exp is non-negative + @overload + def pow(__base: int, __exp: int, __mod: int) -> int: ... + @overload + def pow(__base: float, __exp: float, __mod: None = ...) -> float: ... + @overload + def pow(__base: _SupportsPow2[_E, _T_co], __exp: _E) -> _T_co: ... + @overload + def pow(__base: _SupportsPow3[_E, _M, _T_co], __exp: _E, __mod: _M) -> _T_co: ... + +def quit(code: object = ...) -> NoReturn: ... +@overload +def reversed(__sequence: Sequence[_T]) -> Iterator[_T]: ... +@overload +def reversed(__sequence: Reversible[_T]) -> Iterator[_T]: ... +def repr(__obj: object) -> str: ... +@overload +def round(number: float) -> int: ... +@overload +def round(number: float, ndigits: None) -> int: ... +@overload +def round(number: float, ndigits: int) -> float: ... +@overload +def round(number: SupportsRound[_T]) -> int: ... +@overload +def round(number: SupportsRound[_T], ndigits: None) -> int: ... +@overload +def round(number: SupportsRound[_T], ndigits: int) -> _T: ... +def setattr(__obj: Any, __name: str, __value: Any) -> None: ... +@overload +def sorted(__iterable: Iterable[SupportsLessThanT], *, key: None = ..., reverse: bool = ...) -> List[SupportsLessThanT]: ... +@overload +def sorted(__iterable: Iterable[_T], *, key: Callable[[_T], SupportsLessThan], reverse: bool = ...) -> List[_T]: ... + +if sys.version_info >= (3, 8): + @overload + def sum(__iterable: Iterable[_T]) -> Union[_T, int]: ... + @overload + def sum(__iterable: Iterable[_T], start: _S) -> Union[_T, _S]: ... + +else: + @overload + def sum(__iterable: Iterable[_T]) -> Union[_T, int]: ... + @overload + def sum(__iterable: Iterable[_T], __start: _S) -> Union[_T, _S]: ... + +def vars(__object: Any = ...) -> Dict[str, Any]: ... +@overload +def zip(__iter1: Iterable[_T1]) -> Iterator[Tuple[_T1]]: ... +@overload +def zip(__iter1: Iterable[_T1], __iter2: Iterable[_T2]) -> Iterator[Tuple[_T1, _T2]]: ... +@overload +def zip(__iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3]) -> Iterator[Tuple[_T1, _T2, _T3]]: ... +@overload +def zip( + __iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3], __iter4: Iterable[_T4] +) -> Iterator[Tuple[_T1, _T2, _T3, _T4]]: ... +@overload +def zip( + __iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3], __iter4: Iterable[_T4], __iter5: Iterable[_T5] +) -> Iterator[Tuple[_T1, _T2, _T3, _T4, _T5]]: ... +@overload +def zip( + __iter1: Iterable[Any], + __iter2: Iterable[Any], + __iter3: Iterable[Any], + __iter4: Iterable[Any], + __iter5: Iterable[Any], + __iter6: Iterable[Any], + *iterables: Iterable[Any], +) -> Iterator[Tuple[Any, ...]]: ... +def __import__( + name: str, + globals: Optional[Mapping[str, Any]] = ..., + locals: Optional[Mapping[str, Any]] = ..., + fromlist: Sequence[str] = ..., + level: int = ..., +) -> Any: ... + +# Actually the type of Ellipsis is , but since it's +# not exposed anywhere under that name, we make it private here. +class ellipsis: ... + +Ellipsis: ellipsis + +class BaseException(object): + args: Tuple[Any, ...] + __cause__: Optional[BaseException] + __context__: Optional[BaseException] + __suppress_context__: bool + __traceback__: Optional[TracebackType] + def __init__(self, *args: object) -> None: ... + def __str__(self) -> str: ... + def __repr__(self) -> str: ... + def with_traceback(self: _TBE, tb: Optional[TracebackType]) -> _TBE: ... + +class GeneratorExit(BaseException): ... +class KeyboardInterrupt(BaseException): ... + +class SystemExit(BaseException): + code: int + +class Exception(BaseException): ... + +class StopIteration(Exception): + value: Any + +_StandardError = Exception + +class OSError(Exception): + errno: int + strerror: str + # filename, filename2 are actually Union[str, bytes, None] + filename: Any + filename2: Any + +EnvironmentError = OSError +IOError = OSError + +class ArithmeticError(_StandardError): ... +class AssertionError(_StandardError): ... +class AttributeError(_StandardError): ... +class BufferError(_StandardError): ... +class EOFError(_StandardError): ... + +class ImportError(_StandardError): + def __init__(self, *args: object, name: Optional[str] = ..., path: Optional[str] = ...) -> None: ... + name: Optional[str] + path: Optional[str] + +class LookupError(_StandardError): ... +class MemoryError(_StandardError): ... +class NameError(_StandardError): ... +class ReferenceError(_StandardError): ... +class RuntimeError(_StandardError): ... + +class StopAsyncIteration(Exception): + value: Any + +class SyntaxError(_StandardError): + msg: str + lineno: Optional[int] + offset: Optional[int] + text: Optional[str] + filename: Optional[str] + +class SystemError(_StandardError): ... +class TypeError(_StandardError): ... +class ValueError(_StandardError): ... +class FloatingPointError(ArithmeticError): ... +class OverflowError(ArithmeticError): ... +class ZeroDivisionError(ArithmeticError): ... +class ModuleNotFoundError(ImportError): ... +class IndexError(LookupError): ... +class KeyError(LookupError): ... +class UnboundLocalError(NameError): ... + +class WindowsError(OSError): + winerror: int + +class BlockingIOError(OSError): + characters_written: int + +class ChildProcessError(OSError): ... +class ConnectionError(OSError): ... +class BrokenPipeError(ConnectionError): ... +class ConnectionAbortedError(ConnectionError): ... +class ConnectionRefusedError(ConnectionError): ... +class ConnectionResetError(ConnectionError): ... +class FileExistsError(OSError): ... +class FileNotFoundError(OSError): ... +class InterruptedError(OSError): ... +class IsADirectoryError(OSError): ... +class NotADirectoryError(OSError): ... +class PermissionError(OSError): ... +class ProcessLookupError(OSError): ... +class TimeoutError(OSError): ... +class NotImplementedError(RuntimeError): ... +class RecursionError(RuntimeError): ... +class IndentationError(SyntaxError): ... +class TabError(IndentationError): ... +class UnicodeError(ValueError): ... + +class UnicodeDecodeError(UnicodeError): + encoding: str + object: bytes + start: int + end: int + reason: str + def __init__(self, __encoding: str, __object: bytes, __start: int, __end: int, __reason: str) -> None: ... + +class UnicodeEncodeError(UnicodeError): + encoding: str + object: str + start: int + end: int + reason: str + def __init__(self, __encoding: str, __object: str, __start: int, __end: int, __reason: str) -> None: ... + +class UnicodeTranslateError(UnicodeError): ... +class Warning(Exception): ... +class UserWarning(Warning): ... +class DeprecationWarning(Warning): ... +class SyntaxWarning(Warning): ... +class RuntimeWarning(Warning): ... +class FutureWarning(Warning): ... +class PendingDeprecationWarning(Warning): ... +class ImportWarning(Warning): ... +class UnicodeWarning(Warning): ... +class BytesWarning(Warning): ... +class ResourceWarning(Warning): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/collections/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/collections/__init__.pyi old mode 100755 new mode 100644 index 400c3dc3..65f1e0e9 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/collections/__init__.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/collections/__init__.pyi @@ -1,49 +1,49 @@ -# These are not exported. import sys import typing from typing import ( - TypeVar, Generic, Dict, overload, List, Tuple, - Any, Type, Optional, Union -) -# These are exported. -from . import abc - -from typing import ( + AbstractSet, + Any, + AsyncGenerator as AsyncGenerator, AsyncIterable as AsyncIterable, AsyncIterator as AsyncIterator, Awaitable as Awaitable, + ByteString as ByteString, Callable as Callable, + Collection as Collection, Container as Container, Coroutine as Coroutine, + Dict, + Generator as Generator, + Generic, Hashable as Hashable, + ItemsView as ItemsView, Iterable as Iterable, Iterator as Iterator, - Sized as Sized, - Generator as Generator, - ByteString as ByteString, - Reversible as Reversible, + KeysView as KeysView, + List, Mapping as Mapping, MappingView as MappingView, - ItemsView as ItemsView, - KeysView as KeysView, - ValuesView as ValuesView, MutableMapping as MutableMapping, - Sequence as Sequence, MutableSequence as MutableSequence, MutableSet as MutableSet, - AbstractSet as Set, + Optional, + Reversible as Reversible, + Sequence as Sequence, + Sized as Sized, + Tuple, + Type, + TypeVar, + Union, + ValuesView as ValuesView, + overload, ) -if sys.version_info >= (3, 6): - from typing import ( - Collection as Collection, - AsyncGenerator as AsyncGenerator, - ) -_S = TypeVar('_S') -_T = TypeVar('_T') -_KT = TypeVar('_KT') -_VT = TypeVar('_VT') +Set = AbstractSet +_S = TypeVar("_S") +_T = TypeVar("_T") +_KT = TypeVar("_KT") +_VT = TypeVar("_VT") # namedtuple is special-cased in the type checker; the initializer is ignored. if sys.version_info >= (3, 7): @@ -55,7 +55,8 @@ if sys.version_info >= (3, 7): module: Optional[str] = ..., defaults: Optional[Iterable[Any]] = ..., ) -> Type[Tuple[Any, ...]]: ... -elif sys.version_info >= (3, 6): + +else: def namedtuple( typename: str, field_names: Union[str, Iterable[str]], @@ -64,14 +65,10 @@ elif sys.version_info >= (3, 6): rename: bool = ..., module: Optional[str] = ..., ) -> Type[Tuple[Any, ...]]: ... -else: - def namedtuple( - typename: str, field_names: Union[str, Iterable[str]], verbose: bool = ..., rename: bool = ..., - ) -> Type[Tuple[Any, ...]]: ... class UserDict(MutableMapping[_KT, _VT]): data: Dict[_KT, _VT] - def __init__(self, dict: Optional[Mapping[_KT, _VT]] = ..., **kwargs: _VT) -> None: ... + def __init__(self, __dict: Optional[Mapping[_KT, _VT]] = ..., **kwargs: _VT) -> None: ... def __len__(self) -> int: ... def __getitem__(self, key: _KT) -> _VT: ... def __setitem__(self, key: _KT, item: _VT) -> None: ... @@ -116,7 +113,7 @@ class UserList(MutableSequence[_T]): def sort(self, *args: Any, **kwds: Any) -> None: ... def extend(self, other: Iterable[_T]) -> None: ... -_UserStringT = TypeVar('_UserStringT', bound=UserString) +_UserStringT = TypeVar("_UserStringT", bound=UserString) class UserString(Sequence[str]): data: str @@ -140,7 +137,10 @@ class UserString(Sequence[str]): def casefold(self: _UserStringT) -> _UserStringT: ... def center(self: _UserStringT, width: int, *args: Any) -> _UserStringT: ... def count(self, sub: Union[str, UserString], start: int = ..., end: int = ...) -> int: ... - def encode(self: _UserStringT, encoding: Optional[str] = ..., errors: Optional[str] = ...) -> _UserStringT: ... + if sys.version_info >= (3, 8): + def encode(self: _UserStringT, encoding: Optional[str] = ..., errors: Optional[str] = ...) -> bytes: ... + else: + def encode(self: _UserStringT, encoding: Optional[str] = ..., errors: Optional[str] = ...) -> _UserStringT: ... def endswith(self, suffix: Union[str, Tuple[str, ...]], start: int = ..., end: int = ...) -> bool: ... def expandtabs(self: _UserStringT, tabsize: int = ...) -> _UserStringT: ... def find(self, sub: Union[str, UserString], start: int = ..., end: int = ...) -> int: ... @@ -169,7 +169,12 @@ class UserString(Sequence[str]): @overload def maketrans(x: str, y: str, z: str = ...) -> Dict[int, Union[int, None]]: ... def partition(self, sep: str) -> Tuple[str, str, str]: ... - def replace(self: _UserStringT, old: Union[str, UserString], new: Union[str, UserString], maxsplit: int = ...) -> _UserStringT: ... + if sys.version_info >= (3, 9): + def removeprefix(self: _UserStringT, __prefix: Union[str, UserString]) -> _UserStringT: ... + def removesuffix(self: _UserStringT, __suffix: Union[str, UserString]) -> _UserStringT: ... + def replace( + self: _UserStringT, old: Union[str, UserString], new: Union[str, UserString], maxsplit: int = ... + ) -> _UserStringT: ... def rfind(self, sub: Union[str, UserString], start: int = ..., end: int = ...) -> int: ... def rindex(self, sub: Union[str, UserString], start: int = ..., end: int = ...) -> int: ... def rjust(self: _UserStringT, width: int, *args: Any) -> _UserStringT: ... @@ -186,15 +191,10 @@ class UserString(Sequence[str]): def upper(self: _UserStringT) -> _UserStringT: ... def zfill(self: _UserStringT, width: int) -> _UserStringT: ... - -# Technically, deque only derives from MutableSequence in 3.5 (before then, the insert and index -# methods did not exist). -# But in practice it's not worth losing sleep over. class deque(MutableSequence[_T], Generic[_T]): @property def maxlen(self) -> Optional[int]: ... - def __init__(self, iterable: Iterable[_T] = ..., - maxlen: Optional[int] = ...) -> None: ... + def __init__(self, iterable: Iterable[_T] = ..., maxlen: Optional[int] = ...) -> None: ... def append(self, x: _T) -> None: ... def appendleft(self, x: _T) -> None: ... def clear(self) -> None: ... @@ -204,17 +204,15 @@ class deque(MutableSequence[_T], Generic[_T]): def extendleft(self, iterable: Iterable[_T]) -> None: ... def insert(self, i: int, x: _T) -> None: ... def index(self, x: _T, start: int = ..., stop: int = ...) -> int: ... - def pop(self, i: int = ...) -> _T: ... + def pop(self) -> _T: ... # type: ignore def popleft(self) -> _T: ... def remove(self, value: _T) -> None: ... def reverse(self) -> None: ... - def rotate(self, n: int) -> None: ... - + def rotate(self, n: int = ...) -> None: ... def __len__(self) -> int: ... def __iter__(self) -> Iterator[_T]: ... def __str__(self) -> str: ... def __hash__(self) -> int: ... - # These methods of deque don't really take slices, but we need to # define them as taking a slice to satisfy MutableSequence. @overload @@ -229,33 +227,29 @@ class deque(MutableSequence[_T], Generic[_T]): def __delitem__(self, i: int) -> None: ... @overload def __delitem__(self, s: slice) -> None: ... - def __contains__(self, o: object) -> bool: ... def __reversed__(self) -> Iterator[_T]: ... - def __iadd__(self: _S, iterable: Iterable[_T]) -> _S: ... - def __add__(self, other: deque[_T]) -> deque[_T]: ... def __mul__(self, other: int) -> deque[_T]: ... def __imul__(self, other: int) -> None: ... class Counter(Dict[_T, int], Generic[_T]): @overload - def __init__(self, **kwargs: int) -> None: ... + def __init__(self, __iterable: None = ..., **kwargs: int) -> None: ... @overload - def __init__(self, mapping: Mapping[_T, int]) -> None: ... + def __init__(self, __mapping: Mapping[_T, int]) -> None: ... @overload - def __init__(self, iterable: Iterable[_T]) -> None: ... + def __init__(self, __iterable: Iterable[_T]) -> None: ... def copy(self: _S) -> _S: ... def elements(self) -> Iterator[_T]: ... - def most_common(self, n: Optional[int] = ...) -> List[Tuple[_T, int]]: ... - + @overload + def subtract(self, __iterable: None = ...) -> None: ... @overload def subtract(self, __mapping: Mapping[_T, int]) -> None: ... @overload - def subtract(self, iterable: Iterable[_T]) -> None: ... - + def subtract(self, __iterable: Iterable[_T]) -> None: ... # The Iterable[Tuple[...]] argument type is not actually desirable # (the tuples will be added as keys, breaking type safety) but # it's included so that the signature is compatible with @@ -266,23 +260,24 @@ class Counter(Dict[_T, int], Generic[_T]): @overload def update(self, __m: Union[Iterable[_T], Iterable[Tuple[_T, int]]], **kwargs: int) -> None: ... @overload - def update(self, **kwargs: int) -> None: ... - + def update(self, __m: None = ..., **kwargs: int) -> None: ... def __add__(self, other: Counter[_T]) -> Counter[_T]: ... def __sub__(self, other: Counter[_T]) -> Counter[_T]: ... def __and__(self, other: Counter[_T]) -> Counter[_T]: ... - def __or__(self, other: Counter[_T]) -> Counter[_T]: ... + def __or__(self, other: Counter[_T]) -> Counter[_T]: ... # type: ignore def __pos__(self) -> Counter[_T]: ... def __neg__(self) -> Counter[_T]: ... def __iadd__(self, other: Counter[_T]) -> Counter[_T]: ... def __isub__(self, other: Counter[_T]) -> Counter[_T]: ... def __iand__(self, other: Counter[_T]) -> Counter[_T]: ... - def __ior__(self, other: Counter[_T]) -> Counter[_T]: ... + def __ior__(self, other: Counter[_T]) -> Counter[_T]: ... # type: ignore class _OrderedDictKeysView(KeysView[_KT], Reversible[_KT]): def __reversed__(self) -> Iterator[_KT]: ... + class _OrderedDictItemsView(ItemsView[_KT, _VT], Reversible[Tuple[_KT, _VT]]): def __reversed__(self) -> Iterator[Tuple[_KT, _VT]]: ... + class _OrderedDictValuesView(ValuesView[_VT], Reversible[_VT]): def __reversed__(self) -> Iterator[_VT]: ... @@ -297,7 +292,6 @@ class OrderedDict(Dict[_KT, _VT], Reversible[_KT], Generic[_KT, _VT]): class defaultdict(Dict[_KT, _VT], Generic[_KT, _VT]): default_factory: Optional[Callable[[], _VT]] - @overload def __init__(self, **kwargs: _VT) -> None: ... @overload @@ -305,34 +299,29 @@ class defaultdict(Dict[_KT, _VT], Generic[_KT, _VT]): @overload def __init__(self, default_factory: Optional[Callable[[], _VT]], **kwargs: _VT) -> None: ... @overload - def __init__(self, default_factory: Optional[Callable[[], _VT]], - map: Mapping[_KT, _VT]) -> None: ... + def __init__(self, default_factory: Optional[Callable[[], _VT]], map: Mapping[_KT, _VT]) -> None: ... @overload - def __init__(self, default_factory: Optional[Callable[[], _VT]], - map: Mapping[_KT, _VT], **kwargs: _VT) -> None: ... + def __init__(self, default_factory: Optional[Callable[[], _VT]], map: Mapping[_KT, _VT], **kwargs: _VT) -> None: ... @overload - def __init__(self, default_factory: Optional[Callable[[], _VT]], - iterable: Iterable[Tuple[_KT, _VT]]) -> None: ... + def __init__(self, default_factory: Optional[Callable[[], _VT]], iterable: Iterable[Tuple[_KT, _VT]]) -> None: ... @overload - def __init__(self, default_factory: Optional[Callable[[], _VT]], - iterable: Iterable[Tuple[_KT, _VT]], **kwargs: _VT) -> None: ... + def __init__( + self, default_factory: Optional[Callable[[], _VT]], iterable: Iterable[Tuple[_KT, _VT]], **kwargs: _VT + ) -> None: ... def __missing__(self, key: _KT) -> _VT: ... # TODO __reversed__ def copy(self: _S) -> _S: ... class ChainMap(MutableMapping[_KT, _VT], Generic[_KT, _VT]): def __init__(self, *maps: Mapping[_KT, _VT]) -> None: ... - @property def maps(self) -> List[Mapping[_KT, _VT]]: ... - def new_child(self, m: Mapping[_KT, _VT] = ...) -> typing.ChainMap[_KT, _VT]: ... - @property def parents(self) -> typing.ChainMap[_KT, _VT]: ... - def __setitem__(self, k: _KT, v: _VT) -> None: ... def __delitem__(self, v: _KT) -> None: ... def __getitem__(self, k: _KT) -> _VT: ... def __iter__(self) -> Iterator[_KT]: ... def __len__(self) -> int: ... + def __missing__(self, key: _KT) -> _VT: ... # undocumented diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/collections/abc.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/collections/abc.pyi old mode 100755 new mode 100644 index 11718438..c9d69978 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/collections/abc.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/collections/abc.pyi @@ -1,36 +1,27 @@ -# Stubs for collections.abc (introduced from Python 3.3) -# -# https://docs.python.org/3.3/whatsnew/3.3.html#collections -import sys - from . import ( + AsyncGenerator as AsyncGenerator, AsyncIterable as AsyncIterable, AsyncIterator as AsyncIterator, Awaitable as Awaitable, ByteString as ByteString, + Callable as Callable, + Collection as Collection, Container as Container, Coroutine as Coroutine, Generator as Generator, Hashable as Hashable, + ItemsView as ItemsView, Iterable as Iterable, Iterator as Iterator, - Sized as Sized, - Callable as Callable, + KeysView as KeysView, Mapping as Mapping, + MappingView as MappingView, MutableMapping as MutableMapping, - Sequence as Sequence, MutableSequence as MutableSequence, - Set as Set, MutableSet as MutableSet, - MappingView as MappingView, - ItemsView as ItemsView, - KeysView as KeysView, + Reversible as Reversible, + Sequence as Sequence, + Set as Set, + Sized as Sized, ValuesView as ValuesView, ) - -if sys.version_info >= (3, 6): - from . import ( - Collection as Collection, - Reversible as Reversible, - AsyncGenerator as AsyncGenerator, - ) diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/compileall.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/compileall.pyi old mode 100755 new mode 100644 index 72f5d4ca..bcc2a8e8 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/compileall.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/compileall.pyi @@ -1,22 +1,15 @@ -# Stubs for compileall (Python 3) - -import os import sys -from typing import Any, Optional, Union, Pattern - -if sys.version_info < (3, 6): - _Path = Union[str, bytes] - _SuccessType = bool -else: - _Path = Union[str, bytes, os.PathLike] - _SuccessType = int +from _typeshed import AnyPath +from typing import Any, Optional, Pattern if sys.version_info >= (3, 7): from py_compile import PycInvalidationMode + +if sys.version_info >= (3, 9): def compile_dir( - dir: _Path, - maxlevels: int = ..., - ddir: Optional[_Path] = ..., + dir: AnyPath, + maxlevels: Optional[int] = ..., + ddir: Optional[AnyPath] = ..., force: bool = ..., rx: Optional[Pattern[Any]] = ..., quiet: int = ..., @@ -24,49 +17,87 @@ if sys.version_info >= (3, 7): optimize: int = ..., workers: int = ..., invalidation_mode: Optional[PycInvalidationMode] = ..., - ) -> _SuccessType: ... + *, + stripdir: Optional[str] = ..., # TODO: change to Optional[AnyPath] once https://bugs.python.org/issue40447 is resolved + prependdir: Optional[AnyPath] = ..., + limit_sl_dest: Optional[AnyPath] = ..., + hardlink_dupes: bool = ..., + ) -> int: ... def compile_file( - fullname: _Path, - ddir: Optional[_Path] = ..., + fullname: AnyPath, + ddir: Optional[AnyPath] = ..., force: bool = ..., rx: Optional[Pattern[Any]] = ..., quiet: int = ..., legacy: bool = ..., optimize: int = ..., invalidation_mode: Optional[PycInvalidationMode] = ..., - ) -> _SuccessType: ... - def compile_path( - skip_curdir: bool = ..., + *, + stripdir: Optional[str] = ..., # TODO: change to Optional[AnyPath] once https://bugs.python.org/issue40447 is resolved + prependdir: Optional[AnyPath] = ..., + limit_sl_dest: Optional[AnyPath] = ..., + hardlink_dupes: bool = ..., + ) -> int: ... + +elif sys.version_info >= (3, 7): + def compile_dir( + dir: AnyPath, maxlevels: int = ..., + ddir: Optional[AnyPath] = ..., + force: bool = ..., + rx: Optional[Pattern[Any]] = ..., + quiet: int = ..., + legacy: bool = ..., + optimize: int = ..., + workers: int = ..., + invalidation_mode: Optional[PycInvalidationMode] = ..., + ) -> int: ... + def compile_file( + fullname: AnyPath, + ddir: Optional[AnyPath] = ..., force: bool = ..., + rx: Optional[Pattern[Any]] = ..., quiet: int = ..., legacy: bool = ..., optimize: int = ..., invalidation_mode: Optional[PycInvalidationMode] = ..., - ) -> _SuccessType: ... + ) -> int: ... else: # rx can be any object with a 'search' method; once we have Protocols we can change the type def compile_dir( - dir: _Path, + dir: AnyPath, maxlevels: int = ..., - ddir: Optional[_Path] = ..., + ddir: Optional[AnyPath] = ..., force: bool = ..., rx: Optional[Pattern[Any]] = ..., quiet: int = ..., legacy: bool = ..., optimize: int = ..., workers: int = ..., - ) -> _SuccessType: ... + ) -> int: ... def compile_file( - fullname: _Path, - ddir: Optional[_Path] = ..., + fullname: AnyPath, + ddir: Optional[AnyPath] = ..., force: bool = ..., rx: Optional[Pattern[Any]] = ..., quiet: int = ..., legacy: bool = ..., optimize: int = ..., - ) -> _SuccessType: ... + ) -> int: ... + +if sys.version_info >= (3, 7): + def compile_path( + skip_curdir: bool = ..., + maxlevels: int = ..., + force: bool = ..., + quiet: int = ..., + legacy: bool = ..., + optimize: int = ..., + invalidation_mode: Optional[PycInvalidationMode] = ..., + ) -> int: ... + +else: def compile_path( skip_curdir: bool = ..., maxlevels: int = ..., @@ -74,4 +105,4 @@ else: quiet: int = ..., legacy: bool = ..., optimize: int = ..., - ) -> _SuccessType: ... + ) -> int: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/concurrent/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/concurrent/__init__.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/concurrent/futures/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/concurrent/futures/__init__.pyi old mode 100755 new mode 100644 index 4439dcad..f3b54e54 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/concurrent/futures/__init__.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/concurrent/futures/__init__.pyi @@ -1,3 +1,20 @@ -from ._base import * # noqa: F403 -from .thread import * # noqa: F403 -from .process import * # noqa: F403 +import sys + +from ._base import ( + ALL_COMPLETED as ALL_COMPLETED, + FIRST_COMPLETED as FIRST_COMPLETED, + FIRST_EXCEPTION as FIRST_EXCEPTION, + CancelledError as CancelledError, + Executor as Executor, + Future as Future, + TimeoutError as TimeoutError, + as_completed as as_completed, + wait as wait, +) +from .process import ProcessPoolExecutor as ProcessPoolExecutor +from .thread import ThreadPoolExecutor as ThreadPoolExecutor + +if sys.version_info >= (3, 8): + from ._base import InvalidStateError as InvalidStateError +if sys.version_info >= (3, 7): + from ._base import BrokenExecutor as BrokenExecutor diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/concurrent/futures/_base.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/concurrent/futures/_base.pyi old mode 100755 new mode 100644 index 00ff41d7..140f0a9b --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/concurrent/futures/_base.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/concurrent/futures/_base.pyi @@ -1,8 +1,25 @@ +import sys import threading +from abc import abstractmethod from logging import Logger -from typing import TypeVar, Generic, Any, Iterable, Iterator, Callable, Tuple, Optional, Set, List -from types import TracebackType -import sys +from typing import ( + Any, + Callable, + Container, + Generic, + Iterable, + Iterator, + List, + Optional, + Protocol, + Sequence, + Set, + TypeVar, + overload, +) + +if sys.version_info >= (3, 9): + from types import GenericAlias FIRST_COMPLETED: str FIRST_EXCEPTION: str @@ -18,10 +35,22 @@ class Error(Exception): ... class CancelledError(Error): ... class TimeoutError(Error): ... +if sys.version_info >= (3, 8): + class InvalidStateError(Error): ... + if sys.version_info >= (3, 7): class BrokenExecutor(RuntimeError): ... -_T = TypeVar('_T') +_T = TypeVar("_T") + +_T_co = TypeVar("_T_co", covariant=True) + +# Copied over Collection implementation as it does not exist in Python 2 and <3.6. +# Also to solve pytype issues with _Collection. +class _Collection(Iterable[_T_co], Container[_T_co], Protocol[_T_co]): + # Implement Sized (but don't have it as a base class). + @abstractmethod + def __len__(self) -> int: ... class Future(Generic[_T]): def __init__(self) -> None: ... @@ -33,32 +62,40 @@ class Future(Generic[_T]): def result(self, timeout: Optional[float] = ...) -> _T: ... def set_running_or_notify_cancel(self) -> bool: ... def set_result(self, result: _T) -> None: ... - - if sys.version_info >= (3,): - def exception(self, timeout: Optional[float] = ...) -> Optional[BaseException]: ... - def set_exception(self, exception: Optional[BaseException]) -> None: ... - else: - def exception(self, timeout: Optional[float] = ...) -> Any: ... - def exception_info(self, timeout: Optional[float] = ...) -> Tuple[Any, Optional[TracebackType]]: ... - def set_exception(self, exception: Any) -> None: ... - def set_exception_info(self, exception: Any, traceback: Optional[TracebackType]) -> None: ... - + def exception(self, timeout: Optional[float] = ...) -> Optional[BaseException]: ... + def set_exception(self, exception: Optional[BaseException]) -> None: ... + if sys.version_info >= (3, 9): + def __class_getitem__(cls, item: Any) -> GenericAlias: ... class Executor: - def submit(self, fn: Callable[..., _T], *args: Any, **kwargs: Any) -> Future[_T]: ... - if sys.version_info >= (3, 5): - def map(self, func: Callable[..., _T], *iterables: Iterable[Any], timeout: Optional[float] = ..., - chunksize: int = ...) -> Iterator[_T]: ... + if sys.version_info >= (3, 9): + def submit(self, __fn: Callable[..., _T], *args: Any, **kwargs: Any) -> Future[_T]: ... + else: + def submit(self, fn: Callable[..., _T], *args: Any, **kwargs: Any) -> Future[_T]: ... + def map( + self, fn: Callable[..., _T], *iterables: Iterable[Any], timeout: Optional[float] = ..., chunksize: int = ... + ) -> Iterator[_T]: ... + if sys.version_info >= (3, 9): + def shutdown(self, wait: bool = ..., *, cancel_futures: bool = ...) -> None: ... else: - def map(self, func: Callable[..., _T], *iterables: Iterable[Any], timeout: Optional[float] = ...,) -> Iterator[_T]: ... - def shutdown(self, wait: bool = ...) -> None: ... + def shutdown(self, wait: bool = ...) -> None: ... def __enter__(self: _T) -> _T: ... def __exit__(self, exc_type: Any, exc_val: Any, exc_tb: Any) -> Optional[bool]: ... def as_completed(fs: Iterable[Future[_T]], timeout: Optional[float] = ...) -> Iterator[Future[_T]]: ... -def wait(fs: Iterable[Future[_T]], timeout: Optional[float] = ..., return_when: str = ...) -> Tuple[Set[Future[_T]], - Set[Future[_T]]]: ... +# Ideally this would be a namedtuple, but mypy doesn't support generic tuple types. See #1976 +class DoneAndNotDoneFutures(Sequence[_T]): + done: Set[Future[_T]] + not_done: Set[Future[_T]] + def __new__(_cls, done: Set[Future[_T]], not_done: Set[Future[_T]]) -> DoneAndNotDoneFutures[_T]: ... + def __len__(self) -> int: ... + @overload + def __getitem__(self, i: int) -> _T: ... + @overload + def __getitem__(self, s: slice) -> DoneAndNotDoneFutures[_T]: ... + +def wait(fs: Iterable[Future[_T]], timeout: Optional[float] = ..., return_when: str = ...) -> DoneAndNotDoneFutures[_T]: ... class _Waiter: event: threading.Event @@ -68,7 +105,6 @@ class _Waiter: def add_exception(self, future: Future[Any]) -> None: ... def add_cancelled(self, future: Future[Any]) -> None: ... - class _AsCompletedWaiter(_Waiter): lock: threading.Lock def __init__(self) -> None: ... @@ -76,13 +112,11 @@ class _AsCompletedWaiter(_Waiter): def add_exception(self, future: Future[Any]) -> None: ... def add_cancelled(self, future: Future[Any]) -> None: ... - class _FirstCompletedWaiter(_Waiter): def add_result(self, future: Future[Any]) -> None: ... def add_exception(self, future: Future[Any]) -> None: ... def add_cancelled(self, future: Future[Any]) -> None: ... - class _AllCompletedWaiter(_Waiter): num_pending_calls: int stop_on_exception: bool @@ -92,7 +126,6 @@ class _AllCompletedWaiter(_Waiter): def add_exception(self, future: Future[Any]) -> None: ... def add_cancelled(self, future: Future[Any]) -> None: ... - class _AcquireFutures: futures: Iterable[Future[Any]] def __init__(self, futures: Iterable[Future[Any]]) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/concurrent/futures/process.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/concurrent/futures/process.pyi old mode 100755 new mode 100644 index ca22879c..a6655767 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/concurrent/futures/process.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/concurrent/futures/process.pyi @@ -1,20 +1,28 @@ +import sys from typing import Any, Callable, Optional, Tuple + from ._base import Executor -import sys EXTRA_QUEUED_CALLS: Any -if sys.version_info >= (3,): +if sys.version_info >= (3, 7): + from ._base import BrokenExecutor + class BrokenProcessPool(BrokenExecutor): ... + +else: class BrokenProcessPool(RuntimeError): ... if sys.version_info >= (3, 7): from multiprocessing.context import BaseContext - class ProcessPoolExecutor(Executor): - def __init__(self, max_workers: Optional[int] = ..., - mp_context: Optional[BaseContext] = ..., - initializer: Optional[Callable[..., None]] = ..., - initargs: Tuple[Any, ...] = ...) -> None: ... + def __init__( + self, + max_workers: Optional[int] = ..., + mp_context: Optional[BaseContext] = ..., + initializer: Optional[Callable[..., None]] = ..., + initargs: Tuple[Any, ...] = ..., + ) -> None: ... + else: class ProcessPoolExecutor(Executor): def __init__(self, max_workers: Optional[int] = ...) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/concurrent/futures/thread.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/concurrent/futures/thread.pyi old mode 100755 new mode 100644 index 82c8ddd0..e8116c6d --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/concurrent/futures/thread.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/concurrent/futures/thread.pyi @@ -1,26 +1,36 @@ -from typing import Any, Callable, Iterable, Mapping, Optional, Tuple, TypeVar, Generic -from ._base import Executor, Future +import queue import sys +from typing import Any, Callable, Generic, Iterable, Mapping, Optional, Tuple, TypeVar + +from ._base import Executor, Future if sys.version_info >= (3, 7): from ._base import BrokenExecutor class BrokenThreadPool(BrokenExecutor): ... -_S = TypeVar('_S') +if sys.version_info >= (3, 9): + from types import GenericAlias + +_S = TypeVar("_S") class ThreadPoolExecutor(Executor): if sys.version_info >= (3, 7): - def __init__(self, max_workers: Optional[int] = ..., - thread_name_prefix: str = ..., - initializer: Optional[Callable[..., None]] = ..., - initargs: Tuple[Any, ...] = ...) -> None: ... - elif sys.version_info >= (3, 6) or sys.version_info < (3,): - def __init__(self, max_workers: Optional[int] = ..., - thread_name_prefix: str = ...) -> None: ... + _work_queue: queue.SimpleQueue + else: + _work_queue: queue.Queue + if sys.version_info >= (3, 7): + def __init__( + self, + max_workers: Optional[int] = ..., + thread_name_prefix: str = ..., + initializer: Optional[Callable[..., None]] = ..., + initargs: Tuple[Any, ...] = ..., + ) -> None: ... + elif sys.version_info >= (3, 6): + def __init__(self, max_workers: Optional[int] = ..., thread_name_prefix: str = ...) -> None: ... else: def __init__(self, max_workers: Optional[int] = ...) -> None: ... - class _WorkItem(Generic[_S]): future: Future[_S] fn: Callable[..., _S] @@ -28,3 +38,5 @@ class _WorkItem(Generic[_S]): kwargs: Mapping[str, Any] def __init__(self, future: Future[_S], fn: Callable[..., _S], args: Iterable[Any], kwargs: Mapping[str, Any]) -> None: ... def run(self) -> None: ... + if sys.version_info >= (3, 9): + def __class_getitem__(cls, item: Any) -> GenericAlias: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/configparser.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/configparser.pyi old mode 100755 new mode 100644 index 24f81799..fc6adc11 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/configparser.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/configparser.pyi @@ -1,156 +1,160 @@ -# Based on http://docs.python.org/3.5/library/configparser.html and on -# reading configparser.py. - import sys -from typing import (AbstractSet, MutableMapping, Mapping, Dict, Sequence, List, - Union, Iterable, Iterator, Callable, Any, IO, overload, - Optional, Pattern, Type, TypeVar, ClassVar) -# Types only used in type comments only -from typing import Optional, Tuple # noqa - -if sys.version_info >= (3, 6): - from os import PathLike +from _typeshed import AnyPath, StrPath, SupportsWrite +from typing import ( + AbstractSet, + Any, + Callable, + ClassVar, + Dict, + Iterable, + Iterator, + List, + Mapping, + MutableMapping, + Optional, + Pattern, + Sequence, + Tuple, + Type, + TypeVar, + Union, + overload, +) +from typing_extensions import Literal # Internal type aliases _section = Mapping[str, str] _parser = MutableMapping[str, _section] _converter = Callable[[str], Any] _converters = Dict[str, _converter] -_T = TypeVar('_T') +_T = TypeVar("_T") if sys.version_info >= (3, 7): - _Path = Union[str, bytes, PathLike[str]] -elif sys.version_info >= (3, 6): - _Path = Union[str, PathLike[str]] + _Path = AnyPath else: - _Path = str + _Path = StrPath DEFAULTSECT: str MAX_INTERPOLATION_DEPTH: int class Interpolation: - def before_get(self, parser: _parser, - section: str, - option: str, - value: str, - defaults: _section) -> str: ... - - def before_set(self, parser: _parser, - section: str, - option: str, - value: str) -> str: ... - - def before_read(self, parser: _parser, - section: str, - option: str, - value: str) -> str: ... - - def before_write(self, parser: _parser, - section: str, - option: str, - value: str) -> str: ... - + def before_get(self, parser: _parser, section: str, option: str, value: str, defaults: _section) -> str: ... + def before_set(self, parser: _parser, section: str, option: str, value: str) -> str: ... + def before_read(self, parser: _parser, section: str, option: str, value: str) -> str: ... + def before_write(self, parser: _parser, section: str, option: str, value: str) -> str: ... class BasicInterpolation(Interpolation): ... class ExtendedInterpolation(Interpolation): ... class LegacyInterpolation(Interpolation): ... - class RawConfigParser(_parser): - BOOLEAN_STATES: ClassVar[Mapping[str, bool]] = ... # Undocumented - def __init__(self, - defaults: Optional[_section] = ..., - dict_type: Type[Mapping[str, str]] = ..., - allow_no_value: bool = ..., - *, - delimiters: Sequence[str] = ..., - comment_prefixes: Sequence[str] = ..., - inline_comment_prefixes: Optional[Sequence[str]] = ..., - strict: bool = ..., - empty_lines_in_values: bool = ..., - default_section: str = ..., - interpolation: Optional[Interpolation] = ...) -> None: ... + _SECT_TMPL: ClassVar[str] = ... # Undocumented + _OPT_TMPL: ClassVar[str] = ... # Undocumented + _OPT_NV_TMPL: ClassVar[str] = ... # Undocumented - def __len__(self) -> int: ... + SECTCRE: Pattern[str] = ... + OPTCRE: ClassVar[Pattern[str]] = ... + OPTCRE_NV: ClassVar[Pattern[str]] = ... # Undocumented + NONSPACECRE: ClassVar[Pattern[str]] = ... # Undocumented + BOOLEAN_STATES: ClassVar[Mapping[str, bool]] = ... # Undocumented + default_section: str + @overload + def __init__( + self, + defaults: Optional[Mapping[str, Optional[str]]] = ..., + dict_type: Type[Mapping[str, str]] = ..., + allow_no_value: Literal[True] = ..., + *, + delimiters: Sequence[str] = ..., + comment_prefixes: Sequence[str] = ..., + inline_comment_prefixes: Optional[Sequence[str]] = ..., + strict: bool = ..., + empty_lines_in_values: bool = ..., + default_section: str = ..., + interpolation: Optional[Interpolation] = ..., + converters: _converters = ..., + ) -> None: ... + @overload + def __init__( + self, + defaults: Optional[_section] = ..., + dict_type: Type[Mapping[str, str]] = ..., + allow_no_value: bool = ..., + *, + delimiters: Sequence[str] = ..., + comment_prefixes: Sequence[str] = ..., + inline_comment_prefixes: Optional[Sequence[str]] = ..., + strict: bool = ..., + empty_lines_in_values: bool = ..., + default_section: str = ..., + interpolation: Optional[Interpolation] = ..., + converters: _converters = ..., + ) -> None: ... + def __len__(self) -> int: ... def __getitem__(self, section: str) -> SectionProxy: ... - def __setitem__(self, section: str, options: _section) -> None: ... - def __delitem__(self, section: str) -> None: ... - def __iter__(self) -> Iterator[str]: ... - def defaults(self) -> _section: ... - def sections(self) -> List[str]: ... - def add_section(self, section: str) -> None: ... - def has_section(self, section: str) -> bool: ... - def options(self, section: str) -> List[str]: ... - def has_option(self, section: str, option: str) -> bool: ... - - def read(self, filenames: Union[_Path, Iterable[_Path]], - encoding: Optional[str] = ...) -> List[str]: ... + def read(self, filenames: Union[_Path, Iterable[_Path]], encoding: Optional[str] = ...) -> List[str]: ... def read_file(self, f: Iterable[str], source: Optional[str] = ...) -> None: ... def read_string(self, string: str, source: str = ...) -> None: ... - def read_dict(self, dictionary: Mapping[str, Mapping[str, Any]], - source: str = ...) -> None: ... + def read_dict(self, dictionary: Mapping[str, Mapping[str, Any]], source: str = ...) -> None: ... def readfp(self, fp: Iterable[str], filename: Optional[str] = ...) -> None: ... - # These get* methods are partially applied (with the same names) in # SectionProxy; the stubs should be kept updated together - def getint(self, section: str, option: str, *, raw: bool = ..., vars: Optional[_section] = ..., fallback: int = ...) -> int: ... - - def getfloat(self, section: str, option: str, *, raw: bool = ..., vars: Optional[_section] = ..., fallback: float = ...) -> float: ... - - def getboolean(self, section: str, option: str, *, raw: bool = ..., vars: Optional[_section] = ..., fallback: bool = ...) -> bool: ... - - def _get_conv(self, section: str, option: str, conv: Callable[[str], _T], *, raw: bool = ..., vars: Optional[_section] = ..., fallback: _T = ...) -> _T: ... - + @overload + def getint(self, section: str, option: str, *, raw: bool = ..., vars: Optional[_section] = ...) -> int: ... + @overload + def getint( + self, section: str, option: str, *, raw: bool = ..., vars: Optional[_section] = ..., fallback: _T = ... + ) -> Union[int, _T]: ... + @overload + def getfloat(self, section: str, option: str, *, raw: bool = ..., vars: Optional[_section] = ...) -> float: ... + @overload + def getfloat( + self, section: str, option: str, *, raw: bool = ..., vars: Optional[_section] = ..., fallback: _T = ... + ) -> Union[float, _T]: ... + @overload + def getboolean(self, section: str, option: str, *, raw: bool = ..., vars: Optional[_section] = ...) -> bool: ... + @overload + def getboolean( + self, section: str, option: str, *, raw: bool = ..., vars: Optional[_section] = ..., fallback: _T = ... + ) -> Union[bool, _T]: ... + def _get_conv( + self, + section: str, + option: str, + conv: Callable[[str], _T], + *, + raw: bool = ..., + vars: Optional[_section] = ..., + fallback: _T = ..., + ) -> _T: ... # This is incompatible with MutableMapping so we ignore the type @overload # type: ignore def get(self, section: str, option: str, *, raw: bool = ..., vars: Optional[_section] = ...) -> str: ... - @overload - def get(self, section: str, option: str, *, raw: bool = ..., vars: Optional[_section] = ..., fallback: _T) -> Union[str, _T]: ... - + def get( + self, section: str, option: str, *, raw: bool = ..., vars: Optional[_section] = ..., fallback: _T + ) -> Union[str, _T]: ... @overload def items(self, *, raw: bool = ..., vars: Optional[_section] = ...) -> AbstractSet[Tuple[str, SectionProxy]]: ... - @overload def items(self, section: str, raw: bool = ..., vars: Optional[_section] = ...) -> List[Tuple[str, str]]: ... - - def set(self, section: str, option: str, value: str) -> None: ... - - def write(self, - fileobject: IO[str], - space_around_delimiters: bool = ...) -> None: ... - + def set(self, section: str, option: str, value: Optional[str] = ...) -> None: ... + def write(self, fp: SupportsWrite[str], space_around_delimiters: bool = ...) -> None: ... def remove_option(self, section: str, option: str) -> bool: ... - def remove_section(self, section: str) -> bool: ... + def optionxform(self, optionstr: str) -> str: ... - def optionxform(self, option: str) -> str: ... - - -class ConfigParser(RawConfigParser): - def __init__(self, - defaults: Optional[_section] = ..., - dict_type: Type[Mapping[str, str]] = ..., - allow_no_value: bool = ..., - delimiters: Sequence[str] = ..., - comment_prefixes: Sequence[str] = ..., - inline_comment_prefixes: Optional[Sequence[str]] = ..., - strict: bool = ..., - empty_lines_in_values: bool = ..., - default_section: str = ..., - interpolation: Optional[Interpolation] = ..., - converters: _converters = ...) -> None: ... - +class ConfigParser(RawConfigParser): ... class SafeConfigParser(ConfigParser): ... class SectionProxy(MutableMapping[str, str]): @@ -165,14 +169,25 @@ class SectionProxy(MutableMapping[str, str]): def parser(self) -> RawConfigParser: ... @property def name(self) -> str: ... - def get(self, option: str, fallback: Optional[str] = ..., *, raw: bool = ..., vars: Optional[_section] = ..., **kwargs: Any) -> str: ... # type: ignore - + def get(self, option: str, fallback: Optional[str] = ..., *, raw: bool = ..., vars: Optional[_section] = ..., _impl: Optional[Any] = ..., **kwargs: Any) -> str: ... # type: ignore # These are partially-applied version of the methods with the same names in # RawConfigParser; the stubs should be kept updated together - def getint(self, option: str, *, raw: bool = ..., vars: Optional[_section] = ..., fallback: int = ...) -> int: ... - def getfloat(self, option: str, *, raw: bool = ..., vars: Optional[_section] = ..., fallback: float = ...) -> float: ... - def getboolean(self, option: str, *, raw: bool = ..., vars: Optional[_section] = ..., fallback: bool = ...) -> bool: ... - + @overload + def getint(self, option: str, *, raw: bool = ..., vars: Optional[_section] = ...) -> int: ... + @overload + def getint(self, option: str, *, raw: bool = ..., vars: Optional[_section] = ..., fallback: _T = ...) -> Union[int, _T]: ... + @overload + def getfloat(self, option: str, *, raw: bool = ..., vars: Optional[_section] = ...) -> float: ... + @overload + def getfloat( + self, option: str, *, raw: bool = ..., vars: Optional[_section] = ..., fallback: _T = ... + ) -> Union[float, _T]: ... + @overload + def getboolean(self, option: str, *, raw: bool = ..., vars: Optional[_section] = ...) -> bool: ... + @overload + def getboolean( + self, option: str, *, raw: bool = ..., vars: Optional[_section] = ..., fallback: _T = ... + ) -> Union[bool, _T]: ... # SectionProxy can have arbitrary attributes when custon converters are used def __getattr__(self, key: str) -> Callable[..., Any]: ... @@ -185,51 +200,53 @@ class ConverterMapping(MutableMapping[str, Optional[_converter]]): def __iter__(self) -> Iterator[str]: ... def __len__(self) -> int: ... +class Error(Exception): + message: str + def __init__(self, msg: str = ...) -> None: ... -class Error(Exception): ... - - -class NoSectionError(Error): ... - +class NoSectionError(Error): + section: str + def __init__(self, section: str) -> None: ... class DuplicateSectionError(Error): section: str source: Optional[str] lineno: Optional[int] - + def __init__(self, section: str, source: Optional[str] = ..., lineno: Optional[int] = ...) -> None: ... class DuplicateOptionError(Error): section: str option: str source: Optional[str] lineno: Optional[int] - + def __init__(self, section: str, option: str, source: Optional[str] = ..., lineno: Optional[str] = ...) -> None: ... class NoOptionError(Error): section: str option: str - + def __init__(self, option: str, section: str) -> None: ... class InterpolationError(Error): section: str option: str + def __init__(self, option: str, section: str, msg: str) -> None: ... - -class InterpolationDepthError(InterpolationError): ... - +class InterpolationDepthError(InterpolationError): + def __init__(self, option: str, section: str, rawval: object) -> None: ... class InterpolationMissingOptionError(InterpolationError): reference: str - + def __init__(self, option: str, section: str, rawval: object, reference: str) -> None: ... class InterpolationSyntaxError(InterpolationError): ... - class ParsingError(Error): source: str - errors: Sequence[Tuple[int, str]] - + errors: List[Tuple[int, str]] + def __init__(self, source: Optional[str] = ..., filename: Optional[str] = ...) -> None: ... + def append(self, lineno: int, line: str) -> None: ... class MissingSectionHeaderError(ParsingError): lineno: int line: str + def __init__(self, filename: str, lineno: int, line: str) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/copyreg.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/copyreg.pyi old mode 100755 new mode 100644 index a64a82c7..a41f5e41 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/copyreg.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/copyreg.pyi @@ -1,13 +1,15 @@ - -from typing import TypeVar, Callable, Union, Tuple, Any, Optional, SupportsInt, Hashable, List - +from typing import Any, Callable, Hashable, List, Optional, SupportsInt, Tuple, TypeVar, Union _Type = TypeVar("_Type", bound=type) _Reduce = Union[Tuple[Callable[..., _Type], Tuple[Any, ...]], Tuple[Callable[..., _Type], Tuple[Any, ...], Optional[Any]]] __all__: List[str] -def pickle(ob_type: _Type, pickle_function: Callable[[_Type], Union[str, _Reduce[_Type]]], constructor_ob: Optional[Callable[[_Reduce[_Type]], _Type]] = ...) -> None: ... +def pickle( + ob_type: _Type, + pickle_function: Callable[[_Type], Union[str, _Reduce[_Type]]], + constructor_ob: Optional[Callable[[_Reduce[_Type]], _Type]] = ..., +) -> None: ... def constructor(object: Callable[[_Reduce[_Type]], _Type]) -> None: ... def add_extension(module: Hashable, name: Hashable, code: SupportsInt) -> None: ... def remove_extension(module: Hashable, name: Hashable, code: int) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/dbm/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/dbm/__init__.pyi new file mode 100644 index 00000000..2b870b38 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/dbm/__init__.pyi @@ -0,0 +1,24 @@ +from types import TracebackType +from typing import Iterator, MutableMapping, Optional, Type, Union +from typing_extensions import Literal + +_KeyType = Union[str, bytes] +_ValueType = Union[str, bytes] + +class _Database(MutableMapping[_KeyType, bytes]): + def close(self) -> None: ... + def __getitem__(self, key: _KeyType) -> bytes: ... + def __setitem__(self, key: _KeyType, value: _ValueType) -> None: ... + def __delitem__(self, key: _KeyType) -> None: ... + def __iter__(self) -> Iterator[bytes]: ... + def __len__(self) -> int: ... + def __del__(self) -> None: ... + def __enter__(self) -> _Database: ... + def __exit__( + self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType] + ) -> None: ... + +class error(Exception): ... + +def whichdb(filename: str) -> str: ... +def open(file: str, flag: Literal["r", "w", "c", "n"] = ..., mode: int = ...) -> _Database: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/dbm/dumb.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/dbm/dumb.pyi new file mode 100644 index 00000000..0b8ee50a --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/dbm/dumb.pyi @@ -0,0 +1,25 @@ +from types import TracebackType +from typing import Iterator, MutableMapping, Optional, Type, Union + +_KeyType = Union[str, bytes] +_ValueType = Union[str, bytes] + +error = OSError + +class _Database(MutableMapping[_KeyType, bytes]): + def __init__(self, filebasename: str, mode: str, flag: str = ...) -> None: ... + def sync(self) -> None: ... + def iterkeys(self) -> Iterator[bytes]: ... # undocumented + def close(self) -> None: ... + def __getitem__(self, key: _KeyType) -> bytes: ... + def __setitem__(self, key: _KeyType, value: _ValueType) -> None: ... + def __delitem__(self, key: _KeyType) -> None: ... + def __iter__(self) -> Iterator[bytes]: ... + def __len__(self) -> int: ... + def __del__(self) -> None: ... + def __enter__(self) -> _Database: ... + def __exit__( + self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType] + ) -> None: ... + +def open(file: str, flag: str = ..., mode: int = ...) -> _Database: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/dbm/gnu.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/dbm/gnu.pyi new file mode 100644 index 00000000..8f13a298 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/dbm/gnu.pyi @@ -0,0 +1,35 @@ +from types import TracebackType +from typing import List, Optional, Type, TypeVar, Union, overload + +_T = TypeVar("_T") +_KeyType = Union[str, bytes] +_ValueType = Union[str, bytes] + +class error(OSError): ... + +# Actual typename gdbm, not exposed by the implementation +class _gdbm: + def firstkey(self) -> Optional[bytes]: ... + def nextkey(self, key: _KeyType) -> Optional[bytes]: ... + def reorganize(self) -> None: ... + def sync(self) -> None: ... + def close(self) -> None: ... + def __getitem__(self, item: _KeyType) -> bytes: ... + def __setitem__(self, key: _KeyType, value: _ValueType) -> None: ... + def __delitem__(self, key: _KeyType) -> None: ... + def __len__(self) -> int: ... + def __enter__(self) -> _gdbm: ... + def __exit__( + self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType] + ) -> None: ... + @overload + def get(self, k: _KeyType) -> Optional[bytes]: ... + @overload + def get(self, k: _KeyType, default: Union[bytes, _T]) -> Union[bytes, _T]: ... + def keys(self) -> List[bytes]: ... + def setdefault(self, k: _KeyType, default: _ValueType = ...) -> bytes: ... + # Don't exist at runtime + __new__: None # type: ignore + __init__: None # type: ignore + +def open(__filename: str, __flags: str = ..., __mode: int = ...) -> _gdbm: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/dbm/ndbm.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/dbm/ndbm.pyi new file mode 100644 index 00000000..02013154 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/dbm/ndbm.pyi @@ -0,0 +1,34 @@ +from types import TracebackType +from typing import List, Optional, Type, TypeVar, Union, overload + +_T = TypeVar("_T") +_KeyType = Union[str, bytes] +_ValueType = Union[str, bytes] + +class error(OSError): ... + +library: str = ... + +# Actual typename dbm, not exposed by the implementation +class _dbm: + def close(self) -> None: ... + def __getitem__(self, item: _KeyType) -> bytes: ... + def __setitem__(self, key: _KeyType, value: _ValueType) -> None: ... + def __delitem__(self, key: _KeyType) -> None: ... + def __len__(self) -> int: ... + def __del__(self) -> None: ... + def __enter__(self) -> _dbm: ... + def __exit__( + self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType] + ) -> None: ... + @overload + def get(self, k: _KeyType) -> Optional[bytes]: ... + @overload + def get(self, k: _KeyType, default: Union[bytes, _T]) -> Union[bytes, _T]: ... + def keys(self) -> List[bytes]: ... + def setdefault(self, k: _KeyType, default: _ValueType = ...) -> bytes: ... + # Don't exist at runtime + __new__: None # type: ignore + __init__: None # type: ignore + +def open(__filename: str, __flags: str = ..., __mode: int = ...) -> _dbm: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/archive_util.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/archive_util.pyi new file mode 100644 index 00000000..0e94d381 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/archive_util.pyi @@ -0,0 +1,12 @@ +from typing import Optional + +def make_archive( + base_name: str, + format: str, + root_dir: Optional[str] = ..., + base_dir: Optional[str] = ..., + verbose: int = ..., + dry_run: int = ..., +) -> str: ... +def make_tarball(base_name: str, base_dir: str, compress: Optional[str] = ..., verbose: int = ..., dry_run: int = ...) -> str: ... +def make_zipfile(base_name: str, base_dir: str, verbose: int = ..., dry_run: int = ...) -> str: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/bcppcompiler.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/bcppcompiler.pyi new file mode 100644 index 00000000..3e432f94 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/bcppcompiler.pyi @@ -0,0 +1,3 @@ +from distutils.ccompiler import CCompiler + +class BCPPCompiler(CCompiler): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/ccompiler.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/ccompiler.pyi new file mode 100644 index 00000000..831311d2 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/ccompiler.pyi @@ -0,0 +1,150 @@ +from typing import Any, Callable, List, Optional, Tuple, Union + +_Macro = Union[Tuple[str], Tuple[str, Optional[str]]] + +def gen_lib_options( + compiler: CCompiler, library_dirs: List[str], runtime_library_dirs: List[str], libraries: List[str] +) -> List[str]: ... +def gen_preprocess_options(macros: List[_Macro], include_dirs: List[str]) -> List[str]: ... +def get_default_compiler(osname: Optional[str] = ..., platform: Optional[str] = ...) -> str: ... +def new_compiler( + plat: Optional[str] = ..., compiler: Optional[str] = ..., verbose: int = ..., dry_run: int = ..., force: int = ... +) -> CCompiler: ... +def show_compilers() -> None: ... + +class CCompiler: + dry_run: bool + force: bool + verbose: bool + output_dir: Optional[str] + macros: List[_Macro] + include_dirs: List[str] + libraries: List[str] + library_dirs: List[str] + runtime_library_dirs: List[str] + objects: List[str] + def __init__(self, verbose: int = ..., dry_run: int = ..., force: int = ...) -> None: ... + def add_include_dir(self, dir: str) -> None: ... + def set_include_dirs(self, dirs: List[str]) -> None: ... + def add_library(self, libname: str) -> None: ... + def set_libraries(self, libnames: List[str]) -> None: ... + def add_library_dir(self, dir: str) -> None: ... + def set_library_dirs(self, dirs: List[str]) -> None: ... + def add_runtime_library_dir(self, dir: str) -> None: ... + def set_runtime_library_dirs(self, dirs: List[str]) -> None: ... + def define_macro(self, name: str, value: Optional[str] = ...) -> None: ... + def undefine_macro(self, name: str) -> None: ... + def add_link_object(self, object: str) -> None: ... + def set_link_objects(self, objects: List[str]) -> None: ... + def detect_language(self, sources: Union[str, List[str]]) -> Optional[str]: ... + def find_library_file(self, dirs: List[str], lib: str, debug: bool = ...) -> Optional[str]: ... + def has_function( + self, + funcname: str, + includes: Optional[List[str]] = ..., + include_dirs: Optional[List[str]] = ..., + libraries: Optional[List[str]] = ..., + library_dirs: Optional[List[str]] = ..., + ) -> bool: ... + def library_dir_option(self, dir: str) -> str: ... + def library_option(self, lib: str) -> str: ... + def runtime_library_dir_option(self, dir: str) -> str: ... + def set_executables(self, **args: str) -> None: ... + def compile( + self, + sources: List[str], + output_dir: Optional[str] = ..., + macros: Optional[_Macro] = ..., + include_dirs: Optional[List[str]] = ..., + debug: bool = ..., + extra_preargs: Optional[List[str]] = ..., + extra_postargs: Optional[List[str]] = ..., + depends: Optional[List[str]] = ..., + ) -> List[str]: ... + def create_static_lib( + self, + objects: List[str], + output_libname: str, + output_dir: Optional[str] = ..., + debug: bool = ..., + target_lang: Optional[str] = ..., + ) -> None: ... + def link( + self, + target_desc: str, + objects: List[str], + output_filename: str, + output_dir: Optional[str] = ..., + libraries: Optional[List[str]] = ..., + library_dirs: Optional[List[str]] = ..., + runtime_library_dirs: Optional[List[str]] = ..., + export_symbols: Optional[List[str]] = ..., + debug: bool = ..., + extra_preargs: Optional[List[str]] = ..., + extra_postargs: Optional[List[str]] = ..., + build_temp: Optional[str] = ..., + target_lang: Optional[str] = ..., + ) -> None: ... + def link_executable( + self, + objects: List[str], + output_progname: str, + output_dir: Optional[str] = ..., + libraries: Optional[List[str]] = ..., + library_dirs: Optional[List[str]] = ..., + runtime_library_dirs: Optional[List[str]] = ..., + debug: bool = ..., + extra_preargs: Optional[List[str]] = ..., + extra_postargs: Optional[List[str]] = ..., + target_lang: Optional[str] = ..., + ) -> None: ... + def link_shared_lib( + self, + objects: List[str], + output_libname: str, + output_dir: Optional[str] = ..., + libraries: Optional[List[str]] = ..., + library_dirs: Optional[List[str]] = ..., + runtime_library_dirs: Optional[List[str]] = ..., + export_symbols: Optional[List[str]] = ..., + debug: bool = ..., + extra_preargs: Optional[List[str]] = ..., + extra_postargs: Optional[List[str]] = ..., + build_temp: Optional[str] = ..., + target_lang: Optional[str] = ..., + ) -> None: ... + def link_shared_object( + self, + objects: List[str], + output_filename: str, + output_dir: Optional[str] = ..., + libraries: Optional[List[str]] = ..., + library_dirs: Optional[List[str]] = ..., + runtime_library_dirs: Optional[List[str]] = ..., + export_symbols: Optional[List[str]] = ..., + debug: bool = ..., + extra_preargs: Optional[List[str]] = ..., + extra_postargs: Optional[List[str]] = ..., + build_temp: Optional[str] = ..., + target_lang: Optional[str] = ..., + ) -> None: ... + def preprocess( + self, + source: str, + output_file: Optional[str] = ..., + macros: Optional[List[_Macro]] = ..., + include_dirs: Optional[List[str]] = ..., + extra_preargs: Optional[List[str]] = ..., + extra_postargs: Optional[List[str]] = ..., + ) -> None: ... + def executable_filename(self, basename: str, strip_dir: int = ..., output_dir: str = ...) -> str: ... + def library_filename(self, libname: str, lib_type: str = ..., strip_dir: int = ..., output_dir: str = ...) -> str: ... + def object_filenames(self, source_filenames: List[str], strip_dir: int = ..., output_dir: str = ...) -> List[str]: ... + def shared_object_filename(self, basename: str, strip_dir: int = ..., output_dir: str = ...) -> str: ... + def execute(self, func: Callable[..., None], args: Tuple[Any, ...], msg: Optional[str] = ..., level: int = ...) -> None: ... + def spawn(self, cmd: List[str]) -> None: ... + def mkpath(self, name: str, mode: int = ...) -> None: ... + def move_file(self, src: str, dst: str) -> str: ... + def announce(self, msg: str, level: int = ...) -> None: ... + def warn(self, msg: str) -> None: ... + def debug_print(self, msg: str) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/cmd.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/cmd.pyi new file mode 100644 index 00000000..93bfc7c9 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/cmd.pyi @@ -0,0 +1,67 @@ +from abc import abstractmethod +from distutils.dist import Distribution +from typing import Any, Callable, Iterable, List, Optional, Tuple, Union + +class Command: + sub_commands: List[Tuple[str, Optional[Callable[[Command], bool]]]] + def __init__(self, dist: Distribution) -> None: ... + @abstractmethod + def initialize_options(self) -> None: ... + @abstractmethod + def finalize_options(self) -> None: ... + @abstractmethod + def run(self) -> None: ... + def announce(self, msg: str, level: int = ...) -> None: ... + def debug_print(self, msg: str) -> None: ... + def ensure_string(self, option: str, default: Optional[str] = ...) -> None: ... + def ensure_string_list(self, option: Union[str, List[str]]) -> None: ... + def ensure_filename(self, option: str) -> None: ... + def ensure_dirname(self, option: str) -> None: ... + def get_command_name(self) -> str: ... + def set_undefined_options(self, src_cmd: str, *option_pairs: Tuple[str, str]) -> None: ... + def get_finalized_command(self, command: str, create: int = ...) -> Command: ... + def reinitialize_command(self, command: Union[Command, str], reinit_subcommands: int = ...) -> Command: ... + def run_command(self, command: str) -> None: ... + def get_sub_commands(self) -> List[str]: ... + def warn(self, msg: str) -> None: ... + def execute(self, func: Callable[..., Any], args: Iterable[Any], msg: Optional[str] = ..., level: int = ...) -> None: ... + def mkpath(self, name: str, mode: int = ...) -> None: ... + def copy_file( + self, + infile: str, + outfile: str, + preserve_mode: int = ..., + preserve_times: int = ..., + link: Optional[str] = ..., + level: Any = ..., + ) -> Tuple[str, bool]: ... # level is not used + def copy_tree( + self, + infile: str, + outfile: str, + preserve_mode: int = ..., + preserve_times: int = ..., + preserve_symlinks: int = ..., + level: Any = ..., + ) -> List[str]: ... # level is not used + def move_file(self, src: str, dst: str, level: Any = ...) -> str: ... # level is not used + def spawn(self, cmd: Iterable[str], search_path: int = ..., level: Any = ...) -> None: ... # level is not used + def make_archive( + self, + base_name: str, + format: str, + root_dir: Optional[str] = ..., + base_dir: Optional[str] = ..., + owner: Optional[str] = ..., + group: Optional[str] = ..., + ) -> str: ... + def make_file( + self, + infiles: Union[str, List[str], Tuple[str]], + outfile: str, + func: Callable[..., Any], + args: List[Any], + exec_msg: Optional[str] = ..., + skip_msg: Optional[str] = ..., + level: Any = ..., + ) -> None: ... # level is not used diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/bdist.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/bdist.pyi new file mode 100644 index 00000000..e69de29b diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/bdist_dumb.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/bdist_dumb.pyi new file mode 100644 index 00000000..e69de29b diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/bdist_msi.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/bdist_msi.pyi new file mode 100644 index 00000000..a7617920 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/bdist_msi.pyi @@ -0,0 +1,6 @@ +from distutils.cmd import Command + +class bdist_msi(Command): + def initialize_options(self) -> None: ... + def finalize_options(self) -> None: ... + def run(self) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/bdist_packager.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/bdist_packager.pyi new file mode 100644 index 00000000..e69de29b diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/bdist_rpm.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/bdist_rpm.pyi new file mode 100644 index 00000000..e69de29b diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/bdist_wininst.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/bdist_wininst.pyi new file mode 100644 index 00000000..e69de29b diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/build.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/build.pyi new file mode 100644 index 00000000..e69de29b diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/build_clib.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/build_clib.pyi new file mode 100644 index 00000000..e69de29b diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/build_ext.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/build_ext.pyi new file mode 100644 index 00000000..e69de29b diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/build_py.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/build_py.pyi new file mode 100644 index 00000000..4e8c9af4 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/build_py.pyi @@ -0,0 +1,8 @@ +from distutils.cmd import Command + +class build_py(Command): + def initialize_options(self) -> None: ... + def finalize_options(self) -> None: ... + def run(self) -> None: ... + +class build_py_2to3(build_py): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/build_scripts.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/build_scripts.pyi new file mode 100644 index 00000000..e69de29b diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/check.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/check.pyi new file mode 100644 index 00000000..e69de29b diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/clean.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/clean.pyi new file mode 100644 index 00000000..e69de29b diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/config.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/config.pyi new file mode 100644 index 00000000..6b57a64b --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/config.pyi @@ -0,0 +1,87 @@ +from distutils import log as log +from distutils.ccompiler import CCompiler +from distutils.core import Command as Command +from distutils.errors import DistutilsExecError as DistutilsExecError +from distutils.sysconfig import customize_compiler as customize_compiler +from typing import Dict, List, Optional, Pattern, Sequence, Tuple, Union + +LANG_EXT: Dict[str, str] + +class config(Command): + description: str = ... + # Tuple is full name, short name, description + user_options: Sequence[Tuple[str, Optional[str], str]] = ... + compiler: Optional[Union[str, CCompiler]] = ... + cc: Optional[str] = ... + include_dirs: Optional[Sequence[str]] = ... + libraries: Optional[Sequence[str]] = ... + library_dirs: Optional[Sequence[str]] = ... + noisy: int = ... + dump_source: int = ... + temp_files: Sequence[str] = ... + def initialize_options(self) -> None: ... + def finalize_options(self) -> None: ... + def run(self) -> None: ... + def try_cpp( + self, + body: Optional[str] = ..., + headers: Optional[Sequence[str]] = ..., + include_dirs: Optional[Sequence[str]] = ..., + lang: str = ..., + ) -> bool: ... + def search_cpp( + self, + pattern: Union[Pattern[str], str], + body: Optional[str] = ..., + headers: Optional[Sequence[str]] = ..., + include_dirs: Optional[Sequence[str]] = ..., + lang: str = ..., + ) -> bool: ... + def try_compile( + self, body: str, headers: Optional[Sequence[str]] = ..., include_dirs: Optional[Sequence[str]] = ..., lang: str = ... + ) -> bool: ... + def try_link( + self, + body: str, + headers: Optional[Sequence[str]] = ..., + include_dirs: Optional[Sequence[str]] = ..., + libraries: Optional[Sequence[str]] = ..., + library_dirs: Optional[Sequence[str]] = ..., + lang: str = ..., + ) -> bool: ... + def try_run( + self, + body: str, + headers: Optional[Sequence[str]] = ..., + include_dirs: Optional[Sequence[str]] = ..., + libraries: Optional[Sequence[str]] = ..., + library_dirs: Optional[Sequence[str]] = ..., + lang: str = ..., + ) -> bool: ... + def check_func( + self, + func: str, + headers: Optional[Sequence[str]] = ..., + include_dirs: Optional[Sequence[str]] = ..., + libraries: Optional[Sequence[str]] = ..., + library_dirs: Optional[Sequence[str]] = ..., + decl: int = ..., + call: int = ..., + ) -> bool: ... + def check_lib( + self, + library: str, + library_dirs: Optional[Sequence[str]] = ..., + headers: Optional[Sequence[str]] = ..., + include_dirs: Optional[Sequence[str]] = ..., + other_libraries: List[str] = ..., + ) -> bool: ... + def check_header( + self, + header: str, + include_dirs: Optional[Sequence[str]] = ..., + library_dirs: Optional[Sequence[str]] = ..., + lang: str = ..., + ) -> bool: ... + +def dump_file(filename: str, head: Optional[str] = ...) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/install.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/install.pyi new file mode 100644 index 00000000..12e83d97 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/install.pyi @@ -0,0 +1,14 @@ +from distutils.cmd import Command +from typing import Optional, Tuple + +SCHEME_KEYS: Tuple[str, ...] + +class install(Command): + user: bool + prefix: Optional[str] + home: Optional[str] + root: Optional[str] + install_lib: Optional[str] + def initialize_options(self) -> None: ... + def finalize_options(self) -> None: ... + def run(self) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/install_data.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/install_data.pyi new file mode 100644 index 00000000..e69de29b diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/install_egg_info.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/install_egg_info.pyi new file mode 100644 index 00000000..80ffb19b --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/install_egg_info.pyi @@ -0,0 +1,10 @@ +from distutils.cmd import Command +from typing import ClassVar, List, Optional, Tuple + +class install_egg_info(Command): + description: ClassVar[str] + user_options: ClassVar[List[Tuple[str, Optional[str], str]]] + def initialize_options(self) -> None: ... + def finalize_options(self) -> None: ... + def run(self) -> None: ... + def get_outputs(self) -> List[str]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/install_headers.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/install_headers.pyi new file mode 100644 index 00000000..e69de29b diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/install_lib.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/install_lib.pyi new file mode 100644 index 00000000..e69de29b diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/install_scripts.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/install_scripts.pyi new file mode 100644 index 00000000..e69de29b diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/register.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/register.pyi new file mode 100644 index 00000000..e69de29b diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/sdist.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/sdist.pyi new file mode 100644 index 00000000..e69de29b diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/upload.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/upload.pyi new file mode 100644 index 00000000..a30fabb1 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/command/upload.pyi @@ -0,0 +1,8 @@ +from distutils.config import PyPIRCCommand +from typing import ClassVar, List + +class upload(PyPIRCCommand): + description: ClassVar[str] + boolean_options: ClassVar[List[str]] + def run(self) -> None: ... + def upload_file(self, command, pyversion, filename) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/config.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/config.pyi new file mode 100644 index 00000000..e60507e0 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/config.pyi @@ -0,0 +1,17 @@ +from abc import abstractmethod +from distutils.cmd import Command +from typing import ClassVar, List, Optional, Tuple + +DEFAULT_PYPIRC: str + +class PyPIRCCommand(Command): + DEFAULT_REPOSITORY: ClassVar[str] + DEFAULT_REALM: ClassVar[str] + repository: None + realm: None + user_options: ClassVar[List[Tuple[str, Optional[str], str]]] + boolean_options: ClassVar[List[str]] + def initialize_options(self) -> None: ... + def finalize_options(self) -> None: ... + @abstractmethod + def run(self) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/core.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/core.pyi new file mode 100644 index 00000000..9a3fa70f --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/core.pyi @@ -0,0 +1,48 @@ +from distutils.cmd import Command as Command +from distutils.dist import Distribution as Distribution +from distutils.extension import Extension as Extension +from typing import Any, List, Mapping, Optional, Tuple, Type, Union + +def setup( + *, + name: str = ..., + version: str = ..., + description: str = ..., + long_description: str = ..., + author: str = ..., + author_email: str = ..., + maintainer: str = ..., + maintainer_email: str = ..., + url: str = ..., + download_url: str = ..., + packages: List[str] = ..., + py_modules: List[str] = ..., + scripts: List[str] = ..., + ext_modules: List[Extension] = ..., + classifiers: List[str] = ..., + distclass: Type[Distribution] = ..., + script_name: str = ..., + script_args: List[str] = ..., + options: Mapping[str, Any] = ..., + license: str = ..., + keywords: Union[List[str], str] = ..., + platforms: Union[List[str], str] = ..., + cmdclass: Mapping[str, Type[Command]] = ..., + data_files: List[Tuple[str, List[str]]] = ..., + package_dir: Mapping[str, str] = ..., + obsoletes: List[str] = ..., + provides: List[str] = ..., + requires: List[str] = ..., + command_packages: List[str] = ..., + command_options: Mapping[str, Mapping[str, Tuple[Any, Any]]] = ..., + package_data: Mapping[str, List[str]] = ..., + include_package_data: bool = ..., + libraries: List[str] = ..., + headers: List[str] = ..., + ext_package: str = ..., + include_dirs: List[str] = ..., + password: str = ..., + fullname: str = ..., + **attrs: Any, +) -> None: ... +def run_setup(script_name: str, script_args: Optional[List[str]] = ..., stop_after: str = ...) -> Distribution: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/cygwinccompiler.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/cygwinccompiler.pyi new file mode 100644 index 00000000..1f85b254 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/cygwinccompiler.pyi @@ -0,0 +1,4 @@ +from distutils.unixccompiler import UnixCCompiler + +class CygwinCCompiler(UnixCCompiler): ... +class Mingw32CCompiler(CygwinCCompiler): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/debug.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/debug.pyi new file mode 100644 index 00000000..098dc3de --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/debug.pyi @@ -0,0 +1 @@ +DEBUG: bool diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/dep_util.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/dep_util.pyi new file mode 100644 index 00000000..6f779d54 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/dep_util.pyi @@ -0,0 +1,5 @@ +from typing import List, Tuple + +def newer(source: str, target: str) -> bool: ... +def newer_pairwise(sources: List[str], targets: List[str]) -> List[Tuple[str, str]]: ... +def newer_group(sources: List[str], target: str, missing: str = ...) -> bool: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/dir_util.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/dir_util.pyi new file mode 100644 index 00000000..4c4a2210 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/dir_util.pyi @@ -0,0 +1,15 @@ +from typing import List + +def mkpath(name: str, mode: int = ..., verbose: int = ..., dry_run: int = ...) -> List[str]: ... +def create_tree(base_dir: str, files: List[str], mode: int = ..., verbose: int = ..., dry_run: int = ...) -> None: ... +def copy_tree( + src: str, + dst: str, + preserve_mode: int = ..., + preserve_times: int = ..., + preserve_symlinks: int = ..., + update: int = ..., + verbose: int = ..., + dry_run: int = ..., +) -> List[str]: ... +def remove_tree(directory: str, verbose: int = ..., dry_run: int = ...) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/dist.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/dist.pyi new file mode 100644 index 00000000..d3acdafb --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/dist.pyi @@ -0,0 +1,58 @@ +from _typeshed import AnyPath, SupportsWrite +from distutils.cmd import Command +from typing import IO, Any, Dict, Iterable, List, Mapping, Optional, Tuple, Type, Union + +class DistributionMetadata: + def __init__(self, path: Optional[Union[int, AnyPath]] = ...) -> None: ... + name: Optional[str] + version: Optional[str] + author: Optional[str] + author_email: Optional[str] + maintainer: Optional[str] + maintainer_email: Optional[str] + url: Optional[str] + license: Optional[str] + description: Optional[str] + long_description: Optional[str] + keywords: Optional[Union[str, List[str]]] + platforms: Optional[Union[str, List[str]]] + classifiers: Optional[Union[str, List[str]]] + download_url: Optional[str] + provides: Optional[List[str]] + requires: Optional[List[str]] + obsoletes: Optional[List[str]] + def read_pkg_file(self, file: IO[str]) -> None: ... + def write_pkg_info(self, base_dir: str) -> None: ... + def write_pkg_file(self, file: SupportsWrite[str]) -> None: ... + def get_name(self) -> str: ... + def get_version(self) -> str: ... + def get_fullname(self) -> str: ... + def get_author(self) -> str: ... + def get_author_email(self) -> str: ... + def get_maintainer(self) -> str: ... + def get_maintainer_email(self) -> str: ... + def get_contact(self) -> str: ... + def get_contact_email(self) -> str: ... + def get_url(self) -> str: ... + def get_license(self) -> str: ... + def get_licence(self) -> str: ... + def get_description(self) -> str: ... + def get_long_description(self) -> str: ... + def get_keywords(self) -> Union[str, List[str]]: ... + def get_platforms(self) -> Union[str, List[str]]: ... + def get_classifiers(self) -> Union[str, List[str]]: ... + def get_download_url(self) -> str: ... + def get_requires(self) -> List[str]: ... + def set_requires(self, value: Iterable[str]) -> None: ... + def get_provides(self) -> List[str]: ... + def set_provides(self, value: Iterable[str]) -> None: ... + def get_obsoletes(self) -> List[str]: ... + def set_obsoletes(self, value: Iterable[str]) -> None: ... + +class Distribution: + cmdclass: Dict[str, Type[Command]] + metadata: DistributionMetadata + def __init__(self, attrs: Optional[Mapping[str, Any]] = ...) -> None: ... + def get_option_dict(self, command: str) -> Dict[str, Tuple[str, str]]: ... + def parse_config_files(self, filenames: Optional[Iterable[str]] = ...) -> None: ... + def get_command_obj(self, command: str, create: bool = ...) -> Optional[Command]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/errors.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/errors.pyi new file mode 100644 index 00000000..e483362b --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/errors.pyi @@ -0,0 +1,19 @@ +class DistutilsError(Exception): ... +class DistutilsModuleError(DistutilsError): ... +class DistutilsClassError(DistutilsError): ... +class DistutilsGetoptError(DistutilsError): ... +class DistutilsArgError(DistutilsError): ... +class DistutilsFileError(DistutilsError): ... +class DistutilsOptionError(DistutilsError): ... +class DistutilsSetupError(DistutilsError): ... +class DistutilsPlatformError(DistutilsError): ... +class DistutilsExecError(DistutilsError): ... +class DistutilsInternalError(DistutilsError): ... +class DistutilsTemplateError(DistutilsError): ... +class DistutilsByteCompileError(DistutilsError): ... +class CCompilerError(Exception): ... +class PreprocessError(CCompilerError): ... +class CompileError(CCompilerError): ... +class LibError(CCompilerError): ... +class LinkError(CCompilerError): ... +class UnknownFileError(CCompilerError): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/extension.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/extension.pyi new file mode 100644 index 00000000..c85128ab --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/extension.pyi @@ -0,0 +1,22 @@ +from typing import List, Optional, Tuple + +class Extension: + def __init__( + self, + name: str, + sources: List[str], + include_dirs: List[str] = ..., + define_macros: List[Tuple[str, Optional[str]]] = ..., + undef_macros: List[str] = ..., + library_dirs: List[str] = ..., + libraries: List[str] = ..., + runtime_library_dirs: List[str] = ..., + extra_objects: List[str] = ..., + extra_compile_args: List[str] = ..., + extra_link_args: List[str] = ..., + export_symbols: List[str] = ..., + swig_opts: Optional[str] = ..., # undocumented + depends: List[str] = ..., + language: str = ..., + optional: bool = ..., + ) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/fancy_getopt.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/fancy_getopt.pyi new file mode 100644 index 00000000..8eb4c416 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/fancy_getopt.pyi @@ -0,0 +1,21 @@ +from typing import Any, List, Mapping, Optional, Tuple, Union, overload + +_Option = Tuple[str, Optional[str], str] +_GR = Tuple[List[str], OptionDummy] + +def fancy_getopt( + options: List[_Option], negative_opt: Mapping[_Option, _Option], object: Any, args: Optional[List[str]] +) -> Union[List[str], _GR]: ... +def wrap_text(text: str, width: int) -> List[str]: ... + +class FancyGetopt: + def __init__(self, option_table: Optional[List[_Option]] = ...) -> None: ... + # TODO kinda wrong, `getopt(object=object())` is invalid + @overload + def getopt(self, args: Optional[List[str]] = ...) -> _GR: ... + @overload + def getopt(self, args: Optional[List[str]], object: Any) -> List[str]: ... + def get_option_order(self) -> List[Tuple[str, str]]: ... + def generate_help(self, header: Optional[str] = ...) -> List[str]: ... + +class OptionDummy: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/file_util.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/file_util.pyi new file mode 100644 index 00000000..01833973 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/file_util.pyi @@ -0,0 +1,14 @@ +from typing import Optional, Sequence, Tuple + +def copy_file( + src: str, + dst: str, + preserve_mode: bool = ..., + preserve_times: bool = ..., + update: bool = ..., + link: Optional[str] = ..., + verbose: bool = ..., + dry_run: bool = ..., +) -> Tuple[str, str]: ... +def move_file(src: str, dst: str, verbose: bool = ..., dry_run: bool = ...) -> str: ... +def write_file(filename: str, contents: Sequence[str]) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/filelist.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/filelist.pyi new file mode 100644 index 00000000..8fa55d09 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/filelist.pyi @@ -0,0 +1 @@ +class FileList: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/log.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/log.pyi new file mode 100644 index 00000000..549b569e --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/log.pyi @@ -0,0 +1,25 @@ +from typing import Any + +DEBUG: int +INFO: int +WARN: int +ERROR: int +FATAL: int + +class Log: + def __init__(self, threshold: int = ...) -> None: ... + def log(self, level: int, msg: str, *args: Any) -> None: ... + def debug(self, msg: str, *args: Any) -> None: ... + def info(self, msg: str, *args: Any) -> None: ... + def warn(self, msg: str, *args: Any) -> None: ... + def error(self, msg: str, *args: Any) -> None: ... + def fatal(self, msg: str, *args: Any) -> None: ... + +def log(level: int, msg: str, *args: Any) -> None: ... +def debug(msg: str, *args: Any) -> None: ... +def info(msg: str, *args: Any) -> None: ... +def warn(msg: str, *args: Any) -> None: ... +def error(msg: str, *args: Any) -> None: ... +def fatal(msg: str, *args: Any) -> None: ... +def set_threshold(level: int) -> int: ... +def set_verbosity(v: int) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/msvccompiler.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/msvccompiler.pyi new file mode 100644 index 00000000..80872a6b --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/msvccompiler.pyi @@ -0,0 +1,3 @@ +from distutils.ccompiler import CCompiler + +class MSVCCompiler(CCompiler): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/spawn.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/spawn.pyi new file mode 100644 index 00000000..e12eae99 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/spawn.pyi @@ -0,0 +1,4 @@ +from typing import List, Optional + +def spawn(cmd: List[str], search_path: bool = ..., verbose: bool = ..., dry_run: bool = ...) -> None: ... +def find_executable(executable: str, path: Optional[str] = ...) -> Optional[str]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/sysconfig.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/sysconfig.pyi new file mode 100644 index 00000000..9061db75 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/sysconfig.pyi @@ -0,0 +1,14 @@ +from distutils.ccompiler import CCompiler +from typing import Mapping, Optional, Union + +PREFIX: str +EXEC_PREFIX: str + +def get_config_var(name: str) -> Union[int, str, None]: ... +def get_config_vars(*args: str) -> Mapping[str, Union[int, str]]: ... +def get_config_h_filename() -> str: ... +def get_makefile_filename() -> str: ... +def get_python_inc(plat_specific: bool = ..., prefix: Optional[str] = ...) -> str: ... +def get_python_lib(plat_specific: bool = ..., standard_lib: bool = ..., prefix: Optional[str] = ...) -> str: ... +def customize_compiler(compiler: CCompiler) -> None: ... +def set_python_build() -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/text_file.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/text_file.pyi new file mode 100644 index 00000000..9872a1f2 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/text_file.pyi @@ -0,0 +1,21 @@ +from typing import IO, List, Optional, Tuple, Union + +class TextFile: + def __init__( + self, + filename: Optional[str] = ..., + file: Optional[IO[str]] = ..., + *, + strip_comments: bool = ..., + lstrip_ws: bool = ..., + rstrip_ws: bool = ..., + skip_blanks: bool = ..., + join_lines: bool = ..., + collapse_join: bool = ..., + ) -> None: ... + def open(self, filename: str) -> None: ... + def close(self) -> None: ... + def warn(self, msg: str, line: Union[List[int], Tuple[int, int], int] = ...) -> None: ... + def readline(self) -> Optional[str]: ... + def readlines(self) -> List[str]: ... + def unreadline(self, line: str) -> str: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/unixccompiler.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/unixccompiler.pyi new file mode 100644 index 00000000..e1d44347 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/unixccompiler.pyi @@ -0,0 +1,3 @@ +from distutils.ccompiler import CCompiler + +class UnixCCompiler(CCompiler): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/util.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/util.pyi new file mode 100644 index 00000000..0086d726 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/util.pyi @@ -0,0 +1,23 @@ +from typing import Any, Callable, List, Mapping, Optional, Tuple + +def get_platform() -> str: ... +def convert_path(pathname: str) -> str: ... +def change_root(new_root: str, pathname: str) -> str: ... +def check_environ() -> None: ... +def subst_vars(s: str, local_vars: Mapping[str, str]) -> None: ... +def split_quoted(s: str) -> List[str]: ... +def execute( + func: Callable[..., None], args: Tuple[Any, ...], msg: Optional[str] = ..., verbose: bool = ..., dry_run: bool = ... +) -> None: ... +def strtobool(val: str) -> bool: ... +def byte_compile( + py_files: List[str], + optimize: int = ..., + force: bool = ..., + prefix: Optional[str] = ..., + base_dir: Optional[str] = ..., + verbose: bool = ..., + dry_run: bool = ..., + direct: Optional[bool] = ..., +) -> None: ... +def rfc822_escape(header: str) -> str: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/version.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/version.pyi new file mode 100644 index 00000000..311b0bea --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/distutils/version.pyi @@ -0,0 +1,38 @@ +from abc import abstractmethod +from typing import Optional, Pattern, Tuple, TypeVar, Union + +_T = TypeVar("_T", bound=Version) + +class Version: + def __repr__(self) -> str: ... + def __eq__(self, other: object) -> bool: ... + def __lt__(self: _T, other: Union[_T, str]) -> bool: ... + def __le__(self: _T, other: Union[_T, str]) -> bool: ... + def __gt__(self: _T, other: Union[_T, str]) -> bool: ... + def __ge__(self: _T, other: Union[_T, str]) -> bool: ... + @abstractmethod + def __init__(self, vstring: Optional[str] = ...) -> None: ... + @abstractmethod + def parse(self: _T, vstring: str) -> _T: ... + @abstractmethod + def __str__(self) -> str: ... + @abstractmethod + def _cmp(self: _T, other: Union[_T, str]) -> bool: ... + +class StrictVersion(Version): + version_re: Pattern[str] + version: Tuple[int, int, int] + prerelease: Optional[Tuple[str, int]] + def __init__(self, vstring: Optional[str] = ...) -> None: ... + def parse(self: _T, vstring: str) -> _T: ... + def __str__(self) -> str: ... + def _cmp(self: _T, other: Union[_T, str]) -> bool: ... + +class LooseVersion(Version): + component_re: Pattern[str] + vstring: str + version: Tuple[Union[str, int], ...] + def __init__(self, vstring: Optional[str] = ...) -> None: ... + def parse(self: _T, vstring: str) -> _T: ... + def __str__(self) -> str: ... + def _cmp(self: _T, other: Union[_T, str]) -> bool: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/__init__.pyi old mode 100755 new mode 100644 index a69f188d..e2c22554 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/__init__.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/__init__.pyi @@ -1,8 +1,6 @@ -# Stubs for email (Python 3.4) - -from typing import Callable, IO from email.message import Message from email.policy import Policy +from typing import IO, Callable def message_from_string(s: str, _class: Callable[[], Message] = ..., *, policy: Policy = ...) -> Message: ... def message_from_bytes(s: bytes, _class: Callable[[], Message] = ..., *, policy: Policy = ...) -> Message: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/charset.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/charset.pyi old mode 100755 new mode 100644 index 3a6c19d1..7c8e8ae7 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/charset.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/charset.pyi @@ -1,6 +1,4 @@ -# Stubs for email.charset (Python 3.4) - -from typing import List, Optional, Iterator, Any +from typing import Any, Iterator, List, Optional QP: int # undocumented BASE64: int # undocumented @@ -17,15 +15,14 @@ class Charset: def get_body_encoding(self) -> str: ... def get_output_charset(self) -> Optional[str]: ... def header_encode(self, string: str) -> str: ... - def header_encode_lines(self, string: str, - maxlengths: Iterator[int]) -> List[str]: ... + def header_encode_lines(self, string: str, maxlengths: Iterator[int]) -> List[str]: ... def body_encode(self, string: str) -> str: ... def __str__(self) -> str: ... def __eq__(self, other: Any) -> bool: ... def __ne__(self, other: Any) -> bool: ... -def add_charset(charset: str, header_enc: Optional[int] = ..., - body_enc: Optional[int] = ..., - output_charset: Optional[str] = ...) -> None: ... +def add_charset( + charset: str, header_enc: Optional[int] = ..., body_enc: Optional[int] = ..., output_charset: Optional[str] = ... +) -> None: ... def add_alias(alias: str, canonical: str) -> None: ... def add_codec(charset: str, codecname: str) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/contentmanager.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/contentmanager.pyi old mode 100755 new mode 100644 index ed55ef67..68fe99c8 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/contentmanager.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/contentmanager.pyi @@ -1,15 +1,11 @@ -# Stubs for email.contentmanager (Python 3.4) - -from typing import Any, Callable from email.message import Message +from typing import Any, Callable class ContentManager: def __init__(self) -> None: ... def get_content(self, msg: Message, *args: Any, **kw: Any) -> Any: ... - def set_content(self, msg: Message, obj: Any, *args: Any, - **kw: Any) -> Any: ... + def set_content(self, msg: Message, obj: Any, *args: Any, **kw: Any) -> Any: ... def add_get_handler(self, key: str, handler: Callable[..., Any]) -> None: ... - def add_set_handler(self, typekey: type, - handler: Callable[..., Any]) -> None: ... + def add_set_handler(self, typekey: type, handler: Callable[..., Any]) -> None: ... raw_data_manager: ContentManager diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/encoders.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/encoders.pyi old mode 100755 new mode 100644 index bb5c84cb..e05225e8 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/encoders.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/encoders.pyi @@ -1,5 +1,3 @@ -# Stubs for email.encoders (Python 3.4) - from email.message import Message def encode_base64(msg: Message) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/errors.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/errors.pyi old mode 100755 new mode 100644 index 77d9902c..dd2b70b1 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/errors.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/errors.pyi @@ -1,19 +1,17 @@ -# Stubs for email.errors (Python 3.4) - class MessageError(Exception): ... class MessageParseError(MessageError): ... class HeaderParseError(MessageParseError): ... class BoundaryError(MessageParseError): ... class MultipartConversionError(MessageError, TypeError): ... - class MessageDefect(ValueError): ... class NoBoundaryInMultipartDefect(MessageDefect): ... class StartBoundaryNotFoundDefect(MessageDefect): ... class FirstHeaderLineIsContinuationDefect(MessageDefect): ... class MisplacedEnvelopeHeaderDefect(MessageDefect): ... -class MalformedHeaderDefect(MessageDefect): ... class MultipartInvariantViolationDefect(MessageDefect): ... class InvalidBase64PaddingDefect(MessageDefect): ... class InvalidBase64CharactersDefect(MessageDefect): ... class CloseBoundaryNotFoundDefect(MessageDefect): ... class MissingHeaderBodySeparatorDefect(MessageDefect): ... + +MalformedHeaderDefect = MissingHeaderBodySeparatorDefect diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/feedparser.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/feedparser.pyi old mode 100755 new mode 100644 index facfd438..ffcf4f0a --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/feedparser.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/feedparser.pyi @@ -1,17 +1,21 @@ -# Stubs for email.feedparser (Python 3.4) - -from typing import Callable from email.message import Message from email.policy import Policy +from typing import Callable, Generic, TypeVar, overload -class FeedParser: - def __init__(self, _factory: Callable[[], Message] = ..., *, - policy: Policy = ...) -> None: ... - def feed(self, data: str) -> None: ... - def close(self) -> Message: ... +_M = TypeVar("_M", bound=Message) -class BytesFeedParser: - def __init__(self, _factory: Callable[[], Message] = ..., *, - policy: Policy = ...) -> None: ... +class FeedParser(Generic[_M]): + @overload + def __init__(self: FeedParser[Message], _factory: None = ..., *, policy: Policy = ...) -> None: ... + @overload + def __init__(self, _factory: Callable[[], _M], *, policy: Policy = ...) -> None: ... def feed(self, data: str) -> None: ... - def close(self) -> Message: ... + def close(self) -> _M: ... + +class BytesFeedParser(Generic[_M]): + @overload + def __init__(self: BytesFeedParser[Message], _factory: None = ..., *, policy: Policy = ...) -> None: ... + @overload + def __init__(self, _factory: Callable[[], _M], *, policy: Policy = ...) -> None: ... + def feed(self, data: bytes) -> None: ... + def close(self) -> _M: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/generator.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/generator.pyi old mode 100755 new mode 100644 index 2cf3942d..ff0c2d90 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/generator.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/generator.pyi @@ -1,27 +1,18 @@ -# Stubs for email.generator (Python 3.4) - -from typing import BinaryIO, TextIO, Optional from email.message import Message from email.policy import Policy +from typing import BinaryIO, Optional, TextIO class Generator: def clone(self, fp: TextIO) -> Generator: ... def write(self, s: str) -> None: ... - def __init__(self, outfp: TextIO, mangle_from_: bool = ..., - maxheaderlen: int = ..., *, - policy: Policy = ...) -> None: ... - def flatten(self, msg: Message, unixfrom: bool = ..., - linesep: Optional[str] = ...) -> None: ... + def __init__(self, outfp: TextIO, mangle_from_: bool = ..., maxheaderlen: int = ..., *, policy: Policy = ...) -> None: ... + def flatten(self, msg: Message, unixfrom: bool = ..., linesep: Optional[str] = ...) -> None: ... class BytesGenerator: def clone(self, fp: BinaryIO) -> BytesGenerator: ... def write(self, s: str) -> None: ... - def __init__(self, outfp: BinaryIO, mangle_from_: bool = ..., - maxheaderlen: int = ..., *, - policy: Policy = ...) -> None: ... - def flatten(self, msg: Message, unixfrom: bool = ..., - linesep: Optional[str] = ...) -> None: ... + def __init__(self, outfp: BinaryIO, mangle_from_: bool = ..., maxheaderlen: int = ..., *, policy: Policy = ...) -> None: ... + def flatten(self, msg: Message, unixfrom: bool = ..., linesep: Optional[str] = ...) -> None: ... class DecodedGenerator(Generator): - def __init__(self, outfp: TextIO, mangle_from_: bool = ..., - maxheaderlen: int = ..., *, fmt: Optional[str] = ...) -> None: ... + def __init__(self, outfp: TextIO, mangle_from_: bool = ..., maxheaderlen: int = ..., *, fmt: Optional[str] = ...) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/header.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/header.pyi old mode 100755 new mode 100644 index 21b99953..1a5e1a2e --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/header.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/header.pyi @@ -1,25 +1,26 @@ -# Stubs for email.header (Python 3.4) - -from typing import Union, Optional, Any, List, Tuple from email.charset import Charset +from typing import Any, List, Optional, Tuple, Union class Header: - def __init__(self, s: Union[bytes, str, None] = ..., - charset: Union[Charset, str, None] = ..., - maxlinelen: Optional[int] = ..., - header_name: Optional[str] = ..., continuation_ws: str = ..., - errors: str = ...) -> None: ... - def append(self, s: Union[bytes, str], - charset: Union[Charset, str, None] = ..., - errors: str = ...) -> None: ... - def encode(self, splitchars: str = ..., maxlinelen: Optional[int] = ..., - linesep: str = ...) -> str: ... + def __init__( + self, + s: Union[bytes, str, None] = ..., + charset: Union[Charset, str, None] = ..., + maxlinelen: Optional[int] = ..., + header_name: Optional[str] = ..., + continuation_ws: str = ..., + errors: str = ..., + ) -> None: ... + def append(self, s: Union[bytes, str], charset: Union[Charset, str, None] = ..., errors: str = ...) -> None: ... + def encode(self, splitchars: str = ..., maxlinelen: Optional[int] = ..., linesep: str = ...) -> str: ... def __str__(self) -> str: ... def __eq__(self, other: Any) -> bool: ... def __ne__(self, other: Any) -> bool: ... def decode_header(header: Union[Header, str]) -> List[Tuple[bytes, Optional[str]]]: ... -def make_header(decoded_seq: List[Tuple[bytes, Optional[str]]], - maxlinelen: Optional[int] = ..., - header_name: Optional[str] = ..., - continuation_ws: str = ...) -> Header: ... +def make_header( + decoded_seq: List[Tuple[bytes, Optional[str]]], + maxlinelen: Optional[int] = ..., + header_name: Optional[str] = ..., + continuation_ws: str = ..., +) -> Header: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/headerregistry.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/headerregistry.pyi old mode 100755 new mode 100644 index 6af1abfb..4ccb4d31 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/headerregistry.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/headerregistry.pyi @@ -1,9 +1,7 @@ -# Stubs for email.headerregistry (Python 3.4) - from datetime import datetime as _datetime -from typing import Dict, Tuple, Optional, Any, Union, Mapping from email.errors import MessageDefect from email.policy import Policy +from typing import Any, Dict, Mapping, Optional, Tuple, Union class BaseHeader(str): @property @@ -25,8 +23,7 @@ class UniqueUnstructuredHeader(UnstructuredHeader): ... class DateHeader: datetime: _datetime @classmethod - def parse(cls, string: Union[str, _datetime], - kwds: Dict[str, Any]) -> None: ... + def parse(cls, string: Union[str, _datetime], kwds: Dict[str, Any]) -> None: ... class UniqueDateHeader(DateHeader): ... @@ -70,9 +67,7 @@ class ContentTransferEncodingHeader: def parse(cls, string: str, kwds: Dict[str, Any]) -> None: ... class HeaderRegistry: - def __init__(self, base_class: BaseHeader = ..., - default_class: BaseHeader = ..., - use_default_map: bool = ...) -> None: ... + def __init__(self, base_class: BaseHeader = ..., default_class: BaseHeader = ..., use_default_map: bool = ...) -> None: ... def map_to_type(self, name: str, cls: BaseHeader) -> None: ... def __getitem__(self, name: str) -> BaseHeader: ... def __call__(self, name: str, value: Any) -> BaseHeader: ... @@ -83,15 +78,13 @@ class Address: domain: str @property def addr_spec(self) -> str: ... - def __init__(self, display_name: str = ..., - username: Optional[str] = ..., - domain: Optional[str] = ..., - addr_spec: Optional[str] = ...) -> None: ... + def __init__( + self, display_name: str = ..., username: Optional[str] = ..., domain: Optional[str] = ..., addr_spec: Optional[str] = ... + ) -> None: ... def __str__(self) -> str: ... class Group: display_name: Optional[str] addresses: Tuple[Address, ...] - def __init__(self, display_name: Optional[str] = ..., - addresses: Optional[Tuple[Address, ...]] = ...) -> None: ... + def __init__(self, display_name: Optional[str] = ..., addresses: Optional[Tuple[Address, ...]] = ...) -> None: ... def __str__(self) -> str: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/iterators.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/iterators.pyi old mode 100755 new mode 100644 index 6a69f39c..2b3d14c2 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/iterators.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/iterators.pyi @@ -1,8 +1,5 @@ -# Stubs for email.iterators (Python 3.4) - -from typing import Iterator, Optional from email.message import Message +from typing import Iterator, Optional def body_line_iterator(msg: Message, decode: bool = ...) -> Iterator[str]: ... -def typed_subpart_iterator(msg: Message, maintype: str = ..., - subtype: Optional[str] = ...) -> Iterator[str]: ... +def typed_subpart_iterator(msg: Message, maintype: str = ..., subtype: Optional[str] = ...) -> Iterator[str]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/message.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/message.pyi old mode 100755 new mode 100644 index 85bba630..720d5e5d --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/message.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/message.pyi @@ -1,15 +1,10 @@ -# Stubs for email.message (Python 3.4) - -from typing import ( - List, Optional, Union, Tuple, TypeVar, Generator, Sequence, Iterator, Any -) from email.charset import Charset +from email.contentmanager import ContentManager from email.errors import MessageDefect -from email.header import Header from email.policy import Policy -from email.contentmanager import ContentManager +from typing import Any, Generator, Iterator, List, Optional, Sequence, Tuple, TypeVar, Union -_T = TypeVar('_T') +_T = TypeVar("_T") _PayloadType = Union[List[Message], str, bytes] _CharsetType = Union[Charset, str, None] @@ -27,8 +22,7 @@ class Message: def get_unixfrom(self) -> Optional[str]: ... def attach(self, payload: Message) -> None: ... def get_payload(self, i: int = ..., decode: bool = ...) -> Any: ... # returns Optional[_PayloadType] - def set_payload(self, payload: _PayloadType, - charset: _CharsetType = ...) -> None: ... + def set_payload(self, payload: _PayloadType, charset: _CharsetType = ...) -> None: ... def set_charset(self, charset: _CharsetType) -> None: ... def get_charset(self) -> _CharsetType: ... def __len__(self) -> int: ... @@ -48,14 +42,10 @@ class Message: def get_content_subtype(self) -> str: ... def get_default_type(self) -> str: ... def set_default_type(self, ctype: str) -> None: ... - def get_params(self, failobj: _T = ..., header: str = ..., - unquote: bool = ...) -> Union[List[Tuple[str, str]], _T]: ... - def get_param(self, param: str, failobj: _T = ..., header: str = ..., - unquote: bool = ...) -> Union[_T, _ParamType]: ... - def del_param(self, param: str, header: str = ..., - requote: bool = ...) -> None: ... - def set_type(self, type: str, header: str = ..., - requote: bool = ...) -> None: ... + def get_params(self, failobj: _T = ..., header: str = ..., unquote: bool = ...) -> Union[List[Tuple[str, str]], _T]: ... + def get_param(self, param: str, failobj: _T = ..., header: str = ..., unquote: bool = ...) -> Union[_T, _ParamType]: ... + def del_param(self, param: str, header: str = ..., requote: bool = ...) -> None: ... + def set_type(self, type: str, header: str = ..., requote: bool = ...) -> None: ... def get_filename(self, failobj: _T = ...) -> Union[_T, str]: ... def get_boundary(self, failobj: _T = ...) -> Union[_T, str]: ... def set_boundary(self, boundary: str) -> None: ... @@ -63,39 +53,33 @@ class Message: def get_charsets(self, failobj: _T = ...) -> Union[_T, List[str]]: ... def walk(self) -> Generator[Message, None, None]: ... def get_content_disposition(self) -> Optional[str]: ... - def as_string(self, unixfrom: bool = ..., maxheaderlen: int = ..., - policy: Optional[Policy] = ...) -> str: ... - def as_bytes(self, unixfrom: bool = ..., - policy: Optional[Policy] = ...) -> bytes: ... + def as_string(self, unixfrom: bool = ..., maxheaderlen: int = ..., policy: Optional[Policy] = ...) -> str: ... + def as_bytes(self, unixfrom: bool = ..., policy: Optional[Policy] = ...) -> bytes: ... def __bytes__(self) -> bytes: ... - def set_param(self, param: str, value: str, header: str = ..., - requote: bool = ..., charset: str = ..., - language: str = ..., replace: bool = ...) -> None: ... + def set_param( + self, + param: str, + value: str, + header: str = ..., + requote: bool = ..., + charset: str = ..., + language: str = ..., + replace: bool = ..., + ) -> None: ... def __init__(self, policy: Policy = ...) -> None: ... class MIMEPart(Message): - def get_body(self, - preferencelist: Sequence[str] = ...) -> Optional[Message]: ... + def get_body(self, preferencelist: Sequence[str] = ...) -> Optional[Message]: ... def iter_attachments(self) -> Iterator[Message]: ... def iter_parts(self) -> Iterator[Message]: ... - def get_content(self, *args: Any, - content_manager: Optional[ContentManager] = ..., - **kw: Any) -> Any: ... - def set_content(self, *args: Any, - content_manager: Optional[ContentManager] = ..., - **kw: Any) -> None: ... + def get_content(self, *args: Any, content_manager: Optional[ContentManager] = ..., **kw: Any) -> Any: ... + def set_content(self, *args: Any, content_manager: Optional[ContentManager] = ..., **kw: Any) -> None: ... def make_related(self, boundary: Optional[str] = ...) -> None: ... def make_alternative(self, boundary: Optional[str] = ...) -> None: ... def make_mixed(self, boundary: Optional[str] = ...) -> None: ... - def add_related(self, *args: Any, - content_manager: Optional[ContentManager] = ..., - **kw: Any) -> None: ... - def add_alternative(self, *args: Any, - content_manager: Optional[ContentManager] = ..., - **kw: Any) -> None: ... - def add_attachment(self, *args: Any, - content_manager: Optional[ContentManager] = ..., - **kw: Any) -> None: ... + def add_related(self, *args: Any, content_manager: Optional[ContentManager] = ..., **kw: Any) -> None: ... + def add_alternative(self, *args: Any, content_manager: Optional[ContentManager] = ..., **kw: Any) -> None: ... + def add_attachment(self, *args: Any, content_manager: Optional[ContentManager] = ..., **kw: Any) -> None: ... def clear(self) -> None: ... def clear_content(self) -> None: ... def is_attachment(self) -> bool: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/mime/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/mime/__init__.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/mime/application.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/mime/application.pyi old mode 100755 new mode 100644 index 1a40e281..d1b2f1da --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/mime/application.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/mime/application.pyi @@ -1,11 +1,16 @@ -# Stubs for email.mime.application (Python 3.4) - -from typing import Callable, Optional, Tuple, Union from email.mime.nonmultipart import MIMENonMultipart +from email.policy import Policy +from typing import Callable, Optional, Tuple, Union _ParamsType = Union[str, None, Tuple[str, Optional[str], str]] class MIMEApplication(MIMENonMultipart): - def __init__(self, _data: Union[str, bytes], _subtype: str = ..., - _encoder: Callable[[MIMEApplication], None] = ..., - **_params: _ParamsType) -> None: ... + def __init__( + self, + _data: Union[str, bytes], + _subtype: str = ..., + _encoder: Callable[[MIMEApplication], None] = ..., + *, + policy: Optional[Policy] = ..., + **_params: _ParamsType, + ) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/mime/audio.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/mime/audio.pyi old mode 100755 new mode 100644 index 5bb57d3a..9bd5b5ca --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/mime/audio.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/mime/audio.pyi @@ -1,11 +1,16 @@ -# Stubs for email.mime.audio (Python 3.4) - -from typing import Callable, Optional, Tuple, Union from email.mime.nonmultipart import MIMENonMultipart +from email.policy import Policy +from typing import Callable, Optional, Tuple, Union _ParamsType = Union[str, None, Tuple[str, Optional[str], str]] class MIMEAudio(MIMENonMultipart): - def __init__(self, _audiodata: Union[str, bytes], _subtype: Optional[str] = ..., - _encoder: Callable[[MIMEAudio], None] = ..., - **_params: _ParamsType) -> None: ... + def __init__( + self, + _audiodata: Union[str, bytes], + _subtype: Optional[str] = ..., + _encoder: Callable[[MIMEAudio], None] = ..., + *, + policy: Optional[Policy] = ..., + **_params: _ParamsType, + ) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/mime/base.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/mime/base.pyi old mode 100755 new mode 100644 index 448d34be..1e322331 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/mime/base.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/mime/base.pyi @@ -1,10 +1,8 @@ -# Stubs for email.mime.base (Python 3.4) - -from typing import Optional, Tuple, Union import email.message +from email.policy import Policy +from typing import Optional, Tuple, Union _ParamsType = Union[str, None, Tuple[str, Optional[str], str]] class MIMEBase(email.message.Message): - def __init__(self, _maintype: str, _subtype: str, - **_params: _ParamsType) -> None: ... + def __init__(self, _maintype: str, _subtype: str, *, policy: Optional[Policy] = ..., **_params: _ParamsType) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/mime/image.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/mime/image.pyi old mode 100755 new mode 100644 index d32d9ee6..f192494e --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/mime/image.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/mime/image.pyi @@ -1,11 +1,16 @@ -# Stubs for email.mime.image (Python 3.4) - -from typing import Callable, Optional, Tuple, Union from email.mime.nonmultipart import MIMENonMultipart +from email.policy import Policy +from typing import Callable, Optional, Tuple, Union _ParamsType = Union[str, None, Tuple[str, Optional[str], str]] class MIMEImage(MIMENonMultipart): - def __init__(self, _imagedata: Union[str, bytes], _subtype: Optional[str] = ..., - _encoder: Callable[[MIMEImage], None] = ..., - **_params: _ParamsType) -> None: ... + def __init__( + self, + _imagedata: Union[str, bytes], + _subtype: Optional[str] = ..., + _encoder: Callable[[MIMEImage], None] = ..., + *, + policy: Optional[Policy] = ..., + **_params: _ParamsType, + ) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/mime/message.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/mime/message.pyi old mode 100755 new mode 100644 index 561e8c35..d2ce8181 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/mime/message.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/mime/message.pyi @@ -1,7 +1,7 @@ -# Stubs for email.mime.message (Python 3.4) - from email.message import Message from email.mime.nonmultipart import MIMENonMultipart +from email.policy import Policy +from typing import Optional class MIMEMessage(MIMENonMultipart): - def __init__(self, _msg: Message, _subtype: str = ...) -> None: ... + def __init__(self, _msg: Message, _subtype: str = ..., *, policy: Optional[Policy] = ...) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/mime/multipart.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/mime/multipart.pyi old mode 100755 new mode 100644 index ea5eba15..eb5f662d --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/mime/multipart.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/mime/multipart.pyi @@ -1,12 +1,17 @@ -# Stubs for email.mime.multipart (Python 3.4) - -from typing import Optional, Sequence, Tuple, Union from email.message import Message from email.mime.base import MIMEBase +from email.policy import Policy +from typing import Optional, Sequence, Tuple, Union _ParamsType = Union[str, None, Tuple[str, Optional[str], str]] class MIMEMultipart(MIMEBase): - def __init__(self, _subtype: str = ..., boundary: Optional[str] = ..., - _subparts: Optional[Sequence[Message]] = ..., - **_params: _ParamsType) -> None: ... + def __init__( + self, + _subtype: str = ..., + boundary: Optional[str] = ..., + _subparts: Optional[Sequence[Message]] = ..., + *, + policy: Optional[Policy] = ..., + **_params: _ParamsType, + ) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/mime/nonmultipart.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/mime/nonmultipart.pyi old mode 100755 new mode 100644 index 1fd3ea98..4addff18 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/mime/nonmultipart.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/mime/nonmultipart.pyi @@ -1,5 +1,3 @@ -# Stubs for email.mime.nonmultipart (Python 3.4) - from email.mime.base import MIMEBase class MIMENonMultipart(MIMEBase): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/mime/text.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/mime/text.pyi old mode 100755 new mode 100644 index 73adaf5f..aa5590eb --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/mime/text.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/mime/text.pyi @@ -1,8 +1,8 @@ -# Stubs for email.mime.text (Python 3.4) - -from typing import Optional from email.mime.nonmultipart import MIMENonMultipart +from email.policy import Policy +from typing import Optional class MIMEText(MIMENonMultipart): - def __init__(self, _text: str, _subtype: str = ..., - _charset: Optional[str] = ...) -> None: ... + def __init__( + self, _text: str, _subtype: str = ..., _charset: Optional[str] = ..., *, policy: Optional[Policy] = ... + ) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/parser.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/parser.pyi old mode 100755 new mode 100644 index 89ca2774..f1e40240 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/parser.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/parser.pyi @@ -1,5 +1,3 @@ -# Stubs for email.parser (Python 3.4) - import email.feedparser from email.message import Message from email.policy import Policy @@ -9,25 +7,21 @@ FeedParser = email.feedparser.FeedParser BytesFeedParser = email.feedparser.BytesFeedParser class Parser: - def __init__(self, _class: Callable[[], Message] = ..., *, - policy: Policy = ...) -> None: ... + def __init__(self, _class: Callable[[], Message] = ..., *, policy: Policy = ...) -> None: ... def parse(self, fp: TextIO, headersonly: bool = ...) -> Message: ... def parsestr(self, text: str, headersonly: bool = ...) -> Message: ... class HeaderParser(Parser): - def __init__(self, _class: Callable[[], Message] = ..., *, - policy: Policy = ...) -> None: ... + def __init__(self, _class: Callable[[], Message] = ..., *, policy: Policy = ...) -> None: ... def parse(self, fp: TextIO, headersonly: bool = ...) -> Message: ... def parsestr(self, text: str, headersonly: bool = ...) -> Message: ... class BytesHeaderParser(BytesParser): - def __init__(self, _class: Callable[[], Message] = ..., *, - policy: Policy = ...) -> None: ... + def __init__(self, _class: Callable[[], Message] = ..., *, policy: Policy = ...) -> None: ... def parse(self, fp: BinaryIO, headersonly: bool = ...) -> Message: ... def parsebytes(self, text: bytes, headersonly: bool = ...) -> Message: ... class BytesParser: - def __init__(self, _class: Callable[[], Message] = ..., *, - policy: Policy = ...) -> None: ... + def __init__(self, _class: Callable[[], Message] = ..., *, policy: Policy = ...) -> None: ... def parse(self, fp: BinaryIO, headersonly: bool = ...) -> Message: ... def parsebytes(self, text: bytes, headersonly: bool = ...) -> Message: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/policy.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/policy.pyi old mode 100755 new mode 100644 index 5f3b8977..d0906ebf --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/policy.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/policy.pyi @@ -1,11 +1,9 @@ -# Stubs for email.policy (Python 3.4) - from abc import abstractmethod -from typing import Any, List, Optional, Tuple, Union, Callable -from email.message import Message +from email.contentmanager import ContentManager from email.errors import MessageDefect from email.header import Header -from email.contentmanager import ContentManager +from email.message import Message +from typing import Any, Callable, List, Optional, Tuple, Union class Policy: max_line_length: Optional[int] @@ -15,28 +13,23 @@ class Policy: mange_from: bool def __init__(self, **kw: Any) -> None: ... def clone(self, **kw: Any) -> Policy: ... - def handle_defect(self, obj: Message, - defect: MessageDefect) -> None: ... - def register_defect(self, obj: Message, - defect: MessageDefect) -> None: ... + def handle_defect(self, obj: Message, defect: MessageDefect) -> None: ... + def register_defect(self, obj: Message, defect: MessageDefect) -> None: ... def header_max_count(self, name: str) -> Optional[int]: ... @abstractmethod - def header_source_parse(self, sourcelines: List[str]) -> str: ... + def header_source_parse(self, sourcelines: List[str]) -> Tuple[str, str]: ... @abstractmethod - def header_store_parse(self, name: str, - value: str) -> Tuple[str, str]: ... + def header_store_parse(self, name: str, value: str) -> Tuple[str, str]: ... @abstractmethod - def header_fetch_parse(self, name: str, - value: str) -> str: ... + def header_fetch_parse(self, name: str, value: str) -> str: ... @abstractmethod def fold(self, name: str, value: str) -> str: ... @abstractmethod def fold_binary(self, name: str, value: str) -> bytes: ... class Compat32(Policy): - def header_source_parse(self, sourcelines: List[str]) -> str: ... - def header_store_parse(self, name: str, - value: str) -> Tuple[str, str]: ... + def header_source_parse(self, sourcelines: List[str]) -> Tuple[str, str]: ... + def header_store_parse(self, name: str, value: str) -> Tuple[str, str]: ... def header_fetch_parse(self, name: str, value: str) -> Union[str, Header]: ... # type: ignore def fold(self, name: str, value: str) -> str: ... def fold_binary(self, name: str, value: str) -> bytes: ... @@ -48,9 +41,8 @@ class EmailPolicy(Policy): refold_source: str header_factory: Callable[[str, str], str] content_manager: ContentManager - def header_source_parse(self, sourcelines: List[str]) -> str: ... - def header_store_parse(self, name: str, - value: str) -> Tuple[str, str]: ... + def header_source_parse(self, sourcelines: List[str]) -> Tuple[str, str]: ... + def header_store_parse(self, name: str, value: str) -> Tuple[str, str]: ... def header_fetch_parse(self, name: str, value: str) -> str: ... def fold(self, name: str, value: str) -> str: ... def fold_binary(self, name: str, value: str) -> bytes: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/utils.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/utils.pyi old mode 100755 new mode 100644 index 6c0a1831..7c4c409b --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/utils.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/email/utils.pyi @@ -1,8 +1,7 @@ -# Stubs for email.utils (Python 3.4) - -from typing import List, Optional, Tuple, Union -from email.charset import Charset import datetime +import sys +from email.charset import Charset +from typing import List, Optional, Tuple, Union, overload _ParamType = Union[str, Tuple[Optional[str], Optional[str], str]] _PDTZ = Tuple[int, int, int, int, int, int, int, int, int, Optional[int]] @@ -10,24 +9,32 @@ _PDTZ = Tuple[int, int, int, int, int, int, int, int, int, Optional[int]] def quote(str: str) -> str: ... def unquote(str: str) -> str: ... def parseaddr(address: Optional[str]) -> Tuple[str, str]: ... -def formataddr(pair: Tuple[Optional[str], str], - charset: Union[str, Charset] = ...) -> str: ... +def formataddr(pair: Tuple[Optional[str], str], charset: Union[str, Charset] = ...) -> str: ... def getaddresses(fieldvalues: List[str]) -> List[Tuple[str, str]]: ... +@overload +def parsedate(date: None) -> None: ... +@overload def parsedate(date: str) -> Optional[Tuple[int, int, int, int, int, int, int, int, int]]: ... +@overload +def parsedate_tz(date: None) -> None: ... +@overload def parsedate_tz(date: str) -> Optional[_PDTZ]: ... -def parsedate_to_datetime(date: str) -> datetime.datetime: ... + +if sys.version_info >= (3, 10): + @overload + def parsedate_to_datetime(date: None) -> None: ... + @overload + def parsedate_to_datetime(date: str) -> datetime.datetime: ... + +else: + def parsedate_to_datetime(date: str) -> datetime.datetime: ... + def mktime_tz(tuple: _PDTZ) -> int: ... -def formatdate(timeval: Optional[float] = ..., localtime: bool = ..., - usegmt: bool = ...) -> str: ... +def formatdate(timeval: Optional[float] = ..., localtime: bool = ..., usegmt: bool = ...) -> str: ... def format_datetime(dt: datetime.datetime, usegmt: bool = ...) -> str: ... def localtime(dt: Optional[datetime.datetime] = ...) -> datetime.datetime: ... -def make_msgid(idstring: Optional[str] = ..., - domain: Optional[str] = ...) -> str: ... +def make_msgid(idstring: Optional[str] = ..., domain: Optional[str] = ...) -> str: ... def decode_rfc2231(s: str) -> Tuple[Optional[str], Optional[str], str]: ... -def encode_rfc2231(s: str, charset: Optional[str] = ..., - language: Optional[str] = ...) -> str: ... -def collapse_rfc2231_value(value: _ParamType, errors: str = ..., - fallback_charset: str = ...) -> str: ... -def decode_params( - params: List[Tuple[str, str]] -) -> List[Tuple[str, _ParamType]]: ... +def encode_rfc2231(s: str, charset: Optional[str] = ..., language: Optional[str] = ...) -> str: ... +def collapse_rfc2231_value(value: _ParamType, errors: str = ..., fallback_charset: str = ...) -> str: ... +def decode_params(params: List[Tuple[str, str]]) -> List[Tuple[str, _ParamType]]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/encodings/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/encodings/__init__.pyi old mode 100755 new mode 100644 index 0c050530..d6f4389b --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/encodings/__init__.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/encodings/__init__.pyi @@ -1,3 +1,7 @@ import codecs +from typing import Any def search_function(encoding: str) -> codecs.CodecInfo: ... + +# Explicitly mark this package as incomplete. +def __getattr__(name: str) -> Any: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/encodings/utf_8.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/encodings/utf_8.pyi old mode 100755 new mode 100644 index d38bd58d..67e139c8 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/encodings/utf_8.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/encodings/utf_8.pyi @@ -1,15 +1,15 @@ import codecs -from typing import Text, Tuple +from typing import Tuple class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: Text, final: bool = ...) -> bytes: ... + def encode(self, input: str, final: bool = ...) -> bytes: ... class IncrementalDecoder(codecs.BufferedIncrementalDecoder): - def _buffer_decode(self, input: bytes, errors: str, final: bool) -> Tuple[Text, int]: ... + def _buffer_decode(self, input: bytes, errors: str, final: bool) -> Tuple[str, int]: ... class StreamWriter(codecs.StreamWriter): ... class StreamReader(codecs.StreamReader): ... def getregentry() -> codecs.CodecInfo: ... -def encode(input: Text, errors: Text = ...) -> bytes: ... -def decode(input: bytes, errors: Text = ...) -> Text: ... +def encode(input: str, errors: str = ...) -> bytes: ... +def decode(input: bytes, errors: str = ...) -> str: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/enum.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/enum.pyi old mode 100755 new mode 100644 index be22d386..1a1dcf00 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/enum.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/enum.pyi @@ -1,10 +1,9 @@ -# NB: third_party/2/enum.pyi and stdlib/3.4/enum.pyi must remain consistent! import sys -from typing import Any, Dict, Iterator, List, Mapping, Type, TypeVar, Union from abc import ABCMeta +from typing import Any, Dict, Iterator, List, Mapping, Type, TypeVar, Union -_T = TypeVar('_T') -_S = TypeVar('_S', bound=Type[Enum]) +_T = TypeVar("_T") +_S = TypeVar("_S", bound=Type[Enum]) # Note: EnumMeta actually subclasses type directly, not ABCMeta. # This is a temporary workaround to allow multiple creation of enums with builtins @@ -30,12 +29,12 @@ class Enum(metaclass=EnumMeta): _value2member_map_: Dict[int, Enum] # undocumented if sys.version_info >= (3, 7): _ignore_: Union[str, List[str]] - if sys.version_info >= (3, 6): - _order_: str - @classmethod - def _missing_(cls, value: object) -> Any: ... - @staticmethod - def _generate_next_value_(name: str, start: int, count: int, last_values: List[Any]) -> Any: ... + _order_: str + __order__: str + @classmethod + def _missing_(cls, value: object) -> Any: ... + @staticmethod + def _generate_next_value_(name: str, start: int, count: int, last_values: List[Any]) -> Any: ... def __new__(cls: Type[_T], value: object) -> _T: ... def __repr__(self) -> str: ... def __str__(self) -> str: ... @@ -49,27 +48,26 @@ class IntEnum(int, Enum): def unique(enumeration: _S) -> _S: ... -if sys.version_info >= (3, 6): - _auto_null: Any +_auto_null: Any - # subclassing IntFlag so it picks up all implemented base functions, best modeling behavior of enum.auto() - class auto(IntFlag): - value: Any +# subclassing IntFlag so it picks up all implemented base functions, best modeling behavior of enum.auto() +class auto(IntFlag): + value: Any - class Flag(Enum): - def __contains__(self: _T, other: _T) -> bool: ... - def __repr__(self) -> str: ... - def __str__(self) -> str: ... - def __bool__(self) -> bool: ... - def __or__(self: _T, other: _T) -> _T: ... - def __and__(self: _T, other: _T) -> _T: ... - def __xor__(self: _T, other: _T) -> _T: ... - def __invert__(self: _T) -> _T: ... +class Flag(Enum): + def __contains__(self: _T, other: _T) -> bool: ... + def __repr__(self) -> str: ... + def __str__(self) -> str: ... + def __bool__(self) -> bool: ... + def __or__(self: _T, other: _T) -> _T: ... + def __and__(self: _T, other: _T) -> _T: ... + def __xor__(self: _T, other: _T) -> _T: ... + def __invert__(self: _T) -> _T: ... - class IntFlag(int, Flag): - def __or__(self: _T, other: Union[int, _T]) -> _T: ... - def __and__(self: _T, other: Union[int, _T]) -> _T: ... - def __xor__(self: _T, other: Union[int, _T]) -> _T: ... - __ror__ = __or__ - __rand__ = __and__ - __rxor__ = __xor__ +class IntFlag(int, Flag): + def __or__(self: _T, other: Union[int, _T]) -> _T: ... + def __and__(self: _T, other: Union[int, _T]) -> _T: ... + def __xor__(self: _T, other: Union[int, _T]) -> _T: ... + __ror__ = __or__ + __rand__ = __and__ + __rxor__ = __xor__ diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/faulthandler.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/faulthandler.pyi old mode 100755 new mode 100644 index 736a4539..7b42b8ec --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/faulthandler.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/faulthandler.pyi @@ -1,17 +1,13 @@ import sys -from typing import Union, Protocol - -class _HasFileno(Protocol): - def fileno(self) -> int: ... - -_File = Union[_HasFileno, int] +from _typeshed import FileDescriptorLike def cancel_dump_traceback_later() -> None: ... def disable() -> None: ... -def dump_traceback(file: _File = ..., all_threads: bool = ...) -> None: ... -def dump_traceback_later(timeout: float, repeat: bool = ..., file: _File = ..., exit: bool = ...) -> None: ... -def enable(file: _File = ..., all_threads: bool = ...) -> None: ... +def dump_traceback(file: FileDescriptorLike = ..., all_threads: bool = ...) -> None: ... +def dump_traceback_later(timeout: float, repeat: bool = ..., file: FileDescriptorLike = ..., exit: bool = ...) -> None: ... +def enable(file: FileDescriptorLike = ..., all_threads: bool = ...) -> None: ... def is_enabled() -> bool: ... + if sys.platform != "win32": - def register(signum: int, file: _File = ..., all_threads: bool = ..., chain: bool = ...) -> None: ... + def register(signum: int, file: FileDescriptorLike = ..., all_threads: bool = ..., chain: bool = ...) -> None: ... def unregister(signum: int) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/fcntl.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/fcntl.pyi old mode 100755 new mode 100644 index fdcb4fcf..7b94c6e9 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/fcntl.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/fcntl.pyi @@ -1,6 +1,8 @@ -# Stubs for fcntl -from io import IOBase -from typing import Any, IO, Union +import sys +from _typeshed import FileDescriptorLike +from array import array +from typing import Any, Union, overload +from typing_extensions import Literal FASYNC: int FD_CLOEXEC: int @@ -32,6 +34,10 @@ F_SETLK: int F_SETLK64: int F_SETLKW: int F_SETLKW64: int +if sys.version_info >= (3, 9) and sys.platform == "linux": + F_OFD_GETLK: int + F_OFD_SETLK: int + F_OFD_SETLKW: int F_SETOWN: int F_SETSIG: int F_SHLCK: int @@ -74,23 +80,20 @@ LOCK_RW: int LOCK_SH: int LOCK_UN: int LOCK_WRITE: int +@overload +def fcntl(__fd: FileDescriptorLike, __cmd: int, __arg: int = ...) -> int: ... +@overload +def fcntl(__fd: FileDescriptorLike, __cmd: int, __arg: bytes) -> bytes: ... -_AnyFile = Union[int, IO[Any], IOBase] - -# TODO All these return either int or bytes depending on the value of -# cmd (not on the type of arg). -def fcntl(fd: _AnyFile, - cmd: int, - arg: Union[int, bytes] = ...) -> Any: ... -# TODO This function accepts any object supporting a buffer interface, -# as arg, is there a better way to express this than bytes? -def ioctl(fd: _AnyFile, - request: int, - arg: Union[int, bytes] = ..., - mutate_flag: bool = ...) -> Any: ... -def flock(fd: _AnyFile, operation: int) -> None: ... -def lockf(fd: _AnyFile, - cmd: int, - len: int = ..., - start: int = ..., - whence: int = ...) -> Any: ... +_ReadOnlyBuffer = bytes +_WritableBuffer = Union[bytearray, memoryview, array] +@overload +def ioctl(__fd: FileDescriptorLike, __request: int, __arg: int = ..., __mutate_flag: bool = ...) -> int: ... +@overload +def ioctl(__fd: FileDescriptorLike, __request: int, __arg: _WritableBuffer, __mutate_flag: Literal[True] = ...) -> int: ... +@overload +def ioctl(__fd: FileDescriptorLike, __request: int, __arg: _WritableBuffer, __mutate_flag: Literal[False]) -> bytes: ... +@overload +def ioctl(__fd: FileDescriptorLike, __request: int, __arg: _ReadOnlyBuffer, __mutate_flag: bool = ...) -> bytes: ... +def flock(__fd: FileDescriptorLike, __operation: int) -> None: ... +def lockf(__fd: FileDescriptorLike, __cmd: int, __len: int = ..., __start: int = ..., __whence: int = ...) -> Any: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/fnmatch.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/fnmatch.pyi old mode 100755 new mode 100644 index 4f99b4aa..5311f13e --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/fnmatch.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/fnmatch.pyi @@ -1,9 +1,4 @@ -# Stubs for fnmatch - -# Based on http://docs.python.org/3.2/library/fnmatch.html and -# python-lib/fnmatch.py - -from typing import Iterable, List, AnyStr +from typing import AnyStr, Iterable, List def fnmatch(name: AnyStr, pat: AnyStr) -> bool: ... def fnmatchcase(name: AnyStr, pat: AnyStr) -> bool: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/functools.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/functools.pyi old mode 100755 new mode 100644 index a23ef6f5..562c32bc --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/functools.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/functools.pyi @@ -1,17 +1,34 @@ import sys -from typing import Any, Callable, Generic, Dict, Iterable, Mapping, Optional, Sequence, Tuple, Type, TypeVar, NamedTuple, Union, overload +from _typeshed import SupportsLessThan +from typing import ( + Any, + Callable, + Dict, + Generic, + Hashable, + Iterable, + Mapping, + NamedTuple, + Optional, + Sequence, + Tuple, + Type, + TypeVar, + Union, + overload, +) + +if sys.version_info >= (3, 9): + from types import GenericAlias _AnyCallable = Callable[..., Any] _T = TypeVar("_T") _S = TypeVar("_S") - @overload -def reduce(function: Callable[[_T, _S], _T], - sequence: Iterable[_S], initial: _T) -> _T: ... +def reduce(function: Callable[[_T, _S], _T], sequence: Iterable[_S], initial: _T) -> _T: ... @overload -def reduce(function: Callable[[_T, _T], _T], - sequence: Iterable[_T]) -> _T: ... +def reduce(function: Callable[[_T, _T], _T], sequence: Iterable[_T]) -> _T: ... class _CacheInfo(NamedTuple): hits: int @@ -21,7 +38,7 @@ class _CacheInfo(NamedTuple): class _lru_cache_wrapper(Generic[_T]): __wrapped__: Callable[..., _T] - def __call__(self, *args: Any, **kwargs: Any) -> _T: ... + def __call__(self, *args: Hashable, **kwargs: Hashable) -> _T: ... def cache_info(self) -> _CacheInfo: ... def cache_clear(self) -> None: ... @@ -30,17 +47,17 @@ if sys.version_info >= (3, 8): def lru_cache(maxsize: Optional[int] = ..., typed: bool = ...) -> Callable[[Callable[..., _T]], _lru_cache_wrapper[_T]]: ... @overload def lru_cache(maxsize: Callable[..., _T], typed: bool = ...) -> _lru_cache_wrapper[_T]: ... + else: def lru_cache(maxsize: Optional[int] = ..., typed: bool = ...) -> Callable[[Callable[..., _T]], _lru_cache_wrapper[_T]]: ... WRAPPER_ASSIGNMENTS: Sequence[str] WRAPPER_UPDATES: Sequence[str] -def update_wrapper(wrapper: _AnyCallable, wrapped: _AnyCallable, assigned: Sequence[str] = ..., - updated: Sequence[str] = ...) -> _AnyCallable: ... -def wraps(wrapped: _AnyCallable, assigned: Sequence[str] = ..., updated: Sequence[str] = ...) -> Callable[[_AnyCallable], _AnyCallable]: ... -def total_ordering(cls: type) -> type: ... -def cmp_to_key(mycmp: Callable[[_T, _T], int]) -> Callable[[_T], Any]: ... +def update_wrapper(wrapper: _T, wrapped: _AnyCallable, assigned: Sequence[str] = ..., updated: Sequence[str] = ...) -> _T: ... +def wraps(wrapped: _AnyCallable, assigned: Sequence[str] = ..., updated: Sequence[str] = ...) -> Callable[[_T], _T]: ... +def total_ordering(cls: Type[_T]) -> Type[_T]: ... +def cmp_to_key(mycmp: Callable[[_T, _T], int]) -> Callable[[_T], SupportsLessThan]: ... class partial(Generic[_T]): func: Callable[..., _T] @@ -48,6 +65,8 @@ class partial(Generic[_T]): keywords: Dict[str, Any] def __init__(self, func: Callable[..., _T], *args: Any, **kwargs: Any) -> None: ... def __call__(self, *args: Any, **kwargs: Any) -> _T: ... + if sys.version_info >= (3, 9): + def __class_getitem__(cls, item: Any) -> GenericAlias: ... # With protocols, this could change into a generic protocol that defines __get__ and returns _T _Descriptor = Any @@ -56,14 +75,15 @@ class partialmethod(Generic[_T]): func: Union[Callable[..., _T], _Descriptor] args: Tuple[Any, ...] keywords: Dict[str, Any] - @overload - def __init__(self, func: Callable[..., _T], *args: Any, **keywords: Any) -> None: ... + def __init__(self, __func: Callable[..., _T], *args: Any, **keywords: Any) -> None: ... @overload - def __init__(self, func: _Descriptor, *args: Any, **keywords: Any) -> None: ... + def __init__(self, __func: _Descriptor, *args: Any, **keywords: Any) -> None: ... def __get__(self, obj: Any, cls: Type[Any]) -> Callable[..., _T]: ... @property def __isabstractmethod__(self) -> bool: ... + if sys.version_info >= (3, 9): + def __class_getitem__(cls, item: Any) -> GenericAlias: ... class _SingleDispatchCallable(Generic[_T]): registry: Mapping[Any, Callable[..., _T]] @@ -78,12 +98,26 @@ class _SingleDispatchCallable(Generic[_T]): def singledispatch(func: Callable[..., _T]) -> _SingleDispatchCallable[_T]: ... if sys.version_info >= (3, 8): - class cached_property(Generic[_S, _T]): - func: Callable[[_S], _T] + class singledispatchmethod(Generic[_T]): + dispatcher: _SingleDispatchCallable[_T] + func: Callable[..., _T] + def __init__(self, func: Callable[..., _T]) -> None: ... + @overload + def register(self, cls: Any, method: None = ...) -> Callable[[Callable[..., _T]], Callable[..., _T]]: ... + @overload + def register(self, cls: Any, method: Callable[..., _T]) -> Callable[..., _T]: ... + def __call__(self, *args: Any, **kwargs: Any) -> _T: ... + class cached_property(Generic[_T]): + func: Callable[[Any], _T] attrname: Optional[str] - def __init__(self, func: Callable[[_S], _T]) -> None: ... + def __init__(self, func: Callable[[Any], _T]) -> None: ... @overload - def __get__(self, instance: None, owner: Optional[Type[_S]] = ...) -> cached_property[_S, _T]: ... + def __get__(self, instance: None, owner: Optional[Type[Any]] = ...) -> cached_property[_T]: ... @overload - def __get__(self, instance: _S, owner: Optional[Type[_S]] = ...) -> _T: ... - def __set_name__(self, owner: Type[_S], name: str) -> None: ... + def __get__(self, instance: _S, owner: Optional[Type[Any]] = ...) -> _T: ... + def __set_name__(self, owner: Type[Any], name: str) -> None: ... + if sys.version_info >= (3, 9): + def __class_getitem__(cls, item: Any) -> GenericAlias: ... + +if sys.version_info >= (3, 9): + def cache(__user_function: Callable[..., _T]) -> _lru_cache_wrapper[_T]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/gc.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/gc.pyi old mode 100755 new mode 100644 index b85e8f58..841ffd8b --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/gc.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/gc.pyi @@ -1,9 +1,6 @@ -# Stubs for gc - import sys from typing import Any, Dict, List, Optional, Tuple - DEBUG_COLLECTABLE: int DEBUG_LEAK: int DEBUG_SAVEALL: int @@ -12,21 +9,32 @@ DEBUG_UNCOLLECTABLE: int callbacks: List[Any] garbage: List[Any] -def collect(generations: int = ...) -> int: ... +def collect(generation: int = ...) -> int: ... def disable() -> None: ... def enable() -> None: ... def get_count() -> Tuple[int, int, int]: ... def get_debug() -> int: ... + if sys.version_info >= (3, 8): def get_objects(generation: Optional[int] = ...) -> List[Any]: ... + else: def get_objects() -> List[Any]: ... + +if sys.version_info >= (3, 7): + def freeze() -> None: ... + def unfreeze() -> None: ... + def get_freeze_count() -> int: ... + def get_referents(*objs: Any) -> List[Any]: ... def get_referrers(*objs: Any) -> List[Any]: ... def get_stats() -> List[Dict[str, Any]]: ... def get_threshold() -> Tuple[int, int, int]: ... -def is_tracked(obj: Any) -> bool: ... +def is_tracked(__obj: Any) -> bool: ... + +if sys.version_info >= (3, 9): + def is_finalized(__obj: Any) -> bool: ... + def isenabled() -> bool: ... -def set_debug(flags: int) -> None: ... -def set_threshold(threshold0: int, threshold1: int = ..., - threshold2: int = ...) -> None: ... +def set_debug(__flags: int) -> None: ... +def set_threshold(threshold0: int, threshold1: int = ..., threshold2: int = ...) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/getopt.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/getopt.pyi old mode 100755 new mode 100644 index 0417a827..c92be2a6 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/getopt.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/getopt.pyi @@ -1,7 +1,3 @@ -# Stubs for getopt - -# Based on http://docs.python.org/3.2/library/getopt.html - from typing import List, Tuple def getopt(args: List[str], shortopts: str, longopts: List[str] = ...) -> Tuple[List[Tuple[str, str]], List[str]]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/getpass.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/getpass.pyi old mode 100755 new mode 100644 index 55a8433f..aac162a5 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/getpass.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/getpass.pyi @@ -1,12 +1,6 @@ -# Stubs for getpass - from typing import Optional, TextIO - def getpass(prompt: str = ..., stream: Optional[TextIO] = ...) -> str: ... - - def getuser() -> str: ... - class GetPassWarning(UserWarning): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/gettext.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/gettext.pyi old mode 100755 new mode 100644 index ad1ba3c8..5624817b --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/gettext.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/gettext.pyi @@ -1,21 +1,19 @@ import sys -from typing import overload, Any, Container, IO, Iterable, Optional, Type, TypeVar - -if sys.version_info >= (3, 8): - from typing import Literal -else: - from typing_extensions import Literal +from _typeshed import StrPath +from typing import IO, Any, Container, Iterable, Optional, Sequence, Type, TypeVar, overload +from typing_extensions import Literal class NullTranslations: - def __init__(self, fp: IO[str] = ...) -> None: ... + def __init__(self, fp: Optional[IO[str]] = ...) -> None: ... def _parse(self, fp: IO[str]) -> None: ... def add_fallback(self, fallback: NullTranslations) -> None: ... def gettext(self, message: str) -> str: ... def lgettext(self, message: str) -> str: ... - def ngettext(self, singular: str, plural: str, n: int) -> str: ... - def lngettext(self, singular: str, plural: str, n: int) -> str: ... - def pgettext(self, context: str, message: str) -> str: ... - def npgettext(self, context: str, msgid1: str, msgid2: str, n: int) -> str: ... + def ngettext(self, msgid1: str, msgid2: str, n: int) -> str: ... + def lngettext(self, msgid1: str, msgid2: str, n: int) -> str: ... + if sys.version_info >= (3, 8): + def pgettext(self, context: str, message: str) -> str: ... + def npgettext(self, context: str, msgid1: str, msgid2: str, n: int) -> str: ... def info(self) -> Any: ... def charset(self) -> Any: ... def output_charset(self) -> Any: ... @@ -25,38 +23,58 @@ class NullTranslations: class GNUTranslations(NullTranslations): LE_MAGIC: int BE_MAGIC: int + CONTEXT: str + VERSIONS: Sequence[int] -def find(domain: str, localedir: Optional[str] = ..., languages: Optional[Iterable[str]] = ..., - all: bool = ...) -> Any: ... +def find(domain: str, localedir: Optional[StrPath] = ..., languages: Optional[Iterable[str]] = ..., all: bool = ...) -> Any: ... -_T = TypeVar('_T') +_T = TypeVar("_T") @overload -def translation(domain: str, localedir: Optional[str] = ..., languages: Optional[Iterable[str]] = ..., - class_: None = ..., fallback: bool = ..., codeset: Optional[str] = ...) -> NullTranslations: ... +def translation( + domain: str, + localedir: Optional[StrPath] = ..., + languages: Optional[Iterable[str]] = ..., + class_: None = ..., + fallback: bool = ..., + codeset: Optional[str] = ..., +) -> NullTranslations: ... @overload -def translation(domain: str, localedir: Optional[str] = ..., languages: Optional[Iterable[str]] = ..., - class_: Type[_T] = ..., fallback: Literal[False] = ..., codeset: Optional[str] = ...) -> _T: ... +def translation( + domain: str, + localedir: Optional[StrPath] = ..., + languages: Optional[Iterable[str]] = ..., + class_: Type[_T] = ..., + fallback: Literal[False] = ..., + codeset: Optional[str] = ..., +) -> _T: ... @overload -def translation(domain: str, localedir: Optional[str] = ..., languages: Optional[Iterable[str]] = ..., - class_: Type[_T] = ..., fallback: Literal[True] = ..., codeset: Optional[str] = ...) -> Any: ... - -def install(domain: str, localedir: Optional[str] = ..., codeset: Optional[str] = ..., - names: Optional[Container[str]] = ...) -> None: ... - +def translation( + domain: str, + localedir: Optional[StrPath] = ..., + languages: Optional[Iterable[str]] = ..., + class_: Type[_T] = ..., + fallback: Literal[True] = ..., + codeset: Optional[str] = ..., +) -> Any: ... +def install( + domain: str, localedir: Optional[StrPath] = ..., codeset: Optional[str] = ..., names: Optional[Container[str]] = ... +) -> None: ... def textdomain(domain: Optional[str] = ...) -> str: ... -def bindtextdomain(domain: str, localedir: Optional[str] = ...) -> str: ... +def bindtextdomain(domain: str, localedir: Optional[StrPath] = ...) -> str: ... def bind_textdomain_codeset(domain: str, codeset: Optional[str] = ...) -> str: ... def dgettext(domain: str, message: str) -> str: ... def ldgettext(domain: str, message: str) -> str: ... -def dngettext(domain: str, singular: str, plural: str, n: int) -> str: ... -def ldngettext(domain: str, singular: str, plural: str, n: int) -> str: ... +def dngettext(domain: str, msgid1: str, msgid2: str, n: int) -> str: ... +def ldngettext(domain: str, msgid1: str, msgid2: str, n: int) -> str: ... def gettext(message: str) -> str: ... def lgettext(message: str) -> str: ... -def ngettext(singular: str, plural: str, n: int) -> str: ... -def lngettext(singular: str, plural: str, n: int) -> str: ... -def pgettext(context: str, message: str) -> str: ... -def dpgettext(domain: str, context: str, message: str) -> str: ... -def npgettext(context: str, msgid1: str, msgid2: str, n: int) -> str: ... -def dnpgettext(domain: str, context: str, msgid1: str, msgid2: str, n: int) -> str: ... +def ngettext(msgid1: str, msgid2: str, n: int) -> str: ... +def lngettext(msgid1: str, msgid2: str, n: int) -> str: ... + +if sys.version_info >= (3, 8): + def pgettext(context: str, message: str) -> str: ... + def dpgettext(domain: str, context: str, message: str) -> str: ... + def npgettext(context: str, msgid1: str, msgid2: str, n: int) -> str: ... + def dnpgettext(domain: str, context: str, msgid1: str, msgid2: str, n: int) -> str: ... Catalog = translation diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/glob.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/glob.pyi old mode 100755 new mode 100644 index 5e73a797..3029b258 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/glob.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/glob.pyi @@ -1,19 +1,8 @@ -# Stubs for glob -# Based on http://docs.python.org/3/library/glob.html - -from typing import List, Iterator, AnyStr, Union -import sys - -if sys.version_info >= (3, 6): - def glob0(dirname: AnyStr, pattern: AnyStr) -> List[AnyStr]: ... -else: - def glob0(dirname: AnyStr, basename: AnyStr) -> List[AnyStr]: ... +from typing import AnyStr, Iterator, List, Union +def glob0(dirname: AnyStr, pattern: AnyStr) -> List[AnyStr]: ... def glob1(dirname: AnyStr, pattern: AnyStr) -> List[AnyStr]: ... - def glob(pathname: AnyStr, *, recursive: bool = ...) -> List[AnyStr]: ... def iglob(pathname: AnyStr, *, recursive: bool = ...) -> Iterator[AnyStr]: ... - def escape(pathname: AnyStr) -> AnyStr: ... - def has_magic(s: Union[str, bytes]) -> bool: ... # undocumented diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/gzip.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/gzip.pyi old mode 100755 new mode 100644 index ce8152c3..4ce54b3b --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/gzip.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/gzip.pyi @@ -1,10 +1,39 @@ -from typing import Any, IO, Optional -from os.path import _PathType import _compression import sys import zlib +from _typeshed import AnyPath, ReadableBuffer +from typing import IO, Optional, TextIO, Union, overload +from typing_extensions import Literal -def open(filename, mode: str = ..., compresslevel: int = ..., encoding: Optional[str] = ..., errors: Optional[str] = ..., newline: Optional[str] = ...) -> IO[Any]: ... +_OpenBinaryMode = Literal["r", "rb", "a", "ab", "w", "wb", "x", "xb"] +_OpenTextMode = Literal["rt", "at", "wt", "xt"] +@overload +def open( + filename: Union[AnyPath, IO[bytes]], + mode: _OpenBinaryMode = ..., + compresslevel: int = ..., + encoding: None = ..., + errors: None = ..., + newline: None = ..., +) -> GzipFile: ... +@overload +def open( + filename: AnyPath, + mode: _OpenTextMode, + compresslevel: int = ..., + encoding: Optional[str] = ..., + errors: Optional[str] = ..., + newline: Optional[str] = ..., +) -> TextIO: ... +@overload +def open( + filename: Union[AnyPath, IO[bytes]], + mode: str, + compresslevel: int = ..., + encoding: Optional[str] = ..., + errors: Optional[str] = ..., + newline: Optional[str] = ..., +) -> Union[GzipFile, TextIO]: ... class _PaddedFile: file: IO[bytes] @@ -14,19 +43,29 @@ class _PaddedFile: def seek(self, off: int) -> int: ... def seekable(self) -> bool: ... +if sys.version_info >= (3, 8): + class BadGzipFile(OSError): ... + class GzipFile(_compression.BaseStream): myfileobj: Optional[IO[bytes]] mode: str name: str compress: zlib._Compress fileobj: IO[bytes] - def __init__(self, filename: Optional[_PathType] = ..., mode: Optional[str] = ..., compresslevel: int = ..., fileobj: Optional[IO[bytes]] = ..., mtime: Optional[float] = ...) -> None: ... + def __init__( + self, + filename: Optional[AnyPath] = ..., + mode: Optional[str] = ..., + compresslevel: int = ..., + fileobj: Optional[IO[bytes]] = ..., + mtime: Optional[float] = ..., + ) -> None: ... @property def filename(self) -> str: ... @property def mtime(self) -> Optional[int]: ... crc: int - def write(self, data: bytes) -> int: ... + def write(self, data: ReadableBuffer) -> int: ... def read(self, size: Optional[int] = ...) -> bytes: ... def read1(self, size: int = ...) -> bytes: ... def peek(self, n: int) -> bytes: ... @@ -40,14 +79,16 @@ class GzipFile(_compression.BaseStream): def writable(self) -> bool: ... def seekable(self) -> bool: ... def seek(self, offset: int, whence: int = ...) -> int: ... - def readline(self, size: int = ...) -> bytes: ... + def readline(self, size: Optional[int] = ...) -> bytes: ... class _GzipReader(_compression.DecompressReader): def __init__(self, fp: IO[bytes]) -> None: ... def read(self, size: int = ...) -> bytes: ... if sys.version_info >= (3, 8): - def compress(data, compresslevel: int = ..., *, mtime: Optional[float] = ...) -> bytes: ... + def compress(data: bytes, compresslevel: int = ..., *, mtime: Optional[float] = ...) -> bytes: ... + else: - def compress(data, compresslevel: int = ...) -> bytes: ... + def compress(data: bytes, compresslevel: int = ...) -> bytes: ... + def decompress(data: bytes) -> bytes: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/hashlib.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/hashlib.pyi old mode 100755 new mode 100644 index 616bb0fd..70b120d0 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/hashlib.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/hashlib.pyi @@ -1,9 +1,6 @@ -# Stubs for hashlib - import sys -from typing import AbstractSet, Optional, Union - -_DataType = Union[bytes, bytearray, memoryview] +from _typeshed import ReadableBuffer +from typing import AbstractSet, Optional class _Hash(object): digest_size: int @@ -13,57 +10,114 @@ class _Hash(object): # been present in CPython since its inception, but until Python 3.4 was not # formally specified, so may not exist on some platforms name: str - - def __init__(self, data: _DataType = ...) -> None: ... - + def __init__(self, data: ReadableBuffer = ...) -> None: ... def copy(self) -> _Hash: ... def digest(self) -> bytes: ... def hexdigest(self) -> str: ... - def update(self, arg: _DataType) -> None: ... - -def md5(arg: _DataType = ...) -> _Hash: ... -def sha1(arg: _DataType = ...) -> _Hash: ... -def sha224(arg: _DataType = ...) -> _Hash: ... -def sha256(arg: _DataType = ...) -> _Hash: ... -def sha384(arg: _DataType = ...) -> _Hash: ... -def sha512(arg: _DataType = ...) -> _Hash: ... - -def new(name: str, data: _DataType = ...) -> _Hash: ... + def update(self, __data: ReadableBuffer) -> None: ... + +if sys.version_info >= (3, 9): + def md5(string: ReadableBuffer = ..., *, usedforsecurity: bool = ...) -> _Hash: ... + def sha1(string: ReadableBuffer = ..., *, usedforsecurity: bool = ...) -> _Hash: ... + def sha224(string: ReadableBuffer = ..., *, usedforsecurity: bool = ...) -> _Hash: ... + def sha256(string: ReadableBuffer = ..., *, usedforsecurity: bool = ...) -> _Hash: ... + def sha384(string: ReadableBuffer = ..., *, usedforsecurity: bool = ...) -> _Hash: ... + def sha512(string: ReadableBuffer = ..., *, usedforsecurity: bool = ...) -> _Hash: ... + +elif sys.version_info >= (3, 8): + def md5(string: ReadableBuffer = ...) -> _Hash: ... + def sha1(string: ReadableBuffer = ...) -> _Hash: ... + def sha224(string: ReadableBuffer = ...) -> _Hash: ... + def sha256(string: ReadableBuffer = ...) -> _Hash: ... + def sha384(string: ReadableBuffer = ...) -> _Hash: ... + def sha512(string: ReadableBuffer = ...) -> _Hash: ... + +else: + def md5(__string: ReadableBuffer = ...) -> _Hash: ... + def sha1(__string: ReadableBuffer = ...) -> _Hash: ... + def sha224(__string: ReadableBuffer = ...) -> _Hash: ... + def sha256(__string: ReadableBuffer = ...) -> _Hash: ... + def sha384(__string: ReadableBuffer = ...) -> _Hash: ... + def sha512(__string: ReadableBuffer = ...) -> _Hash: ... + +def new(name: str, data: ReadableBuffer = ...) -> _Hash: ... algorithms_guaranteed: AbstractSet[str] algorithms_available: AbstractSet[str] -def pbkdf2_hmac(hash_name: str, password: _DataType, salt: _DataType, iterations: int, dklen: Optional[int] = ...) -> bytes: ... - -if sys.version_info >= (3, 6): - class _VarLenHash(object): - digest_size: int - block_size: int - name: str - - def __init__(self, data: _DataType = ...) -> None: ... +def pbkdf2_hmac( + hash_name: str, password: ReadableBuffer, salt: ReadableBuffer, iterations: int, dklen: Optional[int] = ... +) -> bytes: ... - def copy(self) -> _VarLenHash: ... - def digest(self, length: int) -> bytes: ... - def hexdigest(self, length: int) -> str: ... - def update(self, arg: _DataType) -> None: ... - - sha3_224 = _Hash - sha3_256 = _Hash - sha3_384 = _Hash - sha3_512 = _Hash - shake_128 = _VarLenHash - shake_256 = _VarLenHash - - def scrypt(password: _DataType, *, salt: _DataType, n: int, r: int, p: int, maxmem: int = ..., dklen: int = ...) -> bytes: ... - - class _BlakeHash(_Hash): - MAX_DIGEST_SIZE: int - MAX_KEY_SIZE: int - PERSON_SIZE: int - SALT_SIZE: int - - def __init__(self, data: _DataType = ..., digest_size: int = ..., key: _DataType = ..., salt: _DataType = ..., person: _DataType = ..., fanout: int = ..., depth: int = ..., leaf_size: int = ..., node_offset: int = ..., node_depth: int = ..., inner_size: int = ..., last_node: bool = ...) -> None: ... - - blake2b = _BlakeHash - blake2s = _BlakeHash +class _VarLenHash(object): + digest_size: int + block_size: int + name: str + def __init__(self, data: ReadableBuffer = ...) -> None: ... + def copy(self) -> _VarLenHash: ... + def digest(self, __length: int) -> bytes: ... + def hexdigest(self, __length: int) -> str: ... + def update(self, __data: ReadableBuffer) -> None: ... + +sha3_224 = _Hash +sha3_256 = _Hash +sha3_384 = _Hash +sha3_512 = _Hash +shake_128 = _VarLenHash +shake_256 = _VarLenHash + +def scrypt( + password: ReadableBuffer, + *, + salt: Optional[ReadableBuffer] = ..., + n: Optional[int] = ..., + r: Optional[int] = ..., + p: Optional[int] = ..., + maxmem: int = ..., + dklen: int = ..., +) -> bytes: ... + +class _BlakeHash(_Hash): + MAX_DIGEST_SIZE: int + MAX_KEY_SIZE: int + PERSON_SIZE: int + SALT_SIZE: int + + if sys.version_info >= (3, 9): + def __init__( + self, + __data: ReadableBuffer = ..., + *, + digest_size: int = ..., + key: ReadableBuffer = ..., + salt: ReadableBuffer = ..., + person: ReadableBuffer = ..., + fanout: int = ..., + depth: int = ..., + leaf_size: int = ..., + node_offset: int = ..., + node_depth: int = ..., + inner_size: int = ..., + last_node: bool = ..., + usedforsecurity: bool = ..., + ) -> None: ... + else: + def __init__( + self, + __data: ReadableBuffer = ..., + *, + digest_size: int = ..., + key: ReadableBuffer = ..., + salt: ReadableBuffer = ..., + person: ReadableBuffer = ..., + fanout: int = ..., + depth: int = ..., + leaf_size: int = ..., + node_offset: int = ..., + node_depth: int = ..., + inner_size: int = ..., + last_node: bool = ..., + ) -> None: ... + +blake2b = _BlakeHash +blake2s = _BlakeHash diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/heapq.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/heapq.pyi old mode 100755 new mode 100644 index 8f703c58..5592e615 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/heapq.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/heapq.pyi @@ -1,18 +1,14 @@ -# Stubs for heapq - -# Based on http://docs.python.org/3.2/library/heapq.html - -from typing import TypeVar, List, Iterable, Any, Callable, Optional - -_T = TypeVar('_T') - -def heappush(heap: List[_T], item: _T) -> None: ... -def heappop(heap: List[_T]) -> _T: ... -def heappushpop(heap: List[_T], item: _T) -> _T: ... -def heapify(x: List[_T]) -> None: ... -def heapreplace(heap: List[_T], item: _T) -> _T: ... -def merge(*iterables: Iterable[_T], key: Callable[[_T], Any] = ..., reverse: bool = ...) -> Iterable[_T]: ... -def nlargest(n: int, iterable: Iterable[_T], - key: Optional[Callable[[_T], Any]] = ...) -> List[_T]: ... -def nsmallest(n: int, iterable: Iterable[_T], - key: Callable[[_T], Any] = ...) -> List[_T]: ... +from _typeshed import SupportsLessThan +from typing import Any, Callable, Iterable, List, Optional, TypeVar + +_T = TypeVar("_T") + +def heappush(__heap: List[_T], __item: _T) -> None: ... +def heappop(__heap: List[_T]) -> _T: ... +def heappushpop(__heap: List[_T], __item: _T) -> _T: ... +def heapify(__heap: List[_T]) -> None: ... +def heapreplace(__heap: List[_T], __item: _T) -> _T: ... +def merge(*iterables: Iterable[_T], key: Optional[Callable[[_T], Any]] = ..., reverse: bool = ...) -> Iterable[_T]: ... +def nlargest(n: int, iterable: Iterable[_T], key: Optional[Callable[[_T], SupportsLessThan]] = ...) -> List[_T]: ... +def nsmallest(n: int, iterable: Iterable[_T], key: Optional[Callable[[_T], SupportsLessThan]] = ...) -> List[_T]: ... +def _heapify_max(__x: List[_T]) -> None: ... # undocumented diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/html/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/html/__init__.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/html/entities.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/html/entities.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/html/parser.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/html/parser.pyi old mode 100755 new mode 100644 index 4c037845..31240f78 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/html/parser.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/html/parser.pyi @@ -1,5 +1,5 @@ -from typing import List, Optional, Tuple from _markupbase import ParserBase +from typing import List, Optional, Tuple class HTMLParser(ParserBase): def __init__(self, *, convert_charrefs: bool = ...) -> None: ... @@ -8,12 +8,9 @@ class HTMLParser(ParserBase): def reset(self) -> None: ... def getpos(self) -> Tuple[int, int]: ... def get_starttag_text(self) -> Optional[str]: ... - - def handle_starttag(self, tag: str, - attrs: List[Tuple[str, Optional[str]]]) -> None: ... + def handle_starttag(self, tag: str, attrs: List[Tuple[str, Optional[str]]]) -> None: ... def handle_endtag(self, tag: str) -> None: ... - def handle_startendtag(self, tag: str, - attrs: List[Tuple[str, Optional[str]]]) -> None: ... + def handle_startendtag(self, tag: str, attrs: List[Tuple[str, Optional[str]]]) -> None: ... def handle_data(self, data: str) -> None: ... def handle_entityref(self, name: str) -> None: ... def handle_charref(self, name: str) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/http/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/http/__init__.pyi old mode 100755 new mode 100644 index 8e12f799..93895549 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/http/__init__.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/http/__init__.pyi @@ -1,5 +1,6 @@ import sys from enum import IntEnum +from typing_extensions import Literal class HTTPStatus(IntEnum): @property @@ -65,3 +66,9 @@ class HTTPStatus(IntEnum): NETWORK_AUTHENTICATION_REQUIRED: int if sys.version_info >= (3, 7): MISDIRECTED_REQUEST: int + if sys.version_info >= (3, 8): + UNAVAILABLE_FOR_LEGAL_REASONS: int + if sys.version_info >= (3, 9): + EARLY_HINTS: Literal[103] + IM_A_TEAPOT: Literal[418] + TOO_EARLY: Literal[425] diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/http/client.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/http/client.pyi old mode 100755 new mode 100644 index 02e8d700..34402e40 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/http/client.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/http/client.pyi @@ -1,19 +1,30 @@ -from typing import ( - Any, Dict, IO, Iterable, List, Iterator, Mapping, Optional, - Protocol, Tuple, Type, TypeVar, - Union, - overload, - BinaryIO, -) import email.message import io -from socket import socket -import sys import ssl +import sys import types +from socket import socket +from typing import ( + IO, + Any, + BinaryIO, + Callable, + Dict, + Iterable, + Iterator, + List, + Mapping, + Optional, + Protocol, + Tuple, + Type, + TypeVar, + Union, + overload, +) _DataType = Union[bytes, IO[Any], Iterable[bytes], str] -_T = TypeVar('_T') +_T = TypeVar("_T") HTTP_PORT: int HTTPS_PORT: int @@ -80,6 +91,8 @@ responses: Dict[int, str] class HTTPMessage(email.message.Message): ... +def parse_headers(fp: io.BufferedIOBase, _class: Callable[[], email.message.Message] = ...) -> HTTPMessage: ... + class HTTPResponse(io.BufferedIOBase, BinaryIO): msg: HTTPMessage headers: HTTPMessage @@ -88,8 +101,7 @@ class HTTPResponse(io.BufferedIOBase, BinaryIO): closed: bool status: int reason: str - def __init__(self, sock: socket, debuglevel: int = ..., - method: Optional[str] = ..., url: Optional[str] = ...) -> None: ... + def __init__(self, sock: socket, debuglevel: int = ..., method: Optional[str] = ..., url: Optional[str] = ...) -> None: ... def read(self, amt: Optional[int] = ...) -> bytes: ... @overload def getheader(self, name: str) -> Optional[str]: ... @@ -100,9 +112,9 @@ class HTTPResponse(io.BufferedIOBase, BinaryIO): def isclosed(self) -> bool: ... def __iter__(self) -> Iterator[bytes]: ... def __enter__(self) -> HTTPResponse: ... - def __exit__(self, exc_type: Optional[Type[BaseException]], - exc_val: Optional[BaseException], - exc_tb: Optional[types.TracebackType]) -> Optional[bool]: ... + def __exit__( + self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[types.TracebackType] + ) -> Optional[bool]: ... def info(self) -> email.message.Message: ... def geturl(self) -> str: ... def getcode(self) -> int: ... @@ -122,64 +134,66 @@ class _HTTPConnectionProtocol(Protocol): ) -> HTTPConnection: ... else: def __call__( - self, host: str, port: Optional[int] = ..., timeout: float = ..., source_address: Optional[Tuple[str, int]] = ..., + self, host: str, port: Optional[int] = ..., timeout: float = ..., source_address: Optional[Tuple[str, int]] = ... ) -> HTTPConnection: ... class HTTPConnection: - timeout: float + timeout: Optional[float] host: str port: int sock: Any if sys.version_info >= (3, 7): def __init__( self, - host: str, port: Optional[int] = ..., - timeout: float = ..., - source_address: Optional[Tuple[str, int]] = ..., blocksize: int = ... + host: str, + port: Optional[int] = ..., + timeout: Optional[float] = ..., + source_address: Optional[Tuple[str, int]] = ..., + blocksize: int = ..., ) -> None: ... else: def __init__( self, - host: str, port: Optional[int] = ..., - timeout: float = ..., - source_address: Optional[Tuple[str, int]] = ... + host: str, + port: Optional[int] = ..., + timeout: Optional[float] = ..., + source_address: Optional[Tuple[str, int]] = ..., ) -> None: ... - if sys.version_info >= (3, 6): - def request(self, method: str, url: str, - body: Optional[_DataType] = ..., - headers: Mapping[str, str] = ..., - *, encode_chunked: bool = ...) -> None: ... - else: - def request(self, method: str, url: str, - body: Optional[_DataType] = ..., - headers: Mapping[str, str] = ...) -> None: ... + def request( + self, + method: str, + url: str, + body: Optional[_DataType] = ..., + headers: Mapping[str, str] = ..., + *, + encode_chunked: bool = ..., + ) -> None: ... def getresponse(self) -> HTTPResponse: ... def set_debuglevel(self, level: int) -> None: ... - def set_tunnel(self, host: str, port: Optional[int] = ..., - headers: Optional[Mapping[str, str]] = ...) -> None: ... + def set_tunnel(self, host: str, port: Optional[int] = ..., headers: Optional[Mapping[str, str]] = ...) -> None: ... def connect(self) -> None: ... def close(self) -> None: ... - def putrequest(self, method: str, url: str, skip_host: bool = ..., - skip_accept_encoding: bool = ...) -> None: ... + def putrequest(self, method: str, url: str, skip_host: bool = ..., skip_accept_encoding: bool = ...) -> None: ... def putheader(self, header: str, *argument: str) -> None: ... - if sys.version_info >= (3, 6): - def endheaders(self, message_body: Optional[_DataType] = ..., - *, encode_chunked: bool = ...) -> None: ... - else: - def endheaders(self, message_body: Optional[_DataType] = ...) -> None: ... + def endheaders(self, message_body: Optional[_DataType] = ..., *, encode_chunked: bool = ...) -> None: ... def send(self, data: _DataType) -> None: ... class HTTPSConnection(HTTPConnection): - def __init__(self, - host: str, port: Optional[int] = ..., - key_file: Optional[str] = ..., - cert_file: Optional[str] = ..., - timeout: float = ..., - source_address: Optional[Tuple[str, int]] = ..., - *, context: Optional[ssl.SSLContext] = ..., - check_hostname: Optional[bool] = ...) -> None: ... + def __init__( + self, + host: str, + port: Optional[int] = ..., + key_file: Optional[str] = ..., + cert_file: Optional[str] = ..., + timeout: Optional[float] = ..., + source_address: Optional[Tuple[str, int]] = ..., + *, + context: Optional[ssl.SSLContext] = ..., + check_hostname: Optional[bool] = ..., + ) -> None: ... class HTTPException(Exception): ... + error = HTTPException class NotConnected(HTTPException): ... @@ -188,13 +202,10 @@ class UnknownProtocol(HTTPException): ... class UnknownTransferEncoding(HTTPException): ... class UnimplementedFileMode(HTTPException): ... class IncompleteRead(HTTPException): ... - class ImproperConnectionState(HTTPException): ... class CannotSendRequest(ImproperConnectionState): ... class CannotSendHeader(ImproperConnectionState): ... class ResponseNotReady(ImproperConnectionState): ... - class BadStatusLine(HTTPException): ... class LineTooLong(HTTPException): ... - class RemoteDisconnected(ConnectionResetError, BadStatusLine): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/http/cookiejar.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/http/cookiejar.pyi old mode 100755 new mode 100644 index 9e31fb99..7ff7544a --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/http/cookiejar.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/http/cookiejar.pyi @@ -1,25 +1,22 @@ -from typing import Dict, Iterable, Iterator, Optional, Sequence, Tuple, TypeVar, Union, overload +import sys from http.client import HTTPResponse +from os import PathLike +from typing import Dict, Iterable, Iterator, Optional, Sequence, Tuple, TypeVar, Union, overload from urllib.request import Request -_T = TypeVar('_T') +_T = TypeVar("_T") class LoadError(OSError): ... - class CookieJar(Iterable[Cookie]): def __init__(self, policy: Optional[CookiePolicy] = ...) -> None: ... def add_cookie_header(self, request: Request) -> None: ... - def extract_cookies(self, response: HTTPResponse, - request: Request) -> None: ... + def extract_cookies(self, response: HTTPResponse, request: Request) -> None: ... def set_policy(self, policy: CookiePolicy) -> None: ... - def make_cookies(self, response: HTTPResponse, - request: Request) -> Sequence[Cookie]: ... + def make_cookies(self, response: HTTPResponse, request: Request) -> Sequence[Cookie]: ... def set_cookie(self, cookie: Cookie) -> None: ... - def set_cookie_if_ok(self, cookie: Cookie, - request: Request) -> None: ... - def clear(self, domain: str = ..., path: str = ..., - name: str = ...) -> None: ... + def set_cookie_if_ok(self, cookie: Cookie, request: Request) -> None: ... + def clear(self, domain: str = ..., path: str = ..., name: str = ...) -> None: ... def clear_session_cookies(self) -> None: ... def __iter__(self) -> Iterator[Cookie]: ... def __len__(self) -> int: ... @@ -27,14 +24,15 @@ class CookieJar(Iterable[Cookie]): class FileCookieJar(CookieJar): filename: str delayload: bool - def __init__(self, filename: str = ..., delayload: bool = ..., - policy: Optional[CookiePolicy] = ...) -> None: ... - def save(self, filename: Optional[str] = ..., ignore_discard: bool = ..., - ignore_expires: bool = ...) -> None: ... - def load(self, filename: Optional[str] = ..., ignore_discard: bool = ..., - ignore_expires: bool = ...) -> None: ... - def revert(self, filename: Optional[str] = ..., ignore_discard: bool = ..., - ignore_expires: bool = ...) -> None: ... + if sys.version_info >= (3, 8): + def __init__( + self, filename: Union[str, PathLike[str]] = ..., delayload: bool = ..., policy: Optional[CookiePolicy] = ... + ) -> None: ... + else: + def __init__(self, filename: str = ..., delayload: bool = ..., policy: Optional[CookiePolicy] = ...) -> None: ... + def save(self, filename: Optional[str] = ..., ignore_discard: bool = ..., ignore_expires: bool = ...) -> None: ... + def load(self, filename: Optional[str] = ..., ignore_discard: bool = ..., ignore_expires: bool = ...) -> None: ... + def revert(self, filename: Optional[str] = ..., ignore_discard: bool = ..., ignore_expires: bool = ...) -> None: ... class MozillaCookieJar(FileCookieJar): ... @@ -50,7 +48,6 @@ class CookiePolicy: def domain_return_ok(self, domain: str, request: Request) -> bool: ... def path_return_ok(self, path: str, request: Request) -> bool: ... - class DefaultCookiePolicy(CookiePolicy): rfc2109_as_netscape: bool strict_domain: bool @@ -64,17 +61,21 @@ class DefaultCookiePolicy(CookiePolicy): DomainRFC2965Match: int DomainLiberal: int DomainStrict: int - def __init__(self, blocked_domains: Optional[Sequence[str]] = ..., - allowed_domains: Optional[Sequence[str]] = ..., - netscape: bool = ..., - rfc2965: bool = ..., - rfc2109_as_netscape: Optional[bool] = ..., - hide_cookie2: bool = ..., strict_domain: bool = ..., - strict_rfc2965_unverifiable: bool = ..., - strict_ns_unverifiable: bool = ..., - strict_ns_domain: int = ..., - strict_ns_set_initial_dollar: bool = ..., - strict_ns_set_path: bool = ...) -> None: ... + def __init__( + self, + blocked_domains: Optional[Sequence[str]] = ..., + allowed_domains: Optional[Sequence[str]] = ..., + netscape: bool = ..., + rfc2965: bool = ..., + rfc2109_as_netscape: Optional[bool] = ..., + hide_cookie2: bool = ..., + strict_domain: bool = ..., + strict_rfc2965_unverifiable: bool = ..., + strict_ns_unverifiable: bool = ..., + strict_ns_domain: int = ..., + strict_ns_set_initial_dollar: bool = ..., + strict_ns_set_path: bool = ..., + ) -> None: ... def blocked_domains(self) -> Tuple[str, ...]: ... def set_blocked_domains(self, blocked_domains: Sequence[str]) -> None: ... def is_blocked(self, domain: str) -> bool: ... @@ -82,13 +83,13 @@ class DefaultCookiePolicy(CookiePolicy): def set_allowed_domains(self, allowed_domains: Optional[Sequence[str]]) -> None: ... def is_not_allowed(self, domain: str) -> bool: ... - class Cookie: version: Optional[int] name: str value: Optional[str] port: Optional[str] path: str + path_specified: bool secure: bool expires: Optional[int] discard: bool @@ -99,14 +100,26 @@ class Cookie: domain: str # undocumented domain_specified: bool domain_initial_dot: bool - def __init__(self, version: Optional[int], name: str, value: Optional[str], # undocumented - port: Optional[str], port_specified: bool, - domain: str, domain_specified: bool, domain_initial_dot: bool, - path: str, path_specified: bool, - secure: bool, expires: Optional[int], discard: bool, - comment: Optional[str], comment_url: Optional[str], - rest: Dict[str, str], - rfc2109: bool = ...) -> None: ... + def __init__( + self, + version: Optional[int], + name: str, + value: Optional[str], # undocumented + port: Optional[str], + port_specified: bool, + domain: str, + domain_specified: bool, + domain_initial_dot: bool, + path: str, + path_specified: bool, + secure: bool, + expires: Optional[int], + discard: bool, + comment: Optional[str], + comment_url: Optional[str], + rest: Dict[str, str], + rfc2109: bool = ..., + ) -> None: ... def has_nonstandard_attr(self, name: str) -> bool: ... @overload def get_nonstandard_attr(self, name: str) -> Optional[str]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/http/cookies.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/http/cookies.pyi old mode 100755 new mode 100644 index 886d3c71..fe2b4f92 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/http/cookies.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/http/cookies.pyi @@ -1,9 +1,8 @@ -# Stubs for http.cookies (Python 3.5) - -from typing import Generic, Dict, List, Mapping, Optional, TypeVar, Union, Any +import sys +from typing import Any, Dict, Generic, List, Mapping, Optional, TypeVar, Union _DataType = Union[str, Mapping[str, Union[str, Morsel[Any]]]] -_T = TypeVar('_T') +_T = TypeVar("_T") class CookieError(Exception): ... @@ -11,10 +10,12 @@ class Morsel(Dict[str, Any], Generic[_T]): value: str coded_value: _T key: str - def set(self, key: str, val: str, coded_val: _T) -> None: ... + if sys.version_info >= (3, 7): + def set(self, key: str, val: str, coded_val: _T) -> None: ... + else: + def set(self, key: str, val: str, coded_val: _T, LegalChars: str = ...) -> None: ... def isReservedKey(self, K: str) -> bool: ... - def output(self, attrs: Optional[List[str]] = ..., - header: str = ...) -> str: ... + def output(self, attrs: Optional[List[str]] = ..., header: str = ...) -> str: ... def js_output(self, attrs: Optional[List[str]] = ...) -> str: ... def OutputString(self, attrs: Optional[List[str]] = ...) -> str: ... @@ -22,8 +23,7 @@ class BaseCookie(Dict[str, Morsel[_T]], Generic[_T]): def __init__(self, input: Optional[_DataType] = ...) -> None: ... def value_decode(self, val: str) -> _T: ... def value_encode(self, val: _T) -> str: ... - def output(self, attrs: Optional[List[str]] = ..., header: str = ..., - sep: str = ...) -> str: ... + def output(self, attrs: Optional[List[str]] = ..., header: str = ..., sep: str = ...) -> str: ... def js_output(self, attrs: Optional[List[str]] = ...) -> str: ... def load(self, rawdata: _DataType) -> None: ... def __setitem__(self, key: str, value: Union[str, Morsel[_T]]) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/http/server.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/http/server.pyi old mode 100755 new mode 100644 index 701199a7..995a089a --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/http/server.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/http/server.pyi @@ -1,9 +1,7 @@ -# Stubs for http.server (Python 3.4) - -import sys -from typing import Any, BinaryIO, Callable, ClassVar, Dict, List, Mapping, Optional, Sequence, Tuple, Union -import socketserver import email.message +import socketserver +import sys +from typing import Any, Callable, ClassVar, Dict, List, Mapping, Optional, Sequence, Tuple, Union if sys.version_info >= (3, 7): from builtins import _PathLike @@ -11,14 +9,13 @@ if sys.version_info >= (3, 7): class HTTPServer(socketserver.TCPServer): server_name: str server_port: int - def __init__(self, server_address: Tuple[str, int], - RequestHandlerClass: Callable[..., BaseHTTPRequestHandler]) -> None: ... + def __init__(self, server_address: Tuple[str, int], RequestHandlerClass: Callable[..., BaseHTTPRequestHandler]) -> None: ... if sys.version_info >= (3, 7): class ThreadingHTTPServer(socketserver.ThreadingMixIn, HTTPServer): daemon_threads: bool # undocumented -class BaseHTTPRequestHandler: +class BaseHTTPRequestHandler(socketserver.StreamRequestHandler): client_address: Tuple[str, int] server: socketserver.BaseServer close_connection: bool @@ -27,8 +24,6 @@ class BaseHTTPRequestHandler: path: str request_version: str headers: email.message.Message - rfile: BinaryIO - wfile: BinaryIO server_version: str sys_version: str error_message_format: str @@ -38,22 +33,17 @@ class BaseHTTPRequestHandler: responses: Mapping[int, Tuple[str, str]] weekdayname: ClassVar[Sequence[str]] = ... # Undocumented monthname: ClassVar[Sequence[Optional[str]]] = ... # Undocumented - def __init__(self, request: bytes, client_address: Tuple[str, int], - server: socketserver.BaseServer) -> None: ... + def __init__(self, request: bytes, client_address: Tuple[str, int], server: socketserver.BaseServer) -> None: ... def handle(self) -> None: ... def handle_one_request(self) -> None: ... def handle_expect_100(self) -> bool: ... - def send_error(self, code: int, message: Optional[str] = ..., - explain: Optional[str] = ...) -> None: ... - def send_response(self, code: int, - message: Optional[str] = ...) -> None: ... + def send_error(self, code: int, message: Optional[str] = ..., explain: Optional[str] = ...) -> None: ... + def send_response(self, code: int, message: Optional[str] = ...) -> None: ... def send_header(self, keyword: str, value: str) -> None: ... - def send_response_only(self, code: int, - message: Optional[str] = ...) -> None: ... + def send_response_only(self, code: int, message: Optional[str] = ...) -> None: ... def end_headers(self) -> None: ... def flush_headers(self) -> None: ... - def log_request(self, code: Union[int, str] = ..., - size: Union[int, str] = ...) -> None: ... + def log_request(self, code: Union[int, str] = ..., size: Union[int, str] = ...) -> None: ... def log_error(self, format: str, *args: Any) -> None: ... def log_message(self, format: str, *args: Any) -> None: ... def version_string(self) -> str: ... @@ -65,11 +55,15 @@ class BaseHTTPRequestHandler: class SimpleHTTPRequestHandler(BaseHTTPRequestHandler): extensions_map: Dict[str, str] if sys.version_info >= (3, 7): - def __init__(self, request: bytes, client_address: Tuple[str, int], - server: socketserver.BaseServer, directory: Optional[Union[str, _PathLike[str]]]) -> None: ... + def __init__( + self, + request: bytes, + client_address: Tuple[str, int], + server: socketserver.BaseServer, + directory: Optional[Union[str, _PathLike[str]]] = ..., + ) -> None: ... else: - def __init__(self, request: bytes, client_address: Tuple[str, int], - server: socketserver.BaseServer) -> None: ... + def __init__(self, request: bytes, client_address: Tuple[str, int], server: socketserver.BaseServer) -> None: ... def do_GET(self) -> None: ... def do_HEAD(self) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/imp.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/imp.pyi old mode 100755 new mode 100644 index 5f17fe5d..adcf6e09 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/imp.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/imp.pyi @@ -1,22 +1,21 @@ -# Stubs for imp (Python 3.6) - import os -import sys import types -from typing import Any, IO, List, Optional, Tuple, TypeVar, Union - -from _imp import (lock_held as lock_held, acquire_lock as acquire_lock, release_lock as release_lock, - get_frozen_object as get_frozen_object, is_frozen_package as is_frozen_package, - init_frozen as init_frozen, is_builtin as is_builtin, is_frozen as is_frozen) - -from _imp import create_dynamic as create_dynamic +from _typeshed import StrPath +from typing import IO, Any, List, Optional, Protocol, Tuple, TypeVar, Union -_T = TypeVar('_T') +from _imp import ( + acquire_lock as acquire_lock, + create_dynamic as create_dynamic, + get_frozen_object as get_frozen_object, + init_frozen as init_frozen, + is_builtin as is_builtin, + is_frozen as is_frozen, + is_frozen_package as is_frozen_package, + lock_held as lock_held, + release_lock as release_lock, +) -if sys.version_info >= (3, 6): - _Path = Union[str, os.PathLike[str]] -else: - _Path = str +_T = TypeVar("_T") SEARCH_ERROR: int PY_SOURCE: int @@ -32,23 +31,34 @@ IMP_HOOK: int def new_module(name: str) -> types.ModuleType: ... def get_magic() -> bytes: ... def get_tag() -> str: ... -def cache_from_source(path: _Path, debug_override: Optional[bool] = ...) -> str: ... -def source_from_cache(path: _Path) -> str: ... +def cache_from_source(path: StrPath, debug_override: Optional[bool] = ...) -> str: ... +def source_from_cache(path: StrPath) -> str: ... def get_suffixes() -> List[Tuple[str, str, int]]: ... class NullImporter: - def __init__(self, path: _Path) -> None: ... + def __init__(self, path: StrPath) -> None: ... def find_module(self, fullname: Any) -> None: ... +# Technically, a text file has to support a slightly different set of operations than a binary file, +# but we ignore that here. +class _FileLike(Protocol): + closed: bool + mode: str + def read(self) -> Union[str, bytes]: ... + def close(self) -> Any: ... + def __enter__(self) -> Any: ... + def __exit__(self, *args: Any) -> Any: ... + # PathLike doesn't work for the pathname argument here -def load_source(name: str, pathname: str, file: Optional[IO[Any]] = ...) -> types.ModuleType: ... -def load_compiled(name: str, pathname: str, file: Optional[IO[Any]] = ...) -> types.ModuleType: ... -def load_package(name: str, path: _Path) -> types.ModuleType: ... -def load_module(name: str, file: IO[Any], filename: str, details: Tuple[str, str, int]) -> types.ModuleType: ... -if sys.version_info >= (3, 6): - def find_module(name: str, path: Union[None, List[str], List[os.PathLike[str]], List[_Path]] = ...) -> Tuple[IO[Any], str, Tuple[str, str, int]]: ... -else: - def find_module(name: str, path: Optional[List[str]] = ...) -> Tuple[IO[Any], str, Tuple[str, str, int]]: ... +def load_source(name: str, pathname: str, file: Optional[_FileLike] = ...) -> types.ModuleType: ... +def load_compiled(name: str, pathname: str, file: Optional[_FileLike] = ...) -> types.ModuleType: ... +def load_package(name: str, path: StrPath) -> types.ModuleType: ... +def load_module(name: str, file: Optional[_FileLike], filename: str, details: Tuple[str, str, int]) -> types.ModuleType: ... + +# IO[Any] is a TextIOWrapper if name is a .py file, and a FileIO otherwise. +def find_module( + name: str, path: Union[None, List[str], List[os.PathLike[str]], List[StrPath]] = ... +) -> Tuple[IO[Any], str, Tuple[str, str, int]]: ... def reload(module: types.ModuleType) -> types.ModuleType: ... def init_builtin(name: str) -> Optional[types.ModuleType]: ... -def load_dynamic(name: str, path: str, file: Optional[IO[Any]] = ...) -> types.ModuleType: ... +def load_dynamic(name: str, path: str, file: Any = ...) -> types.ModuleType: ... # file argument is ignored diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/importlib/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/importlib/__init__.pyi old mode 100755 new mode 100644 index e44f4241..d55393df --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/importlib/__init__.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/importlib/__init__.pyi @@ -1,16 +1,15 @@ -from importlib.abc import Loader import types +from importlib.abc import Loader from typing import Any, Mapping, Optional, Sequence -def __import__(name: str, globals: Optional[Mapping[str, Any]] = ..., - locals: Optional[Mapping[str, Any]] = ..., - fromlist: Sequence[str] = ..., - level: int = ...) -> types.ModuleType: ... - +def __import__( + name: str, + globals: Optional[Mapping[str, Any]] = ..., + locals: Optional[Mapping[str, Any]] = ..., + fromlist: Sequence[str] = ..., + level: int = ..., +) -> types.ModuleType: ... def import_module(name: str, package: Optional[str] = ...) -> types.ModuleType: ... - def find_loader(name: str, path: Optional[str] = ...) -> Optional[Loader]: ... - def invalidate_caches() -> None: ... - def reload(module: types.ModuleType) -> types.ModuleType: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/importlib/abc.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/importlib/abc.pyi old mode 100755 new mode 100644 index 709ba44f..507d3a59 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/importlib/abc.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/importlib/abc.pyi @@ -1,25 +1,17 @@ -from abc import ABCMeta, abstractmethod import os import sys import types -from typing import Any, IO, Iterator, Mapping, Optional, Sequence, Tuple, Union +from abc import ABCMeta, abstractmethod +from typing import IO, Any, Iterator, Mapping, Optional, Sequence, Tuple, Union +from typing_extensions import Literal # Loader is exported from this module, but for circular import reasons # exists in its own stub file (with ModuleSpec and ModuleType). -from _importlib_modulespec import Loader as Loader # Exported - -from _importlib_modulespec import ModuleSpec +from _importlib_modulespec import Loader as Loader, ModuleSpec # Exported _Path = Union[bytes, str] -class Finder(metaclass=ABCMeta): - ... - # Technically this class defines the following method, but its subclasses - # in this module violate its signature. Since this class is deprecated, it's - # easier to simply ignore that this method exists. - # @abstractmethod - # def find_module(self, fullname: str, - # path: Optional[Sequence[_Path]] = ...) -> Optional[Loader]: ... +class Finder(metaclass=ABCMeta): ... class ResourceLoader(Loader): @abstractmethod @@ -46,30 +38,20 @@ class SourceLoader(ResourceLoader, ExecutionLoader, metaclass=ABCMeta): def get_source(self, fullname: str) -> Optional[str]: ... def path_stats(self, path: _Path) -> Mapping[str, Any]: ... - class MetaPathFinder(Finder): - def find_module(self, fullname: str, - path: Optional[Sequence[_Path]]) -> Optional[Loader]: - ... + def find_module(self, fullname: str, path: Optional[Sequence[_Path]]) -> Optional[Loader]: ... def invalidate_caches(self) -> None: ... # Not defined on the actual class, but expected to exist. def find_spec( - self, fullname: str, path: Optional[Sequence[_Path]], - target: Optional[types.ModuleType] = ... - ) -> Optional[ModuleSpec]: - ... + self, fullname: str, path: Optional[Sequence[_Path]], target: Optional[types.ModuleType] = ... + ) -> Optional[ModuleSpec]: ... class PathEntryFinder(Finder): def find_module(self, fullname: str) -> Optional[Loader]: ... - def find_loader( - self, fullname: str - ) -> Tuple[Optional[Loader], Sequence[_Path]]: ... + def find_loader(self, fullname: str) -> Tuple[Optional[Loader], Sequence[_Path]]: ... def invalidate_caches(self) -> None: ... # Not defined on the actual class, but expected to exist. - def find_spec( - self, fullname: str, - target: Optional[types.ModuleType] = ... - ) -> Optional[ModuleSpec]: ... + def find_spec(self, fullname: str, target: Optional[types.ModuleType] = ...) -> Optional[ModuleSpec]: ... class FileLoader(ResourceLoader, ExecutionLoader, metaclass=ABCMeta): name: str @@ -80,7 +62,6 @@ class FileLoader(ResourceLoader, ExecutionLoader, metaclass=ABCMeta): if sys.version_info >= (3, 7): _PathLike = Union[bytes, str, os.PathLike[Any]] - class ResourceReader(metaclass=ABCMeta): @abstractmethod def open_resource(self, resource: _PathLike) -> IO[bytes]: ... @@ -90,3 +71,27 @@ if sys.version_info >= (3, 7): def is_resource(self, name: str) -> bool: ... @abstractmethod def contents(self) -> Iterator[str]: ... + +if sys.version_info >= (3, 9): + from typing import Protocol, runtime_checkable + @runtime_checkable + class Traversable(Protocol): + @abstractmethod + def iterdir(self) -> Iterator[Traversable]: ... + @abstractmethod + def read_bytes(self) -> bytes: ... + @abstractmethod + def read_text(self, encoding: Optional[str] = ...) -> str: ... + @abstractmethod + def is_dir(self) -> bool: ... + @abstractmethod + def is_file(self) -> bool: ... + @abstractmethod + def joinpath(self, child: Traversable) -> Traversable: ... + @abstractmethod + def __truediv__(self, child: Traversable) -> Traversable: ... + @abstractmethod + def open(self, mode: Literal["r", "rb"] = ..., *args: Any, **kwargs: Any) -> IO: ... + @property + @abstractmethod + def name(self) -> str: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/importlib/machinery.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/importlib/machinery.pyi old mode 100755 new mode 100644 index 746c5026..9d0333a2 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/importlib/machinery.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/importlib/machinery.pyi @@ -1,25 +1,19 @@ import importlib.abc import types -from typing import Any, Callable, List, Optional, Sequence, Tuple +from typing import Callable, List, Optional, Sequence, Tuple, Union # ModuleSpec is exported from this module, but for circular import # reasons exists in its own stub file (with Loader and ModuleType). -from _importlib_modulespec import ModuleSpec as ModuleSpec # Exported +from _importlib_modulespec import Loader, ModuleSpec as ModuleSpec # Exported -class BuiltinImporter(importlib.abc.MetaPathFinder, - importlib.abc.InspectLoader): +class BuiltinImporter(importlib.abc.MetaPathFinder, importlib.abc.InspectLoader): # MetaPathFinder @classmethod - def find_module( - cls, fullname: str, - path: Optional[Sequence[importlib.abc._Path]] - ) -> Optional[importlib.abc.Loader]: - ... + def find_module(cls, fullname: str, path: Optional[Sequence[importlib.abc._Path]]) -> Optional[importlib.abc.Loader]: ... @classmethod - def find_spec(cls, fullname: str, - path: Optional[Sequence[importlib.abc._Path]], - target: Optional[types.ModuleType] = ...) -> Optional[ModuleSpec]: - ... + def find_spec( + cls, fullname: str, path: Optional[Sequence[importlib.abc._Path]], target: Optional[types.ModuleType] = ... + ) -> Optional[ModuleSpec]: ... # InspectLoader @classmethod def is_package(cls, fullname: str) -> bool: ... @@ -40,16 +34,11 @@ class BuiltinImporter(importlib.abc.MetaPathFinder, class FrozenImporter(importlib.abc.MetaPathFinder, importlib.abc.InspectLoader): # MetaPathFinder @classmethod - def find_module( - cls, fullname: str, - path: Optional[Sequence[importlib.abc._Path]] - ) -> Optional[importlib.abc.Loader]: - ... + def find_module(cls, fullname: str, path: Optional[Sequence[importlib.abc._Path]]) -> Optional[importlib.abc.Loader]: ... @classmethod - def find_spec(cls, fullname: str, - path: Optional[Sequence[importlib.abc._Path]], - target: Optional[types.ModuleType] = ...) -> Optional[ModuleSpec]: - ... + def find_spec( + cls, fullname: str, path: Optional[Sequence[importlib.abc._Path]], target: Optional[types.ModuleType] = ... + ) -> Optional[ModuleSpec]: ... # InspectLoader @classmethod def is_package(cls, fullname: str) -> bool: ... @@ -63,25 +52,27 @@ class FrozenImporter(importlib.abc.MetaPathFinder, importlib.abc.InspectLoader): @staticmethod def module_repr(module: types.ModuleType) -> str: ... @classmethod - def create_module(cls, spec: ModuleSpec) -> Optional[types.ModuleType]: - ... + def create_module(cls, spec: ModuleSpec) -> Optional[types.ModuleType]: ... @staticmethod def exec_module(module: types.ModuleType) -> None: ... class WindowsRegistryFinder(importlib.abc.MetaPathFinder): @classmethod - def find_module( - cls, fullname: str, - path: Optional[Sequence[importlib.abc._Path]] - ) -> Optional[importlib.abc.Loader]: - ... + def find_module(cls, fullname: str, path: Optional[Sequence[importlib.abc._Path]]) -> Optional[importlib.abc.Loader]: ... @classmethod - def find_spec(cls, fullname: str, - path: Optional[Sequence[importlib.abc._Path]], - target: Optional[types.ModuleType] = ...) -> Optional[ModuleSpec]: - ... + def find_spec( + cls, fullname: str, path: Optional[Sequence[importlib.abc._Path]], target: Optional[types.ModuleType] = ... + ) -> Optional[ModuleSpec]: ... -class PathFinder(importlib.abc.MetaPathFinder): ... +class PathFinder: + @classmethod + def invalidate_caches(cls) -> None: ... + @classmethod + def find_spec( + cls, fullname: str, path: Optional[Sequence[Union[bytes, str]]] = ..., target: Optional[types.ModuleType] = ... + ) -> Optional[ModuleSpec]: ... + @classmethod + def find_module(cls, fullname: str, path: Optional[Sequence[Union[bytes, str]]] = ...) -> Optional[Loader]: ... SOURCE_SUFFIXES: List[str] DEBUG_BYTECODE_SUFFIXES: List[str] @@ -93,22 +84,14 @@ def all_suffixes() -> List[str]: ... class FileFinder(importlib.abc.PathEntryFinder): path: str - def __init__( - self, path: str, - *loader_details: Tuple[importlib.abc.Loader, List[str]] - ) -> None: ... + def __init__(self, path: str, *loader_details: Tuple[importlib.abc.Loader, List[str]]) -> None: ... @classmethod def path_hook( cls, *loader_details: Tuple[importlib.abc.Loader, List[str]] ) -> Callable[[str], importlib.abc.PathEntryFinder]: ... -class SourceFileLoader(importlib.abc.FileLoader, - importlib.abc.SourceLoader): - ... - -class SourcelessFileLoader(importlib.abc.FileLoader, - importlib.abc.SourceLoader): - ... +class SourceFileLoader(importlib.abc.FileLoader, importlib.abc.SourceLoader): ... +class SourcelessFileLoader(importlib.abc.FileLoader, importlib.abc.SourceLoader): ... class ExtensionFileLoader(importlib.abc.ExecutionLoader): def get_filename(self, fullname: str) -> importlib.abc._Path: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/importlib/metadata.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/importlib/metadata.pyi old mode 100755 new mode 100644 index b3d01266..99511859 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/importlib/metadata.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/importlib/metadata.pyi @@ -12,6 +12,7 @@ if sys.version_info >= (3, 8): class EntryPointBase(NamedTuple): name: str value: str + group: str class EntryPoint(EntryPointBase): def load(self) -> Any: ... # Callable[[], Any] or an importable module @property diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/importlib/resources.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/importlib/resources.pyi old mode 100755 new mode 100644 index 007477d5..65beccba --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/importlib/resources.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/importlib/resources.pyi @@ -1,25 +1,22 @@ import sys + # This is a >=3.7 module, so we conditionally include its source. if sys.version_info >= (3, 7): import os - from pathlib import Path from types import ModuleType - from typing import ContextManager, Iterator, Union, BinaryIO, TextIO + from typing import BinaryIO, ContextManager, Iterator, TextIO, Union Package = Union[str, ModuleType] Resource = Union[str, os.PathLike] - def open_binary(package: Package, resource: Resource) -> BinaryIO: ... - def open_text(package: Package, - resource: Resource, - encoding: str = ..., - errors: str = ...) -> TextIO: ... + def open_text(package: Package, resource: Resource, encoding: str = ..., errors: str = ...) -> TextIO: ... def read_binary(package: Package, resource: Resource) -> bytes: ... - def read_text(package: Package, - resource: Resource, - encoding: str = ..., - errors: str = ...) -> str: ... + def read_text(package: Package, resource: Resource, encoding: str = ..., errors: str = ...) -> str: ... def path(package: Package, resource: Resource) -> ContextManager[Path]: ... def is_resource(package: Package, name: str) -> bool: ... def contents(package: Package) -> Iterator[str]: ... + +if sys.version_info >= (3, 9): + from importlib.abc import Traversable + def files(package: Package) -> Traversable: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/importlib/util.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/importlib/util.pyi old mode 100755 new mode 100644 index 878d0652..e586f99b --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/importlib/util.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/importlib/util.pyi @@ -1,48 +1,35 @@ import importlib.abc import importlib.machinery -import sys +import os import types from typing import Any, Callable, List, Optional, Union -def module_for_loader( - fxn: Callable[..., types.ModuleType] -) -> Callable[..., types.ModuleType]: ... -def set_loader( - fxn: Callable[..., types.ModuleType] -) -> Callable[..., types.ModuleType]: ... -def set_package( - fxn: Callable[..., types.ModuleType] -) -> Callable[..., types.ModuleType]: ... - +def module_for_loader(fxn: Callable[..., types.ModuleType]) -> Callable[..., types.ModuleType]: ... +def set_loader(fxn: Callable[..., types.ModuleType]) -> Callable[..., types.ModuleType]: ... +def set_package(fxn: Callable[..., types.ModuleType]) -> Callable[..., types.ModuleType]: ... def resolve_name(name: str, package: str) -> str: ... MAGIC_NUMBER: bytes -def cache_from_source(path: str, debug_override: Optional[bool] = ..., *, - optimization: Optional[Any] = ...) -> str: ... +def cache_from_source(path: str, debug_override: Optional[bool] = ..., *, optimization: Optional[Any] = ...) -> str: ... def source_from_cache(path: str) -> str: ... def decode_source(source_bytes: bytes) -> str: ... -def find_spec( - name: str, package: Optional[str] = ... -) -> Optional[importlib.machinery.ModuleSpec]: ... +def find_spec(name: str, package: Optional[str] = ...) -> Optional[importlib.machinery.ModuleSpec]: ... def spec_from_loader( - name: str, loader: Optional[importlib.abc.Loader], *, - origin: Optional[str] = ..., loader_state: Optional[Any] = ..., - is_package: Optional[bool] = ... + name: str, + loader: Optional[importlib.abc.Loader], + *, + origin: Optional[str] = ..., + loader_state: Optional[Any] = ..., + is_package: Optional[bool] = ..., ) -> importlib.machinery.ModuleSpec: ... - -if sys.version_info >= (3, 6): - import os - _Path = Union[str, bytes, os.PathLike] -else: - _Path = str - def spec_from_file_location( - name: str, location: _Path, *, + name: str, + location: Union[str, bytes, os.PathLike[str], os.PathLike[bytes]], + *, loader: Optional[importlib.abc.Loader] = ..., - submodule_search_locations: Optional[List[str]] = ... + submodule_search_locations: Optional[List[str]] = ..., ) -> importlib.machinery.ModuleSpec: ... - def module_from_spec(spec: importlib.machinery.ModuleSpec) -> types.ModuleType: ... class LazyLoader(importlib.abc.Loader): diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/inspect.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/inspect.pyi old mode 100755 new mode 100644 index 6c1afd5e..d0627d54 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/inspect.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/inspect.pyi @@ -1,11 +1,24 @@ +import enum import sys -from typing import (AbstractSet, Any, Callable, Dict, Generator, List, Mapping, - NamedTuple, Optional, Sequence, Tuple, Type, Union, - ) -from types import (CodeType, FrameType, FunctionType, MethodType, ModuleType, - TracebackType, - ) from collections import OrderedDict +from types import CodeType, FrameType, FunctionType, MethodType, ModuleType, TracebackType +from typing import ( + AbstractSet, + Any, + Callable, + ClassVar, + Dict, + Generator, + List, + Mapping, + NamedTuple, + Optional, + Sequence, + Tuple, + Type, + Union, +) +from typing_extensions import Literal # # Types and members @@ -20,8 +33,7 @@ class BlockFinder: indecorator: bool decoratorhasargs: bool last: int - def tokeneater(self, type: int, token: str, srow_scol: Tuple[int, int], - erow_ecol: Tuple[int, int], line: str) -> None: ... + def tokeneater(self, type: int, token: str, srowcol: Tuple[int, int], erowcol: Tuple[int, int], line: str) -> None: ... CO_OPTIMIZED: int CO_NEWLOCALS: int @@ -32,36 +44,35 @@ CO_GENERATOR: int CO_NOFREE: int CO_COROUTINE: int CO_ITERABLE_COROUTINE: int -if sys.version_info >= (3, 6): - CO_ASYNC_GENERATOR: int +CO_ASYNC_GENERATOR: int TPFLAGS_IS_ABSTRACT: int -if sys.version_info < (3, 6): - class ModuleInfo(NamedTuple): - name: str - suffix: str - mode: str - module_type: int - def getmoduleinfo(path: str) -> Optional[ModuleInfo]: ... - -def getmembers(object: object, - predicate: Optional[Callable[[Any], bool]] = ..., - ) -> List[Tuple[str, Any]]: ... +def getmembers(object: object, predicate: Optional[Callable[[Any], bool]] = ...) -> List[Tuple[str, Any]]: ... def getmodulename(path: str) -> Optional[str]: ... - def ismodule(object: object) -> bool: ... def isclass(object: object) -> bool: ... def ismethod(object: object) -> bool: ... def isfunction(object: object) -> bool: ... -def isgeneratorfunction(object: object) -> bool: ... -def isgenerator(object: object) -> bool: ... -def iscoroutinefunction(object: object) -> bool: ... +if sys.version_info >= (3, 8): + def isgeneratorfunction(obj: object) -> bool: ... + def iscoroutinefunction(obj: object) -> bool: ... + +else: + def isgeneratorfunction(object: object) -> bool: ... + def iscoroutinefunction(object: object) -> bool: ... + +def isgenerator(object: object) -> bool: ... def iscoroutine(object: object) -> bool: ... def isawaitable(object: object) -> bool: ... -if sys.version_info >= (3, 6): + +if sys.version_info >= (3, 8): + def isasyncgenfunction(obj: object) -> bool: ... + +else: def isasyncgenfunction(object: object) -> bool: ... - def isasyncgen(object: object) -> bool: ... + +def isasyncgen(object: object) -> bool: ... def istraceback(object: object) -> bool: ... def isframe(object: object) -> bool: ... def iscode(object: object) -> bool: ... @@ -73,38 +84,31 @@ def isdatadescriptor(object: object) -> bool: ... def isgetsetdescriptor(object: object) -> bool: ... def ismemberdescriptor(object: object) -> bool: ... - # # Retrieving source code # _SourceObjectType = Union[ModuleType, Type[Any], MethodType, FunctionType, TracebackType, FrameType, CodeType, Callable[..., Any]] def findsource(object: _SourceObjectType) -> Tuple[List[str], int]: ... -def getabsfile(object: _SourceObjectType) -> str: ... +def getabsfile(object: _SourceObjectType, _filename: Optional[str] = ...) -> str: ... def getblock(lines: Sequence[str]) -> Sequence[str]: ... def getdoc(object: object) -> Optional[str]: ... def getcomments(object: object) -> Optional[str]: ... def getfile(object: _SourceObjectType) -> str: ... -def getmodule(object: object) -> Optional[ModuleType]: ... +def getmodule(object: object, _filename: Optional[str] = ...) -> Optional[ModuleType]: ... def getsourcefile(object: _SourceObjectType) -> Optional[str]: ... def getsourcelines(object: _SourceObjectType) -> Tuple[List[str], int]: ... def getsource(object: _SourceObjectType) -> str: ... def cleandoc(doc: str) -> str: ... def indentsize(line: str) -> int: ... - # # Introspecting callables with the Signature object # -def signature(callable: Callable[..., Any], - *, - follow_wrapped: bool = ...) -> Signature: ... +def signature(obj: Callable[..., Any], *, follow_wrapped: bool = ...) -> Signature: ... class Signature: - def __init__(self, - parameters: Optional[Sequence[Parameter]] = ..., - *, - return_annotation: Any = ...) -> None: ... + def __init__(self, parameters: Optional[Sequence[Parameter]] = ..., *, return_annotation: Any = ...) -> None: ... # TODO: can we be more specific here? empty: object = ... @@ -112,55 +116,48 @@ class Signature: # TODO: can we be more specific here? return_annotation: Any - def bind(self, *args: Any, **kwargs: Any) -> BoundArguments: ... def bind_partial(self, *args: Any, **kwargs: Any) -> BoundArguments: ... - def replace(self, - *, - parameters: Optional[Sequence[Parameter]] = ..., - return_annotation: Any = ...) -> Signature: ... - + def replace(self, *, parameters: Optional[Sequence[Parameter]] = ..., return_annotation: Any = ...) -> Signature: ... @classmethod def from_callable(cls, obj: Callable[..., Any], *, follow_wrapped: bool = ...) -> Signature: ... # The name is the same as the enum's name in CPython -class _ParameterKind: ... +class _ParameterKind(enum.IntEnum): + POSITIONAL_ONLY: int + POSITIONAL_OR_KEYWORD: int + VAR_POSITIONAL: int + KEYWORD_ONLY: int + VAR_KEYWORD: int + + if sys.version_info >= (3, 8): + description: str class Parameter: - def __init__(self, - name: str, - kind: _ParameterKind, - *, - default: Any = ..., - annotation: Any = ...) -> None: ... + def __init__(self, name: str, kind: _ParameterKind, *, default: Any = ..., annotation: Any = ...) -> None: ... empty: Any = ... name: str default: Any annotation: Any kind: _ParameterKind - POSITIONAL_ONLY: _ParameterKind = ... - POSITIONAL_OR_KEYWORD: _ParameterKind = ... - VAR_POSITIONAL: _ParameterKind = ... - KEYWORD_ONLY: _ParameterKind = ... - VAR_KEYWORD: _ParameterKind = ... - - def replace(self, - *, - name: Optional[str] = ..., - kind: Optional[_ParameterKind] = ..., - default: Any = ..., - annotation: Any = ...) -> Parameter: ... + POSITIONAL_ONLY: ClassVar[Literal[_ParameterKind.POSITIONAL_ONLY]] + POSITIONAL_OR_KEYWORD: ClassVar[Literal[_ParameterKind.POSITIONAL_OR_KEYWORD]] + VAR_POSITIONAL: ClassVar[Literal[_ParameterKind.VAR_POSITIONAL]] + KEYWORD_ONLY: ClassVar[Literal[_ParameterKind.KEYWORD_ONLY]] + VAR_KEYWORD: ClassVar[Literal[_ParameterKind.VAR_KEYWORD]] + def replace( + self, *, name: Optional[str] = ..., kind: Optional[_ParameterKind] = ..., default: Any = ..., annotation: Any = ... + ) -> Parameter: ... class BoundArguments: arguments: OrderedDict[str, Any] args: Tuple[Any, ...] kwargs: Dict[str, Any] signature: Signature - + def __init__(self, signature: Signature, arguments: OrderedDict[str, Any]) -> None: ... def apply_defaults(self) -> None: ... - # # Classes and functions # @@ -172,8 +169,8 @@ def getclasstree(classes: List[type], unique: bool = ...) -> Any: ... class ArgSpec(NamedTuple): args: List[str] - varargs: str - keywords: str + varargs: Optional[str] + keywords: Optional[str] defaults: Tuple[Any, ...] class Arguments(NamedTuple): @@ -204,46 +201,42 @@ class ArgInfo(NamedTuple): def getargvalues(frame: FrameType) -> ArgInfo: ... def formatannotation(annotation: object, base_module: Optional[str] = ...) -> str: ... def formatannotationrelativeto(object: object) -> Callable[[object], str]: ... -def formatargspec(args: List[str], - varargs: Optional[str] = ..., - varkw: Optional[str] = ..., - defaults: Optional[Tuple[Any, ...]] = ..., - kwonlyargs: Optional[List[str]] = ..., - kwonlydefaults: Optional[Dict[str, Any]] = ..., - annotations: Dict[str, Any] = ..., - formatarg: Callable[[str], str] = ..., - formatvarargs: Callable[[str], str] = ..., - formatvarkw: Callable[[str], str] = ..., - formatvalue: Callable[[Any], str] = ..., - formatreturns: Callable[[Any], str] = ..., - formatannotations: Callable[[Any], str] = ..., - ) -> str: ... -def formatargvalues(args: List[str], - varargs: Optional[str] = ..., - varkw: Optional[str] = ..., - locals: Optional[Dict[str, Any]] = ..., - formatarg: Optional[Callable[[str], str]] = ..., - formatvarargs: Optional[Callable[[str], str]] = ..., - formatvarkw: Optional[Callable[[str], str]] = ..., - formatvalue: Optional[Callable[[Any], str]] = ..., - ) -> str: ... +def formatargspec( + args: List[str], + varargs: Optional[str] = ..., + varkw: Optional[str] = ..., + defaults: Optional[Tuple[Any, ...]] = ..., + kwonlyargs: Optional[Sequence[str]] = ..., + kwonlydefaults: Optional[Dict[str, Any]] = ..., + annotations: Dict[str, Any] = ..., + formatarg: Callable[[str], str] = ..., + formatvarargs: Callable[[str], str] = ..., + formatvarkw: Callable[[str], str] = ..., + formatvalue: Callable[[Any], str] = ..., + formatreturns: Callable[[Any], str] = ..., + formatannotation: Callable[[Any], str] = ..., +) -> str: ... +def formatargvalues( + args: List[str], + varargs: Optional[str], + varkw: Optional[str], + locals: Optional[Dict[str, Any]], + formatarg: Optional[Callable[[str], str]] = ..., + formatvarargs: Optional[Callable[[str], str]] = ..., + formatvarkw: Optional[Callable[[str], str]] = ..., + formatvalue: Optional[Callable[[Any], str]] = ..., +) -> str: ... def getmro(cls: type) -> Tuple[type, ...]: ... - -def getcallargs(func: Callable[..., Any], - *args: Any, - **kwds: Any) -> Dict[str, Any]: ... +def getcallargs(__func: Callable[..., Any], *args: Any, **kwds: Any) -> Dict[str, Any]: ... class ClosureVars(NamedTuple): nonlocals: Mapping[str, Any] globals: Mapping[str, Any] builtins: Mapping[str, Any] unbound: AbstractSet[str] -def getclosurevars(func: Callable[..., Any]) -> ClosureVars: ... - -def unwrap(func: Callable[..., Any], - *, - stop: Optional[Callable[[Any], Any]] = ...) -> Any: ... +def getclosurevars(func: Callable[..., Any]) -> ClosureVars: ... +def unwrap(func: Callable[..., Any], *, stop: Optional[Callable[[Any], Any]] = ...) -> Any: ... # # The interpreter stack @@ -266,7 +259,7 @@ class FrameInfo(NamedTuple): def getframeinfo(frame: Union[FrameType, TracebackType], context: int = ...) -> Traceback: ... def getouterframes(frame: Any, context: int = ...) -> List[FrameInfo]: ... -def getinnerframes(traceback: TracebackType, context: int = ...) -> List[FrameInfo]: ... +def getinnerframes(tb: TracebackType, context: int = ...) -> List[FrameInfo]: ... def getlineno(frame: FrameType) -> int: ... def currentframe() -> Optional[FrameType]: ... def stack(context: int = ...) -> List[FrameInfo]: ... @@ -278,7 +271,6 @@ def trace(context: int = ...) -> List[FrameInfo]: ... def getattr_static(obj: object, attr: str, default: Optional[Any] = ...) -> Any: ... - # # Current State of Generators and Coroutines # @@ -290,6 +282,7 @@ GEN_CREATED: str GEN_RUNNING: str GEN_SUSPENDED: str GEN_CLOSED: str + def getgeneratorstate(generator: Generator[Any, Any, Any]) -> str: ... CORO_CREATED: str @@ -298,16 +291,19 @@ CORO_SUSPENDED: str CORO_CLOSED: str # TODO can we be more specific than "object"? def getcoroutinestate(coroutine: object) -> str: ... - def getgeneratorlocals(generator: Generator[Any, Any, Any]) -> Dict[str, Any]: ... # TODO can we be more specific than "object"? def getcoroutinelocals(coroutine: object) -> Dict[str, Any]: ... +# Create private type alias to avoid conflict with symbol of same +# name created in Attribute class. +_Object = object + class Attribute(NamedTuple): name: str kind: str defining_class: type - object: object + object: _Object def classify_class_attrs(cls: type) -> List[Attribute]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/io.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/io.pyi old mode 100755 new mode 100644 index d835219d..f904e976 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/io.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/io.pyi @@ -1,13 +1,9 @@ -from typing import ( - List, BinaryIO, TextIO, Iterator, Union, Optional, Callable, Tuple, Type, Any, IO, Iterable -) import builtins import codecs -from mmap import mmap +import sys +from _typeshed import ReadableBuffer, WriteableBuffer from types import TracebackType -from typing import TypeVar - -_bytearray_like = Union[bytearray, mmap] +from typing import IO, Any, BinaryIO, Callable, Iterable, Iterator, List, Optional, TextIO, Tuple, Type, TypeVar, Union DEFAULT_BUFFER_SIZE: int @@ -15,32 +11,37 @@ SEEK_SET: int SEEK_CUR: int SEEK_END: int -_T = TypeVar('_T', bound=IOBase) +_T = TypeVar("_T", bound=IOBase) open = builtins.open +if sys.version_info >= (3, 8): + def open_code(path: str) -> IO[bytes]: ... + BlockingIOError = builtins.BlockingIOError + class UnsupportedOperation(OSError, ValueError): ... class IOBase: def __iter__(self) -> Iterator[bytes]: ... def __next__(self) -> bytes: ... def __enter__(self: _T) -> _T: ... - def __exit__(self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], - exc_tb: Optional[TracebackType]) -> Optional[bool]: ... + def __exit__( + self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType] + ) -> Optional[bool]: ... def close(self) -> None: ... def fileno(self) -> int: ... def flush(self) -> None: ... def isatty(self) -> bool: ... def readable(self) -> bool: ... - def readlines(self, hint: int = ...) -> List[bytes]: ... - def seek(self, offset: int, whence: int = ...) -> int: ... + def readlines(self, __hint: int = ...) -> List[bytes]: ... + def seek(self, __offset: int, __whence: int = ...) -> int: ... def seekable(self) -> bool: ... def tell(self) -> int: ... - def truncate(self, size: Optional[int] = ...) -> int: ... + def truncate(self, __size: Optional[int] = ...) -> int: ... def writable(self) -> bool: ... - def writelines(self, lines: Iterable[Union[bytes, bytearray]]) -> None: ... - def readline(self, size: int = ...) -> bytes: ... + def writelines(self, __lines: Iterable[ReadableBuffer]) -> None: ... + def readline(self, __size: Optional[int] = ...) -> bytes: ... def __del__(self) -> None: ... @property def closed(self) -> bool: ... @@ -48,89 +49,76 @@ class IOBase: class RawIOBase(IOBase): def readall(self) -> bytes: ... - def readinto(self, b: bytearray) -> Optional[int]: ... - def write(self, b: Union[bytes, bytearray]) -> Optional[int]: ... - def read(self, size: int = ...) -> Optional[bytes]: ... + def readinto(self, __buffer: WriteableBuffer) -> Optional[int]: ... + def write(self, __b: ReadableBuffer) -> Optional[int]: ... + def read(self, __size: int = ...) -> Optional[bytes]: ... class BufferedIOBase(IOBase): raw: RawIOBase # This is not part of the BufferedIOBase API and may not exist on some implementations. def detach(self) -> RawIOBase: ... - def readinto(self, b: _bytearray_like) -> int: ... - def write(self, b: Union[bytes, bytearray]) -> int: ... - def readinto1(self, b: _bytearray_like) -> int: ... - def read(self, size: Optional[int] = ...) -> bytes: ... - def read1(self, size: int = ...) -> bytes: ... + def readinto(self, __buffer: WriteableBuffer) -> int: ... + def write(self, __buffer: ReadableBuffer) -> int: ... + def readinto1(self, __buffer: WriteableBuffer) -> int: ... + def read(self, __size: Optional[int] = ...) -> bytes: ... + def read1(self, __size: int = ...) -> bytes: ... - -class FileIO(RawIOBase): +class FileIO(RawIOBase, BinaryIO): mode: str - name: Union[int, str] + # Technically this is whatever is passed in as file, either a str, a bytes, or an int. + name: Union[int, str] # type: ignore def __init__( self, file: Union[str, bytes, int], mode: str = ..., closefd: bool = ..., - opener: Optional[Callable[[Union[int, str], str], int]] = ... + opener: Optional[Callable[[Union[int, str], str], int]] = ..., ) -> None: ... + @property + def closefd(self) -> bool: ... + def write(self, __b: ReadableBuffer) -> int: ... + def read(self, __size: int = ...) -> bytes: ... + def __enter__(self: _T) -> _T: ... -# TODO should extend from BufferedIOBase -class BytesIO(BinaryIO): +class BytesIO(BufferedIOBase, BinaryIO): def __init__(self, initial_bytes: bytes = ...) -> None: ... # BytesIO does not contain a "name" field. This workaround is necessary # to allow BytesIO sub-classes to add this field, as it is defined # as a read-only property on IO[]. name: Any + def __enter__(self: _T) -> _T: ... def getvalue(self) -> bytes: ... def getbuffer(self) -> memoryview: ... - # copied from IOBase - def __iter__(self) -> Iterator[bytes]: ... - def __next__(self) -> bytes: ... - def __enter__(self) -> BytesIO: ... - def __exit__(self, t: Optional[Type[BaseException]] = ..., value: Optional[BaseException] = ..., - traceback: Optional[TracebackType] = ...) -> Optional[bool]: ... - def close(self) -> None: ... - def fileno(self) -> int: ... - def flush(self) -> None: ... - def isatty(self) -> bool: ... - def readable(self) -> bool: ... - def readlines(self, hint: int = ...) -> List[bytes]: ... - def seek(self, offset: int, whence: int = ...) -> int: ... - def seekable(self) -> bool: ... - def tell(self) -> int: ... - def truncate(self, size: Optional[int] = ...) -> int: ... - def writable(self) -> bool: ... - # TODO should be the next line instead - # def writelines(self, lines: List[Union[bytes, bytearray]]) -> None: ... - def writelines(self, lines: Any) -> None: ... - def readline(self, size: int = ...) -> bytes: ... - def __del__(self) -> None: ... - closed: bool - # copied from BufferedIOBase - def detach(self) -> RawIOBase: ... - def readinto(self, b: _bytearray_like) -> int: ... - def write(self, b: Union[bytes, bytearray]) -> int: ... - def readinto1(self, b: _bytearray_like) -> int: ... - def read(self, size: Optional[int] = ...) -> bytes: ... - def read1(self, size: int = ...) -> bytes: ... + if sys.version_info >= (3, 7): + def read1(self, __size: Optional[int] = ...) -> bytes: ... + else: + def read1(self, __size: Optional[int]) -> bytes: ... # type: ignore -class BufferedReader(BufferedIOBase): +class BufferedReader(BufferedIOBase, BinaryIO): + def __enter__(self: _T) -> _T: ... def __init__(self, raw: RawIOBase, buffer_size: int = ...) -> None: ... - def peek(self, size: int = ...) -> bytes: ... + def peek(self, __size: int = ...) -> bytes: ... + if sys.version_info >= (3, 7): + def read1(self, __size: int = ...) -> bytes: ... + else: + def read1(self, __size: int) -> bytes: ... # type: ignore -class BufferedWriter(BufferedIOBase): +class BufferedWriter(BufferedIOBase, BinaryIO): + def __enter__(self: _T) -> _T: ... def __init__(self, raw: RawIOBase, buffer_size: int = ...) -> None: ... - def flush(self) -> None: ... - def write(self, b: Union[bytes, bytearray]) -> int: ... + def write(self, __buffer: ReadableBuffer) -> int: ... class BufferedRandom(BufferedReader, BufferedWriter): + def __enter__(self: _T) -> _T: ... def __init__(self, raw: RawIOBase, buffer_size: int = ...) -> None: ... - def seek(self, offset: int, whence: int = ...) -> int: ... - def tell(self) -> int: ... + def seek(self, __target: int, __whence: int = ...) -> int: ... + if sys.version_info >= (3, 7): + def read1(self, __size: int = ...) -> bytes: ... + else: + def read1(self, __size: int) -> bytes: ... # type: ignore class BufferedRWPair(BufferedIOBase): - def __init__(self, reader: RawIOBase, writer: RawIOBase, - buffer_size: int = ...) -> None: ... - + def __init__(self, reader: RawIOBase, writer: RawIOBase, buffer_size: int = ...) -> None: ... + def peek(self, __size: int = ...) -> bytes: ... class TextIOBase(IOBase): encoding: str @@ -138,23 +126,15 @@ class TextIOBase(IOBase): newlines: Union[str, Tuple[str, ...], None] def __iter__(self) -> Iterator[str]: ... # type: ignore def __next__(self) -> str: ... # type: ignore - def detach(self) -> IOBase: ... - def write(self, s: str) -> int: ... - def writelines(self, lines: List[str]) -> None: ... # type: ignore - def readline(self, size: int = ...) -> str: ... # type: ignore - def readlines(self, hint: int = ...) -> List[str]: ... # type: ignore - def read(self, size: Optional[int] = ...) -> str: ... - def seek(self, offset: int, whence: int = ...) -> int: ... + def detach(self) -> BinaryIO: ... + def write(self, __s: str) -> int: ... + def writelines(self, __lines: Iterable[str]) -> None: ... # type: ignore + def readline(self, __size: int = ...) -> str: ... # type: ignore + def readlines(self, __hint: int = ...) -> List[str]: ... # type: ignore + def read(self, __size: Optional[int] = ...) -> str: ... def tell(self) -> int: ... -# TODO should extend from TextIOBase -class TextIOWrapper(TextIO): - line_buffering: bool - # TODO uncomment after fixing mypy about using write_through - # def __init__(self, buffer: IO[bytes], encoding: str = ..., - # errors: Optional[str] = ..., newline: Optional[str] = ..., - # line_buffering: bool = ..., write_through: bool = ...) \ - # -> None: ... +class TextIOWrapper(TextIOBase, TextIO): def __init__( self, buffer: IO[bytes], @@ -162,50 +142,45 @@ class TextIOWrapper(TextIO): errors: Optional[str] = ..., newline: Optional[str] = ..., line_buffering: bool = ..., - write_through: bool = ... + write_through: bool = ..., ) -> None: ... - # copied from IOBase - def __exit__(self, t: Optional[Type[BaseException]] = ..., value: Optional[BaseException] = ..., - traceback: Optional[TracebackType] = ...) -> Optional[bool]: ... - def close(self) -> None: ... - def fileno(self) -> int: ... - def flush(self) -> None: ... - def isatty(self) -> bool: ... - def readable(self) -> bool: ... - def readlines(self, hint: int = ...) -> List[str]: ... - def seekable(self) -> bool: ... - def truncate(self, size: Optional[int] = ...) -> int: ... - def writable(self) -> bool: ... - # TODO should be the next line instead - # def writelines(self, lines: List[str]) -> None: ... - def writelines(self, lines: Any) -> None: ... - def __del__(self) -> None: ... - closed: bool - # copied from TextIOBase - encoding: str - errors: Optional[str] - newlines: Union[str, Tuple[str, ...], None] - def __iter__(self) -> Iterator[str]: ... - def __next__(self) -> str: ... - def __enter__(self) -> TextIO: ... - def detach(self) -> IOBase: ... - def write(self, s: str) -> int: ... - def readline(self, size: int = ...) -> str: ... - def read(self, size: Optional[int] = ...) -> str: ... - def seek(self, offset: int, whence: int = ...) -> int: ... - def tell(self) -> int: ... + @property + def buffer(self) -> BinaryIO: ... + @property + def closed(self) -> bool: ... + @property + def line_buffering(self) -> bool: ... + if sys.version_info >= (3, 7): + @property + def write_through(self) -> bool: ... + def reconfigure( + self, + *, + encoding: Optional[str] = ..., + errors: Optional[str] = ..., + newline: Optional[str] = ..., + line_buffering: Optional[bool] = ..., + write_through: Optional[bool] = ..., + ) -> None: ... + # These are inherited from TextIOBase, but must exist in the stub to satisfy mypy. + def __enter__(self: _T) -> _T: ... + def __iter__(self) -> Iterator[str]: ... # type: ignore + def __next__(self) -> str: ... # type: ignore + def writelines(self, __lines: Iterable[str]) -> None: ... # type: ignore + def readline(self, __size: int = ...) -> str: ... # type: ignore + def readlines(self, __hint: int = ...) -> List[str]: ... # type: ignore + def seek(self, __cookie: int, __whence: int = ...) -> int: ... class StringIO(TextIOWrapper): - def __init__(self, initial_value: str = ..., - newline: Optional[str] = ...) -> None: ... + def __init__(self, initial_value: Optional[str] = ..., newline: Optional[str] = ...) -> None: ... # StringIO does not contain a "name" field. This workaround is necessary # to allow StringIO sub-classes to add this field, as it is defined # as a read-only property on IO[]. name: Any def getvalue(self) -> str: ... - def __enter__(self) -> StringIO: ... class IncrementalNewlineDecoder(codecs.IncrementalDecoder): - def __init__(self, decoder: Optional[codecs.IncrementalDecoder], - translate: bool, errors: str = ...) -> None: ... + def __init__(self, decoder: Optional[codecs.IncrementalDecoder], translate: bool, errors: str = ...) -> None: ... def decode(self, input: Union[bytes, str], final: bool = ...) -> str: ... + @property + def newlines(self) -> Optional[Union[str, Tuple[str, ...]]]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/ipaddress.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/ipaddress.pyi old mode 100755 new mode 100644 index 6b6a45d1..b4e2b2c4 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/ipaddress.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/ipaddress.pyi @@ -1,5 +1,5 @@ -from typing import (Any, Container, Generic, Iterable, Iterator, Optional, - overload, SupportsInt, Text, Tuple, TypeVar) +import sys +from typing import Any, Container, Generic, Iterable, Iterator, Optional, SupportsInt, Tuple, TypeVar, overload # Undocumented length constants IPV4LENGTH: int @@ -21,11 +21,11 @@ class _IPAddressBase: def __lt__(self: _T, other: _T) -> bool: ... def __ne__(self, other: Any) -> bool: ... @property - def compressed(self) -> Text: ... + def compressed(self) -> str: ... @property - def exploded(self) -> Text: ... + def exploded(self) -> str: ... @property - def reverse_pointer(self) -> Text: ... + def reverse_pointer(self) -> str: ... @property def version(self) -> int: ... @@ -84,17 +84,20 @@ class _BaseNetwork(_IPAddressBase, Container[_A], Iterable[_A], Generic[_A]): def max_prefixlen(self) -> int: ... @property def num_addresses(self) -> int: ... - def overlaps(self: _T, other: _T) -> bool: ... + def overlaps(self, other: _BaseNetwork[_A]) -> bool: ... @property def prefixlen(self) -> int: ... + if sys.version_info >= (3, 7): + def subnet_of(self: _T, other: _T) -> bool: ... + def supernet_of(self: _T, other: _T) -> bool: ... def subnets(self: _T, prefixlen_diff: int = ..., new_prefix: Optional[int] = ...) -> Iterator[_T]: ... def supernet(self: _T, prefixlen_diff: int = ..., new_prefix: Optional[int] = ...) -> _T: ... @property - def with_hostmask(self) -> Text: ... + def with_hostmask(self) -> str: ... @property - def with_netmask(self) -> Text: ... + def with_netmask(self) -> str: ... @property - def with_prefixlen(self) -> Text: ... + def with_prefixlen(self) -> str: ... @property def hostmask(self) -> _A: ... @@ -105,11 +108,11 @@ class _BaseInterface(_BaseAddress, Generic[_A, _N]): @property def ip(self) -> _A: ... @property - def with_hostmask(self) -> Text: ... + def with_hostmask(self) -> str: ... @property - def with_netmask(self) -> Text: ... + def with_netmask(self) -> str: ... @property - def with_prefixlen(self) -> Text: ... + def with_prefixlen(self) -> str: ... class IPv4Address(_BaseAddress): ... class IPv4Network(_BaseNetwork[IPv4Address]): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/itertools.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/itertools.pyi old mode 100755 new mode 100644 index 78149e2f..8a918bdc --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/itertools.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/itertools.pyi @@ -1,19 +1,18 @@ -# Stubs for itertools - -# Based on http://docs.python.org/3.2/library/itertools.html - -from typing import (Iterator, TypeVar, Iterable, overload, Any, Callable, Tuple, - Generic, Optional) import sys +from typing import Any, Callable, Generic, Iterable, Iterator, Optional, Tuple, TypeVar, overload +from typing_extensions import Literal -_T = TypeVar('_T') -_S = TypeVar('_S') -_N = TypeVar('_N', int, float) +_T = TypeVar("_T") +_S = TypeVar("_S") +_N = TypeVar("_N", int, float) Predicate = Callable[[_T], object] -def count(start: _N = ..., - step: _N = ...) -> Iterator[_N]: ... # more general types? -def cycle(iterable: Iterable[_T]) -> Iterator[_T]: ... +def count(start: _N = ..., step: _N = ...) -> Iterator[_N]: ... # more general types? + +class cycle(Iterator[_T], Generic[_T]): + def __init__(self, iterable: Iterable[_T]) -> None: ... + def __next__(self) -> _T: ... + def __iter__(self) -> Iterator[_T]: ... @overload def repeat(object: _T) -> Iterator[_T]: ... @@ -22,15 +21,12 @@ def repeat(object: _T, times: int) -> Iterator[_T]: ... if sys.version_info >= (3, 8): @overload - def accumulate(iterable: Iterable[_T], - func: Callable[[_T, _T], _T] = ...) -> Iterator[_T]: ... + def accumulate(iterable: Iterable[_T], func: Callable[[_T, _T], _T] = ...) -> Iterator[_T]: ... @overload - def accumulate(iterable: Iterable[_T], - func: Callable[[_S, _T], _S], - initial: Optional[_S]) -> Iterator[_S]: ... + def accumulate(iterable: Iterable[_T], func: Callable[[_S, _T], _S], initial: Optional[_S]) -> Iterator[_S]: ... + else: - def accumulate(iterable: Iterable[_T], - func: Callable[[_T, _T], _T] = ...) -> Iterator[_T]: ... + def accumulate(iterable: Iterable[_T], func: Callable[[_T, _T], _T] = ...) -> Iterator[_T]: ... class chain(Iterator[_T], Generic[_T]): def __init__(self, *iterables: Iterable[_T]) -> None: ... @@ -40,78 +36,74 @@ class chain(Iterator[_T], Generic[_T]): def from_iterable(iterable: Iterable[Iterable[_S]]) -> Iterator[_S]: ... def compress(data: Iterable[_T], selectors: Iterable[Any]) -> Iterator[_T]: ... -def dropwhile(predicate: Predicate[_T], - iterable: Iterable[_T]) -> Iterator[_T]: ... -def filterfalse(predicate: Optional[Predicate[_T]], - iterable: Iterable[_T]) -> Iterator[_T]: ... - +def dropwhile(predicate: Predicate[_T], iterable: Iterable[_T]) -> Iterator[_T]: ... +def filterfalse(predicate: Optional[Predicate[_T]], iterable: Iterable[_T]) -> Iterator[_T]: ... @overload def groupby(iterable: Iterable[_T], key: None = ...) -> Iterator[Tuple[_T, Iterator[_T]]]: ... @overload def groupby(iterable: Iterable[_T], key: Callable[[_T], _S]) -> Iterator[Tuple[_S, Iterator[_T]]]: ... - @overload def islice(iterable: Iterable[_T], stop: Optional[int]) -> Iterator[_T]: ... @overload -def islice(iterable: Iterable[_T], start: Optional[int], stop: Optional[int], - step: Optional[int] = ...) -> Iterator[_T]: ... - +def islice(iterable: Iterable[_T], start: Optional[int], stop: Optional[int], step: Optional[int] = ...) -> Iterator[_T]: ... def starmap(func: Callable[..., _S], iterable: Iterable[Iterable[Any]]) -> Iterator[_S]: ... -def takewhile(predicate: Predicate[_T], - iterable: Iterable[_T]) -> Iterator[_T]: ... +def takewhile(predicate: Predicate[_T], iterable: Iterable[_T]) -> Iterator[_T]: ... def tee(iterable: Iterable[_T], n: int = ...) -> Tuple[Iterator[_T], ...]: ... -def zip_longest(*p: Iterable[Any], - fillvalue: Any = ...) -> Iterator[Any]: ... - -_T1 = TypeVar('_T1') -_T2 = TypeVar('_T2') -_T3 = TypeVar('_T3') -_T4 = TypeVar('_T4') -_T5 = TypeVar('_T5') -_T6 = TypeVar('_T6') +def zip_longest(*p: Iterable[Any], fillvalue: Any = ...) -> Iterator[Any]: ... +_T1 = TypeVar("_T1") +_T2 = TypeVar("_T2") +_T3 = TypeVar("_T3") +_T4 = TypeVar("_T4") +_T5 = TypeVar("_T5") +_T6 = TypeVar("_T6") @overload def product(iter1: Iterable[_T1]) -> Iterator[Tuple[_T1]]: ... @overload -def product(iter1: Iterable[_T1], - iter2: Iterable[_T2]) -> Iterator[Tuple[_T1, _T2]]: ... -@overload -def product(iter1: Iterable[_T1], - iter2: Iterable[_T2], - iter3: Iterable[_T3]) -> Iterator[Tuple[_T1, _T2, _T3]]: ... -@overload -def product(iter1: Iterable[_T1], - iter2: Iterable[_T2], - iter3: Iterable[_T3], - iter4: Iterable[_T4]) -> Iterator[Tuple[_T1, _T2, _T3, _T4]]: ... -@overload -def product(iter1: Iterable[_T1], - iter2: Iterable[_T2], - iter3: Iterable[_T3], - iter4: Iterable[_T4], - iter5: Iterable[_T5]) -> Iterator[Tuple[_T1, _T2, _T3, _T4, _T5]]: ... -@overload -def product(iter1: Iterable[_T1], - iter2: Iterable[_T2], - iter3: Iterable[_T3], - iter4: Iterable[_T4], - iter5: Iterable[_T5], - iter6: Iterable[_T6]) -> Iterator[Tuple[_T1, _T2, _T3, _T4, _T5, _T6]]: ... -@overload -def product(iter1: Iterable[Any], - iter2: Iterable[Any], - iter3: Iterable[Any], - iter4: Iterable[Any], - iter5: Iterable[Any], - iter6: Iterable[Any], - iter7: Iterable[Any], - *iterables: Iterable[Any]) -> Iterator[Tuple[Any, ...]]: ... +def product(iter1: Iterable[_T1], iter2: Iterable[_T2]) -> Iterator[Tuple[_T1, _T2]]: ... +@overload +def product(iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3]) -> Iterator[Tuple[_T1, _T2, _T3]]: ... +@overload +def product( + iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], iter4: Iterable[_T4] +) -> Iterator[Tuple[_T1, _T2, _T3, _T4]]: ... +@overload +def product( + iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], iter4: Iterable[_T4], iter5: Iterable[_T5] +) -> Iterator[Tuple[_T1, _T2, _T3, _T4, _T5]]: ... +@overload +def product( + iter1: Iterable[_T1], + iter2: Iterable[_T2], + iter3: Iterable[_T3], + iter4: Iterable[_T4], + iter5: Iterable[_T5], + iter6: Iterable[_T6], +) -> Iterator[Tuple[_T1, _T2, _T3, _T4, _T5, _T6]]: ... +@overload +def product( + iter1: Iterable[Any], + iter2: Iterable[Any], + iter3: Iterable[Any], + iter4: Iterable[Any], + iter5: Iterable[Any], + iter6: Iterable[Any], + iter7: Iterable[Any], + *iterables: Iterable[Any], +) -> Iterator[Tuple[Any, ...]]: ... +@overload +def product(*iterables: Iterable[_T1], repeat: int) -> Iterator[Tuple[_T1, ...]]: ... @overload def product(*iterables: Iterable[Any], repeat: int = ...) -> Iterator[Tuple[Any, ...]]: ... - -def permutations(iterable: Iterable[_T], - r: Optional[int] = ...) -> Iterator[Tuple[_T, ...]]: ... -def combinations(iterable: Iterable[_T], - r: int) -> Iterator[Tuple[_T, ...]]: ... -def combinations_with_replacement(iterable: Iterable[_T], - r: int) -> Iterator[Tuple[_T, ...]]: ... +def permutations(iterable: Iterable[_T], r: Optional[int] = ...) -> Iterator[Tuple[_T, ...]]: ... +@overload +def combinations(iterable: Iterable[_T], r: Literal[2]) -> Iterator[Tuple[_T, _T]]: ... +@overload +def combinations(iterable: Iterable[_T], r: Literal[3]) -> Iterator[Tuple[_T, _T, _T]]: ... +@overload +def combinations(iterable: Iterable[_T], r: Literal[4]) -> Iterator[Tuple[_T, _T, _T, _T]]: ... +@overload +def combinations(iterable: Iterable[_T], r: Literal[5]) -> Iterator[Tuple[_T, _T, _T, _T, _T]]: ... +@overload +def combinations(iterable: Iterable[_T], r: int) -> Iterator[Tuple[_T, ...]]: ... +def combinations_with_replacement(iterable: Iterable[_T], r: int) -> Iterator[Tuple[_T, ...]]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/json/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/json/__init__.pyi old mode 100755 new mode 100644 index 2f6374e3..69c82a9c --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/json/__init__.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/json/__init__.pyi @@ -1,57 +1,57 @@ -import sys -from typing import Any, IO, Optional, Tuple, Callable, Dict, List, Union, Protocol, Type +from _typeshed import SupportsRead +from typing import IO, Any, Callable, Dict, List, Optional, Tuple, Type, Union -from .decoder import JSONDecoder as JSONDecoder +from .decoder import JSONDecodeError as JSONDecodeError, JSONDecoder as JSONDecoder from .encoder import JSONEncoder as JSONEncoder -from .decoder import JSONDecodeError as JSONDecodeError -def dumps(obj: Any, - skipkeys: bool = ..., - ensure_ascii: bool = ..., - check_circular: bool = ..., - allow_nan: bool = ..., - cls: Optional[Type[JSONEncoder]] = ..., - indent: Union[None, int, str] = ..., - separators: Optional[Tuple[str, str]] = ..., - default: Optional[Callable[[Any], Any]] = ..., - sort_keys: bool = ..., - **kwds: Any) -> str: ... - -def dump(obj: Any, - fp: IO[str], - skipkeys: bool = ..., - ensure_ascii: bool = ..., - check_circular: bool = ..., - allow_nan: bool = ..., - cls: Optional[Type[JSONEncoder]] = ..., - indent: Union[None, int, str] = ..., - separators: Optional[Tuple[str, str]] = ..., - default: Optional[Callable[[Any], Any]] = ..., - sort_keys: bool = ..., - **kwds: Any) -> None: ... - -if sys.version_info >= (3, 6): - _LoadsString = Union[str, bytes, bytearray] -else: - _LoadsString = str -def loads(s: _LoadsString, - encoding: Any = ..., # ignored and deprecated - cls: Optional[Type[JSONDecoder]] = ..., - object_hook: Optional[Callable[[Dict[Any, Any]], Any]] = ..., - parse_float: Optional[Callable[[str], Any]] = ..., - parse_int: Optional[Callable[[str], Any]] = ..., - parse_constant: Optional[Callable[[str], Any]] = ..., - object_pairs_hook: Optional[Callable[[List[Tuple[Any, Any]]], Any]] = ..., - **kwds: Any) -> Any: ... - -class _Reader(Protocol): - def read(self) -> _LoadsString: ... - -def load(fp: _Reader, - cls: Optional[Type[JSONDecoder]] = ..., - object_hook: Optional[Callable[[Dict[Any, Any]], Any]] = ..., - parse_float: Optional[Callable[[str], Any]] = ..., - parse_int: Optional[Callable[[str], Any]] = ..., - parse_constant: Optional[Callable[[str], Any]] = ..., - object_pairs_hook: Optional[Callable[[List[Tuple[Any, Any]]], Any]] = ..., - **kwds: Any) -> Any: ... +def dumps( + obj: Any, + *, + skipkeys: bool = ..., + ensure_ascii: bool = ..., + check_circular: bool = ..., + allow_nan: bool = ..., + cls: Optional[Type[JSONEncoder]] = ..., + indent: Union[None, int, str] = ..., + separators: Optional[Tuple[str, str]] = ..., + default: Optional[Callable[[Any], Any]] = ..., + sort_keys: bool = ..., + **kwds: Any, +) -> str: ... +def dump( + obj: Any, + fp: IO[str], + *, + skipkeys: bool = ..., + ensure_ascii: bool = ..., + check_circular: bool = ..., + allow_nan: bool = ..., + cls: Optional[Type[JSONEncoder]] = ..., + indent: Union[None, int, str] = ..., + separators: Optional[Tuple[str, str]] = ..., + default: Optional[Callable[[Any], Any]] = ..., + sort_keys: bool = ..., + **kwds: Any, +) -> None: ... +def loads( + s: Union[str, bytes], + *, + cls: Optional[Type[JSONDecoder]] = ..., + object_hook: Optional[Callable[[Dict[Any, Any]], Any]] = ..., + parse_float: Optional[Callable[[str], Any]] = ..., + parse_int: Optional[Callable[[str], Any]] = ..., + parse_constant: Optional[Callable[[str], Any]] = ..., + object_pairs_hook: Optional[Callable[[List[Tuple[Any, Any]]], Any]] = ..., + **kwds: Any, +) -> Any: ... +def load( + fp: SupportsRead[Union[str, bytes]], + *, + cls: Optional[Type[JSONDecoder]] = ..., + object_hook: Optional[Callable[[Dict[Any, Any]], Any]] = ..., + parse_float: Optional[Callable[[str], Any]] = ..., + parse_int: Optional[Callable[[str], Any]] = ..., + parse_constant: Optional[Callable[[str], Any]] = ..., + object_pairs_hook: Optional[Callable[[List[Tuple[Any, Any]]], Any]] = ..., + **kwds: Any, +) -> Any: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/json/decoder.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/json/decoder.pyi old mode 100755 new mode 100644 index d57a6a9f..19d7b4eb --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/json/decoder.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/json/decoder.pyi @@ -12,15 +12,18 @@ class JSONDecoder: object_hook: Callable[[Dict[str, Any]], Any] parse_float: Callable[[str], Any] parse_int: Callable[[str], Any] - parse_constant = ... # Callable[[str], Any] + parse_constant: Callable[[str], Any] = ... strict: bool object_pairs_hook: Callable[[List[Tuple[str, Any]]], Any] - - def __init__(self, object_hook: Optional[Callable[[Dict[str, Any]], Any]] = ..., - parse_float: Optional[Callable[[str], Any]] = ..., - parse_int: Optional[Callable[[str], Any]] = ..., - parse_constant: Optional[Callable[[str], Any]] = ..., - strict: bool = ..., - object_pairs_hook: Optional[Callable[[List[Tuple[str, Any]]], Any]] = ...) -> None: ... - def decode(self, s: str) -> Any: ... + def __init__( + self, + *, + object_hook: Optional[Callable[[Dict[str, Any]], Any]] = ..., + parse_float: Optional[Callable[[str], Any]] = ..., + parse_int: Optional[Callable[[str], Any]] = ..., + parse_constant: Optional[Callable[[str], Any]] = ..., + strict: bool = ..., + object_pairs_hook: Optional[Callable[[List[Tuple[str, Any]]], Any]] = ..., + ) -> None: ... + def decode(self, s: str, _w: Callable[..., Any] = ...) -> Any: ... # _w is undocumented def raw_decode(self, s: str, idx: int = ...) -> Tuple[Any, int]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/json/encoder.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/json/encoder.pyi old mode 100755 new mode 100644 index 63f5ffeb..7d520149 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/json/encoder.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/json/encoder.pyi @@ -10,12 +10,18 @@ class JSONEncoder: allow_nan: bool sort_keys: bool indent: int - - def __init__(self, skipkeys: bool = ..., ensure_ascii: bool = ..., - check_circular: bool = ..., allow_nan: bool = ..., sort_keys: bool = ..., - indent: Optional[int] = ..., separators: Optional[Tuple[str, str]] = ..., - default: Optional[Callable[..., Any]] = ...) -> None: ... - + def __init__( + self, + *, + skipkeys: bool = ..., + ensure_ascii: bool = ..., + check_circular: bool = ..., + allow_nan: bool = ..., + sort_keys: bool = ..., + indent: Optional[int] = ..., + separators: Optional[Tuple[str, str]] = ..., + default: Optional[Callable[..., Any]] = ..., + ) -> None: ... def default(self, o: Any) -> Any: ... def encode(self, o: Any) -> str: ... def iterencode(self, o: Any, _one_shot: bool = ...) -> Iterator[str]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/json/tool.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/json/tool.pyi new file mode 100644 index 00000000..7e7363e7 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/json/tool.pyi @@ -0,0 +1 @@ +def main() -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/lzma.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/lzma.pyi old mode 100755 new mode 100644 index 37009c81..b39b5ecc --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/lzma.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/lzma.pyi @@ -1,14 +1,15 @@ import io -import sys -from typing import Any, IO, Mapping, Optional, Sequence, Union +from _typeshed import AnyPath, ReadableBuffer +from typing import IO, Any, Mapping, Optional, Sequence, TextIO, TypeVar, Union, overload +from typing_extensions import Literal -if sys.version_info >= (3, 6): - from os import PathLike - _PathOrFile = Union[str, bytes, IO[Any], PathLike[Any]] -else: - _PathOrFile = Union[str, bytes, IO[Any]] +_OpenBinaryWritingMode = Literal["w", "wb", "x", "xb", "a", "ab"] +_OpenTextWritingMode = Literal["wt", "xt", "at"] + +_PathOrFile = Union[AnyPath, IO[bytes]] _FilterChain = Sequence[Mapping[str, Any]] +_T = TypeVar("_T") FORMAT_AUTO: int FORMAT_XZ: int @@ -41,7 +42,9 @@ PRESET_EXTREME: int # from _lzma.c class LZMADecompressor(object): - def __init__(self, format: Optional[int] = ..., memlimit: Optional[int] = ..., filters: Optional[_FilterChain] = ...) -> None: ... + def __init__( + self, format: Optional[int] = ..., memlimit: Optional[int] = ..., filters: Optional[_FilterChain] = ... + ) -> None: ... def decompress(self, data: bytes, max_length: int = ...) -> bytes: ... @property def check(self) -> int: ... @@ -54,27 +57,26 @@ class LZMADecompressor(object): # from _lzma.c class LZMACompressor(object): - def __init__(self, - format: Optional[int] = ..., - check: int = ..., - preset: Optional[int] = ..., - filters: Optional[_FilterChain] = ...) -> None: ... + def __init__( + self, format: Optional[int] = ..., check: int = ..., preset: Optional[int] = ..., filters: Optional[_FilterChain] = ... + ) -> None: ... def compress(self, data: bytes) -> bytes: ... def flush(self) -> bytes: ... - class LZMAError(Exception): ... - -class LZMAFile(io.BufferedIOBase, IO[bytes]): # type: ignore # python/mypy#5027 - def __init__(self, - filename: Optional[_PathOrFile] = ..., - mode: str = ..., - *, - format: Optional[int] = ..., - check: int = ..., - preset: Optional[int] = ..., - filters: Optional[_FilterChain] = ...) -> None: ... +class LZMAFile(io.BufferedIOBase, IO[bytes]): + def __init__( + self, + filename: Optional[_PathOrFile] = ..., + mode: str = ..., + *, + format: Optional[int] = ..., + check: int = ..., + preset: Optional[int] = ..., + filters: Optional[_FilterChain] = ..., + ) -> None: ... + def __enter__(self: _T) -> _T: ... def close(self) -> None: ... @property def closed(self) -> bool: ... @@ -85,22 +87,78 @@ class LZMAFile(io.BufferedIOBase, IO[bytes]): # type: ignore # python/mypy#502 def peek(self, size: int = ...) -> bytes: ... def read(self, size: Optional[int] = ...) -> bytes: ... def read1(self, size: int = ...) -> bytes: ... - def readline(self, size: int = ...) -> bytes: ... - def write(self, data: bytes) -> int: ... + def readline(self, size: Optional[int] = ...) -> bytes: ... + def write(self, data: ReadableBuffer) -> int: ... def seek(self, offset: int, whence: int = ...) -> int: ... def tell(self) -> int: ... - -def open(filename: _PathOrFile, - mode: str = ..., - *, - format: Optional[int] = ..., - check: int = ..., - preset: Optional[int] = ..., - filters: Optional[_FilterChain] = ..., - encoding: Optional[str] = ..., - errors: Optional[str] = ..., - newline: Optional[str] = ...) -> IO[Any]: ... -def compress(data: bytes, format: int = ..., check: int = ..., preset: Optional[int] = ..., filters: Optional[_FilterChain] = ...) -> bytes: ... +@overload +def open( + filename: _PathOrFile, + mode: Literal["r", "rb"] = ..., + *, + format: Optional[int] = ..., + check: Literal[-1] = ..., + preset: None = ..., + filters: Optional[_FilterChain] = ..., + encoding: None = ..., + errors: None = ..., + newline: None = ..., +) -> LZMAFile: ... +@overload +def open( + filename: _PathOrFile, + mode: _OpenBinaryWritingMode, + *, + format: Optional[int] = ..., + check: int = ..., + preset: Optional[int] = ..., + filters: Optional[_FilterChain] = ..., + encoding: None = ..., + errors: None = ..., + newline: None = ..., +) -> LZMAFile: ... +@overload +def open( + filename: AnyPath, + mode: Literal["rt"], + *, + format: Optional[int] = ..., + check: Literal[-1] = ..., + preset: None = ..., + filters: Optional[_FilterChain] = ..., + encoding: Optional[str] = ..., + errors: Optional[str] = ..., + newline: Optional[str] = ..., +) -> TextIO: ... +@overload +def open( + filename: AnyPath, + mode: _OpenTextWritingMode, + *, + format: Optional[int] = ..., + check: int = ..., + preset: Optional[int] = ..., + filters: Optional[_FilterChain] = ..., + encoding: Optional[str] = ..., + errors: Optional[str] = ..., + newline: Optional[str] = ..., +) -> TextIO: ... +@overload +def open( + filename: _PathOrFile, + mode: str, + *, + format: Optional[int] = ..., + check: int = ..., + preset: Optional[int] = ..., + filters: Optional[_FilterChain] = ..., + encoding: Optional[str] = ..., + errors: Optional[str] = ..., + newline: Optional[str] = ..., +) -> Union[LZMAFile, TextIO]: ... +def compress( + data: bytes, format: int = ..., check: int = ..., preset: Optional[int] = ..., filters: Optional[_FilterChain] = ... +) -> bytes: ... def decompress(data: bytes, format: int = ..., memlimit: Optional[int] = ..., filters: Optional[_FilterChain] = ...) -> bytes: ... def is_check_supported(check: int) -> bool: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/macurl2path.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/macurl2path.pyi new file mode 100644 index 00000000..41befd1d --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/macurl2path.pyi @@ -0,0 +1,7 @@ +import sys +from typing import Union + +if sys.version_info < (3, 7): + def url2pathname(pathname: str) -> str: ... + def pathname2url(pathname: str) -> str: ... + def _pncomp2url(component: Union[str, bytes]) -> str: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/msvcrt.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/msvcrt.pyi deleted file mode 100755 index 6688c37c..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/msvcrt.pyi +++ /dev/null @@ -1,6 +0,0 @@ -# Stubs for msvcrt - -# NOTE: These are incomplete! - -def get_osfhandle(file: int) -> int: ... -def open_osfhandle(handle: int, flags: int) -> int: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/__init__.pyi old mode 100755 new mode 100644 index f797b548..c7de0a2d --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/__init__.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/__init__.pyi @@ -1,75 +1,58 @@ -# Stubs for multiprocessing - import sys -from typing import Any, Callable, Iterable, Mapping, Optional, List, Union, Sequence, Tuple, Type, overload - -from ctypes import _CData from logging import Logger -from multiprocessing import connection, pool, spawn, synchronize +from multiprocessing import connection, pool, sharedctypes, synchronize from multiprocessing.context import ( AuthenticationError as AuthenticationError, BaseContext, BufferTooShort as BufferTooShort, + DefaultContext, Process as Process, ProcessError as ProcessError, + SpawnContext, TimeoutError as TimeoutError, ) from multiprocessing.managers import SyncManager from multiprocessing.process import active_children as active_children, current_process as current_process -from multiprocessing.queues import Queue as Queue, SimpleQueue as SimpleQueue, JoinableQueue as JoinableQueue + +# These are technically functions that return instances of these Queue classes. See #4313 for discussion +from multiprocessing.queues import JoinableQueue as JoinableQueue, Queue as Queue, SimpleQueue as SimpleQueue from multiprocessing.spawn import freeze_support as freeze_support -from multiprocessing.spawn import set_executable as set_executable +from typing import Any, Callable, Iterable, List, Optional, Sequence, Tuple, Union, overload +from typing_extensions import Literal if sys.version_info >= (3, 8): from multiprocessing.process import parent_process as parent_process +if sys.platform != "win32": + from multiprocessing.context import ForkContext, ForkServerContext + # N.B. The functions below are generated at runtime by partially applying # multiprocessing.context.BaseContext's methods, so the two signatures should # be identical (modulo self). # Sychronization primitives _LockLike = Union[synchronize.Lock, synchronize.RLock] -def Barrier(parties: int, - action: Optional[Callable[..., Any]] = ..., - timeout: Optional[float] = ...) -> synchronize.Barrier: ... + +def Barrier(parties: int, action: Optional[Callable[..., Any]] = ..., timeout: Optional[float] = ...) -> synchronize.Barrier: ... def BoundedSemaphore(value: int = ...) -> synchronize.BoundedSemaphore: ... def Condition(lock: Optional[_LockLike] = ...) -> synchronize.Condition: ... -def Event(lock: Optional[_LockLike] = ...) -> synchronize.Event: ... +def Event() -> synchronize.Event: ... def Lock() -> synchronize.Lock: ... def RLock() -> synchronize.RLock: ... def Semaphore(value: int = ...) -> synchronize.Semaphore: ... - def Pipe(duplex: bool = ...) -> Tuple[connection.Connection, connection.Connection]: ... +def Pool( + processes: Optional[int] = ..., + initializer: Optional[Callable[..., Any]] = ..., + initargs: Iterable[Any] = ..., + maxtasksperchild: Optional[int] = ..., +) -> pool.Pool: ... -def Pool(processes: Optional[int] = ..., - initializer: Optional[Callable[..., Any]] = ..., - initargs: Iterable[Any] = ..., - maxtasksperchild: Optional[int] = ...) -> pool.Pool: ... - -class Array(): - value: Any = ... - - def __init__(self, typecode_or_type: Union[str, Type[_CData]], size_or_initializer: Union[int, Sequence[Any]], *, lock: Union[bool, _LockLike] = ...) -> None: ... - def acquire(self) -> bool: ... - def release(self) -> bool: ... - def get_lock(self) -> _LockLike: ... - def get_obj(self) -> Any: ... - - @overload - def __getitem__(self, key: int) -> Any: ... - @overload - def __getitem__(self, key: slice) -> List[Any]: ... - def __getslice__(self, start: int, stop: int) -> Any: ... - def __setitem__(self, key: int, value: Any) -> None: ... - - -class Value(): - value: Any = ... - def __init__(self, typecode_or_type: Union[str, Type[_CData]], *args: Any, lock: Union[bool, _LockLike] = ...) -> None: ... - def get_lock(self) -> _LockLike: ... - def get_obj(self) -> Any: ... - def acquire(self) -> bool: ... - def release(self) -> bool: ... +# Functions Array and Value are copied from context.pyi. +# See https://github.com/python/typeshed/blob/ac234f25927634e06d9c96df98d72d54dd80dfc4/stdlib/2and3/turtle.pyi#L284-L291 +# for rationale +def Array(typecode_or_type: Any, size_or_initializer: Union[int, Sequence[Any]], *, lock: bool = ...) -> sharedctypes._Array: ... +def Value(typecode_or_type: Any, *args: Any, lock: bool = ...) -> sharedctypes._Value: ... # ----- multiprocessing function stubs ----- def allow_connection_pickling() -> None: ... @@ -77,8 +60,28 @@ def cpu_count() -> int: ... def get_logger() -> Logger: ... def log_to_stderr(level: Optional[Union[str, int]] = ...) -> Logger: ... def Manager() -> SyncManager: ... +def set_executable(executable: str) -> None: ... def set_forkserver_preload(module_names: List[str]) -> None: ... def get_all_start_methods() -> List[str]: ... -def get_context(method: Optional[str] = ...) -> BaseContext: ... def get_start_method(allow_none: bool = ...) -> Optional[str]: ... def set_start_method(method: str, force: Optional[bool] = ...) -> None: ... + +if sys.platform != "win32": + @overload + def get_context(method: None = ...) -> DefaultContext: ... + @overload + def get_context(method: Literal["spawn"]) -> SpawnContext: ... + @overload + def get_context(method: Literal["fork"]) -> ForkContext: ... + @overload + def get_context(method: Literal["forkserver"]) -> ForkServerContext: ... + @overload + def get_context(method: str) -> BaseContext: ... + +else: + @overload + def get_context(method: None = ...) -> DefaultContext: ... + @overload + def get_context(method: Literal["spawn"]) -> SpawnContext: ... + @overload + def get_context(method: str) -> BaseContext: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/connection.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/connection.pyi old mode 100755 new mode 100644 index 76bdca01..15f58a37 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/connection.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/connection.pyi @@ -1,12 +1,19 @@ -from typing import Any, Iterable, List, Optional, Tuple, Type, Union import socket import sys import types +from typing import Any, Iterable, List, Optional, Tuple, Type, Union + +if sys.version_info >= (3, 8): + from typing import SupportsIndex # https://docs.python.org/3/library/multiprocessing.html#address-formats _Address = Union[str, Tuple[str, int]] class _ConnectionBase: + if sys.version_info >= (3, 8): + def __init__(self, handle: SupportsIndex, readable: bool = ..., writable: bool = ...) -> None: ... + else: + def __init__(self, handle: int, readable: bool = ..., writable: bool = ...) -> None: ... @property def closed(self) -> bool: ... # undocumented @property @@ -15,15 +22,16 @@ class _ConnectionBase: def writable(self) -> bool: ... # undocumented def fileno(self) -> int: ... def close(self) -> None: ... - def send_bytes(self, - buf: bytes, - offset: int = ..., - size: Optional[int] = ...) -> None: ... + def send_bytes(self, buf: bytes, offset: int = ..., size: Optional[int] = ...) -> None: ... def send(self, obj: Any) -> None: ... def recv_bytes(self, maxlength: Optional[int] = ...) -> bytes: ... def recv_bytes_into(self, buf: Any, offset: int = ...) -> int: ... def recv(self) -> Any: ... def poll(self, timeout: Optional[float] = ...) -> bool: ... + def __enter__(self) -> _ConnectionBase: ... + def __exit__( + self, exc_type: Optional[Type[BaseException]], exc_value: Optional[BaseException], exc_tb: Optional[types.TracebackType] + ) -> None: ... class Connection(_ConnectionBase): ... @@ -31,7 +39,9 @@ if sys.platform == "win32": class PipeConnection(_ConnectionBase): ... class Listener: - def __init__(self, address: Optional[_Address] = ..., family: Optional[str] = ..., backlog: int = ..., authkey: Optional[bytes] = ...) -> None: ... + def __init__( + self, address: Optional[_Address] = ..., family: Optional[str] = ..., backlog: int = ..., authkey: Optional[bytes] = ... + ) -> None: ... def accept(self) -> Connection: ... def close(self) -> None: ... @property @@ -39,10 +49,14 @@ class Listener: @property def last_accepted(self) -> Optional[_Address]: ... def __enter__(self) -> Listener: ... - def __exit__(self, exc_type: Optional[Type[BaseException]], exc_value: Optional[BaseException], exc_tb: Optional[types.TracebackType]) -> None: ... + def __exit__( + self, exc_type: Optional[Type[BaseException]], exc_value: Optional[BaseException], exc_tb: Optional[types.TracebackType] + ) -> None: ... def deliver_challenge(connection: Connection, authkey: bytes) -> None: ... def answer_challenge(connection: Connection, authkey: bytes) -> None: ... -def wait(object_list: Iterable[Union[Connection, socket.socket, int]], timeout: Optional[float] = ...) -> List[Union[Connection, socket.socket, int]]: ... +def wait( + object_list: Iterable[Union[Connection, socket.socket, int]], timeout: Optional[float] = ... +) -> List[Union[Connection, socket.socket, int]]: ... def Client(address: _Address, family: Optional[str] = ..., authkey: Optional[bytes] = ...) -> Connection: ... def Pipe(duplex: bool = ...) -> Tuple[Connection, Connection]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/context.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/context.pyi old mode 100755 new mode 100644 index 627c760f..5f39d45d --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/context.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/context.pyi @@ -1,24 +1,20 @@ -# Stubs for multiprocessing.context - -from logging import Logger import multiprocessing -from multiprocessing import synchronize -from multiprocessing import queues -from multiprocessing.process import BaseProcess import sys -from typing import Any, Callable, Iterable, Optional, List, Mapping, Sequence, Type, Union +from logging import Logger +from multiprocessing import queues, sharedctypes, synchronize +from multiprocessing.process import BaseProcess +from typing import Any, Callable, Iterable, List, Optional, Sequence, Type, Union, overload +from typing_extensions import Literal _LockLike = Union[synchronize.Lock, synchronize.RLock] class ProcessError(Exception): ... - class BufferTooShort(ProcessError): ... - class TimeoutError(ProcessError): ... - class AuthenticationError(ProcessError): ... class BaseContext(object): + Process: Type[BaseProcess] ProcessError: Type[Exception] BufferTooShort: Type[Exception] TimeoutError: Type[Exception] @@ -26,7 +22,6 @@ class BaseContext(object): # N.B. The methods below are applied at runtime to generate # multiprocessing.*, so the signatures should be identical (modulo self). - @staticmethod def current_process() -> BaseProcess: ... if sys.version_info >= (3, 8): @@ -39,20 +34,15 @@ class BaseContext(object): def Manager(self) -> Any: ... # TODO: change return to Pipe once a stub exists in multiprocessing.connection def Pipe(self, duplex: bool = ...) -> Any: ... - - def Barrier(self, - parties: int, - action: Optional[Callable[..., Any]] = ..., - timeout: Optional[float] = ...) -> synchronize.Barrier: ... - def BoundedSemaphore(self, - value: int = ...) -> synchronize.BoundedSemaphore: ... - def Condition(self, - lock: Optional[_LockLike] = ...) -> synchronize.Condition: ... - def Event(self, lock: Optional[_LockLike] = ...) -> synchronize.Event: ... + def Barrier( + self, parties: int, action: Optional[Callable[..., Any]] = ..., timeout: Optional[float] = ... + ) -> synchronize.Barrier: ... + def BoundedSemaphore(self, value: int = ...) -> synchronize.BoundedSemaphore: ... + def Condition(self, lock: Optional[_LockLike] = ...) -> synchronize.Condition: ... + def Event(self) -> synchronize.Event: ... def Lock(self) -> synchronize.Lock: ... def RLock(self) -> synchronize.RLock: ... def Semaphore(self, value: int = ...) -> synchronize.Semaphore: ... - def Queue(self, maxsize: int = ...) -> queues.Queue[Any]: ... def JoinableQueue(self, maxsize: int = ...) -> queues.JoinableQueue[Any]: ... def SimpleQueue(self) -> queues.SimpleQueue[Any]: ... @@ -61,7 +51,7 @@ class BaseContext(object): processes: Optional[int] = ..., initializer: Optional[Callable[..., Any]] = ..., initargs: Iterable[Any] = ..., - maxtasksperchild: Optional[int] = ... + maxtasksperchild: Optional[int] = ..., ) -> multiprocessing.pool.Pool: ... # TODO: typecode_or_type param is a ctype with a base class of _SimpleCData or array.typecode Need to figure out # how to handle the ctype @@ -73,30 +63,36 @@ class BaseContext(object): def RawArray(self, typecode_or_type: Any, size_or_initializer: Union[int, Sequence[Any]]) -> Any: ... # TODO: typecode_or_type param is a ctype with a base class of _SimpleCData or array.typecode Need to figure out # how to handle the ctype - # TODO: change return to Value once a stub exists in multiprocessing.sharedctypes - def Value( - self, - typecode_or_type: Any, - *args: Any, - lock: bool = ... - ) -> Any: ... + def Value(self, typecode_or_type: Any, *args: Any, lock: bool = ...) -> sharedctypes._Value: ... # TODO: typecode_or_type param is a ctype with a base class of _SimpleCData or array.typecode Need to figure out # how to handle the ctype - # TODO: change return to Array once a stub exists in multiprocessing.sharedctypes def Array( - self, - typecode_or_type: Any, - size_or_initializer: Union[int, Sequence[Any]], - *, - lock: bool = ... - ) -> Any: ... + self, typecode_or_type: Any, size_or_initializer: Union[int, Sequence[Any]], *, lock: bool = ... + ) -> sharedctypes._Array: ... def freeze_support(self) -> None: ... def get_logger(self) -> Logger: ... def log_to_stderr(self, level: Optional[str] = ...) -> Logger: ... def allow_connection_pickling(self) -> None: ... def set_executable(self, executable: str) -> None: ... def set_forkserver_preload(self, module_names: List[str]) -> None: ... - def get_context(self, method: Optional[str] = ...) -> BaseContext: ... + if sys.platform != "win32": + @overload + def get_context(self, method: None = ...) -> DefaultContext: ... + @overload + def get_context(self, method: Literal["spawn"]) -> SpawnContext: ... + @overload + def get_context(self, method: Literal["fork"]) -> ForkContext: ... + @overload + def get_context(self, method: Literal["forkserver"]) -> ForkServerContext: ... + @overload + def get_context(self, method: str) -> BaseContext: ... + else: + @overload + def get_context(self, method: None = ...) -> DefaultContext: ... + @overload + def get_context(self, method: Literal["spawn"]) -> SpawnContext: ... + @overload + def get_context(self, method: str) -> BaseContext: ... def get_start_method(self, allow_none: bool = ...) -> str: ... def set_start_method(self, method: Optional[str], force: bool = ...) -> None: ... @property @@ -112,46 +108,39 @@ class Process(BaseProcess): class DefaultContext(BaseContext): Process: Type[multiprocessing.Process] - def __init__(self, context: BaseContext) -> None: ... - def get_context(self, method: Optional[str] = ...) -> BaseContext: ... def set_start_method(self, method: Optional[str], force: bool = ...) -> None: ... def get_start_method(self, allow_none: bool = ...) -> str: ... def get_all_start_methods(self) -> List[str]: ... -if sys.platform != 'win32': +if sys.platform != "win32": class ForkProcess(BaseProcess): _start_method: str @staticmethod def _Popen(process_obj: BaseProcess) -> Any: ... - class SpawnProcess(BaseProcess): _start_method: str @staticmethod def _Popen(process_obj: BaseProcess) -> SpawnProcess: ... - class ForkServerProcess(BaseProcess): _start_method: str @staticmethod def _Popen(process_obj: BaseProcess) -> Any: ... - class ForkContext(BaseContext): _name: str Process: Type[ForkProcess] - class SpawnContext(BaseContext): _name: str Process: Type[SpawnProcess] - class ForkServerContext(BaseContext): _name: str Process: Type[ForkServerProcess] + else: class SpawnProcess(BaseProcess): _start_method: str @staticmethod def _Popen(process_obj: BaseProcess) -> Any: ... - class SpawnContext(BaseContext): _name: str Process: Type[SpawnProcess] diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/dummy/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/dummy/__init__.pyi old mode 100755 new mode 100644 index be7ebf99..0089defc --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/dummy/__init__.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/dummy/__init__.pyi @@ -1,10 +1,8 @@ -from typing import Any, Optional, List - import array import threading import weakref - from queue import Queue as Queue +from typing import Any, Callable, Iterable, List, Mapping, Optional, Sequence JoinableQueue = Queue Barrier = threading.Barrier @@ -21,23 +19,33 @@ class DummyProcess(threading.Thread): _pid: None _start_called: int exitcode: Optional[int] - def __init__(self, group=..., target=..., name=..., args=..., kwargs=...) -> None: ... + def __init__( + self, + group: Any = ..., + target: Optional[Callable[..., Any]] = ..., + name: Optional[str] = ..., + args: Iterable[Any] = ..., + kwargs: Mapping[str, Any] = ..., + ) -> None: ... Process = DummyProcess -class Namespace(object): - def __init__(self, **kwds) -> None: ... +class Namespace: + def __init__(self, **kwds: Any) -> None: ... + def __getattr__(self, __name: str) -> Any: ... + def __setattr__(self, __name: str, __value: Any) -> None: ... -class Value(object): +class Value: _typecode: Any _value: Any value: Any - def __init__(self, typecode, value, lock=...) -> None: ... - + def __init__(self, typecode: Any, value: Any, lock: Any = ...) -> None: ... -def Array(typecode, sequence, lock=...) -> array.array[Any]: ... +def Array(typecode: Any, sequence: Sequence[Any], lock: Any = ...) -> array.array[Any]: ... def Manager() -> Any: ... -def Pool(processes=..., initializer=..., initargs=...) -> Any: ... +def Pool( + processes: Optional[int] = ..., initializer: Optional[Callable[..., Any]] = ..., initargs: Iterable[Any] = ... +) -> Any: ... def active_children() -> List[Any]: ... def current_process() -> threading.Thread: ... def freeze_support() -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/dummy/connection.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/dummy/connection.pyi old mode 100755 new mode 100644 index d465a5b4..4f9f7169 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/dummy/connection.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/dummy/connection.pyi @@ -1,11 +1,12 @@ -from typing import Any, List, Optional, Tuple, TypeVar - from queue import Queue +from types import TracebackType +from typing import Any, List, Optional, Tuple, Type, TypeVar, Union families: List[None] -_TConnection = TypeVar('_TConnection', bound=Connection) -_TListener = TypeVar('_TListener', bound=Listener) +_TConnection = TypeVar("_TConnection", bound=Connection) +_TListener = TypeVar("_TListener", bound=Listener) +_Address = Union[str, Tuple[str, int]] class Connection(object): _in: Any @@ -15,8 +16,10 @@ class Connection(object): send: Any send_bytes: Any def __enter__(self: _TConnection) -> _TConnection: ... - def __exit__(self, exc_type, exc_value, exc_tb) -> None: ... - def __init__(self, _in, _out) -> None: ... + def __exit__( + self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType] + ) -> None: ... + def __init__(self, _in: Any, _out: Any) -> None: ... def close(self) -> None: ... def poll(self, timeout: float = ...) -> bool: ... @@ -25,11 +28,12 @@ class Listener(object): @property def address(self) -> Optional[Queue[Any]]: ... def __enter__(self: _TListener) -> _TListener: ... - def __exit__(self, exc_type, exc_value, exc_tb) -> None: ... - def __init__(self, address=..., family=..., backlog=...) -> None: ... + def __exit__( + self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType] + ) -> None: ... + def __init__(self, address: Optional[_Address] = ..., family: Optional[int] = ..., backlog: int = ...) -> None: ... def accept(self) -> Connection: ... def close(self) -> None: ... - -def Client(address) -> Connection: ... +def Client(address: _Address) -> Connection: ... def Pipe(duplex: bool = ...) -> Tuple[Connection, Connection]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/managers.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/managers.pyi old mode 100755 new mode 100644 index 151ade02..92d46731 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/managers.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/managers.pyi @@ -1,33 +1,86 @@ -# Stubs for multiprocessing.managers - # NOTE: These are incomplete! import queue import sys import threading from typing import ( - Any, Callable, ContextManager, Dict, Iterable, Generic, List, Mapping, Optional, - Sequence, Tuple, TypeVar, Union, + Any, + AnyStr, + Callable, + ContextManager, + Dict, + Generic, + Iterable, + List, + Mapping, + Optional, + Sequence, + Tuple, + TypeVar, + Union, ) + from .context import BaseContext if sys.version_info >= (3, 8): - from .shared_memory import ShareableList, SharedMemory, _SLT + from .shared_memory import _SLT, ShareableList, SharedMemory + + _SharedMemory = SharedMemory + _ShareableList = ShareableList + +if sys.version_info >= (3, 9): + from types import GenericAlias -_T = TypeVar('_T') -_KT = TypeVar('_KT') -_VT = TypeVar('_VT') +_T = TypeVar("_T") +_KT = TypeVar("_KT") +_VT = TypeVar("_VT") -class Namespace: ... +class Namespace: + def __init__(self, **kwds: Any) -> None: ... + def __getattr__(self, __name: str) -> Any: ... + def __setattr__(self, __name: str, __value: Any) -> None: ... _Namespace = Namespace -class BaseProxy: ... +class Token(object): + typeid: Optional[Union[str, bytes]] + address: Tuple[Union[str, bytes], int] + id: Optional[Union[str, bytes, int]] + def __init__( + self, typeid: Optional[Union[bytes, str]], address: Tuple[Union[str, bytes], int], id: Optional[Union[str, bytes, int]] + ) -> None: ... + def __repr__(self) -> str: ... + def __getstate__( + self, + ) -> Tuple[Optional[Union[str, bytes]], Tuple[Union[str, bytes], int], Optional[Union[str, bytes, int]]]: ... + def __setstate__( + self, state: Tuple[Optional[Union[str, bytes]], Tuple[Union[str, bytes], int], Optional[Union[str, bytes, int]]] + ) -> None: ... + +class BaseProxy(object): + _address_to_local: Dict[Any, Any] + _mutex: Any + def __init__( + self, + token: Any, + serializer: str, + manager: Any = ..., + authkey: Optional[AnyStr] = ..., + exposed: Any = ..., + incref: bool = ..., + manager_owned: bool = ..., + ) -> None: ... + def __deepcopy__(self, memo: Optional[Any]) -> Any: ... + def _callmethod(self, methodname: str, args: Tuple[Any, ...] = ..., kwds: Dict[Any, Any] = ...) -> None: ... + def _getvalue(self) -> Any: ... + def __reduce__(self) -> Tuple[Any, Tuple[Any, Any, str, Dict[Any, Any]]]: ... class ValueProxy(BaseProxy, Generic[_T]): def get(self) -> _T: ... def set(self, value: _T) -> None: ... value: _T + if sys.version_info >= (3, 9): + def __class_getitem__(cls, item: Any) -> GenericAlias: ... # Returned by BaseManager.get_server() class Server: @@ -50,11 +103,15 @@ class BaseManager(ContextManager[BaseManager]): @property def address(self) -> Any: ... @classmethod - def register(cls, typeid: str, callable: Optional[Callable[..., Any]] = ..., - proxytype: Any = ..., - exposed: Optional[Sequence[str]] = ..., - method_to_typeid: Optional[Mapping[str, str]] = ..., - create_method: bool = ...) -> None: ... + def register( + cls, + typeid: str, + callable: Optional[Callable[..., Any]] = ..., + proxytype: Any = ..., + exposed: Optional[Sequence[str]] = ..., + method_to_typeid: Optional[Mapping[str, str]] = ..., + create_method: bool = ..., + ) -> None: ... class SyncManager(BaseManager, ContextManager[SyncManager]): def BoundedSemaphore(self, value: Any = ...) -> threading.BoundedSemaphore: ... @@ -76,5 +133,5 @@ if sys.version_info >= (3, 8): class SharedMemoryServer(Server): ... class SharedMemoryManager(BaseManager): def get_server(self) -> SharedMemoryServer: ... - def SharedMemory(self, size: int) -> SharedMemory: ... - def ShareableList(self, sequence: Optional[Iterable[_SLT]]) -> ShareableList[_SLT]: ... + def SharedMemory(self, size: int) -> _SharedMemory: ... + def ShareableList(self, sequence: Optional[Iterable[_SLT]]) -> _ShareableList[_SLT]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/pool.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/pool.pyi old mode 100755 new mode 100644 index 5d376443..7a31051f --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/pool.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/pool.pyi @@ -1,14 +1,20 @@ -from typing import Any, Callable, ContextManager, Iterable, Mapping, Optional, List, TypeVar, Generic, Iterator +import sys +from typing import Any, Callable, ContextManager, Generic, Iterable, Iterator, List, Mapping, Optional, TypeVar -_PT = TypeVar('_PT', bound=Pool) -_S = TypeVar('_S') -_T = TypeVar('_T') +if sys.version_info >= (3, 9): + from types import GenericAlias + +_PT = TypeVar("_PT", bound=Pool) +_S = TypeVar("_S") +_T = TypeVar("_T") class ApplyResult(Generic[_T]): def get(self, timeout: Optional[float] = ...) -> _T: ... def wait(self, timeout: Optional[float] = ...) -> None: ... def ready(self) -> bool: ... def successful(self) -> bool: ... + if sys.version_info >= (3, 9): + def __class_getitem__(cls, item: Any) -> GenericAlias: ... # alias created during issue #17805 AsyncResult = ApplyResult @@ -23,59 +29,54 @@ class IMapIterator(Iterator[_T]): class IMapUnorderedIterator(IMapIterator[_T]): ... class Pool(ContextManager[Pool]): - def __init__(self, processes: Optional[int] = ..., - initializer: Optional[Callable[..., None]] = ..., - initargs: Iterable[Any] = ..., - maxtasksperchild: Optional[int] = ..., - context: Optional[Any] = ...) -> None: ... - def apply(self, - func: Callable[..., _T], - args: Iterable[Any] = ..., - kwds: Mapping[str, Any] = ...) -> _T: ... - def apply_async(self, - func: Callable[..., _T], - args: Iterable[Any] = ..., - kwds: Mapping[str, Any] = ..., - callback: Optional[Callable[[_T], None]] = ..., - error_callback: Optional[Callable[[BaseException], None]] = ...) -> AsyncResult[_T]: ... - def map(self, - func: Callable[[_S], _T], - iterable: Iterable[_S] = ..., - chunksize: Optional[int] = ...) -> List[_T]: ... - def map_async(self, func: Callable[[_S], _T], - iterable: Iterable[_S] = ..., - chunksize: Optional[int] = ..., - callback: Optional[Callable[[_T], None]] = ..., - error_callback: Optional[Callable[[BaseException], None]] = ...) -> MapResult[_T]: ... - def imap(self, - func: Callable[[_S], _T], - iterable: Iterable[_S] = ..., - chunksize: Optional[int] = ...) -> IMapIterator[_T]: ... - def imap_unordered(self, - func: Callable[[_S], _T], - iterable: Iterable[_S] = ..., - chunksize: Optional[int] = ...) -> IMapIterator[_T]: ... - def starmap(self, - func: Callable[..., _T], - iterable: Iterable[Iterable[Any]] = ..., - chunksize: Optional[int] = ...) -> List[_T]: ... - def starmap_async(self, - func: Callable[..., _T], - iterable: Iterable[Iterable[Any]] = ..., - chunksize: Optional[int] = ..., - callback: Optional[Callable[[_T], None]] = ..., - error_callback: Optional[Callable[[BaseException], None]] = ...) -> AsyncResult[List[_T]]: ... + def __init__( + self, + processes: Optional[int] = ..., + initializer: Optional[Callable[..., None]] = ..., + initargs: Iterable[Any] = ..., + maxtasksperchild: Optional[int] = ..., + context: Optional[Any] = ..., + ) -> None: ... + def apply(self, func: Callable[..., _T], args: Iterable[Any] = ..., kwds: Mapping[str, Any] = ...) -> _T: ... + def apply_async( + self, + func: Callable[..., _T], + args: Iterable[Any] = ..., + kwds: Mapping[str, Any] = ..., + callback: Optional[Callable[[_T], None]] = ..., + error_callback: Optional[Callable[[BaseException], None]] = ..., + ) -> AsyncResult[_T]: ... + def map(self, func: Callable[[_S], _T], iterable: Iterable[_S], chunksize: Optional[int] = ...) -> List[_T]: ... + def map_async( + self, + func: Callable[[_S], _T], + iterable: Iterable[_S], + chunksize: Optional[int] = ..., + callback: Optional[Callable[[_T], None]] = ..., + error_callback: Optional[Callable[[BaseException], None]] = ..., + ) -> MapResult[_T]: ... + def imap(self, func: Callable[[_S], _T], iterable: Iterable[_S], chunksize: Optional[int] = ...) -> IMapIterator[_T]: ... + def imap_unordered( + self, func: Callable[[_S], _T], iterable: Iterable[_S], chunksize: Optional[int] = ... + ) -> IMapIterator[_T]: ... + def starmap(self, func: Callable[..., _T], iterable: Iterable[Iterable[Any]], chunksize: Optional[int] = ...) -> List[_T]: ... + def starmap_async( + self, + func: Callable[..., _T], + iterable: Iterable[Iterable[Any]], + chunksize: Optional[int] = ..., + callback: Optional[Callable[[_T], None]] = ..., + error_callback: Optional[Callable[[BaseException], None]] = ..., + ) -> AsyncResult[List[_T]]: ... def close(self) -> None: ... def terminate(self) -> None: ... def join(self) -> None: ... def __enter__(self: _PT) -> _PT: ... - class ThreadPool(Pool, ContextManager[ThreadPool]): - - def __init__(self, processes: Optional[int] = ..., - initializer: Optional[Callable[..., Any]] = ..., - initargs: Iterable[Any] = ...) -> None: ... + def __init__( + self, processes: Optional[int] = ..., initializer: Optional[Callable[..., Any]] = ..., initargs: Iterable[Any] = ... + ) -> None: ... # undocumented RUN: int diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/process.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/process.pyi old mode 100755 new mode 100644 index a979ee7b..f2d0b574 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/process.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/process.pyi @@ -34,5 +34,6 @@ class BaseProcess: def current_process() -> BaseProcess: ... def active_children() -> List[BaseProcess]: ... + if sys.version_info >= (3, 8): def parent_process() -> Optional[BaseProcess]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/queues.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/queues.pyi old mode 100755 new mode 100644 index c6dd0f20..3d61e44e --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/queues.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/queues.pyi @@ -1,8 +1,11 @@ +import queue +import sys from typing import Any, Generic, Optional, TypeVar -import queue +if sys.version_info >= (3, 9): + from types import GenericAlias -_T = TypeVar('_T') +_T = TypeVar("_T") class Queue(queue.Queue[_T]): # FIXME: `ctx` is a circular dependency and it's not actually optional. @@ -28,3 +31,5 @@ class SimpleQueue(Generic[_T]): def empty(self) -> bool: ... def get(self) -> _T: ... def put(self, item: _T) -> None: ... + if sys.version_info >= (3, 9): + def __class_getitem__(cls, item: Any) -> GenericAlias: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/shared_memory.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/shared_memory.pyi old mode 100755 new mode 100644 index 6a16a09a..cf8b68bf --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/shared_memory.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/shared_memory.pyi @@ -1,5 +1,8 @@ import sys -from typing import Generic, Iterable, Optional, Tuple, TypeVar +from typing import Any, Generic, Iterable, Optional, Tuple, TypeVar + +if sys.version_info >= (3, 9): + from types import GenericAlias _S = TypeVar("_S") _SLT = TypeVar("_SLT", int, float, bool, str, bytes, None) @@ -15,7 +18,6 @@ if sys.version_info >= (3, 8): def size(self) -> int: ... def close(self) -> None: ... def unlink(self) -> None: ... - class ShareableList(Generic[_SLT]): shm: SharedMemory def __init__(self, sequence: Optional[Iterable[_SLT]] = ..., *, name: Optional[str] = ...) -> None: ... @@ -27,3 +29,5 @@ if sys.version_info >= (3, 8): def format(self) -> str: ... def count(self, value: _SLT) -> int: ... def index(self, value: _SLT) -> int: ... + if sys.version_info >= (3, 9): + def __class_getitem__(cls, item: Any) -> GenericAlias: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/sharedctypes.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/sharedctypes.pyi new file mode 100644 index 00000000..3979b094 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/sharedctypes.pyi @@ -0,0 +1,43 @@ +from ctypes import _CData +from multiprocessing.context import BaseContext +from multiprocessing.synchronize import _LockLike +from typing import Any, List, Optional, Sequence, Type, Union, overload + +class _Array: + value: Any = ... + def __init__( + self, + typecode_or_type: Union[str, Type[_CData]], + size_or_initializer: Union[int, Sequence[Any]], + *, + lock: Union[bool, _LockLike] = ..., + ) -> None: ... + def acquire(self) -> bool: ... + def release(self) -> bool: ... + def get_lock(self) -> _LockLike: ... + def get_obj(self) -> Any: ... + @overload + def __getitem__(self, key: int) -> Any: ... + @overload + def __getitem__(self, key: slice) -> List[Any]: ... + def __getslice__(self, start: int, stop: int) -> Any: ... + def __setitem__(self, key: int, value: Any) -> None: ... + +class _Value: + value: Any = ... + def __init__(self, typecode_or_type: Union[str, Type[_CData]], *args: Any, lock: Union[bool, _LockLike] = ...) -> None: ... + def get_lock(self) -> _LockLike: ... + def get_obj(self) -> Any: ... + def acquire(self) -> bool: ... + def release(self) -> bool: ... + +def Array( + typecode_or_type: Union[str, Type[_CData]], + size_or_initializer: Union[int, Sequence[Any]], + *, + lock: Union[bool, _LockLike] = ..., + ctx: Optional[BaseContext] = ..., +) -> _Array: ... +def Value( + typecode_or_type: Union[str, Type[_CData]], *args: Any, lock: Union[bool, _LockLike] = ..., ctx: Optional[BaseContext] = ... +) -> _Value: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/spawn.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/spawn.pyi old mode 100755 new mode 100644 index 9d170f6f..0faee175 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/spawn.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/spawn.pyi @@ -1,5 +1,5 @@ -from typing import Any, Dict, List, Mapping, Optional, Sequence from types import ModuleType +from typing import Any, Dict, List, Mapping, Optional, Sequence WINEXE: bool WINSERVICE: bool @@ -10,9 +10,12 @@ def is_forking(argv: Sequence[str]) -> bool: ... def freeze_support() -> None: ... def get_command_line(**kwds: Any) -> List[str]: ... def spawn_main(pipe_handle: int, parent_pid: Optional[int] = ..., tracker_fd: Optional[int] = ...) -> None: ... + # undocumented def _main(fd: int) -> Any: ... def get_preparation_data(name: str) -> Dict[str, Any]: ... + old_main_modules: List[ModuleType] + def prepare(data: Mapping[str, Any]) -> None: ... def import_main_path(main_path: str) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/synchronize.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/synchronize.pyi old mode 100755 new mode 100644 index 224485b3..7eefc767 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/synchronize.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/multiprocessing/synchronize.pyi @@ -1,46 +1,32 @@ -from typing import Any, Callable, ContextManager, Optional, Union - -from multiprocessing.context import BaseContext -import threading import sys +import threading +from multiprocessing.context import BaseContext +from typing import Any, Callable, ContextManager, Optional, Union _LockLike = Union[Lock, RLock] class Barrier(threading.Barrier): - def __init__(self, - parties: int, - action: Optional[Callable[..., Any]] = ..., - timeout: Optional[float] = ..., - * - ctx: BaseContext) -> None: ... + def __init__( + self, parties: int, action: Optional[Callable[..., Any]] = ..., timeout: Optional[float] = ..., *ctx: BaseContext + ) -> None: ... class BoundedSemaphore(Semaphore): def __init__(self, value: int = ..., *, ctx: BaseContext) -> None: ... class Condition(ContextManager[bool]): - def __init__(self, - lock: Optional[_LockLike] = ..., - *, - ctx: BaseContext) -> None: ... + def __init__(self, lock: Optional[_LockLike] = ..., *, ctx: BaseContext) -> None: ... if sys.version_info >= (3, 7): def notify(self, n: int = ...) -> None: ... else: def notify(self) -> None: ... def notify_all(self) -> None: ... def wait(self, timeout: Optional[float] = ...) -> bool: ... - def wait_for(self, - predicate: Callable[[], bool], - timeout: Optional[float] = ...) -> bool: ... - def acquire(self, - block: bool = ..., - timeout: Optional[float] = ...) -> bool: ... + def wait_for(self, predicate: Callable[[], bool], timeout: Optional[float] = ...) -> bool: ... + def acquire(self, block: bool = ..., timeout: Optional[float] = ...) -> bool: ... def release(self) -> None: ... class Event(ContextManager[bool]): - def __init__(self, - lock: Optional[_LockLike] = ..., - *, - ctx: BaseContext) -> None: ... + def __init__(self, lock: Optional[_LockLike] = ..., *, ctx: BaseContext) -> None: ... def is_set(self) -> bool: ... def set(self) -> None: ... def clear(self) -> None: ... @@ -57,7 +43,5 @@ class Semaphore(SemLock): # Not part of public API class SemLock(ContextManager[bool]): - def acquire(self, - block: bool = ..., - timeout: Optional[float] = ...) -> bool: ... + def acquire(self, block: bool = ..., timeout: Optional[float] = ...) -> bool: ... def release(self) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/nntplib.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/nntplib.pyi old mode 100755 new mode 100644 index 78b078cb..7e7b7b84 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/nntplib.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/nntplib.pyi @@ -1,16 +1,15 @@ -# Stubs for nntplib (Python 3) - import datetime import socket import ssl -from typing import Any, Dict, IO, Iterable, List, NamedTuple, Optional, Tuple, TypeVar, Union +import sys +from typing import IO, Any, Dict, Iterable, List, NamedTuple, Optional, Tuple, TypeVar, Union -_SelfT = TypeVar('_SelfT', bound=_NNTPBase) +_SelfT = TypeVar("_SelfT", bound=_NNTPBase) _File = Union[IO[bytes], bytes, str, None] - class NNTPError(Exception): response: str + class NNTPReplyError(NNTPError): ... class NNTPTemporaryError(NNTPError): ... class NNTPPermanentError(NNTPError): ... @@ -25,6 +24,7 @@ class GroupInfo(NamedTuple): last: str first: str flag: str + class ArticleInfo(NamedTuple): number: int message_id: str @@ -45,9 +45,7 @@ class _NNTPBase: authenticated: bool nntp_implementation: str nntp_version: int - - def __init__(self, file: IO[bytes], host: str, - readermode: Optional[bool] = ..., timeout: float = ...) -> None: ... + def __init__(self, file: IO[bytes], host: str, readermode: Optional[bool] = ..., timeout: float = ...) -> None: ... def __enter__(self: _SelfT) -> _SelfT: ... def __exit__(self, *args: Any) -> None: ... def getwelcome(self) -> str: ... @@ -56,7 +54,9 @@ class _NNTPBase: def debug(self, level: int) -> None: ... def capabilities(self) -> Tuple[str, Dict[str, List[str]]]: ... def newgroups(self, date: Union[datetime.date, datetime.datetime], *, file: _File = ...) -> Tuple[str, List[str]]: ... - def newnews(self, group: str, date: Union[datetime.date, datetime.datetime], *, file: _File = ...) -> Tuple[str, List[str]]: ... + def newnews( + self, group: str, date: Union[datetime.date, datetime.datetime], *, file: _File = ... + ) -> Tuple[str, List[str]]: ... def list(self, group_pattern: Optional[str] = ..., *, file: _File = ...) -> Tuple[str, List[str]]: ... def description(self, group: str) -> str: ... def descriptions(self, group_pattern: str) -> Tuple[str, Dict[str, str]]: ... @@ -71,9 +71,12 @@ class _NNTPBase: def slave(self) -> str: ... def xhdr(self, hdr: str, str: Any, *, file: _File = ...) -> Tuple[str, List[str]]: ... def xover(self, start: int, end: int, *, file: _File = ...) -> Tuple[str, List[Tuple[int, Dict[str, str]]]]: ... - def over(self, message_spec: Union[None, str, List[Any], Tuple[Any, ...]], *, file: _File = ...) -> Tuple[str, List[Tuple[int, Dict[str, str]]]]: ... - def xgtitle(self, group: str, *, file: _File = ...) -> Tuple[str, List[Tuple[str, str]]]: ... - def xpath(self, id: Any) -> Tuple[str, str]: ... + def over( + self, message_spec: Union[None, str, List[Any], Tuple[Any, ...]], *, file: _File = ... + ) -> Tuple[str, List[Tuple[int, Dict[str, str]]]]: ... + if sys.version_info < (3, 9): + def xgtitle(self, group: str, *, file: _File = ...) -> Tuple[str, List[Tuple[str, str]]]: ... + def xpath(self, id: Any) -> Tuple[str, str]: ... def date(self) -> Tuple[str, datetime.datetime]: ... def post(self, data: Union[bytes, Iterable[bytes]]) -> str: ... def ihave(self, message_id: Any, data: Union[bytes, Iterable[bytes]]) -> str: ... @@ -81,20 +84,30 @@ class _NNTPBase: def login(self, user: Optional[str] = ..., password: Optional[str] = ..., usenetrc: bool = ...) -> None: ... def starttls(self, ssl_context: Optional[ssl.SSLContext] = ...) -> None: ... - class NNTP(_NNTPBase): port: int sock: socket.socket - - def __init__(self, host: str, port: int = ..., user: Optional[str] = ..., password: Optional[str] = ..., - readermode: Optional[bool] = ..., usenetrc: bool = ..., - timeout: float = ...) -> None: ... - + def __init__( + self, + host: str, + port: int = ..., + user: Optional[str] = ..., + password: Optional[str] = ..., + readermode: Optional[bool] = ..., + usenetrc: bool = ..., + timeout: float = ..., + ) -> None: ... class NNTP_SSL(_NNTPBase): sock: socket.socket - - def __init__(self, host: str, port: int = ..., user: Optional[str] = ..., password: Optional[str] = ..., - ssl_context: Optional[ssl.SSLContext] = ..., - readermode: Optional[bool] = ..., usenetrc: bool = ..., - timeout: float = ...) -> None: ... + def __init__( + self, + host: str, + port: int = ..., + user: Optional[str] = ..., + password: Optional[str] = ..., + ssl_context: Optional[ssl.SSLContext] = ..., + readermode: Optional[bool] = ..., + usenetrc: bool = ..., + timeout: float = ..., + ) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/ntpath.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/ntpath.pyi new file mode 100644 index 00000000..7dac80e5 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/ntpath.pyi @@ -0,0 +1,144 @@ +import os +import sys +from _typeshed import AnyPath, BytesPath, StrPath +from genericpath import exists as exists +from typing import Any, AnyStr, Optional, Sequence, Tuple, TypeVar, overload + +_T = TypeVar("_T") + +if sys.version_info >= (3, 6): + from builtins import _PathLike + +# ----- os.path variables ----- +supports_unicode_filenames: bool +# aliases (also in os) +curdir: str +pardir: str +sep: str +if sys.platform == "win32": + altsep: str +else: + altsep: Optional[str] +extsep: str +pathsep: str +defpath: str +devnull: str + +# ----- os.path function stubs ----- +if sys.version_info >= (3, 6): + # Overloads are necessary to work around python/mypy#3644. + @overload + def abspath(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def abspath(path: AnyStr) -> AnyStr: ... + @overload + def basename(p: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def basename(p: AnyStr) -> AnyStr: ... + @overload + def dirname(p: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def dirname(p: AnyStr) -> AnyStr: ... + @overload + def expanduser(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def expanduser(path: AnyStr) -> AnyStr: ... + @overload + def expandvars(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def expandvars(path: AnyStr) -> AnyStr: ... + @overload + def normcase(s: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def normcase(s: AnyStr) -> AnyStr: ... + @overload + def normpath(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def normpath(path: AnyStr) -> AnyStr: ... + if sys.platform == "win32": + @overload + def realpath(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def realpath(path: AnyStr) -> AnyStr: ... + else: + @overload + def realpath(filename: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def realpath(filename: AnyStr) -> AnyStr: ... + +else: + def abspath(path: AnyStr) -> AnyStr: ... + def basename(p: AnyStr) -> AnyStr: ... + def dirname(p: AnyStr) -> AnyStr: ... + def expanduser(path: AnyStr) -> AnyStr: ... + def expandvars(path: AnyStr) -> AnyStr: ... + def normcase(s: AnyStr) -> AnyStr: ... + def normpath(path: AnyStr) -> AnyStr: ... + if sys.platform == "win32": + def realpath(path: AnyStr) -> AnyStr: ... + else: + def realpath(filename: AnyStr) -> AnyStr: ... + +if sys.version_info >= (3, 6): + # In reality it returns str for sequences of StrPath and bytes for sequences + # of BytesPath, but mypy does not accept such a signature. + def commonpath(paths: Sequence[AnyPath]) -> Any: ... + +elif sys.version_info >= (3, 5): + def commonpath(paths: Sequence[AnyStr]) -> AnyStr: ... + +# NOTE: Empty lists results in '' (str) regardless of contained type. +# So, fall back to Any +def commonprefix(m: Sequence[AnyPath]) -> Any: ... +def lexists(path: AnyPath) -> bool: ... + +# These return float if os.stat_float_times() == True, +# but int is a subclass of float. +def getatime(filename: AnyPath) -> float: ... +def getmtime(filename: AnyPath) -> float: ... +def getctime(filename: AnyPath) -> float: ... +def getsize(filename: AnyPath) -> int: ... +def isabs(s: AnyPath) -> bool: ... +def isfile(path: AnyPath) -> bool: ... +def isdir(s: AnyPath) -> bool: ... +def islink(path: AnyPath) -> bool: ... +def ismount(path: AnyPath) -> bool: ... + +if sys.version_info >= (3, 6): + @overload + def join(a: StrPath, *paths: StrPath) -> str: ... + @overload + def join(a: BytesPath, *paths: BytesPath) -> bytes: ... + +else: + def join(a: AnyStr, *paths: AnyStr) -> AnyStr: ... + +@overload +def relpath(path: BytesPath, start: Optional[BytesPath] = ...) -> bytes: ... +@overload +def relpath(path: StrPath, start: Optional[StrPath] = ...) -> str: ... +def samefile(f1: AnyPath, f2: AnyPath) -> bool: ... +def sameopenfile(fp1: int, fp2: int) -> bool: ... +def samestat(s1: os.stat_result, s2: os.stat_result) -> bool: ... + +if sys.version_info >= (3, 6): + @overload + def split(p: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... + @overload + def split(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitdrive(p: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitdrive(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitext(p: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitext(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + +else: + def split(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + def splitdrive(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + def splitext(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + +if sys.version_info < (3, 7) and sys.platform == "win32": + def splitunc(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ... # deprecated diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/nturl2path.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/nturl2path.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/os/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/os/__init__.pyi old mode 100755 new mode 100644 index 1b4b3c7b..a311b174 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/os/__init__.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/os/__init__.pyi @@ -1,22 +1,55 @@ -# Stubs for os -# Ron Murawski - -from io import TextIOWrapper as _TextIOWrapper -from posix import listdir as listdir, times_result import sys +from _typeshed import ( + AnyPath, + FileDescriptorLike, + OpenBinaryMode, + OpenBinaryModeReading, + OpenBinaryModeUpdating, + OpenBinaryModeWriting, + OpenTextMode, +) +from builtins import OSError, _PathLike +from io import BufferedRandom, BufferedReader, BufferedWriter, FileIO, TextIOWrapper as _TextIOWrapper +from posix import listdir as listdir, times_result from typing import ( - Mapping, MutableMapping, Dict, List, Any, Tuple, Iterable, Iterator, NoReturn, overload, Union, AnyStr, - Optional, Generic, Set, Callable, Text, Sequence, NamedTuple, TypeVar, ContextManager + IO, + Any, + AnyStr, + BinaryIO, + Callable, + ContextManager, + Dict, + Generic, + Iterable, + Iterator, + List, + Mapping, + MutableMapping, + NoReturn, + Optional, + Sequence, + Set, + Tuple, + TypeVar, + Union, + overload, ) +from typing_extensions import Literal -# Re-exported names from other modules. -from builtins import OSError as error from . import path as path -_T = TypeVar('_T') +if sys.version_info >= (3, 9): + from types import GenericAlias + +# We need to use something from path, or flake8 and pytype get unhappy +_supports_unicode_filenames = path.supports_unicode_filenames + +_T = TypeVar("_T") # ----- os variables ----- +error = OSError + supports_bytes_environ: bool supports_dir_fd: Set[Callable[..., Any]] @@ -24,7 +57,7 @@ supports_fd: Set[Callable[..., Any]] supports_effective_ids: Set[Callable[..., Any]] supports_follow_symlinks: Set[Callable[..., Any]] -if sys.platform != 'win32': +if sys.platform != "win32": # Unix only PRIO_PROCESS: int PRIO_PGRP: int @@ -35,20 +68,22 @@ if sys.platform != 'win32': F_ULOCK: int F_TEST: int - POSIX_FADV_NORMAL: int - POSIX_FADV_SEQUENTIAL: int - POSIX_FADV_RANDOM: int - POSIX_FADV_NOREUSE: int - POSIX_FADV_WILLNEED: int - POSIX_FADV_DONTNEED: int + if sys.platform != "darwin": + POSIX_FADV_NORMAL: int + POSIX_FADV_SEQUENTIAL: int + POSIX_FADV_RANDOM: int + POSIX_FADV_NOREUSE: int + POSIX_FADV_WILLNEED: int + POSIX_FADV_DONTNEED: int SF_NODISKIO: int SF_MNOWAIT: int SF_SYNC: int - XATTR_SIZE_MAX: int # Linux only - XATTR_CREATE: int # Linux only - XATTR_REPLACE: int # Linux only + if sys.platform == "linux": + XATTR_SIZE_MAX: int + XATTR_CREATE: int + XATTR_REPLACE: int P_PID: int P_PGID: int @@ -71,18 +106,19 @@ if sys.platform != 'win32': SCHED_RR: int # some flavors of Unix SCHED_RESET_ON_FORK: int # some flavors of Unix -RTLD_LAZY: int -RTLD_NOW: int -RTLD_GLOBAL: int -RTLD_LOCAL: int -RTLD_NODELETE: int -RTLD_NOLOAD: int -RTLD_DEEPBIND: int +if sys.platform != "win32": + RTLD_LAZY: int + RTLD_NOW: int + RTLD_GLOBAL: int + RTLD_LOCAL: int + RTLD_NODELETE: int + RTLD_NOLOAD: int + RTLD_DEEPBIND: int SEEK_SET: int SEEK_CUR: int SEEK_END: int -if sys.platform != 'win32': +if sys.platform != "win32": SEEK_DATA: int # some flavors of Unix SEEK_HOLE: int # some flavors of Unix @@ -96,27 +132,27 @@ O_TRUNC: int # We don't use sys.platform for O_* flags to denote platform-dependent APIs because some codes, # including tests for mypy, use a more finer way than sys.platform before using these APIs # See https://github.com/python/typeshed/pull/2286 for discussions -O_DSYNC: int # Unix only -O_RSYNC: int # Unix only -O_SYNC: int # Unix only -O_NDELAY: int # Unix only +O_DSYNC: int # Unix only +O_RSYNC: int # Unix only +O_SYNC: int # Unix only +O_NDELAY: int # Unix only O_NONBLOCK: int # Unix only -O_NOCTTY: int # Unix only +O_NOCTTY: int # Unix only O_CLOEXEC: int # Unix only -O_SHLOCK: int # Unix only -O_EXLOCK: int # Unix only -O_BINARY: int # Windows only +O_SHLOCK: int # Unix only +O_EXLOCK: int # Unix only +O_BINARY: int # Windows only O_NOINHERIT: int # Windows only O_SHORT_LIVED: int # Windows only O_TEMPORARY: int # Windows only -O_RANDOM: int # Windows only +O_RANDOM: int # Windows only O_SEQUENTIAL: int # Windows only -O_TEXT: int # Windows only -O_ASYNC: int # Gnu extension if in C library -O_DIRECT: int # Gnu extension if in C library +O_TEXT: int # Windows only +O_ASYNC: int # Gnu extension if in C library +O_DIRECT: int # Gnu extension if in C library O_DIRECTORY: int # Gnu extension if in C library -O_NOFOLLOW: int # Gnu extension if in C library -O_NOATIME: int # Gnu extension if in C library +O_NOFOLLOW: int # Gnu extension if in C library +O_NOATIME: int # Gnu extension if in C library O_PATH: int # Gnu extension if in C library O_TMPFILE: int # Gnu extension if in C library O_LARGEFILE: int # Gnu extension if in C library @@ -124,7 +160,7 @@ O_LARGEFILE: int # Gnu extension if in C library curdir: str pardir: str sep: str -if sys.platform == 'win32': +if sys.platform == "win32": altsep: str else: altsep: Optional[str] @@ -149,9 +185,10 @@ class _Environ(MutableMapping[AnyStr, AnyStr], Generic[AnyStr]): def __len__(self) -> int: ... environ: _Environ[str] -environb: _Environ[bytes] +if sys.platform != "win32": + environb: _Environ[bytes] -if sys.platform != 'win32': +if sys.platform != "win32": confstr_names: Dict[str, int] pathconf_names: Dict[str, int] sysconf_names: Dict[str, int] @@ -177,12 +214,12 @@ if sys.platform != 'win32': P_NOWAIT: int P_NOWAITO: int P_WAIT: int -if sys.platform == 'win32': +if sys.platform == "win32": P_DETACH: int P_OVERLAY: int # wait()/waitpid() options -if sys.platform != 'win32': +if sys.platform != "win32": WNOHANG: int # Unix only WCONTINUED: int # some Unix systems WUNTRACED: int # Unix only @@ -212,12 +249,11 @@ class stat_result: st_ctime_ns: int # platform dependent (time of most recent metadata change on Unix, or the time of creation on Windows) in nanoseconds if sys.version_info >= (3, 8) and sys.platform == "win32": st_reparse_tag: int - + if sys.platform == "win32": + st_file_attributes: int def __getitem__(self, i: int) -> int: ... - # not documented def __init__(self, tuple: Tuple[int, ...]) -> None: ... - # On some Unix systems (such as Linux), the following attributes may also # be available: st_blocks: int # number of blocks allocated for file @@ -235,81 +271,83 @@ class stat_result: st_creator: int st_type: int -if sys.version_info >= (3, 6): - from builtins import _PathLike as PathLike # See comment in builtins +PathLike = _PathLike # See comment in builtins -_PathType = path._PathType -_FdOrPathType = Union[int, _PathType] +_FdOrAnyPath = Union[int, AnyPath] -if sys.version_info >= (3, 6): - class DirEntry(PathLike[AnyStr]): - # This is what the scandir interator yields - # The constructor is hidden +class DirEntry(Generic[AnyStr]): + # This is what the scandir interator yields + # The constructor is hidden - name: AnyStr - path: AnyStr - def inode(self) -> int: ... - def is_dir(self, *, follow_symlinks: bool = ...) -> bool: ... - def is_file(self, *, follow_symlinks: bool = ...) -> bool: ... - def is_symlink(self) -> bool: ... - def stat(self, *, follow_symlinks: bool = ...) -> stat_result: ... + name: AnyStr + path: AnyStr + def inode(self) -> int: ... + def is_dir(self, *, follow_symlinks: bool = ...) -> bool: ... + def is_file(self, *, follow_symlinks: bool = ...) -> bool: ... + def is_symlink(self) -> bool: ... + def stat(self, *, follow_symlinks: bool = ...) -> stat_result: ... + def __fspath__(self) -> AnyStr: ... + if sys.version_info >= (3, 9): + def __class_getitem__(cls, item: Any) -> GenericAlias: ... - def __fspath__(self) -> AnyStr: ... -else: - class DirEntry(Generic[AnyStr]): - # This is what the scandir interator yields - # The constructor is hidden - - name: AnyStr - path: AnyStr - def inode(self) -> int: ... - def is_dir(self, *, follow_symlinks: bool = ...) -> bool: ... - def is_file(self, *, follow_symlinks: bool = ...) -> bool: ... - def is_symlink(self) -> bool: ... - def stat(self, *, follow_symlinks: bool = ...) -> stat_result: ... - - -if sys.platform != 'win32': - class statvfs_result: # Unix only - f_bsize: int - f_frsize: int - f_blocks: int - f_bfree: int - f_bavail: int - f_files: int - f_ffree: int - f_favail: int - f_flag: int - f_namemax: int +if sys.platform != "win32": + _Tuple10Int = Tuple[int, int, int, int, int, int, int, int, int, int] + _Tuple11Int = Tuple[int, int, int, int, int, int, int, int, int, int, int] + if sys.version_info >= (3, 7): + # f_fsid was added in https://github.com/python/cpython/pull/4571 + class statvfs_result(_Tuple10Int): # Unix only + def __new__(cls, seq: Union[_Tuple10Int, _Tuple11Int], dict: Dict[str, int] = ...) -> statvfs_result: ... + n_fields: int + n_sequence_fields: int + n_unnamed_fields: int + + f_bsize: int + f_frsize: int + f_blocks: int + f_bfree: int + f_bavail: int + f_files: int + f_ffree: int + f_favail: int + f_flag: int + f_namemax: int + f_fsid: int = ... + else: + class statvfs_result(_Tuple10Int): # Unix only + n_fields: int + n_sequence_fields: int + n_unnamed_fields: int + + f_bsize: int + f_frsize: int + f_blocks: int + f_bfree: int + f_bavail: int + f_files: int + f_ffree: int + f_favail: int + f_flag: int + f_namemax: int # ----- os function stubs ----- -if sys.version_info >= (3, 6): - def fsencode(filename: Union[str, bytes, PathLike[Any]]) -> bytes: ... -else: - def fsencode(filename: Union[str, bytes]) -> bytes: ... - -if sys.version_info >= (3, 6): - def fsdecode(filename: Union[str, bytes, PathLike[Any]]) -> str: ... -else: - def fsdecode(filename: Union[str, bytes]) -> str: ... - -if sys.version_info >= (3, 6): - @overload - def fspath(path: str) -> str: ... - @overload - def fspath(path: bytes) -> bytes: ... - @overload - def fspath(path: PathLike[Any]) -> Any: ... - +def fsencode(filename: Union[str, bytes, PathLike[Any]]) -> bytes: ... +def fsdecode(filename: Union[str, bytes, PathLike[Any]]) -> str: ... +@overload +def fspath(path: str) -> str: ... +@overload +def fspath(path: bytes) -> bytes: ... +@overload +def fspath(path: PathLike[AnyStr]) -> AnyStr: ... def get_exec_path(env: Optional[Mapping[str, str]] = ...) -> List[str]: ... + # NOTE: get_exec_path(): returns List[bytes] when env not None def getlogin() -> str: ... def getpid() -> int: ... def getppid() -> int: ... -def strerror(code: int) -> str: ... -def umask(mask: int) -> int: ... +def strerror(__code: int) -> str: ... +def umask(__mask: int) -> int: ... -if sys.platform != 'win32': +if sys.platform != "win32": # Unix only def ctermid() -> str: ... def getegid() -> int: ... @@ -322,187 +360,278 @@ if sys.platform != 'win32': def getpgrp() -> int: ... def getpriority(which: int, who: int) -> int: ... def setpriority(which: int, who: int, priority: int) -> None: ... - def getresuid() -> Tuple[int, int, int]: ... - def getresgid() -> Tuple[int, int, int]: ... + if sys.platform != "darwin": + def getresuid() -> Tuple[int, int, int]: ... + def getresgid() -> Tuple[int, int, int]: ... def getuid() -> int: ... - def setegid(egid: int) -> None: ... - def seteuid(euid: int) -> None: ... - def setgid(gid: int) -> None: ... - def setgroups(groups: Sequence[int]) -> None: ... + def setegid(__egid: int) -> None: ... + def seteuid(__euid: int) -> None: ... + def setgid(__gid: int) -> None: ... + def setgroups(__groups: Sequence[int]) -> None: ... def setpgrp() -> None: ... - def setpgid(pid: int, pgrp: int) -> None: ... - def setregid(rgid: int, egid: int) -> None: ... - def setresgid(rgid: int, egid: int, sgid: int) -> None: ... - def setresuid(ruid: int, euid: int, suid: int) -> None: ... - def setreuid(ruid: int, euid: int) -> None: ... - def getsid(pid: int) -> int: ... + def setpgid(__pid: int, __pgrp: int) -> None: ... + def setregid(__rgid: int, __egid: int) -> None: ... + if sys.platform != "darwin": + def setresgid(rgid: int, egid: int, sgid: int) -> None: ... + def setresuid(ruid: int, euid: int, suid: int) -> None: ... + def setreuid(__ruid: int, __euid: int) -> None: ... + def getsid(__pid: int) -> int: ... def setsid() -> None: ... - def setuid(uid: int) -> None: ... + def setuid(__uid: int) -> None: ... from posix import uname_result def uname() -> uname_result: ... @overload -def getenv(key: Text) -> Optional[str]: ... +def getenv(key: str) -> Optional[str]: ... +@overload +def getenv(key: str, default: _T) -> Union[str, _T]: ... + +if sys.platform != "win32": + @overload + def getenvb(key: bytes) -> Optional[bytes]: ... + @overload + def getenvb(key: bytes, default: _T = ...) -> Union[bytes, _T]: ... + +def putenv(__name: Union[bytes, str], __value: Union[bytes, str]) -> None: ... + +if sys.platform != "win32": + def unsetenv(__name: Union[bytes, str]) -> None: ... + +_Opener = Callable[[str, int], int] +@overload +def fdopen( + fd: int, + mode: OpenTextMode = ..., + buffering: int = ..., + encoding: Optional[str] = ..., + errors: Optional[str] = ..., + newline: Optional[str] = ..., + closefd: bool = ..., + opener: Optional[_Opener] = ..., +) -> _TextIOWrapper: ... +@overload +def fdopen( + fd: int, + mode: OpenBinaryMode, + buffering: Literal[0], + encoding: None = ..., + errors: None = ..., + newline: None = ..., + closefd: bool = ..., + opener: Optional[_Opener] = ..., +) -> FileIO: ... @overload -def getenv(key: Text, default: _T) -> Union[str, _T]: ... -def getenvb(key: bytes, default: bytes = ...) -> bytes: ... -def putenv(key: Union[bytes, Text], value: Union[bytes, Text]) -> None: ... -def unsetenv(key: Union[bytes, Text]) -> None: ... - -# Return IO or TextIO -def fdopen(fd: int, mode: str = ..., buffering: int = ..., encoding: Optional[str] = ..., - errors: str = ..., newline: str = ..., closefd: bool = ...) -> Any: ... +def fdopen( + fd: int, + mode: OpenBinaryModeUpdating, + buffering: Literal[-1, 1] = ..., + encoding: None = ..., + errors: None = ..., + newline: None = ..., + closefd: bool = ..., + opener: Optional[_Opener] = ..., +) -> BufferedRandom: ... +@overload +def fdopen( + fd: int, + mode: OpenBinaryModeWriting, + buffering: Literal[-1, 1] = ..., + encoding: None = ..., + errors: None = ..., + newline: None = ..., + closefd: bool = ..., + opener: Optional[_Opener] = ..., +) -> BufferedWriter: ... +@overload +def fdopen( + fd: int, + mode: OpenBinaryModeReading, + buffering: Literal[-1, 1] = ..., + encoding: None = ..., + errors: None = ..., + newline: None = ..., + closefd: bool = ..., + opener: Optional[_Opener] = ..., +) -> BufferedReader: ... +@overload +def fdopen( + fd: int, + mode: OpenBinaryMode, + buffering: int, + encoding: None = ..., + errors: None = ..., + newline: None = ..., + closefd: bool = ..., + opener: Optional[_Opener] = ..., +) -> BinaryIO: ... +@overload +def fdopen( + fd: int, + mode: str, + buffering: int = ..., + encoding: Optional[str] = ..., + errors: Optional[str] = ..., + newline: Optional[str] = ..., + closefd: bool = ..., + opener: Optional[_Opener] = ..., +) -> IO[Any]: ... def close(fd: int) -> None: ... -def closerange(fd_low: int, fd_high: int) -> None: ... +def closerange(__fd_low: int, __fd_high: int) -> None: ... def device_encoding(fd: int) -> Optional[str]: ... -def dup(fd: int) -> int: ... +def dup(__fd: int) -> int: ... + if sys.version_info >= (3, 7): def dup2(fd: int, fd2: int, inheritable: bool = ...) -> int: ... + else: def dup2(fd: int, fd2: int, inheritable: bool = ...) -> None: ... + def fstat(fd: int) -> stat_result: ... -def fsync(fd: int) -> None: ... -def lseek(fd: int, pos: int, how: int) -> int: ... -def open(file: _PathType, flags: int, mode: int = ..., *, dir_fd: Optional[int] = ...) -> int: ... +def fsync(fd: FileDescriptorLike) -> None: ... +def lseek(__fd: int, __position: int, __how: int) -> int: ... +def open(path: AnyPath, flags: int, mode: int = ..., *, dir_fd: Optional[int] = ...) -> int: ... def pipe() -> Tuple[int, int]: ... -def read(fd: int, n: int) -> bytes: ... +def read(__fd: int, __length: int) -> bytes: ... -if sys.platform != 'win32': +if sys.platform != "win32": # Unix only def fchmod(fd: int, mode: int) -> None: ... def fchown(fd: int, uid: int, gid: int) -> None: ... - def fdatasync(fd: int) -> None: ... # Unix only, not Mac - def fpathconf(fd: int, name: Union[str, int]) -> int: ... - def fstatvfs(fd: int) -> statvfs_result: ... - def ftruncate(fd: int, length: int) -> None: ... - def get_blocking(fd: int) -> bool: ... - def set_blocking(fd: int, blocking: bool) -> None: ... - def isatty(fd: int) -> bool: ... - def lockf(__fd: int, __cmd: int, __length: int) -> None: ... + if sys.platform != "darwin": + def fdatasync(fd: FileDescriptorLike) -> None: ... # Unix only, not Mac + def fpathconf(__fd: int, __name: Union[str, int]) -> int: ... + def fstatvfs(__fd: int) -> statvfs_result: ... + def ftruncate(__fd: int, __length: int) -> None: ... + def get_blocking(__fd: int) -> bool: ... + def set_blocking(__fd: int, __blocking: bool) -> None: ... + def isatty(__fd: int) -> bool: ... + def lockf(__fd: int, __command: int, __length: int) -> None: ... def openpty() -> Tuple[int, int]: ... # some flavors of Unix - def pipe2(flags: int) -> Tuple[int, int]: ... # some flavors of Unix - def posix_fallocate(fd: int, offset: int, length: int) -> None: ... - def posix_fadvise(fd: int, offset: int, length: int, advice: int) -> None: ... - def pread(fd: int, buffersize: int, offset: int) -> bytes: ... - def pwrite(fd: int, string: bytes, offset: int) -> int: ... + if sys.platform != "darwin": + def pipe2(flags: int) -> Tuple[int, int]: ... # some flavors of Unix + def posix_fallocate(fd: int, offset: int, length: int) -> None: ... + def posix_fadvise(fd: int, offset: int, length: int, advice: int) -> None: ... + def pread(__fd: int, __length: int, __offset: int) -> bytes: ... + def pwrite(__fd: int, __buffer: bytes, __offset: int) -> int: ... @overload def sendfile(__out_fd: int, __in_fd: int, offset: Optional[int], count: int) -> int: ... @overload - def sendfile(__out_fd: int, __in_fd: int, offset: int, count: int, - headers: Sequence[bytes] = ..., trailers: Sequence[bytes] = ..., flags: int = ...) -> int: ... # FreeBSD and Mac OS X only - def readv(fd: int, buffers: Sequence[bytearray]) -> int: ... - def writev(fd: int, buffers: Sequence[bytes]) -> int: ... + def sendfile( + __out_fd: int, + __in_fd: int, + offset: int, + count: int, + headers: Sequence[bytes] = ..., + trailers: Sequence[bytes] = ..., + flags: int = ..., + ) -> int: ... # FreeBSD and Mac OS X only + def readv(__fd: int, __buffers: Sequence[bytearray]) -> int: ... + def writev(__fd: int, __buffers: Sequence[bytes]) -> int: ... class terminal_size(Tuple[int, int]): columns: int lines: int -def get_terminal_size(fd: int = ...) -> terminal_size: ... -def get_inheritable(fd: int) -> bool: ... -def set_inheritable(fd: int, inheritable: bool) -> None: ... +def get_terminal_size(fd: int = ...) -> terminal_size: ... +def get_inheritable(__fd: int) -> bool: ... +def set_inheritable(__fd: int, __inheritable: bool) -> None: ... -if sys.platform != 'win32': +if sys.platform != "win32": # Unix only - def tcgetpgrp(fd: int) -> int: ... - def tcsetpgrp(fd: int, pg: int) -> None: ... - def ttyname(fd: int) -> str: ... -def write(fd: int, string: bytes) -> int: ... + def tcgetpgrp(__fd: int) -> int: ... + def tcsetpgrp(__fd: int, __pgid: int) -> None: ... + def ttyname(__fd: int) -> str: ... + +def write(__fd: int, __data: bytes) -> int: ... def access( - path: _FdOrPathType, - mode: int, - *, - dir_fd: Optional[int] = ..., - effective_ids: bool = ..., - follow_symlinks: bool = ..., + path: _FdOrAnyPath, mode: int, *, dir_fd: Optional[int] = ..., effective_ids: bool = ..., follow_symlinks: bool = ... ) -> bool: ... -def chdir(path: _FdOrPathType) -> None: ... -def fchdir(fd: int) -> None: ... +def chdir(path: _FdOrAnyPath) -> None: ... + +if sys.platform != "win32": + def fchdir(fd: FileDescriptorLike) -> None: ... + def getcwd() -> str: ... def getcwdb() -> bytes: ... -def chmod(path: _FdOrPathType, mode: int, *, dir_fd: Optional[int] = ..., follow_symlinks: bool = ...) -> None: ... -if sys.platform != 'win32': - def chflags(path: _PathType, flags: int, follow_symlinks: bool = ...) -> None: ... # some flavors of Unix - def chown(path: _FdOrPathType, uid: int, gid: int, *, dir_fd: Optional[int] = ..., follow_symlinks: bool = ...) -> None: ... # Unix only -if sys.platform != 'win32': +def chmod(path: _FdOrAnyPath, mode: int, *, dir_fd: Optional[int] = ..., follow_symlinks: bool = ...) -> None: ... + +if sys.platform != "win32": + def chflags(path: AnyPath, flags: int, follow_symlinks: bool = ...) -> None: ... # some flavors of Unix + def chown( + path: _FdOrAnyPath, uid: int, gid: int, *, dir_fd: Optional[int] = ..., follow_symlinks: bool = ... + ) -> None: ... # Unix only + +if sys.platform != "win32": # Unix only - def chroot(path: _PathType) -> None: ... - def lchflags(path: _PathType, flags: int) -> None: ... - def lchmod(path: _PathType, mode: int) -> None: ... - def lchown(path: _PathType, uid: int, gid: int) -> None: ... + def chroot(path: AnyPath) -> None: ... + def lchflags(path: AnyPath, flags: int) -> None: ... + def lchmod(path: AnyPath, mode: int) -> None: ... + def lchown(path: AnyPath, uid: int, gid: int) -> None: ... + def link( - src: _PathType, - link_name: _PathType, - *, - src_dir_fd: Optional[int] = ..., - dst_dir_fd: Optional[int] = ..., - follow_symlinks: bool = ..., + src: AnyPath, dst: AnyPath, *, src_dir_fd: Optional[int] = ..., dst_dir_fd: Optional[int] = ..., follow_symlinks: bool = ... ) -> None: ... +def lstat(path: AnyPath, *, dir_fd: Optional[int] = ...) -> stat_result: ... +def mkdir(path: AnyPath, mode: int = ..., *, dir_fd: Optional[int] = ...) -> None: ... + +if sys.platform != "win32": + def mkfifo(path: AnyPath, mode: int = ..., *, dir_fd: Optional[int] = ...) -> None: ... # Unix only + +def makedirs(name: AnyPath, mode: int = ..., exist_ok: bool = ...) -> None: ... + +if sys.platform != "win32": + def mknod(path: AnyPath, mode: int = ..., device: int = ..., *, dir_fd: Optional[int] = ...) -> None: ... + def major(__device: int) -> int: ... + def minor(__device: int) -> int: ... + def makedev(__major: int, __minor: int) -> int: ... + def pathconf(path: _FdOrAnyPath, name: Union[str, int]) -> int: ... # Unix only + +def readlink(path: Union[AnyStr, PathLike[AnyStr]], *, dir_fd: Optional[int] = ...) -> AnyStr: ... +def remove(path: AnyPath, *, dir_fd: Optional[int] = ...) -> None: ... +def removedirs(name: AnyPath) -> None: ... +def rename(src: AnyPath, dst: AnyPath, *, src_dir_fd: Optional[int] = ..., dst_dir_fd: Optional[int] = ...) -> None: ... +def renames(old: AnyPath, new: AnyPath) -> None: ... +def replace(src: AnyPath, dst: AnyPath, *, src_dir_fd: Optional[int] = ..., dst_dir_fd: Optional[int] = ...) -> None: ... +def rmdir(path: AnyPath, *, dir_fd: Optional[int] = ...) -> None: ... + +class _ScandirIterator(Iterator[DirEntry[AnyStr]], ContextManager[_ScandirIterator[AnyStr]]): + def __next__(self) -> DirEntry[AnyStr]: ... + def close(self) -> None: ... -def lstat(path: _PathType, *, dir_fd: Optional[int] = ...) -> stat_result: ... -def mkdir(path: _PathType, mode: int = ..., *, dir_fd: Optional[int] = ...) -> None: ... -if sys.platform != 'win32': - def mkfifo(path: _PathType, mode: int = ..., *, dir_fd: Optional[int] = ...) -> None: ... # Unix only -def makedirs(name: _PathType, mode: int = ..., exist_ok: bool = ...) -> None: ... -def mknod(path: _PathType, mode: int = ..., device: int = ..., *, dir_fd: Optional[int] = ...) -> None: ... -def major(device: int) -> int: ... -def minor(device: int) -> int: ... -def makedev(major: int, minor: int) -> int: ... -if sys.platform != 'win32': - def pathconf(path: _FdOrPathType, name: Union[str, int]) -> int: ... # Unix only -if sys.version_info >= (3, 6): - def readlink(path: Union[AnyStr, PathLike[AnyStr]], *, dir_fd: Optional[int] = ...) -> AnyStr: ... -else: - def readlink(path: AnyStr, *, dir_fd: Optional[int] = ...) -> AnyStr: ... -def remove(path: _PathType, *, dir_fd: Optional[int] = ...) -> None: ... -def removedirs(name: _PathType) -> None: ... -def rename(src: _PathType, dst: _PathType, *, src_dir_fd: Optional[int] = ..., dst_dir_fd: Optional[int] = ...) -> None: ... -def renames(old: _PathType, new: _PathType) -> None: ... -def replace(src: _PathType, dst: _PathType, *, src_dir_fd: Optional[int] = ..., dst_dir_fd: Optional[int] = ...) -> None: ... -def rmdir(path: _PathType, *, dir_fd: Optional[int] = ...) -> None: ... if sys.version_info >= (3, 7): - class _ScandirIterator(Iterator[DirEntry[AnyStr]], ContextManager[_ScandirIterator[AnyStr]]): - def __next__(self) -> DirEntry[AnyStr]: ... - def close(self) -> None: ... @overload - def scandir() -> _ScandirIterator[str]: ... + def scandir(path: None = ...) -> _ScandirIterator[str]: ... @overload def scandir(path: int) -> _ScandirIterator[str]: ... @overload def scandir(path: Union[AnyStr, PathLike[AnyStr]]) -> _ScandirIterator[AnyStr]: ... -elif sys.version_info >= (3, 6): - class _ScandirIterator(Iterator[DirEntry[AnyStr]], ContextManager[_ScandirIterator[AnyStr]]): - def __next__(self) -> DirEntry[AnyStr]: ... - def close(self) -> None: ... - @overload - def scandir() -> _ScandirIterator[str]: ... - @overload - def scandir(path: Union[AnyStr, PathLike[AnyStr]]) -> _ScandirIterator[AnyStr]: ... + else: @overload - def scandir() -> Iterator[DirEntry[str]]: ... + def scandir(path: None = ...) -> _ScandirIterator[str]: ... @overload - def scandir(path: AnyStr) -> Iterator[DirEntry[AnyStr]]: ... -def stat(path: _FdOrPathType, *, dir_fd: Optional[int] = ..., follow_symlinks: bool = ...) -> stat_result: ... + def scandir(path: Union[AnyStr, PathLike[AnyStr]]) -> _ScandirIterator[AnyStr]: ... + +def stat(path: _FdOrAnyPath, *, dir_fd: Optional[int] = ..., follow_symlinks: bool = ...) -> stat_result: ... + if sys.version_info < (3, 7): @overload def stat_float_times() -> bool: ... @overload def stat_float_times(__newvalue: bool) -> None: ... -if sys.platform != 'win32': - def statvfs(path: _FdOrPathType) -> statvfs_result: ... # Unix only -def symlink( - source: _PathType, - link_name: _PathType, - target_is_directory: bool = ..., - *, - dir_fd: Optional[int] = ..., -) -> None: ... -if sys.platform != 'win32': + +if sys.platform != "win32": + def statvfs(path: _FdOrAnyPath) -> statvfs_result: ... # Unix only + +def symlink(src: AnyPath, dst: AnyPath, target_is_directory: bool = ..., *, dir_fd: Optional[int] = ...) -> None: ... + +if sys.platform != "win32": def sync() -> None: ... # Unix only -def truncate(path: _FdOrPathType, length: int) -> None: ... # Unix only up to version 3.4 -def unlink(path: _PathType, *, dir_fd: Optional[int] = ...) -> None: ... + +def truncate(path: _FdOrAnyPath, length: int) -> None: ... # Unix only up to version 3.4 +def unlink(path: AnyPath, *, dir_fd: Optional[int] = ...) -> None: ... def utime( - path: _FdOrPathType, + path: _FdOrAnyPath, times: Optional[Union[Tuple[int, int], Tuple[float, float]]] = ..., *, ns: Tuple[int, int] = ..., @@ -512,95 +641,124 @@ def utime( _OnError = Callable[[OSError], Any] -if sys.version_info >= (3, 6): - def walk(top: Union[AnyStr, PathLike[AnyStr]], topdown: bool = ..., - onerror: Optional[_OnError] = ..., - followlinks: bool = ...) -> Iterator[Tuple[AnyStr, List[AnyStr], - List[AnyStr]]]: ... -else: - def walk(top: AnyStr, topdown: bool = ..., onerror: Optional[_OnError] = ..., - followlinks: bool = ...) -> Iterator[Tuple[AnyStr, List[AnyStr], - List[AnyStr]]]: ... -if sys.platform != 'win32': +def walk( + top: Union[AnyStr, PathLike[AnyStr]], topdown: bool = ..., onerror: Optional[_OnError] = ..., followlinks: bool = ... +) -> Iterator[Tuple[AnyStr, List[AnyStr], List[AnyStr]]]: ... + +if sys.platform != "win32": if sys.version_info >= (3, 7): @overload - def fwalk(top: Union[str, PathLike[str]] = ..., topdown: bool = ..., - onerror: Optional[_OnError] = ..., *, follow_symlinks: bool = ..., - dir_fd: Optional[int] = ...) -> Iterator[Tuple[str, List[str], List[str], int]]: ... + def fwalk( + top: Union[str, PathLike[str]] = ..., + topdown: bool = ..., + onerror: Optional[_OnError] = ..., + *, + follow_symlinks: bool = ..., + dir_fd: Optional[int] = ..., + ) -> Iterator[Tuple[str, List[str], List[str], int]]: ... @overload - def fwalk(top: bytes, topdown: bool = ..., - onerror: Optional[_OnError] = ..., *, follow_symlinks: bool = ..., - dir_fd: Optional[int] = ...) -> Iterator[Tuple[bytes, List[bytes], List[bytes], int]]: ... - elif sys.version_info >= (3, 6): - def fwalk(top: Union[str, PathLike[str]] = ..., topdown: bool = ..., - onerror: Optional[_OnError] = ..., *, follow_symlinks: bool = ..., - dir_fd: Optional[int] = ...) -> Iterator[Tuple[str, List[str], List[str], int]]: ... + def fwalk( + top: bytes, + topdown: bool = ..., + onerror: Optional[_OnError] = ..., + *, + follow_symlinks: bool = ..., + dir_fd: Optional[int] = ..., + ) -> Iterator[Tuple[bytes, List[bytes], List[bytes], int]]: ... else: - def fwalk(top: str = ..., topdown: bool = ..., - onerror: Optional[_OnError] = ..., *, follow_symlinks: bool = ..., - dir_fd: Optional[int] = ...) -> Iterator[Tuple[str, List[str], List[str], int]]: ... - def getxattr(path: _FdOrPathType, attribute: _PathType, *, follow_symlinks: bool = ...) -> bytes: ... # Linux only - def listxattr(path: _FdOrPathType, *, follow_symlinks: bool = ...) -> List[str]: ... # Linux only - def removexattr(path: _FdOrPathType, attribute: _PathType, *, follow_symlinks: bool = ...) -> None: ... # Linux only - def setxattr(path: _FdOrPathType, attribute: _PathType, value: bytes, flags: int = ..., *, - follow_symlinks: bool = ...) -> None: ... # Linux only + def fwalk( + top: Union[str, PathLike[str]] = ..., + topdown: bool = ..., + onerror: Optional[_OnError] = ..., + *, + follow_symlinks: bool = ..., + dir_fd: Optional[int] = ..., + ) -> Iterator[Tuple[str, List[str], List[str], int]]: ... + if sys.platform == "linux": + def getxattr(path: _FdOrAnyPath, attribute: AnyPath, *, follow_symlinks: bool = ...) -> bytes: ... + def listxattr(path: _FdOrAnyPath, *, follow_symlinks: bool = ...) -> List[str]: ... + def removexattr(path: _FdOrAnyPath, attribute: AnyPath, *, follow_symlinks: bool = ...) -> None: ... + def setxattr( + path: _FdOrAnyPath, attribute: AnyPath, value: bytes, flags: int = ..., *, follow_symlinks: bool = ... + ) -> None: ... def abort() -> NoReturn: ... + # These are defined as execl(file, *args) but the first *arg is mandatory. -def execl(file: _PathType, __arg0: Union[bytes, Text], *args: Union[bytes, Text]) -> NoReturn: ... -def execlp(file: _PathType, __arg0: Union[bytes, Text], *args: Union[bytes, Text]) -> NoReturn: ... +def execl(file: AnyPath, __arg0: AnyPath, *args: AnyPath) -> NoReturn: ... +def execlp(file: AnyPath, __arg0: AnyPath, *args: AnyPath) -> NoReturn: ... # These are: execle(file, *args, env) but env is pulled from the last element of the args. -def execle(file: _PathType, __arg0: Union[bytes, Text], *args: Any) -> NoReturn: ... -def execlpe(file: _PathType, __arg0: Union[bytes, Text], *args: Any) -> NoReturn: ... +def execle(file: AnyPath, __arg0: AnyPath, *args: Any) -> NoReturn: ... +def execlpe(file: AnyPath, __arg0: AnyPath, *args: Any) -> NoReturn: ... # The docs say `args: tuple or list of strings` # The implementation enforces tuple or list so we can't use Sequence. -_ExecVArgs = Union[Tuple[Union[bytes, Text], ...], List[bytes], List[Text], List[Union[bytes, Text]]] +# Not separating out PathLike[str] and PathLike[bytes] here because it doesn't make much difference +# in practice, and doing so would explode the number of combinations in this already long union. +# All these combinations are necessary due to List being invariant. +_ExecVArgs = Union[ + Tuple[AnyPath, ...], + List[bytes], + List[str], + List[PathLike[Any]], + List[Union[bytes, str]], + List[Union[bytes, PathLike[Any]]], + List[Union[str, PathLike[Any]]], + List[Union[bytes, str, PathLike[Any]]], +] _ExecEnv = Union[Mapping[bytes, Union[bytes, str]], Mapping[str, Union[bytes, str]]] -def execv(path: _PathType, args: _ExecVArgs) -> NoReturn: ... -def execve(path: _FdOrPathType, args: _ExecVArgs, env: _ExecEnv) -> NoReturn: ... -def execvp(file: _PathType, args: _ExecVArgs) -> NoReturn: ... -def execvpe(file: _PathType, args: _ExecVArgs, env: _ExecEnv) -> NoReturn: ... - -def _exit(n: int) -> NoReturn: ... -def kill(pid: int, sig: int) -> None: ... -if sys.platform != 'win32': + +def execv(__path: AnyPath, __argv: _ExecVArgs) -> NoReturn: ... +def execve(path: _FdOrAnyPath, argv: _ExecVArgs, env: _ExecEnv) -> NoReturn: ... +def execvp(file: AnyPath, args: _ExecVArgs) -> NoReturn: ... +def execvpe(file: AnyPath, args: _ExecVArgs, env: _ExecEnv) -> NoReturn: ... +def _exit(status: int) -> NoReturn: ... +def kill(__pid: int, __signal: int) -> None: ... + +if sys.platform != "win32": # Unix only def fork() -> int: ... def forkpty() -> Tuple[int, int]: ... # some flavors of Unix - def killpg(pgid: int, sig: int) -> None: ... - def nice(increment: int) -> int: ... - def plock(op: int) -> None: ... # ???op is int? + def killpg(__pgid: int, __signal: int) -> None: ... + def nice(__increment: int) -> int: ... + if sys.platform != "darwin": + def plock(op: int) -> None: ... # ???op is int? class _wrap_close(_TextIOWrapper): def close(self) -> Optional[int]: ... # type: ignore -def popen(command: str, mode: str = ..., buffering: int = ...) -> _wrap_close: ... - -def spawnl(mode: int, path: _PathType, arg0: Union[bytes, Text], *args: Union[bytes, Text]) -> int: ... -def spawnle(mode: int, path: _PathType, arg0: Union[bytes, Text], - *args: Any) -> int: ... # Imprecise sig -def spawnv(mode: int, path: _PathType, args: List[Union[bytes, Text]]) -> int: ... -def spawnve(mode: int, path: _PathType, args: List[Union[bytes, Text]], - env: _ExecEnv) -> int: ... -def system(command: _PathType) -> int: ... + +def popen(cmd: str, mode: str = ..., buffering: int = ...) -> _wrap_close: ... +def spawnl(mode: int, file: AnyPath, arg0: AnyPath, *args: AnyPath) -> int: ... +def spawnle(mode: int, file: AnyPath, arg0: AnyPath, *args: Any) -> int: ... # Imprecise sig + +if sys.platform != "win32": + def spawnv(mode: int, file: AnyPath, args: _ExecVArgs) -> int: ... + def spawnve(mode: int, file: AnyPath, args: _ExecVArgs, env: _ExecEnv) -> int: ... + +else: + def spawnv(__mode: int, __path: AnyPath, __argv: _ExecVArgs) -> int: ... + def spawnve(__mode: int, __path: AnyPath, __argv: _ExecVArgs, __env: _ExecEnv) -> int: ... + +def system(command: AnyPath) -> int: ... def times() -> times_result: ... -def waitpid(pid: int, options: int) -> Tuple[int, int]: ... +def waitpid(__pid: int, __options: int) -> Tuple[int, int]: ... + +if sys.platform == "win32": + def startfile(path: AnyPath, operation: Optional[str] = ...) -> None: ... -if sys.platform == 'win32': - def startfile(path: _PathType, operation: Optional[str] = ...) -> None: ... else: # Unix only - def spawnlp(mode: int, file: _PathType, arg0: Union[bytes, Text], *args: Union[bytes, Text]) -> int: ... - def spawnlpe(mode: int, file: _PathType, arg0: Union[bytes, Text], *args: Any) -> int: ... # Imprecise signature - def spawnvp(mode: int, file: _PathType, args: List[Union[bytes, Text]]) -> int: ... - def spawnvpe(mode: int, file: _PathType, args: List[Union[bytes, Text]], env: _ExecEnv) -> int: ... + def spawnlp(mode: int, file: AnyPath, arg0: AnyPath, *args: AnyPath) -> int: ... + def spawnlpe(mode: int, file: AnyPath, arg0: AnyPath, *args: Any) -> int: ... # Imprecise signature + def spawnvp(mode: int, file: AnyPath, args: _ExecVArgs) -> int: ... + def spawnvpe(mode: int, file: AnyPath, args: _ExecVArgs, env: _ExecEnv) -> int: ... def wait() -> Tuple[int, int]: ... # Unix only from posix import waitid_result def waitid(idtype: int, ident: int, options: int) -> waitid_result: ... def wait3(options: int) -> Tuple[int, int, Any]: ... def wait4(pid: int, options: int) -> Tuple[int, int, Any]: ... - def WCOREDUMP(status: int) -> bool: ... + def WCOREDUMP(__status: int) -> bool: ... def WIFCONTINUED(status: int) -> bool: ... def WIFSTOPPED(status: int) -> bool: ... def WIFSIGNALED(status: int) -> bool: ... @@ -609,7 +767,7 @@ else: def WSTOPSIG(status: int) -> int: ... def WTERMSIG(status: int) -> int: ... -if sys.platform != 'win32': +if sys.platform != "win32": from posix import sched_param def sched_get_priority_min(policy: int) -> int: ... # some flavors of Unix def sched_get_priority_max(policy: int) -> int: ... # some flavors of Unix @@ -623,24 +781,31 @@ if sys.platform != 'win32': def sched_getaffinity(pid: int) -> Set[int]: ... # some flavors of Unix def cpu_count() -> Optional[int]: ... -if sys.platform != 'win32': + +if sys.platform != "win32": # Unix only - def confstr(name: Union[str, int]) -> Optional[str]: ... + def confstr(__name: Union[str, int]) -> Optional[str]: ... def getloadavg() -> Tuple[float, float, float]: ... - def sysconf(name: Union[str, int]) -> int: ... -if sys.version_info >= (3, 6): + def sysconf(__name: Union[str, int]) -> int: ... + +if sys.platform == "linux": def getrandom(size: int, flags: int = ...) -> bytes: ... - def urandom(size: int) -> bytes: ... -else: - def urandom(n: int) -> bytes: ... -if sys.version_info >= (3, 7): - def register_at_fork(func: Callable[..., object], when: str) -> None: ... +def urandom(__size: int) -> bytes: ... + +if sys.version_info >= (3, 7) and sys.platform != "win32": + def register_at_fork( + *, + before: Optional[Callable[..., Any]] = ..., + after_in_parent: Optional[Callable[..., Any]] = ..., + after_in_child: Optional[Callable[..., Any]] = ..., + ) -> None: ... if sys.version_info >= (3, 8): if sys.platform == "win32": class _AddedDllDirectory: path: Optional[str] + def __init__(self, path: Optional[str], cookie: _T, remove_dll_directory: Callable[[_T], Any]) -> None: ... def close(self) -> None: ... def __enter__(self: _T) -> _T: ... def __exit__(self, *args: Any) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/os/path.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/os/path.pyi old mode 100755 new mode 100644 index 42409c0e..7dac80e5 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/os/path.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/os/path.pyi @@ -1,22 +1,13 @@ -# NB: path.pyi and stdlib/2 and stdlib/3 must remain consistent! -# Stubs for os.path -# Ron Murawski - import os import sys -from typing import overload, List, Any, AnyStr, Sequence, Tuple, TypeVar, Union, Text, Callable, Optional +from _typeshed import AnyPath, BytesPath, StrPath +from genericpath import exists as exists +from typing import Any, AnyStr, Optional, Sequence, Tuple, TypeVar, overload -_T = TypeVar('_T') +_T = TypeVar("_T") if sys.version_info >= (3, 6): from builtins import _PathLike - _PathType = Union[bytes, Text, _PathLike] - _StrPath = Union[Text, _PathLike[Text]] - _BytesPath = Union[bytes, _PathLike[bytes]] -else: - _PathType = Union[bytes, Text] - _StrPath = Text - _BytesPath = bytes # ----- os.path variables ----- supports_unicode_filenames: bool @@ -24,7 +15,7 @@ supports_unicode_filenames: bool curdir: str pardir: str sep: str -if sys.platform == 'win32': +if sys.platform == "win32": altsep: str else: altsep: Optional[str] @@ -41,13 +32,13 @@ if sys.version_info >= (3, 6): @overload def abspath(path: AnyStr) -> AnyStr: ... @overload - def basename(path: _PathLike[AnyStr]) -> AnyStr: ... + def basename(p: _PathLike[AnyStr]) -> AnyStr: ... @overload - def basename(path: AnyStr) -> AnyStr: ... + def basename(p: AnyStr) -> AnyStr: ... @overload - def dirname(path: _PathLike[AnyStr]) -> AnyStr: ... + def dirname(p: _PathLike[AnyStr]) -> AnyStr: ... @overload - def dirname(path: AnyStr) -> AnyStr: ... + def dirname(p: AnyStr) -> AnyStr: ... @overload def expanduser(path: _PathLike[AnyStr]) -> AnyStr: ... @overload @@ -57,14 +48,14 @@ if sys.version_info >= (3, 6): @overload def expandvars(path: AnyStr) -> AnyStr: ... @overload - def normcase(path: _PathLike[AnyStr]) -> AnyStr: ... + def normcase(s: _PathLike[AnyStr]) -> AnyStr: ... @overload - def normcase(path: AnyStr) -> AnyStr: ... + def normcase(s: AnyStr) -> AnyStr: ... @overload def normpath(path: _PathLike[AnyStr]) -> AnyStr: ... @overload def normpath(path: AnyStr) -> AnyStr: ... - if sys.platform == 'win32': + if sys.platform == "win32": @overload def realpath(path: _PathLike[AnyStr]) -> AnyStr: ... @overload @@ -77,101 +68,77 @@ if sys.version_info >= (3, 6): else: def abspath(path: AnyStr) -> AnyStr: ... - def basename(path: AnyStr) -> AnyStr: ... - def dirname(path: AnyStr) -> AnyStr: ... + def basename(p: AnyStr) -> AnyStr: ... + def dirname(p: AnyStr) -> AnyStr: ... def expanduser(path: AnyStr) -> AnyStr: ... def expandvars(path: AnyStr) -> AnyStr: ... - def normcase(path: AnyStr) -> AnyStr: ... + def normcase(s: AnyStr) -> AnyStr: ... def normpath(path: AnyStr) -> AnyStr: ... - if sys.platform == 'win32': + if sys.platform == "win32": def realpath(path: AnyStr) -> AnyStr: ... else: def realpath(filename: AnyStr) -> AnyStr: ... if sys.version_info >= (3, 6): - # In reality it returns str for sequences of _StrPath and bytes for sequences - # of _BytesPath, but mypy does not accept such a signature. - def commonpath(paths: Sequence[_PathType]) -> Any: ... + # In reality it returns str for sequences of StrPath and bytes for sequences + # of BytesPath, but mypy does not accept such a signature. + def commonpath(paths: Sequence[AnyPath]) -> Any: ... + elif sys.version_info >= (3, 5): def commonpath(paths: Sequence[AnyStr]) -> AnyStr: ... # NOTE: Empty lists results in '' (str) regardless of contained type. -# Also, in Python 2 mixed sequences of Text and bytes results in either Text or bytes # So, fall back to Any -def commonprefix(list: Sequence[_PathType]) -> Any: ... - -if sys.version_info >= (3, 3): - def exists(path: Union[_PathType, int]) -> bool: ... -else: - def exists(path: _PathType) -> bool: ... -def lexists(path: _PathType) -> bool: ... +def commonprefix(m: Sequence[AnyPath]) -> Any: ... +def lexists(path: AnyPath) -> bool: ... # These return float if os.stat_float_times() == True, # but int is a subclass of float. -def getatime(path: _PathType) -> float: ... -def getmtime(path: _PathType) -> float: ... -def getctime(path: _PathType) -> float: ... - -def getsize(path: _PathType) -> int: ... -def isabs(path: _PathType) -> bool: ... -def isfile(path: _PathType) -> bool: ... -def isdir(path: _PathType) -> bool: ... -def islink(path: _PathType) -> bool: ... -def ismount(path: _PathType) -> bool: ... +def getatime(filename: AnyPath) -> float: ... +def getmtime(filename: AnyPath) -> float: ... +def getctime(filename: AnyPath) -> float: ... +def getsize(filename: AnyPath) -> int: ... +def isabs(s: AnyPath) -> bool: ... +def isfile(path: AnyPath) -> bool: ... +def isdir(s: AnyPath) -> bool: ... +def islink(path: AnyPath) -> bool: ... +def ismount(path: AnyPath) -> bool: ... -if sys.version_info < (3, 0): - # Make sure signatures are disjunct, and allow combinations of bytes and unicode. - # (Since Python 2 allows that, too) - # Note that e.g. os.path.join("a", "b", "c", "d", u"e") will still result in - # a type error. - @overload - def join(__p1: bytes, *p: bytes) -> bytes: ... - @overload - def join(__p1: bytes, __p2: bytes, __p3: bytes, __p4: Text, *p: _PathType) -> Text: ... - @overload - def join(__p1: bytes, __p2: bytes, __p3: Text, *p: _PathType) -> Text: ... - @overload - def join(__p1: bytes, __p2: Text, *p: _PathType) -> Text: ... - @overload - def join(__p1: Text, *p: _PathType) -> Text: ... -elif sys.version_info >= (3, 6): - # Mypy complains that the signatures overlap (same for relpath below), but things seem to behave correctly anyway. +if sys.version_info >= (3, 6): @overload - def join(path: _StrPath, *paths: _StrPath) -> Text: ... + def join(a: StrPath, *paths: StrPath) -> str: ... @overload - def join(path: _BytesPath, *paths: _BytesPath) -> bytes: ... + def join(a: BytesPath, *paths: BytesPath) -> bytes: ... + else: - def join(path: AnyStr, *paths: AnyStr) -> AnyStr: ... + def join(a: AnyStr, *paths: AnyStr) -> AnyStr: ... @overload -def relpath(path: _BytesPath, start: Optional[_BytesPath] = ...) -> bytes: ... +def relpath(path: BytesPath, start: Optional[BytesPath] = ...) -> bytes: ... @overload -def relpath(path: _StrPath, start: Optional[_StrPath] = ...) -> Text: ... - -def samefile(path1: _PathType, path2: _PathType) -> bool: ... +def relpath(path: StrPath, start: Optional[StrPath] = ...) -> str: ... +def samefile(f1: AnyPath, f2: AnyPath) -> bool: ... def sameopenfile(fp1: int, fp2: int) -> bool: ... -def samestat(stat1: os.stat_result, stat2: os.stat_result) -> bool: ... +def samestat(s1: os.stat_result, s2: os.stat_result) -> bool: ... if sys.version_info >= (3, 6): @overload - def split(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... + def split(p: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... @overload - def split(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + def split(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ... @overload - def splitdrive(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... + def splitdrive(p: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... @overload - def splitdrive(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + def splitdrive(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ... @overload - def splitext(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... + def splitext(p: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... @overload - def splitext(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... -else: - def split(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... - def splitdrive(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... - def splitext(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + def splitext(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ... -if sys.platform == 'win32': - def splitunc(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... # deprecated +else: + def split(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + def splitdrive(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + def splitext(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ... -if sys.version_info < (3,): - def walk(path: AnyStr, visit: Callable[[_T, AnyStr, List[AnyStr]], Any], arg: _T) -> None: ... +if sys.version_info < (3, 7) and sys.platform == "win32": + def splitunc(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ... # deprecated diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/pathlib.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/pathlib.pyi old mode 100755 new mode 100644 index fb925e60..7882f900 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/pathlib.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/pathlib.pyi @@ -1,14 +1,22 @@ -from typing import Any, Generator, IO, Optional, Sequence, Tuple, Type, TypeVar, Union, List -from types import TracebackType import os import sys +from _typeshed import OpenBinaryMode, OpenBinaryModeReading, OpenBinaryModeUpdating, OpenBinaryModeWriting, OpenTextMode +from io import BufferedRandom, BufferedReader, BufferedWriter, FileIO, TextIOWrapper +from types import TracebackType +from typing import IO, Any, BinaryIO, Generator, List, Optional, Sequence, Tuple, Type, TypeVar, Union, overload +from typing_extensions import Literal -_P = TypeVar('_P', bound=PurePath) +if sys.version_info >= (3, 9): + from types import GenericAlias + +_P = TypeVar("_P", bound=PurePath) if sys.version_info >= (3, 6): _PurePathBase = os.PathLike[str] + _PathLike = os.PathLike[str] else: _PurePathBase = object + _PathLike = PurePath class PurePath(_PurePathBase): parts: Tuple[str, ...] @@ -19,117 +27,152 @@ class PurePath(_PurePathBase): suffix: str suffixes: List[str] stem: str - if sys.version_info < (3, 5): - def __init__(self, *pathsegments: str) -> None: ... - elif sys.version_info < (3, 6): - def __new__(cls: Type[_P], *args: Union[str, PurePath]) -> _P: ... - else: - def __new__(cls: Type[_P], *args: Union[str, os.PathLike[str]]) -> _P: ... + def __new__(cls: Type[_P], *args: Union[str, _PathLike]) -> _P: ... def __hash__(self) -> int: ... def __lt__(self, other: PurePath) -> bool: ... def __le__(self, other: PurePath) -> bool: ... def __gt__(self, other: PurePath) -> bool: ... def __ge__(self, other: PurePath) -> bool: ... - if sys.version_info < (3, 6): - def __truediv__(self: _P, key: Union[str, PurePath]) -> _P: ... - def __rtruediv__(self: _P, key: Union[str, PurePath]) -> _P: ... - else: - def __truediv__(self: _P, key: Union[str, os.PathLike[str]]) -> _P: ... - def __rtruediv__(self: _P, key: Union[str, os.PathLike[str]]) -> _P: ... - if sys.version_info < (3,): - def __div__(self: _P, key: Union[str, PurePath]) -> _P: ... + def __truediv__(self: _P, key: Union[str, _PathLike]) -> _P: ... + def __rtruediv__(self: _P, key: Union[str, _PathLike]) -> _P: ... def __bytes__(self) -> bytes: ... def as_posix(self) -> str: ... def as_uri(self) -> str: ... def is_absolute(self) -> bool: ... def is_reserved(self) -> bool: ... + if sys.version_info >= (3, 9): + def is_relative_to(self, *other: Union[str, os.PathLike[str]]) -> bool: ... def match(self, path_pattern: str) -> bool: ... - if sys.version_info < (3, 6): - def relative_to(self: _P, *other: Union[str, PurePath]) -> _P: ... - else: - def relative_to(self: _P, *other: Union[str, os.PathLike[str]]) -> _P: ... + def relative_to(self: _P, *other: Union[str, _PathLike]) -> _P: ... def with_name(self: _P, name: str) -> _P: ... + if sys.version_info >= (3, 9): + def with_stem(self: _P, stem: str) -> _P: ... def with_suffix(self: _P, suffix: str) -> _P: ... - if sys.version_info < (3, 6): - def joinpath(self: _P, *other: Union[str, PurePath]) -> _P: ... - else: - def joinpath(self: _P, *other: Union[str, os.PathLike[str]]) -> _P: ... - + def joinpath(self: _P, *other: Union[str, _PathLike]) -> _P: ... @property def parents(self: _P) -> Sequence[_P]: ... @property def parent(self: _P) -> _P: ... + if sys.version_info >= (3, 9): + def __class_getitem__(cls, type: Any) -> GenericAlias: ... class PurePosixPath(PurePath): ... class PureWindowsPath(PurePath): ... class Path(PurePath): - def __enter__(self) -> Path: ... - def __exit__(self, exc_type: Optional[Type[BaseException]], - exc_value: Optional[BaseException], - traceback: Optional[TracebackType]) -> Optional[bool]: ... + def __new__(cls: Type[_P], *args: Union[str, _PathLike], **kwargs: Any) -> _P: ... + def __enter__(self: _P) -> _P: ... + def __exit__( + self, exc_type: Optional[Type[BaseException]], exc_value: Optional[BaseException], traceback: Optional[TracebackType] + ) -> Optional[bool]: ... @classmethod def cwd(cls: Type[_P]) -> _P: ... def stat(self) -> os.stat_result: ... def chmod(self, mode: int) -> None: ... def exists(self) -> bool: ... - def glob(self, pattern: str) -> Generator[Path, None, None]: ... + def glob(self: _P, pattern: str) -> Generator[_P, None, None]: ... def group(self) -> str: ... def is_dir(self) -> bool: ... def is_file(self) -> bool: ... + if sys.version_info >= (3, 7): + def is_mount(self) -> bool: ... def is_symlink(self) -> bool: ... def is_socket(self) -> bool: ... def is_fifo(self) -> bool: ... def is_block_device(self) -> bool: ... def is_char_device(self) -> bool: ... - def iterdir(self) -> Generator[Path, None, None]: ... + def iterdir(self: _P) -> Generator[_P, None, None]: ... def lchmod(self, mode: int) -> None: ... def lstat(self) -> os.stat_result: ... - if sys.version_info < (3, 5): - def mkdir(self, mode: int = ..., - parents: bool = ...) -> None: ... - else: - def mkdir(self, mode: int = ..., parents: bool = ..., - exist_ok: bool = ...) -> None: ... - def open(self, mode: str = ..., buffering: int = ..., - encoding: Optional[str] = ..., errors: Optional[str] = ..., - newline: Optional[str] = ...) -> IO[Any]: ... + def mkdir(self, mode: int = ..., parents: bool = ..., exist_ok: bool = ...) -> None: ... + # Adapted from builtins.open + # Text mode: always returns a TextIOWrapper + @overload + def open( + self, + mode: OpenTextMode = ..., + buffering: int = ..., + encoding: Optional[str] = ..., + errors: Optional[str] = ..., + newline: Optional[str] = ..., + ) -> TextIOWrapper: ... + # Unbuffered binary mode: returns a FileIO + @overload + def open( + self, mode: OpenBinaryMode, buffering: Literal[0], encoding: None = ..., errors: None = ..., newline: None = ... + ) -> FileIO: ... + # Buffering is on: return BufferedRandom, BufferedReader, or BufferedWriter + @overload + def open( + self, + mode: OpenBinaryModeUpdating, + buffering: Literal[-1, 1] = ..., + encoding: None = ..., + errors: None = ..., + newline: None = ..., + ) -> BufferedRandom: ... + @overload + def open( + self, + mode: OpenBinaryModeWriting, + buffering: Literal[-1, 1] = ..., + encoding: None = ..., + errors: None = ..., + newline: None = ..., + ) -> BufferedWriter: ... + @overload + def open( + self, + mode: OpenBinaryModeReading, + buffering: Literal[-1, 1] = ..., + encoding: None = ..., + errors: None = ..., + newline: None = ..., + ) -> BufferedReader: ... + # Buffering cannot be determined: fall back to BinaryIO + @overload + def open( + self, mode: OpenBinaryMode, buffering: int, encoding: None = ..., errors: None = ..., newline: None = ... + ) -> BinaryIO: ... + # Fallback if mode is not specified + @overload + def open( + self, + mode: str, + buffering: int = ..., + encoding: Optional[str] = ..., + errors: Optional[str] = ..., + newline: Optional[str] = ..., + ) -> IO[Any]: ... def owner(self) -> str: ... - def rename(self, target: Union[str, PurePath]) -> None: ... - def replace(self, target: Union[str, PurePath]) -> None: ... - if sys.version_info < (3, 6): - def resolve(self: _P) -> _P: ... + if sys.version_info >= (3, 9): + def readlink(self: _P) -> _P: ... + if sys.version_info >= (3, 8): + def rename(self: _P, target: Union[str, PurePath]) -> _P: ... + def replace(self: _P, target: Union[str, PurePath]) -> _P: ... else: - def resolve(self: _P, strict: bool = ...) -> _P: ... - def rglob(self, pattern: str) -> Generator[Path, None, None]: ... + def rename(self, target: Union[str, PurePath]) -> None: ... + def replace(self, target: Union[str, PurePath]) -> None: ... + def resolve(self: _P, strict: bool = ...) -> _P: ... + def rglob(self: _P, pattern: str) -> Generator[_P, None, None]: ... def rmdir(self) -> None: ... - def symlink_to(self, target: Union[str, Path], - target_is_directory: bool = ...) -> None: ... + def symlink_to(self, target: Union[str, Path], target_is_directory: bool = ...) -> None: ... def touch(self, mode: int = ..., exist_ok: bool = ...) -> None: ... - def unlink(self) -> None: ... - - if sys.version_info >= (3, 5): - @classmethod - def home(cls: Type[_P]) -> _P: ... - if sys.version_info < (3, 6): - def __new__(cls: Type[_P], *args: Union[str, PurePath], - **kwargs: Any) -> _P: ... - else: - def __new__(cls: Type[_P], *args: Union[str, os.PathLike[str]], - **kwargs: Any) -> _P: ... - - def absolute(self: _P) -> _P: ... - def expanduser(self: _P) -> _P: ... - def read_bytes(self) -> bytes: ... - def read_text(self, encoding: Optional[str] = ..., - errors: Optional[str] = ...) -> str: ... - def samefile(self, other_path: Union[str, bytes, int, Path]) -> bool: ... - def write_bytes(self, data: bytes) -> int: ... - def write_text(self, data: str, encoding: Optional[str] = ..., - errors: Optional[str] = ...) -> int: ... + if sys.version_info >= (3, 8): + def unlink(self, missing_ok: bool = ...) -> None: ... + else: + def unlink(self) -> None: ... + @classmethod + def home(cls: Type[_P]) -> _P: ... + def absolute(self: _P) -> _P: ... + def expanduser(self: _P) -> _P: ... + def read_bytes(self) -> bytes: ... + def read_text(self, encoding: Optional[str] = ..., errors: Optional[str] = ...) -> str: ... + def samefile(self, other_path: Union[str, bytes, int, Path]) -> bool: ... + def write_bytes(self, data: bytes) -> int: ... + def write_text(self, data: str, encoding: Optional[str] = ..., errors: Optional[str] = ...) -> int: ... if sys.version_info >= (3, 8): def link_to(self, target: Union[str, bytes, os.PathLike[str]]) -> None: ... - class PosixPath(Path, PurePosixPath): ... class WindowsPath(Path, PureWindowsPath): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/pipes.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/pipes.pyi old mode 100755 new mode 100644 index 658373e4..2c2fd400 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/pipes.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/pipes.pyi @@ -1,7 +1,3 @@ -# Stubs for pipes - -# Based on http://docs.python.org/3.5/library/pipes.html - import os class Template: diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/platform.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/platform.pyi old mode 100755 new mode 100644 index 858bb593..73579dff --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/platform.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/platform.pyi @@ -1,14 +1,43 @@ -# Stubs for platform (Python 3.5) +import sys -from os import devnull as DEV_NULL -from typing import Tuple, NamedTuple +if sys.version_info < (3, 9): + import os + + DEV_NULL = os.devnull +from typing import NamedTuple, Optional, Tuple + +if sys.version_info >= (3, 8): + def libc_ver( + executable: Optional[str] = ..., lib: str = ..., version: str = ..., chunksize: int = ... + ) -> Tuple[str, str]: ... + +else: + def libc_ver(executable: str = ..., lib: str = ..., version: str = ..., chunksize: int = ...) -> Tuple[str, str]: ... + +if sys.version_info < (3, 8): + def linux_distribution( + distname: str = ..., + version: str = ..., + id: str = ..., + supported_dists: Tuple[str, ...] = ..., + full_distribution_name: bool = ..., + ) -> Tuple[str, str, str]: ... + def dist( + distname: str = ..., version: str = ..., id: str = ..., supported_dists: Tuple[str, ...] = ... + ) -> Tuple[str, str, str]: ... -def libc_ver(executable: str = ..., lib: str = ..., version: str = ..., chunksize: int = ...) -> Tuple[str, str]: ... -def linux_distribution(distname: str = ..., version: str = ..., id: str = ..., supported_dists: Tuple[str, ...] = ..., full_distribution_name: bool = ...) -> Tuple[str, str, str]: ... -def dist(distname: str = ..., version: str = ..., id: str = ..., supported_dists: Tuple[str, ...] = ...) -> Tuple[str, str, str]: ... def win32_ver(release: str = ..., version: str = ..., csd: str = ..., ptype: str = ...) -> Tuple[str, str, str, str]: ... -def mac_ver(release: str = ..., versioninfo: Tuple[str, str, str] = ..., machine: str = ...) -> Tuple[str, Tuple[str, str, str], str]: ... -def java_ver(release: str = ..., vendor: str = ..., vminfo: Tuple[str, str, str] = ..., osinfo: Tuple[str, str, str] = ...) -> Tuple[str, str, Tuple[str, str, str], Tuple[str, str, str]]: ... + +if sys.version_info >= (3, 8): + def win32_edition() -> str: ... + def win32_is_iot() -> bool: ... + +def mac_ver( + release: str = ..., versioninfo: Tuple[str, str, str] = ..., machine: str = ... +) -> Tuple[str, Tuple[str, str, str], str]: ... +def java_ver( + release: str = ..., vendor: str = ..., vminfo: Tuple[str, str, str] = ..., osinfo: Tuple[str, str, str] = ... +) -> Tuple[str, str, Tuple[str, str, str], Tuple[str, str, str]]: ... def system_alias(system: str, release: str, version: str) -> Tuple[str, str, str]: ... def architecture(executable: str = ..., bits: str = ..., linkage: str = ...) -> Tuple[str, str]: ... @@ -27,7 +56,6 @@ def release() -> str: ... def version() -> str: ... def machine() -> str: ... def processor() -> str: ... - def python_implementation() -> str: ... def python_version() -> str: ... def python_version_tuple() -> Tuple[str, str, str]: ... @@ -35,5 +63,4 @@ def python_branch() -> str: ... def python_revision() -> str: ... def python_build() -> Tuple[str, str]: ... def python_compiler() -> str: ... - def platform(aliased: bool = ..., terse: bool = ...) -> str: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/posix.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/posix.pyi old mode 100755 new mode 100644 index c6092ead..9080d5b9 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/posix.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/posix.pyi @@ -1,14 +1,7 @@ -# Stubs for posix - -# NOTE: These are incomplete! - import sys -from typing import List, NamedTuple, Optional, overload - +from builtins import _PathLike # See comment in builtins from os import stat_result as stat_result - -if sys.version_info >= (3, 6): - from builtins import _PathLike # See comment in builtins +from typing import Dict, List, NamedTuple, Optional, overload class uname_result(NamedTuple): sysname: str @@ -34,6 +27,11 @@ class waitid_result(NamedTuple): class sched_param(NamedTuple): sched_priority: int +CLD_CONTINUED: int +CLD_DUMPED: int +CLD_EXITED: int +CLD_TRAPPED: int + EX_CANTCREAT: int EX_CONFIG: int EX_DATAERR: int @@ -57,9 +55,13 @@ R_OK: int W_OK: int X_OK: int -if sys.version_info >= (3, 6): - GRND_NONBLOCK: int - GRND_RANDOM: int +F_LOCK: int +F_TEST: int +F_TLOCK: int +F_ULOCK: int + +GRND_NONBLOCK: int +GRND_RANDOM: int NGROUPS_MAX: int O_APPEND: int @@ -83,6 +85,39 @@ O_SYNC: int O_TRUNC: int O_WRONLY: int +POSIX_FADV_DONTNEED: int +POSIX_FADV_NOREUSE: int +POSIX_FADV_NORMAL: int +POSIX_FADV_RANDOM: int +POSIX_FADV_SEQUENTIAL: int +POSIX_FADV_WILLNEED: int + +PRIO_PGRP: int +PRIO_PROCESS: int +PRIO_USER: int + +P_ALL: int +P_PGID: int +P_PID: int + +RTLD_DEEPBIND: int +RTLD_GLOBAL: int +RTLD_LAZY: int +RTLD_LOCAL: int +RTLD_NODELETE: int +RTLD_NOLOAD: int +RTLD_NOW: int + +SCHED_BATCH: int +SCHED_FIFO: int +SCHED_IDLE: int +SCHED_OTHER: int +SCHED_RESET_ON_FORK: int +SCHED_RR: int + +SEEK_DATA: int +SEEK_HOLE: int + ST_APPEND: int ST_MANDLOCK: int ST_NOATIME: int @@ -97,30 +132,34 @@ ST_WRITE: int TMP_MAX: int WCONTINUED: int -WCOREDUMP: int -WEXITSTATUS: int -WIFCONTINUED: int -WIFEXITED: int -WIFSIGNALED: int -WIFSTOPPED: int + +def WCOREDUMP(__status: int) -> bool: ... +def WEXITSTATUS(status: int) -> int: ... +def WIFCONTINUED(status: int) -> bool: ... +def WIFEXITED(status: int) -> bool: ... +def WIFSIGNALED(status: int) -> bool: ... +def WIFSTOPPED(status: int) -> bool: ... + WNOHANG: int -WSTOPSIG: int -WTERMSIG: int + +def WSTOPSIG(status: int) -> int: ... +def WTERMSIG(status: int) -> int: ... + WUNTRACED: int -if sys.version_info >= (3, 6): - @overload - def listdir(path: Optional[str] = ...) -> List[str]: ... - @overload - def listdir(path: bytes) -> List[bytes]: ... - @overload - def listdir(path: int) -> List[str]: ... - @overload - def listdir(path: _PathLike[str]) -> List[str]: ... +XATTR_CREATE: int +XATTR_REPLACE: int +XATTR_SIZE_MAX: int +@overload +def listdir(path: Optional[str] = ...) -> List[str]: ... +@overload +def listdir(path: bytes) -> List[bytes]: ... +@overload +def listdir(path: int) -> List[str]: ... +@overload +def listdir(path: _PathLike[str]) -> List[str]: ... + +if sys.platform == "win32": + environ: Dict[str, str] else: - @overload - def listdir(path: Optional[str] = ...) -> List[str]: ... - @overload - def listdir(path: bytes) -> List[bytes]: ... - @overload - def listdir(path: int) -> List[str]: ... + environ: Dict[bytes, bytes] diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/posixpath.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/posixpath.pyi new file mode 100644 index 00000000..7dac80e5 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/posixpath.pyi @@ -0,0 +1,144 @@ +import os +import sys +from _typeshed import AnyPath, BytesPath, StrPath +from genericpath import exists as exists +from typing import Any, AnyStr, Optional, Sequence, Tuple, TypeVar, overload + +_T = TypeVar("_T") + +if sys.version_info >= (3, 6): + from builtins import _PathLike + +# ----- os.path variables ----- +supports_unicode_filenames: bool +# aliases (also in os) +curdir: str +pardir: str +sep: str +if sys.platform == "win32": + altsep: str +else: + altsep: Optional[str] +extsep: str +pathsep: str +defpath: str +devnull: str + +# ----- os.path function stubs ----- +if sys.version_info >= (3, 6): + # Overloads are necessary to work around python/mypy#3644. + @overload + def abspath(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def abspath(path: AnyStr) -> AnyStr: ... + @overload + def basename(p: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def basename(p: AnyStr) -> AnyStr: ... + @overload + def dirname(p: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def dirname(p: AnyStr) -> AnyStr: ... + @overload + def expanduser(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def expanduser(path: AnyStr) -> AnyStr: ... + @overload + def expandvars(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def expandvars(path: AnyStr) -> AnyStr: ... + @overload + def normcase(s: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def normcase(s: AnyStr) -> AnyStr: ... + @overload + def normpath(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def normpath(path: AnyStr) -> AnyStr: ... + if sys.platform == "win32": + @overload + def realpath(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def realpath(path: AnyStr) -> AnyStr: ... + else: + @overload + def realpath(filename: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def realpath(filename: AnyStr) -> AnyStr: ... + +else: + def abspath(path: AnyStr) -> AnyStr: ... + def basename(p: AnyStr) -> AnyStr: ... + def dirname(p: AnyStr) -> AnyStr: ... + def expanduser(path: AnyStr) -> AnyStr: ... + def expandvars(path: AnyStr) -> AnyStr: ... + def normcase(s: AnyStr) -> AnyStr: ... + def normpath(path: AnyStr) -> AnyStr: ... + if sys.platform == "win32": + def realpath(path: AnyStr) -> AnyStr: ... + else: + def realpath(filename: AnyStr) -> AnyStr: ... + +if sys.version_info >= (3, 6): + # In reality it returns str for sequences of StrPath and bytes for sequences + # of BytesPath, but mypy does not accept such a signature. + def commonpath(paths: Sequence[AnyPath]) -> Any: ... + +elif sys.version_info >= (3, 5): + def commonpath(paths: Sequence[AnyStr]) -> AnyStr: ... + +# NOTE: Empty lists results in '' (str) regardless of contained type. +# So, fall back to Any +def commonprefix(m: Sequence[AnyPath]) -> Any: ... +def lexists(path: AnyPath) -> bool: ... + +# These return float if os.stat_float_times() == True, +# but int is a subclass of float. +def getatime(filename: AnyPath) -> float: ... +def getmtime(filename: AnyPath) -> float: ... +def getctime(filename: AnyPath) -> float: ... +def getsize(filename: AnyPath) -> int: ... +def isabs(s: AnyPath) -> bool: ... +def isfile(path: AnyPath) -> bool: ... +def isdir(s: AnyPath) -> bool: ... +def islink(path: AnyPath) -> bool: ... +def ismount(path: AnyPath) -> bool: ... + +if sys.version_info >= (3, 6): + @overload + def join(a: StrPath, *paths: StrPath) -> str: ... + @overload + def join(a: BytesPath, *paths: BytesPath) -> bytes: ... + +else: + def join(a: AnyStr, *paths: AnyStr) -> AnyStr: ... + +@overload +def relpath(path: BytesPath, start: Optional[BytesPath] = ...) -> bytes: ... +@overload +def relpath(path: StrPath, start: Optional[StrPath] = ...) -> str: ... +def samefile(f1: AnyPath, f2: AnyPath) -> bool: ... +def sameopenfile(fp1: int, fp2: int) -> bool: ... +def samestat(s1: os.stat_result, s2: os.stat_result) -> bool: ... + +if sys.version_info >= (3, 6): + @overload + def split(p: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... + @overload + def split(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitdrive(p: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitdrive(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitext(p: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitext(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + +else: + def split(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + def splitdrive(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + def splitext(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + +if sys.version_info < (3, 7) and sys.platform == "win32": + def splitunc(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ... # deprecated diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/queue.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/queue.pyi old mode 100755 new mode 100644 index 9647faf4..82fde598 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/queue.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/queue.pyi @@ -1,12 +1,11 @@ -# Stubs for queue - -# NOTE: These are incomplete! - -from threading import Condition, Lock -from typing import Any, Deque, TypeVar, Generic, Optional import sys +from threading import Condition, Lock +from typing import Any, Generic, Optional, TypeVar + +if sys.version_info >= (3, 9): + from types import GenericAlias -_T = TypeVar('_T') +_T = TypeVar("_T") class Empty(Exception): ... class Full(Exception): ... @@ -19,8 +18,7 @@ class Queue(Generic[_T]): not_full: Condition # undocumented all_tasks_done: Condition # undocumented unfinished_tasks: int # undocumented - - queue: Deque[Any] # undocumented + queue: Any # undocumented def __init__(self, maxsize: int = ...) -> None: ... def _init(self, maxsize: int) -> None: ... def empty(self) -> bool: ... @@ -35,6 +33,8 @@ class Queue(Generic[_T]): def qsize(self) -> int: ... def _qsize(self) -> int: ... def task_done(self) -> None: ... + if sys.version_info >= (3, 9): + def __class_getitem__(cls, item: Any) -> GenericAlias: ... class PriorityQueue(Queue[_T]): ... class LifoQueue(Queue[_T]): ... @@ -48,3 +48,5 @@ if sys.version_info >= (3, 7): def put(self, item: _T, block: bool = ..., timeout: Optional[float] = ...) -> None: ... def put_nowait(self, item: _T) -> None: ... def qsize(self) -> int: ... + if sys.version_info >= (3, 9): + def __class_getitem__(cls, item: Any) -> GenericAlias: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/random.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/random.pyi old mode 100755 new mode 100644 index 7fa0698a..9a28024c --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/random.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/random.pyi @@ -1,33 +1,38 @@ -# Stubs for random -# Ron Murawski -# Updated by Jukka Lehtosalo - -# based on http://docs.python.org/3.2/library/random.html - -# ----- random classes ----- - import _random import sys -from typing import Any, TypeVar, Sequence, List, Callable, AbstractSet, Union, Optional, Tuple +from typing import AbstractSet, Any, Callable, Iterable, List, MutableSequence, Optional, Sequence, Tuple, TypeVar, Union -_T = TypeVar('_T') +_T = TypeVar("_T") class Random(_random.Random): def __init__(self, x: Any = ...) -> None: ... def seed(self, a: Any = ..., version: int = ...) -> None: ... def getstate(self) -> Tuple[Any, ...]: ... def setstate(self, state: Tuple[Any, ...]) -> None: ... - def getrandbits(self, k: int) -> int: ... - def randrange(self, start: int, stop: Union[int, None] = ..., step: int = ...) -> int: ... + def getrandbits(self, __k: int) -> int: ... + def randrange(self, start: int, stop: Optional[int] = ..., step: int = ...) -> int: ... def randint(self, a: int, b: int) -> int: ... + if sys.version_info >= (3, 9): + def randbytes(self, n: int) -> bytes: ... def choice(self, seq: Sequence[_T]) -> _T: ... - if sys.version_info >= (3, 6): - def choices(self, population: Sequence[_T], weights: Optional[Sequence[float]] = ..., *, cum_weights: Optional[Sequence[float]] = ..., k: int = ...) -> List[_T]: ... - def shuffle(self, x: List[Any], random: Union[Callable[[], float], None] = ...) -> None: ... - def sample(self, population: Union[Sequence[_T], AbstractSet[_T]], k: int) -> List[_T]: ... + def choices( + self, + population: Sequence[_T], + weights: Optional[Sequence[float]] = ..., + *, + cum_weights: Optional[Sequence[float]] = ..., + k: int = ..., + ) -> List[_T]: ... + def shuffle(self, x: MutableSequence[Any], random: Optional[Callable[[], float]] = ...) -> None: ... + if sys.version_info >= (3, 9): + def sample( + self, population: Union[Sequence[_T], AbstractSet[_T]], k: int, *, counts: Optional[Iterable[_T]] = ... + ) -> List[_T]: ... + else: + def sample(self, population: Union[Sequence[_T], AbstractSet[_T]], k: int) -> List[_T]: ... def random(self) -> float: ... def uniform(self, a: float, b: float) -> float: ... - def triangular(self, low: float = ..., high: float = ..., mode: float = ...) -> float: ... + def triangular(self, low: float = ..., high: float = ..., mode: Optional[float] = ...) -> float: ... def betavariate(self, alpha: float, beta: float) -> float: ... def expovariate(self, lambd: float) -> float: ... def gammavariate(self, alpha: float, beta: float) -> float: ... @@ -39,25 +44,38 @@ class Random(_random.Random): def weibullvariate(self, alpha: float, beta: float) -> float: ... # SystemRandom is not implemented for all OS's; good on Windows & Linux -class SystemRandom(Random): - ... +class SystemRandom(Random): ... # ----- random function stubs ----- def seed(a: Any = ..., version: int = ...) -> None: ... def getstate() -> object: ... def setstate(state: object) -> None: ... -def getrandbits(k: int) -> int: ... +def getrandbits(__k: int) -> int: ... def randrange(start: int, stop: Union[None, int] = ..., step: int = ...) -> int: ... def randint(a: int, b: int) -> int: ... + +if sys.version_info >= (3, 9): + def randbytes(n: int) -> bytes: ... + def choice(seq: Sequence[_T]) -> _T: ... -if sys.version_info >= (3, 6): - def choices(population: Sequence[_T], weights: Optional[Sequence[float]] = ..., *, cum_weights: Optional[Sequence[float]] = ..., k: int = ...) -> List[_T]: ... -def shuffle(x: List[Any], random: Union[Callable[[], float], None] = ...) -> None: ... -def sample(population: Union[Sequence[_T], AbstractSet[_T]], k: int) -> List[_T]: ... +def choices( + population: Sequence[_T], + weights: Optional[Sequence[float]] = ..., + *, + cum_weights: Optional[Sequence[float]] = ..., + k: int = ..., +) -> List[_T]: ... +def shuffle(x: MutableSequence[Any], random: Optional[Callable[[], float]] = ...) -> None: ... + +if sys.version_info >= (3, 9): + def sample(population: Union[Sequence[_T], AbstractSet[_T]], k: int, *, counts: Optional[Iterable[_T]] = ...) -> List[_T]: ... + +else: + def sample(population: Union[Sequence[_T], AbstractSet[_T]], k: int) -> List[_T]: ... + def random() -> float: ... def uniform(a: float, b: float) -> float: ... -def triangular(low: float = ..., high: float = ..., - mode: float = ...) -> float: ... +def triangular(low: float = ..., high: float = ..., mode: Optional[float] = ...) -> float: ... def betavariate(alpha: float, beta: float) -> float: ... def expovariate(lambd: float) -> float: ... def gammavariate(alpha: float, beta: float) -> float: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/re.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/re.pyi old mode 100755 new mode 100644 index 259f787c..26417444 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/re.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/re.pyi @@ -1,62 +1,14 @@ -# Stubs for re -# Ron Murawski -# 'bytes' support added by Jukka Lehtosalo - -# based on: http://docs.python.org/3.2/library/re.html -# and http://hg.python.org/cpython/file/618ea5612e83/Lib/re.py - +import enum import sys -from typing import ( - List, Iterator, overload, Callable, Tuple, - AnyStr, Any, Optional, Union -) +from typing import Any, AnyStr, Callable, Iterator, List, Optional, Tuple, Union, overload # ----- re variables and constants ----- if sys.version_info >= (3, 7): - from typing import Pattern as Pattern, Match as Match + from typing import Match as Match, Pattern as Pattern else: - from typing import Pattern, Match + from typing import Match, Pattern -if sys.version_info >= (3, 6): - import enum - class RegexFlag(enum.IntFlag): - A: int - ASCII: int - DEBUG: int - I: int - IGNORECASE: int - L: int - LOCALE: int - M: int - MULTILINE: int - S: int - DOTALL: int - X: int - VERBOSE: int - U: int - UNICODE: int - T: int - TEMPLATE: int - - A = RegexFlag.A - ASCII = RegexFlag.ASCII - DEBUG = RegexFlag.DEBUG - I = RegexFlag.I - IGNORECASE = RegexFlag.IGNORECASE - L = RegexFlag.L - LOCALE = RegexFlag.LOCALE - M = RegexFlag.M - MULTILINE = RegexFlag.MULTILINE - S = RegexFlag.S - DOTALL = RegexFlag.DOTALL - X = RegexFlag.X - VERBOSE = RegexFlag.VERBOSE - U = RegexFlag.U - UNICODE = RegexFlag.UNICODE - T = RegexFlag.T - TEMPLATE = RegexFlag.TEMPLATE - _FlagsType = Union[int, RegexFlag] -else: +class RegexFlag(enum.IntFlag): A: int ASCII: int DEBUG: int @@ -74,24 +26,45 @@ else: UNICODE: int T: int TEMPLATE: int - _FlagsType = int + +A = RegexFlag.A +ASCII = RegexFlag.ASCII +DEBUG = RegexFlag.DEBUG +I = RegexFlag.I +IGNORECASE = RegexFlag.IGNORECASE +L = RegexFlag.L +LOCALE = RegexFlag.LOCALE +M = RegexFlag.M +MULTILINE = RegexFlag.MULTILINE +S = RegexFlag.S +DOTALL = RegexFlag.DOTALL +X = RegexFlag.X +VERBOSE = RegexFlag.VERBOSE +U = RegexFlag.U +UNICODE = RegexFlag.UNICODE +T = RegexFlag.T +TEMPLATE = RegexFlag.TEMPLATE +_FlagsType = Union[int, RegexFlag] if sys.version_info < (3, 7): # undocumented _pattern_type: type -class error(Exception): ... +class error(Exception): + msg: str + pattern: str + pos: Optional[int] + lineno: Optional[int] + colno: Optional[int] @overload def compile(pattern: AnyStr, flags: _FlagsType = ...) -> Pattern[AnyStr]: ... @overload def compile(pattern: Pattern[AnyStr], flags: _FlagsType = ...) -> Pattern[AnyStr]: ... - @overload def search(pattern: AnyStr, string: AnyStr, flags: _FlagsType = ...) -> Optional[Match[AnyStr]]: ... @overload def search(pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType = ...) -> Optional[Match[AnyStr]]: ... - @overload def match(pattern: AnyStr, string: AnyStr, flags: _FlagsType = ...) -> Optional[Match[AnyStr]]: ... @overload @@ -102,14 +75,10 @@ def match(pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType = ...) -> def fullmatch(pattern: AnyStr, string: AnyStr, flags: _FlagsType = ...) -> Optional[Match[AnyStr]]: ... @overload def fullmatch(pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType = ...) -> Optional[Match[AnyStr]]: ... - @overload -def split(pattern: AnyStr, string: AnyStr, - maxsplit: int = ..., flags: _FlagsType = ...) -> List[AnyStr]: ... +def split(pattern: AnyStr, string: AnyStr, maxsplit: int = ..., flags: _FlagsType = ...) -> List[AnyStr]: ... @overload -def split(pattern: Pattern[AnyStr], string: AnyStr, - maxsplit: int = ..., flags: _FlagsType = ...) -> List[AnyStr]: ... - +def split(pattern: Pattern[AnyStr], string: AnyStr, maxsplit: int = ..., flags: _FlagsType = ...) -> List[AnyStr]: ... @overload def findall(pattern: AnyStr, string: AnyStr, flags: _FlagsType = ...) -> List[Any]: ... @overload @@ -120,41 +89,35 @@ def findall(pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType = ...) - # matches are returned in the order found. Empty matches are included in the # result unless they touch the beginning of another match. @overload -def finditer(pattern: AnyStr, string: AnyStr, - flags: _FlagsType = ...) -> Iterator[Match[AnyStr]]: ... +def finditer(pattern: AnyStr, string: AnyStr, flags: _FlagsType = ...) -> Iterator[Match[AnyStr]]: ... @overload -def finditer(pattern: Pattern[AnyStr], string: AnyStr, - flags: _FlagsType = ...) -> Iterator[Match[AnyStr]]: ... - +def finditer(pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType = ...) -> Iterator[Match[AnyStr]]: ... @overload -def sub(pattern: AnyStr, repl: AnyStr, string: AnyStr, count: int = ..., - flags: _FlagsType = ...) -> AnyStr: ... +def sub(pattern: AnyStr, repl: AnyStr, string: AnyStr, count: int = ..., flags: _FlagsType = ...) -> AnyStr: ... @overload -def sub(pattern: AnyStr, repl: Callable[[Match[AnyStr]], AnyStr], - string: AnyStr, count: int = ..., flags: _FlagsType = ...) -> AnyStr: ... +def sub( + pattern: AnyStr, repl: Callable[[Match[AnyStr]], AnyStr], string: AnyStr, count: int = ..., flags: _FlagsType = ... +) -> AnyStr: ... @overload -def sub(pattern: Pattern[AnyStr], repl: AnyStr, string: AnyStr, count: int = ..., - flags: _FlagsType = ...) -> AnyStr: ... +def sub(pattern: Pattern[AnyStr], repl: AnyStr, string: AnyStr, count: int = ..., flags: _FlagsType = ...) -> AnyStr: ... @overload -def sub(pattern: Pattern[AnyStr], repl: Callable[[Match[AnyStr]], AnyStr], - string: AnyStr, count: int = ..., flags: _FlagsType = ...) -> AnyStr: ... - +def sub( + pattern: Pattern[AnyStr], repl: Callable[[Match[AnyStr]], AnyStr], string: AnyStr, count: int = ..., flags: _FlagsType = ... +) -> AnyStr: ... @overload -def subn(pattern: AnyStr, repl: AnyStr, string: AnyStr, count: int = ..., - flags: _FlagsType = ...) -> Tuple[AnyStr, int]: ... +def subn(pattern: AnyStr, repl: AnyStr, string: AnyStr, count: int = ..., flags: _FlagsType = ...) -> Tuple[AnyStr, int]: ... @overload -def subn(pattern: AnyStr, repl: Callable[[Match[AnyStr]], AnyStr], - string: AnyStr, count: int = ..., - flags: _FlagsType = ...) -> Tuple[AnyStr, int]: ... +def subn( + pattern: AnyStr, repl: Callable[[Match[AnyStr]], AnyStr], string: AnyStr, count: int = ..., flags: _FlagsType = ... +) -> Tuple[AnyStr, int]: ... @overload -def subn(pattern: Pattern[AnyStr], repl: AnyStr, string: AnyStr, count: int = ..., - flags: _FlagsType = ...) -> Tuple[AnyStr, int]: ... +def subn( + pattern: Pattern[AnyStr], repl: AnyStr, string: AnyStr, count: int = ..., flags: _FlagsType = ... +) -> Tuple[AnyStr, int]: ... @overload -def subn(pattern: Pattern[AnyStr], repl: Callable[[Match[AnyStr]], AnyStr], - string: AnyStr, count: int = ..., - flags: _FlagsType = ...) -> Tuple[AnyStr, int]: ... - -def escape(string: AnyStr) -> AnyStr: ... - +def subn( + pattern: Pattern[AnyStr], repl: Callable[[Match[AnyStr]], AnyStr], string: AnyStr, count: int = ..., flags: _FlagsType = ... +) -> Tuple[AnyStr, int]: ... +def escape(pattern: AnyStr) -> AnyStr: ... def purge() -> None: ... def template(pattern: Union[AnyStr, Pattern[AnyStr]], flags: _FlagsType = ...) -> Pattern[AnyStr]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/reprlib.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/reprlib.pyi old mode 100755 new mode 100644 index 7ff879bc..39828ffc --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/reprlib.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/reprlib.pyi @@ -1,5 +1,3 @@ -# Stubs for reprlib (Python 3) - from array import array from typing import Any, Callable, Deque, Dict, FrozenSet, List, Set, Tuple @@ -34,4 +32,5 @@ class Repr: def repr_instance(self, x: Any, level: int) -> str: ... aRepr: Repr + def repr(x: object) -> str: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/resource.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/resource.pyi old mode 100755 new mode 100644 index b4a6829f..38e28898 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/resource.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/resource.pyi @@ -1,8 +1,5 @@ -# Stubs for resource - -# NOTE: These are incomplete! - -from typing import Tuple, Optional, NamedTuple +import sys +from typing import NamedTuple, Tuple, overload RLIMIT_AS: int RLIMIT_CORE: int @@ -10,20 +7,21 @@ RLIMIT_CPU: int RLIMIT_DATA: int RLIMIT_FSIZE: int RLIMIT_MEMLOCK: int -RLIMIT_MSGQUEUE: int -RLIMIT_NICE: int RLIMIT_NOFILE: int RLIMIT_NPROC: int -RLIMIT_OFILE: int RLIMIT_RSS: int -RLIMIT_RTPRIO: int -RLIMIT_RTTIME: int -RLIMIT_SIGPENDING: int RLIMIT_STACK: int RLIM_INFINITY: int RUSAGE_CHILDREN: int RUSAGE_SELF: int -RUSAGE_THREAD: int +if sys.platform == "linux": + RLIMIT_MSGQUEUE: int + RLIMIT_NICE: int + RLIMIT_OFILE: int + RLIMIT_RTPRIO: int + RLIMIT_RTTIME: int + RLIMIT_SIGPENDING: int + RUSAGE_THREAD: int class _RUsage(NamedTuple): ru_utime: float @@ -44,10 +42,14 @@ class _RUsage(NamedTuple): ru_nivcsw: int def getpagesize() -> int: ... -def getrlimit(resource: int) -> Tuple[int, int]: ... -def getrusage(who: int) -> _RUsage: ... -def prlimit(pid: int, resource: int, limits: Optional[Tuple[int, int]]) -> Tuple[int, int]: ... -def setrlimit(resource: int, limits: Tuple[int, int]) -> None: ... +def getrlimit(__resource: int) -> Tuple[int, int]: ... +def getrusage(__who: int) -> _RUsage: ... +def setrlimit(__resource: int, __limits: Tuple[int, int]) -> None: ... + +if sys.platform == "linux": + @overload + def prlimit(pid: int, resource: int, limits: Tuple[int, int]) -> Tuple[int, int]: ... + @overload + def prlimit(pid: int, resource: int) -> Tuple[int, int]: ... -# NOTE: This is an alias of OSError in Python 3.3. -class error(Exception): ... +error = OSError diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/runpy.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/runpy.pyi old mode 100755 new mode 100644 index 654c53c8..e27849d9 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/runpy.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/runpy.pyi @@ -1,23 +1,22 @@ from types import ModuleType -from typing import Dict, Optional, Any +from typing import Any, Dict, Optional, TypeVar + +_T = TypeVar("_T") class _TempModule: mod_name: str = ... module: ModuleType = ... - def __init__(self, mod_name): ... - def __enter__(self): ... - def __exit__(self, *args): ... + def __init__(self, mod_name: str) -> None: ... + def __enter__(self: _T) -> _T: ... + def __exit__(self, *args: Any) -> None: ... class _ModifiedArgv0: value: Any = ... - def __init__(self, value): ... - def __enter__(self): ... - def __exit__(self, *args): ... + def __init__(self, value: Any) -> None: ... + def __enter__(self: _T) -> _T: ... + def __exit__(self, *args: Any) -> None: ... -def run_module(mod_name: str, - init_globals: Optional[Dict[str, Any]] = ..., - run_name: Optional[str] = ..., - alter_sys: bool = ...): ... -def run_path(path_name: str, - init_globals: Optional[Dict[str, Any]] = ..., - run_name: str = ...): ... +def run_module( + mod_name: str, init_globals: Optional[Dict[str, Any]] = ..., run_name: Optional[str] = ..., alter_sys: bool = ... +) -> None: ... +def run_path(path_name: str, init_globals: Optional[Dict[str, Any]] = ..., run_name: str = ...) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3.6/secrets.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/secrets.pyi old mode 100755 new mode 100644 similarity index 89% rename from anaconda_lib/jedi/third_party/typeshed/stdlib/3.6/secrets.pyi rename to anaconda_lib/jedi/third_party/typeshed/stdlib/3/secrets.pyi index 5069dba2..84b2fea8 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3.6/secrets.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/secrets.pyi @@ -1,10 +1,8 @@ -# Stubs for secrets (Python 3.6) - -from typing import Optional, Sequence, TypeVar from hmac import compare_digest as compare_digest from random import SystemRandom as SystemRandom +from typing import Optional, Sequence, TypeVar -_T = TypeVar('_T') +_T = TypeVar("_T") def randbelow(exclusive_upper_bound: int) -> int: ... def randbits(k: int) -> int: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/selectors.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/selectors.pyi old mode 100755 new mode 100644 index 99e311da..b019c4f9 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/selectors.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/selectors.pyi @@ -1,84 +1,69 @@ -# Stubs for selector -# See https://docs.python.org/3/library/selectors.html - +import sys +from _typeshed import FileDescriptor, FileDescriptorLike from abc import ABCMeta, abstractmethod -from typing import Any, List, Mapping, NamedTuple, Optional, Protocol, Tuple, Union - -class _HasFileno(Protocol): - def fileno(self) -> int: ... +from typing import Any, List, Mapping, NamedTuple, Optional, Tuple -# Type aliases added mainly to preserve some context -_FileObject = Union[int, _HasFileno] -_FileDescriptor = int _EventMask = int EVENT_READ: _EventMask EVENT_WRITE: _EventMask class SelectorKey(NamedTuple): - fileobj: _FileObject - fd: _FileDescriptor + fileobj: FileDescriptorLike + fd: FileDescriptor events: _EventMask data: Any class BaseSelector(metaclass=ABCMeta): @abstractmethod - def register(self, fileobj: _FileObject, events: _EventMask, data: Any = ...) -> SelectorKey: ... - + def register(self, fileobj: FileDescriptorLike, events: _EventMask, data: Any = ...) -> SelectorKey: ... @abstractmethod - def unregister(self, fileobj: _FileObject) -> SelectorKey: ... - - def modify(self, fileobj: _FileObject, events: _EventMask, data: Any = ...) -> SelectorKey: ... - + def unregister(self, fileobj: FileDescriptorLike) -> SelectorKey: ... + def modify(self, fileobj: FileDescriptorLike, events: _EventMask, data: Any = ...) -> SelectorKey: ... @abstractmethod def select(self, timeout: Optional[float] = ...) -> List[Tuple[SelectorKey, _EventMask]]: ... - def close(self) -> None: ... - - def get_key(self, fileobj: _FileObject) -> SelectorKey: ... - + def get_key(self, fileobj: FileDescriptorLike) -> SelectorKey: ... @abstractmethod - def get_map(self) -> Mapping[_FileObject, SelectorKey]: ... - + def get_map(self) -> Mapping[FileDescriptorLike, SelectorKey]: ... def __enter__(self) -> BaseSelector: ... - def __exit__(self, *args: Any) -> None: ... class SelectSelector(BaseSelector): - def register(self, fileobj: _FileObject, events: _EventMask, data: Any = ...) -> SelectorKey: ... - def unregister(self, fileobj: _FileObject) -> SelectorKey: ... - def select(self, timeout: Optional[float] = ...) -> List[Tuple[SelectorKey, _EventMask]]: ... - def get_map(self) -> Mapping[_FileObject, SelectorKey]: ... - -class PollSelector(BaseSelector): - def register(self, fileobj: _FileObject, events: _EventMask, data: Any = ...) -> SelectorKey: ... - def unregister(self, fileobj: _FileObject) -> SelectorKey: ... - def select(self, timeout: Optional[float] = ...) -> List[Tuple[SelectorKey, _EventMask]]: ... - def get_map(self) -> Mapping[_FileObject, SelectorKey]: ... - -class EpollSelector(BaseSelector): - def fileno(self) -> int: ... - def register(self, fileobj: _FileObject, events: _EventMask, data: Any = ...) -> SelectorKey: ... - def unregister(self, fileobj: _FileObject) -> SelectorKey: ... + def register(self, fileobj: FileDescriptorLike, events: _EventMask, data: Any = ...) -> SelectorKey: ... + def unregister(self, fileobj: FileDescriptorLike) -> SelectorKey: ... def select(self, timeout: Optional[float] = ...) -> List[Tuple[SelectorKey, _EventMask]]: ... - def get_map(self) -> Mapping[_FileObject, SelectorKey]: ... + def get_map(self) -> Mapping[FileDescriptorLike, SelectorKey]: ... + +if sys.platform != "win32": + class PollSelector(BaseSelector): + def register(self, fileobj: FileDescriptorLike, events: _EventMask, data: Any = ...) -> SelectorKey: ... + def unregister(self, fileobj: FileDescriptorLike) -> SelectorKey: ... + def select(self, timeout: Optional[float] = ...) -> List[Tuple[SelectorKey, _EventMask]]: ... + def get_map(self) -> Mapping[FileDescriptorLike, SelectorKey]: ... + class EpollSelector(BaseSelector): + def fileno(self) -> int: ... + def register(self, fileobj: FileDescriptorLike, events: _EventMask, data: Any = ...) -> SelectorKey: ... + def unregister(self, fileobj: FileDescriptorLike) -> SelectorKey: ... + def select(self, timeout: Optional[float] = ...) -> List[Tuple[SelectorKey, _EventMask]]: ... + def get_map(self) -> Mapping[FileDescriptorLike, SelectorKey]: ... class DevpollSelector(BaseSelector): def fileno(self) -> int: ... - def register(self, fileobj: _FileObject, events: _EventMask, data: Any = ...) -> SelectorKey: ... - def unregister(self, fileobj: _FileObject) -> SelectorKey: ... + def register(self, fileobj: FileDescriptorLike, events: _EventMask, data: Any = ...) -> SelectorKey: ... + def unregister(self, fileobj: FileDescriptorLike) -> SelectorKey: ... def select(self, timeout: Optional[float] = ...) -> List[Tuple[SelectorKey, _EventMask]]: ... - def get_map(self) -> Mapping[_FileObject, SelectorKey]: ... + def get_map(self) -> Mapping[FileDescriptorLike, SelectorKey]: ... class KqueueSelector(BaseSelector): def fileno(self) -> int: ... - def register(self, fileobj: _FileObject, events: _EventMask, data: Any = ...) -> SelectorKey: ... - def unregister(self, fileobj: _FileObject) -> SelectorKey: ... + def register(self, fileobj: FileDescriptorLike, events: _EventMask, data: Any = ...) -> SelectorKey: ... + def unregister(self, fileobj: FileDescriptorLike) -> SelectorKey: ... def select(self, timeout: Optional[float] = ...) -> List[Tuple[SelectorKey, _EventMask]]: ... - def get_map(self) -> Mapping[_FileObject, SelectorKey]: ... + def get_map(self) -> Mapping[FileDescriptorLike, SelectorKey]: ... class DefaultSelector(BaseSelector): - def register(self, fileobj: _FileObject, events: _EventMask, data: Any = ...) -> SelectorKey: ... - def unregister(self, fileobj: _FileObject) -> SelectorKey: ... + def register(self, fileobj: FileDescriptorLike, events: _EventMask, data: Any = ...) -> SelectorKey: ... + def unregister(self, fileobj: FileDescriptorLike) -> SelectorKey: ... def select(self, timeout: Optional[float] = ...) -> List[Tuple[SelectorKey, _EventMask]]: ... - def get_map(self) -> Mapping[_FileObject, SelectorKey]: ... + def get_map(self) -> Mapping[FileDescriptorLike, SelectorKey]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/shelve.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/shelve.pyi old mode 100755 new mode 100644 index 97a045e0..bbbd72e4 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/shelve.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/shelve.pyi @@ -1,9 +1,10 @@ -from typing import Any, Dict, Iterator, Optional, Tuple import collections - +from typing import Any, Dict, Iterator, Optional, Tuple class Shelf(collections.MutableMapping[Any, Any]): - def __init__(self, dict: Dict[bytes, Any], protocol: Optional[int] = ..., writeback: bool = ..., keyencoding: str = ...) -> None: ... + def __init__( + self, dict: Dict[bytes, Any], protocol: Optional[int] = ..., writeback: bool = ..., keyencoding: str = ... + ) -> None: ... def __iter__(self) -> Iterator[str]: ... def __len__(self) -> int: ... def __contains__(self, key: Any) -> bool: ... # key should be str, but it would conflict with superclass's type signature @@ -18,7 +19,9 @@ class Shelf(collections.MutableMapping[Any, Any]): def sync(self) -> None: ... class BsdDbShelf(Shelf): - def __init__(self, dict: Dict[bytes, Any], protocol: Optional[int] = ..., writeback: bool = ..., keyencoding: str = ...) -> None: ... + def __init__( + self, dict: Dict[bytes, Any], protocol: Optional[int] = ..., writeback: bool = ..., keyencoding: str = ... + ) -> None: ... def set_location(self, key: Any) -> Tuple[str, Any]: ... def next(self) -> Tuple[str, Any]: ... def previous(self) -> Tuple[str, Any]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/shlex.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/shlex.pyi old mode 100755 new mode 100644 index 51ed42d9..0eb89d33 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/shlex.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/shlex.pyi @@ -1,12 +1,14 @@ -from typing import List, Tuple, Any, TextIO, Union, Optional, Iterable, TypeVar import sys +from typing import Any, Iterable, List, Optional, TextIO, Tuple, TypeVar, Union def split(s: str, comments: bool = ..., posix: bool = ...) -> List[str]: ... + if sys.version_info >= (3, 8): def join(split_command: Iterable[str]) -> str: ... + def quote(s: str) -> str: ... -_SLT = TypeVar('_SLT', bound=shlex) +_SLT = TypeVar("_SLT", bound=shlex) class shlex(Iterable[str]): commenters: str @@ -23,15 +25,14 @@ class shlex(Iterable[str]): lineno: int token: str eof: str - if sys.version_info >= (3, 6): - punctuation_chars: str - - if sys.version_info >= (3, 6): - def __init__(self, instream: Union[str, TextIO] = ..., infile: Optional[str] = ..., - posix: bool = ..., punctuation_chars: Union[bool, str] = ...) -> None: ... - else: - def __init__(self, instream: Union[str, TextIO] = ..., infile: Optional[str] = ..., - posix: bool = ...) -> None: ... + punctuation_chars: str + def __init__( + self, + instream: Union[str, TextIO] = ..., + infile: Optional[str] = ..., + posix: bool = ..., + punctuation_chars: Union[bool, str] = ..., + ) -> None: ... def get_token(self) -> str: ... def push_token(self, tok: str) -> None: ... def read_token(self) -> str: ... @@ -39,7 +40,6 @@ class shlex(Iterable[str]): # TODO argument types def push_source(self, newstream: Any, newfile: Any = ...) -> None: ... def pop_source(self) -> None: ... - def error_leader(self, infile: str = ..., - lineno: int = ...) -> None: ... + def error_leader(self, infile: str = ..., lineno: int = ...) -> None: ... def __iter__(self: _SLT) -> _SLT: ... def __next__(self) -> str: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/signal.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/signal.pyi old mode 100755 new mode 100644 index dd457d8c..53d8caac --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/signal.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/signal.pyi @@ -1,56 +1,67 @@ -"""Stub file for the 'signal' module.""" - +import sys from enum import IntEnum -from typing import Any, Callable, Tuple, Union, Optional, Iterable, Set from types import FrameType +from typing import Any, Callable, Iterable, Optional, Set, Tuple, Union -class ItimerError(IOError): ... - -ITIMER_PROF: int -ITIMER_REAL: int -ITIMER_VIRTUAL: int +if sys.platform != "win32": + class ItimerError(IOError): ... + ITIMER_PROF: int + ITIMER_REAL: int + ITIMER_VIRTUAL: int NSIG: int class Signals(IntEnum): SIGABRT: int - SIGALRM: int - SIGBREAK: int # Windows - SIGBUS: int - SIGCHLD: int - SIGCLD: int - SIGCONT: int + if sys.platform != "win32": + SIGALRM: int + if sys.platform == "win32": + SIGBREAK: int + if sys.platform != "win32": + SIGBUS: int + SIGCHLD: int + if sys.platform != "darwin" and sys.platform != "win32": + SIGCLD: int + if sys.platform != "win32": + SIGCONT: int SIGEMT: int SIGFPE: int - SIGHUP: int + if sys.platform != "win32": + SIGHUP: int SIGILL: int SIGINFO: int SIGINT: int - SIGIO: int - SIGIOT: int - SIGKILL: int - SIGPIPE: int - SIGPOLL: int - SIGPROF: int - SIGPWR: int - SIGQUIT: int - SIGRTMAX: int - SIGRTMIN: int + if sys.platform != "win32": + SIGIO: int + SIGIOT: int + SIGKILL: int + SIGPIPE: int + if sys.platform != "darwin" and sys.platform != "win32": + SIGPOLL: int + SIGPWR: int + if sys.platform != "win32": + SIGPROF: int + SIGQUIT: int + if sys.platform != "darwin" and sys.platform != "win32": + SIGRTMAX: int + SIGRTMIN: int SIGSEGV: int - SIGSTOP: int - SIGSYS: int + if sys.platform != "win32": + SIGSTOP: int + SIGSYS: int SIGTERM: int - SIGTRAP: int - SIGTSTP: int - SIGTTIN: int - SIGTTOU: int - SIGURG: int - SIGUSR1: int - SIGUSR2: int - SIGVTALRM: int - SIGWINCH: int - SIGXCPU: int - SIGXFSZ: int + if sys.platform != "win32": + SIGTRAP: int + SIGTSTP: int + SIGTTIN: int + SIGTTOU: int + SIGURG: int + SIGUSR1: int + SIGUSR2: int + SIGVTALRM: int + SIGWINCH: int + SIGXCPU: int + SIGXFSZ: int class Handlers(IntEnum): SIG_DFL: int @@ -59,90 +70,125 @@ class Handlers(IntEnum): SIG_DFL = Handlers.SIG_DFL SIG_IGN = Handlers.SIG_IGN -class Sigmasks(IntEnum): - SIG_BLOCK: int - SIG_UNBLOCK: int - SIG_SETMASK: int - -SIG_BLOCK = Sigmasks.SIG_BLOCK -SIG_UNBLOCK = Sigmasks.SIG_UNBLOCK -SIG_SETMASK = Sigmasks.SIG_SETMASK +if sys.platform != "win32": + class Sigmasks(IntEnum): + SIG_BLOCK: int + SIG_UNBLOCK: int + SIG_SETMASK: int + SIG_BLOCK = Sigmasks.SIG_BLOCK + SIG_UNBLOCK = Sigmasks.SIG_UNBLOCK + SIG_SETMASK = Sigmasks.SIG_SETMASK _SIGNUM = Union[int, Signals] -_HANDLER = Union[Callable[[Signals, FrameType], None], int, Handlers, None] +_HANDLER = Union[Callable[[Signals, FrameType], Any], int, Handlers, None] SIGABRT: Signals -SIGALRM: Signals -SIGBREAK: Signals # Windows -SIGBUS: Signals -SIGCHLD: Signals -SIGCLD: Signals -SIGCONT: Signals +if sys.platform != "win32": + SIGALRM: Signals +if sys.platform == "win32": + SIGBREAK: Signals +if sys.platform != "win32": + SIGBUS: Signals + SIGCHLD: Signals +if sys.platform != "darwin" and sys.platform != "win32": + SIGCLD: Signals +if sys.platform != "win32": + SIGCONT: Signals SIGEMT: Signals SIGFPE: Signals -SIGHUP: Signals +if sys.platform != "win32": + SIGHUP: Signals SIGILL: Signals SIGINFO: Signals SIGINT: Signals -SIGIO: Signals -SIGIOT: Signals -SIGKILL: Signals -SIGPIPE: Signals -SIGPOLL: Signals -SIGPROF: Signals -SIGPWR: Signals -SIGQUIT: Signals -SIGRTMAX: Signals -SIGRTMIN: Signals +if sys.platform != "win32": + SIGIO: Signals + SIGIOT: Signals + SIGKILL: Signals + SIGPIPE: Signals +if sys.platform != "darwin" and sys.platform != "win32": + SIGPOLL: Signals + SIGPWR: Signals +if sys.platform != "win32": + SIGPROF: Signals + SIGQUIT: Signals +if sys.platform != "darwin" and sys.platform != "win32": + SIGRTMAX: Signals + SIGRTMIN: Signals SIGSEGV: Signals -SIGSTOP: Signals -SIGSYS: Signals +if sys.platform != "win32": + SIGSTOP: Signals + SIGSYS: Signals SIGTERM: Signals -SIGTRAP: Signals -SIGTSTP: Signals -SIGTTIN: Signals -SIGTTOU: Signals -SIGURG: Signals -SIGUSR1: Signals -SIGUSR2: Signals -SIGVTALRM: Signals -SIGWINCH: Signals -SIGXCPU: Signals -SIGXFSZ: Signals - -# Windows -CTRL_C_EVENT: int -CTRL_BREAK_EVENT: int - -class struct_siginfo(Tuple[int, int, int, int, int, int, int]): - def __init__(self, sequence: Iterable[int]) -> None: ... - @property - def si_signo(self) -> int: ... - @property - def si_code(self) -> int: ... - @property - def si_errno(self) -> int: ... - @property - def si_pid(self) -> int: ... - @property - def si_uid(self) -> int: ... - @property - def si_status(self) -> int: ... - @property - def si_band(self) -> int: ... - -def alarm(time: int) -> int: ... +if sys.platform != "win32": + SIGTRAP: Signals + SIGTSTP: Signals + SIGTTIN: Signals + SIGTTOU: Signals + SIGURG: Signals + SIGUSR1: Signals + SIGUSR2: Signals + SIGVTALRM: Signals + SIGWINCH: Signals + SIGXCPU: Signals + SIGXFSZ: Signals + +if sys.platform == "win32": + CTRL_C_EVENT: int + CTRL_BREAK_EVENT: int + +if sys.platform != "win32": + class struct_siginfo(Tuple[int, int, int, int, int, int, int]): + def __init__(self, sequence: Iterable[int]) -> None: ... + @property + def si_signo(self) -> int: ... + @property + def si_code(self) -> int: ... + @property + def si_errno(self) -> int: ... + @property + def si_pid(self) -> int: ... + @property + def si_uid(self) -> int: ... + @property + def si_status(self) -> int: ... + @property + def si_band(self) -> int: ... + +if sys.platform != "win32": + def alarm(__seconds: int) -> int: ... + def default_int_handler(signum: int, frame: FrameType) -> None: ... -def getitimer(which: int) -> Tuple[float, float]: ... -def getsignal(signalnum: _SIGNUM) -> _HANDLER: ... -def pause() -> None: ... -def pthread_kill(thread_id: int, signum: int) -> None: ... -def pthread_sigmask(how: int, mask: Iterable[int]) -> Set[_SIGNUM]: ... -def set_wakeup_fd(fd: int) -> int: ... -def setitimer(which: int, seconds: float, interval: float = ...) -> Tuple[float, float]: ... -def siginterrupt(signalnum: int, flag: bool) -> None: ... -def signal(signalnum: _SIGNUM, handler: _HANDLER) -> _HANDLER: ... -def sigpending() -> Any: ... -def sigtimedwait(sigset: Iterable[int], timeout: float) -> Optional[struct_siginfo]: ... -def sigwait(sigset: Iterable[int]) -> _SIGNUM: ... -def sigwaitinfo(sigset: Iterable[int]) -> struct_siginfo: ... + +if sys.platform != "win32": + def getitimer(__which: int) -> Tuple[float, float]: ... + +def getsignal(__signalnum: _SIGNUM) -> _HANDLER: ... + +if sys.version_info >= (3, 8): + def strsignal(__signalnum: _SIGNUM) -> Optional[str]: ... + def valid_signals() -> Set[Signals]: ... + def raise_signal(__signalnum: _SIGNUM) -> None: ... + +if sys.platform != "win32": + def pause() -> None: ... + def pthread_kill(__thread_id: int, __signalnum: int) -> None: ... + def pthread_sigmask(__how: int, __mask: Iterable[int]) -> Set[_SIGNUM]: ... + +if sys.version_info >= (3, 7): + def set_wakeup_fd(fd: int, *, warn_on_full_buffer: bool = ...) -> int: ... + +else: + def set_wakeup_fd(fd: int) -> int: ... + +if sys.platform != "win32": + def setitimer(__which: int, __seconds: float, __interval: float = ...) -> Tuple[float, float]: ... + def siginterrupt(__signalnum: int, __flag: bool) -> None: ... + +def signal(__signalnum: _SIGNUM, __handler: _HANDLER) -> _HANDLER: ... + +if sys.platform != "win32": + def sigpending() -> Any: ... + def sigtimedwait(sigset: Iterable[int], timeout: float) -> Optional[struct_siginfo]: ... + def sigwait(__sigset: Iterable[int]) -> _SIGNUM: ... + def sigwaitinfo(sigset: Iterable[int]) -> struct_siginfo: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/smtplib.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/smtplib.pyi old mode 100755 new mode 100644 index 60e3a35b..fa9d37e4 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/smtplib.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/smtplib.pyi @@ -2,7 +2,7 @@ from email.message import Message as _Message from socket import socket from ssl import SSLContext from types import TracebackType -from typing import Any, Dict, List, Optional, Sequence, Tuple, Union, Pattern, Type, Protocol, overload +from typing import Any, Dict, List, Optional, Pattern, Protocol, Sequence, Tuple, Type, Union, overload _Reply = Tuple[int, bytes] _SendErrs = Dict[str, _Reply] @@ -67,16 +67,20 @@ class SMTP: command_encoding: str source_address: Optional[_SourceAddress] local_hostname: str - def __init__(self, host: str = ..., port: int = ..., - local_hostname: Optional[str] = ..., timeout: float = ..., - source_address: Optional[_SourceAddress] = ...) -> None: ... + def __init__( + self, + host: str = ..., + port: int = ..., + local_hostname: Optional[str] = ..., + timeout: float = ..., + source_address: Optional[_SourceAddress] = ..., + ) -> None: ... def __enter__(self) -> SMTP: ... - def __exit__(self, exc_type: Optional[Type[BaseException]], - exc_value: Optional[BaseException], - tb: Optional[TracebackType]) -> None: ... + def __exit__( + self, exc_type: Optional[Type[BaseException]], exc_value: Optional[BaseException], tb: Optional[TracebackType] + ) -> None: ... def set_debuglevel(self, debuglevel: int) -> None: ... - def connect(self, host: str = ..., port: int = ..., - source_address: Optional[_SourceAddress] = ...) -> _Reply: ... + def connect(self, host: str = ..., port: int = ..., source_address: Optional[_SourceAddress] = ...) -> _Reply: ... def send(self, s: Union[bytes, str]) -> None: ... def putcmd(self, cmd: str, args: str = ...) -> None: ... def getreply(self) -> _Reply: ... @@ -104,15 +108,25 @@ class SMTP: def auth_plain(self, challenge: Optional[bytes] = ...) -> str: ... def auth_login(self, challenge: Optional[bytes] = ...) -> str: ... def login(self, user: str, password: str, *, initial_response_ok: bool = ...) -> _Reply: ... - def starttls(self, keyfile: Optional[str] = ..., certfile: Optional[str] = ..., - context: Optional[SSLContext] = ...) -> _Reply: ... - def sendmail(self, from_addr: str, to_addrs: Union[str, Sequence[str]], - msg: Union[bytes, str], mail_options: Sequence[str] = ..., - rcpt_options: List[str] = ...) -> _SendErrs: ... - def send_message(self, msg: _Message, from_addr: Optional[str] = ..., - to_addrs: Optional[Union[str, Sequence[str]]] = ..., - mail_options: List[str] = ..., - rcpt_options: Sequence[str] = ...) -> _SendErrs: ... + def starttls( + self, keyfile: Optional[str] = ..., certfile: Optional[str] = ..., context: Optional[SSLContext] = ... + ) -> _Reply: ... + def sendmail( + self, + from_addr: str, + to_addrs: Union[str, Sequence[str]], + msg: Union[bytes, str], + mail_options: Sequence[str] = ..., + rcpt_options: List[str] = ..., + ) -> _SendErrs: ... + def send_message( + self, + msg: _Message, + from_addr: Optional[str] = ..., + to_addrs: Optional[Union[str, Sequence[str]]] = ..., + mail_options: List[str] = ..., + rcpt_options: Sequence[str] = ..., + ) -> _SendErrs: ... def close(self) -> None: ... def quit(self) -> _Reply: ... @@ -121,16 +135,25 @@ class SMTP_SSL(SMTP): keyfile: Optional[str] certfile: Optional[str] context: SSLContext - def __init__(self, host: str = ..., port: int = ..., - local_hostname: Optional[str] = ..., - keyfile: Optional[str] = ..., certfile: Optional[str] = ..., - timeout: float = ..., - source_address: Optional[_SourceAddress] = ..., - context: Optional[SSLContext] = ...) -> None: ... + def __init__( + self, + host: str = ..., + port: int = ..., + local_hostname: Optional[str] = ..., + keyfile: Optional[str] = ..., + certfile: Optional[str] = ..., + timeout: float = ..., + source_address: Optional[_SourceAddress] = ..., + context: Optional[SSLContext] = ..., + ) -> None: ... LMTP_PORT: int class LMTP(SMTP): - def __init__(self, host: str = ..., port: int = ..., - local_hostname: Optional[str] = ..., - source_address: Optional[_SourceAddress] = ...) -> None: ... + def __init__( + self, + host: str = ..., + port: int = ..., + local_hostname: Optional[str] = ..., + source_address: Optional[_SourceAddress] = ..., + ) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/socketserver.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/socketserver.pyi old mode 100755 new mode 100644 index 0b4d3a27..01ab760b --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/socketserver.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/socketserver.pyi @@ -1,10 +1,7 @@ -# NB: SocketServer.pyi and socketserver.pyi must remain consistent! -# Stubs for socketserver - -from typing import Any, BinaryIO, Callable, Optional, Tuple, Type, Text, Union -from socket import SocketType import sys import types +from socket import SocketType +from typing import Any, BinaryIO, Callable, ClassVar, List, Optional, Tuple, Type, Union class BaseServer: address_family: int @@ -15,66 +12,96 @@ class BaseServer: request_queue_size: int socket_type: int timeout: Optional[float] - def __init__(self, server_address: Any, - RequestHandlerClass: Callable[..., BaseRequestHandler]) -> None: ... + def __init__(self, server_address: Any, RequestHandlerClass: Callable[..., BaseRequestHandler]) -> None: ... def fileno(self) -> int: ... def handle_request(self) -> None: ... def serve_forever(self, poll_interval: float = ...) -> None: ... def shutdown(self) -> None: ... def server_close(self) -> None: ... - def finish_request(self, request: bytes, - client_address: Tuple[str, int]) -> None: ... - def get_request(self) -> None: ... - def handle_error(self, request: bytes, - client_address: Tuple[str, int]) -> None: ... + def finish_request(self, request: bytes, client_address: Tuple[str, int]) -> None: ... + def get_request(self) -> Tuple[SocketType, Tuple[str, int]]: ... + def handle_error(self, request: bytes, client_address: Tuple[str, int]) -> None: ... def handle_timeout(self) -> None: ... - def process_request(self, request: bytes, - client_address: Tuple[str, int]) -> None: ... + def process_request(self, request: bytes, client_address: Tuple[str, int]) -> None: ... def server_activate(self) -> None: ... def server_bind(self) -> None: ... - def verify_request(self, request: bytes, - client_address: Tuple[str, int]) -> bool: ... + def verify_request(self, request: bytes, client_address: Tuple[str, int]) -> bool: ... if sys.version_info >= (3, 6): def __enter__(self) -> BaseServer: ... - def __exit__(self, exc_type: Optional[Type[BaseException]], - exc_val: Optional[BaseException], - exc_tb: Optional[types.TracebackType]) -> None: ... - if sys.version_info >= (3, 3): - def service_actions(self) -> None: ... + def __exit__( + self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[types.TracebackType] + ) -> None: ... + def service_actions(self) -> None: ... class TCPServer(BaseServer): - def __init__(self, server_address: Tuple[str, int], - RequestHandlerClass: Callable[..., BaseRequestHandler], - bind_and_activate: bool = ...) -> None: ... + def __init__( + self, + server_address: Tuple[str, int], + RequestHandlerClass: Callable[..., BaseRequestHandler], + bind_and_activate: bool = ..., + ) -> None: ... class UDPServer(BaseServer): - def __init__(self, server_address: Tuple[str, int], - RequestHandlerClass: Callable[..., BaseRequestHandler], - bind_and_activate: bool = ...) -> None: ... + def __init__( + self, + server_address: Tuple[str, int], + RequestHandlerClass: Callable[..., BaseRequestHandler], + bind_and_activate: bool = ..., + ) -> None: ... -if sys.platform != 'win32': +if sys.platform != "win32": class UnixStreamServer(BaseServer): - def __init__(self, server_address: Union[Text, bytes], - RequestHandlerClass: Callable[..., BaseRequestHandler], - bind_and_activate: bool = ...) -> None: ... - + def __init__( + self, + server_address: Union[str, bytes], + RequestHandlerClass: Callable[..., BaseRequestHandler], + bind_and_activate: bool = ..., + ) -> None: ... class UnixDatagramServer(BaseServer): - def __init__(self, server_address: Union[Text, bytes], - RequestHandlerClass: Callable[..., BaseRequestHandler], - bind_and_activate: bool = ...) -> None: ... + def __init__( + self, + server_address: Union[str, bytes], + RequestHandlerClass: Callable[..., BaseRequestHandler], + bind_and_activate: bool = ..., + ) -> None: ... + +if sys.platform != "win32": + class ForkingMixIn: + timeout: Optional[float] # undocumented + active_children: Optional[List[int]] # undocumented + max_children: int # undocumented + if sys.version_info >= (3, 7): + block_on_close: bool + if sys.version_info >= (3, 6): + def collect_children(self, *, blocking: bool = ...) -> None: ... # undocumented + else: + def collect_children(self) -> None: ... # undocumented + def handle_timeout(self) -> None: ... # undocumented + def service_actions(self) -> None: ... # undocumented + def process_request(self, request: bytes, client_address: Tuple[str, int]) -> None: ... + if sys.version_info >= (3, 6): + def server_close(self) -> None: ... -class ForkingMixIn: ... -class ThreadingMixIn: ... +class ThreadingMixIn: + daemon_threads: bool + if sys.version_info >= (3, 7): + block_on_close: bool + def process_request_thread(self, request: bytes, client_address: Tuple[str, int]) -> None: ... # undocumented + def process_request(self, request: bytes, client_address: Tuple[str, int]) -> None: ... + if sys.version_info >= (3, 6): + def server_close(self) -> None: ... + +if sys.platform != "win32": + class ForkingTCPServer(ForkingMixIn, TCPServer): ... + class ForkingUDPServer(ForkingMixIn, UDPServer): ... -class ForkingTCPServer(ForkingMixIn, TCPServer): ... -class ForkingUDPServer(ForkingMixIn, UDPServer): ... class ThreadingTCPServer(ThreadingMixIn, TCPServer): ... class ThreadingUDPServer(ThreadingMixIn, UDPServer): ... -if sys.platform != 'win32': + +if sys.platform != "win32": class ThreadingUnixStreamServer(ThreadingMixIn, UnixStreamServer): ... class ThreadingUnixDatagramServer(ThreadingMixIn, UnixDatagramServer): ... - class BaseRequestHandler: # Those are technically of types, respectively: # * Union[SocketType, Tuple[bytes, SocketType]] @@ -84,16 +111,23 @@ class BaseRequestHandler: # https://github.com/python/typeshed/pull/384#issuecomment-234649696) request: Any client_address: Any - server: BaseServer + def __init__(self, request: Any, client_address: Any, server: BaseServer) -> None: ... def setup(self) -> None: ... def handle(self) -> None: ... def finish(self) -> None: ... class StreamRequestHandler(BaseRequestHandler): + rbufsize: ClassVar[int] # Undocumented + wbufsize: ClassVar[int] # Undocumented + timeout: ClassVar[Optional[float]] # Undocumented + disable_nagle_algorithm: ClassVar[bool] # Undocumented + connection: SocketType # Undocumented rfile: BinaryIO wfile: BinaryIO class DatagramRequestHandler(BaseRequestHandler): + packet: SocketType # Undocumented + socket: SocketType # Undocumented rfile: BinaryIO wfile: BinaryIO diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/spwd.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/spwd.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/sre_constants.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/sre_constants.pyi old mode 100755 new mode 100644 index 85f50ca0..2b411d5c --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/sre_constants.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/sre_constants.pyi @@ -1,5 +1,3 @@ -# Source: https://github.com/python/cpython/blob/master/Lib/sre_constants.py - from typing import Any, Dict, List, Optional, Union MAGIC: int @@ -14,7 +12,7 @@ class error(Exception): class _NamedIntConstant(int): name: Any - def __new__(cls, value: int, name: str): ... + def __new__(cls, value: int, name: str) -> _NamedIntConstant: ... MAXREPEAT: _NamedIntConstant OPCODES: List[_NamedIntConstant] @@ -39,7 +37,6 @@ SRE_INFO_PREFIX: int SRE_INFO_LITERAL: int SRE_INFO_CHARSET: int - # Stubgen above; manually defined constants below (dynamic at runtime) # from OPCODES diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/sre_parse.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/sre_parse.pyi old mode 100755 new mode 100644 index 175fb54c..4c7b6157 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/sre_parse.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/sre_parse.pyi @@ -1,11 +1,6 @@ -# Source: https://github.com/python/cpython/blob/master/Lib/sre_parse.py - -from typing import ( - Any, Dict, FrozenSet, Iterable, List, Match, - Optional, Pattern as _Pattern, Tuple, Union -) import sys -from sre_constants import _NamedIntConstant as NIC, error as _Error +from sre_constants import _NamedIntConstant as _NIC, error as _Error +from typing import Any, Dict, FrozenSet, Iterable, List, Match, Optional, Pattern as _Pattern, Tuple, Union, overload SPECIAL_CHARS: str REPEAT_CHARS: str @@ -14,8 +9,8 @@ OCTDIGITS: FrozenSet[str] HEXDIGITS: FrozenSet[str] ASCIILETTERS: FrozenSet[str] WHITESPACE: FrozenSet[str] -ESCAPES: Dict[str, Tuple[NIC, int]] -CATEGORIES: Dict[str, Union[Tuple[NIC, NIC], Tuple[NIC, List[Tuple[NIC, NIC]]]]] +ESCAPES: Dict[str, Tuple[_NIC, int]] +CATEGORIES: Dict[str, Union[Tuple[_NIC, _NIC], Tuple[_NIC, List[Tuple[_NIC, _NIC]]]]] FLAGS: Dict[str, int] GLOBAL_FLAGS: int @@ -39,14 +34,12 @@ if sys.version_info >= (3, 8): else: Pattern = _State - _OpSubpatternType = Tuple[Optional[int], int, int, SubPattern] _OpGroupRefExistsType = Tuple[int, SubPattern, SubPattern] -_OpInType = List[Tuple[NIC, int]] +_OpInType = List[Tuple[_NIC, int]] _OpBranchType = Tuple[None, List[SubPattern]] _AvType = Union[_OpInType, _OpBranchType, Iterable[SubPattern], _OpGroupRefExistsType, _OpSubpatternType] -_CodeType = Tuple[NIC, _AvType] - +_CodeType = Tuple[_NIC, _AvType] class SubPattern: data: List[_CodeType] @@ -54,11 +47,10 @@ class SubPattern: if sys.version_info >= (3, 8): state: State - def __init__(self, state: State, data: List[_CodeType] = ...) -> None: ... + def __init__(self, state: State, data: Optional[List[_CodeType]] = ...) -> None: ... else: pattern: Pattern - def __init__(self, pattern: Pattern, data: List[_CodeType] = ...) -> None: ... - + def __init__(self, pattern: Pattern, data: Optional[List[_CodeType]] = ...) -> None: ... def dump(self, level: int = ...) -> None: ... def __len__(self) -> int: ... def __delitem__(self, index: Union[int, slice]) -> None: ... @@ -68,7 +60,6 @@ class SubPattern: def append(self, code: _CodeType) -> None: ... def getwidth(self) -> int: ... - class Tokenizer: istext: bool string: Any @@ -79,19 +70,32 @@ class Tokenizer: def match(self, char: str) -> bool: ... def get(self) -> Optional[str]: ... def getwhile(self, n: int, charset: Iterable[str]) -> str: ... - def getuntil(self, terminator: str) -> str: ... + if sys.version_info >= (3, 8): + def getuntil(self, terminator: str, name: str) -> str: ... + else: + def getuntil(self, terminator: str) -> str: ... @property def pos(self) -> int: ... def tell(self) -> int: ... def seek(self, index: int) -> None: ... def error(self, msg: str, offset: int = ...) -> _Error: ... -def fix_flags(src: Union[str, bytes], flag: int) -> int: ... -_TemplateType = Tuple[List[Tuple[int, int]], List[str]] +def fix_flags(src: Union[str, bytes], flags: int) -> int: ... + +_TemplateType = Tuple[List[Tuple[int, int]], List[Optional[str]]] +_TemplateByteType = Tuple[List[Tuple[int, int]], List[Optional[bytes]]] if sys.version_info >= (3, 8): - def parse(str: str, flags: int = ..., state: State = ...) -> SubPattern: ... + def parse(str: str, flags: int = ..., state: Optional[State] = ...) -> SubPattern: ... + @overload def parse_template(source: str, state: _Pattern[Any]) -> _TemplateType: ... + @overload + def parse_template(source: bytes, state: _Pattern[Any]) -> _TemplateByteType: ... + else: - def parse(str: str, flags: int = ..., pattern: Pattern = ...) -> SubPattern: ... + def parse(str: str, flags: int = ..., pattern: Optional[Pattern] = ...) -> SubPattern: ... + @overload def parse_template(source: str, pattern: _Pattern[Any]) -> _TemplateType: ... + @overload + def parse_template(source: bytes, pattern: _Pattern[Any]) -> _TemplateByteType: ... + def expand_template(template: _TemplateType, match: Match[Any]) -> str: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/stat.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/stat.pyi old mode 100755 new mode 100644 index b8cff23c..6fd2bc08 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/stat.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/stat.pyi @@ -1,7 +1,3 @@ -# Stubs for stat - -# Based on http://docs.python.org/3.2/library/stat.html - import sys def S_ISDIR(mode: int) -> bool: ... @@ -11,10 +7,8 @@ def S_ISREG(mode: int) -> bool: ... def S_ISFIFO(mode: int) -> bool: ... def S_ISLNK(mode: int) -> bool: ... def S_ISSOCK(mode: int) -> bool: ... - def S_IMODE(mode: int) -> int: ... def S_IFMT(mode: int) -> int: ... - def filemode(mode: int) -> str: ... ST_MODE: int @@ -64,9 +58,9 @@ UF_IMMUTABLE: int UF_APPEND: int UF_OPAQUE: int UF_NOUNLINK: int -if sys.platform == 'darwin': +if sys.platform == "darwin": UF_COMPRESSED: int # OS X 10.6+ only - UF_HIDDEN: int # OX X 10.5+ only + UF_HIDDEN: int # OX X 10.5+ only SF_ARCHIVED: int SF_IMMUTABLE: int SF_APPEND: int diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/statistics.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/statistics.pyi old mode 100755 new mode 100644 index 3181044e..8d6b8f92 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/statistics.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/statistics.pyi @@ -1,33 +1,39 @@ -# Stubs for statistics - +import sys +from _typeshed import SupportsLessThanT from decimal import Decimal from fractions import Fraction -import sys -from typing import Any, Iterable, List, Optional, SupportsFloat, Type, TypeVar, Union +from typing import Any, Hashable, Iterable, List, Optional, SupportsFloat, Type, TypeVar, Union _T = TypeVar("_T") # Most functions in this module accept homogeneous collections of one of these types -_Number = TypeVar('_Number', float, Decimal, Fraction) +_Number = TypeVar("_Number", float, Decimal, Fraction) + +# Used in mode, multimode +_HashableT = TypeVar("_HashableT", bound=Hashable) class StatisticsError(ValueError): ... if sys.version_info >= (3, 8): def fmean(data: Iterable[SupportsFloat]) -> float: ... def geometric_mean(data: Iterable[SupportsFloat]) -> float: ... + def mean(data: Iterable[_Number]) -> _Number: ... -if sys.version_info >= (3, 6): - def harmonic_mean(data: Iterable[_Number]) -> _Number: ... +def harmonic_mean(data: Iterable[_Number]) -> _Number: ... def median(data: Iterable[_Number]) -> _Number: ... -def median_low(data: Iterable[_Number]) -> _Number: ... -def median_high(data: Iterable[_Number]) -> _Number: ... -def median_grouped(data: Iterable[_Number]) -> _Number: ... -def mode(data: Iterable[_Number]) -> _Number: ... +def median_low(data: Iterable[SupportsLessThanT]) -> SupportsLessThanT: ... +def median_high(data: Iterable[SupportsLessThanT]) -> SupportsLessThanT: ... +def median_grouped(data: Iterable[_Number], interval: _Number = ...) -> _Number: ... +def mode(data: Iterable[_HashableT]) -> _HashableT: ... + if sys.version_info >= (3, 8): - def multimode(data: Iterable[_T]) -> List[_T]: ... + def multimode(data: Iterable[_HashableT]) -> List[_HashableT]: ... + def pstdev(data: Iterable[_Number], mu: Optional[_Number] = ...) -> _Number: ... def pvariance(data: Iterable[_Number], mu: Optional[_Number] = ...) -> _Number: ... + if sys.version_info >= (3, 8): def quantiles(data: Iterable[_Number], *, n: int = ..., method: str = ...) -> List[_Number]: ... + def stdev(data: Iterable[_Number], xbar: Optional[_Number] = ...) -> _Number: ... def variance(data: Iterable[_Number], xbar: Optional[_Number] = ...) -> _Number: ... @@ -46,12 +52,14 @@ if sys.version_info >= (3, 8): def variance(self) -> float: ... @classmethod def from_samples(cls: Type[_T], data: Iterable[SupportsFloat]) -> _T: ... - def samples(self, n: int, *, seed: Optional[Any]) -> List[float]: ... + def samples(self, n: int, *, seed: Optional[Any] = ...) -> List[float]: ... def pdf(self, x: float) -> float: ... def cdf(self, x: float) -> float: ... def inv_cdf(self, p: float) -> float: ... def overlap(self, other: NormalDist) -> float: ... def quantiles(self, n: int = ...) -> List[float]: ... + if sys.version_info >= (3, 9): + def zscore(self, x: float) -> float: ... def __add__(self, x2: Union[float, NormalDist]) -> NormalDist: ... def __sub__(self, x2: Union[float, NormalDist]) -> NormalDist: ... def __mul__(self, x2: float) -> NormalDist: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/string.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/string.pyi old mode 100755 new mode 100644 index 6427a76d..a39e64dd --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/string.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/string.pyi @@ -1,8 +1,4 @@ -# Stubs for string - -# Based on http://docs.python.org/3.2/library/string.html - -from typing import Mapping, Sequence, Any, Optional, Union, Tuple, Iterable +from typing import Any, Iterable, Mapping, Optional, Sequence, Tuple, Union ascii_letters: str ascii_lowercase: str @@ -14,26 +10,21 @@ punctuation: str printable: str whitespace: str -def capwords(s: str, sep: str = ...) -> str: ... +def capwords(s: str, sep: Optional[str] = ...) -> str: ... class Template: template: str - def __init__(self, template: str) -> None: ... - def substitute(self, mapping: Mapping[str, object] = ..., **kwds: object) -> str: ... - def safe_substitute(self, mapping: Mapping[str, object] = ..., - **kwds: object) -> str: ... + def substitute(self, __mapping: Mapping[str, object] = ..., **kwds: object) -> str: ... + def safe_substitute(self, __mapping: Mapping[str, object] = ..., **kwds: object) -> str: ... # TODO(MichalPokorny): This is probably badly and/or loosely typed. class Formatter: - def format(self, format_string: str, *args: Any, **kwargs: Any) -> str: ... - def vformat(self, format_string: str, args: Sequence[Any], - kwargs: Mapping[str, Any]) -> str: ... + def format(self, __format_string: str, *args: Any, **kwargs: Any) -> str: ... + def vformat(self, format_string: str, args: Sequence[Any], kwargs: Mapping[str, Any]) -> str: ... def parse(self, format_string: str) -> Iterable[Tuple[str, Optional[str], Optional[str], Optional[str]]]: ... - def get_field(self, field_name: str, args: Sequence[Any], - kwargs: Mapping[str, Any]) -> Any: ... + def get_field(self, field_name: str, args: Sequence[Any], kwargs: Mapping[str, Any]) -> Any: ... def get_value(self, key: Union[int, str], args: Sequence[Any], kwargs: Mapping[str, Any]) -> Any: ... - def check_unused_args(self, used_args: Sequence[Union[int, str]], args: Sequence[Any], - kwargs: Mapping[str, Any]) -> None: ... + def check_unused_args(self, used_args: Sequence[Union[int, str]], args: Sequence[Any], kwargs: Mapping[str, Any]) -> None: ... def format_field(self, value: Any, format_spec: str) -> Any: ... def convert_field(self, value: Any, conversion: str) -> Any: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/subprocess.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/subprocess.pyi old mode 100755 new mode 100644 index 2fd8b5ba..f41a71e5 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/subprocess.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/subprocess.pyi @@ -1,14 +1,11 @@ -# Stubs for subprocess - -# Based on http://docs.python.org/3.6/library/subprocess.html import sys -from typing import Sequence, Any, Mapping, Callable, Tuple, IO, Optional, Union, Type, Text, Generic, TypeVar, AnyStr, overload +from _typeshed import AnyPath from types import TracebackType +from typing import IO, Any, AnyStr, Callable, Generic, Mapping, Optional, Sequence, Tuple, Type, TypeVar, Union, overload +from typing_extensions import Literal -if sys.version_info >= (3, 8): - from typing import Literal -else: - from typing_extensions import Literal +if sys.version_info >= (3, 9): + from types import GenericAlias # We prefer to annotate inputs to methods (eg subprocess.check_call) with these # union types. @@ -25,19 +22,14 @@ else: # except TimeoutError as e: # reveal_type(e.cmd) # Any, but morally is _CMD _FILE = Union[None, int, IO[Any]] -_TXT = Union[bytes, Text] -if sys.version_info >= (3, 6): - from builtins import _PathLike - _PATH = Union[bytes, Text, _PathLike] -else: - _PATH = Union[bytes, Text] +_TXT = Union[bytes, str] # Python 3.6 does't support _CMD being a single PathLike. # See: https://bugs.python.org/issue31961 -_CMD = Union[_TXT, Sequence[_PATH]] -_ENV = Union[Mapping[bytes, _TXT], Mapping[Text, _TXT]] +_CMD = Union[_TXT, Sequence[AnyPath]] +_ENV = Union[Mapping[bytes, _TXT], Mapping[str, _TXT]] -_S = TypeVar('_S') -_T = TypeVar('_T') +_S = TypeVar("_S") +_T = TypeVar("_T") class CompletedProcess(Generic[_T]): # morally: _CMD @@ -49,6 +41,8 @@ class CompletedProcess(Generic[_T]): stderr: _T def __init__(self, args: _CMD, returncode: int, stdout: Optional[_T] = ..., stderr: Optional[_T] = ...) -> None: ... def check_returncode(self) -> None: ... + if sys.version_info >= (3, 9): + def __class_getitem__(cls, item: Any) -> GenericAlias: ... if sys.version_info >= (3, 7): # Nearly the same args as for 3.6, except for capture_output and text @@ -56,14 +50,14 @@ if sys.version_info >= (3, 7): def run( args: _CMD, bufsize: int = ..., - executable: _PATH = ..., + executable: Optional[AnyPath] = ..., stdin: _FILE = ..., stdout: _FILE = ..., stderr: _FILE = ..., preexec_fn: Callable[[], Any] = ..., close_fds: bool = ..., shell: bool = ..., - cwd: Optional[_PATH] = ..., + cwd: Optional[AnyPath] = ..., env: Optional[_ENV] = ..., universal_newlines: bool = ..., startupinfo: Any = ..., @@ -84,14 +78,14 @@ if sys.version_info >= (3, 7): def run( args: _CMD, bufsize: int = ..., - executable: _PATH = ..., + executable: Optional[AnyPath] = ..., stdin: _FILE = ..., stdout: _FILE = ..., stderr: _FILE = ..., preexec_fn: Callable[[], Any] = ..., close_fds: bool = ..., shell: bool = ..., - cwd: Optional[_PATH] = ..., + cwd: Optional[AnyPath] = ..., env: Optional[_ENV] = ..., universal_newlines: bool = ..., startupinfo: Any = ..., @@ -112,14 +106,14 @@ if sys.version_info >= (3, 7): def run( args: _CMD, bufsize: int = ..., - executable: _PATH = ..., + executable: Optional[AnyPath] = ..., stdin: _FILE = ..., stdout: _FILE = ..., stderr: _FILE = ..., preexec_fn: Callable[[], Any] = ..., close_fds: bool = ..., shell: bool = ..., - cwd: Optional[_PATH] = ..., + cwd: Optional[AnyPath] = ..., env: Optional[_ENV] = ..., universal_newlines: bool = ..., startupinfo: Any = ..., @@ -140,14 +134,14 @@ if sys.version_info >= (3, 7): def run( args: _CMD, bufsize: int = ..., - executable: _PATH = ..., + executable: Optional[AnyPath] = ..., stdin: _FILE = ..., stdout: _FILE = ..., stderr: _FILE = ..., preexec_fn: Callable[[], Any] = ..., close_fds: bool = ..., shell: bool = ..., - cwd: Optional[_PATH] = ..., + cwd: Optional[AnyPath] = ..., env: Optional[_ENV] = ..., *, universal_newlines: Literal[True], @@ -169,14 +163,14 @@ if sys.version_info >= (3, 7): def run( args: _CMD, bufsize: int = ..., - executable: _PATH = ..., + executable: Optional[AnyPath] = ..., stdin: _FILE = ..., stdout: _FILE = ..., stderr: _FILE = ..., preexec_fn: Callable[[], Any] = ..., close_fds: bool = ..., shell: bool = ..., - cwd: Optional[_PATH] = ..., + cwd: Optional[AnyPath] = ..., env: Optional[_ENV] = ..., universal_newlines: Literal[False] = ..., startupinfo: Any = ..., @@ -197,14 +191,14 @@ if sys.version_info >= (3, 7): def run( args: _CMD, bufsize: int = ..., - executable: _PATH = ..., + executable: Optional[AnyPath] = ..., stdin: _FILE = ..., stdout: _FILE = ..., stderr: _FILE = ..., preexec_fn: Callable[[], Any] = ..., close_fds: bool = ..., shell: bool = ..., - cwd: Optional[_PATH] = ..., + cwd: Optional[AnyPath] = ..., env: Optional[_ENV] = ..., universal_newlines: bool = ..., startupinfo: Any = ..., @@ -221,20 +215,21 @@ if sys.version_info >= (3, 7): text: Optional[bool] = ..., timeout: Optional[float] = ..., ) -> CompletedProcess[Any]: ... -elif sys.version_info >= (3, 6): + +else: # Nearly same args as Popen.__init__ except for timeout, input, and check @overload def run( args: _CMD, bufsize: int = ..., - executable: _PATH = ..., + executable: Optional[AnyPath] = ..., stdin: _FILE = ..., stdout: _FILE = ..., stderr: _FILE = ..., preexec_fn: Callable[[], Any] = ..., close_fds: bool = ..., shell: bool = ..., - cwd: Optional[_PATH] = ..., + cwd: Optional[AnyPath] = ..., env: Optional[_ENV] = ..., universal_newlines: bool = ..., startupinfo: Any = ..., @@ -253,14 +248,14 @@ elif sys.version_info >= (3, 6): def run( args: _CMD, bufsize: int = ..., - executable: _PATH = ..., + executable: Optional[AnyPath] = ..., stdin: _FILE = ..., stdout: _FILE = ..., stderr: _FILE = ..., preexec_fn: Callable[[], Any] = ..., close_fds: bool = ..., shell: bool = ..., - cwd: Optional[_PATH] = ..., + cwd: Optional[AnyPath] = ..., env: Optional[_ENV] = ..., universal_newlines: bool = ..., startupinfo: Any = ..., @@ -279,14 +274,14 @@ elif sys.version_info >= (3, 6): def run( args: _CMD, bufsize: int = ..., - executable: _PATH = ..., + executable: Optional[AnyPath] = ..., stdin: _FILE = ..., stdout: _FILE = ..., stderr: _FILE = ..., preexec_fn: Callable[[], Any] = ..., close_fds: bool = ..., shell: bool = ..., - cwd: Optional[_PATH] = ..., + cwd: Optional[AnyPath] = ..., env: Optional[_ENV] = ..., *, universal_newlines: Literal[True], @@ -306,14 +301,14 @@ elif sys.version_info >= (3, 6): def run( args: _CMD, bufsize: int = ..., - executable: _PATH = ..., + executable: Optional[AnyPath] = ..., stdin: _FILE = ..., stdout: _FILE = ..., stderr: _FILE = ..., preexec_fn: Callable[[], Any] = ..., close_fds: bool = ..., shell: bool = ..., - cwd: Optional[_PATH] = ..., + cwd: Optional[AnyPath] = ..., env: Optional[_ENV] = ..., universal_newlines: Literal[False] = ..., startupinfo: Any = ..., @@ -332,14 +327,14 @@ elif sys.version_info >= (3, 6): def run( args: _CMD, bufsize: int = ..., - executable: _PATH = ..., + executable: Optional[AnyPath] = ..., stdin: _FILE = ..., stdout: _FILE = ..., stderr: _FILE = ..., preexec_fn: Callable[[], Any] = ..., close_fds: bool = ..., shell: bool = ..., - cwd: Optional[_PATH] = ..., + cwd: Optional[AnyPath] = ..., env: Optional[_ENV] = ..., universal_newlines: bool = ..., startupinfo: Any = ..., @@ -354,20 +349,140 @@ elif sys.version_info >= (3, 6): input: Optional[_TXT] = ..., timeout: Optional[float] = ..., ) -> CompletedProcess[Any]: ... -else: - # Nearly same args as Popen.__init__ except for timeout, input, and check + +# Same args as Popen.__init__ +def call( + args: _CMD, + bufsize: int = ..., + executable: Optional[AnyPath] = ..., + stdin: _FILE = ..., + stdout: _FILE = ..., + stderr: _FILE = ..., + preexec_fn: Callable[[], Any] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[AnyPath] = ..., + env: Optional[_ENV] = ..., + universal_newlines: bool = ..., + startupinfo: Any = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + *, + timeout: Optional[float] = ..., +) -> int: ... + +# Same args as Popen.__init__ +def check_call( + args: _CMD, + bufsize: int = ..., + executable: AnyPath = ..., + stdin: _FILE = ..., + stdout: _FILE = ..., + stderr: _FILE = ..., + preexec_fn: Callable[[], Any] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[AnyPath] = ..., + env: Optional[_ENV] = ..., + universal_newlines: bool = ..., + startupinfo: Any = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + timeout: Optional[float] = ..., +) -> int: ... + +if sys.version_info >= (3, 7): + # 3.7 added text @overload - def run( + def check_output( args: _CMD, bufsize: int = ..., - executable: _PATH = ..., + executable: Optional[AnyPath] = ..., + stdin: _FILE = ..., + stderr: _FILE = ..., + preexec_fn: Callable[[], Any] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[AnyPath] = ..., + env: Optional[_ENV] = ..., + universal_newlines: bool = ..., + startupinfo: Any = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + *, + timeout: Optional[float] = ..., + input: _TXT = ..., + encoding: Optional[str] = ..., + errors: Optional[str] = ..., + text: Literal[True], + ) -> str: ... + @overload + def check_output( + args: _CMD, + bufsize: int = ..., + executable: Optional[AnyPath] = ..., + stdin: _FILE = ..., + stderr: _FILE = ..., + preexec_fn: Callable[[], Any] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[AnyPath] = ..., + env: Optional[_ENV] = ..., + universal_newlines: bool = ..., + startupinfo: Any = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + *, + timeout: Optional[float] = ..., + input: _TXT = ..., + encoding: str, + errors: Optional[str] = ..., + text: Optional[bool] = ..., + ) -> str: ... + @overload + def check_output( + args: _CMD, + bufsize: int = ..., + executable: Optional[AnyPath] = ..., + stdin: _FILE = ..., + stderr: _FILE = ..., + preexec_fn: Callable[[], Any] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[AnyPath] = ..., + env: Optional[_ENV] = ..., + universal_newlines: bool = ..., + startupinfo: Any = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + *, + timeout: Optional[float] = ..., + input: _TXT = ..., + encoding: Optional[str] = ..., + errors: str, + text: Optional[bool] = ..., + ) -> str: ... + @overload + def check_output( + args: _CMD, + bufsize: int = ..., + executable: Optional[AnyPath] = ..., stdin: _FILE = ..., - stdout: _FILE = ..., stderr: _FILE = ..., preexec_fn: Callable[[], Any] = ..., close_fds: bool = ..., shell: bool = ..., - cwd: Optional[_PATH] = ..., + cwd: Optional[AnyPath] = ..., env: Optional[_ENV] = ..., *, universal_newlines: Literal[True], @@ -376,23 +491,24 @@ else: restore_signals: bool = ..., start_new_session: bool = ..., pass_fds: Any = ..., - # where the *real* keyword only args start - check: bool = ..., - input: Optional[str] = ..., + # where the real keyword only ones start timeout: Optional[float] = ..., - ) -> CompletedProcess[str]: ... + input: _TXT = ..., + encoding: Optional[str] = ..., + errors: Optional[str] = ..., + text: Optional[bool] = ..., + ) -> str: ... @overload - def run( + def check_output( args: _CMD, bufsize: int = ..., - executable: _PATH = ..., + executable: Optional[AnyPath] = ..., stdin: _FILE = ..., - stdout: _FILE = ..., stderr: _FILE = ..., preexec_fn: Callable[[], Any] = ..., close_fds: bool = ..., shell: bool = ..., - cwd: Optional[_PATH] = ..., + cwd: Optional[AnyPath] = ..., env: Optional[_ENV] = ..., universal_newlines: Literal[False] = ..., startupinfo: Any = ..., @@ -401,22 +517,23 @@ else: start_new_session: bool = ..., pass_fds: Any = ..., *, - check: bool = ..., - input: Optional[bytes] = ..., timeout: Optional[float] = ..., - ) -> CompletedProcess[bytes]: ... + input: _TXT = ..., + encoding: None = ..., + errors: None = ..., + text: Literal[None, False] = ..., + ) -> bytes: ... @overload - def run( + def check_output( args: _CMD, bufsize: int = ..., - executable: _PATH = ..., + executable: Optional[AnyPath] = ..., stdin: _FILE = ..., - stdout: _FILE = ..., stderr: _FILE = ..., preexec_fn: Callable[[], Any] = ..., close_fds: bool = ..., shell: bool = ..., - cwd: Optional[_PATH] = ..., + cwd: Optional[AnyPath] = ..., env: Optional[_ENV] = ..., universal_newlines: bool = ..., startupinfo: Any = ..., @@ -425,383 +542,141 @@ else: start_new_session: bool = ..., pass_fds: Any = ..., *, - check: bool = ..., - input: Optional[_TXT] = ..., timeout: Optional[float] = ..., - ) -> CompletedProcess[Any]: ... - -# Same args as Popen.__init__ -def call(args: _CMD, - bufsize: int = ..., - executable: _PATH = ..., - stdin: _FILE = ..., - stdout: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., - timeout: Optional[float] = ...) -> int: ... - -# Same args as Popen.__init__ -def check_call(args: _CMD, - bufsize: int = ..., - executable: _PATH = ..., - stdin: _FILE = ..., - stdout: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., - timeout: Optional[float] = ...) -> int: ... + input: _TXT = ..., + encoding: Optional[str] = ..., + errors: Optional[str] = ..., + text: Optional[bool] = ..., + ) -> Any: ... # morally: -> _TXT -if sys.version_info >= (3, 7): - # 3.7 added text - @overload - def check_output(args: _CMD, - bufsize: int = ..., - executable: _PATH = ..., - stdin: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., - *, - timeout: Optional[float] = ..., - input: _TXT = ..., - encoding: Optional[str] = ..., - errors: Optional[str] = ..., - text: Literal[True], - ) -> str: ... - @overload - def check_output(args: _CMD, - bufsize: int = ..., - executable: _PATH = ..., - stdin: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., - *, - timeout: Optional[float] = ..., - input: _TXT = ..., - encoding: str, - errors: Optional[str] = ..., - text: Optional[bool] = ..., - ) -> str: ... - @overload - def check_output(args: _CMD, - bufsize: int = ..., - executable: _PATH = ..., - stdin: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., - *, - timeout: Optional[float] = ..., - input: _TXT = ..., - encoding: Optional[str] = ..., - errors: str, - text: Optional[bool] = ..., - ) -> str: ... - @overload - def check_output(args: _CMD, - bufsize: int = ..., - executable: _PATH = ..., - stdin: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - *, - universal_newlines: Literal[True], - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., - # where the real keyword only ones start - timeout: Optional[float] = ..., - input: _TXT = ..., - encoding: Optional[str] = ..., - errors: Optional[str] = ..., - text: Optional[bool] = ..., - ) -> str: ... - @overload - def check_output(args: _CMD, - bufsize: int = ..., - executable: _PATH = ..., - stdin: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - universal_newlines: Literal[False] = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., - *, - timeout: Optional[float] = ..., - input: _TXT = ..., - encoding: None = ..., - errors: None = ..., - text: Literal[None, False] = ..., - ) -> bytes: ... - @overload - def check_output(args: _CMD, - bufsize: int = ..., - executable: _PATH = ..., - stdin: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., - *, - timeout: Optional[float] = ..., - input: _TXT = ..., - encoding: Optional[str] = ..., - errors: Optional[str] = ..., - text: Optional[bool] = ..., - ) -> Any: ... # morally: -> _TXT -elif sys.version_info >= (3, 6): - # 3.6 added encoding and errors - @overload - def check_output(args: _CMD, - bufsize: int = ..., - executable: _PATH = ..., - stdin: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., - *, - timeout: Optional[float] = ..., - input: _TXT = ..., - encoding: str, - errors: Optional[str] = ..., - ) -> str: ... - @overload - def check_output(args: _CMD, - bufsize: int = ..., - executable: _PATH = ..., - stdin: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., - *, - timeout: Optional[float] = ..., - input: _TXT = ..., - encoding: Optional[str] = ..., - errors: str, - ) -> str: ... - @overload - def check_output(args: _CMD, - bufsize: int = ..., - executable: _PATH = ..., - stdin: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., - *, - universal_newlines: Literal[True], - timeout: Optional[float] = ..., - input: _TXT = ..., - encoding: Optional[str] = ..., - errors: Optional[str] = ..., - ) -> str: ... +else: @overload - def check_output(args: _CMD, - bufsize: int = ..., - executable: _PATH = ..., - stdin: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - universal_newlines: Literal[False] = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., - *, - timeout: Optional[float] = ..., - input: _TXT = ..., - encoding: None = ..., - errors: None = ..., - ) -> bytes: ... + def check_output( + args: _CMD, + bufsize: int = ..., + executable: Optional[AnyPath] = ..., + stdin: _FILE = ..., + stderr: _FILE = ..., + preexec_fn: Callable[[], Any] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[AnyPath] = ..., + env: Optional[_ENV] = ..., + universal_newlines: bool = ..., + startupinfo: Any = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + *, + timeout: Optional[float] = ..., + input: _TXT = ..., + encoding: str, + errors: Optional[str] = ..., + ) -> str: ... @overload - def check_output(args: _CMD, - bufsize: int = ..., - executable: _PATH = ..., - stdin: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., - *, - timeout: Optional[float] = ..., - input: _TXT = ..., - encoding: Optional[str] = ..., - errors: Optional[str] = ..., - ) -> Any: ... # morally: -> _TXT -else: + def check_output( + args: _CMD, + bufsize: int = ..., + executable: Optional[AnyPath] = ..., + stdin: _FILE = ..., + stderr: _FILE = ..., + preexec_fn: Callable[[], Any] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[AnyPath] = ..., + env: Optional[_ENV] = ..., + universal_newlines: bool = ..., + startupinfo: Any = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + *, + timeout: Optional[float] = ..., + input: _TXT = ..., + encoding: Optional[str] = ..., + errors: str, + ) -> str: ... @overload - def check_output(args: _CMD, - bufsize: int = ..., - executable: _PATH = ..., - stdin: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., - timeout: Optional[float] = ..., - input: _TXT = ..., - *, - universal_newlines: Literal[True], - ) -> str: ... + def check_output( + args: _CMD, + bufsize: int = ..., + executable: Optional[AnyPath] = ..., + stdin: _FILE = ..., + stderr: _FILE = ..., + preexec_fn: Callable[[], Any] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[AnyPath] = ..., + env: Optional[_ENV] = ..., + startupinfo: Any = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + *, + universal_newlines: Literal[True], + timeout: Optional[float] = ..., + input: _TXT = ..., + encoding: Optional[str] = ..., + errors: Optional[str] = ..., + ) -> str: ... @overload - def check_output(args: _CMD, - bufsize: int = ..., - executable: _PATH = ..., - stdin: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - universal_newlines: Literal[False] = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., - timeout: Optional[float] = ..., - input: _TXT = ..., - ) -> bytes: ... + def check_output( + args: _CMD, + bufsize: int = ..., + executable: Optional[AnyPath] = ..., + stdin: _FILE = ..., + stderr: _FILE = ..., + preexec_fn: Callable[[], Any] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[AnyPath] = ..., + env: Optional[_ENV] = ..., + universal_newlines: Literal[False] = ..., + startupinfo: Any = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + *, + timeout: Optional[float] = ..., + input: _TXT = ..., + encoding: None = ..., + errors: None = ..., + ) -> bytes: ... @overload - def check_output(args: _CMD, - bufsize: int = ..., - executable: _PATH = ..., - stdin: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., - timeout: Optional[float] = ..., - input: _TXT = ..., - ) -> Any: ... # morally: -> _TXT - + def check_output( + args: _CMD, + bufsize: int = ..., + executable: Optional[AnyPath] = ..., + stdin: _FILE = ..., + stderr: _FILE = ..., + preexec_fn: Callable[[], Any] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[AnyPath] = ..., + env: Optional[_ENV] = ..., + universal_newlines: bool = ..., + startupinfo: Any = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + *, + timeout: Optional[float] = ..., + input: _TXT = ..., + encoding: Optional[str] = ..., + errors: Optional[str] = ..., + ) -> Any: ... # morally: -> _TXT PIPE: int STDOUT: int DEVNULL: int + class SubprocessError(Exception): ... + class TimeoutExpired(SubprocessError): def __init__(self, cmd: _CMD, timeout: float, output: Optional[_TXT] = ..., stderr: Optional[_TXT] = ...) -> None: ... # morally: _CMD @@ -812,8 +687,7 @@ class TimeoutExpired(SubprocessError): stdout: Any stderr: Any - -class CalledProcessError(Exception): +class CalledProcessError(SubprocessError): returncode: int # morally: _CMD cmd: Any @@ -823,20 +697,16 @@ class CalledProcessError(Exception): # morally: Optional[_TXT] stdout: Any stderr: Any - - def __init__(self, - returncode: int, - cmd: _CMD, - output: Optional[_TXT] = ..., - stderr: Optional[_TXT] = ...) -> None: ... + def __init__(self, returncode: int, cmd: _CMD, output: Optional[_TXT] = ..., stderr: Optional[_TXT] = ...) -> None: ... class Popen(Generic[AnyStr]): args: _CMD - stdin: IO[AnyStr] - stdout: IO[AnyStr] - stderr: IO[AnyStr] + stdin: Optional[IO[AnyStr]] + stdout: Optional[IO[AnyStr]] + stderr: Optional[IO[AnyStr]] pid: int returncode: int + universal_newlines: bool # Technically it is wrong that Popen provides __new__ instead of __init__ # but this shouldn't come up hopefully? @@ -844,341 +714,318 @@ class Popen(Generic[AnyStr]): if sys.version_info >= (3, 7): # text is added in 3.7 @overload - def __new__(cls, - args: _CMD, - bufsize: int = ..., - executable: Optional[_PATH] = ..., - stdin: Optional[_FILE] = ..., - stdout: Optional[_FILE] = ..., - stderr: Optional[_FILE] = ..., - preexec_fn: Optional[Callable[[], Any]] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - universal_newlines: bool = ..., - startupinfo: Optional[Any] = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., - *, - text: Optional[bool] = ..., - encoding: str, - errors: Optional[str] = ...) -> Popen[str]: ... + def __new__( + cls, + args: _CMD, + bufsize: int = ..., + executable: Optional[AnyPath] = ..., + stdin: Optional[_FILE] = ..., + stdout: Optional[_FILE] = ..., + stderr: Optional[_FILE] = ..., + preexec_fn: Optional[Callable[[], Any]] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[AnyPath] = ..., + env: Optional[_ENV] = ..., + universal_newlines: bool = ..., + startupinfo: Optional[Any] = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + *, + text: Optional[bool] = ..., + encoding: str, + errors: Optional[str] = ..., + ) -> Popen[str]: ... @overload - def __new__(cls, - args: _CMD, - bufsize: int = ..., - executable: Optional[_PATH] = ..., - stdin: Optional[_FILE] = ..., - stdout: Optional[_FILE] = ..., - stderr: Optional[_FILE] = ..., - preexec_fn: Optional[Callable[[], Any]] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - universal_newlines: bool = ..., - startupinfo: Optional[Any] = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., - *, - text: Optional[bool] = ..., - encoding: Optional[str] = ..., - errors: str) -> Popen[str]: ... + def __new__( + cls, + args: _CMD, + bufsize: int = ..., + executable: Optional[AnyPath] = ..., + stdin: Optional[_FILE] = ..., + stdout: Optional[_FILE] = ..., + stderr: Optional[_FILE] = ..., + preexec_fn: Optional[Callable[[], Any]] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[AnyPath] = ..., + env: Optional[_ENV] = ..., + universal_newlines: bool = ..., + startupinfo: Optional[Any] = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + *, + text: Optional[bool] = ..., + encoding: Optional[str] = ..., + errors: str, + ) -> Popen[str]: ... @overload - def __new__(cls, - args: _CMD, - bufsize: int = ..., - executable: Optional[_PATH] = ..., - stdin: Optional[_FILE] = ..., - stdout: Optional[_FILE] = ..., - stderr: Optional[_FILE] = ..., - preexec_fn: Optional[Callable[[], Any]] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - *, - universal_newlines: Literal[True], - startupinfo: Optional[Any] = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., - # where the *real* keyword only args start - text: Optional[bool] = ..., - encoding: Optional[str] = ..., - errors: Optional[str] = ...) -> Popen[str]: ... + def __new__( + cls, + args: _CMD, + bufsize: int = ..., + executable: Optional[AnyPath] = ..., + stdin: Optional[_FILE] = ..., + stdout: Optional[_FILE] = ..., + stderr: Optional[_FILE] = ..., + preexec_fn: Optional[Callable[[], Any]] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[AnyPath] = ..., + env: Optional[_ENV] = ..., + *, + universal_newlines: Literal[True], + startupinfo: Optional[Any] = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + # where the *real* keyword only args start + text: Optional[bool] = ..., + encoding: Optional[str] = ..., + errors: Optional[str] = ..., + ) -> Popen[str]: ... @overload - def __new__(cls, - args: _CMD, - bufsize: int = ..., - executable: Optional[_PATH] = ..., - stdin: Optional[_FILE] = ..., - stdout: Optional[_FILE] = ..., - stderr: Optional[_FILE] = ..., - preexec_fn: Optional[Callable[[], Any]] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - universal_newlines: bool = ..., - startupinfo: Optional[Any] = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., - *, - text: Literal[True], - encoding: Optional[str] = ..., - errors: Optional[str] = ...) -> Popen[str]: ... + def __new__( + cls, + args: _CMD, + bufsize: int = ..., + executable: Optional[AnyPath] = ..., + stdin: Optional[_FILE] = ..., + stdout: Optional[_FILE] = ..., + stderr: Optional[_FILE] = ..., + preexec_fn: Optional[Callable[[], Any]] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[AnyPath] = ..., + env: Optional[_ENV] = ..., + universal_newlines: bool = ..., + startupinfo: Optional[Any] = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + *, + text: Literal[True], + encoding: Optional[str] = ..., + errors: Optional[str] = ..., + ) -> Popen[str]: ... @overload - def __new__(cls, - args: _CMD, - bufsize: int = ..., - executable: Optional[_PATH] = ..., - stdin: Optional[_FILE] = ..., - stdout: Optional[_FILE] = ..., - stderr: Optional[_FILE] = ..., - preexec_fn: Optional[Callable[[], Any]] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - universal_newlines: Literal[False] = ..., - startupinfo: Optional[Any] = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., - *, - text: Literal[None, False] = ..., - encoding: None = ..., - errors: None = ...) -> Popen[bytes]: ... + def __new__( + cls, + args: _CMD, + bufsize: int = ..., + executable: Optional[AnyPath] = ..., + stdin: Optional[_FILE] = ..., + stdout: Optional[_FILE] = ..., + stderr: Optional[_FILE] = ..., + preexec_fn: Optional[Callable[[], Any]] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[AnyPath] = ..., + env: Optional[_ENV] = ..., + universal_newlines: Literal[False] = ..., + startupinfo: Optional[Any] = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + *, + text: Literal[None, False] = ..., + encoding: None = ..., + errors: None = ..., + ) -> Popen[bytes]: ... @overload - def __new__(cls, - args: _CMD, - bufsize: int = ..., - executable: Optional[_PATH] = ..., - stdin: Optional[_FILE] = ..., - stdout: Optional[_FILE] = ..., - stderr: Optional[_FILE] = ..., - preexec_fn: Optional[Callable[[], Any]] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - universal_newlines: bool = ..., - startupinfo: Optional[Any] = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., - *, - text: Optional[bool] = ..., - encoding: Optional[str] = ..., - errors: Optional[str] = ...) -> Popen[Any]: ... - elif sys.version_info >= (3, 6): + def __new__( + cls, + args: _CMD, + bufsize: int = ..., + executable: Optional[AnyPath] = ..., + stdin: Optional[_FILE] = ..., + stdout: Optional[_FILE] = ..., + stderr: Optional[_FILE] = ..., + preexec_fn: Optional[Callable[[], Any]] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[AnyPath] = ..., + env: Optional[_ENV] = ..., + universal_newlines: bool = ..., + startupinfo: Optional[Any] = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + *, + text: Optional[bool] = ..., + encoding: Optional[str] = ..., + errors: Optional[str] = ..., + ) -> Popen[Any]: ... + else: @overload - def __new__(cls, - args: _CMD, - bufsize: int = ..., - executable: Optional[_PATH] = ..., - stdin: Optional[_FILE] = ..., - stdout: Optional[_FILE] = ..., - stderr: Optional[_FILE] = ..., - preexec_fn: Optional[Callable[[], Any]] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - universal_newlines: bool = ..., - startupinfo: Optional[Any] = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., - *, - encoding: str, - errors: Optional[str] = ...) -> Popen[str]: ... + def __new__( + cls, + args: _CMD, + bufsize: int = ..., + executable: Optional[AnyPath] = ..., + stdin: Optional[_FILE] = ..., + stdout: Optional[_FILE] = ..., + stderr: Optional[_FILE] = ..., + preexec_fn: Optional[Callable[[], Any]] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[AnyPath] = ..., + env: Optional[_ENV] = ..., + universal_newlines: bool = ..., + startupinfo: Optional[Any] = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + *, + encoding: str, + errors: Optional[str] = ..., + ) -> Popen[str]: ... @overload - def __new__(cls, - args: _CMD, - bufsize: int = ..., - executable: Optional[_PATH] = ..., - stdin: Optional[_FILE] = ..., - stdout: Optional[_FILE] = ..., - stderr: Optional[_FILE] = ..., - preexec_fn: Optional[Callable[[], Any]] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - universal_newlines: bool = ..., - startupinfo: Optional[Any] = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., - *, - encoding: Optional[str] = ..., - errors: str) -> Popen[str]: ... + def __new__( + cls, + args: _CMD, + bufsize: int = ..., + executable: Optional[AnyPath] = ..., + stdin: Optional[_FILE] = ..., + stdout: Optional[_FILE] = ..., + stderr: Optional[_FILE] = ..., + preexec_fn: Optional[Callable[[], Any]] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[AnyPath] = ..., + env: Optional[_ENV] = ..., + universal_newlines: bool = ..., + startupinfo: Optional[Any] = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + *, + encoding: Optional[str] = ..., + errors: str, + ) -> Popen[str]: ... @overload - def __new__(cls, - args: _CMD, - bufsize: int = ..., - executable: Optional[_PATH] = ..., - stdin: Optional[_FILE] = ..., - stdout: Optional[_FILE] = ..., - stderr: Optional[_FILE] = ..., - preexec_fn: Optional[Callable[[], Any]] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - *, - universal_newlines: Literal[True], - startupinfo: Optional[Any] = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., - # where the *real* keyword only args start - encoding: Optional[str] = ..., - errors: Optional[str] = ...) -> Popen[str]: ... + def __new__( + cls, + args: _CMD, + bufsize: int = ..., + executable: Optional[AnyPath] = ..., + stdin: Optional[_FILE] = ..., + stdout: Optional[_FILE] = ..., + stderr: Optional[_FILE] = ..., + preexec_fn: Optional[Callable[[], Any]] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[AnyPath] = ..., + env: Optional[_ENV] = ..., + *, + universal_newlines: Literal[True], + startupinfo: Optional[Any] = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + # where the *real* keyword only args start + encoding: Optional[str] = ..., + errors: Optional[str] = ..., + ) -> Popen[str]: ... @overload - def __new__(cls, - args: _CMD, - bufsize: int = ..., - executable: Optional[_PATH] = ..., - stdin: Optional[_FILE] = ..., - stdout: Optional[_FILE] = ..., - stderr: Optional[_FILE] = ..., - preexec_fn: Optional[Callable[[], Any]] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - universal_newlines: Literal[False] = ..., - startupinfo: Optional[Any] = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., - *, - encoding: None = ..., - errors: None = ...) -> Popen[bytes]: ... + def __new__( + cls, + args: _CMD, + bufsize: int = ..., + executable: Optional[AnyPath] = ..., + stdin: Optional[_FILE] = ..., + stdout: Optional[_FILE] = ..., + stderr: Optional[_FILE] = ..., + preexec_fn: Optional[Callable[[], Any]] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[AnyPath] = ..., + env: Optional[_ENV] = ..., + universal_newlines: Literal[False] = ..., + startupinfo: Optional[Any] = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + *, + encoding: None = ..., + errors: None = ..., + ) -> Popen[bytes]: ... @overload - def __new__(cls, - args: _CMD, - bufsize: int = ..., - executable: Optional[_PATH] = ..., - stdin: Optional[_FILE] = ..., - stdout: Optional[_FILE] = ..., - stderr: Optional[_FILE] = ..., - preexec_fn: Optional[Callable[[], Any]] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - universal_newlines: bool = ..., - startupinfo: Optional[Any] = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., - *, - encoding: Optional[str] = ..., - errors: Optional[str] = ...) -> Popen[Any]: ... + def __new__( + cls, + args: _CMD, + bufsize: int = ..., + executable: Optional[AnyPath] = ..., + stdin: Optional[_FILE] = ..., + stdout: Optional[_FILE] = ..., + stderr: Optional[_FILE] = ..., + preexec_fn: Optional[Callable[[], Any]] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[AnyPath] = ..., + env: Optional[_ENV] = ..., + universal_newlines: bool = ..., + startupinfo: Optional[Any] = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + *, + encoding: Optional[str] = ..., + errors: Optional[str] = ..., + ) -> Popen[Any]: ... + def poll(self) -> Optional[int]: ... + if sys.version_info >= (3, 7): + def wait(self, timeout: Optional[float] = ...) -> int: ... else: - @overload - def __new__(cls, - args: _CMD, - bufsize: int = ..., - executable: Optional[_PATH] = ..., - stdin: Optional[_FILE] = ..., - stdout: Optional[_FILE] = ..., - stderr: Optional[_FILE] = ..., - preexec_fn: Optional[Callable[[], Any]] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - *, - universal_newlines: Literal[True], - startupinfo: Optional[Any] = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ...) -> Popen[str]: ... - @overload - def __new__(cls, - args: _CMD, - bufsize: int = ..., - executable: Optional[_PATH] = ..., - stdin: Optional[_FILE] = ..., - stdout: Optional[_FILE] = ..., - stderr: Optional[_FILE] = ..., - preexec_fn: Optional[Callable[[], Any]] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - *, - universal_newlines: Literal[False] = ..., - startupinfo: Optional[Any] = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ...) -> Popen[bytes]: ... - @overload - def __new__(cls, - args: _CMD, - bufsize: int = ..., - executable: Optional[_PATH] = ..., - stdin: Optional[_FILE] = ..., - stdout: Optional[_FILE] = ..., - stderr: Optional[_FILE] = ..., - preexec_fn: Optional[Callable[[], Any]] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - universal_newlines: bool = ..., - startupinfo: Optional[Any] = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ...) -> Popen[Any]: ... - - def poll(self) -> int: ... - def wait(self, timeout: Optional[float] = ...) -> int: ... + def wait(self, timeout: Optional[float] = ..., endtime: Optional[float] = ...) -> int: ... # Return str/bytes - def communicate(self, - input: Optional[AnyStr] = ..., - timeout: Optional[float] = ..., - # morally this should be optional - ) -> Tuple[AnyStr, AnyStr]: ... - def send_signal(self, signal: int) -> None: ... + def communicate( + self, + input: Optional[AnyStr] = ..., + timeout: Optional[float] = ..., + # morally this should be optional + ) -> Tuple[AnyStr, AnyStr]: ... + def send_signal(self, sig: int) -> None: ... def terminate(self) -> None: ... def kill(self) -> None: ... def __enter__(self: _S) -> _S: ... - def __exit__(self, type: Optional[Type[BaseException]], value: Optional[BaseException], traceback: Optional[TracebackType]) -> None: ... + def __exit__( + self, type: Optional[Type[BaseException]], value: Optional[BaseException], traceback: Optional[TracebackType] + ) -> None: ... + if sys.version_info >= (3, 9): + def __class_getitem__(cls, item: Any) -> GenericAlias: ... # The result really is always a str. def getstatusoutput(cmd: _TXT) -> Tuple[int, str]: ... def getoutput(cmd: _TXT) -> str: ... - def list2cmdline(seq: Sequence[str]) -> str: ... # undocumented -if sys.platform == 'win32': +if sys.platform == "win32": class STARTUPINFO: if sys.version_info >= (3, 7): - def __init__(self, *, dwFlags: int = ..., hStdInput: Optional[Any] = ..., hStdOutput: Optional[Any] = ..., hStdError: Optional[Any] = ..., wShowWindow: int = ..., lpAttributeList: Optional[Mapping[str, Any]] = ...) -> None: ... + def __init__( + self, + *, + dwFlags: int = ..., + hStdInput: Optional[Any] = ..., + hStdOutput: Optional[Any] = ..., + hStdError: Optional[Any] = ..., + wShowWindow: int = ..., + lpAttributeList: Optional[Mapping[str, Any]] = ..., + ) -> None: ... dwFlags: int hStdInput: Optional[Any] hStdOutput: Optional[Any] @@ -1186,7 +1033,6 @@ if sys.platform == 'win32': wShowWindow: int if sys.version_info >= (3, 7): lpAttributeList: Mapping[str, Any] - STD_INPUT_HANDLE: Any STD_OUTPUT_HANDLE: Any STD_ERROR_HANDLE: Any diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/symbol.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/symbol.pyi old mode 100755 new mode 100644 index 59be5776..6fbe306f --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/symbol.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/symbol.pyi @@ -1,6 +1,3 @@ -# Stubs for symbol (Python 3) - -import sys from typing import Dict single_input: int @@ -20,8 +17,7 @@ stmt: int simple_stmt: int small_stmt: int expr_stmt: int -if sys.version_info >= (3, 6): - annassign: int +annassign: int testlist_star_expr: int augassign: int del_stmt: int diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/sys.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/sys.pyi old mode 100755 new mode 100644 index 3d17a55c..dde62de3 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/sys.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/sys.pyi @@ -1,35 +1,44 @@ -# Stubs for sys -# Ron Murawski - -# based on http://docs.python.org/3.2/library/sys.html - -from typing import ( - List, NoReturn, Sequence, Any, Dict, Tuple, TextIO, overload, Optional, - Union, TypeVar, Callable, Type -) import sys +from builtins import object as _object +from importlib.abc import MetaPathFinder, PathEntryFinder from types import FrameType, ModuleType, TracebackType +from typing import ( + Any, + AsyncGenerator, + Callable, + Dict, + List, + NoReturn, + Optional, + Sequence, + TextIO, + Tuple, + Type, + TypeVar, + Union, + overload, +) -from importlib.abc import MetaPathFinder - -_T = TypeVar('_T') +_T = TypeVar("_T") # The following type alias are stub-only and do not exist during runtime _ExcInfo = Tuple[Type[BaseException], BaseException, TracebackType] _OptExcInfo = Union[_ExcInfo, Tuple[None, None, None]] # ----- sys variables ----- -abiflags: str +if sys.platform != "win32": + abiflags: str argv: List[str] base_exec_prefix: str base_prefix: str byteorder: str builtin_module_names: Sequence[str] # actually a tuple of strings copyright: str -# dllhandle = 0 # Windows only +if sys.platform == "win32": + dllhandle: int dont_write_bytecode: bool -__displayhook__: Any # contains the original value of displayhook -__excepthook__: Any # contains the original value of excepthook +displayhook: Callable[[object], Any] +excepthook: Callable[[Type[BaseException], BaseException, TracebackType], Any] exec_prefix: str executable: str float_repr_style: str @@ -43,8 +52,10 @@ meta_path: List[MetaPathFinder] modules: Dict[str, ModuleType] path: List[str] path_hooks: List[Any] # TODO precise type; function, path to finder -path_importer_cache: Dict[str, Any] # TODO precise type +path_importer_cache: Dict[str, Optional[PathEntryFinder]] platform: str +if sys.version_info >= (3, 9): + platlibdir: str prefix: str if sys.version_info >= (3, 8): pycache_prefix: Optional[str] @@ -62,11 +73,12 @@ api_version: int warnoptions: Any # Each entry is a tuple of the form (action, message, category, module, # lineno) -# winver = '' # Windows only +if sys.platform == "win32": + winver: str _xoptions: Dict[Any, Any] - flags: _flags + class _flags: debug: int division_warning: int @@ -86,20 +98,22 @@ class _flags: utf8_mode: int float_info: _float_info + class _float_info: - epsilon: float # DBL_EPSILON - dig: int # DBL_DIG - mant_dig: int # DBL_MANT_DIG - max: float # DBL_MAX - max_exp: int # DBL_MAX_EXP + epsilon: float # DBL_EPSILON + dig: int # DBL_DIG + mant_dig: int # DBL_MANT_DIG + max: float # DBL_MAX + max_exp: int # DBL_MAX_EXP max_10_exp: int # DBL_MAX_10_EXP - min: float # DBL_MIN - min_exp: int # DBL_MIN_EXP + min: float # DBL_MIN + min_exp: int # DBL_MIN_EXP min_10_exp: int # DBL_MIN_10_EXP - radix: int # FLT_RADIX - rounds: int # FLT_ROUNDS + radix: int # FLT_RADIX + rounds: int # FLT_ROUNDS hash_info: _hash_info + class _hash_info: width: int modulus: int @@ -108,6 +122,7 @@ class _hash_info: imag: int implementation: _implementation + class _implementation: name: str version: _version_info @@ -115,6 +130,7 @@ class _implementation: cache_tag: str int_info: _int_info + class _int_info: bits_per_digit: int sizeof_digit: int @@ -125,51 +141,46 @@ class _version_info(Tuple[int, int, int, str, int]): micro: int releaselevel: str serial: int + version_info: _version_info -def call_tracing(fn: Callable[..., _T], args: Any) -> _T: ... +def call_tracing(__func: Callable[..., _T], __args: Any) -> _T: ... def _clear_type_cache() -> None: ... def _current_frames() -> Dict[int, Any]: ... def _debugmallocstats() -> None: ... -def displayhook(value: Optional[int]) -> None: ... -def excepthook(type_: Type[BaseException], value: BaseException, - traceback: TracebackType) -> None: ... +def __displayhook__(value: object) -> None: ... +def __excepthook__(type_: Type[BaseException], value: BaseException, traceback: TracebackType) -> None: ... def exc_info() -> _OptExcInfo: ... + # sys.exit() accepts an optional argument of anything printable -def exit(arg: object = ...) -> NoReturn: ... -def getcheckinterval() -> int: ... # deprecated +def exit(__status: object = ...) -> NoReturn: ... def getdefaultencoding() -> str: ... -if sys.platform != 'win32': - # Unix only + +if sys.platform != "win32": def getdlopenflags() -> int: ... + def getfilesystemencoding() -> str: ... -def getrefcount(arg: Any) -> int: ... +def getfilesystemencodeerrors() -> str: ... +def getrefcount(__object: Any) -> int: ... def getrecursionlimit() -> int: ... - @overload def getsizeof(obj: object) -> int: ... @overload def getsizeof(obj: object, default: int) -> int: ... - def getswitchinterval() -> float: ... - -@overload -def _getframe() -> FrameType: ... -@overload -def _getframe(depth: int) -> FrameType: ... +def _getframe(__depth: int = ...) -> FrameType: ... _ProfileFunc = Callable[[FrameType, str, Any], Any] + def getprofile() -> Optional[_ProfileFunc]: ... def setprofile(profilefunc: Optional[_ProfileFunc]) -> None: ... _TraceFunc = Callable[[FrameType, str, Any], Optional[Callable[[FrameType, str, Any], Any]]] + def gettrace() -> Optional[_TraceFunc]: ... def settrace(tracefunc: Optional[_TraceFunc]) -> None: ... - -class _WinVersion(Tuple[int, int, int, int, - str, int, int, int, int, - Tuple[int, int, int]]): +class _WinVersion(Tuple[int, int, int, int, str, int, int, int, int, Tuple[int, int, int]]): major: int minor: int build: int @@ -181,25 +192,27 @@ class _WinVersion(Tuple[int, int, int, int, product_type: int platform_version: Tuple[int, int, int] +if sys.platform == "win32": + def getwindowsversion() -> _WinVersion: ... -def getwindowsversion() -> _WinVersion: ... # Windows only - -def intern(string: str) -> str: ... - +def intern(__string: str) -> str: ... def is_finalizing() -> bool: ... if sys.version_info >= (3, 7): __breakpointhook__: Any # contains the original value of breakpointhook def breakpointhook(*args: Any, **kwargs: Any) -> Any: ... -def setcheckinterval(interval: int) -> None: ... # deprecated -def setdlopenflags(n: int) -> None: ... # Linux only -def setrecursionlimit(limit: int) -> None: ... -def setswitchinterval(interval: float) -> None: ... -def settscdump(on_flag: bool) -> None: ... +if sys.platform != "win32": + def setdlopenflags(__flags: int) -> None: ... +def setrecursionlimit(__limit: int) -> None: ... +def setswitchinterval(__interval: float) -> None: ... def gettotalrefcount() -> int: ... # Debug builds only +if sys.version_info < (3, 9): + def getcheckinterval() -> int: ... # deprecated + def setcheckinterval(__n: int) -> None: ... # deprecated + if sys.version_info >= (3, 8): # not exported by sys class UnraisableHookArgs: @@ -207,7 +220,16 @@ if sys.version_info >= (3, 8): exc_value: Optional[BaseException] exc_traceback: Optional[TracebackType] err_msg: Optional[str] - object: Optional[object] + object: Optional[_object] unraisablehook: Callable[[UnraisableHookArgs], Any] def addaudithook(hook: Callable[[str, Tuple[Any, ...]], Any]) -> None: ... def audit(__event: str, *args: Any) -> None: ... + +_AsyncgenHook = Optional[Callable[[AsyncGenerator[Any, Any]], None]] + +class _asyncgen_hooks(Tuple[_AsyncgenHook, _AsyncgenHook]): + firstiter: _AsyncgenHook + finalizer: _AsyncgenHook + +def get_asyncgen_hooks() -> _asyncgen_hooks: ... +def set_asyncgen_hooks(firstiter: _AsyncgenHook = ..., finalizer: _AsyncgenHook = ...) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/tempfile.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/tempfile.pyi old mode 100755 new mode 100644 index 6ee70d11..7b87fd46 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/tempfile.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/tempfile.pyi @@ -1,17 +1,11 @@ -# Stubs for tempfile -# Ron Murawski - -# based on http://docs.python.org/3.3/library/tempfile.html - import os import sys from types import TracebackType -from typing import Any, AnyStr, Generic, IO, Iterable, Iterator, List, Optional, overload, Tuple, Type, TypeVar, Union +from typing import IO, Any, AnyStr, Generic, Iterable, Iterator, List, Optional, Tuple, Type, TypeVar, Union, overload +from typing_extensions import Literal -if sys.version_info >= (3, 8): - from typing import Literal -else: - from typing_extensions import Literal +if sys.version_info >= (3, 9): + from types import GenericAlias # global variables TMP_MAX: int @@ -20,115 +14,242 @@ template: str _S = TypeVar("_S") _T = TypeVar("_T") # for pytype, define typevar in same file as alias -if sys.version_info >= (3, 6): - _DirT = Union[_T, os.PathLike[_T]] -else: - _DirT = Union[_T] - -@overload -def TemporaryFile( - mode: Literal["r", "w", "a", "x", "r+", "w+", "a+", "x+", "rt", "wt", "at", "xt", "r+t", "w+t", "a+t", "x+t"], - buffering: int = ..., - encoding: Optional[str] = ..., - newline: Optional[str] = ..., - suffix: Optional[AnyStr] = ..., - prefix: Optional[AnyStr] = ..., - dir: Optional[_DirT[AnyStr]] = ..., -) -> IO[str]: ... -@overload -def TemporaryFile( - mode: Literal["rb", "wb", "ab", "xb", "r+b", "w+b", "a+b", "x+b"] = ..., - buffering: int = ..., - encoding: Optional[str] = ..., - newline: Optional[str] = ..., - suffix: Optional[AnyStr] = ..., - prefix: Optional[AnyStr] = ..., - dir: Optional[_DirT[AnyStr]] = ..., -) -> IO[bytes]: ... -@overload -def TemporaryFile( - mode: str = ..., - buffering: int = ..., - encoding: Optional[str] = ..., - newline: Optional[str] = ..., - suffix: Optional[AnyStr] = ..., - prefix: Optional[AnyStr] = ..., - dir: Optional[_DirT[AnyStr]] = ..., -) -> IO[Any]: ... -@overload -def NamedTemporaryFile( - mode: Literal["r", "w", "a", "x", "r+", "w+", "a+", "x+", "rt", "wt", "at", "xt", "r+t", "w+t", "a+t", "x+t"], - buffering: int = ..., - encoding: Optional[str] = ..., - newline: Optional[str] = ..., - suffix: Optional[AnyStr] = ..., - prefix: Optional[AnyStr] = ..., - dir: Optional[_DirT[AnyStr]] = ..., - delete: bool = ..., -) -> IO[str]: ... -@overload -def NamedTemporaryFile( - mode: Literal["rb", "wb", "ab", "xb", "r+b", "w+b", "a+b", "x+b"] = ..., - buffering: int = ..., - encoding: Optional[str] = ..., - newline: Optional[str] = ..., - suffix: Optional[AnyStr] = ..., - prefix: Optional[AnyStr] = ..., - dir: Optional[_DirT[AnyStr]] = ..., - delete: bool = ..., -) -> IO[bytes]: ... -@overload -def NamedTemporaryFile( - mode: str = ..., - buffering: int = ..., - encoding: Optional[str] = ..., - newline: Optional[str] = ..., - suffix: Optional[AnyStr] = ..., - prefix: Optional[AnyStr] = ..., - dir: Optional[_DirT[AnyStr]] = ..., - delete: bool = ..., -) -> IO[Any]: ... +_DirT = Union[_T, os.PathLike[_T]] -# It does not actually derive from IO[AnyStr], but it does implement the -# protocol. -class SpooledTemporaryFile(IO[AnyStr]): - # bytes needs to go first, as default mode is to open as bytes +if sys.version_info >= (3, 8): @overload - def __init__( - self: SpooledTemporaryFile[bytes], - max_size: int = ..., + def NamedTemporaryFile( + mode: Literal["r", "w", "a", "x", "r+", "w+", "a+", "x+", "rt", "wt", "at", "xt", "r+t", "w+t", "a+t", "x+t"], + buffering: int = ..., + encoding: Optional[str] = ..., + newline: Optional[str] = ..., + suffix: Optional[AnyStr] = ..., + prefix: Optional[AnyStr] = ..., + dir: Optional[_DirT[AnyStr]] = ..., + delete: bool = ..., + *, + errors: Optional[str] = ..., + ) -> IO[str]: ... + @overload + def NamedTemporaryFile( mode: Literal["rb", "wb", "ab", "xb", "r+b", "w+b", "a+b", "x+b"] = ..., buffering: int = ..., encoding: Optional[str] = ..., newline: Optional[str] = ..., - suffix: Optional[str] = ..., - prefix: Optional[str] = ..., - dir: Optional[str] = ..., - ) -> None: ... + suffix: Optional[AnyStr] = ..., + prefix: Optional[AnyStr] = ..., + dir: Optional[_DirT[AnyStr]] = ..., + delete: bool = ..., + *, + errors: Optional[str] = ..., + ) -> IO[bytes]: ... @overload - def __init__( - self: SpooledTemporaryFile[str], - max_size: int = ..., - mode: Literal["r", "w", "a", "x", "r+", "w+", "a+", "x+", "rt", "wt", "at", "xt", "r+t", "w+t", "a+t", "x+t"] = ..., + def NamedTemporaryFile( + mode: str = ..., buffering: int = ..., encoding: Optional[str] = ..., newline: Optional[str] = ..., - suffix: Optional[str] = ..., - prefix: Optional[str] = ..., - dir: Optional[str] = ..., - ) -> None: ... + suffix: Optional[AnyStr] = ..., + prefix: Optional[AnyStr] = ..., + dir: Optional[_DirT[AnyStr]] = ..., + delete: bool = ..., + *, + errors: Optional[str] = ..., + ) -> IO[Any]: ... + +else: @overload - def __init__( - self, - max_size: int = ..., + def NamedTemporaryFile( + mode: Literal["r", "w", "a", "x", "r+", "w+", "a+", "x+", "rt", "wt", "at", "xt", "r+t", "w+t", "a+t", "x+t"], + buffering: int = ..., + encoding: Optional[str] = ..., + newline: Optional[str] = ..., + suffix: Optional[AnyStr] = ..., + prefix: Optional[AnyStr] = ..., + dir: Optional[_DirT[AnyStr]] = ..., + delete: bool = ..., + ) -> IO[str]: ... + @overload + def NamedTemporaryFile( + mode: Literal["rb", "wb", "ab", "xb", "r+b", "w+b", "a+b", "x+b"] = ..., + buffering: int = ..., + encoding: Optional[str] = ..., + newline: Optional[str] = ..., + suffix: Optional[AnyStr] = ..., + prefix: Optional[AnyStr] = ..., + dir: Optional[_DirT[AnyStr]] = ..., + delete: bool = ..., + ) -> IO[bytes]: ... + @overload + def NamedTemporaryFile( mode: str = ..., buffering: int = ..., encoding: Optional[str] = ..., newline: Optional[str] = ..., - suffix: Optional[str] = ..., - prefix: Optional[str] = ..., - dir: Optional[str] = ..., - ) -> None: ... + suffix: Optional[AnyStr] = ..., + prefix: Optional[AnyStr] = ..., + dir: Optional[_DirT[AnyStr]] = ..., + delete: bool = ..., + ) -> IO[Any]: ... + +if sys.platform == "win32": + TemporaryFile = NamedTemporaryFile +else: + if sys.version_info >= (3, 8): + @overload + def TemporaryFile( + mode: Literal["r", "w", "a", "x", "r+", "w+", "a+", "x+", "rt", "wt", "at", "xt", "r+t", "w+t", "a+t", "x+t"], + buffering: int = ..., + encoding: Optional[str] = ..., + newline: Optional[str] = ..., + suffix: Optional[AnyStr] = ..., + prefix: Optional[AnyStr] = ..., + dir: Optional[_DirT[AnyStr]] = ..., + *, + errors: Optional[str] = ..., + ) -> IO[str]: ... + @overload + def TemporaryFile( + mode: Literal["rb", "wb", "ab", "xb", "r+b", "w+b", "a+b", "x+b"] = ..., + buffering: int = ..., + encoding: Optional[str] = ..., + newline: Optional[str] = ..., + suffix: Optional[AnyStr] = ..., + prefix: Optional[AnyStr] = ..., + dir: Optional[_DirT[AnyStr]] = ..., + *, + errors: Optional[str] = ..., + ) -> IO[bytes]: ... + @overload + def TemporaryFile( + mode: str = ..., + buffering: int = ..., + encoding: Optional[str] = ..., + newline: Optional[str] = ..., + suffix: Optional[AnyStr] = ..., + prefix: Optional[AnyStr] = ..., + dir: Optional[_DirT[AnyStr]] = ..., + *, + errors: Optional[str] = ..., + ) -> IO[Any]: ... + else: + @overload + def TemporaryFile( + mode: Literal["r", "w", "a", "x", "r+", "w+", "a+", "x+", "rt", "wt", "at", "xt", "r+t", "w+t", "a+t", "x+t"], + buffering: int = ..., + encoding: Optional[str] = ..., + newline: Optional[str] = ..., + suffix: Optional[AnyStr] = ..., + prefix: Optional[AnyStr] = ..., + dir: Optional[_DirT[AnyStr]] = ..., + ) -> IO[str]: ... + @overload + def TemporaryFile( + mode: Literal["rb", "wb", "ab", "xb", "r+b", "w+b", "a+b", "x+b"] = ..., + buffering: int = ..., + encoding: Optional[str] = ..., + newline: Optional[str] = ..., + suffix: Optional[AnyStr] = ..., + prefix: Optional[AnyStr] = ..., + dir: Optional[_DirT[AnyStr]] = ..., + ) -> IO[bytes]: ... + @overload + def TemporaryFile( + mode: str = ..., + buffering: int = ..., + encoding: Optional[str] = ..., + newline: Optional[str] = ..., + suffix: Optional[AnyStr] = ..., + prefix: Optional[AnyStr] = ..., + dir: Optional[_DirT[AnyStr]] = ..., + ) -> IO[Any]: ... + +# It does not actually derive from IO[AnyStr], but it does implement the +# protocol. +class SpooledTemporaryFile(IO[AnyStr]): + # bytes needs to go first, as default mode is to open as bytes + if sys.version_info >= (3, 8): + @overload + def __init__( + self: SpooledTemporaryFile[bytes], + max_size: int = ..., + mode: Literal["rb", "wb", "ab", "xb", "r+b", "w+b", "a+b", "x+b"] = ..., + buffering: int = ..., + encoding: Optional[str] = ..., + newline: Optional[str] = ..., + suffix: Optional[str] = ..., + prefix: Optional[str] = ..., + dir: Optional[str] = ..., + *, + errors: Optional[str] = ..., + ) -> None: ... + @overload + def __init__( + self: SpooledTemporaryFile[str], + max_size: int = ..., + mode: Literal["r", "w", "a", "x", "r+", "w+", "a+", "x+", "rt", "wt", "at", "xt", "r+t", "w+t", "a+t", "x+t"] = ..., + buffering: int = ..., + encoding: Optional[str] = ..., + newline: Optional[str] = ..., + suffix: Optional[str] = ..., + prefix: Optional[str] = ..., + dir: Optional[str] = ..., + *, + errors: Optional[str] = ..., + ) -> None: ... + @overload + def __init__( + self, + max_size: int = ..., + mode: str = ..., + buffering: int = ..., + encoding: Optional[str] = ..., + newline: Optional[str] = ..., + suffix: Optional[str] = ..., + prefix: Optional[str] = ..., + dir: Optional[str] = ..., + *, + errors: Optional[str] = ..., + ) -> None: ... + @property + def errors(self) -> Optional[str]: ... + else: + @overload + def __init__( + self: SpooledTemporaryFile[bytes], + max_size: int = ..., + mode: Literal["rb", "wb", "ab", "xb", "r+b", "w+b", "a+b", "x+b"] = ..., + buffering: int = ..., + encoding: Optional[str] = ..., + newline: Optional[str] = ..., + suffix: Optional[str] = ..., + prefix: Optional[str] = ..., + dir: Optional[str] = ..., + ) -> None: ... + @overload + def __init__( + self: SpooledTemporaryFile[str], + max_size: int = ..., + mode: Literal["r", "w", "a", "x", "r+", "w+", "a+", "x+", "rt", "wt", "at", "xt", "r+t", "w+t", "a+t", "x+t"] = ..., + buffering: int = ..., + encoding: Optional[str] = ..., + newline: Optional[str] = ..., + suffix: Optional[str] = ..., + prefix: Optional[str] = ..., + dir: Optional[str] = ..., + ) -> None: ... + @overload + def __init__( + self, + max_size: int = ..., + mode: str = ..., + buffering: int = ..., + encoding: Optional[str] = ..., + newline: Optional[str] = ..., + suffix: Optional[str] = ..., + prefix: Optional[str] = ..., + dir: Optional[str] = ..., + ) -> None: ... def rollover(self) -> None: ... def __enter__(self: _S) -> _S: ... def __exit__( @@ -142,18 +263,19 @@ class SpooledTemporaryFile(IO[AnyStr]): def flush(self) -> None: ... def isatty(self) -> bool: ... def read(self, n: int = ...) -> AnyStr: ... - def readable(self) -> bool: ... def readline(self, limit: int = ...) -> AnyStr: ... def readlines(self, hint: int = ...) -> List[AnyStr]: ... def seek(self, offset: int, whence: int = ...) -> int: ... - def seekable(self) -> bool: ... def tell(self) -> int: ... def truncate(self, size: Optional[int] = ...) -> int: ... - def writable(self) -> bool: ... def write(self, s: AnyStr) -> int: ... - def writelines(self, lines: Iterable[AnyStr]) -> None: ... - def __next__(self) -> AnyStr: ... + def writelines(self, iterable: Iterable[AnyStr]) -> None: ... def __iter__(self) -> Iterator[AnyStr]: ... + # Other than the following methods, which do not exist on SpooledTemporaryFile + def readable(self) -> bool: ... + def seekable(self) -> bool: ... + def writable(self) -> bool: ... + def __next__(self) -> AnyStr: ... class TemporaryDirectory(Generic[AnyStr]): name: str @@ -165,6 +287,8 @@ class TemporaryDirectory(Generic[AnyStr]): def __exit__( self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType] ) -> None: ... + if sys.version_info >= (3, 9): + def __class_getitem__(cls, item: Any) -> GenericAlias: ... def mkstemp( suffix: Optional[AnyStr] = ..., prefix: Optional[AnyStr] = ..., dir: Optional[_DirT[AnyStr]] = ..., text: bool = ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/textwrap.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/textwrap.pyi old mode 100755 new mode 100644 index f61f975b..0fd80bcb --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/textwrap.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/textwrap.pyi @@ -1,4 +1,4 @@ -from typing import Callable, List, Optional, Dict, Pattern +from typing import Callable, Dict, List, Optional, Pattern class TextWrapper: width: int = ... @@ -21,25 +21,23 @@ class TextWrapper: whitespace_trans: str = ... unicode_whitespace_trans: Dict[int, int] = ... uspace: int = ... - x: int = ... - + x: str = ... # leaked loop variable def __init__( - self, - width: int = ..., - initial_indent: str = ..., - subsequent_indent: str = ..., - expand_tabs: bool = ..., - replace_whitespace: bool = ..., - fix_sentence_endings: bool = ..., - break_long_words: bool = ..., - drop_whitespace: bool = ..., - break_on_hyphens: bool = ..., - tabsize: int = ..., - *, - max_lines: Optional[int] = ..., - placeholder: str = ...) -> None: - ... - + self, + width: int = ..., + initial_indent: str = ..., + subsequent_indent: str = ..., + expand_tabs: bool = ..., + replace_whitespace: bool = ..., + fix_sentence_endings: bool = ..., + break_long_words: bool = ..., + drop_whitespace: bool = ..., + break_on_hyphens: bool = ..., + tabsize: int = ..., + *, + max_lines: Optional[int] = ..., + placeholder: str = ..., + ) -> None: ... # Private methods *are* part of the documented API for subclasses. def _munge_whitespace(self, text: str) -> str: ... def _split(self, text: str) -> List[str]: ... @@ -47,67 +45,56 @@ class TextWrapper: def _handle_long_word(self, reversed_chunks: List[str], cur_line: List[str], cur_len: int, width: int) -> None: ... def _wrap_chunks(self, chunks: List[str]) -> List[str]: ... def _split_chunks(self, text: str) -> List[str]: ... - def wrap(self, text: str) -> List[str]: ... def fill(self, text: str) -> str: ... - def wrap( - text: str = ..., - width: int = ..., - *, - initial_indent: str = ..., - subsequent_indent: str = ..., - expand_tabs: bool = ..., - tabsize: int = ..., - replace_whitespace: bool = ..., - fix_sentence_endings: bool = ..., - break_long_words: bool = ..., - break_on_hyphens: bool = ..., - drop_whitespace: bool = ..., - max_lines: int = ..., - placeholder: str = ... -) -> List[str]: - ... - + text: str, + width: int = ..., + *, + initial_indent: str = ..., + subsequent_indent: str = ..., + expand_tabs: bool = ..., + tabsize: int = ..., + replace_whitespace: bool = ..., + fix_sentence_endings: bool = ..., + break_long_words: bool = ..., + break_on_hyphens: bool = ..., + drop_whitespace: bool = ..., + max_lines: int = ..., + placeholder: str = ..., +) -> List[str]: ... def fill( - text: str, - width: int = ..., - *, - initial_indent: str = ..., - subsequent_indent: str = ..., - expand_tabs: bool = ..., - tabsize: int = ..., - replace_whitespace: bool = ..., - fix_sentence_endings: bool = ..., - break_long_words: bool = ..., - break_on_hyphens: bool = ..., - drop_whitespace: bool = ..., - max_lines: int = ..., - placeholder: str = ... -) -> str: - ... - + text: str, + width: int = ..., + *, + initial_indent: str = ..., + subsequent_indent: str = ..., + expand_tabs: bool = ..., + tabsize: int = ..., + replace_whitespace: bool = ..., + fix_sentence_endings: bool = ..., + break_long_words: bool = ..., + break_on_hyphens: bool = ..., + drop_whitespace: bool = ..., + max_lines: int = ..., + placeholder: str = ..., +) -> str: ... def shorten( - text: str, - width: int, - *, - initial_indent: str = ..., - subsequent_indent: str = ..., - expand_tabs: bool = ..., - tabsize: int = ..., - replace_whitespace: bool = ..., - fix_sentence_endings: bool = ..., - break_long_words: bool = ..., - break_on_hyphens: bool = ..., - drop_whitespace: bool = ..., - # Omit `max_lines: int = None`, it is forced to 1 here. - placeholder: str = ... -) -> str: - ... - -def dedent(text: str) -> str: - ... - -def indent(text: str, prefix: str, predicate: Callable[[str], bool] = ...) -> str: - ... + text: str, + width: int, + *, + initial_indent: str = ..., + subsequent_indent: str = ..., + expand_tabs: bool = ..., + tabsize: int = ..., + replace_whitespace: bool = ..., + fix_sentence_endings: bool = ..., + break_long_words: bool = ..., + break_on_hyphens: bool = ..., + drop_whitespace: bool = ..., + # Omit `max_lines: int = None`, it is forced to 1 here. + placeholder: str = ..., +) -> str: ... +def dedent(text: str) -> str: ... +def indent(text: str, prefix: str, predicate: Optional[Callable[[str], bool]] = ...) -> str: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/tkinter/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/tkinter/__init__.pyi old mode 100755 new mode 100644 index 157ad296..1634089d --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/tkinter/__init__.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/tkinter/__init__.pyi @@ -1,49 +1,216 @@ +import _tkinter import sys +from enum import Enum +from tkinter.constants import * # comment this out to find undefined identifier names with flake8 +from tkinter.font import _FontDescription from types import TracebackType -from typing import Any, Optional, Dict, Callable, Tuple, Type, Union -from tkinter.constants import * # noqa: F403 +from typing import Any, Callable, Dict, Generic, List, Mapping, Optional, Protocol, Tuple, Type, TypeVar, Union, overload +from typing_extensions import Literal, TypedDict -TclError: Any +# Using anything from tkinter.font in this file means that 'import tkinter' +# seems to also load tkinter.font. That's not how it actually works, but +# unfortunately not much can be done about it. https://github.com/python/typeshed/pull/4346 + +TclError = _tkinter.TclError wantobjects: Any TkVersion: Any TclVersion: Any -READABLE: Any -WRITABLE: Any -EXCEPTION: Any +READABLE = _tkinter.READABLE +WRITABLE = _tkinter.WRITABLE +EXCEPTION = _tkinter.EXCEPTION + +# Quick guide for figuring out which widget class to choose: +# - Misc: any widget (don't use BaseWidget because Tk doesn't inherit from BaseWidget) +# - Widget: anything that is meant to be put into another widget with e.g. pack or grid +# - Wm: a toplevel window, Tk or Toplevel +# +# Instructions for figuring out the correct type of each widget option: +# - See discussion on #4363. +# +# - Find the option from the manual page of the widget. Usually the manual +# page of a non-ttk widget has the same name as the tkinter class, in the +# 3tk section: +# +# $ sudo apt install tk-doc +# $ man 3tk label +# +# Ttk manual pages tend to have ttk_ prefixed names: +# +# $ man 3tk ttk_label +# +# Non-GUI things like the .after() method are often in the 3tcl section: +# +# $ sudo apt install tcl-doc +# $ man 3tcl after +# +# If you don't have man or apt, you can read these manual pages online: +# +# https://www.tcl.tk/doc/ +# +# Every option has '-' in front of its name in the manual page (and in Tcl). +# For example, there's an option named '-text' in the label manual page. +# +# - Tkinter has some options documented in docstrings, but don't rely on them. +# They aren't updated when a new version of Tk comes out, so the latest Tk +# manual pages (see above) are much more likely to actually contain all +# possible options. +# +# Also, reading tkinter's source code typically won't help much because it +# uses a lot of **kwargs and duck typing. Typically every argument goes into +# self.tk.call, which is _tkinter.TkappType.call, and the return value is +# whatever that returns. The type of that depends on how the Tcl interpreter +# represents the return value of the executed Tcl code. +# +# - If you think that int is an appropriate type for something, then you may +# actually want _ScreenUnits instead. +# +# - If you think that Callable[something] is an appropriate type for +# something, then you may actually want Union[Callable[something], str], +# because it's often possible to specify a string of Tcl code. +# +# - Some options can be set only in __init__, but all options are available +# when getting their values with configure's return value or cget. +# +# - Asks other tkinter users if you haven't worked much with tkinter. + +# _TkinterSequence[T] represents a sequence that tkinter understands. It +# differs from typing.Sequence[T]. For example, collections.deque a valid +# Sequence but not a valid _TkinterSequence: +# +# >>> tkinter.Label(font=('Helvetica', 12, collections.deque(['bold']))) +# Traceback (most recent call last): +# ... +# _tkinter.TclError: unknown font style "deque(['bold'])" +_T = TypeVar("_T") +_TkinterSequence = Union[List[_T], Tuple[_T, ...]] + +# Some widgets have an option named -compound that accepts different values +# than the _Compound defined here. Many other options have similar things. +_Anchor = Literal["nw", "n", "ne", "w", "center", "e", "sw", "s", "se"] # manual page: Tk_GetAnchor +_Bitmap = str # manual page: Tk_GetBitmap +_ButtonCommand = Union[str, Callable[[], Any]] # return value is returned from Button.invoke() +_Color = str # typically '#rrggbb', '#rgb' or color names. +_Compound = Literal["top", "left", "center", "right", "bottom", "none"] # -compound in manual page named 'options' +_Cursor = Union[str, Tuple[str], Tuple[str, str], Tuple[str, str, str], Tuple[str, str, str, str]] # manual page: Tk_GetCursor +_EntryValidateCommand = Union[ + Callable[[], bool], str, _TkinterSequence[str] +] # example when it's sequence: entry['invalidcommand'] = [entry.register(print), '%P'] +_ImageSpec = Union[_Image, str] # str can be from e.g. tkinter.image_names() +_Padding = Union[ + _ScreenUnits, + Tuple[_ScreenUnits], + Tuple[_ScreenUnits, _ScreenUnits], + Tuple[_ScreenUnits, _ScreenUnits, _ScreenUnits], + Tuple[_ScreenUnits, _ScreenUnits, _ScreenUnits, _ScreenUnits], +] +_Relief = Literal["raised", "sunken", "flat", "ridge", "solid", "groove"] # manual page: Tk_GetRelief +_ScreenUnits = Union[str, float] # manual page: Tk_GetPixels +_XYScrollCommand = Union[str, Callable[[float, float], Any]] # -xscrollcommand and -yscrollcommand in 'options' manual page +_TakeFocusValue = Union[int, Literal[""], Callable[[str], Optional[bool]]] # -takefocus in manual page named 'options' -class Event: ... +class EventType(str, Enum): + Activate: str = ... + ButtonPress: str = ... + ButtonRelease: str = ... + Circulate: str = ... + CirculateRequest: str = ... + ClientMessage: str = ... + Colormap: str = ... + Configure: str = ... + ConfigureRequest: str = ... + Create: str = ... + Deactivate: str = ... + Destroy: str = ... + Enter: str = ... + Expose: str = ... + FocusIn: str = ... + FocusOut: str = ... + GraphicsExpose: str = ... + Gravity: str = ... + KeyPress: str = ... + KeyRelease: str = ... + Keymap: str = ... + Leave: str = ... + Map: str = ... + MapRequest: str = ... + Mapping: str = ... + Motion: str = ... + MouseWheel: str = ... + NoExpose: str = ... + Property: str = ... + Reparent: str = ... + ResizeRequest: str = ... + Selection: str = ... + SelectionClear: str = ... + SelectionRequest: str = ... + Unmap: str = ... + VirtualEvent: str = ... + Visibility: str = ... + +# Events considered covariant because you should never assign to event.widget. +_W = TypeVar("_W", covariant=True, bound="Misc") + +class Event(Generic[_W]): + serial: int + num: int + focus: bool + height: int + width: int + keycode: int + state: Union[int, str] + time: int + x: int + y: int + x_root: int + y_root: int + char: str + send_event: bool + keysym: str + keysym_num: int + type: EventType + widget: _W + delta: int def NoDefaultRoot(): ... +_TraceMode = Literal["array", "read", "write", "unset"] + class Variable: - def __init__(self, master: Optional[Any] = ..., value: Optional[Any] = ..., name: Optional[Any] = ...): ... - def __del__(self): ... - def set(self, value): ... - initialize: Any - def get(self): ... - def trace_variable(self, mode, callback): ... - trace: Any - def trace_vdelete(self, mode, cbname): ... - def trace_vinfo(self): ... - def __eq__(self, other): ... + def __init__(self, master: Optional[Misc] = ..., value: Optional[Any] = ..., name: Optional[str] = ...) -> None: ... + def set(self, value: Any) -> None: ... + initialize = set + def get(self) -> Any: ... + def trace_add(self, mode: _TraceMode, callback: Callable[[str, str, str], Any]) -> str: ... + def trace_remove(self, mode: _TraceMode, cbname: str) -> None: ... + def trace_info(self) -> List[Tuple[Tuple[_TraceMode, ...], str]]: ... + def trace_variable(self, mode, callback): ... # deprecated + def trace_vdelete(self, mode, cbname): ... # deprecated + def trace_vinfo(self): ... # deprecated + trace = trace_variable # deprecated class StringVar(Variable): - def __init__(self, master: Optional[Any] = ..., value: Optional[Any] = ..., name: Optional[Any] = ...): ... - def get(self): ... + def __init__(self, master: Optional[Misc] = ..., value: Optional[str] = ..., name: Optional[str] = ...) -> None: ... + def set(self, value: str) -> None: ... + initialize = set + def get(self) -> str: ... class IntVar(Variable): - def __init__(self, master: Optional[Any] = ..., value: Optional[Any] = ..., name: Optional[Any] = ...): ... - def get(self): ... + def __init__(self, master: Optional[Misc] = ..., value: Optional[int] = ..., name: Optional[str] = ...) -> None: ... + def set(self, value: int) -> None: ... + initialize = set + def get(self) -> int: ... class DoubleVar(Variable): - def __init__(self, master: Optional[Any] = ..., value: Optional[Any] = ..., name: Optional[Any] = ...): ... - def get(self): ... + def __init__(self, master: Optional[Misc] = ..., value: Optional[float] = ..., name: Optional[str] = ...) -> None: ... + def set(self, value: float) -> None: ... + initialize = set + def get(self) -> float: ... class BooleanVar(Variable): - def __init__(self, master: Optional[Any] = ..., value: Optional[Any] = ..., name: Optional[Any] = ...): ... - def set(self, value): ... - initialize: Any - def get(self): ... + def __init__(self, master: Optional[Misc] = ..., value: Optional[bool] = ..., name: Optional[str] = ...) -> None: ... + def set(self, value: bool) -> None: ... + initialize = set + def get(self) -> bool: ... def mainloop(n: int = ...): ... @@ -53,13 +220,14 @@ getdouble: Any def getboolean(s): ... class Misc: + master: Optional[Misc] + tk: _tkinter.TkappType def destroy(self): ... def deletecommand(self, name): ... def tk_strictMotif(self, boolean: Optional[Any] = ...): ... def tk_bisque(self): ... def tk_setPalette(self, *args, **kw): ... - def tk_menuBar(self, *args): ... - def wait_variable(self, name: str = ...): ... + def wait_variable(self, name: Union[str, Variable] = ...): ... waitvar: Any def wait_window(self, window: Optional[Any] = ...): ... def wait_visibility(self, window: Optional[Any] = ...): ... @@ -77,9 +245,13 @@ class Misc: def tk_focusFollowsMouse(self): ... def tk_focusNext(self): ... def tk_focusPrev(self): ... - def after(self, ms, func: Optional[Any] = ..., *args): ... - def after_idle(self, func, *args): ... - def after_cancel(self, id): ... + @overload + def after(self, ms: int, func: None = ...) -> None: ... + @overload + def after(self, ms: Union[int, Literal["idle"]], func: Callable[..., Any], *args: Any) -> str: ... + # after_idle is essentially partialmethod(after, "idle") + def after_idle(self, func: Callable[..., Any], *args: Any) -> str: ... + def after_cancel(self, id: str) -> None: ... def bell(self, displayof: int = ...): ... def clipboard_get(self, **kw): ... def clipboard_clear(self, **kw): ... @@ -154,47 +326,94 @@ class Misc: def update(self): ... def update_idletasks(self): ... def bindtags(self, tagList: Optional[Any] = ...): ... - def bind(self, sequence: Optional[Any] = ..., func: Optional[Any] = ..., add: Optional[Any] = ...): ... - def unbind(self, sequence, funcid: Optional[Any] = ...): ... - def bind_all(self, sequence: Optional[Any] = ..., func: Optional[Any] = ..., add: Optional[Any] = ...): ... - def unbind_all(self, sequence): ... - def bind_class(self, className, sequence: Optional[Any] = ..., func: Optional[Any] = ..., add: Optional[Any] = ...): ... - def unbind_class(self, className, sequence): ... + # bind with isinstance(func, str) doesn't return anything, but all other + # binds do. The default value of func is not str. + @overload + def bind( + self, + sequence: Optional[str] = ..., + func: Optional[Callable[[Event[Misc]], Optional[Literal["break"]]]] = ..., + add: Optional[bool] = ..., + ) -> str: ... + @overload + def bind(self, sequence: Optional[str], func: str, add: Optional[bool] = ...) -> None: ... + @overload + def bind(self, *, func: str, add: Optional[bool] = ...) -> None: ... + # There's no way to know what type of widget bind_all and bind_class + # callbacks will get, so those are Misc. + @overload + def bind_all( + self, + sequence: Optional[str] = ..., + func: Optional[Callable[[Event[Misc]], Optional[Literal["break"]]]] = ..., + add: Optional[bool] = ..., + ) -> str: ... + @overload + def bind_all(self, sequence: Optional[str], func: str, add: Optional[bool] = ...) -> None: ... + @overload + def bind_all(self, *, func: str, add: Optional[bool] = ...) -> None: ... + @overload + def bind_class( + self, + className: str, + sequence: Optional[str] = ..., + func: Optional[Callable[[Event[Misc]], Optional[Literal["break"]]]] = ..., + add: Optional[bool] = ..., + ) -> str: ... + @overload + def bind_class(self, className: str, sequence: Optional[str], func: str, add: Optional[bool] = ...) -> None: ... + @overload + def bind_class(self, className: str, *, func: str, add: Optional[bool] = ...) -> None: ... + def unbind(self, sequence: str, funcid: Optional[str] = ...) -> None: ... + def unbind_all(self, sequence: str) -> None: ... + def unbind_class(self, className: str, sequence: str) -> None: ... def mainloop(self, n: int = ...): ... def quit(self): ... def nametowidget(self, name): ... register: Any - def configure(self, cnf: Optional[Any] = ..., **kw): ... - config: Any - def cget(self, key): ... - __getitem__: Any - def __setitem__(self, key, value): ... - def keys(self): ... - def pack_propagate(self, flag=...): ... - propagate: Any - def pack_slaves(self): ... - slaves: Any - def place_slaves(self): ... - def grid_anchor(self, anchor: Optional[Any] = ...): ... - anchor: Any - def grid_bbox(self, column: Optional[Any] = ..., row: Optional[Any] = ..., col2: Optional[Any] = ..., - row2: Optional[Any] = ...): ... - bbox: Any - def grid_columnconfigure(self, index, cnf=..., **kw): ... - columnconfigure: Any - def grid_location(self, x, y): ... - def grid_propagate(self, flag=...): ... - def grid_rowconfigure(self, index, cnf=..., **kw): ... - rowconfigure: Any - def grid_size(self): ... - size: Any - def grid_slaves(self, row: Optional[Any] = ..., column: Optional[Any] = ...): ... + def keys(self) -> List[str]: ... + @overload + def pack_propagate(self, flag: bool) -> Optional[bool]: ... + @overload + def pack_propagate(self) -> None: ... + propagate = pack_propagate + def grid_anchor(self, anchor: Optional[_Anchor] = ...) -> None: ... + anchor = grid_anchor + @overload + def grid_bbox( + self, column: None = ..., row: None = ..., col2: None = ..., row2: None = ... + ) -> Optional[Tuple[int, int, int, int]]: ... + @overload + def grid_bbox(self, column: int, row: int, col2: None = ..., row2: None = ...) -> Optional[Tuple[int, int, int, int]]: ... + @overload + def grid_bbox(self, column: int, row: int, col2: int, row2: int) -> Optional[Tuple[int, int, int, int]]: ... + # commented out to avoid conflicting with other bbox methods + # bbox = grid_bbox + def grid_columnconfigure(self, index, cnf=..., **kw): ... # TODO + def grid_rowconfigure(self, index, cnf=..., **kw): ... # TODO + columnconfigure = grid_columnconfigure + rowconfigure = grid_rowconfigure + def grid_location(self, x: _ScreenUnits, y: _ScreenUnits) -> Tuple[int, int]: ... + @overload + def grid_propagate(self, flag: bool) -> None: ... + @overload + def grid_propagate(self) -> bool: ... + def grid_size(self) -> Tuple[int, int]: ... + size = grid_size + # Widget because Toplevel or Tk is never a slave + def pack_slaves(self) -> List[Widget]: ... + def grid_slaves(self, row: Optional[int] = ..., column: Optional[int] = ...) -> List[Widget]: ... + def place_slaves(self) -> List[Widget]: ... + slaves = pack_slaves def event_add(self, virtual, *sequences): ... def event_delete(self, virtual, *sequences): ... def event_generate(self, sequence, **kw): ... def event_info(self, virtual: Optional[Any] = ...): ... def image_names(self): ... def image_types(self): ... + # See #4363 + def __setitem__(self, key: str, value: Any) -> None: ... + def __getitem__(self, key: str) -> Any: ... class CallWrapper: func: Any @@ -214,8 +433,13 @@ class YView: def yview_scroll(self, number, what): ... class Wm: - def wm_aspect(self, minNumer: Optional[Any] = ..., minDenom: Optional[Any] = ..., maxNumer: Optional[Any] = ..., - maxDenom: Optional[Any] = ...): ... + def wm_aspect( + self, + minNumer: Optional[Any] = ..., + minDenom: Optional[Any] = ..., + maxNumer: Optional[Any] = ..., + maxDenom: Optional[Any] = ..., + ): ... aspect: Any def wm_attributes(self, *args): ... attributes: Any @@ -235,8 +459,13 @@ class Wm: frame: Any def wm_geometry(self, newGeometry: Optional[Any] = ...): ... geometry: Any - def wm_grid(self, baseWidth: Optional[Any] = ..., baseHeight: Optional[Any] = ..., widthInc: Optional[Any] = ..., - heightInc: Optional[Any] = ...): ... + def wm_grid( + self, + baseWidth: Optional[Any] = ..., + baseHeight: Optional[Any] = ..., + widthInc: Optional[Any] = ..., + heightInc: Optional[Any] = ..., + ): ... grid: Any def wm_group(self, pathName: Optional[Any] = ...): ... group: Any @@ -279,72 +508,567 @@ class Wm: def wm_withdraw(self): ... withdraw: Any +_TkOptionName = Literal[ + "background", + "bd", + "bg", + "border", + "borderwidth", + "class", + "colormap", + "container", + "cursor", + "height", + "highlightbackground", + "highlightcolor", + "highlightthickness", + "menu", + "padx", + "pady", + "relief", + "screen", # can't be changed after creating widget + "takefocus", + "use", + "visual", + "width", +] + +class _ExceptionReportingCallback(Protocol): + def __call__(self, __exc: Type[BaseException], __val: BaseException, __tb: TracebackType) -> Any: ... + class Tk(Misc, Wm): - master: Optional[Any] + master: None children: Dict[str, Any] - tk: Any - def __init__(self, screenName: Optional[str] = ..., baseName: Optional[str] = ..., className: str = ..., useTk: bool = ..., - sync: bool = ..., use: Optional[str] = ...) -> None: ... - def loadtk(self) -> None: ... + def __init__( + self, + screenName: Optional[str] = ..., + baseName: Optional[str] = ..., + className: str = ..., + useTk: bool = ..., + sync: bool = ..., + use: Optional[str] = ..., + ) -> None: ... + @overload + def configure( + self: Union[Tk, Toplevel], + cnf: Optional[Dict[str, Any]] = ..., + *, + background: _Color = ..., + bd: _ScreenUnits = ..., + bg: _Color = ..., + border: _ScreenUnits = ..., + borderwidth: _ScreenUnits = ..., + cursor: _Cursor = ..., + height: _ScreenUnits = ..., + highlightbackground: _Color = ..., + highlightcolor: _Color = ..., + highlightthickness: _ScreenUnits = ..., + menu: Menu = ..., + padx: _ScreenUnits = ..., + pady: _ScreenUnits = ..., + relief: _Relief = ..., + takefocus: _TakeFocusValue = ..., + width: _ScreenUnits = ..., + ) -> Optional[Dict[str, Tuple[str, str, str, Any, Any]]]: ... + @overload + def configure(self, cnf: _TkOptionName) -> Tuple[str, str, str, Any, Any]: ... + config = configure + def cget(self, key: _TkOptionName) -> Any: ... + def loadtk(self) -> None: ... # differs from _tkinter.TkappType.loadtk def destroy(self) -> None: ... def readprofile(self, baseName: str, className: str) -> None: ... - report_callback_exception: Callable[[Type[BaseException], BaseException, TracebackType], Any] - def __getattr__(self, attr: str) -> Any: ... + report_callback_exception: _ExceptionReportingCallback + # Tk has __getattr__ so that tk_instance.foo falls back to tk_instance.tk.foo + # Please keep in sync with _tkinter.TkappType + call: Callable[..., Any] + eval: Callable[[str], str] + adderrorinfo: Any + createcommand: Any + createfilehandler: Any + createtimerhandler: Any + deletecommand: Any + deletefilehandler: Any + dooneevent: Any + evalfile: Any + exprboolean: Any + exprdouble: Any + exprlong: Any + exprstring: Any + getboolean: Any + getdouble: Any + getint: Any + getvar: Any + globalgetvar: Any + globalsetvar: Any + globalunsetvar: Any + interpaddr: Any + mainloop: Any + quit: Any + record: Any + setvar: Any + split: Any + splitlist: Any + unsetvar: Any + wantobjects: Any + willdispatch: Any def Tcl(screenName: Optional[Any] = ..., baseName: Optional[Any] = ..., className: str = ..., useTk: bool = ...): ... +_InMiscTotal = TypedDict("_InMiscTotal", {"in": Misc}) +_InMiscNonTotal = TypedDict("_InMiscNonTotal", {"in": Misc}, total=False) + +class _PackInfo(_InMiscTotal): + # 'before' and 'after' never appear in _PackInfo + anchor: _Anchor + expand: Literal[0, 1] + fill: Literal["none", "x", "y", "both"] + side: Literal["left", "right", "top", "bottom"] + # Paddings come out as int or tuple of int, even though any _ScreenUnits + # can be specified in pack(). + ipadx: int + ipady: int + padx: Union[int, Tuple[int, int]] + pady: Union[int, Tuple[int, int]] + class Pack: - def pack_configure(self, cnf=..., **kw): ... - pack: Any - def pack_forget(self): ... - forget: Any - def pack_info(self): ... - info: Any - propagate: Any - slaves: Any + # _PackInfo is not the valid type for cnf because pad stuff accepts any + # _ScreenUnits instead of int only. I didn't bother to create another + # TypedDict for cnf because it appears to be a legacy thing that was + # replaced by **kwargs. + def pack_configure( + self, + cnf: Optional[Mapping[str, Any]] = ..., + *, + after: Misc = ..., + anchor: _Anchor = ..., + before: Misc = ..., + expand: int = ..., + fill: Literal["none", "x", "y", "both"] = ..., + side: Literal["left", "right", "top", "bottom"] = ..., + ipadx: _ScreenUnits = ..., + ipady: _ScreenUnits = ..., + padx: Union[_ScreenUnits, Tuple[_ScreenUnits, _ScreenUnits]] = ..., + pady: Union[_ScreenUnits, Tuple[_ScreenUnits, _ScreenUnits]] = ..., + in_: Misc = ..., + ) -> None: ... + def pack_forget(self) -> None: ... + def pack_info(self) -> _PackInfo: ... # errors if widget hasn't been packed + pack = pack_configure + forget = pack_forget + propagate = Misc.pack_propagate + # commented out to avoid mypy getting confused with multiple + # inheritance and how things get overrided with different things + # info = pack_info + # pack_propagate = Misc.pack_propagate + # configure = pack_configure + # config = pack_configure + # slaves = Misc.pack_slaves + # pack_slaves = Misc.pack_slaves + +class _PlaceInfo(_InMiscNonTotal): # empty dict if widget hasn't been placed + anchor: _Anchor + bordermode: Literal["inside", "outside", "ignore"] + width: str # can be int()ed (even after e.g. widget.place(height='2.3c') or similar) + height: str # can be int()ed + x: str # can be int()ed + y: str # can be int()ed + relheight: str # can be float()ed if not empty string + relwidth: str # can be float()ed if not empty string + relx: float # can be float()ed if not empty string + rely: float # can be float()ed if not empty string class Place: - def place_configure(self, cnf=..., **kw): ... - place: Any - def place_forget(self): ... - forget: Any - def place_info(self): ... - info: Any - slaves: Any + def place_configure( + self, + cnf: Optional[Mapping[str, Any]] = ..., + *, + anchor: _Anchor = ..., + bordermode: Literal["inside", "outside", "ignore"] = ..., + width: _ScreenUnits = ..., + height: _ScreenUnits = ..., + x: _ScreenUnits = ..., + y: _ScreenUnits = ..., + relheight: float = ..., + relwidth: float = ..., + relx: float = ..., + rely: float = ..., + in_: Misc = ..., + ) -> None: ... + def place_forget(self) -> None: ... + def place_info(self) -> _PlaceInfo: ... + place = place_configure + info = place_info + # commented out to avoid mypy getting confused with multiple + # inheritance and how things get overrided with different things + # config = place_configure + # configure = place_configure + # forget = place_forget + # slaves = Misc.place_slaves + # place_slaves = Misc.place_slaves + +class _GridInfo(_InMiscNonTotal): # empty dict if widget hasn't been gridded + column: int + columnspan: int + row: int + rowspan: int + ipadx: int + ipady: int + padx: Union[int, Tuple[int, int]] + pady: Union[int, Tuple[int, int]] + sticky: str # consists of letters 'n', 's', 'w', 'e', no repeats, may be empty class Grid: - def grid_configure(self, cnf=..., **kw): ... - grid: Any - bbox: Any - columnconfigure: Any - def grid_forget(self): ... - forget: Any - def grid_remove(self): ... - def grid_info(self): ... - info: Any - location: Any - propagate: Any - rowconfigure: Any - size: Any - slaves: Any + def grid_configure( + self, + cnf: Optional[Mapping[str, Any]] = ..., + *, + column: int = ..., + columnspan: int = ..., + row: int = ..., + rowspan: int = ..., + ipadx: _ScreenUnits = ..., + ipady: _ScreenUnits = ..., + padx: Union[_ScreenUnits, Tuple[_ScreenUnits, _ScreenUnits]] = ..., + pady: Union[_ScreenUnits, Tuple[_ScreenUnits, _ScreenUnits]] = ..., + sticky: str = ..., # consists of letters 'n', 's', 'w', 'e', may contain repeats, may be empty + in_: Misc = ..., + ) -> None: ... + def grid_forget(self) -> None: ... + def grid_remove(self) -> None: ... + def grid_info(self) -> _GridInfo: ... + grid = grid_configure + location = Misc.grid_location + size = Misc.grid_size + # commented out to avoid mypy getting confused with multiple + # inheritance and how things get overrided with different things + # bbox = Misc.grid_bbox + # grid_bbox = Misc.grid_bbox + # forget = grid_forget + # info = grid_info + # grid_location = Misc.grid_location + # grid_propagate = Misc.grid_propagate + # grid_size = Misc.grid_size + # rowconfigure = Misc.grid_rowconfigure + # grid_rowconfigure = Misc.grid_rowconfigure + # grid_columnconfigure = Misc.grid_columnconfigure + # columnconfigure = Misc.grid_columnconfigure + # config = grid_configure + # configure = grid_configure + # propagate = Misc.grid_propagate + # slaves = Misc.grid_slaves + # grid_slaves = Misc.grid_slaves class BaseWidget(Misc): + master: Misc widgetName: Any def __init__(self, master, widgetName, cnf=..., kw=..., extra=...): ... def destroy(self): ... -class Widget(BaseWidget, Pack, Place, Grid): ... +# This class represents any widget except Toplevel or Tk. +class Widget(BaseWidget, Pack, Place, Grid): + # Allow bind callbacks to take e.g. Event[Label] instead of Event[Misc]. + # Tk and Toplevel get notified for their child widgets' events, but other + # widgets don't. + @overload + def bind( + self: _W, + sequence: Optional[str] = ..., + func: Optional[Callable[[Event[_W]], Optional[Literal["break"]]]] = ..., + add: Optional[bool] = ..., + ) -> str: ... + @overload + def bind(self, sequence: Optional[str], func: str, add: Optional[bool] = ...) -> None: ... + @overload + def bind(self, *, func: str, add: Optional[bool] = ...) -> None: ... class Toplevel(BaseWidget, Wm): - def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + def __init__( + self, + master: Optional[Misc] = ..., + cnf: Optional[Dict[str, Any]] = ..., + *, + background: _Color = ..., + bd: _ScreenUnits = ..., + bg: _Color = ..., + border: _ScreenUnits = ..., + borderwidth: _ScreenUnits = ..., + class_: str = ..., + colormap: Union[Literal["new", ""], Misc] = ..., + container: bool = ..., + cursor: _Cursor = ..., + height: _ScreenUnits = ..., + highlightbackground: _Color = ..., + highlightcolor: _Color = ..., + highlightthickness: _ScreenUnits = ..., + menu: Menu = ..., + padx: _ScreenUnits = ..., + pady: _ScreenUnits = ..., + relief: _Relief = ..., + screen: str = ..., + takefocus: _TakeFocusValue = ..., + use: int = ..., + visual: Union[str, Tuple[str, int]] = ..., + width: _ScreenUnits = ..., + ) -> None: ... + # Toplevel and Tk have the same options because they correspond to the same + # Tcl/Tk toplevel widget. + configure = Tk.configure + config = Tk.config + cget = Tk.cget + +_ButtonOptionName = Literal[ + "activebackground", + "activeforeground", + "anchor", + "background", + "bd", # same as borderwidth + "bg", # same as background + "bitmap", + "border", # same as borderwidth + "borderwidth", + "command", + "compound", + "cursor", + "default", + "disabledforeground", + "fg", # same as foreground + "font", + "foreground", + "height", + "highlightbackground", + "highlightcolor", + "highlightthickness", + "image", + "justify", + "overrelief", + "padx", + "pady", + "relief", + "repeatdelay", + "repeatinterval", + "state", + "takefocus", + "text", + "textvariable", + "underline", + "width", + "wraplength", +] class Button(Widget): - def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + def __init__( + self, + master: Optional[Misc] = ..., + cnf: Optional[Dict[str, Any]] = ..., + *, + activebackground: _Color = ..., + activeforeground: _Color = ..., + anchor: _Anchor = ..., + background: _Color = ..., + bd: _ScreenUnits = ..., + bg: _Color = ..., + bitmap: _Bitmap = ..., + border: _ScreenUnits = ..., + borderwidth: _ScreenUnits = ..., + command: _ButtonCommand = ..., + compound: _Compound = ..., + cursor: _Cursor = ..., + default: Literal["normal", "active", "disabled"] = ..., + disabledforeground: _Color = ..., + fg: _Color = ..., + font: _FontDescription = ..., + foreground: _Color = ..., + # width and height must be int for buttons containing just text, but + # ints are also valid _ScreenUnits + height: _ScreenUnits = ..., + highlightbackground: _Color = ..., + highlightcolor: _Color = ..., + highlightthickness: _ScreenUnits = ..., + image: _ImageSpec = ..., + justify: Literal["left", "center", "right"] = ..., + name: str = ..., + overrelief: _Relief = ..., + padx: _ScreenUnits = ..., + pady: _ScreenUnits = ..., + relief: _Relief = ..., + repeatdelay: int = ..., + repeatinterval: int = ..., + state: Literal["normal", "active", "disabled"] = ..., + takefocus: _TakeFocusValue = ..., + text: str = ..., + # We allow the textvariable to be any Variable, not necessarly + # StringVar. This is useful for e.g. a button that displays the value + # of an IntVar. + textvariable: Variable = ..., + underline: int = ..., + width: _ScreenUnits = ..., + wraplength: _ScreenUnits = ..., + ) -> None: ... + @overload + def configure( + self, + cnf: Optional[Dict[str, Any]] = ..., + *, + activebackground: _Color = ..., + activeforeground: _Color = ..., + anchor: _Anchor = ..., + background: _Color = ..., + bd: _ScreenUnits = ..., + bg: _Color = ..., + bitmap: _Bitmap = ..., + border: _ScreenUnits = ..., + borderwidth: _ScreenUnits = ..., + command: _ButtonCommand = ..., + compound: _Compound = ..., + cursor: _Cursor = ..., + default: Literal["normal", "active", "disabled"] = ..., + disabledforeground: _Color = ..., + fg: _Color = ..., + font: _FontDescription = ..., + foreground: _Color = ..., + height: _ScreenUnits = ..., + highlightbackground: _Color = ..., + highlightcolor: _Color = ..., + highlightthickness: _ScreenUnits = ..., + image: _ImageSpec = ..., + justify: Literal["left", "center", "right"] = ..., + overrelief: _Relief = ..., + padx: _ScreenUnits = ..., + pady: _ScreenUnits = ..., + relief: _Relief = ..., + repeatdelay: int = ..., + repeatinterval: int = ..., + state: Literal["normal", "active", "disabled"] = ..., + takefocus: _TakeFocusValue = ..., + text: str = ..., + textvariable: Variable = ..., + underline: int = ..., + width: _ScreenUnits = ..., + wraplength: _ScreenUnits = ..., + ) -> Optional[Dict[str, Tuple[str, str, str, Any, Any]]]: ... + @overload + def configure(self, cnf: _ButtonOptionName) -> Tuple[str, str, str, Any, Any]: ... + config = configure + def cget(self, key: _ButtonOptionName) -> Any: ... def flash(self): ... def invoke(self): ... +_CanvasOptionName = Literal[ + "background", + "bd", + "bg", + "border", + "borderwidth", + "closeenough", + "confine", + "cursor", + "height", + "highlightbackground", + "highlightcolor", + "highlightthickness", + "insertbackground", + "insertborderwidth", + "insertofftime", + "insertontime", + "insertwidth", + "offset", + "relief", + "scrollregion", + "selectbackground", + "selectborderwidth", + "selectforeground", + "state", + "takefocus", + "width", + "xscrollcommand", + "xscrollincrement", + "yscrollcommand", + "yscrollincrement", +] + class Canvas(Widget, XView, YView): - def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + def __init__( + self, + master: Optional[Misc] = ..., + cnf: Optional[Dict[str, Any]] = ..., + *, + background: _Color = ..., + bd: _ScreenUnits = ..., + bg: _Color = ..., + border: _ScreenUnits = ..., + borderwidth: _ScreenUnits = ..., + closeenough: float = ..., + confine: bool = ..., + cursor: _Cursor = ..., + # canvas manual page has a section named COORDINATES, and the first + # part of it describes _ScreenUnits. + height: _ScreenUnits = ..., + highlightbackground: _Color = ..., + highlightcolor: _Color = ..., + highlightthickness: _ScreenUnits = ..., + insertbackground: _Color = ..., + insertborderwidth: _ScreenUnits = ..., + insertofftime: int = ..., + insertontime: int = ..., + insertwidth: _ScreenUnits = ..., + name: str = ..., + offset: Any = ..., # undocumented + relief: _Relief = ..., + # Setting scrollregion to None doesn't reset it back to empty, + # but setting it to () does. + scrollregion: Union[Tuple[_ScreenUnits, _ScreenUnits, _ScreenUnits, _ScreenUnits], Tuple[()]] = ..., + selectbackground: _Color = ..., + selectborderwidth: _ScreenUnits = ..., + selectforeground: _Color = ..., + # man page says that state can be 'hidden', but it can't + state: Literal["normal", "disabled"] = ..., + takefocus: _TakeFocusValue = ..., + width: _ScreenUnits = ..., + xscrollcommand: _XYScrollCommand = ..., + xscrollincrement: _ScreenUnits = ..., + yscrollcommand: _XYScrollCommand = ..., + yscrollincrement: _ScreenUnits = ..., + ) -> None: ... + @overload + def configure( + self, + cnf: Optional[Dict[str, Any]] = ..., + *, + background: _Color = ..., + bd: _ScreenUnits = ..., + bg: _Color = ..., + border: _ScreenUnits = ..., + borderwidth: _ScreenUnits = ..., + closeenough: float = ..., + confine: bool = ..., + cursor: _Cursor = ..., + height: _ScreenUnits = ..., + highlightbackground: _Color = ..., + highlightcolor: _Color = ..., + highlightthickness: _ScreenUnits = ..., + insertbackground: _Color = ..., + insertborderwidth: _ScreenUnits = ..., + insertofftime: int = ..., + insertontime: int = ..., + insertwidth: _ScreenUnits = ..., + offset: Any = ..., # undocumented + relief: _Relief = ..., + scrollregion: Union[Tuple[_ScreenUnits, _ScreenUnits, _ScreenUnits, _ScreenUnits], Tuple[()]] = ..., + selectbackground: _Color = ..., + selectborderwidth: _ScreenUnits = ..., + selectforeground: _Color = ..., + state: Literal["normal", "disabled"] = ..., + takefocus: _TakeFocusValue = ..., + width: _ScreenUnits = ..., + xscrollcommand: _XYScrollCommand = ..., + xscrollincrement: _ScreenUnits = ..., + yscrollcommand: _XYScrollCommand = ..., + yscrollincrement: _ScreenUnits = ..., + ) -> Optional[Dict[str, Tuple[str, str, str, Any, Any]]]: ... + @overload + def configure(self, cnf: _CanvasOptionName) -> Tuple[str, str, str, Any, Any]: ... + config = configure + def cget(self, key: _CanvasOptionName) -> Any: ... def addtag(self, *args): ... def addtag_above(self, newtag, tagOrId): ... def addtag_all(self, newtag): ... @@ -354,8 +1078,19 @@ class Canvas(Widget, XView, YView): def addtag_overlapping(self, newtag, x1, y1, x2, y2): ... def addtag_withtag(self, newtag, tagOrId): ... def bbox(self, *args): ... - def tag_unbind(self, tagOrId, sequence, funcid: Optional[Any] = ...): ... - def tag_bind(self, tagOrId, sequence: Optional[Any] = ..., func: Optional[Any] = ..., add: Optional[Any] = ...): ... + @overload + def tag_bind( + self, + tagOrId: Union[str, int], + sequence: Optional[str] = ..., + func: Optional[Callable[[Event[Canvas]], Optional[Literal["break"]]]] = ..., + add: Optional[bool] = ..., + ) -> str: ... + @overload + def tag_bind(self, tagOrId: Union[str, int], sequence: Optional[str], func: str, add: Optional[bool] = ...) -> None: ... + @overload + def tag_bind(self, tagOrId: Union[str, int], *, func: str, add: Optional[bool] = ...) -> None: ... + def tag_unbind(self, tagOrId: Union[str, int], sequence: str, funcid: Optional[str] = ...) -> None: ... def canvasx(self, screenx, gridspacing: Optional[Any] = ...): ... def canvasy(self, screeny, gridspacing: Optional[Any] = ...): ... def coords(self, *args): ... @@ -405,16 +1140,301 @@ class Canvas(Widget, XView, YView): def select_to(self, tagOrId, index): ... def type(self, tagOrId): ... +_CheckbuttonOptionName = Literal[ + "activebackground", + "activeforeground", + "anchor", + "background", + "bd", + "bg", + "bitmap", + "border", + "borderwidth", + "command", + "compound", + "cursor", + "disabledforeground", + "fg", + "font", + "foreground", + "height", + "highlightbackground", + "highlightcolor", + "highlightthickness", + "image", + "indicatoron", + "justify", + "offrelief", + "offvalue", + "onvalue", + "overrelief", + "padx", + "pady", + "relief", + "selectcolor", + "selectimage", + "state", + "takefocus", + "text", + "textvariable", + "tristateimage", + "tristatevalue", + "underline", + "variable", + "width", + "wraplength", +] + class Checkbutton(Widget): - def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + def __init__( + self, + master: Optional[Misc] = ..., + cnf: Optional[Dict[str, Any]] = ..., + *, + activebackground: _Color = ..., + activeforeground: _Color = ..., + anchor: _Anchor = ..., + background: _Color = ..., + bd: _ScreenUnits = ..., + bg: _Color = ..., + bitmap: _Bitmap = ..., + border: _ScreenUnits = ..., + borderwidth: _ScreenUnits = ..., + command: _ButtonCommand = ..., + compound: _Compound = ..., + cursor: _Cursor = ..., + disabledforeground: _Color = ..., + fg: _Color = ..., + font: _FontDescription = ..., + foreground: _Color = ..., + height: _ScreenUnits = ..., + highlightbackground: _Color = ..., + highlightcolor: _Color = ..., + highlightthickness: _ScreenUnits = ..., + image: _ImageSpec = ..., + indicatoron: bool = ..., + justify: Literal["left", "center", "right"] = ..., + name: str = ..., + offrelief: _Relief = ..., + # The checkbutton puts a value to its variable when it's checked or + # unchecked. We don't restrict the type of that value here, so + # Any-typing is fine. + # + # I think Checkbutton shouldn't be generic, because then specifying + # "any checkbutton regardless of what variable it uses" would be + # difficult, and we might run into issues just like how List[float] + # and List[int] are incompatible. Also, we would need a way to + # specify "Checkbutton not associated with any variable", which is + # done by setting variable to empty string (the default). + offvalue: Any = ..., + onvalue: Any = ..., + overrelief: _Relief = ..., + padx: _ScreenUnits = ..., + pady: _ScreenUnits = ..., + relief: _Relief = ..., + selectcolor: _Color = ..., + selectimage: _ImageSpec = ..., + state: Literal["normal", "active", "disabled"] = ..., + takefocus: _TakeFocusValue = ..., + text: str = ..., + textvariable: Variable = ..., + tristateimage: _ImageSpec = ..., + tristatevalue: Any = ..., + underline: int = ..., + variable: Union[Variable, Literal[""]] = ..., + width: _ScreenUnits = ..., + wraplength: _ScreenUnits = ..., + ) -> None: ... + @overload + def configure( + self, + cnf: Optional[Dict[str, Any]] = ..., + *, + activebackground: _Color = ..., + activeforeground: _Color = ..., + anchor: _Anchor = ..., + background: _Color = ..., + bd: _ScreenUnits = ..., + bg: _Color = ..., + bitmap: _Bitmap = ..., + border: _ScreenUnits = ..., + borderwidth: _ScreenUnits = ..., + command: _ButtonCommand = ..., + compound: _Compound = ..., + cursor: _Cursor = ..., + disabledforeground: _Color = ..., + fg: _Color = ..., + font: _FontDescription = ..., + foreground: _Color = ..., + height: _ScreenUnits = ..., + highlightbackground: _Color = ..., + highlightcolor: _Color = ..., + highlightthickness: _ScreenUnits = ..., + image: _ImageSpec = ..., + indicatoron: bool = ..., + justify: Literal["left", "center", "right"] = ..., + offrelief: _Relief = ..., + offvalue: Any = ..., + onvalue: Any = ..., + overrelief: _Relief = ..., + padx: _ScreenUnits = ..., + pady: _ScreenUnits = ..., + relief: _Relief = ..., + selectcolor: _Color = ..., + selectimage: _ImageSpec = ..., + state: Literal["normal", "active", "disabled"] = ..., + takefocus: _TakeFocusValue = ..., + text: str = ..., + textvariable: Variable = ..., + tristateimage: _ImageSpec = ..., + tristatevalue: Any = ..., + underline: int = ..., + variable: Union[Variable, Literal[""]] = ..., + width: _ScreenUnits = ..., + wraplength: _ScreenUnits = ..., + ) -> Optional[Dict[str, Tuple[str, str, str, Any, Any]]]: ... + @overload + def configure(self, cnf: _CheckbuttonOptionName) -> Tuple[str, str, str, Any, Any]: ... + config = configure + def cget(self, key: _CheckbuttonOptionName) -> Any: ... def deselect(self): ... def flash(self): ... def invoke(self): ... def select(self): ... def toggle(self): ... +_EntryOptionName = Literal[ + "background", + "bd", + "bg", + "border", + "borderwidth", + "cursor", + "disabledbackground", + "disabledforeground", + "exportselection", + "fg", + "font", + "foreground", + "highlightbackground", + "highlightcolor", + "highlightthickness", + "insertbackground", + "insertborderwidth", + "insertofftime", + "insertontime", + "insertwidth", + "invalidcommand", + "invcmd", # same as invalidcommand + "justify", + "readonlybackground", + "relief", + "selectbackground", + "selectborderwidth", + "selectforeground", + "show", + "state", + "takefocus", + "textvariable", + "validate", + "validatecommand", + "vcmd", # same as validatecommand + "width", + "xscrollcommand", +] + class Entry(Widget, XView): - def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + def __init__( + self, + master: Optional[Misc] = ..., + cnf: Optional[Dict[str, Any]] = ..., + *, + background: _Color = ..., + bd: _ScreenUnits = ..., + bg: _Color = ..., + border: _ScreenUnits = ..., + borderwidth: _ScreenUnits = ..., + cursor: _Cursor = ..., + disabledbackground: _Color = ..., + disabledforeground: _Color = ..., + exportselection: bool = ..., + fg: _Color = ..., + font: _FontDescription = ..., + foreground: _Color = ..., + highlightbackground: _Color = ..., + highlightcolor: _Color = ..., + highlightthickness: _ScreenUnits = ..., + insertbackground: _Color = ..., + insertborderwidth: _ScreenUnits = ..., + insertofftime: int = ..., + insertontime: int = ..., + insertwidth: _ScreenUnits = ..., + invalidcommand: _EntryValidateCommand = ..., + invcmd: _EntryValidateCommand = ..., + justify: Literal["left", "center", "right"] = ..., + name: str = ..., + readonlybackground: _Color = ..., + relief: _Relief = ..., + selectbackground: _Color = ..., + selectborderwidth: _ScreenUnits = ..., + selectforeground: _Color = ..., + show: str = ..., + state: Literal["normal", "disabled", "readonly"] = ..., + takefocus: _TakeFocusValue = ..., + textvariable: Variable = ..., + validate: Literal["none", "focus", "focusin", "focusout", "key", "all"] = ..., + validatecommand: _EntryValidateCommand = ..., + vcmd: _EntryValidateCommand = ..., + width: int = ..., + xscrollcommand: _XYScrollCommand = ..., + ) -> None: ... + @overload + def configure( + self, + cnf: Optional[Dict[str, Any]] = ..., + *, + background: _Color = ..., + bd: _ScreenUnits = ..., + bg: _Color = ..., + border: _ScreenUnits = ..., + borderwidth: _ScreenUnits = ..., + cursor: _Cursor = ..., + disabledbackground: _Color = ..., + disabledforeground: _Color = ..., + exportselection: bool = ..., + fg: _Color = ..., + font: _FontDescription = ..., + foreground: _Color = ..., + highlightbackground: _Color = ..., + highlightcolor: _Color = ..., + highlightthickness: _ScreenUnits = ..., + insertbackground: _Color = ..., + insertborderwidth: _ScreenUnits = ..., + insertofftime: int = ..., + insertontime: int = ..., + insertwidth: _ScreenUnits = ..., + invalidcommand: _EntryValidateCommand = ..., + invcmd: _EntryValidateCommand = ..., + justify: Literal["left", "center", "right"] = ..., + readonlybackground: _Color = ..., + relief: _Relief = ..., + selectbackground: _Color = ..., + selectborderwidth: _ScreenUnits = ..., + selectforeground: _Color = ..., + show: str = ..., + state: Literal["normal", "disabled", "readonly"] = ..., + takefocus: _TakeFocusValue = ..., + textvariable: Variable = ..., + validate: Literal["none", "focus", "focusin", "focusout", "key", "all"] = ..., + validatecommand: _EntryValidateCommand = ..., + vcmd: _EntryValidateCommand = ..., + width: int = ..., + xscrollcommand: _XYScrollCommand = ..., + ) -> Optional[Dict[str, Tuple[str, str, str, Any, Any]]]: ... + @overload + def configure(self, cnf: _EntryOptionName) -> Tuple[str, str, str, Any, Any]: ... + config = configure + def cget(self, key: _EntryOptionName) -> Any: ... def delete(self, first, last: Optional[Any] = ...): ... def get(self): ... def icursor(self, index): ... @@ -435,14 +1455,318 @@ class Entry(Widget, XView): def selection_to(self, index): ... select_to: Any +_FrameOptionName = Literal[ + "background", + "bd", + "bg", + "border", + "borderwidth", + "class", + "colormap", + "container", + "cursor", + "height", + "highlightbackground", + "highlightcolor", + "highlightthickness", + "padx", + "pady", + "relief", + "takefocus", + "visual", + "width", +] + class Frame(Widget): - def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + def __init__( + self, + master: Optional[Misc] = ..., + cnf: Optional[Dict[str, Any]] = ..., + *, + background: _Color = ..., + bd: _ScreenUnits = ..., + bg: _Color = ..., + border: _ScreenUnits = ..., + borderwidth: _ScreenUnits = ..., + class_: str = ..., + colormap: Union[Literal["new", ""], Misc] = ..., + container: bool = ..., + cursor: _Cursor = ..., + height: _ScreenUnits = ..., + highlightbackground: _Color = ..., + highlightcolor: _Color = ..., + highlightthickness: _ScreenUnits = ..., + name: str = ..., + padx: _ScreenUnits = ..., + pady: _ScreenUnits = ..., + relief: _Relief = ..., + takefocus: _TakeFocusValue = ..., + visual: Union[str, Tuple[str, int]] = ..., + width: _ScreenUnits = ..., + ) -> None: ... + @overload + def configure( + self, + cnf: Optional[Dict[str, Any]] = ..., + *, + background: _Color = ..., + bd: _ScreenUnits = ..., + bg: _Color = ..., + border: _ScreenUnits = ..., + borderwidth: _ScreenUnits = ..., + cursor: _Cursor = ..., + height: _ScreenUnits = ..., + highlightbackground: _Color = ..., + highlightcolor: _Color = ..., + highlightthickness: _ScreenUnits = ..., + padx: _ScreenUnits = ..., + pady: _ScreenUnits = ..., + relief: _Relief = ..., + takefocus: _TakeFocusValue = ..., + width: _ScreenUnits = ..., + ) -> Optional[Dict[str, Tuple[str, str, str, Any, Any]]]: ... + @overload + def configure(self, cnf: _FrameOptionName) -> Tuple[str, str, str, Any, Any]: ... + config = configure + def cget(self, key: _FrameOptionName) -> Any: ... + +_LabelOptionName = Literal[ + "activebackground", + "activeforeground", + "anchor", + "background", + "bd", + "bg", + "bitmap", + "border", + "borderwidth", + "compound", + "cursor", + "disabledforeground", + "fg", + "font", + "foreground", + "height", + "highlightbackground", + "highlightcolor", + "highlightthickness", + "image", + "justify", + "padx", + "pady", + "relief", + "state", + "takefocus", + "text", + "textvariable", + "underline", + "width", + "wraplength", +] class Label(Widget): - def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + def __init__( + self, + master: Optional[Misc] = ..., + cnf: Optional[Dict[str, Any]] = ..., + *, + activebackground: _Color = ..., + activeforeground: _Color = ..., + anchor: _Anchor = ..., + background: _Color = ..., + bd: _ScreenUnits = ..., + bg: _Color = ..., + bitmap: _Bitmap = ..., + border: _ScreenUnits = ..., + borderwidth: _ScreenUnits = ..., + compound: _Compound = ..., + cursor: _Cursor = ..., + disabledforeground: _Color = ..., + fg: _Color = ..., + font: _FontDescription = ..., + foreground: _Color = ..., + height: _ScreenUnits = ..., + highlightbackground: _Color = ..., + highlightcolor: _Color = ..., + highlightthickness: _ScreenUnits = ..., + image: _ImageSpec = ..., + justify: Literal["left", "center", "right"] = ..., + name: str = ..., + padx: _ScreenUnits = ..., + pady: _ScreenUnits = ..., + relief: _Relief = ..., + state: Literal["normal", "active", "disabled"] = ..., + takefocus: _TakeFocusValue = ..., + text: str = ..., + textvariable: Variable = ..., + underline: int = ..., + width: _ScreenUnits = ..., + wraplength: _ScreenUnits = ..., + ) -> None: ... + @overload + def configure( + self, + cnf: Optional[Dict[str, Any]] = ..., + *, + activebackground: _Color = ..., + activeforeground: _Color = ..., + anchor: _Anchor = ..., + background: _Color = ..., + bd: _ScreenUnits = ..., + bg: _Color = ..., + bitmap: _Bitmap = ..., + border: _ScreenUnits = ..., + borderwidth: _ScreenUnits = ..., + compound: _Compound = ..., + cursor: _Cursor = ..., + disabledforeground: _Color = ..., + fg: _Color = ..., + font: _FontDescription = ..., + foreground: _Color = ..., + height: _ScreenUnits = ..., + highlightbackground: _Color = ..., + highlightcolor: _Color = ..., + highlightthickness: _ScreenUnits = ..., + image: _ImageSpec = ..., + justify: Literal["left", "center", "right"] = ..., + padx: _ScreenUnits = ..., + pady: _ScreenUnits = ..., + relief: _Relief = ..., + state: Literal["normal", "active", "disabled"] = ..., + takefocus: _TakeFocusValue = ..., + text: str = ..., + textvariable: Variable = ..., + underline: int = ..., + width: _ScreenUnits = ..., + wraplength: _ScreenUnits = ..., + ) -> Optional[Dict[str, Tuple[str, str, str, Any, Any]]]: ... + @overload + def configure(self, cnf: _LabelOptionName) -> Tuple[str, str, str, Any, Any]: ... + config = configure + def cget(self, key: _LabelOptionName) -> Any: ... + +_ListboxOptionName = Literal[ + "activestyle", + "background", + "bd", + "bg", + "border", + "borderwidth", + "cursor", + "disabledforeground", + "exportselection", + "fg", + "font", + "foreground", + "height", + "highlightbackground", + "highlightcolor", + "highlightthickness", + "justify", + "listvariable", + "relief", + "selectbackground", + "selectborderwidth", + "selectforeground", + "selectmode", + "setgrid", + "state", + "takefocus", + "width", + "xscrollcommand", + "yscrollcommand", +] class Listbox(Widget, XView, YView): - def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + def __init__( + self, + master: Optional[Misc] = ..., + cnf: Optional[Dict[str, Any]] = ..., + *, + activestyle: Literal["dotbox", "none", "underline"] = ..., + background: _Color = ..., + bd: _ScreenUnits = ..., + bg: _Color = ..., + border: _ScreenUnits = ..., + borderwidth: _ScreenUnits = ..., + cursor: _Cursor = ..., + disabledforeground: _Color = ..., + exportselection: int = ..., + fg: _Color = ..., + font: _FontDescription = ..., + foreground: _Color = ..., + height: int = ..., + highlightbackground: _Color = ..., + highlightcolor: _Color = ..., + highlightthickness: _ScreenUnits = ..., + justify: Literal["left", "center", "right"] = ..., + # There's no tkinter.ListVar, but seems like bare tkinter.Variable + # actually works for this: + # + # >>> import tkinter + # >>> lb = tkinter.Listbox() + # >>> var = lb['listvariable'] = tkinter.Variable() + # >>> var.set(['foo', 'bar', 'baz']) + # >>> lb.get(0, 'end') + # ('foo', 'bar', 'baz') + listvariable: Variable = ..., + name: str = ..., + relief: _Relief = ..., + selectbackground: _Color = ..., + selectborderwidth: _ScreenUnits = ..., + selectforeground: _Color = ..., + # from listbox man page: "The value of the [selectmode] option may be + # arbitrary, but the default bindings expect it to be ..." + # + # I have never seen anyone setting this to something else than what + # "the default bindings expect", but let's support it anyway. + selectmode: str = ..., + setgrid: bool = ..., + state: Literal["normal", "disabled"] = ..., + takefocus: _TakeFocusValue = ..., + width: int = ..., + xscrollcommand: _XYScrollCommand = ..., + yscrollcommand: _XYScrollCommand = ..., + ) -> None: ... + @overload + def configure( + self, + cnf: Optional[Dict[str, Any]] = ..., + *, + activestyle: Literal["dotbox", "none", "underline"] = ..., + background: _Color = ..., + bd: _ScreenUnits = ..., + bg: _Color = ..., + border: _ScreenUnits = ..., + borderwidth: _ScreenUnits = ..., + cursor: _Cursor = ..., + disabledforeground: _Color = ..., + exportselection: bool = ..., + fg: _Color = ..., + font: _FontDescription = ..., + foreground: _Color = ..., + height: int = ..., + highlightbackground: _Color = ..., + highlightcolor: _Color = ..., + highlightthickness: _ScreenUnits = ..., + justify: Literal["left", "center", "right"] = ..., + listvariable: Variable = ..., + relief: _Relief = ..., + selectbackground: _Color = ..., + selectborderwidth: _ScreenUnits = ..., + selectforeground: _Color = ..., + selectmode: str = ..., + setgrid: bool = ..., + state: Literal["normal", "disabled"] = ..., + takefocus: _TakeFocusValue = ..., + width: int = ..., + xscrollcommand: _XYScrollCommand = ..., + yscrollcommand: _XYScrollCommand = ..., + ) -> Optional[Dict[str, Tuple[str, str, str, Any, Any]]]: ... + @overload + def configure(self, cnf: _ListboxOptionName) -> Tuple[str, str, str, Any, Any]: ... + config = configure + def cget(self, key: _ListboxOptionName) -> Any: ... def activate(self, index): ... def bbox(self, index): ... def curselection(self): ... @@ -467,10 +1791,94 @@ class Listbox(Widget, XView, YView): def itemconfigure(self, index, cnf: Optional[Any] = ..., **kw): ... itemconfig: Any +_MenuOptionName = Literal[ + "activebackground", + "activeborderwidth", + "activeforeground", + "background", + "bd", + "bg", + "border", + "borderwidth", + "cursor", + "disabledforeground", + "fg", + "font", + "foreground", + "postcommand", + "relief", + "selectcolor", + "takefocus", + "tearoff", + "tearoffcommand", + "title", + "type", +] + class Menu(Widget): - def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + def __init__( + self, + master: Optional[Misc] = ..., + cnf: Optional[Dict[str, Any]] = ..., + *, + activebackground: _Color = ..., + activeborderwidth: _ScreenUnits = ..., + activeforeground: _Color = ..., + background: _Color = ..., + bd: _ScreenUnits = ..., + bg: _Color = ..., + border: _ScreenUnits = ..., + borderwidth: _ScreenUnits = ..., + cursor: _Cursor = ..., + disabledforeground: _Color = ..., + fg: _Color = ..., + font: _FontDescription = ..., + foreground: _Color = ..., + name: str = ..., + postcommand: Union[Callable[[], Any], str] = ..., + relief: _Relief = ..., + selectcolor: _Color = ..., + takefocus: _TakeFocusValue = ..., + tearoff: int = ..., + # I guess tearoffcommand arguments are supposed to be widget objects, + # but they are widget name strings. Use nametowidget() to handle the + # arguments of tearoffcommand. + tearoffcommand: Union[Callable[[str, str], Any], str] = ..., + title: str = ..., + type: Literal["menubar", "tearoff", "normal"] = ..., + ) -> None: ... + @overload + def configure( + self, + cnf: Optional[Dict[str, Any]] = ..., + *, + activebackground: _Color = ..., + activeborderwidth: _ScreenUnits = ..., + activeforeground: _Color = ..., + background: _Color = ..., + bd: _ScreenUnits = ..., + bg: _Color = ..., + border: _ScreenUnits = ..., + borderwidth: _ScreenUnits = ..., + cursor: _Cursor = ..., + disabledforeground: _Color = ..., + fg: _Color = ..., + font: _FontDescription = ..., + foreground: _Color = ..., + postcommand: Union[Callable[[], Any], str] = ..., + relief: _Relief = ..., + selectcolor: _Color = ..., + takefocus: _TakeFocusValue = ..., + tearoff: bool = ..., + tearoffcommand: Union[Callable[[str, str], Any], str] = ..., + title: str = ..., + type: Literal["menubar", "tearoff", "normal"] = ..., + ) -> Optional[Dict[str, Tuple[str, str, str, Any, Any]]]: ... + @overload + def configure(self, cnf: _MenuOptionName) -> Tuple[str, str, str, Any, Any]: ... + config = configure + def cget(self, key: _MenuOptionName) -> Any: ... def tk_popup(self, x, y, entry: str = ...): ... - def tk_bindForTraversal(self): ... def activate(self, index): ... def add(self, itemType, cnf=..., **kw): ... def add_cascade(self, cnf=..., **kw): ... @@ -496,28 +1904,585 @@ class Menu(Widget): def xposition(self, index): ... def yposition(self, index): ... +_MenubuttonOptionName = Literal[ + "activebackground", + "activeforeground", + "anchor", + "background", + "bd", + "bg", + "bitmap", + "border", + "borderwidth", + "compound", + "cursor", + "direction", + "disabledforeground", + "fg", + "font", + "foreground", + "height", + "highlightbackground", + "highlightcolor", + "highlightthickness", + "image", + "indicatoron", + "justify", + "menu", + "padx", + "pady", + "relief", + "state", + "takefocus", + "text", + "textvariable", + "underline", + "width", + "wraplength", +] + class Menubutton(Widget): - def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + def __init__( + self, + master: Optional[Misc] = ..., + cnf: Optional[Dict[str, Any]] = ..., + *, + activebackground: _Color = ..., + activeforeground: _Color = ..., + anchor: _Anchor = ..., + background: _Color = ..., + bd: _ScreenUnits = ..., + bg: _Color = ..., + bitmap: _Bitmap = ..., + border: _ScreenUnits = ..., + borderwidth: _ScreenUnits = ..., + compound: _Compound = ..., + cursor: _Cursor = ..., + direction: Literal["above", "below", "left", "right", "flush"] = ..., + disabledforeground: _Color = ..., + fg: _Color = ..., + font: _FontDescription = ..., + foreground: _Color = ..., + height: _ScreenUnits = ..., + highlightbackground: _Color = ..., + highlightcolor: _Color = ..., + highlightthickness: _ScreenUnits = ..., + image: _ImageSpec = ..., + indicatoron: bool = ..., + justify: Literal["left", "center", "right"] = ..., + menu: Menu = ..., + name: str = ..., + padx: _ScreenUnits = ..., + pady: _ScreenUnits = ..., + relief: _Relief = ..., + state: Literal["normal", "active", "disabled"] = ..., + takefocus: _TakeFocusValue = ..., + text: str = ..., + textvariable: Variable = ..., + underline: int = ..., + width: _ScreenUnits = ..., + wraplength: _ScreenUnits = ..., + ) -> None: ... + @overload + def configure( + self, + cnf: Optional[Dict[str, Any]] = ..., + *, + activebackground: _Color = ..., + activeforeground: _Color = ..., + anchor: _Anchor = ..., + background: _Color = ..., + bd: _ScreenUnits = ..., + bg: _Color = ..., + bitmap: _Bitmap = ..., + border: _ScreenUnits = ..., + borderwidth: _ScreenUnits = ..., + compound: _Compound = ..., + cursor: _Cursor = ..., + direction: Literal["above", "below", "left", "right", "flush"] = ..., + disabledforeground: _Color = ..., + fg: _Color = ..., + font: _FontDescription = ..., + foreground: _Color = ..., + height: _ScreenUnits = ..., + highlightbackground: _Color = ..., + highlightcolor: _Color = ..., + highlightthickness: _ScreenUnits = ..., + image: _ImageSpec = ..., + indicatoron: bool = ..., + justify: Literal["left", "center", "right"] = ..., + menu: Menu = ..., + padx: _ScreenUnits = ..., + pady: _ScreenUnits = ..., + relief: _Relief = ..., + state: Literal["normal", "active", "disabled"] = ..., + takefocus: _TakeFocusValue = ..., + text: str = ..., + textvariable: Variable = ..., + underline: int = ..., + width: _ScreenUnits = ..., + wraplength: _ScreenUnits = ..., + ) -> Optional[Dict[str, Tuple[str, str, str, Any, Any]]]: ... + @overload + def configure(self, cnf: _MenubuttonOptionName) -> Tuple[str, str, str, Any, Any]: ... + config = configure + def cget(self, key: _MenubuttonOptionName) -> Any: ... + +_MessageOptionName = Literal[ + "anchor", + "aspect", + "background", + "bd", + "bg", + "border", + "borderwidth", + "cursor", + "fg", + "font", + "foreground", + "highlightbackground", + "highlightcolor", + "highlightthickness", + "justify", + "padx", + "pady", + "relief", + "takefocus", + "text", + "textvariable", + "width", +] class Message(Widget): - def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + def __init__( + self, + master: Optional[Misc] = ..., + cnf: Optional[Dict[str, Any]] = ..., + *, + anchor: _Anchor = ..., + aspect: int = ..., + background: _Color = ..., + bd: _ScreenUnits = ..., + bg: _Color = ..., + border: _ScreenUnits = ..., + borderwidth: _ScreenUnits = ..., + cursor: _Cursor = ..., + fg: _Color = ..., + font: _FontDescription = ..., + foreground: _Color = ..., + highlightbackground: _Color = ..., + highlightcolor: _Color = ..., + highlightthickness: _ScreenUnits = ..., + justify: Literal["left", "center", "right"] = ..., + name: str = ..., + padx: _ScreenUnits = ..., + pady: _ScreenUnits = ..., + relief: _Relief = ..., + takefocus: _TakeFocusValue = ..., + text: str = ..., + textvariable: Variable = ..., + # there's width but no height + width: _ScreenUnits = ..., + ) -> None: ... + @overload + def configure( + self, + cnf: Optional[Dict[str, Any]] = ..., + *, + anchor: _Anchor = ..., + aspect: int = ..., + background: _Color = ..., + bd: _ScreenUnits = ..., + bg: _Color = ..., + border: _ScreenUnits = ..., + borderwidth: _ScreenUnits = ..., + cursor: _Cursor = ..., + fg: _Color = ..., + font: _FontDescription = ..., + foreground: _Color = ..., + highlightbackground: _Color = ..., + highlightcolor: _Color = ..., + highlightthickness: _ScreenUnits = ..., + justify: Literal["left", "center", "right"] = ..., + padx: _ScreenUnits = ..., + pady: _ScreenUnits = ..., + relief: _Relief = ..., + takefocus: _TakeFocusValue = ..., + text: str = ..., + textvariable: Variable = ..., + width: _ScreenUnits = ..., + ) -> Optional[Dict[str, Tuple[str, str, str, Any, Any]]]: ... + @overload + def configure(self, cnf: _MessageOptionName) -> Tuple[str, str, str, Any, Any]: ... + config = configure + def cget(self, key: _MessageOptionName) -> Any: ... + +_RadiobuttonOptionName = Literal[ + "activebackground", + "activeforeground", + "anchor", + "background", + "bd", + "bg", + "bitmap", + "border", + "borderwidth", + "command", + "compound", + "cursor", + "disabledforeground", + "fg", + "font", + "foreground", + "height", + "highlightbackground", + "highlightcolor", + "highlightthickness", + "image", + "indicatoron", + "justify", + "offrelief", + "overrelief", + "padx", + "pady", + "relief", + "selectcolor", + "selectimage", + "state", + "takefocus", + "text", + "textvariable", + "tristateimage", + "tristatevalue", + "underline", + "value", + "variable", + "width", + "wraplength", +] class Radiobutton(Widget): - def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + def __init__( + self, + master: Optional[Misc] = ..., + cnf: Optional[Dict[str, Any]] = ..., + *, + activebackground: _Color = ..., + activeforeground: _Color = ..., + anchor: _Anchor = ..., + background: _Color = ..., + bd: _ScreenUnits = ..., + bg: _Color = ..., + bitmap: _Bitmap = ..., + border: _ScreenUnits = ..., + borderwidth: _ScreenUnits = ..., + command: _ButtonCommand = ..., + compound: _Compound = ..., + cursor: _Cursor = ..., + disabledforeground: _Color = ..., + fg: _Color = ..., + font: _FontDescription = ..., + foreground: _Color = ..., + height: _ScreenUnits = ..., + highlightbackground: _Color = ..., + highlightcolor: _Color = ..., + highlightthickness: _ScreenUnits = ..., + image: _ImageSpec = ..., + indicatoron: bool = ..., + justify: Literal["left", "center", "right"] = ..., + name: str = ..., + offrelief: _Relief = ..., + overrelief: _Relief = ..., + padx: _ScreenUnits = ..., + pady: _ScreenUnits = ..., + relief: _Relief = ..., + selectcolor: _Color = ..., + selectimage: _ImageSpec = ..., + state: Literal["normal", "active", "disabled"] = ..., + takefocus: _TakeFocusValue = ..., + text: str = ..., + textvariable: Variable = ..., + tristateimage: _ImageSpec = ..., + tristatevalue: Any = ..., + underline: int = ..., + value: Any = ..., + variable: Union[Variable, Literal[""]] = ..., + width: _ScreenUnits = ..., + wraplength: _ScreenUnits = ..., + ) -> None: ... + @overload + def configure( + self, + cnf: Optional[Dict[str, Any]] = ..., + *, + activebackground: _Color = ..., + activeforeground: _Color = ..., + anchor: _Anchor = ..., + background: _Color = ..., + bd: _ScreenUnits = ..., + bg: _Color = ..., + bitmap: _Bitmap = ..., + border: _ScreenUnits = ..., + borderwidth: _ScreenUnits = ..., + command: _ButtonCommand = ..., + compound: _Compound = ..., + cursor: _Cursor = ..., + disabledforeground: _Color = ..., + fg: _Color = ..., + font: _FontDescription = ..., + foreground: _Color = ..., + height: _ScreenUnits = ..., + highlightbackground: _Color = ..., + highlightcolor: _Color = ..., + highlightthickness: _ScreenUnits = ..., + image: _ImageSpec = ..., + indicatoron: bool = ..., + justify: Literal["left", "center", "right"] = ..., + offrelief: _Relief = ..., + overrelief: _Relief = ..., + padx: _ScreenUnits = ..., + pady: _ScreenUnits = ..., + relief: _Relief = ..., + selectcolor: _Color = ..., + selectimage: _ImageSpec = ..., + state: Literal["normal", "active", "disabled"] = ..., + takefocus: _TakeFocusValue = ..., + text: str = ..., + textvariable: Variable = ..., + tristateimage: _ImageSpec = ..., + tristatevalue: Any = ..., + underline: int = ..., + value: Any = ..., + variable: Union[Variable, Literal[""]] = ..., + width: _ScreenUnits = ..., + wraplength: _ScreenUnits = ..., + ) -> Optional[Dict[str, Tuple[str, str, str, Any, Any]]]: ... + @overload + def configure(self, cnf: _RadiobuttonOptionName) -> Tuple[str, str, str, Any, Any]: ... + config = configure + def cget(self, key: _RadiobuttonOptionName) -> Any: ... def deselect(self): ... def flash(self): ... def invoke(self): ... def select(self): ... +_ScaleOptionName = Literal[ + "activebackground", + "background", + "bd", + "bg", + "bigincrement", + "border", + "borderwidth", + "command", + "cursor", + "digits", + "fg", + "font", + "foreground", + "from", + "highlightbackground", + "highlightcolor", + "highlightthickness", + "label", + "length", + "orient", + "relief", + "repeatdelay", + "repeatinterval", + "resolution", + "showvalue", + "sliderlength", + "sliderrelief", + "state", + "takefocus", + "tickinterval", + "to", + "troughcolor", + "variable", + "width", +] + class Scale(Widget): - def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + def __init__( + self, + master: Optional[Misc] = ..., + cnf: Optional[Dict[str, Any]] = ..., + *, + activebackground: _Color = ..., + background: _Color = ..., + bd: _ScreenUnits = ..., + bg: _Color = ..., + bigincrement: float = ..., + border: _ScreenUnits = ..., + borderwidth: _ScreenUnits = ..., + # don't know why the callback gets string instead of float + command: Union[str, Callable[[str], Any]] = ..., + cursor: _Cursor = ..., + digits: int = ..., + fg: _Color = ..., + font: _FontDescription = ..., + foreground: _Color = ..., + from_: float = ..., + highlightbackground: _Color = ..., + highlightcolor: _Color = ..., + highlightthickness: _ScreenUnits = ..., + label: str = ..., + length: _ScreenUnits = ..., + name: str = ..., + orient: Literal["horizontal", "vertical"] = ..., + relief: _Relief = ..., + repeatdelay: int = ..., + repeatinterval: int = ..., + resolution: float = ..., + showvalue: bool = ..., + sliderlength: _ScreenUnits = ..., + sliderrelief: _Relief = ..., + state: Literal["normal", "active", "disabled"] = ..., + takefocus: _TakeFocusValue = ..., + tickinterval: float = ..., + to: float = ..., + troughcolor: _Color = ..., + variable: DoubleVar = ..., + width: _ScreenUnits = ..., + ) -> None: ... + @overload + def configure( + self, + cnf: Optional[Dict[str, Any]] = ..., + *, + activebackground: _Color = ..., + background: _Color = ..., + bd: _ScreenUnits = ..., + bg: _Color = ..., + bigincrement: float = ..., + border: _ScreenUnits = ..., + borderwidth: _ScreenUnits = ..., + command: Union[str, Callable[[str], Any]] = ..., + cursor: _Cursor = ..., + digits: int = ..., + fg: _Color = ..., + font: _FontDescription = ..., + foreground: _Color = ..., + from_: float = ..., + highlightbackground: _Color = ..., + highlightcolor: _Color = ..., + highlightthickness: _ScreenUnits = ..., + label: str = ..., + length: _ScreenUnits = ..., + orient: Literal["horizontal", "vertical"] = ..., + relief: _Relief = ..., + repeatdelay: int = ..., + repeatinterval: int = ..., + resolution: float = ..., + showvalue: bool = ..., + sliderlength: _ScreenUnits = ..., + sliderrelief: _Relief = ..., + state: Literal["normal", "active", "disabled"] = ..., + takefocus: _TakeFocusValue = ..., + tickinterval: float = ..., + to: float = ..., + troughcolor: _Color = ..., + variable: DoubleVar = ..., + width: _ScreenUnits = ..., + ) -> Optional[Dict[str, Tuple[str, str, str, Any, Any]]]: ... + @overload + def configure(self, cnf: _ScaleOptionName) -> Tuple[str, str, str, Any, Any]: ... + config = configure + def cget(self, key: _ScaleOptionName) -> Any: ... def get(self): ... def set(self, value): ... def coords(self, value: Optional[Any] = ...): ... def identify(self, x, y): ... +_ScrollbarOptionName = Literal[ + "activebackground", + "activerelief", + "background", + "bd", + "bg", + "border", + "borderwidth", + "command", + "cursor", + "elementborderwidth", + "highlightbackground", + "highlightcolor", + "highlightthickness", + "jump", + "orient", + "relief", + "repeatdelay", + "repeatinterval", + "takefocus", + "troughcolor", + "width", +] + class Scrollbar(Widget): - def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + def __init__( + self, + master: Optional[Misc] = ..., + cnf: Optional[Dict[str, Any]] = ..., + *, + activebackground: _Color = ..., + activerelief: _Relief = ..., + background: _Color = ..., + bd: _ScreenUnits = ..., + bg: _Color = ..., + border: _ScreenUnits = ..., + borderwidth: _ScreenUnits = ..., + # There are many ways how the command may get called. Search for + # 'SCROLLING COMMANDS' in scrollbar man page. There doesn't seem to + # be any way to specify an overloaded callback function, so we say + # that it can take any args while it can't in reality. + command: Union[Callable[..., Optional[Tuple[float, float]]], str] = ..., + cursor: _Cursor = ..., + elementborderwidth: _ScreenUnits = ..., + highlightbackground: _Color = ..., + highlightcolor: _Color = ..., + highlightthickness: _ScreenUnits = ..., + jump: bool = ..., + name: str = ..., + orient: Literal["horizontal", "vertical"] = ..., + relief: _Relief = ..., + repeatdelay: int = ..., + repeatinterval: int = ..., + takefocus: _TakeFocusValue = ..., + troughcolor: _Color = ..., + width: _ScreenUnits = ..., + ) -> None: ... + @overload + def configure( + self, + cnf: Optional[Dict[str, Any]] = ..., + *, + activebackground: _Color = ..., + activerelief: _Relief = ..., + background: _Color = ..., + bd: _ScreenUnits = ..., + bg: _Color = ..., + border: _ScreenUnits = ..., + borderwidth: _ScreenUnits = ..., + command: Union[Callable[..., Optional[Tuple[float, float]]], str] = ..., + cursor: _Cursor = ..., + elementborderwidth: _ScreenUnits = ..., + highlightbackground: _Color = ..., + highlightcolor: _Color = ..., + highlightthickness: _ScreenUnits = ..., + jump: bool = ..., + orient: Literal["horizontal", "vertical"] = ..., + relief: _Relief = ..., + repeatdelay: int = ..., + repeatinterval: int = ..., + takefocus: _TakeFocusValue = ..., + troughcolor: _Color = ..., + width: _ScreenUnits = ..., + ) -> Optional[Dict[str, Tuple[str, str, str, Any, Any]]]: ... + @overload + def configure(self, cnf: _ScrollbarOptionName) -> Tuple[str, str, str, Any, Any]: ... + config = configure + def cget(self, key: _ScrollbarOptionName) -> Any: ... def activate(self, index: Optional[Any] = ...): ... def delta(self, deltax, deltay): ... def fraction(self, x, y): ... @@ -525,79 +2490,373 @@ class Scrollbar(Widget): def get(self): ... def set(self, first, last): ... +_TextIndex = Union[_tkinter.Tcl_Obj, str, float] +_TextOptionName = Literal[ + "autoseparators", + "background", + "bd", + "bg", + "blockcursor", + "border", + "borderwidth", + "cursor", + "endline", + "exportselection", + "fg", + "font", + "foreground", + "height", + "highlightbackground", + "highlightcolor", + "highlightthickness", + "inactiveselectbackground", + "insertbackground", + "insertborderwidth", + "insertofftime", + "insertontime", + "insertunfocussed", + "insertwidth", + "maxundo", + "padx", + "pady", + "relief", + "selectbackground", + "selectborderwidth", + "selectforeground", + "setgrid", + "spacing1", + "spacing2", + "spacing3", + "startline", + "state", + "tabs", + "tabstyle", + "takefocus", + "undo", + "width", + "wrap", + "xscrollcommand", + "yscrollcommand", +] + class Text(Widget, XView, YView): - def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... - def bbox(self, index): ... - def compare(self, index1, op, index2): ... - def count(self, index1, index2, *args): ... - def debug(self, boolean: Optional[Any] = ...): ... - def delete(self, index1, index2: Optional[Any] = ...): ... - def dlineinfo(self, index): ... - def dump(self, index1, index2: Optional[Any] = ..., command: Optional[Any] = ..., **kw): ... - def edit(self, *args): ... - def edit_modified(self, arg: Optional[Any] = ...): ... - def edit_redo(self): ... - def edit_reset(self): ... - def edit_separator(self): ... - def edit_undo(self): ... - def get(self, index1, index2: Optional[Any] = ...): ... + def __init__( + self, + master: Optional[Misc] = ..., + cnf: Optional[Dict[str, Any]] = ..., + *, + autoseparators: bool = ..., + background: _Color = ..., + bd: _ScreenUnits = ..., + bg: _Color = ..., + blockcursor: bool = ..., + border: _ScreenUnits = ..., + borderwidth: _ScreenUnits = ..., + cursor: _Cursor = ..., + endline: Union[int, Literal[""]] = ..., + exportselection: bool = ..., + fg: _Color = ..., + font: _FontDescription = ..., + foreground: _Color = ..., + # width is always int, but height is allowed to be ScreenUnits. + # This doesn't make any sense to me, and this isn't documented. + # The docs seem to say that both should be integers. + height: _ScreenUnits = ..., + highlightbackground: _Color = ..., + highlightcolor: _Color = ..., + highlightthickness: _ScreenUnits = ..., + inactiveselectbackground: _Color = ..., + insertbackground: _Color = ..., + insertborderwidth: _ScreenUnits = ..., + insertofftime: int = ..., + insertontime: int = ..., + insertunfocussed: Literal["none", "hollow", "solid"] = ..., + insertwidth: _ScreenUnits = ..., + maxundo: int = ..., + name: str = ..., + padx: _ScreenUnits = ..., + pady: _ScreenUnits = ..., + relief: _Relief = ..., + selectbackground: _Color = ..., + selectborderwidth: _ScreenUnits = ..., + selectforeground: _Color = ..., + setgrid: bool = ..., + spacing1: _ScreenUnits = ..., + spacing2: _ScreenUnits = ..., + spacing3: _ScreenUnits = ..., + startline: Union[int, Literal[""]] = ..., + state: Literal["normal", "disabled"] = ..., + # Literal inside Tuple doesn't actually work + tabs: Union[_ScreenUnits, str, Tuple[Union[_ScreenUnits, str], ...]] = ..., + tabstyle: Literal["tabular", "wordprocessor"] = ..., + takefocus: _TakeFocusValue = ..., + undo: bool = ..., + width: int = ..., + wrap: Literal["none", "char", "word"] = ..., + xscrollcommand: _XYScrollCommand = ..., + yscrollcommand: _XYScrollCommand = ..., + ) -> None: ... + @overload + def configure( + self, + cnf: Optional[Dict[str, Any]] = ..., + *, + autoseparators: bool = ..., + background: _Color = ..., + bd: _ScreenUnits = ..., + bg: _Color = ..., + blockcursor: bool = ..., + border: _ScreenUnits = ..., + borderwidth: _ScreenUnits = ..., + cursor: _Cursor = ..., + endline: Union[int, Literal[""]] = ..., + exportselection: bool = ..., + fg: _Color = ..., + font: _FontDescription = ..., + foreground: _Color = ..., + height: _ScreenUnits = ..., + highlightbackground: _Color = ..., + highlightcolor: _Color = ..., + highlightthickness: _ScreenUnits = ..., + inactiveselectbackground: _Color = ..., + insertbackground: _Color = ..., + insertborderwidth: _ScreenUnits = ..., + insertofftime: int = ..., + insertontime: int = ..., + insertunfocussed: Literal["none", "hollow", "solid"] = ..., + insertwidth: _ScreenUnits = ..., + maxundo: int = ..., + padx: _ScreenUnits = ..., + pady: _ScreenUnits = ..., + relief: _Relief = ..., + selectbackground: _Color = ..., + selectborderwidth: _ScreenUnits = ..., + selectforeground: _Color = ..., + setgrid: bool = ..., + spacing1: _ScreenUnits = ..., + spacing2: _ScreenUnits = ..., + spacing3: _ScreenUnits = ..., + startline: Union[int, Literal[""]] = ..., + state: Literal["normal", "disabled"] = ..., + tabs: Union[_ScreenUnits, str, Tuple[Union[_ScreenUnits, str], ...]] = ..., + tabstyle: Literal["tabular", "wordprocessor"] = ..., + takefocus: _TakeFocusValue = ..., + undo: bool = ..., + width: int = ..., + wrap: Literal["none", "char", "word"] = ..., + xscrollcommand: _XYScrollCommand = ..., + yscrollcommand: _XYScrollCommand = ..., + ) -> Optional[Dict[str, Tuple[str, str, str, Any, Any]]]: ... + @overload + def configure(self, cnf: _TextOptionName) -> Tuple[str, str, str, Any, Any]: ... + config = configure + def cget(self, key: _TextOptionName) -> Any: ... + def bbox(self, index: _TextIndex) -> Optional[Tuple[int, int, int, int]]: ... + def compare(self, index1: _TextIndex, op: Literal["<", "<=", "==", ">=", ">", "!="], index2: _TextIndex) -> bool: ... + def count(self, index1, index2, *args): ... # TODO + @overload + def debug(self, boolean: None = ...) -> bool: ... + @overload + def debug(self, boolean: bool) -> None: ... + def delete(self, index1: _TextIndex, index2: Optional[_TextIndex] = ...) -> None: ... + def dlineinfo(self, index: _TextIndex) -> Optional[Tuple[int, int, int, int, int]]: ... + @overload + def dump( + self, + index1: _TextIndex, + index2: Optional[_TextIndex] = ..., + command: None = ..., + *, + all: bool = ..., + image: bool = ..., + mark: bool = ..., + tag: bool = ..., + text: bool = ..., + window: bool = ..., + ) -> List[Tuple[str, str, str]]: ... + @overload + def dump( + self, + index1: _TextIndex, + index2: Optional[_TextIndex], + command: Union[Callable[[str, str, str], Any], str], + *, + all: bool = ..., + image: bool = ..., + mark: bool = ..., + tag: bool = ..., + text: bool = ..., + window: bool = ..., + ) -> None: ... + @overload + def dump( + self, + index1: _TextIndex, + index2: Optional[_TextIndex] = ..., + *, + command: Union[Callable[[str, str, str], Any], str], + all: bool = ..., + image: bool = ..., + mark: bool = ..., + tag: bool = ..., + text: bool = ..., + window: bool = ..., + ) -> None: ... + def edit(self, *args): ... # docstring says "Internal method" + @overload + def edit_modified(self, arg: None = ...) -> bool: ... # actually returns Literal[0, 1] + @overload + def edit_modified(self, arg: bool) -> None: ... # actually returns empty string + def edit_redo(self) -> None: ... # actually returns empty string + def edit_reset(self) -> None: ... # actually returns empty string + def edit_separator(self) -> None: ... # actually returns empty string + def edit_undo(self) -> None: ... # actually returns empty string + def get(self, index1: _TextIndex, index2: Optional[_TextIndex] = ...) -> str: ... + # TODO: image_* methods def image_cget(self, index, option): ... def image_configure(self, index, cnf: Optional[Any] = ..., **kw): ... def image_create(self, index, cnf=..., **kw): ... def image_names(self): ... - def index(self, index): ... - def insert(self, index, chars, *args): ... - def mark_gravity(self, markName, direction: Optional[Any] = ...): ... - def mark_names(self): ... - def mark_set(self, markName, index): ... - def mark_unset(self, *markNames): ... - def mark_next(self, index): ... - def mark_previous(self, index): ... - def peer_create(self, newPathName, cnf=..., **kw): ... - def peer_names(self): ... - def replace(self, index1, index2, chars, *args): ... - def scan_mark(self, x, y): ... - def scan_dragto(self, x, y): ... - def search(self, pattern, index, stopindex: Optional[Any] = ..., forwards: Optional[Any] = ..., - backwards: Optional[Any] = ..., exact: Optional[Any] = ..., regexp: Optional[Any] = ..., - nocase: Optional[Any] = ..., count: Optional[Any] = ..., elide: Optional[Any] = ...): ... - def see(self, index): ... - def tag_add(self, tagName, index1, *args): ... - def tag_unbind(self, tagName, sequence, funcid: Optional[Any] = ...): ... - def tag_bind(self, tagName, sequence, func, add: Optional[Any] = ...): ... - def tag_cget(self, tagName, option): ... - def tag_configure(self, tagName, cnf: Optional[Any] = ..., **kw): ... - tag_config: Any - def tag_delete(self, *tagNames): ... - def tag_lower(self, tagName, belowThis: Optional[Any] = ...): ... - def tag_names(self, index: Optional[Any] = ...): ... - def tag_nextrange(self, tagName, index1, index2: Optional[Any] = ...): ... - def tag_prevrange(self, tagName, index1, index2: Optional[Any] = ...): ... - def tag_raise(self, tagName, aboveThis: Optional[Any] = ...): ... - def tag_ranges(self, tagName): ... - def tag_remove(self, tagName, index1, index2: Optional[Any] = ...): ... + def index(self, index: _TextIndex) -> str: ... + def insert(self, index: _TextIndex, chars: str, *args: Union[_TextIndex, str, _TkinterSequence[str]]) -> None: ... + @overload + def mark_gravity(self, markName: str, direction: None = ...) -> Literal["left", "right"]: ... + @overload + def mark_gravity(self, markName: str, direction: Literal["left", "right"]) -> None: ... # actually returns empty string + def mark_names(self) -> Tuple[str, ...]: ... + def mark_set(self, markName: str, index: _TextIndex) -> None: ... + def mark_unset(self, *markNames: str) -> None: ... + def mark_next(self, index: _TextIndex) -> Optional[str]: ... + def mark_previous(self, index: _TextIndex): ... + # **kw of peer_create is same as the kwargs of Text.__init__ + def peer_create(self, newPathName: Union[str, Text], cnf: Dict[str, Any] = ..., **kw: Any) -> None: ... + def peer_names(self) -> Tuple[_tkinter.Tcl_Obj, ...]: ... + def replace( + self, index1: _TextIndex, index2: _TextIndex, chars: str, *args: Union[_TextIndex, str, _TkinterSequence[str]] + ) -> None: ... + def scan_mark(self, x: int, y: int) -> None: ... + def scan_dragto(self, x: int, y: int) -> None: ... + def search( + self, + pattern: str, + index: _TextIndex, + stopindex: Optional[_TextIndex] = ..., + forwards: Optional[bool] = ..., + backwards: Optional[bool] = ..., + exact: Optional[bool] = ..., + regexp: Optional[bool] = ..., + nocase: Optional[bool] = ..., + count: Optional[Variable] = ..., + elide: Optional[bool] = ..., + ) -> str: ... # returns empty string for not found + def see(self, index: _TextIndex) -> None: ... + def tag_add(self, tagName: str, index1: _TextIndex, *args: _TextIndex) -> None: ... + # tag_bind stuff is very similar to Canvas + @overload + def tag_bind( + self, + tagName: str, + sequence: Optional[str], + func: Optional[Callable[[Event[Text]], Optional[Literal["break"]]]], + add: Optional[bool] = ..., + ) -> str: ... + @overload + def tag_bind(self, tagName: str, sequence: Optional[str], func: str, add: Optional[bool] = ...) -> None: ... + def tag_unbind(self, tagName: str, sequence: str, funcid: Optional[str] = ...) -> None: ... + # allowing any string for cget instead of just Literals because there's no other way to look up tag options + def tag_cget(self, tagName: str, option: str) -> Any: ... + @overload + def tag_configure( + self, + tagName: str, + cnf: Optional[Dict[str, Any]] = ..., + *, + background: _Color = ..., + bgstipple: _Bitmap = ..., + borderwidth: _ScreenUnits = ..., + border: _ScreenUnits = ..., # alias for borderwidth + elide: bool = ..., + fgstipple: _Bitmap = ..., + font: _FontDescription = ..., + foreground: _Color = ..., + justify: Literal["left", "right", "center"] = ..., + lmargin1: _ScreenUnits = ..., + lmargin2: _ScreenUnits = ..., + lmargincolor: _Color = ..., + offset: _ScreenUnits = ..., + overstrike: bool = ..., + overstrikefg: _Color = ..., + relief: _Relief = ..., + rmargin: _ScreenUnits = ..., + rmargincolor: _Color = ..., + selectbackground: _Color = ..., + selectforeground: _Color = ..., + spacing1: _ScreenUnits = ..., + spacing2: _ScreenUnits = ..., + spacing3: _ScreenUnits = ..., + tabs: Any = ..., # the exact type is kind of complicated, see manual page + tabstyle: Literal["tabular", "wordprocessor"] = ..., + underline: bool = ..., + underlinefg: _Color = ..., + wrap: Literal["none", "char", "word"] = ..., # be careful with "none" vs None + ) -> Optional[Dict[str, Tuple[str, str, str, Any, Any]]]: ... + @overload + def tag_configure(self, tagName: str, cnf: str) -> Tuple[str, str, str, Any, Any]: ... + tag_config = tag_configure + def tag_delete(self, __first_tag_name: str, *tagNames: str) -> None: ... # error if no tag names given + def tag_lower(self, tagName: str, belowThis: Optional[str] = ...) -> None: ... + def tag_names(self, index: Optional[_TextIndex] = ...) -> Tuple[str, ...]: ... + def tag_nextrange( + self, tagName: str, index1: _TextIndex, index2: Optional[_TextIndex] = ... + ) -> Union[Tuple[str, str], Tuple[()]]: ... + def tag_prevrange( + self, tagName: str, index1: _TextIndex, index2: Optional[_TextIndex] = ... + ) -> Union[Tuple[str, str], Tuple[()]]: ... + def tag_raise(self, tagName: str, aboveThis: Optional[str] = ...) -> None: ... + def tag_ranges(self, tagName: str) -> Tuple[_tkinter.Tcl_Obj, ...]: ... + # tag_remove and tag_delete are different + def tag_remove(self, tagName: str, index1: _TextIndex, index2: Optional[_TextIndex] = ...) -> None: ... + # TODO: window_* methods def window_cget(self, index, option): ... def window_configure(self, index, cnf: Optional[Any] = ..., **kw): ... - window_config: Any + window_config = window_configure def window_create(self, index, cnf=..., **kw): ... def window_names(self): ... - def yview_pickplace(self, *what): ... + def yview_pickplace(self, *what): ... # deprecated class _setit: def __init__(self, var, value, callback: Optional[Any] = ...): ... def __call__(self, *args): ... +# manual page: tk_optionMenu class OptionMenu(Menubutton): widgetName: Any menuname: Any - def __init__(self, master, variable, value, *values, **kwargs): ... - def __getitem__(self, name): ... - def destroy(self): ... + def __init__( + # differs from other widgets + self, + master: Optional[Misc], + variable: StringVar, + value: str, + *values: str, + # kwarg only from now on + command: Optional[Callable[[StringVar], Any]] = ..., + ) -> None: ... + # configure, config, cget are inherited from Menubutton + # destroy and __getitem__ are overrided, signature does not change + +class _Image(Protocol): + tk: _tkinter.TkappType + def __del__(self) -> None: ... + def height(self) -> int: ... + def width(self) -> int: ... class Image: name: Any - tk: Any - def __init__(self, imgtype, name: Optional[Any] = ..., cnf=..., master: Optional[Any] = ..., **kw): ... + tk: _tkinter.TkappType + def __init__( + self, imgtype, name: Optional[Any] = ..., cnf=..., master: Optional[Union[Misc, _tkinter.TkappType]] = ..., **kw + ): ... def __del__(self): ... def __setitem__(self, key, value): ... def __getitem__(self, key): ... @@ -628,8 +2887,178 @@ class BitmapImage(Image): def image_names(): ... def image_types(): ... +_SpinboxOptionName = Literal[ + "activebackground", + "background", + "bd", + "bg", + "border", + "borderwidth", + "buttonbackground", + "buttoncursor", + "buttondownrelief", + "buttonuprelief", + "command", + "cursor", + "disabledbackground", + "disabledforeground", + "exportselection", + "fg", + "font", + "foreground", + "format", + "from", + "highlightbackground", + "highlightcolor", + "highlightthickness", + "increment", + "insertbackground", + "insertborderwidth", + "insertofftime", + "insertontime", + "insertwidth", + "invalidcommand", + "invcmd", + "justify", + "readonlybackground", + "relief", + "repeatdelay", + "repeatinterval", + "selectbackground", + "selectborderwidth", + "selectforeground", + "state", + "takefocus", + "textvariable", + "to", + "validate", + "validatecommand", + "vcmd", + "values", + "width", + "wrap", + "xscrollcommand", +] + class Spinbox(Widget, XView): - def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + def __init__( + self, + master: Optional[Misc] = ..., + cnf: Optional[Dict[str, Any]] = ..., + *, + activebackground: _Color = ..., + background: _Color = ..., + bd: _ScreenUnits = ..., + bg: _Color = ..., + border: _ScreenUnits = ..., + borderwidth: _ScreenUnits = ..., + buttonbackground: _Color = ..., + buttoncursor: _Cursor = ..., + buttondownrelief: _Relief = ..., + buttonuprelief: _Relief = ..., + # percent substitutions don't seem to be supported, it's similar to Entry's validion stuff + command: Union[Callable[[], Any], str, _TkinterSequence[str]] = ..., + cursor: _Cursor = ..., + disabledbackground: _Color = ..., + disabledforeground: _Color = ..., + exportselection: bool = ..., + fg: _Color = ..., + font: _FontDescription = ..., + foreground: _Color = ..., + format: str = ..., + from_: float = ..., + highlightbackground: _Color = ..., + highlightcolor: _Color = ..., + highlightthickness: _ScreenUnits = ..., + increment: float = ..., + insertbackground: _Color = ..., + insertborderwidth: _ScreenUnits = ..., + insertofftime: int = ..., + insertontime: int = ..., + insertwidth: _ScreenUnits = ..., + invalidcommand: _EntryValidateCommand = ..., + invcmd: _EntryValidateCommand = ..., + justify: Literal["left", "center", "right"] = ..., + name: str = ..., + readonlybackground: _Color = ..., + relief: _Relief = ..., + repeatdelay: int = ..., + repeatinterval: int = ..., + selectbackground: _Color = ..., + selectborderwidth: _ScreenUnits = ..., + selectforeground: _Color = ..., + state: Literal["normal", "disabled", "readonly"] = ..., + takefocus: _TakeFocusValue = ..., + textvariable: Variable = ..., + to: float = ..., + validate: Literal["none", "focus", "focusin", "focusout", "key", "all"] = ..., + validatecommand: _EntryValidateCommand = ..., + vcmd: _EntryValidateCommand = ..., + values: _TkinterSequence[str] = ..., + width: int = ..., + wrap: bool = ..., + xscrollcommand: _XYScrollCommand = ..., + ) -> None: ... + @overload + def configure( + self, + cnf: Optional[Dict[str, Any]] = ..., + *, + activebackground: _Color = ..., + background: _Color = ..., + bd: _ScreenUnits = ..., + bg: _Color = ..., + border: _ScreenUnits = ..., + borderwidth: _ScreenUnits = ..., + buttonbackground: _Color = ..., + buttoncursor: _Cursor = ..., + buttondownrelief: _Relief = ..., + buttonuprelief: _Relief = ..., + command: Union[Callable[[], Any], str, _TkinterSequence[str]] = ..., + cursor: _Cursor = ..., + disabledbackground: _Color = ..., + disabledforeground: _Color = ..., + exportselection: bool = ..., + fg: _Color = ..., + font: _FontDescription = ..., + foreground: _Color = ..., + format: str = ..., + from_: float = ..., + highlightbackground: _Color = ..., + highlightcolor: _Color = ..., + highlightthickness: _ScreenUnits = ..., + increment: float = ..., + insertbackground: _Color = ..., + insertborderwidth: _ScreenUnits = ..., + insertofftime: int = ..., + insertontime: int = ..., + insertwidth: _ScreenUnits = ..., + invalidcommand: _EntryValidateCommand = ..., + invcmd: _EntryValidateCommand = ..., + justify: Literal["left", "center", "right"] = ..., + readonlybackground: _Color = ..., + relief: _Relief = ..., + repeatdelay: int = ..., + repeatinterval: int = ..., + selectbackground: _Color = ..., + selectborderwidth: _ScreenUnits = ..., + selectforeground: _Color = ..., + state: Literal["normal", "disabled", "readonly"] = ..., + takefocus: _TakeFocusValue = ..., + textvariable: Variable = ..., + to: float = ..., + validate: Literal["none", "focus", "focusin", "focusout", "key", "all"] = ..., + validatecommand: _EntryValidateCommand = ..., + vcmd: _EntryValidateCommand = ..., + values: _TkinterSequence[str] = ..., + width: int = ..., + wrap: bool = ..., + xscrollcommand: _XYScrollCommand = ..., + ) -> Optional[Dict[str, Tuple[str, str, str, Any, Any]]]: ... + @overload + def configure(self, cnf: _SpinboxOptionName) -> Tuple[str, str, str, Any, Any]: ... + config = configure + def cget(self, key: _SpinboxOptionName) -> Any: ... def bbox(self, index): ... def delete(self, first, last: Optional[Any] = ...): ... def get(self): ... @@ -651,11 +3080,184 @@ class Spinbox(Widget, XView): def selection_range(self, start: int, end: int) -> None: ... def selection_to(self, index: int) -> None: ... +_LabelFrameOptionName = Literal[ + "background", + "bd", + "bg", + "border", + "borderwidth", + "class", + "colormap", + "container", + "cursor", + "fg", + "font", + "foreground", + "height", + "highlightbackground", + "highlightcolor", + "highlightthickness", + "labelanchor", + "labelwidget", + "padx", + "pady", + "relief", + "takefocus", + "text", + "visual", + "width", +] + class LabelFrame(Widget): - def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + def __init__( + self, + master: Optional[Misc] = ..., + cnf: Optional[Dict[str, Any]] = ..., + *, + background: _Color = ..., + bd: _ScreenUnits = ..., + bg: _Color = ..., + border: _ScreenUnits = ..., + borderwidth: _ScreenUnits = ..., + class_: str = ..., + colormap: Union[Literal["new", ""], Misc] = ..., + container: bool = ..., # undocumented + cursor: _Cursor = ..., + fg: _Color = ..., + font: _FontDescription = ..., + foreground: _Color = ..., + height: _ScreenUnits = ..., + highlightbackground: _Color = ..., + highlightcolor: _Color = ..., + highlightthickness: _ScreenUnits = ..., + # 'ne' and 'en' are valid labelanchors, but only 'ne' is a valid _Anchor. + labelanchor: Literal["nw", "n", "ne", "en", "e", "es", "se", "s", "sw", "ws", "w", "wn"] = ..., + labelwidget: Misc = ..., + name: str = ..., + padx: _ScreenUnits = ..., + pady: _ScreenUnits = ..., + relief: _Relief = ..., + takefocus: _TakeFocusValue = ..., + text: str = ..., + visual: Union[str, Tuple[str, int]] = ..., + width: _ScreenUnits = ..., + ) -> None: ... + @overload + def configure( + self, + cnf: Optional[Dict[str, Any]] = ..., + *, + background: _Color = ..., + bd: _ScreenUnits = ..., + bg: _Color = ..., + border: _ScreenUnits = ..., + borderwidth: _ScreenUnits = ..., + cursor: _Cursor = ..., + fg: _Color = ..., + font: _FontDescription = ..., + foreground: _Color = ..., + height: _ScreenUnits = ..., + highlightbackground: _Color = ..., + highlightcolor: _Color = ..., + highlightthickness: _ScreenUnits = ..., + labelanchor: Literal["nw", "n", "ne", "en", "e", "es", "se", "s", "sw", "ws", "w", "wn"] = ..., + labelwidget: Misc = ..., + padx: _ScreenUnits = ..., + pady: _ScreenUnits = ..., + relief: _Relief = ..., + takefocus: _TakeFocusValue = ..., + text: str = ..., + width: _ScreenUnits = ..., + ) -> Optional[Dict[str, Tuple[str, str, str, Any, Any]]]: ... + @overload + def configure(self, cnf: _LabelFrameOptionName) -> Tuple[str, str, str, Any, Any]: ... + config = configure + def cget(self, key: _LabelFrameOptionName) -> Any: ... + +_PanedWindowOptionName = Literal[ + "background", + "bd", + "bg", + "border", + "borderwidth", + "cursor", + "handlepad", + "handlesize", + "height", + "opaqueresize", + "orient", + "proxybackground", + "proxyborderwidth", + "proxyrelief", + "relief", + "sashcursor", + "sashpad", + "sashrelief", + "sashwidth", + "showhandle", + "width", +] class PanedWindow(Widget): - def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + def __init__( + self, + master: Optional[Misc] = ..., + cnf: Optional[Dict[str, Any]] = ..., + *, + background: _Color = ..., + bd: _ScreenUnits = ..., + bg: _Color = ..., + border: _ScreenUnits = ..., + borderwidth: _ScreenUnits = ..., + cursor: _Cursor = ..., + handlepad: _ScreenUnits = ..., + handlesize: _ScreenUnits = ..., + height: _ScreenUnits = ..., + name: str = ..., + opaqueresize: bool = ..., + orient: Literal["horizontal", "vertical"] = ..., + proxybackground: _Color = ..., + proxyborderwidth: _ScreenUnits = ..., + proxyrelief: _Relief = ..., + relief: _Relief = ..., + sashcursor: _Cursor = ..., + sashpad: _ScreenUnits = ..., + sashrelief: _Relief = ..., + sashwidth: _ScreenUnits = ..., + showhandle: bool = ..., + width: _ScreenUnits = ..., + ) -> None: ... + @overload + def configure( + self, + cnf: Optional[Dict[str, Any]] = ..., + *, + background: _Color = ..., + bd: _ScreenUnits = ..., + bg: _Color = ..., + border: _ScreenUnits = ..., + borderwidth: _ScreenUnits = ..., + cursor: _Cursor = ..., + handlepad: _ScreenUnits = ..., + handlesize: _ScreenUnits = ..., + height: _ScreenUnits = ..., + opaqueresize: bool = ..., + orient: Literal["horizontal", "vertical"] = ..., + proxybackground: _Color = ..., + proxyborderwidth: _ScreenUnits = ..., + proxyrelief: _Relief = ..., + relief: _Relief = ..., + sashcursor: _Cursor = ..., + sashpad: _ScreenUnits = ..., + sashrelief: _Relief = ..., + sashwidth: _ScreenUnits = ..., + showhandle: bool = ..., + width: _ScreenUnits = ..., + ) -> Optional[Dict[str, Tuple[str, str, str, Any, Any]]]: ... + @overload + def configure(self, cnf: _PanedWindowOptionName) -> Tuple[str, str, str, Any, Any]: ... + config = configure + def cget(self, key: _PanedWindowOptionName) -> Any: ... def add(self, child, **kw): ... def remove(self, child): ... forget: Any diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/tkinter/commondialog.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/tkinter/commondialog.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/tkinter/constants.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/tkinter/constants.pyi old mode 100755 new mode 100644 index e21a93e6..1383b0f9 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/tkinter/constants.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/tkinter/constants.pyi @@ -1,79 +1,80 @@ -from typing import Any +from typing_extensions import Literal -NO: Any -YES: Any -TRUE: Any -FALSE: Any -ON: Any -OFF: Any -N: Any -S: Any -W: Any -E: Any -NW: Any -SW: Any -NE: Any -SE: Any -NS: Any -EW: Any -NSEW: Any -CENTER: Any -NONE: Any -X: Any -Y: Any -BOTH: Any -LEFT: Any -TOP: Any -RIGHT: Any -BOTTOM: Any -RAISED: Any -SUNKEN: Any -FLAT: Any -RIDGE: Any -GROOVE: Any -SOLID: Any -HORIZONTAL: Any -VERTICAL: Any -NUMERIC: Any -CHAR: Any -WORD: Any -BASELINE: Any -INSIDE: Any -OUTSIDE: Any -SEL: Any -SEL_FIRST: Any -SEL_LAST: Any -END: Any -INSERT: Any -CURRENT: Any -ANCHOR: Any -ALL: Any -NORMAL: Any -DISABLED: Any -ACTIVE: Any -HIDDEN: Any -CASCADE: Any -CHECKBUTTON: Any -COMMAND: Any -RADIOBUTTON: Any -SEPARATOR: Any -SINGLE: Any -BROWSE: Any -MULTIPLE: Any -EXTENDED: Any -DOTBOX: Any -UNDERLINE: Any -PIESLICE: Any -CHORD: Any -ARC: Any -FIRST: Any -LAST: Any -BUTT: Any -PROJECTING: Any -ROUND: Any -BEVEL: Any -MITER: Any -MOVETO: Any -SCROLL: Any -UNITS: Any -PAGES: Any +# These are not actually bools. See #4669 +NO: bool +YES: bool +TRUE: bool +FALSE: bool +ON: bool +OFF: bool +N: Literal["n"] +S: Literal["s"] +W: Literal["w"] +E: Literal["e"] +NW: Literal["nw"] +SW: Literal["sw"] +NE: Literal["ne"] +SE: Literal["se"] +NS: Literal["ns"] +EW: Literal["ew"] +NSEW: Literal["nsew"] +CENTER: Literal["center"] +NONE: Literal["none"] +X: Literal["x"] +Y: Literal["y"] +BOTH: Literal["both"] +LEFT: Literal["left"] +TOP: Literal["top"] +RIGHT: Literal["right"] +BOTTOM: Literal["bottom"] +RAISED: Literal["raised"] +SUNKEN: Literal["sunken"] +FLAT: Literal["flat"] +RIDGE: Literal["ridge"] +GROOVE: Literal["groove"] +SOLID: Literal["solid"] +HORIZONTAL: Literal["horizontal"] +VERTICAL: Literal["vertical"] +NUMERIC: Literal["numeric"] +CHAR: Literal["char"] +WORD: Literal["word"] +BASELINE: Literal["baseline"] +INSIDE: Literal["inside"] +OUTSIDE: Literal["outside"] +SEL: Literal["sel"] +SEL_FIRST: Literal["sel.first"] +SEL_LAST: Literal["sel.last"] +END: Literal["end"] +INSERT: Literal["insert"] +CURRENT: Literal["current"] +ANCHOR: Literal["anchor"] +ALL: Literal["all"] +NORMAL: Literal["normal"] +DISABLED: Literal["disabled"] +ACTIVE: Literal["active"] +HIDDEN: Literal["hidden"] +CASCADE: Literal["cascade"] +CHECKBUTTON: Literal["checkbutton"] +COMMAND: Literal["command"] +RADIOBUTTON: Literal["radiobutton"] +SEPARATOR: Literal["separator"] +SINGLE: Literal["single"] +BROWSE: Literal["browse"] +MULTIPLE: Literal["multiple"] +EXTENDED: Literal["extended"] +DOTBOX: Literal["dotbox"] +UNDERLINE: Literal["underline"] +PIESLICE: Literal["pieslice"] +CHORD: Literal["chord"] +ARC: Literal["arc"] +FIRST: Literal["first"] +LAST: Literal["last"] +BUTT: Literal["butt"] +PROJECTING: Literal["projecting"] +ROUND: Literal["round"] +BEVEL: Literal["bevel"] +MITER: Literal["miter"] +MOVETO: Literal["moveto"] +SCROLL: Literal["scroll"] +UNITS: Literal["units"] +PAGES: Literal["pages"] diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/tkinter/dialog.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/tkinter/dialog.pyi old mode 100755 new mode 100644 index 3136f21e..d02036a6 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/tkinter/dialog.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/tkinter/dialog.pyi @@ -1,5 +1,5 @@ -from typing import Any, Mapping, Optional from tkinter import Widget +from typing import Any, Mapping, Optional DIALOG_ICON: str diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/tkinter/filedialog.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/tkinter/filedialog.pyi old mode 100755 new mode 100644 index 6d5f1651..8c281c6b --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/tkinter/filedialog.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/tkinter/filedialog.pyi @@ -1,5 +1,5 @@ +from tkinter import Button, Entry, Frame, Listbox, Scrollbar, Toplevel, commondialog from typing import Any, Dict, Optional, Tuple -from tkinter import Button, commondialog, Entry, Frame, Listbox, Scrollbar, Toplevel dialogstates: Dict[Any, Tuple[Any, Any]] @@ -19,7 +19,9 @@ class FileDialog: ok_button: Button = ... filter_button: Button = ... cancel_button: Button = ... - def __init__(self, master, title: Optional[Any] = ...) -> None: ... # title is usually a str or None, but e.g. int doesn't raise en exception either + def __init__( + self, master, title: Optional[Any] = ... + ) -> None: ... # title is usually a str or None, but e.g. int doesn't raise en exception either how: Optional[Any] = ... def go(self, dir_or_file: Any = ..., pattern: str = ..., default: str = ..., key: Optional[Any] = ...): ... def quit(self, how: Optional[Any] = ...) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/tkinter/font.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/tkinter/font.pyi new file mode 100644 index 00000000..19afbd90 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/tkinter/font.pyi @@ -0,0 +1,96 @@ +import tkinter +from typing import Any, List, Optional, Tuple, TypeVar, Union, overload +from typing_extensions import Literal, TypedDict + +NORMAL: Literal["normal"] +ROMAN: Literal["roman"] +BOLD: Literal["bold"] +ITALIC: Literal["italic"] + +def nametofont(name: str) -> Font: ... + +# See 'FONT DESCRIPTIONS' in font man page. This uses str because Literal +# inside Tuple doesn't work. +_FontDescription = Union[str, Font, Tuple[str, int], Tuple[str, int, str], Tuple[str, int, tkinter._TkinterSequence[str]]] + +class _FontDict(TypedDict): + family: str + size: int + weight: Literal["normal", "bold"] + slant: Literal["roman", "italic"] + underline: Literal[0, 1] + overstrike: Literal[0, 1] + +class _MetricsDict(TypedDict): + ascent: int + descent: int + linespace: int + fixed: Literal[0, 1] + +class Font: + name: str + delete_font: bool + def __init__( + self, + # In tkinter, 'root' refers to tkinter.Tk by convention, but the code + # actually works with any tkinter widget so we use tkinter.Misc. + root: Optional[tkinter.Misc] = ..., + font: Optional[_FontDescription] = ..., + name: Optional[str] = ..., + exists: bool = ..., + *, + family: str = ..., + size: int = ..., + weight: Literal["normal", "bold"] = ..., + slant: Literal["roman", "italic"] = ..., + underline: bool = ..., + overstrike: bool = ..., + ) -> None: ... + def __getitem__(self, key: str) -> Any: ... + def __setitem__(self, key: str, value: Any) -> None: ... + @overload + def cget(self, option: Literal["family"]) -> str: ... + @overload + def cget(self, option: Literal["size"]) -> int: ... + @overload + def cget(self, option: Literal["weight"]) -> Literal["normal", "bold"]: ... + @overload + def cget(self, option: Literal["slant"]) -> Literal["roman", "italic"]: ... + @overload + def cget(self, option: Literal["underline", "overstrike"]) -> Literal[0, 1]: ... + @overload + def actual(self, option: Literal["family"], displayof: Optional[tkinter.Misc] = ...) -> str: ... + @overload + def actual(self, option: Literal["size"], displayof: Optional[tkinter.Misc] = ...) -> int: ... + @overload + def actual(self, option: Literal["weight"], displayof: Optional[tkinter.Misc] = ...) -> Literal["normal", "bold"]: ... + @overload + def actual(self, option: Literal["slant"], displayof: Optional[tkinter.Misc] = ...) -> Literal["roman", "italic"]: ... + @overload + def actual(self, option: Literal["underline", "overstrike"], displayof: Optional[tkinter.Misc] = ...) -> Literal[0, 1]: ... + @overload + def actual(self, option: None, displayof: Optional[tkinter.Misc] = ...) -> _FontDict: ... + @overload + def actual(self, *, displayof: Optional[tkinter.Misc] = ...) -> _FontDict: ... + def config( + self, + *, + family: str = ..., + size: int = ..., + weight: Literal["normal", "bold"] = ..., + slant: Literal["roman", "italic"] = ..., + underline: bool = ..., + overstrike: bool = ..., + ) -> Optional[_FontDict]: ... + configure = config + def copy(self) -> Font: ... + @overload + def metrics(self, __option: Literal["ascent", "descent", "linespace"], *, displayof: Optional[tkinter.Misc] = ...) -> int: ... + @overload + def metrics(self, __option: Literal["fixed"], *, displayof: Optional[tkinter.Misc] = ...) -> Literal[0, 1]: ... + @overload + def metrics(self, *, displayof: Optional[tkinter.Misc] = ...) -> _MetricsDict: ... + def measure(self, text: str, displayof: Optional[tkinter.Misc] = ...) -> int: ... + +def families(root: Optional[tkinter.Misc] = ..., displayof: Optional[tkinter.Misc] = ...) -> Tuple[str, ...]: ... +def names(root: Optional[tkinter.Misc] = ...) -> Tuple[str, ...]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/tkinter/messagebox.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/tkinter/messagebox.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/tkinter/ttk.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/tkinter/ttk.pyi old mode 100755 new mode 100644 index 755fb252..2162373a --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/tkinter/ttk.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/tkinter/ttk.pyi @@ -1,13 +1,19 @@ +import _tkinter import sys -from typing import Any, List, Optional import tkinter +from tkinter.font import _FontDescription +from typing import Any, Callable, Dict, List, Optional, Tuple, Union, overload +from typing_extensions import Literal def tclobjs_to_py(adict): ... def setup_master(master: Optional[Any] = ...): ... +# from ttk_widget (aka ttk::widget) manual page, differs from tkinter._Compound +_TtkCompound = Literal["text", "image", tkinter._Compound] + class Style: master: Any - tk: Any + tk: _tkinter.TkappType def __init__(self, master: Optional[Any] = ...): ... def configure(self, style, query_opt: Optional[Any] = ..., **kw): ... def map(self, style, query_opt: Optional[Any] = ..., **kw): ... @@ -22,46 +28,636 @@ class Style: def theme_use(self, themename: Optional[Any] = ...): ... class Widget(tkinter.Widget): - def __init__(self, master, widgetname, kw: Optional[Any] = ...): ... + def __init__(self, master: Optional[tkinter.Misc], widgetname, kw: Optional[Any] = ...): ... def identify(self, x, y): ... def instate(self, statespec, callback: Optional[Any] = ..., *args, **kw): ... def state(self, statespec: Optional[Any] = ...): ... +_ButtonOptionName = Literal[ + "class", + "command", + "compound", + "cursor", + "default", + "image", + "padding", + "state", + "style", + "takefocus", + "text", + "textvariable", + "underline", + "width", +] + class Button(Widget): - def __init__(self, master: Optional[Any] = ..., **kw): ... + def __init__( + self, + master: Optional[tkinter.Misc] = ..., + *, + class_: str = ..., + command: tkinter._ButtonCommand = ..., + compound: _TtkCompound = ..., + cursor: tkinter._Cursor = ..., + default: Literal["normal", "active", "disabled"] = ..., + image: tkinter._ImageSpec = ..., + name: str = ..., + padding: Any = ..., # undocumented + state: Literal["normal", "disabled"] = ..., + style: str = ..., + takefocus: tkinter._TakeFocusValue = ..., + text: str = ..., + textvariable: tkinter.Variable = ..., + underline: int = ..., + width: Union[int, Literal[""]] = ..., + ) -> None: ... + @overload + def configure( + self, + cnf: Optional[Dict[str, Any]] = ..., + *, + command: tkinter._ButtonCommand = ..., + compound: _TtkCompound = ..., + cursor: tkinter._Cursor = ..., + default: Literal["normal", "active", "disabled"] = ..., + image: tkinter._ImageSpec = ..., + padding: Any = ..., + state: Literal["normal", "disabled"] = ..., + style: str = ..., + takefocus: tkinter._TakeFocusValue = ..., + text: str = ..., + textvariable: tkinter.Variable = ..., + underline: int = ..., + width: Union[int, Literal[""]] = ..., + ) -> Optional[Dict[str, Tuple[str, str, str, Any, Any]]]: ... + @overload + def configure(self, cnf: _ButtonOptionName) -> Tuple[str, str, str, Any, Any]: ... + config = configure + def cget(self, key: _ButtonOptionName) -> Any: ... def invoke(self): ... +_CheckbuttonOptionName = Literal[ + "class", + "command", + "compound", + "cursor", + "image", + "offvalue", + "onvalue", + "padding", + "state", + "style", + "takefocus", + "text", + "textvariable", + "underline", + "variable", + "width", +] + class Checkbutton(Widget): - def __init__(self, master: Optional[Any] = ..., **kw): ... + def __init__( + self, + master: Optional[tkinter.Misc] = ..., + *, + class_: str = ..., + command: tkinter._ButtonCommand = ..., + compound: _TtkCompound = ..., + cursor: tkinter._Cursor = ..., + image: tkinter._ImageSpec = ..., + name: str = ..., + offvalue: Any = ..., + onvalue: Any = ..., + padding: Any = ..., # undocumented + state: Literal["normal", "disabled"] = ..., + style: str = ..., + takefocus: tkinter._TakeFocusValue = ..., + text: str = ..., + textvariable: tkinter.Variable = ..., + underline: int = ..., + # Seems like variable can be empty string, but actually setting it to + # empty string segfaults before Tcl 8.6.9. Search for ttk::checkbutton + # here: https://sourceforge.net/projects/tcl/files/Tcl/8.6.9/tcltk-release-notes-8.6.9.txt/view + variable: tkinter.Variable = ..., + width: Union[int, Literal[""]] = ..., + ) -> None: ... + @overload + def configure( + self, + cnf: Optional[Dict[str, Any]] = ..., + *, + command: tkinter._ButtonCommand = ..., + compound: _TtkCompound = ..., + cursor: tkinter._Cursor = ..., + image: tkinter._ImageSpec = ..., + offvalue: Any = ..., + onvalue: Any = ..., + padding: Any = ..., + state: Literal["normal", "disabled"] = ..., + style: str = ..., + takefocus: tkinter._TakeFocusValue = ..., + text: str = ..., + textvariable: tkinter.Variable = ..., + underline: int = ..., + variable: tkinter.Variable = ..., + width: Union[int, Literal[""]] = ..., + ) -> Optional[Dict[str, Tuple[str, str, str, Any, Any]]]: ... + @overload + def configure(self, cnf: _CheckbuttonOptionName) -> Tuple[str, str, str, Any, Any]: ... + config = configure + def cget(self, key: _CheckbuttonOptionName) -> Any: ... def invoke(self): ... +_EntryOptionName = Literal[ + "background", + "class", + "cursor", + "exportselection", + "font", + "foreground", + "invalidcommand", + "justify", + "show", + "state", + "style", + "takefocus", + "textvariable", + "validate", + "validatecommand", + "width", + "xscrollcommand", +] + class Entry(Widget, tkinter.Entry): - def __init__(self, master: Optional[Any] = ..., widget: Optional[Any] = ..., **kw): ... + def __init__( + self, + master: Optional[tkinter.Misc] = ..., + widget: Optional[str] = ..., + *, + background: tkinter._Color = ..., # undocumented + class_: str = ..., + cursor: tkinter._Cursor = ..., + exportselection: bool = ..., + font: _FontDescription = ..., + foreground: tkinter._Color = ..., + invalidcommand: tkinter._EntryValidateCommand = ..., + justify: Literal["left", "center", "right"] = ..., + name: str = ..., + show: str = ..., + state: Literal["normal", "disabled", "readonly"] = ..., + style: str = ..., + takefocus: tkinter._TakeFocusValue = ..., + textvariable: tkinter.Variable = ..., + validate: Literal["none", "focus", "focusin", "focusout", "key", "all"] = ..., + validatecommand: tkinter._EntryValidateCommand = ..., + width: int = ..., + xscrollcommand: tkinter._XYScrollCommand = ..., + ) -> None: ... + @overload # type: ignore + def configure( + self, + cnf: Optional[Dict[str, Any]] = ..., + *, + background: tkinter._Color = ..., + cursor: tkinter._Cursor = ..., + exportselection: bool = ..., + font: _FontDescription = ..., + foreground: tkinter._Color = ..., + invalidcommand: tkinter._EntryValidateCommand = ..., + justify: Literal["left", "center", "right"] = ..., + show: str = ..., + state: Literal["normal", "disabled", "readonly"] = ..., + style: str = ..., + takefocus: tkinter._TakeFocusValue = ..., + textvariable: tkinter.Variable = ..., + validate: Literal["none", "focus", "focusin", "focusout", "key", "all"] = ..., + validatecommand: tkinter._EntryValidateCommand = ..., + width: int = ..., + xscrollcommand: tkinter._XYScrollCommand = ..., + ) -> Optional[Dict[str, Tuple[str, str, str, Any, Any]]]: ... + @overload + def configure(self, cnf: _EntryOptionName) -> Tuple[str, str, str, Any, Any]: ... + # config must be copy/pasted, otherwise ttk.Entry().config is mypy error (don't know why) + @overload # type: ignore + def config( + self, + cnf: Optional[Dict[str, Any]] = ..., + *, + background: tkinter._Color = ..., + cursor: tkinter._Cursor = ..., + exportselection: bool = ..., + font: _FontDescription = ..., + foreground: tkinter._Color = ..., + invalidcommand: tkinter._EntryValidateCommand = ..., + justify: Literal["left", "center", "right"] = ..., + show: str = ..., + state: Literal["normal", "disabled", "readonly"] = ..., + style: str = ..., + takefocus: tkinter._TakeFocusValue = ..., + textvariable: tkinter.Variable = ..., + validate: Literal["none", "focus", "focusin", "focusout", "key", "all"] = ..., + validatecommand: tkinter._EntryValidateCommand = ..., + width: int = ..., + xscrollcommand: tkinter._XYScrollCommand = ..., + ) -> Optional[Dict[str, Tuple[str, str, str, Any, Any]]]: ... + @overload + def config(self, cnf: _EntryOptionName) -> Tuple[str, str, str, Any, Any]: ... + def cget(self, key: _EntryOptionName) -> Any: ... # type: ignore def bbox(self, index): ... def identify(self, x, y): ... def validate(self): ... +_ComboboxOptionName = Literal[ + "background", + "class", + "cursor", + "exportselection", + "font", + "foreground", + "height", + "invalidcommand", + "justify", + "postcommand", + "show", + "state", + "style", + "takefocus", + "textvariable", + "validate", + "validatecommand", + "values", + "width", + "xscrollcommand", +] + class Combobox(Entry): - def __init__(self, master: Optional[Any] = ..., **kw): ... + def __init__( + self, + master: Optional[tkinter.Misc] = ..., + *, + background: tkinter._Color = ..., # undocumented + class_: str = ..., + cursor: tkinter._Cursor = ..., + exportselection: bool = ..., + font: _FontDescription = ..., # undocumented + foreground: tkinter._Color = ..., # undocumented + height: int = ..., + invalidcommand: tkinter._EntryValidateCommand = ..., # undocumented + justify: Literal["left", "center", "right"] = ..., + name: str = ..., + postcommand: Union[Callable[[], Any], str] = ..., + show: Any = ..., # undocumented + state: Literal["normal", "readonly", "disabled"] = ..., + style: str = ..., + takefocus: tkinter._TakeFocusValue = ..., + textvariable: tkinter.Variable = ..., + validate: Literal["none", "focus", "focusin", "focusout", "key", "all"] = ..., # undocumented + validatecommand: tkinter._EntryValidateCommand = ..., # undocumented + values: tkinter._TkinterSequence[str] = ..., + width: int = ..., + xscrollcommand: tkinter._XYScrollCommand = ..., # undocumented + ) -> None: ... + @overload # type: ignore + def configure( + self, + cnf: Optional[Dict[str, Any]] = ..., + *, + background: tkinter._Color = ..., + cursor: tkinter._Cursor = ..., + exportselection: bool = ..., + font: _FontDescription = ..., + foreground: tkinter._Color = ..., + height: int = ..., + invalidcommand: tkinter._EntryValidateCommand = ..., + justify: Literal["left", "center", "right"] = ..., + postcommand: Union[Callable[[], Any], str] = ..., + show: Any = ..., + state: Literal["normal", "readonly", "disabled"] = ..., + style: str = ..., + takefocus: tkinter._TakeFocusValue = ..., + textvariable: tkinter.Variable = ..., + validate: Literal["none", "focus", "focusin", "focusout", "key", "all"] = ..., + validatecommand: tkinter._EntryValidateCommand = ..., + values: tkinter._TkinterSequence[str] = ..., + width: int = ..., + xscrollcommand: tkinter._XYScrollCommand = ..., + ) -> Optional[Dict[str, Tuple[str, str, str, Any, Any]]]: ... + @overload + def configure(self, cnf: _ComboboxOptionName) -> Tuple[str, str, str, Any, Any]: ... + # config must be copy/pasted, otherwise ttk.Combobox().config is mypy error (don't know why) + @overload # type: ignore + def config( + self, + cnf: Optional[Dict[str, Any]] = ..., + *, + background: tkinter._Color = ..., + cursor: tkinter._Cursor = ..., + exportselection: bool = ..., + font: _FontDescription = ..., + foreground: tkinter._Color = ..., + height: int = ..., + invalidcommand: tkinter._EntryValidateCommand = ..., + justify: Literal["left", "center", "right"] = ..., + postcommand: Union[Callable[[], Any], str] = ..., + show: Any = ..., + state: Literal["normal", "readonly", "disabled"] = ..., + style: str = ..., + takefocus: tkinter._TakeFocusValue = ..., + textvariable: tkinter.Variable = ..., + validate: Literal["none", "focus", "focusin", "focusout", "key", "all"] = ..., + validatecommand: tkinter._EntryValidateCommand = ..., + values: tkinter._TkinterSequence[str] = ..., + width: int = ..., + xscrollcommand: tkinter._XYScrollCommand = ..., + ) -> Optional[Dict[str, Tuple[str, str, str, Any, Any]]]: ... + @overload + def config(self, cnf: _ComboboxOptionName) -> Tuple[str, str, str, Any, Any]: ... + def cget(self, key: _ComboboxOptionName) -> Any: ... # type: ignore def current(self, newindex: Optional[Any] = ...): ... def set(self, value): ... +_FrameOptionName = Literal[ + "border", "borderwidth", "class", "cursor", "height", "padding", "relief", "style", "takefocus", "width" +] + class Frame(Widget): - def __init__(self, master: Optional[Any] = ..., **kw): ... + def __init__( + self, + master: Optional[tkinter.Misc] = ..., + *, + border: tkinter._ScreenUnits = ..., + borderwidth: tkinter._ScreenUnits = ..., + class_: str = ..., + cursor: tkinter._Cursor = ..., + height: tkinter._ScreenUnits = ..., + name: str = ..., + padding: tkinter._Padding = ..., + relief: tkinter._Relief = ..., + style: str = ..., + takefocus: tkinter._TakeFocusValue = ..., + width: tkinter._ScreenUnits = ..., + ) -> None: ... + @overload + def configure( + self, + cnf: Optional[Dict[str, Any]] = ..., + *, + border: tkinter._ScreenUnits = ..., + borderwidth: tkinter._ScreenUnits = ..., + cursor: tkinter._Cursor = ..., + height: tkinter._ScreenUnits = ..., + padding: tkinter._Padding = ..., + relief: tkinter._Relief = ..., + style: str = ..., + takefocus: tkinter._TakeFocusValue = ..., + width: tkinter._ScreenUnits = ..., + ) -> Optional[Dict[str, Tuple[str, str, str, Any, Any]]]: ... + @overload + def configure(self, cnf: _FrameOptionName) -> Tuple[str, str, str, Any, Any]: ... + config = configure + def cget(self, key: _FrameOptionName) -> Any: ... + +_LabelOptionName = Literal[ + "anchor", + "background", + "border", + "borderwidth", + "class", + "compound", + "cursor", + "font", + "foreground", + "image", + "justify", + "padding", + "relief", + "state", + "style", + "takefocus", + "text", + "textvariable", + "underline", + "width", + "wraplength", +] class Label(Widget): - def __init__(self, master: Optional[Any] = ..., **kw): ... + def __init__( + self, + master: Optional[tkinter.Misc] = ..., + *, + anchor: tkinter._Anchor = ..., + background: tkinter._Color = ..., + border: tkinter._ScreenUnits = ..., # alias for borderwidth + borderwidth: tkinter._ScreenUnits = ..., # undocumented + class_: str = ..., + compound: _TtkCompound = ..., + cursor: tkinter._Cursor = ..., + font: _FontDescription = ..., + foreground: tkinter._Color = ..., + image: tkinter._ImageSpec = ..., + justify: Literal["left", "center", "right"] = ..., + name: str = ..., + padding: tkinter._Padding = ..., + relief: tkinter._Relief = ..., + state: Literal["normal", "disabled"] = ..., + style: str = ..., + takefocus: tkinter._TakeFocusValue = ..., + text: str = ..., + textvariable: tkinter.Variable = ..., + underline: int = ..., + width: Union[int, Literal[""]] = ..., + wraplength: tkinter._ScreenUnits = ..., + ) -> None: ... + @overload + def configure( + self, + cnf: Optional[Dict[str, Any]] = ..., + *, + anchor: tkinter._Anchor = ..., + background: tkinter._Color = ..., + border: tkinter._ScreenUnits = ..., + borderwidth: tkinter._ScreenUnits = ..., + compound: _TtkCompound = ..., + cursor: tkinter._Cursor = ..., + font: _FontDescription = ..., + foreground: tkinter._Color = ..., + image: tkinter._ImageSpec = ..., + justify: Literal["left", "center", "right"] = ..., + padding: tkinter._Padding = ..., + relief: tkinter._Relief = ..., + state: Literal["normal", "disabled"] = ..., + style: str = ..., + takefocus: tkinter._TakeFocusValue = ..., + text: str = ..., + textvariable: tkinter.Variable = ..., + underline: int = ..., + width: Union[int, Literal[""]] = ..., + wraplength: tkinter._ScreenUnits = ..., + ) -> Optional[Dict[str, Tuple[str, str, str, Any, Any]]]: ... + @overload + def configure(self, cnf: _LabelOptionName) -> Tuple[str, str, str, Any, Any]: ... + config = configure + def cget(self, key: _LabelOptionName) -> Any: ... + +_LabelframeOptionName = Literal[ + "border", + "borderwidth", + "class", + "cursor", + "height", + "labelanchor", + "labelwidget", + "padding", + "relief", + "style", + "takefocus", + "text", + "underline", + "width", +] class Labelframe(Widget): - def __init__(self, master: Optional[Any] = ..., **kw): ... + def __init__( + self, + master: Optional[tkinter.Misc] = ..., + *, + border: tkinter._ScreenUnits = ..., + borderwidth: tkinter._ScreenUnits = ..., # undocumented + class_: str = ..., + cursor: tkinter._Cursor = ..., + height: tkinter._ScreenUnits = ..., + labelanchor: Literal["nw", "n", "ne", "en", "e", "es", "se", "s", "sw", "ws", "w", "wn"] = ..., + labelwidget: tkinter.Misc = ..., + name: str = ..., + padding: tkinter._Padding = ..., + relief: tkinter._Relief = ..., # undocumented + style: str = ..., + takefocus: tkinter._TakeFocusValue = ..., + text: str = ..., + underline: int = ..., + width: tkinter._ScreenUnits = ..., + ) -> None: ... + @overload + def configure( + self, + cnf: Optional[Dict[str, Any]] = ..., + *, + border: tkinter._ScreenUnits = ..., + borderwidth: tkinter._ScreenUnits = ..., + cursor: tkinter._Cursor = ..., + height: tkinter._ScreenUnits = ..., + labelanchor: Literal["nw", "n", "ne", "en", "e", "es", "se", "s", "sw", "ws", "w", "wn"] = ..., + labelwidget: tkinter.Misc = ..., + padding: tkinter._Padding = ..., + relief: tkinter._Relief = ..., + style: str = ..., + takefocus: tkinter._TakeFocusValue = ..., + text: str = ..., + underline: int = ..., + width: tkinter._ScreenUnits = ..., + ) -> Optional[Dict[str, Tuple[str, str, str, Any, Any]]]: ... + @overload + def configure(self, cnf: _LabelframeOptionName) -> Tuple[str, str, str, Any, Any]: ... + config = configure + def cget(self, key: _LabelframeOptionName) -> Any: ... + +LabelFrame = Labelframe -LabelFrame: Any +_MenubuttonOptionName = Literal[ + "class", + "compound", + "cursor", + "direction", + "image", + "menu", + "padding", + "state", + "style", + "takefocus", + "text", + "textvariable", + "underline", + "width", +] class Menubutton(Widget): - def __init__(self, master: Optional[Any] = ..., **kw): ... + def __init__( + self, + master: Optional[tkinter.Misc] = ..., + *, + class_: str = ..., + compound: _TtkCompound = ..., + cursor: tkinter._Cursor = ..., + direction: Literal["above", "below", "left", "right", "flush"] = ..., + image: tkinter._ImageSpec = ..., + menu: tkinter.Menu = ..., + name: str = ..., + padding: Any = ..., # undocumented + state: Literal["normal", "disabled"] = ..., + style: str = ..., + takefocus: tkinter._TakeFocusValue = ..., + text: str = ..., + textvariable: tkinter.Variable = ..., + underline: int = ..., + width: Union[int, Literal[""]] = ..., + ) -> None: ... + @overload + def configure( + self, + cnf: Optional[Dict[str, Any]] = ..., + *, + compound: _TtkCompound = ..., + cursor: tkinter._Cursor = ..., + direction: Literal["above", "below", "left", "right", "flush"] = ..., + image: tkinter._ImageSpec = ..., + menu: tkinter.Menu = ..., + padding: Any = ..., + state: Literal["normal", "disabled"] = ..., + style: str = ..., + takefocus: tkinter._TakeFocusValue = ..., + text: str = ..., + textvariable: tkinter.Variable = ..., + underline: int = ..., + width: Union[int, Literal[""]] = ..., + ) -> Optional[Dict[str, Tuple[str, str, str, Any, Any]]]: ... + @overload + def configure(self, cnf: _MenubuttonOptionName) -> Tuple[str, str, str, Any, Any]: ... + config = configure + def cget(self, key: _MenubuttonOptionName) -> Any: ... + +_NotebookOptionName = Literal["class", "cursor", "height", "padding", "style", "takefocus", "width"] class Notebook(Widget): - def __init__(self, master: Optional[Any] = ..., **kw): ... + def __init__( + self, + master: Optional[tkinter.Misc] = ..., + *, + class_: str = ..., + cursor: tkinter._Cursor = ..., + height: int = ..., + name: str = ..., + padding: tkinter._Padding = ..., + style: str = ..., + takefocus: tkinter._TakeFocusValue = ..., + width: int = ..., + ) -> None: ... + @overload + def configure( + self, + cnf: Optional[Dict[str, Any]] = ..., + *, + cursor: tkinter._Cursor = ..., + height: int = ..., + padding: tkinter._Padding = ..., + style: str = ..., + takefocus: tkinter._TakeFocusValue = ..., + width: int = ..., + ) -> Optional[Dict[str, Tuple[str, str, str, Any, Any]]]: ... + @overload + def configure(self, cnf: _NotebookOptionName) -> Tuple[str, str, str, Any, Any]: ... + config = configure + def cget(self, key: _NotebookOptionName) -> Any: ... def add(self, child, **kw): ... def forget(self, tab_id): ... def hide(self, tab_id): ... @@ -73,46 +669,487 @@ class Notebook(Widget): def tabs(self): ... def enable_traversal(self): ... +_PanedwindowOptionName = Literal["class", "cursor", "height", "orient", "style", "takefocus", "width"] + class Panedwindow(Widget, tkinter.PanedWindow): - def __init__(self, master: Optional[Any] = ..., **kw): ... + def __init__( + self, + master: Optional[tkinter.Misc] = ..., + *, + class_: str = ..., + cursor: tkinter._Cursor = ..., + # width and height for tkinter.ttk.Panedwindow are int but for tkinter.PanedWindow they are screen units + height: int = ..., + name: str = ..., + orient: Literal["vertical", "horizontal"] = ..., + style: str = ..., + takefocus: tkinter._TakeFocusValue = ..., + width: int = ..., + ) -> None: ... + @overload # type: ignore + def configure( + self, + cnf: Optional[Dict[str, Any]] = ..., + *, + cursor: tkinter._Cursor = ..., + height: int = ..., + style: str = ..., + takefocus: tkinter._TakeFocusValue = ..., + width: int = ..., + ) -> Optional[Dict[str, Tuple[str, str, str, Any, Any]]]: ... + @overload + def configure(self, cnf: _PanedwindowOptionName) -> Tuple[str, str, str, Any, Any]: ... + # config must be copy/pasted, otherwise ttk.Panedwindow().config is mypy error (don't know why) + @overload # type: ignore + def config( + self, + cnf: Optional[Dict[str, Any]] = ..., + *, + cursor: tkinter._Cursor = ..., + height: int = ..., + style: str = ..., + takefocus: tkinter._TakeFocusValue = ..., + width: int = ..., + ) -> Optional[Dict[str, Tuple[str, str, str, Any, Any]]]: ... + @overload + def config(self, cnf: _PanedwindowOptionName) -> Tuple[str, str, str, Any, Any]: ... + def cget(self, key: _PanedwindowOptionName) -> Any: ... # type: ignore forget: Any def insert(self, pos, child, **kw): ... def pane(self, pane, option: Optional[Any] = ..., **kw): ... def sashpos(self, index, newpos: Optional[Any] = ...): ... -PanedWindow: Any +PanedWindow = Panedwindow + +_ProgressbarOptionName = Literal[ + "class", "cursor", "length", "maximum", "mode", "orient", "phase", "style", "takefocus", "value", "variable" +] class Progressbar(Widget): - def __init__(self, master: Optional[Any] = ..., **kw): ... + def __init__( + self, + master: Optional[tkinter.Misc] = ..., + *, + class_: str = ..., + cursor: tkinter._Cursor = ..., + length: tkinter._ScreenUnits = ..., + maximum: float = ..., + mode: Literal["determinate", "indeterminate"] = ..., + name: str = ..., + orient: Literal["horizontal", "vertical"] = ..., + phase: int = ..., # docs say read-only but assigning int to this works + style: str = ..., + takefocus: tkinter._TakeFocusValue = ..., + value: float = ..., + variable: tkinter.DoubleVar = ..., + ) -> None: ... + @overload + def configure( + self, + cnf: Optional[Dict[str, Any]] = ..., + *, + cursor: tkinter._Cursor = ..., + length: tkinter._ScreenUnits = ..., + maximum: float = ..., + mode: Literal["determinate", "indeterminate"] = ..., + orient: Literal["horizontal", "vertical"] = ..., + phase: int = ..., + style: str = ..., + takefocus: tkinter._TakeFocusValue = ..., + value: float = ..., + variable: tkinter.DoubleVar = ..., + ) -> Optional[Dict[str, Tuple[str, str, str, Any, Any]]]: ... + @overload + def configure(self, cnf: _ProgressbarOptionName) -> Tuple[str, str, str, Any, Any]: ... + config = configure + def cget(self, key: _ProgressbarOptionName) -> Any: ... def start(self, interval: Optional[Any] = ...): ... def step(self, amount: Optional[Any] = ...): ... def stop(self): ... +_RadiobuttonOptionName = Literal[ + "class", + "command", + "compound", + "cursor", + "image", + "padding", + "state", + "style", + "takefocus", + "text", + "textvariable", + "underline", + "value", + "variable", + "width", +] + class Radiobutton(Widget): - def __init__(self, master: Optional[Any] = ..., **kw): ... + def __init__( + self, + master: Optional[tkinter.Misc] = ..., + *, + class_: str = ..., + command: tkinter._ButtonCommand = ..., + compound: _TtkCompound = ..., + cursor: tkinter._Cursor = ..., + image: tkinter._ImageSpec = ..., + name: str = ..., + padding: Any = ..., # undocumented + state: Literal["normal", "disabled"] = ..., + style: str = ..., + takefocus: tkinter._TakeFocusValue = ..., + text: str = ..., + textvariable: tkinter.Variable = ..., + underline: int = ..., + value: Any = ..., + variable: Union[tkinter.Variable, Literal[""]] = ..., + width: Union[int, Literal[""]] = ..., + ) -> None: ... + @overload + def configure( + self, + cnf: Optional[Dict[str, Any]] = ..., + *, + command: tkinter._ButtonCommand = ..., + compound: _TtkCompound = ..., + cursor: tkinter._Cursor = ..., + image: tkinter._ImageSpec = ..., + padding: Any = ..., + state: Literal["normal", "disabled"] = ..., + style: str = ..., + takefocus: tkinter._TakeFocusValue = ..., + text: str = ..., + textvariable: tkinter.Variable = ..., + underline: int = ..., + value: Any = ..., + variable: Union[tkinter.Variable, Literal[""]] = ..., + width: Union[int, Literal[""]] = ..., + ) -> Optional[Dict[str, Tuple[str, str, str, Any, Any]]]: ... + @overload + def configure(self, cnf: _RadiobuttonOptionName) -> Tuple[str, str, str, Any, Any]: ... + config = configure + def cget(self, key: _RadiobuttonOptionName) -> Any: ... def invoke(self): ... +_ScaleOptionName = Literal[ + "class", "command", "cursor", "from", "length", "orient", "state", "style", "takefocus", "to", "value", "variable" +] + class Scale(Widget, tkinter.Scale): - def __init__(self, master: Optional[Any] = ..., **kw): ... - def configure(self, cnf: Optional[Any] = ..., **kw): ... + def __init__( + self, + master: Optional[tkinter.Misc] = ..., + *, + class_: str = ..., + command: Union[str, Callable[[str], Any]] = ..., + cursor: tkinter._Cursor = ..., + from_: float = ..., + length: tkinter._ScreenUnits = ..., + name: str = ..., + orient: Literal["horizontal", "vertical"] = ..., + state: Any = ..., # undocumented + style: str = ..., + takefocus: tkinter._TakeFocusValue = ..., + to: float = ..., + value: float = ..., + variable: tkinter.DoubleVar = ..., + ) -> None: ... + @overload # type: ignore + def configure( + self, + cnf: Optional[Dict[str, Any]] = ..., + *, + command: Union[str, Callable[[str], Any]] = ..., + cursor: tkinter._Cursor = ..., + from_: float = ..., + length: tkinter._ScreenUnits = ..., + orient: Literal["horizontal", "vertical"] = ..., + state: Any = ..., + style: str = ..., + takefocus: tkinter._TakeFocusValue = ..., + to: float = ..., + value: float = ..., + variable: tkinter.DoubleVar = ..., + ) -> Optional[Dict[str, Tuple[str, str, str, Any, Any]]]: ... + @overload + def configure(self, cnf: _ScaleOptionName) -> Tuple[str, str, str, Any, Any]: ... + # config must be copy/pasted, otherwise ttk.Scale().config is mypy error (don't know why) + @overload # type: ignore + def config( + self, + cnf: Optional[Dict[str, Any]] = ..., + *, + command: Union[str, Callable[[str], Any]] = ..., + cursor: tkinter._Cursor = ..., + from_: float = ..., + length: tkinter._ScreenUnits = ..., + orient: Literal["horizontal", "vertical"] = ..., + state: Any = ..., + style: str = ..., + takefocus: tkinter._TakeFocusValue = ..., + to: float = ..., + value: float = ..., + variable: tkinter.DoubleVar = ..., + ) -> Optional[Dict[str, Tuple[str, str, str, Any, Any]]]: ... + @overload + def config(self, cnf: _ScaleOptionName) -> Tuple[str, str, str, Any, Any]: ... + def cget(self, key: _ScaleOptionName) -> Any: ... # type: ignore def get(self, x: Optional[Any] = ..., y: Optional[Any] = ...): ... +_ScrollbarOptionName = Literal["class", "command", "cursor", "orient", "style", "takefocus"] + class Scrollbar(Widget, tkinter.Scrollbar): - def __init__(self, master: Optional[Any] = ..., **kw): ... + def __init__( + self, + master: Optional[tkinter.Misc] = ..., + *, + class_: str = ..., + command: Union[Callable[..., Optional[Tuple[float, float]]], str] = ..., + cursor: tkinter._Cursor = ..., + name: str = ..., + orient: Literal["horizontal", "vertical"] = ..., + style: str = ..., + takefocus: tkinter._TakeFocusValue = ..., + ) -> None: ... + @overload # type: ignore + def configure( + self, + cnf: Optional[Dict[str, Any]] = ..., + *, + command: Union[Callable[..., Optional[Tuple[float, float]]], str] = ..., + cursor: tkinter._Cursor = ..., + orient: Literal["horizontal", "vertical"] = ..., + style: str = ..., + takefocus: tkinter._TakeFocusValue = ..., + ) -> Optional[Dict[str, Tuple[str, str, str, Any, Any]]]: ... + @overload + def configure(self, cnf: _ScrollbarOptionName) -> Tuple[str, str, str, Any, Any]: ... + # config must be copy/pasted, otherwise ttk.Scrollbar().config is mypy error (don't know why) + @overload # type: ignore + def config( + self, + cnf: Optional[Dict[str, Any]] = ..., + *, + command: Union[Callable[..., Optional[Tuple[float, float]]], str] = ..., + cursor: tkinter._Cursor = ..., + orient: Literal["horizontal", "vertical"] = ..., + style: str = ..., + takefocus: tkinter._TakeFocusValue = ..., + ) -> Optional[Dict[str, Tuple[str, str, str, Any, Any]]]: ... + @overload + def config(self, cnf: _ScrollbarOptionName) -> Tuple[str, str, str, Any, Any]: ... + def cget(self, key: _ScrollbarOptionName) -> Any: ... # type: ignore + +_SeparatorOptionName = Literal["class", "cursor", "orient", "style", "takefocus"] class Separator(Widget): - def __init__(self, master: Optional[Any] = ..., **kw): ... + def __init__( + self, + master: Optional[tkinter.Misc] = ..., + *, + class_: str = ..., + cursor: tkinter._Cursor = ..., + name: str = ..., + orient: Literal["horizontal", "vertical"] = ..., + style: str = ..., + takefocus: tkinter._TakeFocusValue = ..., + ) -> None: ... + @overload + def configure( + self, + cnf: Optional[Dict[str, Any]] = ..., + *, + cursor: tkinter._Cursor = ..., + orient: Literal["horizontal", "vertical"] = ..., + style: str = ..., + takefocus: tkinter._TakeFocusValue = ..., + ) -> Optional[Dict[str, Tuple[str, str, str, Any, Any]]]: ... + @overload + def configure(self, cnf: _SeparatorOptionName) -> Tuple[str, str, str, Any, Any]: ... + config = configure + def cget(self, key: _SeparatorOptionName) -> Any: ... + +_SizegripOptionName = Literal["class", "cursor", "style", "takefocus"] class Sizegrip(Widget): - def __init__(self, master: Optional[Any] = ..., **kw): ... + def __init__( + self, + master: Optional[tkinter.Misc] = ..., + *, + class_: str = ..., + cursor: tkinter._Cursor = ..., + name: str = ..., + style: str = ..., + takefocus: tkinter._TakeFocusValue = ..., + ) -> None: ... + @overload + def configure( + self, + cnf: Optional[Dict[str, Any]] = ..., + *, + cursor: tkinter._Cursor = ..., + style: str = ..., + takefocus: tkinter._TakeFocusValue = ..., + ) -> Optional[Dict[str, Tuple[str, str, str, Any, Any]]]: ... + @overload + def configure(self, cnf: _SizegripOptionName) -> Tuple[str, str, str, Any, Any]: ... + config = configure + def cget(self, key: _SizegripOptionName) -> Any: ... if sys.version_info >= (3, 7): + _SpinboxOptionName = Literal[ + "background", + "class", + "command", + "cursor", + "exportselection", + "font", + "foreground", + "format", + "from", + "increment", + "invalidcommand", + "justify", + "show", + "state", + "style", + "takefocus", + "textvariable", + "to", + "validate", + "validatecommand", + "values", + "width", + "wrap", + "xscrollcommand", + ] class Spinbox(Entry): - def __init__(self, master: Any = ..., **kw: Any) -> None: ... + def __init__( + self, + master: Optional[tkinter.Misc] = ..., + *, + background: tkinter._Color = ..., # undocumented + class_: str = ..., + command: Union[Callable[[], Any], str, tkinter._TkinterSequence[str]] = ..., + cursor: tkinter._Cursor = ..., + exportselection: bool = ..., # undocumented + font: _FontDescription = ..., # undocumented + foreground: tkinter._Color = ..., # undocumented + format: str = ..., + from_: float = ..., + increment: float = ..., + invalidcommand: tkinter._EntryValidateCommand = ..., # undocumented + justify: Literal["left", "center", "right"] = ..., # undocumented + name: str = ..., + show: Any = ..., # undocumented + state: Literal["normal", "disabled"] = ..., + style: str = ..., + takefocus: tkinter._TakeFocusValue = ..., + textvariable: tkinter.Variable = ..., # undocumented + to: float = ..., + validate: Literal["none", "focus", "focusin", "focusout", "key", "all"] = ..., + validatecommand: tkinter._EntryValidateCommand = ..., + values: tkinter._TkinterSequence[str] = ..., + width: int = ..., # undocumented + wrap: bool = ..., + xscrollcommand: tkinter._XYScrollCommand = ..., + ) -> None: ... + @overload # type: ignore + def configure( + self, + cnf: Optional[Dict[str, Any]] = ..., + *, + background: tkinter._Color = ..., + command: Union[Callable[[], Any], str, tkinter._TkinterSequence[str]] = ..., + cursor: tkinter._Cursor = ..., + exportselection: bool = ..., + font: _FontDescription = ..., + foreground: tkinter._Color = ..., + format: str = ..., + from_: float = ..., + increment: float = ..., + invalidcommand: tkinter._EntryValidateCommand = ..., + justify: Literal["left", "center", "right"] = ..., + show: Any = ..., + state: Literal["normal", "disabled"] = ..., + style: str = ..., + takefocus: tkinter._TakeFocusValue = ..., + textvariable: tkinter.Variable = ..., + to: float = ..., + validate: Literal["none", "focus", "focusin", "focusout", "key", "all"] = ..., + validatecommand: tkinter._EntryValidateCommand = ..., + values: tkinter._TkinterSequence[str] = ..., + width: int = ..., + wrap: bool = ..., + xscrollcommand: tkinter._XYScrollCommand = ..., + ) -> Optional[Dict[str, Tuple[str, str, str, Any, Any]]]: ... + @overload + def configure(self, cnf: _SpinboxOptionName) -> Tuple[str, str, str, Any, Any]: ... + config = configure # type: ignore + def cget(self, key: _SpinboxOptionName) -> Any: ... # type: ignore def set(self, value: Any) -> None: ... +_TreeviewOptionName = Literal[ + "class", + "columns", + "cursor", + "displaycolumns", + "height", + "padding", + "selectmode", + "show", + "style", + "takefocus", + "xscrollcommand", + "yscrollcommand", +] + class Treeview(Widget, tkinter.XView, tkinter.YView): - def __init__(self, master: Optional[Any] = ..., **kw): ... + def __init__( + self, + master: Optional[tkinter.Misc] = ..., + *, + class_: str = ..., + columns: Union[str, tkinter._TkinterSequence[str]] = ..., + cursor: tkinter._Cursor = ..., + displaycolumns: Union[str, tkinter._TkinterSequence[str], tkinter._TkinterSequence[int], Literal["#all"]] = ..., + height: int = ..., + name: str = ..., + padding: tkinter._Padding = ..., + selectmode: Literal["extended", "browse", "none"] = ..., + # _TkinterSequences of Literal don't actually work, using str instead. + # + # 'tree headings' is same as ['tree', 'headings'], and I wouldn't be + # surprised if someone was using it. + show: Union[Literal["tree", "headings", "tree headings"], tkinter._TkinterSequence[str]] = ..., + style: str = ..., + takefocus: tkinter._TakeFocusValue = ..., + xscrollcommand: tkinter._XYScrollCommand = ..., + yscrollcommand: tkinter._XYScrollCommand = ..., + ) -> None: ... + @overload + def configure( + self, + cnf: Optional[Dict[str, Any]] = ..., + *, + columns: Union[str, tkinter._TkinterSequence[str]] = ..., + cursor: tkinter._Cursor = ..., + displaycolumns: Union[str, tkinter._TkinterSequence[str], tkinter._TkinterSequence[int], Literal["#all"]] = ..., + height: int = ..., + padding: tkinter._Padding = ..., + selectmode: Literal["extended", "browse", "none"] = ..., + show: Union[Literal["tree", "headings", "tree headings"], tkinter._TkinterSequence[str]] = ..., + style: str = ..., + takefocus: tkinter._TakeFocusValue = ..., + xscrollcommand: tkinter._XYScrollCommand = ..., + yscrollcommand: tkinter._XYScrollCommand = ..., + ) -> Optional[Dict[str, Tuple[str, str, str, Any, Any]]]: ... + @overload + def configure(self, cnf: _TreeviewOptionName) -> Tuple[str, str, str, Any, Any]: ... + config = configure + def cget(self, key: _TreeviewOptionName) -> Any: ... def bbox(self, item, column: Optional[Any] = ...): ... def get_children(self, item: Optional[Any] = ...): ... def set_children(self, item, *newchildren): ... @@ -145,19 +1182,51 @@ class Treeview(Widget, tkinter.XView, tkinter.YView): def selection_remove(self, items): ... def selection_toggle(self, items): ... def set(self, item, column: Optional[Any] = ..., value: Optional[Any] = ...): ... - def tag_bind(self, tagname, sequence: Optional[Any] = ..., callback: Optional[Any] = ...): ... + # There's no tag_unbind() or 'add' argument for whatever reason. + # Also, it's 'callback' instead of 'func' here. + @overload + def tag_bind( + self, + tagname: str, + sequence: Optional[str] = ..., + callback: Optional[Callable[[tkinter.Event[Treeview]], Optional[Literal["break"]]]] = ..., + ) -> str: ... + @overload + def tag_bind(self, tagname: str, sequence: Optional[str], callback: str) -> None: ... + @overload + def tag_bind(self, tagname: str, *, callback: str) -> None: ... def tag_configure(self, tagname, option: Optional[Any] = ..., **kw): ... def tag_has(self, tagname, item: Optional[Any] = ...): ... class LabeledScale(Frame): label: Any scale: Any - def __init__(self, master: Optional[Any] = ..., variable: Optional[Any] = ..., from_: int = ..., to: int = ..., **kw): ... - def destroy(self): ... + # TODO: don't any-type **kw. That goes to Frame.__init__. + def __init__( + self, + master: Optional[tkinter.Misc] = ..., + variable: Optional[Union[tkinter.IntVar, tkinter.DoubleVar]] = ..., + from_: float = ..., + to: float = ..., + *, + compound: Union[Literal["top"], Literal["bottom"]] = ..., + **kw: Any, + ) -> None: ... + # destroy is overrided, signature does not change value: Any class OptionMenu(Menubutton): - def __init__(self, master, variable, default: Optional[Any] = ..., *values, **kwargs): ... - def __getitem__(self, item): ... + def __init__( + self, + master, + variable, + default: Optional[str] = ..., + *values: str, + # rest of these are keyword-only because *args syntax used above + style: str = ..., + direction: Union[Literal["above"], Literal["below"], Literal["left"], Literal["right"], Literal["flush"]] = ..., + command: Optional[Callable[[tkinter.StringVar], Any]] = ..., + ) -> None: ... + # configure, config, cget, destroy are inherited from Menubutton + # destroy and __setitem__ are overrided, signature does not change def set_menu(self, default: Optional[Any] = ..., *values): ... - def destroy(self): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/tokenize.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/tokenize.pyi old mode 100755 new mode 100644 index 54684f3b..23babea2 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/tokenize.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/tokenize.pyi @@ -1,13 +1,32 @@ -from typing import Any, Callable, Generator, Iterable, List, NamedTuple, Optional, Union, Sequence, TextIO, Tuple -from builtins import open as _builtin_open import sys +from builtins import open as _builtin_open +from os import PathLike from token import * # noqa: F403 +from typing import ( + Any, + Callable, + Dict, + Generator, + Iterable, + List, + NamedTuple, + Optional, + Pattern, + Sequence, + Set, + TextIO, + Tuple, + Union, +) if sys.version_info < (3, 7): COMMENT: int NL: int ENCODING: int +cookie_re: Pattern[str] +blank_re: Pattern[bytes] + _Position = Tuple[int, int] class _TokenInfo(NamedTuple): @@ -25,7 +44,7 @@ class TokenInfo(_TokenInfo): _Token = Union[TokenInfo, Sequence[Union[int, str, _Position]]] class TokenError(Exception): ... -class StopTokenizing(Exception): ... +class StopTokenizing(Exception): ... # undocumented class Untokenizer: tokens: List[str] @@ -37,78 +56,61 @@ class Untokenizer: def untokenize(self, iterable: Iterable[_Token]) -> str: ... def compat(self, token: Sequence[Union[int, str]], iterable: Iterable[_Token]) -> None: ... +# the docstring says "returns bytes" but is incorrect -- +# if the ENCODING token is missing, it skips the encode def untokenize(iterable: Iterable[_Token]) -> Any: ... def detect_encoding(readline: Callable[[], bytes]) -> Tuple[str, Sequence[bytes]]: ... def tokenize(readline: Callable[[], bytes]) -> Generator[TokenInfo, None, None]: ... def generate_tokens(readline: Callable[[], str]) -> Generator[TokenInfo, None, None]: ... # undocumented +def open(filename: Union[str, bytes, int, PathLike[Any]]) -> TextIO: ... +def group(*choices: str) -> str: ... # undocumented +def any(*choices: str) -> str: ... # undocumented +def maybe(*choices: str) -> str: ... # undocumented + +Whitespace: str # undocumented +Comment: str # undocumented +Ignore: str # undocumented +Name: str # undocumented + +Hexnumber: str # undocumented +Binnumber: str # undocumented +Octnumber: str # undocumented +Decnumber: str # undocumented +Intnumber: str # undocumented +Exponent: str # undocumented +Pointfloat: str # undocumented +Expfloat: str # undocumented +Floatnumber: str # undocumented +Imagnumber: str # undocumented +Number: str # undocumented + +def _all_string_prefixes() -> Set[str]: ... # undocumented + +StringPrefix: str # undocumented + +Single: str # undocumented +Double: str # undocumented +Single3: str # undocumented +Double3: str # undocumented +Triple: str # undocumented +String: str # undocumented + +if sys.version_info < (3, 7): + Operator: str # undocumented + Bracket: str # undocumented + +Special: str # undocumented +Funny: str # undocumented + +PlainToken: str # undocumented +Token: str # undocumented + +ContStr: str # undocumented +PseudoExtras: str # undocumented +PseudoToken: str # undocumented + +endpats: Dict[str, str] # undocumented +single_quoted: Set[str] # undocumented +triple_quoted: Set[str] # undocumented -if sys.version_info >= (3, 6): - from os import PathLike - def open(filename: Union[str, bytes, int, PathLike[Any]]) -> TextIO: ... -else: - def open(filename: Union[str, bytes, int]) -> TextIO: ... - -# Names in __all__ with no definition: -# AMPER -# AMPEREQUAL -# ASYNC -# AT -# ATEQUAL -# AWAIT -# CIRCUMFLEX -# CIRCUMFLEXEQUAL -# COLON -# COMMA -# DEDENT -# DOT -# DOUBLESLASH -# DOUBLESLASHEQUAL -# DOUBLESTAR -# DOUBLESTAREQUAL -# ELLIPSIS -# ENDMARKER -# EQEQUAL -# EQUAL -# ERRORTOKEN -# GREATER -# GREATEREQUAL -# INDENT -# ISEOF -# ISNONTERMINAL -# ISTERMINAL -# LBRACE -# LEFTSHIFT -# LEFTSHIFTEQUAL -# LESS -# LESSEQUAL -# LPAR -# LSQB -# MINEQUAL -# MINUS -# NAME -# NEWLINE -# NOTEQUAL -# NT_OFFSET -# NUMBER -# N_TOKENS -# OP -# PERCENT -# PERCENTEQUAL -# PLUS -# PLUSEQUAL -# RARROW -# RBRACE -# RIGHTSHIFT -# RIGHTSHIFTEQUAL -# RPAR -# RSQB -# SEMI -# SLASH -# SLASHEQUAL -# STAR -# STAREQUAL -# STRING -# TILDE -# VBAR -# VBAREQUAL -# tok_name +tabsize: int # undocumented diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/tracemalloc.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/tracemalloc.pyi old mode 100755 new mode 100644 index 8758cc67..593c4eda --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/tracemalloc.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/tracemalloc.pyi @@ -1,54 +1,36 @@ -# Stubs for tracemalloc (Python 3.4+) - import sys from typing import List, Optional, Sequence, Tuple, Union, overload -def clear_traces() -> None: ... +from _tracemalloc import * + def get_object_traceback(obj: object) -> Optional[Traceback]: ... -def get_traceback_limit() -> int: ... -def get_traced_memory() -> Tuple[int, int]: ... -def get_tracemalloc_memory() -> int: ... -def is_tracing() -> bool: ... -def start(nframe: int = ...) -> None: ... -def stop() -> None: ... def take_snapshot() -> Snapshot: ... -if sys.version_info >= (3, 6): - class DomainFilter: - inclusive: bool - domain: int - def __init__(self, inclusive: bool, domain: int) -> None: ... +class DomainFilter: + inclusive: bool + domain: int + def __init__(self, inclusive: bool, domain: int) -> None: ... class Filter: - if sys.version_info >= (3, 6): - domain: Optional[int] + domain: Optional[int] inclusive: bool lineno: Optional[int] filename_pattern: str all_frames: bool - def __init__(self, inclusive: bool, filename_pattern: str, lineno: Optional[int] = ..., all_frames: bool = ..., domain: Optional[int] = ...) -> None: ... - -class Frame: - filename: str - lineno: int - -class Snapshot: - def compare_to(self, old_snapshot: Snapshot, key_type: str, cumulative: bool = ...) -> List[StatisticDiff]: ... - def dump(self, filename: str) -> None: ... - if sys.version_info >= (3, 6): - def filter_traces(self, filters: Sequence[Union[DomainFilter, Filter]]) -> Snapshot: ... - else: - def filter_traces(self, filters: Sequence[Filter]) -> Snapshot: ... - @classmethod - def load(cls, filename: str) -> Snapshot: ... - def statistics(self, key_type: str, cumulative: bool = ...) -> List[Statistic]: ... - traceback_limit: int - traces: Sequence[Trace] + def __init__( + self, + inclusive: bool, + filename_pattern: str, + lineno: Optional[int] = ..., + all_frames: bool = ..., + domain: Optional[int] = ..., + ) -> None: ... class Statistic: count: int size: int traceback: Traceback + def __init__(self, traceback: Traceback, size: int, count: int) -> None: ... class StatisticDiff: count: int @@ -56,15 +38,49 @@ class StatisticDiff: size: int size_diff: int traceback: Traceback + def __init__(self, traceback: Traceback, size: int, size_diff: int, count: int, count_diff: int) -> None: ... + +_FrameTupleT = Tuple[str, int] + +class Frame: + filename: str + lineno: int + def __init__(self, frame: _FrameTupleT) -> None: ... + +if sys.version_info >= (3, 9): + _TraceTupleT = Union[Tuple[int, int, Sequence[_FrameTupleT], Optional[int]], Tuple[int, int, Sequence[_FrameTupleT]]] +else: + _TraceTupleT = Tuple[int, int, Sequence[_FrameTupleT]] class Trace: + domain: int size: int traceback: Traceback + def __init__(self, trace: _TraceTupleT) -> None: ... class Traceback(Sequence[Frame]): - def format(self, limit: Optional[int] = ...) -> List[str]: ... + if sys.version_info >= (3, 9): + total_nframe: Optional[int] + def __init__(self, frames: Sequence[_FrameTupleT], total_nframe: Optional[int] = ...) -> None: ... + else: + def __init__(self, frames: Sequence[_FrameTupleT]) -> None: ... + if sys.version_info >= (3, 7): + def format(self, limit: Optional[int] = ..., most_recent_first: bool = ...) -> List[str]: ... + else: + def format(self, limit: Optional[int] = ...) -> List[str]: ... @overload def __getitem__(self, i: int) -> Frame: ... @overload def __getitem__(self, s: slice) -> Sequence[Frame]: ... def __len__(self) -> int: ... + +class Snapshot: + def __init__(self, traces: Sequence[_TraceTupleT], traceback_limit: int) -> None: ... + def compare_to(self, old_snapshot: Snapshot, key_type: str, cumulative: bool = ...) -> List[StatisticDiff]: ... + def dump(self, filename: str) -> None: ... + def filter_traces(self, filters: Sequence[Union[DomainFilter, Filter]]) -> Snapshot: ... + @staticmethod + def load(filename: str) -> Snapshot: ... + def statistics(self, key_type: str, cumulative: bool = ...) -> List[Statistic]: ... + traceback_limit: int + traces: Sequence[Trace] diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/types.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/types.pyi old mode 100755 new mode 100644 index b8f7d925..d5b419c1 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/types.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/types.pyi @@ -1,23 +1,33 @@ -# Stubs for types -# Note, all classes "defined" here require special handling. - -# TODO parts of this should be conditional on version - import sys from typing import ( - Any, Awaitable, Callable, Dict, Generic, Iterator, Mapping, Optional, Tuple, TypeVar, - Union, overload, Type, Iterable + Any, + Awaitable, + Callable, + Dict, + Generic, + Iterable, + Iterator, + Mapping, + Optional, + Tuple, + Type, + TypeVar, + Union, + overload, ) +from typing_extensions import Literal, final # ModuleType is exported from this module, but for circular import # reasons exists in its own stub file (with ModuleSpec and Loader). from _importlib_modulespec import ModuleType as ModuleType # Exported -_T = TypeVar('_T') -_T_co = TypeVar('_T_co', covariant=True) -_T_contra = TypeVar('_T_contra', contravariant=True) -_KT = TypeVar('_KT') -_VT = TypeVar('_VT') +# Note, all classes "defined" here require special handling. + +_T = TypeVar("_T") +_T_co = TypeVar("_T_co", covariant=True) +_T_contra = TypeVar("_T_contra", contravariant=True) +_KT = TypeVar("_KT") +_VT = TypeVar("_VT") class _Cell: cell_contents: Any @@ -32,13 +42,22 @@ class FunctionType: __qualname__: str __annotations__: Dict[str, Any] __kwdefaults__: Dict[str, Any] - def __init__(self, code: CodeType, globals: Dict[str, Any], name: Optional[str] = ..., argdefs: Optional[Tuple[object, ...]] = ..., closure: Optional[Tuple[_Cell, ...]] = ...) -> None: ... + def __init__( + self, + code: CodeType, + globals: Dict[str, Any], + name: Optional[str] = ..., + argdefs: Optional[Tuple[object, ...]] = ..., + closure: Optional[Tuple[_Cell, ...]] = ..., + ) -> None: ... def __call__(self, *args: Any, **kwargs: Any) -> Any: ... def __get__(self, obj: Optional[object], type: Optional[type]) -> MethodType: ... + LambdaType = FunctionType class CodeType: """Create a code object. Not for the faint of heart.""" + co_argcount: int if sys.version_info >= (3, 8): co_posonlyargcount: int @@ -122,7 +141,7 @@ class MappingProxyType(Mapping[_KT, _VT], Generic[_KT, _VT]): def __getitem__(self, k: _KT) -> _VT: ... def __iter__(self) -> Iterator[_KT]: ... def __len__(self) -> int: ... - def copy(self) -> Mapping[_KT, _VT]: ... + def copy(self) -> Dict[_KT, _VT]: ... class SimpleNamespace: def __init__(self, **kwargs: Any) -> None: ... @@ -138,26 +157,29 @@ class GeneratorType: def __iter__(self) -> GeneratorType: ... def __next__(self) -> Any: ... def close(self) -> None: ... - def send(self, arg: Any) -> Any: ... + def send(self, __arg: Any) -> Any: ... + @overload + def throw( + self, __typ: Type[BaseException], __val: Union[BaseException, object] = ..., __tb: Optional[TracebackType] = ... + ) -> Any: ... + @overload + def throw(self, __typ: BaseException, __val: None = ..., __tb: Optional[TracebackType] = ...) -> Any: ... + +class AsyncGeneratorType(Generic[_T_co, _T_contra]): + ag_await: Optional[Awaitable[Any]] + ag_frame: FrameType + ag_running: bool + ag_code: CodeType + def __aiter__(self) -> Awaitable[AsyncGeneratorType[_T_co, _T_contra]]: ... + def __anext__(self) -> Awaitable[_T_co]: ... + def asend(self, __val: _T_contra) -> Awaitable[_T_co]: ... @overload - def throw(self, val: BaseException) -> Any: ... + def athrow( + self, __typ: Type[BaseException], __val: Union[BaseException, object] = ..., __tb: Optional[TracebackType] = ... + ) -> Awaitable[_T_co]: ... @overload - def throw(self, typ: type, val: BaseException = ..., tb: TracebackType = ...) -> Any: ... - -if sys.version_info >= (3, 6): - class AsyncGeneratorType(Generic[_T_co, _T_contra]): - ag_await: Optional[Awaitable[Any]] - ag_frame: FrameType - ag_running: bool - ag_code: CodeType - def __aiter__(self) -> Awaitable[AsyncGeneratorType[_T_co, _T_contra]]: ... - def __anext__(self) -> Awaitable[_T_co]: ... - def asend(self, val: _T_contra) -> Awaitable[_T_co]: ... - @overload - def athrow(self, val: BaseException) -> Awaitable[_T_co]: ... - @overload - def athrow(self, typ: Type[BaseException], val: BaseException, tb: TracebackType = ...) -> Awaitable[_T_co]: ... - def aclose(self) -> Awaitable[None]: ... + def athrow(self, __typ: BaseException, __val: None = ..., __tb: Optional[TracebackType] = ...) -> Awaitable[_T_co]: ... + def aclose(self) -> Awaitable[None]: ... class CoroutineType: cr_await: Optional[Any] @@ -165,11 +187,13 @@ class CoroutineType: cr_frame: FrameType cr_running: bool def close(self) -> None: ... - def send(self, arg: Any) -> Any: ... + def send(self, __arg: Any) -> Any: ... @overload - def throw(self, val: BaseException) -> Any: ... + def throw( + self, __typ: Type[BaseException], __val: Union[BaseException, object] = ..., __tb: Optional[TracebackType] = ... + ) -> Any: ... @overload - def throw(self, typ: type, val: BaseException = ..., tb: TracebackType = ...) -> Any: ... + def throw(self, __typ: BaseException, __val: None = ..., __tb: Optional[TracebackType] = ...) -> Any: ... class _StaticFunctionType: """Fictional type to correct the type of MethodType.__func__. @@ -184,6 +208,7 @@ class _StaticFunctionType: similar to wrapping a function in staticmethod() at runtime to prevent it being bound as a method. """ + def __get__(self, obj: Optional[object], type: Optional[type]) -> FunctionType: ... class MethodType: @@ -193,11 +218,13 @@ class MethodType: __qualname__: str def __init__(self, func: Callable[..., Any], obj: object) -> None: ... def __call__(self, *args: Any, **kwargs: Any) -> Any: ... + class BuiltinFunctionType: __self__: Union[object, ModuleType] __name__: str __qualname__: str def __call__(self, *args: Any, **kwargs: Any) -> Any: ... + BuiltinMethodType = BuiltinFunctionType if sys.version_info >= (3, 7): @@ -207,7 +234,6 @@ if sys.version_info >= (3, 7): __objclass__: type def __call__(self, *args: Any, **kwargs: Any) -> Any: ... def __get__(self, obj: Any, type: type = ...) -> Any: ... - class MethodWrapperType: __self__: object __name__: str @@ -216,14 +242,12 @@ if sys.version_info >= (3, 7): def __call__(self, *args: Any, **kwargs: Any) -> Any: ... def __eq__(self, other: Any) -> bool: ... def __ne__(self, other: Any) -> bool: ... - class MethodDescriptorType: __name__: str __qualname__: str __objclass__: type def __call__(self, *args: Any, **kwargs: Any) -> Any: ... def __get__(self, obj: Any, type: type = ...) -> Any: ... - class ClassMethodDescriptorType: __name__: str __qualname__: str @@ -231,7 +255,6 @@ if sys.version_info >= (3, 7): def __call__(self, *args: Any, **kwargs: Any) -> Any: ... def __get__(self, obj: Any, type: type = ...) -> Any: ... - class TracebackType: if sys.version_info >= (3, 7): def __init__(self, tb_next: Optional[TracebackType], tb_frame: FrameType, tb_lasti: int, tb_lineno: int) -> None: ... @@ -248,18 +271,17 @@ class TracebackType: def tb_lineno(self) -> int: ... class FrameType: - f_back: FrameType + f_back: Optional[FrameType] f_builtins: Dict[str, Any] f_code: CodeType f_globals: Dict[str, Any] f_lasti: int f_lineno: int f_locals: Dict[str, Any] - f_trace: Callable[[], None] + f_trace: Optional[Callable[[FrameType, str, Any], Any]] if sys.version_info >= (3, 7): f_trace_lines: bool f_trace_opcodes: bool - def clear(self) -> None: ... class GetSetDescriptorType: @@ -268,6 +290,7 @@ class GetSetDescriptorType: def __get__(self, obj: Any, type: type = ...) -> Any: ... def __set__(self, obj: Any) -> None: ... def __delete__(self, obj: Any) -> None: ... + class MemberDescriptorType: __name__: str __objclass__: type @@ -276,13 +299,36 @@ class MemberDescriptorType: def __delete__(self, obj: Any) -> None: ... if sys.version_info >= (3, 7): - def new_class(name: str, bases: Iterable[object] = ..., kwds: Dict[str, Any] = ..., exec_body: Callable[[Dict[str, Any]], None] = ...) -> type: ... + def new_class( + name: str, bases: Iterable[object] = ..., kwds: Dict[str, Any] = ..., exec_body: Callable[[Dict[str, Any]], None] = ... + ) -> type: ... def resolve_bases(bases: Iterable[object]) -> Tuple[Any, ...]: ... + else: - def new_class(name: str, bases: Tuple[type, ...] = ..., kwds: Dict[str, Any] = ..., exec_body: Callable[[Dict[str, Any]], None] = ...) -> type: ... -def prepare_class(name: str, bases: Tuple[type, ...] = ..., kwds: Dict[str, Any] = ...) -> Tuple[type, Dict[str, Any], Dict[str, Any]]: ... + def new_class( + name: str, bases: Tuple[type, ...] = ..., kwds: Dict[str, Any] = ..., exec_body: Callable[[Dict[str, Any]], None] = ... + ) -> type: ... + +def prepare_class( + name: str, bases: Tuple[type, ...] = ..., kwds: Dict[str, Any] = ... +) -> Tuple[type, Dict[str, Any], Dict[str, Any]]: ... # Actually a different type, but `property` is special and we want that too. DynamicClassAttribute = property def coroutine(f: Callable[..., Any]) -> CoroutineType: ... + +if sys.version_info >= (3, 9): + class GenericAlias: + __origin__: type + __args__: Tuple[Any, ...] + __parameters__: Tuple[Any, ...] + def __init__(self, origin: type, args: Any) -> None: ... + def __getattr__(self, name: str) -> Any: ... # incomplete + +if sys.version_info >= (3, 10): + @final + class NoneType: + def __bool__(self) -> Literal[False]: ... + EllipsisType = ellipsis # noqa F811 from builtins + NotImplementedType = _NotImplementedType # noqa F811 from builtins diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/typing.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/typing.pyi old mode 100755 new mode 100644 index 96eaeecc..b74a5435 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/typing.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/typing.pyi @@ -1,36 +1,66 @@ -# Stubs for typing - -import sys -from abc import abstractmethod, ABCMeta -from types import CodeType, FrameType, TracebackType import collections # Needed by aliases like DefaultDict, see mypy issue 2986 +import sys +from abc import ABCMeta, abstractmethod +from types import BuiltinFunctionType, CodeType, FrameType, FunctionType, MethodType, ModuleType, TracebackType + +if sys.version_info >= (3, 7): + from types import MethodDescriptorType, MethodWrapperType, WrapperDescriptorType + +if sys.version_info >= (3, 9): + from types import GenericAlias # Definitions of special type checking related constructs. Their definitions # are not used, so their value does not matter. overload = object() Any = object() -TypeVar = object() + +class TypeVar: + __name__: str + __bound__: Optional[Type[Any]] + __constraints__: Tuple[Type[Any], ...] + __covariant__: bool + __contravariant__: bool + def __init__( + self, + name: str, + *constraints: Type[Any], + bound: Union[None, Type[Any], str] = ..., + covariant: bool = ..., + contravariant: bool = ..., + ) -> None: ... + _promote = object() class _SpecialForm: - def __getitem__(self, typeargs: Any) -> Any: ... + def __getitem__(self, typeargs: Any) -> object: ... +Union: _SpecialForm = ... +Optional: _SpecialForm = ... Tuple: _SpecialForm = ... Generic: _SpecialForm = ... +# Protocol is only present in 3.8 and later, but mypy needs it unconditionally Protocol: _SpecialForm = ... Callable: _SpecialForm = ... Type: _SpecialForm = ... ClassVar: _SpecialForm = ... if sys.version_info >= (3, 8): Final: _SpecialForm = ... - _F = TypeVar('_F', bound=Callable[..., Any]) + _F = TypeVar("_F", bound=Callable[..., Any]) def final(f: _F) -> _F: ... Literal: _SpecialForm = ... # TypedDict is a (non-subscriptable) special form. TypedDict: object -class GenericMeta(type): ... +if sys.version_info < (3, 7): + class GenericMeta(type): ... + +if sys.version_info >= (3, 10): + class ParamSpec: + __name__: str + def __init__(self, name: str) -> None: ... + Concatenate: _SpecialForm = ... + TypeAlias: _SpecialForm = ... # Return type that indicates a function does not return. # This type is equivalent to the None type, but the no-op Union is necessary to @@ -38,49 +68,49 @@ class GenericMeta(type): ... NoReturn = Union[None] # These type variables are used by the container types. -_T = TypeVar('_T') -_S = TypeVar('_S') -_KT = TypeVar('_KT') # Key type. -_VT = TypeVar('_VT') # Value type. -_T_co = TypeVar('_T_co', covariant=True) # Any type covariant containers. -_V_co = TypeVar('_V_co', covariant=True) # Any type covariant containers. -_KT_co = TypeVar('_KT_co', covariant=True) # Key type covariant containers. -_VT_co = TypeVar('_VT_co', covariant=True) # Value type covariant containers. -_T_contra = TypeVar('_T_contra', contravariant=True) # Ditto contravariant. -_TC = TypeVar('_TC', bound=Type[object]) +_T = TypeVar("_T") +_S = TypeVar("_S") +_KT = TypeVar("_KT") # Key type. +_VT = TypeVar("_VT") # Value type. +_T_co = TypeVar("_T_co", covariant=True) # Any type covariant containers. +_V_co = TypeVar("_V_co", covariant=True) # Any type covariant containers. +_KT_co = TypeVar("_KT_co", covariant=True) # Key type covariant containers. +_VT_co = TypeVar("_VT_co", covariant=True) # Value type covariant containers. +_T_contra = TypeVar("_T_contra", contravariant=True) # Ditto contravariant. +_TC = TypeVar("_TC", bound=Type[object]) _C = TypeVar("_C", bound=Callable[..., Any]) no_type_check = object() + def no_type_check_decorator(decorator: _C) -> _C: ... # Type aliases and type constructors -class TypeAlias: +class _Alias: # Class for defining generic aliases for library types. - def __init__(self, target_type: type) -> None: ... def __getitem__(self, typeargs: Any) -> Any: ... -Union = TypeAlias(object) -Optional = TypeAlias(object) -List = TypeAlias(object) -Dict = TypeAlias(object) -DefaultDict = TypeAlias(object) -Set = TypeAlias(object) -FrozenSet = TypeAlias(object) -Counter = TypeAlias(object) -Deque = TypeAlias(object) -ChainMap = TypeAlias(object) +List = _Alias() +Dict = _Alias() +DefaultDict = _Alias() +Set = _Alias() +FrozenSet = _Alias() +Counter = _Alias() +Deque = _Alias() +ChainMap = _Alias() if sys.version_info >= (3, 7): - OrderedDict = TypeAlias(object) + OrderedDict = _Alias() + +if sys.version_info >= (3, 9): + Annotated: _SpecialForm = ... # Predefined type variables. -AnyStr = TypeVar('AnyStr', str, bytes) +AnyStr = TypeVar("AnyStr", str, bytes) # Abstract base classes. def runtime_checkable(cls: _TC) -> _TC: ... - @runtime_checkable class SupportsInt(Protocol, metaclass=ABCMeta): @abstractmethod @@ -121,11 +151,6 @@ class SupportsRound(Protocol[_T_co]): @abstractmethod def __round__(self, ndigits: int) -> _T_co: ... -@runtime_checkable -class Reversible(Protocol[_T_co]): - @abstractmethod - def __reversed__(self) -> Iterator[_T_co]: ... - @runtime_checkable class Sized(Protocol, metaclass=ABCMeta): @abstractmethod @@ -150,23 +175,25 @@ class Iterator(Iterable[_T_co], Protocol[_T_co]): def __next__(self) -> _T_co: ... def __iter__(self) -> Iterator[_T_co]: ... -class Generator(Iterator[_T_co], Generic[_T_co, _T_contra, _V_co]): +@runtime_checkable +class Reversible(Iterable[_T_co], Protocol[_T_co]): @abstractmethod - def __next__(self) -> _T_co: ... + def __reversed__(self) -> Iterator[_T_co]: ... +class Generator(Iterator[_T_co], Generic[_T_co, _T_contra, _V_co]): + def __next__(self) -> _T_co: ... @abstractmethod - def send(self, value: _T_contra) -> _T_co: ... - + def send(self, __value: _T_contra) -> _T_co: ... + @overload @abstractmethod - def throw(self, typ: Type[BaseException], val: Optional[BaseException] = ..., - tb: Optional[TracebackType] = ...) -> _T_co: ... - + def throw( + self, __typ: Type[BaseException], __val: Union[BaseException, object] = ..., __tb: Optional[TracebackType] = ... + ) -> _T_co: ... + @overload @abstractmethod + def throw(self, __typ: BaseException, __val: None = ..., __tb: Optional[TracebackType] = ...) -> _T_co: ... def close(self) -> None: ... - - @abstractmethod def __iter__(self) -> Generator[_T_co, _T_contra, _V_co]: ... - @property def gi_code(self) -> CodeType: ... @property @@ -182,6 +209,8 @@ class Awaitable(Protocol[_T_co]): def __await__(self) -> Generator[Any, None, _T_co]: ... class Coroutine(Awaitable[_V_co], Generic[_T_co, _T_contra, _V_co]): + __name__: str + __qualname__: str @property def cr_await(self) -> Optional[Any]: ... @property @@ -190,22 +219,24 @@ class Coroutine(Awaitable[_V_co], Generic[_T_co, _T_contra, _V_co]): def cr_frame(self) -> FrameType: ... @property def cr_running(self) -> bool: ... - @abstractmethod - def send(self, value: _T_contra) -> _T_co: ... - + def send(self, __value: _T_contra) -> _T_co: ... + @overload @abstractmethod - def throw(self, typ: Type[BaseException], val: Optional[BaseException] = ..., - tb: Optional[TracebackType] = ...) -> _T_co: ... - + def throw( + self, __typ: Type[BaseException], __val: Union[BaseException, object] = ..., __tb: Optional[TracebackType] = ... + ) -> _T_co: ... + @overload + @abstractmethod + def throw(self, __typ: BaseException, __val: None = ..., __tb: Optional[TracebackType] = ...) -> _T_co: ... @abstractmethod def close(self) -> None: ... - # NOTE: This type does not exist in typing.py or PEP 484. # The parameters correspond to Generator, but the 4th is the original type. -class AwaitableGenerator(Awaitable[_V_co], Generator[_T_co, _T_contra, _V_co], - Generic[_T_co, _T_contra, _V_co, _S], metaclass=ABCMeta): ... +class AwaitableGenerator( + Awaitable[_V_co], Generator[_T_co, _T_contra, _V_co], Generic[_T_co, _T_contra, _V_co, _S], metaclass=ABCMeta +): ... @runtime_checkable class AsyncIterable(Protocol[_T_co]): @@ -213,59 +244,49 @@ class AsyncIterable(Protocol[_T_co]): def __aiter__(self) -> AsyncIterator[_T_co]: ... @runtime_checkable -class AsyncIterator(AsyncIterable[_T_co], - Protocol[_T_co]): +class AsyncIterator(AsyncIterable[_T_co], Protocol[_T_co]): @abstractmethod def __anext__(self) -> Awaitable[_T_co]: ... def __aiter__(self) -> AsyncIterator[_T_co]: ... -if sys.version_info >= (3, 6): - class AsyncGenerator(AsyncIterator[_T_co], Generic[_T_co, _T_contra]): - @abstractmethod - def __anext__(self) -> Awaitable[_T_co]: ... - - @abstractmethod - def asend(self, value: _T_contra) -> Awaitable[_T_co]: ... - - @abstractmethod - def athrow(self, typ: Type[BaseException], val: Optional[BaseException] = ..., - tb: Any = ...) -> Awaitable[_T_co]: ... - - @abstractmethod - def aclose(self) -> Awaitable[None]: ... - - @abstractmethod - def __aiter__(self) -> AsyncGenerator[_T_co, _T_contra]: ... - - @property - def ag_await(self) -> Any: ... - @property - def ag_code(self) -> CodeType: ... - @property - def ag_frame(self) -> FrameType: ... - @property - def ag_running(self) -> bool: ... +class AsyncGenerator(AsyncIterator[_T_co], Generic[_T_co, _T_contra]): + @abstractmethod + def __anext__(self) -> Awaitable[_T_co]: ... + @abstractmethod + def asend(self, __value: _T_contra) -> Awaitable[_T_co]: ... + @overload + @abstractmethod + def athrow( + self, __typ: Type[BaseException], __val: Union[BaseException, object] = ..., __tb: Optional[TracebackType] = ... + ) -> Awaitable[_T_co]: ... + @overload + @abstractmethod + def athrow(self, __typ: BaseException, __val: None = ..., __tb: Optional[TracebackType] = ...) -> Awaitable[_T_co]: ... + @abstractmethod + def aclose(self) -> Awaitable[None]: ... + @abstractmethod + def __aiter__(self) -> AsyncGenerator[_T_co, _T_contra]: ... + @property + def ag_await(self) -> Any: ... + @property + def ag_code(self) -> CodeType: ... + @property + def ag_frame(self) -> FrameType: ... + @property + def ag_running(self) -> bool: ... @runtime_checkable class Container(Protocol[_T_co]): @abstractmethod def __contains__(self, __x: object) -> bool: ... +@runtime_checkable +class Collection(Iterable[_T_co], Container[_T_co], Protocol[_T_co]): + # Implement Sized (but don't have it as a base class). + @abstractmethod + def __len__(self) -> int: ... -if sys.version_info >= (3, 6): - @runtime_checkable - class Collection(Iterable[_T_co], Container[_T_co], Protocol[_T_co]): - # Implement Sized (but don't have it as a base class). - @abstractmethod - def __len__(self) -> int: ... - - _Collection = Collection -else: - @runtime_checkable - class _Collection(Iterable[_T_co], Container[_T_co], Protocol[_T_co]): - # Implement Sized (but don't have it as a base class). - @abstractmethod - def __len__(self) -> int: ... +_Collection = Collection[_T_co] class Sequence(_Collection[_T_co], Reversible[_T_co], Generic[_T_co]): @overload @@ -275,15 +296,15 @@ class Sequence(_Collection[_T_co], Reversible[_T_co], Generic[_T_co]): @abstractmethod def __getitem__(self, s: slice) -> Sequence[_T_co]: ... # Mixin methods - def index(self, x: Any, start: int = ..., end: int = ...) -> int: ... - def count(self, x: Any) -> int: ... + def index(self, value: Any, start: int = ..., stop: int = ...) -> int: ... + def count(self, value: Any) -> int: ... def __contains__(self, x: object) -> bool: ... def __iter__(self) -> Iterator[_T_co]: ... def __reversed__(self) -> Iterator[_T_co]: ... class MutableSequence(Sequence[_T], Generic[_T]): @abstractmethod - def insert(self, index: int, object: _T) -> None: ... + def insert(self, index: int, value: _T) -> None: ... @overload @abstractmethod def __getitem__(self, i: int) -> _T: ... @@ -303,12 +324,12 @@ class MutableSequence(Sequence[_T], Generic[_T]): @abstractmethod def __delitem__(self, i: slice) -> None: ... # Mixin methods - def append(self, object: _T) -> None: ... + def append(self, value: _T) -> None: ... def clear(self) -> None: ... - def extend(self, iterable: Iterable[_T]) -> None: ... + def extend(self, values: Iterable[_T]) -> None: ... def reverse(self) -> None: ... def pop(self, index: int = ...) -> _T: ... - def remove(self, object: _T) -> None: ... + def remove(self, value: _T) -> None: ... def __iadd__(self, x: Iterable[_T]) -> MutableSequence[_T]: ... class AbstractSet(_Collection[_T_co], Generic[_T_co]): @@ -323,26 +344,28 @@ class AbstractSet(_Collection[_T_co], Generic[_T_co]): def __or__(self, s: AbstractSet[_T]) -> AbstractSet[Union[_T_co, _T]]: ... def __sub__(self, s: AbstractSet[Any]) -> AbstractSet[_T_co]: ... def __xor__(self, s: AbstractSet[_T]) -> AbstractSet[Union[_T_co, _T]]: ... - def isdisjoint(self, s: Iterable[Any]) -> bool: ... + def isdisjoint(self, other: Iterable[Any]) -> bool: ... class MutableSet(AbstractSet[_T], Generic[_T]): @abstractmethod - def add(self, x: _T) -> None: ... + def add(self, value: _T) -> None: ... @abstractmethod - def discard(self, x: _T) -> None: ... + def discard(self, value: _T) -> None: ... # Mixin methods def clear(self) -> None: ... def pop(self) -> _T: ... - def remove(self, element: _T) -> None: ... + def remove(self, value: _T) -> None: ... def __ior__(self, s: AbstractSet[_S]) -> MutableSet[Union[_T, _S]]: ... def __iand__(self, s: AbstractSet[Any]) -> MutableSet[_T]: ... def __ixor__(self, s: AbstractSet[_S]) -> MutableSet[Union[_T, _S]]: ... def __isub__(self, s: AbstractSet[Any]) -> MutableSet[_T]: ... -class MappingView: +class MappingView(Sized): + def __init__(self, mapping: Mapping[_KT_co, _VT_co]) -> None: ... # undocumented def __len__(self) -> int: ... class ItemsView(MappingView, AbstractSet[Tuple[_KT_co, _VT_co]], Generic[_KT_co, _VT_co]): + def __init__(self, mapping: Mapping[_KT_co, _VT_co]) -> None: ... # undocumented def __and__(self, o: Iterable[Any]) -> Set[Tuple[_KT_co, _VT_co]]: ... def __rand__(self, o: Iterable[_T]) -> Set[_T]: ... def __contains__(self, o: object) -> bool: ... @@ -357,6 +380,7 @@ class ItemsView(MappingView, AbstractSet[Tuple[_KT_co, _VT_co]], Generic[_KT_co, def __rxor__(self, o: Iterable[_T]) -> Set[Union[Tuple[_KT_co, _VT_co], _T]]: ... class KeysView(MappingView, AbstractSet[_KT_co], Generic[_KT_co]): + def __init__(self, mapping: Mapping[_KT_co, _VT_co]) -> None: ... # undocumented def __and__(self, o: Iterable[Any]) -> Set[_KT_co]: ... def __rand__(self, o: Iterable[_T]) -> Set[_T]: ... def __contains__(self, o: object) -> bool: ... @@ -371,6 +395,7 @@ class KeysView(MappingView, AbstractSet[_KT_co], Generic[_KT_co]): def __rxor__(self, o: Iterable[_T]) -> Set[Union[_KT_co, _T]]: ... class ValuesView(MappingView, Iterable[_VT_co], Generic[_VT_co]): + def __init__(self, mapping: Mapping[_KT_co, _VT_co]) -> None: ... # undocumented def __contains__(self, o: object) -> bool: ... def __iter__(self) -> Iterator[_VT_co]: ... if sys.version_info >= (3, 8): @@ -379,31 +404,30 @@ class ValuesView(MappingView, Iterable[_VT_co], Generic[_VT_co]): @runtime_checkable class ContextManager(Protocol[_T_co]): def __enter__(self) -> _T_co: ... - def __exit__(self, __exc_type: Optional[Type[BaseException]], - __exc_value: Optional[BaseException], - __traceback: Optional[TracebackType]) -> Optional[bool]: ... + def __exit__( + self, + __exc_type: Optional[Type[BaseException]], + __exc_value: Optional[BaseException], + __traceback: Optional[TracebackType], + ) -> Optional[bool]: ... @runtime_checkable class AsyncContextManager(Protocol[_T_co]): def __aenter__(self) -> Awaitable[_T_co]: ... def __aexit__( - self, - exc_type: Optional[Type[BaseException]], - exc_value: Optional[BaseException], - traceback: Optional[TracebackType], + self, exc_type: Optional[Type[BaseException]], exc_value: Optional[BaseException], traceback: Optional[TracebackType] ) -> Awaitable[Optional[bool]]: ... class Mapping(_Collection[_KT], Generic[_KT, _VT_co]): # TODO: We wish the key type could also be covariant, but that doesn't work, # see discussion in https: //github.com/python/typing/pull/273. @abstractmethod - def __getitem__(self, k: _KT) -> _VT_co: - ... + def __getitem__(self, k: _KT) -> _VT_co: ... # Mixin methods @overload - def get(self, k: _KT) -> Optional[_VT_co]: ... + def get(self, key: _KT) -> Optional[_VT_co]: ... @overload - def get(self, k: _KT, default: Union[_VT_co, _T]) -> Union[_VT_co, _T]: ... + def get(self, key: _KT, default: Union[_VT_co, _T]) -> Union[_VT_co, _T]: ... def items(self) -> AbstractSet[Tuple[_KT, _VT_co]]: ... def keys(self) -> AbstractSet[_KT]: ... def values(self) -> ValuesView[_VT_co]: ... @@ -414,14 +438,13 @@ class MutableMapping(Mapping[_KT, _VT], Generic[_KT, _VT]): def __setitem__(self, k: _KT, v: _VT) -> None: ... @abstractmethod def __delitem__(self, v: _KT) -> None: ... - def clear(self) -> None: ... @overload - def pop(self, k: _KT) -> _VT: ... + def pop(self, key: _KT) -> _VT: ... @overload - def pop(self, k: _KT, default: Union[_VT, _T] = ...) -> Union[_VT, _T]: ... + def pop(self, key: _KT, default: Union[_VT, _T] = ...) -> Union[_VT, _T]: ... def popitem(self) -> Tuple[_KT, _VT]: ... - def setdefault(self, k: _KT, default: _VT = ...) -> _VT: ... + def setdefault(self, key: _KT, default: _VT = ...) -> _VT: ... # 'update' used to take a Union, but using overloading is better. # The second overloaded type here is a bit too general, because # Mapping[Tuple[_KT, _VT], W] is a subclass of Iterable[Tuple[_KT, _VT]], @@ -444,7 +467,6 @@ Text = str TYPE_CHECKING = True class IO(Iterator[AnyStr], Generic[AnyStr]): - # TODO detach # TODO use abstract properties @property def mode(self) -> str: ... @@ -460,7 +482,6 @@ class IO(Iterator[AnyStr], Generic[AnyStr]): def flush(self) -> None: ... @abstractmethod def isatty(self) -> bool: ... - # TODO what if n is None? @abstractmethod def read(self, n: int = ...) -> AnyStr: ... @abstractmethod @@ -479,12 +500,10 @@ class IO(Iterator[AnyStr], Generic[AnyStr]): def truncate(self, size: Optional[int] = ...) -> int: ... @abstractmethod def writable(self) -> bool: ... - # TODO buffer objects @abstractmethod def write(self, s: AnyStr) -> int: ... @abstractmethod def writelines(self, lines: Iterable[AnyStr]) -> None: ... - @abstractmethod def __next__(self) -> AnyStr: ... @abstractmethod @@ -492,20 +511,11 @@ class IO(Iterator[AnyStr], Generic[AnyStr]): @abstractmethod def __enter__(self) -> IO[AnyStr]: ... @abstractmethod - def __exit__(self, t: Optional[Type[BaseException]], value: Optional[BaseException], - traceback: Optional[TracebackType]) -> Optional[bool]: ... + def __exit__( + self, t: Optional[Type[BaseException]], value: Optional[BaseException], traceback: Optional[TracebackType] + ) -> Optional[bool]: ... class BinaryIO(IO[bytes]): - # TODO readinto - # TODO read1? - # TODO peek? - @overload - @abstractmethod - def write(self, s: bytearray) -> int: ... - @overload - @abstractmethod - def write(self, s: bytes) -> int: ... - @abstractmethod def __enter__(self) -> BinaryIO: ... @@ -536,76 +546,95 @@ class Match(Generic[AnyStr]): # The regular expression object whose match() or search() method produced # this match instance. re: Pattern[AnyStr] - def expand(self, template: AnyStr) -> AnyStr: ... - # TODO: The return for a group may be None, except if __group is 0 or not given. @overload def group(self, __group: Union[str, int] = ...) -> AnyStr: ... @overload - def group( - self, - __group1: Union[str, int], - __group2: Union[str, int], - *groups: Union[str, int], - ) -> Tuple[AnyStr, ...]: ... - + def group(self, __group1: Union[str, int], __group2: Union[str, int], *groups: Union[str, int]) -> Tuple[AnyStr, ...]: ... def groups(self, default: AnyStr = ...) -> Sequence[AnyStr]: ... def groupdict(self, default: AnyStr = ...) -> dict[str, AnyStr]: ... - def start(self, group: Union[int, str] = ...) -> int: ... - def end(self, group: Union[int, str] = ...) -> int: ... - def span(self, group: Union[int, str] = ...) -> Tuple[int, int]: ... + def start(self, __group: Union[int, str] = ...) -> int: ... + def end(self, __group: Union[int, str] = ...) -> int: ... + def span(self, __group: Union[int, str] = ...) -> Tuple[int, int]: ... @property def regs(self) -> Tuple[Tuple[int, int], ...]: ... # undocumented - if sys.version_info >= (3, 6): - def __getitem__(self, g: Union[int, str]) -> AnyStr: ... + def __getitem__(self, g: Union[int, str]) -> AnyStr: ... + if sys.version_info >= (3, 9): + def __class_getitem__(cls, item: Any) -> GenericAlias: ... class Pattern(Generic[AnyStr]): flags: int groupindex: Mapping[str, int] groups: int pattern: AnyStr - - def search(self, string: AnyStr, pos: int = ..., - endpos: int = ...) -> Optional[Match[AnyStr]]: ... - def match(self, string: AnyStr, pos: int = ..., - endpos: int = ...) -> Optional[Match[AnyStr]]: ... + def search(self, string: AnyStr, pos: int = ..., endpos: int = ...) -> Optional[Match[AnyStr]]: ... + def match(self, string: AnyStr, pos: int = ..., endpos: int = ...) -> Optional[Match[AnyStr]]: ... # New in Python 3.4 - def fullmatch(self, string: AnyStr, pos: int = ..., - endpos: int = ...) -> Optional[Match[AnyStr]]: ... + def fullmatch(self, string: AnyStr, pos: int = ..., endpos: int = ...) -> Optional[Match[AnyStr]]: ... def split(self, string: AnyStr, maxsplit: int = ...) -> list[AnyStr]: ... - def findall(self, string: AnyStr, pos: int = ..., - endpos: int = ...) -> list[Any]: ... - def finditer(self, string: AnyStr, pos: int = ..., - endpos: int = ...) -> Iterator[Match[AnyStr]]: ... - + def findall(self, string: AnyStr, pos: int = ..., endpos: int = ...) -> list[Any]: ... + def finditer(self, string: AnyStr, pos: int = ..., endpos: int = ...) -> Iterator[Match[AnyStr]]: ... @overload - def sub(self, repl: AnyStr, string: AnyStr, - count: int = ...) -> AnyStr: ... + def sub(self, repl: AnyStr, string: AnyStr, count: int = ...) -> AnyStr: ... @overload - def sub(self, repl: Callable[[Match[AnyStr]], AnyStr], string: AnyStr, - count: int = ...) -> AnyStr: ... - + def sub(self, repl: Callable[[Match[AnyStr]], AnyStr], string: AnyStr, count: int = ...) -> AnyStr: ... @overload - def subn(self, repl: AnyStr, string: AnyStr, - count: int = ...) -> Tuple[AnyStr, int]: ... + def subn(self, repl: AnyStr, string: AnyStr, count: int = ...) -> Tuple[AnyStr, int]: ... @overload - def subn(self, repl: Callable[[Match[AnyStr]], AnyStr], string: AnyStr, - count: int = ...) -> Tuple[AnyStr, int]: ... + def subn(self, repl: Callable[[Match[AnyStr]], AnyStr], string: AnyStr, count: int = ...) -> Tuple[AnyStr, int]: ... + if sys.version_info >= (3, 9): + def __class_getitem__(cls, item: Any) -> GenericAlias: ... # Functions -def get_type_hints( - obj: Callable[..., Any], globalns: Optional[Dict[str, Any]] = ..., localns: Optional[Dict[str, Any]] = ..., -) -> Dict[str, Any]: ... +if sys.version_info >= (3, 7): + _get_type_hints_obj_allowed_types = Union[ + object, + Callable[..., Any], + FunctionType, + BuiltinFunctionType, + MethodType, + ModuleType, + WrapperDescriptorType, + MethodWrapperType, + MethodDescriptorType, + ] +else: + _get_type_hints_obj_allowed_types = Union[ + object, + Callable[..., Any], + FunctionType, + BuiltinFunctionType, + MethodType, + ModuleType, + ] + +if sys.version_info >= (3, 9): + def get_type_hints( + obj: _get_type_hints_obj_allowed_types, + globalns: Optional[Dict[str, Any]] = ..., + localns: Optional[Dict[str, Any]] = ..., + include_extras: bool = ..., + ) -> Dict[str, Any]: ... + +else: + def get_type_hints( + obj: _get_type_hints_obj_allowed_types, + globalns: Optional[Dict[str, Any]] = ..., + localns: Optional[Dict[str, Any]] = ..., + ) -> Dict[str, Any]: ... + if sys.version_info >= (3, 8): def get_origin(tp: Any) -> Optional[Any]: ... def get_args(tp: Any) -> Tuple[Any, ...]: ... @overload -def cast(tp: Type[_T], obj: Any) -> _T: ... +def cast(typ: Type[_T], val: Any) -> _T: ... @overload -def cast(tp: str, obj: Any) -> Any: ... +def cast(typ: str, val: Any) -> Any: ... +@overload +def cast(typ: object, val: Any) -> Any: ... # Type constructors @@ -615,13 +644,9 @@ class NamedTuple(Tuple[Any, ...]): _field_defaults: Dict[str, Any] = ... _fields: Tuple[str, ...] _source: str - - def __init__(self, typename: str, fields: Iterable[Tuple[str, Any]] = ..., - **kwargs: Any) -> None: ... - + def __init__(self, typename: str, fields: Iterable[Tuple[str, Any]] = ..., **kwargs: Any) -> None: ... @classmethod def _make(cls: Type[_T], iterable: Iterable[Any]) -> _T: ... - if sys.version_info >= (3, 8): def _asdict(self) -> Dict[str, Any]: ... else: @@ -638,8 +663,25 @@ class _TypedDict(Mapping[str, object], metaclass=ABCMeta): def pop(self, k: NoReturn, default: _T = ...) -> object: ... def update(self: _T, __m: _T) -> None: ... def __delitem__(self, k: NoReturn) -> None: ... + def items(self) -> ItemsView[str, object]: ... + def keys(self) -> KeysView[str]: ... + def values(self) -> ValuesView[object]: ... def NewType(name: str, tp: Type[_T]) -> Type[_T]: ... # This itself is only available during type checking def type_check_only(func_or_cls: _C) -> _C: ... + +if sys.version_info >= (3, 7): + from types import CodeType + class ForwardRef: + __forward_arg__: str + __forward_code__: CodeType + __forward_evaluated__: bool + __forward_value__: Optional[Any] + __forward_is_argument__: bool + def __init__(self, arg: str, is_argument: bool = ...) -> None: ... + def _evaluate(self, globalns: Optional[Dict[str, Any]], localns: Optional[Dict[str, Any]]) -> Optional[Any]: ... + def __eq__(self, other: Any) -> bool: ... + def __hash__(self) -> int: ... + def __repr__(self) -> str: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/unittest/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/unittest/__init__.pyi old mode 100755 new mode 100644 index 01f0dbb1..aadaa610 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/unittest/__init__.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/unittest/__init__.pyi @@ -1,32 +1,11 @@ -# Stubs for unittest - -from typing import Iterable, List, Optional, Type, Union -from types import ModuleType - +from typing import Optional from unittest.async_case import * from unittest.case import * from unittest.loader import * -from unittest.result import * +from unittest.main import * +from unittest.result import TestResult as TestResult from unittest.runner import * from unittest.signals import * from unittest.suite import * - -# not really documented -class TestProgram: - result: TestResult - def runTests(self) -> None: ... # undocumented - - -def main(module: Union[None, str, ModuleType] = ..., - defaultTest: Union[str, Iterable[str], None] = ..., - argv: Optional[List[str]] = ..., - testRunner: Union[Type[TestRunner], TestRunner, None] = ..., - testLoader: TestLoader = ..., exit: bool = ..., verbosity: int = ..., - failfast: Optional[bool] = ..., catchbreak: Optional[bool] = ..., - buffer: Optional[bool] = ..., - warnings: Optional[str] = ...) -> TestProgram: ... - - -def load_tests(loader: TestLoader, tests: TestSuite, - pattern: Optional[str]) -> TestSuite: ... +def load_tests(loader: TestLoader, tests: TestSuite, pattern: Optional[str]) -> TestSuite: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/unittest/async_case.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/unittest/async_case.pyi old mode 100755 new mode 100644 index 23e1c005..bdf534b3 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/unittest/async_case.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/unittest/async_case.pyi @@ -1,5 +1,6 @@ import sys from typing import Any, Awaitable, Callable + from .case import TestCase if sys.version_info >= (3, 8): diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/unittest/case.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/unittest/case.pyi old mode 100755 new mode 100644 index 3a17a3a9..e3c23f8e --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/unittest/case.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/unittest/case.pyi @@ -4,28 +4,48 @@ import sys import unittest.result from types import TracebackType from typing import ( - Any, AnyStr, Callable, Container, ContextManager, Dict, FrozenSet, Generic, - Iterable, List, Mapping, NoReturn, Optional, overload, Pattern, Sequence, - Set, Tuple, Type, TypeVar, Union, + Any, + AnyStr, + Callable, + Container, + ContextManager, + Dict, + FrozenSet, + Generic, + Iterable, + List, + Mapping, + NoReturn, + Optional, + Pattern, + Sequence, + Set, + Tuple, + Type, + TypeVar, + Union, + overload, ) +from warnings import WarningMessage -_E = TypeVar('_E', bound=BaseException) -_FT = TypeVar('_FT', bound=Callable[..., Any]) +if sys.version_info >= (3, 9): + from types import GenericAlias + +_E = TypeVar("_E", bound=BaseException) +_FT = TypeVar("_FT", bound=Callable[..., Any]) if sys.version_info >= (3, 8): def addModuleCleanup(__function: Callable[..., Any], *args: Any, **kwargs: Any) -> None: ... def doModuleCleanups() -> None: ... -def expectedFailure(func: _FT) -> _FT: ... +def expectedFailure(test_item: _FT) -> _FT: ... def skip(reason: str) -> Callable[[_FT], _FT]: ... def skipIf(condition: object, reason: str) -> Callable[[_FT], _FT]: ... def skipUnless(condition: object, reason: str) -> Callable[[_FT], _FT]: ... - class SkipTest(Exception): def __init__(self, reason: str) -> None: ... - class TestCase: failureException: Type[BaseException] longMessage: bool @@ -46,126 +66,133 @@ class TestCase: def skipTest(self, reason: Any) -> None: ... def subTest(self, msg: Any = ..., **params: Any) -> ContextManager[None]: ... def debug(self) -> None: ... - def _addSkip( - self, result: unittest.result.TestResult, test_case: unittest.case.TestCase, reason: str - ) -> None: ... + def _addSkip(self, result: unittest.result.TestResult, test_case: TestCase, reason: str) -> None: ... def assertEqual(self, first: Any, second: Any, msg: Any = ...) -> None: ... - def assertNotEqual(self, first: Any, second: Any, - msg: Any = ...) -> None: ... + def assertNotEqual(self, first: Any, second: Any, msg: Any = ...) -> None: ... def assertTrue(self, expr: Any, msg: Any = ...) -> None: ... def assertFalse(self, expr: Any, msg: Any = ...) -> None: ... def assertIs(self, expr1: Any, expr2: Any, msg: Any = ...) -> None: ... def assertIsNot(self, expr1: Any, expr2: Any, msg: Any = ...) -> None: ... def assertIsNone(self, obj: Any, msg: Any = ...) -> None: ... def assertIsNotNone(self, obj: Any, msg: Any = ...) -> None: ... - def assertIn(self, member: Any, - container: Union[Iterable[Any], Container[Any]], - msg: Any = ...) -> None: ... - def assertNotIn(self, member: Any, - container: Union[Iterable[Any], Container[Any]], - msg: Any = ...) -> None: ... - def assertIsInstance(self, obj: Any, - cls: Union[type, Tuple[type, ...]], - msg: Any = ...) -> None: ... - def assertNotIsInstance(self, obj: Any, - cls: Union[type, Tuple[type, ...]], - msg: Any = ...) -> None: ... + def assertIn(self, member: Any, container: Union[Iterable[Any], Container[Any]], msg: Any = ...) -> None: ... + def assertNotIn(self, member: Any, container: Union[Iterable[Any], Container[Any]], msg: Any = ...) -> None: ... + def assertIsInstance(self, obj: Any, cls: Union[type, Tuple[type, ...]], msg: Any = ...) -> None: ... + def assertNotIsInstance(self, obj: Any, cls: Union[type, Tuple[type, ...]], msg: Any = ...) -> None: ... def assertGreater(self, a: Any, b: Any, msg: Any = ...) -> None: ... def assertGreaterEqual(self, a: Any, b: Any, msg: Any = ...) -> None: ... def assertLess(self, a: Any, b: Any, msg: Any = ...) -> None: ... def assertLessEqual(self, a: Any, b: Any, msg: Any = ...) -> None: ... @overload - def assertRaises(self, # type: ignore - expected_exception: Union[Type[BaseException], Tuple[Type[BaseException], ...]], - callable: Callable[..., Any], - *args: Any, **kwargs: Any) -> None: ... - @overload - def assertRaises(self, - expected_exception: Union[Type[_E], Tuple[Type[_E], ...]], - msg: Any = ...) -> _AssertRaisesContext[_E]: ... - @overload - def assertRaisesRegex(self, # type: ignore - expected_exception: Union[Type[BaseException], Tuple[Type[BaseException], ...]], - expected_regex: Union[str, bytes, Pattern[str], Pattern[bytes]], - callable: Callable[..., Any], - *args: Any, **kwargs: Any) -> None: ... - @overload - def assertRaisesRegex(self, - expected_exception: Union[Type[_E], Tuple[Type[_E], ...]], - expected_regex: Union[str, bytes, Pattern[str], Pattern[bytes]], - msg: Any = ...) -> _AssertRaisesContext[_E]: ... - @overload - def assertWarns(self, # type: ignore - expected_warning: Union[Type[Warning], Tuple[Type[Warning], ...]], - callable: Callable[..., Any], - *args: Any, **kwargs: Any) -> None: ... - @overload - def assertWarns(self, - expected_warning: Union[Type[Warning], Tuple[Type[Warning], ...]], - msg: Any = ...) -> _AssertWarnsContext: ... - @overload - def assertWarnsRegex(self, # type: ignore - expected_warning: Union[Type[Warning], Tuple[Type[Warning], ...]], - expected_regex: Union[str, bytes, Pattern[str], Pattern[bytes]], - callable: Callable[..., Any], - *args: Any, **kwargs: Any) -> None: ... - @overload - def assertWarnsRegex(self, - expected_warning: Union[Type[Warning], Tuple[Type[Warning], ...]], - expected_regex: Union[str, bytes, Pattern[str], Pattern[bytes]], - msg: Any = ...) -> _AssertWarnsContext: ... + def assertRaises( # type: ignore + self, + expected_exception: Union[Type[BaseException], Tuple[Type[BaseException], ...]], + callable: Callable[..., Any], + *args: Any, + **kwargs: Any, + ) -> None: ... + @overload + def assertRaises( + self, expected_exception: Union[Type[_E], Tuple[Type[_E], ...]], msg: Any = ... + ) -> _AssertRaisesContext[_E]: ... + @overload + def assertRaisesRegex( # type: ignore + self, + expected_exception: Union[Type[BaseException], Tuple[Type[BaseException], ...]], + expected_regex: Union[str, bytes, Pattern[str], Pattern[bytes]], + callable: Callable[..., Any], + *args: Any, + **kwargs: Any, + ) -> None: ... + @overload + def assertRaisesRegex( + self, + expected_exception: Union[Type[_E], Tuple[Type[_E], ...]], + expected_regex: Union[str, bytes, Pattern[str], Pattern[bytes]], + msg: Any = ..., + ) -> _AssertRaisesContext[_E]: ... + @overload + def assertWarns( # type: ignore + self, + expected_warning: Union[Type[Warning], Tuple[Type[Warning], ...]], + callable: Callable[..., Any], + *args: Any, + **kwargs: Any, + ) -> None: ... + @overload + def assertWarns( + self, expected_warning: Union[Type[Warning], Tuple[Type[Warning], ...]], msg: Any = ... + ) -> _AssertWarnsContext: ... + @overload + def assertWarnsRegex( # type: ignore + self, + expected_warning: Union[Type[Warning], Tuple[Type[Warning], ...]], + expected_regex: Union[str, bytes, Pattern[str], Pattern[bytes]], + callable: Callable[..., Any], + *args: Any, + **kwargs: Any, + ) -> None: ... + @overload + def assertWarnsRegex( + self, + expected_warning: Union[Type[Warning], Tuple[Type[Warning], ...]], + expected_regex: Union[str, bytes, Pattern[str], Pattern[bytes]], + msg: Any = ..., + ) -> _AssertWarnsContext: ... def assertLogs( - self, logger: Optional[Union[str, logging.Logger]] = ..., - level: Union[int, str, None] = ... + self, logger: Optional[Union[str, logging.Logger]] = ..., level: Union[int, str, None] = ... ) -> _AssertLogsContext: ... @overload - def assertAlmostEqual(self, first: float, second: float, places: int = ..., - msg: Any = ..., delta: float = ...) -> None: ... - @overload - def assertAlmostEqual(self, first: datetime.datetime, second: datetime.datetime, - places: int = ..., msg: Any = ..., - delta: datetime.timedelta = ...) -> None: ... - @overload - def assertNotAlmostEqual(self, first: float, second: float, *, - msg: Any = ...) -> None: ... - @overload - def assertNotAlmostEqual(self, first: float, second: float, - places: int = ..., msg: Any = ...) -> None: ... - @overload - def assertNotAlmostEqual(self, first: float, second: float, *, - msg: Any = ..., delta: float = ...) -> None: ... - @overload - def assertNotAlmostEqual(self, first: datetime.datetime, second: datetime.datetime, - places: int = ..., msg: Any = ..., - delta: datetime.timedelta = ...) -> None: ... - def assertRegex(self, text: AnyStr, expected_regex: Union[AnyStr, Pattern[AnyStr]], - msg: Any = ...) -> None: ... - def assertNotRegex(self, text: AnyStr, unexpected_regex: Union[AnyStr, Pattern[AnyStr]], - msg: Any = ...) -> None: ... - def assertCountEqual(self, first: Iterable[Any], second: Iterable[Any], - msg: Any = ...) -> None: ... - def addTypeEqualityFunc(self, typeobj: Type[Any], - function: Callable[..., None]) -> None: ... - def assertMultiLineEqual(self, first: str, second: str, - msg: Any = ...) -> None: ... - def assertSequenceEqual(self, seq1: Sequence[Any], seq2: Sequence[Any], - msg: Any = ..., - seq_type: Type[Sequence[Any]] = ...) -> None: ... - def assertListEqual(self, list1: List[Any], list2: List[Any], - msg: Any = ...) -> None: ... - def assertTupleEqual(self, tuple1: Tuple[Any, ...], tuple2: Tuple[Any, ...], - msg: Any = ...) -> None: ... - def assertSetEqual(self, set1: Union[Set[Any], FrozenSet[Any]], - set2: Union[Set[Any], FrozenSet[Any]], msg: Any = ...) -> None: ... - def assertDictEqual(self, d1: Dict[Any, Any], d2: Dict[Any, Any], - msg: Any = ...) -> None: ... + def assertAlmostEqual( + self, first: float, second: float, places: Optional[int] = ..., msg: Any = ..., delta: Optional[float] = ... + ) -> None: ... + @overload + def assertAlmostEqual( + self, + first: datetime.datetime, + second: datetime.datetime, + places: Optional[int] = ..., + msg: Any = ..., + delta: Optional[datetime.timedelta] = ..., + ) -> None: ... + @overload + def assertNotAlmostEqual(self, first: float, second: float, *, msg: Any = ...) -> None: ... + @overload + def assertNotAlmostEqual(self, first: float, second: float, places: Optional[int] = ..., msg: Any = ...) -> None: ... + @overload + def assertNotAlmostEqual(self, first: float, second: float, *, msg: Any = ..., delta: Optional[float] = ...) -> None: ... + @overload + def assertNotAlmostEqual( + self, + first: datetime.datetime, + second: datetime.datetime, + places: Optional[int] = ..., + msg: Any = ..., + delta: Optional[datetime.timedelta] = ..., + ) -> None: ... + def assertRegex(self, text: AnyStr, expected_regex: Union[AnyStr, Pattern[AnyStr]], msg: Any = ...) -> None: ... + def assertNotRegex(self, text: AnyStr, unexpected_regex: Union[AnyStr, Pattern[AnyStr]], msg: Any = ...) -> None: ... + def assertCountEqual(self, first: Iterable[Any], second: Iterable[Any], msg: Any = ...) -> None: ... + def addTypeEqualityFunc(self, typeobj: Type[Any], function: Callable[..., None]) -> None: ... + def assertMultiLineEqual(self, first: str, second: str, msg: Any = ...) -> None: ... + def assertSequenceEqual( + self, seq1: Sequence[Any], seq2: Sequence[Any], msg: Any = ..., seq_type: Optional[Type[Sequence[Any]]] = ... + ) -> None: ... + def assertListEqual(self, list1: List[Any], list2: List[Any], msg: Any = ...) -> None: ... + def assertTupleEqual(self, tuple1: Tuple[Any, ...], tuple2: Tuple[Any, ...], msg: Any = ...) -> None: ... + def assertSetEqual( + self, set1: Union[Set[Any], FrozenSet[Any]], set2: Union[Set[Any], FrozenSet[Any]], msg: Any = ... + ) -> None: ... + def assertDictEqual(self, d1: Dict[Any, Any], d2: Dict[Any, Any], msg: Any = ...) -> None: ... def fail(self, msg: Any = ...) -> NoReturn: ... def countTestCases(self) -> int: ... def defaultTestResult(self) -> unittest.result.TestResult: ... def id(self) -> str: ... def shortDescription(self) -> Optional[str]: ... - def addCleanup(self, function: Callable[..., Any], *args: Any, - **kwargs: Any) -> None: ... + if sys.version_info >= (3, 8): + def addCleanup(self, __function: Callable[..., Any], *args: Any, **kwargs: Any) -> None: ... + else: + def addCleanup(self, function: Callable[..., Any], *args: Any, **kwargs: Any) -> None: ... def doCleanups(self) -> None: ... if sys.version_info >= (3, 8): @classmethod @@ -175,74 +202,84 @@ class TestCase: def _formatMessage(self, msg: Optional[str], standardMsg: str) -> str: ... # undocumented def _getAssertEqualityFunc(self, first: Any, second: Any) -> Callable[..., None]: ... # undocumented # below is deprecated - def failUnlessEqual(self, first: Any, second: Any, - msg: Any = ...) -> None: ... + def failUnlessEqual(self, first: Any, second: Any, msg: Any = ...) -> None: ... def assertEquals(self, first: Any, second: Any, msg: Any = ...) -> None: ... def failIfEqual(self, first: Any, second: Any, msg: Any = ...) -> None: ... - def assertNotEquals(self, first: Any, second: Any, - msg: Any = ...) -> None: ... + def assertNotEquals(self, first: Any, second: Any, msg: Any = ...) -> None: ... def failUnless(self, expr: bool, msg: Any = ...) -> None: ... def assert_(self, expr: bool, msg: Any = ...) -> None: ... def failIf(self, expr: bool, msg: Any = ...) -> None: ... @overload - def failUnlessRaises(self, # type: ignore - exception: Union[Type[BaseException], Tuple[Type[BaseException], ...]], - callable: Callable[..., Any] = ..., - *args: Any, **kwargs: Any) -> None: ... - @overload - def failUnlessRaises(self, - exception: Union[Type[_E], Tuple[Type[_E], ...]], - msg: Any = ...) -> _AssertRaisesContext[_E]: ... - def failUnlessAlmostEqual(self, first: float, second: float, - places: int = ..., msg: Any = ...) -> None: ... - def assertAlmostEquals(self, first: float, second: float, places: int = ..., - msg: Any = ..., delta: float = ...) -> None: ... - def failIfAlmostEqual(self, first: float, second: float, places: int = ..., - msg: Any = ...) -> None: ... - def assertNotAlmostEquals(self, first: float, second: float, - places: int = ..., msg: Any = ..., - delta: float = ...) -> None: ... - def assertRegexpMatches(self, text: AnyStr, regex: Union[AnyStr, Pattern[AnyStr]], - msg: Any = ...) -> None: ... - @overload - def assertRaisesRegexp(self, # type: ignore - exception: Union[Type[BaseException], Tuple[Type[BaseException], ...]], - expected_regex: Union[str, bytes, Pattern[str], Pattern[bytes]], - callable: Callable[..., Any], - *args: Any, **kwargs: Any) -> None: ... - @overload - def assertRaisesRegexp(self, - exception: Union[Type[_E], Tuple[Type[_E], ...]], - expected_regex: Union[str, bytes, Pattern[str], Pattern[bytes]], - msg: Any = ...) -> _AssertRaisesContext[_E]: ... - def assertDictContainsSubset(self, - expected: Mapping[Any, Any], - actual: Mapping[Any, Any], - msg: object = ...) -> None: ... + def failUnlessRaises( # type: ignore + self, + exception: Union[Type[BaseException], Tuple[Type[BaseException], ...]], + callable: Callable[..., Any] = ..., + *args: Any, + **kwargs: Any, + ) -> None: ... + @overload + def failUnlessRaises(self, exception: Union[Type[_E], Tuple[Type[_E], ...]], msg: Any = ...) -> _AssertRaisesContext[_E]: ... + def failUnlessAlmostEqual(self, first: float, second: float, places: int = ..., msg: Any = ...) -> None: ... + def assertAlmostEquals(self, first: float, second: float, places: int = ..., msg: Any = ..., delta: float = ...) -> None: ... + def failIfAlmostEqual(self, first: float, second: float, places: int = ..., msg: Any = ...) -> None: ... + def assertNotAlmostEquals( + self, first: float, second: float, places: int = ..., msg: Any = ..., delta: float = ... + ) -> None: ... + def assertRegexpMatches(self, text: AnyStr, regex: Union[AnyStr, Pattern[AnyStr]], msg: Any = ...) -> None: ... + def assertNotRegexpMatches(self, text: AnyStr, regex: Union[AnyStr, Pattern[AnyStr]], msg: Any = ...) -> None: ... + @overload + def assertRaisesRegexp( # type: ignore + self, + exception: Union[Type[BaseException], Tuple[Type[BaseException], ...]], + expected_regex: Union[str, bytes, Pattern[str], Pattern[bytes]], + callable: Callable[..., Any], + *args: Any, + **kwargs: Any, + ) -> None: ... + @overload + def assertRaisesRegexp( + self, + exception: Union[Type[_E], Tuple[Type[_E], ...]], + expected_regex: Union[str, bytes, Pattern[str], Pattern[bytes]], + msg: Any = ..., + ) -> _AssertRaisesContext[_E]: ... + def assertDictContainsSubset(self, subset: Mapping[Any, Any], dictionary: Mapping[Any, Any], msg: object = ...) -> None: ... class FunctionTestCase(TestCase): - def __init__(self, testFunc: Callable[[], None], - setUp: Optional[Callable[[], None]] = ..., - tearDown: Optional[Callable[[], None]] = ..., - description: Optional[str] = ...) -> None: ... + def __init__( + self, + testFunc: Callable[[], None], + setUp: Optional[Callable[[], None]] = ..., + tearDown: Optional[Callable[[], None]] = ..., + description: Optional[str] = ..., + ) -> None: ... + def runTest(self) -> None: ... class _AssertRaisesContext(Generic[_E]): exception: _E def __enter__(self) -> _AssertRaisesContext[_E]: ... - def __exit__(self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], - exc_tb: Optional[TracebackType]) -> bool: ... + def __exit__( + self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType] + ) -> bool: ... + if sys.version_info >= (3, 9): + def __class_getitem__(cls, item: Any) -> GenericAlias: ... class _AssertWarnsContext: - warning: Warning + warning: WarningMessage filename: str lineno: int + warnings: List[WarningMessage] def __enter__(self) -> _AssertWarnsContext: ... - def __exit__(self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], - exc_tb: Optional[TracebackType]) -> None: ... + def __exit__( + self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType] + ) -> None: ... class _AssertLogsContext: + LOGGING_FORMAT: str records: List[logging.LogRecord] output: List[str] + def __init__(self, test_case: TestCase, logger_name: str, level: int) -> None: ... def __enter__(self) -> _AssertLogsContext: ... - def __exit__(self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], - exc_tb: Optional[TracebackType]) -> Optional[bool]: ... + def __exit__( + self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType] + ) -> Optional[bool]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/unittest/loader.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/unittest/loader.pyi old mode 100755 new mode 100644 index 2371778f..48c9f1c5 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/unittest/loader.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/unittest/loader.pyi @@ -1,25 +1,50 @@ +import sys import unittest.case -import unittest.suite import unittest.result +import unittest.suite from types import ModuleType from typing import Any, Callable, List, Optional, Sequence, Type +_SortComparisonMethod = Callable[[str, str], int] +_SuiteClass = Callable[[List[unittest.case.TestCase]], unittest.suite.TestSuite] class TestLoader: errors: List[Type[BaseException]] testMethodPrefix: str - sortTestMethodsUsing: Callable[[str, str], bool] - suiteClass: Callable[[List[unittest.case.TestCase]], unittest.suite.TestSuite] - def loadTestsFromTestCase(self, - testCaseClass: Type[unittest.case.TestCase]) -> unittest.suite.TestSuite: ... - def loadTestsFromModule(self, module: ModuleType, *, pattern: Any = ...) -> unittest.suite.TestSuite: ... - def loadTestsFromName(self, name: str, - module: Optional[ModuleType] = ...) -> unittest.suite.TestSuite: ... - def loadTestsFromNames(self, names: Sequence[str], - module: Optional[ModuleType] = ...) -> unittest.suite.TestSuite: ... - def getTestCaseNames(self, - testCaseClass: Type[unittest.case.TestCase]) -> Sequence[str]: ... - def discover(self, start_dir: str, pattern: str = ..., - top_level_dir: Optional[str] = ...) -> unittest.suite.TestSuite: ... + sortTestMethodsUsing: _SortComparisonMethod + + if sys.version_info >= (3, 7): + testNamePatterns: Optional[List[str]] + + suiteClass: _SuiteClass + def loadTestsFromTestCase(self, testCaseClass: Type[unittest.case.TestCase]) -> unittest.suite.TestSuite: ... + def loadTestsFromModule(self, module: ModuleType, *args: Any, pattern: Any = ...) -> unittest.suite.TestSuite: ... + def loadTestsFromName(self, name: str, module: Optional[ModuleType] = ...) -> unittest.suite.TestSuite: ... + def loadTestsFromNames(self, names: Sequence[str], module: Optional[ModuleType] = ...) -> unittest.suite.TestSuite: ... + def getTestCaseNames(self, testCaseClass: Type[unittest.case.TestCase]) -> Sequence[str]: ... + def discover(self, start_dir: str, pattern: str = ..., top_level_dir: Optional[str] = ...) -> unittest.suite.TestSuite: ... defaultTestLoader: TestLoader + +if sys.version_info >= (3, 7): + def getTestCaseNames( + testCaseClass: Type[unittest.case.TestCase], + prefix: str, + sortUsing: _SortComparisonMethod = ..., + testNamePatterns: Optional[List[str]] = ..., + ) -> Sequence[str]: ... + +else: + def getTestCaseNames( + testCaseClass: Type[unittest.case.TestCase], prefix: str, sortUsing: _SortComparisonMethod = ... + ) -> Sequence[str]: ... + +def makeSuite( + testCaseClass: Type[unittest.case.TestCase], + prefix: str = ..., + sortUsing: _SortComparisonMethod = ..., + suiteClass: _SuiteClass = ..., +) -> unittest.suite.TestSuite: ... +def findTestCases( + module: ModuleType, prefix: str = ..., sortUsing: _SortComparisonMethod = ..., suiteClass: _SuiteClass = ... +) -> unittest.suite.TestSuite: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/unittest/main.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/unittest/main.pyi new file mode 100644 index 00000000..5e6151ed --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/unittest/main.pyi @@ -0,0 +1,49 @@ +import sys +import unittest.case +import unittest.loader +import unittest.result +import unittest.suite +from types import ModuleType +from typing import Any, Iterable, List, Optional, Protocol, Type, Union + +class _TestRunner(Protocol): + def run(self, test: Union[unittest.suite.TestSuite, unittest.case.TestCase]) -> unittest.result.TestResult: ... + +# not really documented +class TestProgram: + result: unittest.result.TestResult + module: Union[None, str, ModuleType] + verbosity: int + failfast: Optional[bool] + catchbreak: Optional[bool] + buffer: Optional[bool] + progName: Optional[str] + warnings: Optional[str] + + if sys.version_info >= (3, 7): + testNamePatterns: Optional[List[str]] + def __init__( + self, + module: Union[None, str, ModuleType] = ..., + defaultTest: Union[str, Iterable[str], None] = ..., + argv: Optional[List[str]] = ..., + testRunner: Union[Type[_TestRunner], _TestRunner, None] = ..., + testLoader: unittest.loader.TestLoader = ..., + exit: bool = ..., + verbosity: int = ..., + failfast: Optional[bool] = ..., + catchbreak: Optional[bool] = ..., + buffer: Optional[bool] = ..., + warnings: Optional[str] = ..., + *, + tb_locals: bool = ..., + ) -> None: ... + def usageExit(self, msg: Any = ...) -> None: ... + def parseArgs(self, argv: List[str]) -> None: ... + if sys.version_info >= (3, 7): + def createTests(self, from_discovery: bool = ..., Loader: Optional[unittest.loader.TestLoader] = ...) -> None: ... + else: + def createTests(self) -> None: ... + def runTests(self) -> None: ... # undocumented + +main = TestProgram diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/unittest/mock.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/unittest/mock.pyi old mode 100755 new mode 100644 index 396d806b..bf7e3ef7 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/unittest/mock.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/unittest/mock.pyi @@ -1,9 +1,29 @@ -# Stubs for mock - import sys -from typing import Any, List, Optional, Text, Tuple, Type, TypeVar +from typing import Any, Callable, Generic, List, Mapping, Optional, Sequence, Tuple, Type, TypeVar, Union, overload +_F = TypeVar("_F", bound=Callable[..., Any]) _T = TypeVar("_T") +_TT = TypeVar("_TT", bound=Type[Any]) +_R = TypeVar("_R") + +__all__ = [ + "Mock", + "MagicMock", + "patch", + "sentinel", + "DEFAULT", + "ANY", + "call", + "create_autospec", + "AsyncMock", + "FILTER_DIR", + "NonCallableMock", + "NonCallableMagicMock", + "mock_open", + "PropertyMock", + "seal", +] +__version__: str FILTER_DIR: Any @@ -20,7 +40,27 @@ class _Sentinel: sentinel: Any DEFAULT: Any -class _CallList(List[_T]): +class _Call(Tuple[Any, ...]): + def __new__( + cls, value: Any = ..., name: Optional[Any] = ..., parent: Optional[Any] = ..., two: bool = ..., from_kall: bool = ... + ) -> Any: ... + name: Any + parent: Any + from_kall: Any + def __init__( + self, value: Any = ..., name: Optional[Any] = ..., parent: Optional[Any] = ..., two: bool = ..., from_kall: bool = ... + ) -> None: ... + def __eq__(self, other: Any) -> bool: ... + __ne__: Any + def __call__(self, *args: Any, **kwargs: Any) -> _Call: ... + def __getattr__(self, attr: Any) -> Any: ... + def count(self, *args: Any, **kwargs: Any) -> Any: ... + def index(self, *args: Any, **kwargs: Any) -> Any: ... + def call_list(self) -> Any: ... + +call: _Call + +class _CallList(List[_Call]): def __contains__(self, value: Any) -> bool: ... class _MockIter: @@ -32,44 +72,167 @@ class _MockIter: class Base: def __init__(self, *args: Any, **kwargs: Any) -> None: ... -# TODO: Defining this and other mock classes as classes in this stub causes -# many false positives with mypy and production code. See if we can -# improve mypy somehow and use a class with an "Any" base class. -NonCallableMock = Any +class NonCallableMock(Base, Any): # type: ignore + def __new__(__cls, *args: Any, **kw: Any) -> NonCallableMock: ... + def __init__( + self, + spec: Union[List[str], object, Type[object], None] = ..., + wraps: Optional[Any] = ..., + name: Optional[str] = ..., + spec_set: Union[List[str], object, Type[object], None] = ..., + parent: Optional[NonCallableMock] = ..., + _spec_state: Optional[Any] = ..., + _new_name: str = ..., + _new_parent: Optional[NonCallableMock] = ..., + _spec_as_instance: bool = ..., + _eat_self: Optional[bool] = ..., + unsafe: bool = ..., + **kwargs: Any, + ) -> None: ... + def __getattr__(self, name: str) -> Any: ... + if sys.version_info >= (3, 8): + def _calls_repr(self, prefix: str = ...) -> str: ... + def assert_called_with(self, *args: Any, **kwargs: Any) -> None: ... + def assert_not_called(self) -> None: ... + def assert_called_once_with(self, *args: Any, **kwargs: Any) -> None: ... + def _format_mock_failure_message(self, args: Any, kwargs: Any, action: str = ...) -> str: ... + elif sys.version_info >= (3, 5): + def assert_called_with(_mock_self, *args: Any, **kwargs: Any) -> None: ... + def assert_not_called(_mock_self) -> None: ... + def assert_called_once_with(_mock_self, *args: Any, **kwargs: Any) -> None: ... + def _format_mock_failure_message(self, args: Any, kwargs: Any) -> str: ... + if sys.version_info >= (3, 8): + def assert_called(self) -> None: ... + def assert_called_once(self) -> None: ... + elif sys.version_info >= (3, 6): + def assert_called(_mock_self) -> None: ... + def assert_called_once(_mock_self) -> None: ... + if sys.version_info >= (3, 6): + def reset_mock(self, visited: Any = ..., *, return_value: bool = ..., side_effect: bool = ...) -> None: ... + elif sys.version_info >= (3, 5): + def reset_mock(self, visited: Any = ...) -> None: ... + if sys.version_info >= (3, 7): + def _extract_mock_name(self) -> str: ... + def _get_call_signature_from_name(self, name: str) -> Any: ... + def assert_any_call(self, *args: Any, **kwargs: Any) -> None: ... + def assert_has_calls(self, calls: Sequence[_Call], any_order: bool = ...) -> None: ... + def mock_add_spec(self, spec: Any, spec_set: bool = ...) -> None: ... + def _mock_add_spec(self, spec: Any, spec_set: bool, _spec_as_instance: bool = ..., _eat_self: bool = ...) -> None: ... + def attach_mock(self, mock: NonCallableMock, attribute: str) -> None: ... + def configure_mock(self, **kwargs: Any) -> None: ... + return_value: Any + side_effect: Any + called: bool + call_count: int + call_args: Any + call_args_list: _CallList + mock_calls: _CallList + def _format_mock_call_signature(self, args: Any, kwargs: Any) -> str: ... + def _call_matcher(self, _call: Tuple[_Call, ...]) -> _Call: ... + def _get_child_mock(self, **kw: Any) -> NonCallableMock: ... class CallableMixin(Base): side_effect: Any - def __init__(self, spec: Optional[Any] = ..., side_effect: Optional[Any] = ..., return_value: Any = ..., wraps: Optional[Any] = ..., name: Optional[Any] = ..., spec_set: Optional[Any] = ..., parent: Optional[Any] = ..., _spec_state: Optional[Any] = ..., _new_name: Any = ..., _new_parent: Optional[Any] = ..., **kwargs: Any) -> None: ... + def __init__( + self, + spec: Optional[Any] = ..., + side_effect: Optional[Any] = ..., + return_value: Any = ..., + wraps: Optional[Any] = ..., + name: Optional[Any] = ..., + spec_set: Optional[Any] = ..., + parent: Optional[Any] = ..., + _spec_state: Optional[Any] = ..., + _new_name: Any = ..., + _new_parent: Optional[Any] = ..., + **kwargs: Any, + ) -> None: ... def __call__(_mock_self, *args: Any, **kwargs: Any) -> Any: ... -Mock = Any +class Mock(CallableMixin, NonCallableMock): ... -class _patch: +class _patch(Generic[_T]): attribute_name: Any - getter: Any - attribute: Any - new: Any + getter: Callable[[], Any] + attribute: str + new: _T new_callable: Any spec: Any create: bool has_local: Any spec_set: Any autospec: Any - kwargs: Any + kwargs: Mapping[str, Any] additional_patchers: Any - def __init__(self, getter: Any, attribute: Any, new: Any, spec: Any, create: Any, spec_set: Any, autospec: Any, new_callable: Any, kwargs: Any) -> None: ... - def copy(self) -> Any: ... - def __call__(self, func: Any) -> Any: ... - def decorate_class(self, klass: Any) -> Any: ... - def decorate_callable(self, func: Any) -> Any: ... - def get_original(self) -> Any: ... + if sys.version_info >= (3, 8): + @overload + def __init__( + self: _patch[Union[MagicMock, AsyncMock]], + getter: Callable[[], Any], + attribute: str, + *, + spec: Optional[Any], + create: bool, + spec_set: Optional[Any], + autospec: Optional[Any], + new_callable: Optional[Any], + kwargs: Mapping[str, Any], + ) -> None: ... + # This overload also covers the case, where new==DEFAULT. In this case, self is _patch[Any]. + # Ideally we'd be able to add an overload for it so that self is _patch[MagicMock], + # but that's impossible with the current type system. + @overload + def __init__( + self: _patch[_T], + getter: Callable[[], Any], + attribute: str, + new: _T, + spec: Optional[Any], + create: bool, + spec_set: Optional[Any], + autospec: Optional[Any], + new_callable: Optional[Any], + kwargs: Mapping[str, Any], + ) -> None: ... + else: + @overload + def __init__( + self: _patch[MagicMock], + getter: Callable[[], Any], + attribute: str, + *, + spec: Optional[Any], + create: bool, + spec_set: Optional[Any], + autospec: Optional[Any], + new_callable: Optional[Any], + kwargs: Mapping[str, Any], + ) -> None: ... + @overload + def __init__( + self: _patch[_T], + getter: Callable[[], Any], + attribute: str, + new: _T, + spec: Optional[Any], + create: bool, + spec_set: Optional[Any], + autospec: Optional[Any], + new_callable: Optional[Any], + kwargs: Mapping[str, Any], + ) -> None: ... + def copy(self) -> _patch[_T]: ... + def __call__(self, func: Callable[..., _R]) -> Callable[..., _R]: ... + def decorate_class(self, klass: _TT) -> _TT: ... + def decorate_callable(self, func: _F) -> _F: ... + def get_original(self) -> Tuple[Any, bool]: ... target: Any temp_original: Any - is_local: Any - def __enter__(self) -> Any: ... - def __exit__(self, *exc_info: Any) -> Any: ... - def start(self) -> Any: ... - def stop(self) -> Any: ... + is_local: bool + def __enter__(self) -> _T: ... + def __exit__(self, *exc_info: Any) -> None: ... + def start(self) -> _T: ... + def stop(self) -> None: ... class _patch_dict: in_dict: Any @@ -86,9 +249,123 @@ class _patch_dict: class _patcher: TEST_PREFIX: str dict: Type[_patch_dict] - def __call__(self, target: Any, new: Optional[Any] = ..., spec: Optional[Any] = ..., create: bool = ..., spec_set: Optional[Any] = ..., autospec: Optional[Any] = ..., new_callable: Optional[Any] = ..., **kwargs: Any) -> _patch: ... - def object(self, target: Any, attribute: Text, new: Optional[Any] = ..., spec: Optional[Any] = ..., create: bool = ..., spec_set: Optional[Any] = ..., autospec: Optional[Any] = ..., new_callable: Optional[Any] = ..., **kwargs: Any) -> _patch: ... - def multiple(self, target: Any, spec: Optional[Any] = ..., create: bool = ..., spec_set: Optional[Any] = ..., autospec: Optional[Any] = ..., new_callable: Optional[Any] = ..., **kwargs: Any) -> _patch: ... + if sys.version_info >= (3, 8): + @overload + def __call__( # type: ignore + self, + target: Any, + *, + spec: Optional[Any] = ..., + create: bool = ..., + spec_set: Optional[Any] = ..., + autospec: Optional[Any] = ..., + new_callable: Optional[Any] = ..., + **kwargs: Any, + ) -> _patch[Union[MagicMock, AsyncMock]]: ... + # This overload also covers the case, where new==DEFAULT. In this case, the return type is _patch[Any]. + # Ideally we'd be able to add an overload for it so that the return type is _patch[MagicMock], + # but that's impossible with the current type system. + @overload + def __call__( + self, + target: Any, + new: _T, + spec: Optional[Any] = ..., + create: bool = ..., + spec_set: Optional[Any] = ..., + autospec: Optional[Any] = ..., + new_callable: Optional[Any] = ..., + **kwargs: Any, + ) -> _patch[_T]: ... + else: + @overload + def __call__( # type: ignore + self, + target: Any, + *, + spec: Optional[Any] = ..., + create: bool = ..., + spec_set: Optional[Any] = ..., + autospec: Optional[Any] = ..., + new_callable: Optional[Any] = ..., + **kwargs: Any, + ) -> _patch[MagicMock]: ... + @overload + def __call__( + self, + target: Any, + new: _T, + spec: Optional[Any] = ..., + create: bool = ..., + spec_set: Optional[Any] = ..., + autospec: Optional[Any] = ..., + new_callable: Optional[Any] = ..., + **kwargs: Any, + ) -> _patch[_T]: ... + if sys.version_info >= (3, 8): + @overload + def object( # type: ignore + self, + target: Any, + attribute: str, + *, + spec: Optional[Any] = ..., + create: bool = ..., + spec_set: Optional[Any] = ..., + autospec: Optional[Any] = ..., + new_callable: Optional[Any] = ..., + **kwargs: Any, + ) -> _patch[Union[MagicMock, AsyncMock]]: ... + @overload + def object( + self, + target: Any, + attribute: str, + new: _T = ..., + spec: Optional[Any] = ..., + create: bool = ..., + spec_set: Optional[Any] = ..., + autospec: Optional[Any] = ..., + new_callable: Optional[Any] = ..., + **kwargs: Any, + ) -> _patch[_T]: ... + else: + @overload + def object( # type: ignore + self, + target: Any, + attribute: str, + *, + spec: Optional[Any] = ..., + create: bool = ..., + spec_set: Optional[Any] = ..., + autospec: Optional[Any] = ..., + new_callable: Optional[Any] = ..., + **kwargs: Any, + ) -> _patch[MagicMock]: ... + @overload + def object( + self, + target: Any, + attribute: str, + new: _T = ..., + spec: Optional[Any] = ..., + create: bool = ..., + spec_set: Optional[Any] = ..., + autospec: Optional[Any] = ..., + new_callable: Optional[Any] = ..., + **kwargs: Any, + ) -> _patch[_T]: ... + def multiple( + self, + target: Any, + spec: Optional[Any] = ..., + create: bool = ..., + spec_set: Optional[Any] = ..., + autospec: Optional[Any] = ..., + new_callable: Optional[Any] = ..., + **kwargs: _T, + ) -> _patch[_T]: ... def stopall(self) -> None: ... patch: _patcher @@ -96,10 +373,30 @@ patch: _patcher class MagicMixin: def __init__(self, *args: Any, **kw: Any) -> None: ... -NonCallableMagicMock = Any -MagicMock = Any +class NonCallableMagicMock(MagicMixin, NonCallableMock): + def mock_add_spec(self, spec: Any, spec_set: bool = ...) -> None: ... + +class MagicMock(MagicMixin, Mock): + def mock_add_spec(self, spec: Any, spec_set: bool = ...) -> None: ... + if sys.version_info >= (3, 8): - AsyncMock = Any + class AsyncMockMixin(Base): + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + async def _execute_mock_call(self, *args: Any, **kwargs: Any) -> Any: ... + def assert_awaited(self) -> None: ... + def assert_awaited_once(self) -> None: ... + def assert_awaited_with(self, *args: Any, **kwargs: Any) -> None: ... + def assert_awaited_once_with(self, *args: Any, **kwargs: Any) -> None: ... + def assert_any_await(self, *args: Any, **kwargs: Any) -> None: ... + def assert_has_awaits(self, calls: _CallList, any_order: bool = ...) -> None: ... + def assert_not_awaited(self) -> None: ... + def reset_mock(self, *args, **kwargs) -> None: ... + await_count: int + await_args: Optional[_Call] + await_args_list: _CallList + class AsyncMagicMixin(MagicMixin): + def __init__(self, *args: Any, **kw: Any) -> None: ... + class AsyncMock(AsyncMockMixin, AsyncMagicMixin, Mock): ... class MagicProxy: name: Any @@ -115,23 +412,9 @@ class _ANY: ANY: Any -class _Call(Tuple[Any, ...]): - def __new__(cls, value: Any = ..., name: Optional[Any] = ..., parent: Optional[Any] = ..., two: bool = ..., from_kall: bool = ...) -> Any: ... - name: Any - parent: Any - from_kall: Any - def __init__(self, value: Any = ..., name: Optional[Any] = ..., parent: Optional[Any] = ..., two: bool = ..., from_kall: bool = ...) -> None: ... - def __eq__(self, other: Any) -> bool: ... - __ne__: Any - def __call__(self, *args: Any, **kwargs: Any) -> Any: ... - def __getattr__(self, attr: Any) -> Any: ... - def count(self, *args: Any, **kwargs: Any) -> Any: ... - def index(self, *args: Any, **kwargs: Any) -> Any: ... - def call_list(self) -> Any: ... - -call: Any - -def create_autospec(spec: Any, spec_set: Any = ..., instance: Any = ..., _parent: Optional[Any] = ..., _name: Optional[Any] = ..., **kwargs: Any) -> Any: ... +def create_autospec( + spec: Any, spec_set: Any = ..., instance: Any = ..., _parent: Optional[Any] = ..., _name: Optional[Any] = ..., **kwargs: Any +) -> Any: ... class _SpecState: spec: Any @@ -140,7 +423,15 @@ class _SpecState: parent: Any instance: Any name: Any - def __init__(self, spec: Any, spec_set: Any = ..., parent: Optional[Any] = ..., name: Optional[Any] = ..., ids: Optional[Any] = ..., instance: Any = ...) -> None: ... + def __init__( + self, + spec: Any, + spec_set: Any = ..., + parent: Optional[Any] = ..., + name: Optional[Any] = ..., + ids: Optional[Any] = ..., + instance: Any = ..., + ) -> None: ... def mock_open(mock: Optional[Any] = ..., read_data: Any = ...) -> Any: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/unittest/result.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/unittest/result.pyi old mode 100755 new mode 100644 index 6ce685a2..8c7ff78d --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/unittest/result.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/unittest/result.pyi @@ -1,12 +1,13 @@ -from typing import List, Optional, Tuple, Type -from types import TracebackType import unittest.case +from types import TracebackType +from typing import Any, Callable, List, Optional, TextIO, Tuple, Type, TypeVar, Union +_SysExcInfoType = Union[Tuple[Type[BaseException], BaseException, TracebackType], Tuple[None, None, None]] -_SysExcInfoType = Tuple[Optional[Type[BaseException]], - Optional[BaseException], - Optional[TracebackType]] +_F = TypeVar("_F", bound=Callable[..., Any]) +# undocumented +def failfast(method: _F) -> _F: ... class TestResult: errors: List[Tuple[unittest.case.TestCase, str]] @@ -19,6 +20,10 @@ class TestResult: buffer: bool failfast: bool tb_locals: bool + def __init__( + self, stream: Optional[TextIO] = ..., descriptions: Optional[bool] = ..., verbosity: Optional[int] = ... + ) -> None: ... + def printErrors(self) -> None: ... def wasSuccessful(self) -> bool: ... def stop(self) -> None: ... def startTest(self, test: unittest.case.TestCase) -> None: ... @@ -29,8 +34,8 @@ class TestResult: def addFailure(self, test: unittest.case.TestCase, err: _SysExcInfoType) -> None: ... def addSuccess(self, test: unittest.case.TestCase) -> None: ... def addSkip(self, test: unittest.case.TestCase, reason: str) -> None: ... - def addExpectedFailure(self, test: unittest.case.TestCase, - err: _SysExcInfoType) -> None: ... + def addExpectedFailure(self, test: unittest.case.TestCase, err: _SysExcInfoType) -> None: ... def addUnexpectedSuccess(self, test: unittest.case.TestCase) -> None: ... - def addSubTest(self, test: unittest.case.TestCase, subtest: unittest.case.TestCase, - outcome: Optional[_SysExcInfoType]) -> None: ... + def addSubTest( + self, test: unittest.case.TestCase, subtest: unittest.case.TestCase, err: Optional[_SysExcInfoType] + ) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/unittest/runner.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/unittest/runner.pyi old mode 100755 new mode 100644 index 95199b2c..adb5fc50 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/unittest/runner.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/unittest/runner.pyi @@ -1,27 +1,24 @@ -from typing import Callable, Optional, TextIO, Tuple, Type, Union import unittest.case import unittest.result import unittest.suite - +from typing import Callable, Optional, TextIO, Tuple, Type, Union _ResultClassType = Callable[[TextIO, bool, int], unittest.result.TestResult] - class TextTestResult(unittest.result.TestResult): + descriptions: bool # undocumented + dots: bool # undocumented separator1: str separator2: str - def __init__(self, stream: TextIO, descriptions: bool, - verbosity: int) -> None: ... + showall: bool # undocumented + stream: TextIO # undocumented + def __init__(self, stream: TextIO, descriptions: bool, verbosity: int) -> None: ... def getDescription(self, test: unittest.case.TestCase) -> str: ... def printErrors(self) -> None: ... def printErrorList(self, flavour: str, errors: Tuple[unittest.case.TestCase, str]) -> None: ... - -class TestRunner: - def run(self, test: Union[unittest.suite.TestSuite, unittest.case.TestCase]) -> unittest.result.TestResult: ... - - -class TextTestRunner(TestRunner): +class TextTestRunner(object): + resultclass: _ResultClassType def __init__( self, stream: Optional[TextIO] = ..., @@ -35,3 +32,4 @@ class TextTestRunner(TestRunner): tb_locals: bool = ..., ) -> None: ... def _makeResult(self) -> unittest.result.TestResult: ... + def run(self, test: Union[unittest.suite.TestSuite, unittest.case.TestCase]) -> unittest.result.TestResult: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/unittest/signals.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/unittest/signals.pyi old mode 100755 new mode 100644 index a4616b77..5a0a1d62 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/unittest/signals.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/unittest/signals.pyi @@ -1,14 +1,12 @@ -from typing import Any, Callable, overload, TypeVar import unittest.result +from typing import Any, Callable, TypeVar, overload - -_F = TypeVar('_F', bound=Callable[..., Any]) - +_F = TypeVar("_F", bound=Callable[..., Any]) def installHandler() -> None: ... def registerResult(result: unittest.result.TestResult) -> None: ... def removeResult(result: unittest.result.TestResult) -> bool: ... @overload -def removeHandler() -> None: ... +def removeHandler(method: None = ...) -> None: ... @overload -def removeHandler(function: _F) -> _F: ... +def removeHandler(method: _F) -> _F: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/unittest/suite.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/unittest/suite.pyi old mode 100755 new mode 100644 index 54e9e69e..62869d23 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/unittest/suite.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/unittest/suite.pyi @@ -1,11 +1,9 @@ -from typing import Iterable, Iterator, List, Union import unittest.case import unittest.result - +from typing import Iterable, Iterator, List, Union _TestType = Union[unittest.case.TestCase, TestSuite] - class BaseTestSuite(Iterable[_TestType]): _tests: List[unittest.case.TestCase] _removed_tests: int @@ -18,5 +16,5 @@ class BaseTestSuite(Iterable[_TestType]): def countTestCases(self) -> int: ... def __iter__(self) -> Iterator[_TestType]: ... - -class TestSuite(BaseTestSuite): ... +class TestSuite(BaseTestSuite): + def run(self, result: unittest.result.TestResult, debug: bool = ...) -> unittest.result.TestResult: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/unittest/util.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/unittest/util.pyi old mode 100755 new mode 100644 index 9b56f8bb..8b0e8ad2 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/unittest/util.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/unittest/util.pyi @@ -1,7 +1,6 @@ -# undocumented from typing import Any, List, Sequence, Tuple, TypeVar -_T = TypeVar('_T') +_T = TypeVar("_T") _Mismatch = Tuple[_T, _T, int] _MAX_LENGTH: int diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/urllib/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/urllib/__init__.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/urllib/error.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/urllib/error.pyi old mode 100755 new mode 100644 index 16ceae8f..926f32d0 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/urllib/error.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/urllib/error.pyi @@ -1,11 +1,13 @@ -from typing import Dict, Union +from typing import IO, Mapping, Optional, Union from urllib.response import addinfourl # Stubs for urllib.error class URLError(IOError): reason: Union[str, BaseException] + class HTTPError(URLError, addinfourl): code: int - def __init__(self, url, code, msg, hdrs, fp) -> None: ... + def __init__(self, url: str, code: int, msg: str, hdrs: Mapping[str, str], fp: Optional[IO[bytes]]) -> None: ... + class ContentTooShortError(URLError): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/urllib/parse.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/urllib/parse.pyi old mode 100755 new mode 100644 index 0564a825..d9ecfa4b --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/urllib/parse.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/urllib/parse.pyi @@ -1,8 +1,10 @@ -# Stubs for urllib.parse -from typing import Any, List, Dict, Tuple, AnyStr, Generic, overload, Sequence, Mapping, Union, NamedTuple, Callable, Optional +import sys +from typing import Any, AnyStr, Callable, Dict, Generic, List, Mapping, NamedTuple, Optional, Sequence, Tuple, Union, overload -_Str = Union[bytes, str] +if sys.version_info >= (3, 9): + from types import GenericAlias +_Str = Union[bytes, str] uses_relative: List[str] uses_netloc: List[str] @@ -19,32 +21,31 @@ class _ResultMixinBase(Generic[AnyStr]): class _ResultMixinStr(_ResultMixinBase[str]): def encode(self, encoding: str = ..., errors: str = ...) -> _ResultMixinBytes: ... - class _ResultMixinBytes(_ResultMixinBase[str]): def decode(self, encoding: str = ..., errors: str = ...) -> _ResultMixinStr: ... - class _NetlocResultMixinBase(Generic[AnyStr]): username: Optional[AnyStr] password: Optional[AnyStr] hostname: Optional[AnyStr] port: Optional[int] + if sys.version_info >= (3, 9): + def __class_getitem__(cls, item: Any) -> GenericAlias: ... class _NetlocResultMixinStr(_NetlocResultMixinBase[str], _ResultMixinStr): ... - class _NetlocResultMixinBytes(_NetlocResultMixinBase[bytes], _ResultMixinBytes): ... class _DefragResultBase(Tuple[Any, ...], Generic[AnyStr]): url: AnyStr fragment: AnyStr - class _SplitResultBase(NamedTuple): scheme: str netloc: str path: str query: str fragment: str + class _SplitResultBytesBase(NamedTuple): scheme: bytes netloc: bytes @@ -59,6 +60,7 @@ class _ParseResultBase(NamedTuple): params: str query: str fragment: str + class _ParseResultBytesBase(NamedTuple): scheme: bytes netloc: bytes @@ -69,47 +71,56 @@ class _ParseResultBytesBase(NamedTuple): # Structured result objects for string data class DefragResult(_DefragResultBase[str], _ResultMixinStr): ... - class SplitResult(_SplitResultBase, _NetlocResultMixinStr): ... - class ParseResult(_ParseResultBase, _NetlocResultMixinStr): ... # Structured result objects for bytes data class DefragResultBytes(_DefragResultBase[bytes], _ResultMixinBytes): ... - class SplitResultBytes(_SplitResultBytesBase, _NetlocResultMixinBytes): ... - class ParseResultBytes(_ParseResultBytesBase, _NetlocResultMixinBytes): ... - -def parse_qs(qs: Optional[AnyStr], keep_blank_values: bool = ..., strict_parsing: bool = ..., encoding: str = ..., errors: str = ...) -> Dict[AnyStr, List[AnyStr]]: ... - -def parse_qsl(qs: Optional[AnyStr], keep_blank_values: bool = ..., strict_parsing: bool = ..., encoding: str = ..., errors: str = ...) -> List[Tuple[AnyStr, AnyStr]]: ... - +if sys.version_info >= (3, 8): + def parse_qs( + qs: Optional[AnyStr], + keep_blank_values: bool = ..., + strict_parsing: bool = ..., + encoding: str = ..., + errors: str = ..., + max_num_fields: Optional[int] = ..., + ) -> Dict[AnyStr, List[AnyStr]]: ... + def parse_qsl( + qs: Optional[AnyStr], + keep_blank_values: bool = ..., + strict_parsing: bool = ..., + encoding: str = ..., + errors: str = ..., + max_num_fields: Optional[int] = ..., + ) -> List[Tuple[AnyStr, AnyStr]]: ... + +else: + def parse_qs( + qs: Optional[AnyStr], keep_blank_values: bool = ..., strict_parsing: bool = ..., encoding: str = ..., errors: str = ... + ) -> Dict[AnyStr, List[AnyStr]]: ... + def parse_qsl( + qs: Optional[AnyStr], keep_blank_values: bool = ..., strict_parsing: bool = ..., encoding: str = ..., errors: str = ... + ) -> List[Tuple[AnyStr, AnyStr]]: ... @overload -def quote(string: str, safe: _Str = ..., encoding: str = ..., errors: str = ...) -> str: ... +def quote(string: str, safe: _Str = ..., encoding: Optional[str] = ..., errors: Optional[str] = ...) -> str: ... @overload def quote(string: bytes, safe: _Str = ...) -> str: ... - def quote_from_bytes(bs: bytes, safe: _Str = ...) -> str: ... - @overload -def quote_plus(string: str, safe: _Str = ..., encoding: str = ..., errors: str = ...) -> str: ... +def quote_plus(string: str, safe: _Str = ..., encoding: Optional[str] = ..., errors: Optional[str] = ...) -> str: ... @overload def quote_plus(string: bytes, safe: _Str = ...) -> str: ... - def unquote(string: str, encoding: str = ..., errors: str = ...) -> str: ... - def unquote_to_bytes(string: _Str) -> bytes: ... - def unquote_plus(string: str, encoding: str = ..., errors: str = ...) -> str: ... - @overload def urldefrag(url: str) -> DefragResult: ... @overload def urldefrag(url: Optional[bytes]) -> DefragResultBytes: ... - def urlencode( query: Union[Mapping[Any, Any], Mapping[Any, Sequence[Any]], Sequence[Tuple[Any, Any]], Sequence[Tuple[Any, Sequence[Any]]]], doseq: bool = ..., @@ -118,27 +129,24 @@ def urlencode( errors: str = ..., quote_via: Callable[[str, AnyStr, str, str], str] = ..., ) -> str: ... - def urljoin(base: AnyStr, url: Optional[AnyStr], allow_fragments: bool = ...) -> AnyStr: ... - @overload def urlparse(url: str, scheme: Optional[str] = ..., allow_fragments: bool = ...) -> ParseResult: ... @overload def urlparse(url: Optional[bytes], scheme: Optional[bytes] = ..., allow_fragments: bool = ...) -> ParseResultBytes: ... - @overload def urlsplit(url: str, scheme: Optional[str] = ..., allow_fragments: bool = ...) -> SplitResult: ... @overload def urlsplit(url: Optional[bytes], scheme: Optional[bytes] = ..., allow_fragments: bool = ...) -> SplitResultBytes: ... - @overload def urlunparse( components: Tuple[Optional[AnyStr], Optional[AnyStr], Optional[AnyStr], Optional[AnyStr], Optional[AnyStr], Optional[AnyStr]] ) -> AnyStr: ... @overload def urlunparse(components: Sequence[Optional[AnyStr]]) -> AnyStr: ... - @overload -def urlunsplit(components: Tuple[Optional[AnyStr], Optional[AnyStr], Optional[AnyStr], Optional[AnyStr], Optional[AnyStr]]) -> AnyStr: ... +def urlunsplit( + components: Tuple[Optional[AnyStr], Optional[AnyStr], Optional[AnyStr], Optional[AnyStr], Optional[AnyStr]] +) -> AnyStr: ... @overload def urlunsplit(components: Sequence[Optional[AnyStr]]) -> AnyStr: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/urllib/request.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/urllib/request.pyi old mode 100755 new mode 100644 index 7dd954d4..82816d9c --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/urllib/request.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/urllib/request.pyi @@ -1,36 +1,45 @@ -# Stubs for urllib.request (Python 3.4) - +import os +import ssl +from email.message import Message +from http.client import HTTPMessage, HTTPResponse, _HTTPConnectionProtocol +from http.cookiejar import CookieJar from typing import ( - Any, Callable, ClassVar, Dict, List, IO, Mapping, Optional, Sequence, Tuple, - TypeVar, Union, overload, NoReturn, + IO, + Any, + Callable, + ClassVar, + Dict, + List, + Mapping, + NoReturn, + Optional, + Pattern, + Sequence, + Tuple, + TypeVar, + Union, + overload, ) -from http.client import HTTPResponse, HTTPMessage, _HTTPConnectionProtocol -from http.cookiejar import CookieJar -from email.message import Message +from urllib.error import HTTPError from urllib.response import addinfourl -import ssl -import sys -import os -_T = TypeVar('_T') +_T = TypeVar("_T") _UrlopenRet = Any -class _HTTPResponse(HTTPResponse): - url: str - msg: str # type: ignore - def urlopen( - url: Union[str, Request], data: Optional[bytes] = ..., - timeout: Optional[float] = ..., *, cafile: Optional[str] = ..., - capath: Optional[str] = ..., cadefault: bool = ..., - context: Optional[ssl.SSLContext] = ... + url: Union[str, Request], + data: Optional[bytes] = ..., + timeout: Optional[float] = ..., + *, + cafile: Optional[str] = ..., + capath: Optional[str] = ..., + cadefault: bool = ..., + context: Optional[ssl.SSLContext] = ..., ) -> _UrlopenRet: ... def install_opener(opener: OpenerDirector) -> None: ... -def build_opener( - *handlers: Union[BaseHandler, Callable[[], BaseHandler]] -) -> OpenerDirector: ... -def url2pathname(path: str) -> str: ... -def pathname2url(path: str) -> str: ... +def build_opener(*handlers: Union[BaseHandler, Callable[[], BaseHandler]]) -> OpenerDirector: ... +def url2pathname(pathname: str) -> str: ... +def pathname2url(pathname: str) -> str: ... def getproxies() -> Dict[str, str]: ... def parse_http_list(s: str) -> List[str]: ... def parse_keqv_list(l: List[str]) -> Dict[str, str]: ... @@ -51,9 +60,15 @@ class Request: headers: Dict[str, str] unverifiable: bool method: Optional[str] - def __init__(self, url: str, data: Optional[bytes] = ..., - headers: Dict[str, str] = ..., origin_req_host: Optional[str] = ..., - unverifiable: bool = ..., method: Optional[str] = ...) -> None: ... + def __init__( + self, + url: str, + data: Optional[bytes] = ..., + headers: Dict[str, str] = ..., + origin_req_host: Optional[str] = ..., + unverifiable: bool = ..., + method: Optional[str] = ..., + ) -> None: ... def get_method(self) -> str: ... def add_header(self, key: str, val: str) -> None: ... def add_unredirected_header(self, key: str, val: str) -> None: ... @@ -66,87 +81,103 @@ class Request: @overload def get_header(self, header_name: str, default: _T) -> Union[str, _T]: ... def header_items(self) -> List[Tuple[str, str]]: ... + def has_proxy(self) -> bool: ... class OpenerDirector: addheaders: List[Tuple[str, str]] def add_handler(self, handler: BaseHandler) -> None: ... - def open(self, url: Union[str, Request], data: Optional[bytes] = ..., - timeout: Optional[float] = ...) -> _UrlopenRet: ... + def open(self, fullurl: Union[str, Request], data: Optional[bytes] = ..., timeout: Optional[float] = ...) -> _UrlopenRet: ... def error(self, proto: str, *args: Any) -> _UrlopenRet: ... - + def close(self) -> None: ... class BaseHandler: handler_order: ClassVar[int] parent: OpenerDirector def add_parent(self, parent: OpenerDirector) -> None: ... def close(self) -> None: ... - def http_error_nnn(self, req: Request, fp: IO[str], code: int, msg: int, - hdrs: Mapping[str, str]) -> _UrlopenRet: ... + def http_error_nnn(self, req: Request, fp: IO[str], code: int, msg: int, headers: Mapping[str, str]) -> _UrlopenRet: ... -class HTTPDefaultErrorHandler(BaseHandler): ... +class HTTPDefaultErrorHandler(BaseHandler): + def http_error_default( + self, req: Request, fp: IO[bytes], code: int, msg: str, hdrs: Mapping[str, str] + ) -> HTTPError: ... # undocumented class HTTPRedirectHandler(BaseHandler): - def redirect_request(self, req: Request, fp: IO[str], code: int, msg: str, - hdrs: Mapping[str, str], - newurl: str) -> Optional[Request]: ... - def http_error_301(self, req: Request, fp: IO[str], code: int, msg: int, - hdrs: Mapping[str, str]) -> Optional[_UrlopenRet]: ... - def http_error_302(self, req: Request, fp: IO[str], code: int, msg: int, - hdrs: Mapping[str, str]) -> Optional[_UrlopenRet]: ... - def http_error_303(self, req: Request, fp: IO[str], code: int, msg: int, - hdrs: Mapping[str, str]) -> Optional[_UrlopenRet]: ... - def http_error_307(self, req: Request, fp: IO[str], code: int, msg: int, - hdrs: Mapping[str, str]) -> Optional[_UrlopenRet]: ... + max_redirections: ClassVar[int] # undocumented + max_repeats: ClassVar[int] # undocumented + inf_msg: ClassVar[str] # undocumented + def redirect_request( + self, req: Request, fp: IO[str], code: int, msg: str, headers: Mapping[str, str], newurl: str + ) -> Optional[Request]: ... + def http_error_301( + self, req: Request, fp: IO[str], code: int, msg: int, headers: Mapping[str, str] + ) -> Optional[_UrlopenRet]: ... + def http_error_302( + self, req: Request, fp: IO[str], code: int, msg: int, headers: Mapping[str, str] + ) -> Optional[_UrlopenRet]: ... + def http_error_303( + self, req: Request, fp: IO[str], code: int, msg: int, headers: Mapping[str, str] + ) -> Optional[_UrlopenRet]: ... + def http_error_307( + self, req: Request, fp: IO[str], code: int, msg: int, headers: Mapping[str, str] + ) -> Optional[_UrlopenRet]: ... class HTTPCookieProcessor(BaseHandler): cookiejar: CookieJar def __init__(self, cookiejar: Optional[CookieJar] = ...) -> None: ... + def http_request(self, request: Request) -> Request: ... # undocumented + def http_response(self, request: Request, response: HTTPResponse) -> HTTPResponse: ... # undocumented + def https_request(self, request: Request) -> Request: ... # undocumented + def https_response(self, request: Request, response: HTTPResponse) -> HTTPResponse: ... # undocumented class ProxyHandler(BaseHandler): def __init__(self, proxies: Optional[Dict[str, str]] = ...) -> None: ... + def proxy_open(self, req: Request, proxy: str, type: str) -> Optional[_UrlopenRet]: ... # undocumented # TODO add a method for every (common) proxy protocol class HTTPPasswordMgr: - def add_password(self, realm: str, uri: Union[str, Sequence[str]], - user: str, passwd: str) -> None: ... + def add_password(self, realm: str, uri: Union[str, Sequence[str]], user: str, passwd: str) -> None: ... def find_user_password(self, realm: str, authuri: str) -> Tuple[Optional[str], Optional[str]]: ... + def is_suburi(self, base: str, test: str) -> bool: ... # undocumented + def reduce_uri(self, uri: str, default_port: bool = ...) -> str: ... # undocumented class HTTPPasswordMgrWithDefaultRealm(HTTPPasswordMgr): - def add_password(self, realm: str, uri: Union[str, Sequence[str]], - user: str, passwd: str) -> None: ... - def find_user_password(self, realm: str, authuri: str) -> Tuple[Optional[str], Optional[str]]: ... + def add_password(self, realm: Optional[str], uri: Union[str, Sequence[str]], user: str, passwd: str) -> None: ... + def find_user_password(self, realm: Optional[str], authuri: str) -> Tuple[Optional[str], Optional[str]]: ... class HTTPPasswordMgrWithPriorAuth(HTTPPasswordMgrWithDefaultRealm): def add_password( - self, - realm: str, - uri: Union[str, Sequence[str]], - user: str, - passwd: str, - is_authenticated: bool = ..., + self, realm: Optional[str], uri: Union[str, Sequence[str]], user: str, passwd: str, is_authenticated: bool = ... ) -> None: ... def update_authenticated(self, uri: Union[str, Sequence[str]], is_authenticated: bool = ...) -> None: ... def is_authenticated(self, authuri: str) -> bool: ... class AbstractBasicAuthHandler: - def __init__(self, - password_mgr: Optional[HTTPPasswordMgr] = ...) -> None: ... - def http_error_auth_reqed(self, authreq: str, host: str, req: Request, - headers: Mapping[str, str]) -> None: ... + rx: ClassVar[Pattern[str]] # undocumented + def __init__(self, password_mgr: Optional[HTTPPasswordMgr] = ...) -> None: ... + def http_error_auth_reqed(self, authreq: str, host: str, req: Request, headers: Mapping[str, str]) -> None: ... + def http_request(self, req: Request) -> Request: ... # undocumented + def http_response(self, req: Request, response: HTTPResponse) -> HTTPResponse: ... # undocumented + def https_request(self, req: Request) -> Request: ... # undocumented + def https_response(self, req: Request, response: HTTPResponse) -> HTTPResponse: ... # undocumented + def retry_http_basic_auth(self, host: str, req: Request, realm: str) -> Optional[_UrlopenRet]: ... # undocumented class HTTPBasicAuthHandler(AbstractBasicAuthHandler, BaseHandler): - def http_error_401(self, req: Request, fp: IO[str], code: int, msg: int, - hdrs: Mapping[str, str]) -> Optional[_UrlopenRet]: ... + auth_header: ClassVar[str] # undocumented + def http_error_401( + self, req: Request, fp: IO[str], code: int, msg: int, headers: Mapping[str, str] + ) -> Optional[_UrlopenRet]: ... class ProxyBasicAuthHandler(AbstractBasicAuthHandler, BaseHandler): - def http_error_407(self, req: Request, fp: IO[str], code: int, msg: int, - hdrs: Mapping[str, str]) -> Optional[_UrlopenRet]: ... + auth_header: ClassVar[str] + def http_error_407( + self, req: Request, fp: IO[str], code: int, msg: int, headers: Mapping[str, str] + ) -> Optional[_UrlopenRet]: ... class AbstractDigestAuthHandler: def __init__(self, passwd: Optional[HTTPPasswordMgr] = ...) -> None: ... def reset_retry_count(self) -> None: ... - def http_error_auth_reqed(self, auth_header: str, host: str, req: Request, - headers: Mapping[str, str]) -> None: ... + def http_error_auth_reqed(self, auth_header: str, host: str, req: Request, headers: Mapping[str, str]) -> None: ... def retry_http_digest_auth(self, req: Request, auth: str) -> Optional[_UrlopenRet]: ... def get_cnonce(self, nonce: str) -> str: ... def get_authorization(self, req: Request, chal: Mapping[str, str]) -> str: ... @@ -154,73 +185,157 @@ class AbstractDigestAuthHandler: def get_entity_digest(self, data: Optional[bytes], chal: Mapping[str, str]) -> Optional[str]: ... class HTTPDigestAuthHandler(BaseHandler, AbstractDigestAuthHandler): - def http_error_401(self, req: Request, fp: IO[str], code: int, msg: int, - hdrs: Mapping[str, str]) -> Optional[_UrlopenRet]: ... + auth_header: ClassVar[str] # undocumented + def http_error_401( + self, req: Request, fp: IO[str], code: int, msg: int, headers: Mapping[str, str] + ) -> Optional[_UrlopenRet]: ... class ProxyDigestAuthHandler(BaseHandler, AbstractDigestAuthHandler): - def http_error_407(self, req: Request, fp: IO[str], code: int, msg: int, - hdrs: Mapping[str, str]) -> Optional[_UrlopenRet]: ... + auth_header: ClassVar[str] # undocumented + def http_error_407( + self, req: Request, fp: IO[str], code: int, msg: int, headers: Mapping[str, str] + ) -> Optional[_UrlopenRet]: ... class AbstractHTTPHandler(BaseHandler): # undocumented def __init__(self, debuglevel: int = ...) -> None: ... def set_http_debuglevel(self, level: int) -> None: ... def do_request_(self, request: Request) -> Request: ... - def do_open(self, - http_class: _HTTPConnectionProtocol, - req: Request, - **http_conn_args: Any) -> HTTPResponse: ... + def do_open(self, http_class: _HTTPConnectionProtocol, req: Request, **http_conn_args: Any) -> HTTPResponse: ... class HTTPHandler(AbstractHTTPHandler): def http_open(self, req: Request) -> HTTPResponse: ... def http_request(self, request: Request) -> Request: ... # undocumented class HTTPSHandler(AbstractHTTPHandler): - def __init__(self, debuglevel: int = ..., - context: Optional[ssl.SSLContext] = ..., - check_hostname: Optional[bool] = ...) -> None: ... + def __init__( + self, debuglevel: int = ..., context: Optional[ssl.SSLContext] = ..., check_hostname: Optional[bool] = ... + ) -> None: ... def https_open(self, req: Request) -> HTTPResponse: ... def https_request(self, request: Request) -> Request: ... # undocumented class FileHandler(BaseHandler): + names: ClassVar[Optional[Tuple[str, ...]]] # undocumented def file_open(self, req: Request) -> addinfourl: ... + def get_names(self) -> Tuple[str, ...]: ... # undocumented + def open_local_file(self, req: Request) -> addinfourl: ... # undocumented class DataHandler(BaseHandler): def data_open(self, req: Request) -> addinfourl: ... +class ftpwrapper: # undocumented + def __init__( + self, user: str, passwd: str, host: str, port: int, dirs: str, timeout: Optional[float] = ..., persistent: bool = ... + ) -> None: ... + class FTPHandler(BaseHandler): def ftp_open(self, req: Request) -> addinfourl: ... + def connect_ftp( + self, user: str, passwd: str, host: str, port: int, dirs: str, timeout: float + ) -> ftpwrapper: ... # undocumented class CacheFTPHandler(FTPHandler): def setTimeout(self, t: float) -> None: ... def setMaxConns(self, m: int) -> None: ... + def check_cache(self) -> None: ... # undocumented + def clear_cache(self) -> None: ... # undocumented + def connect_ftp( + self, user: str, passwd: str, host: str, port: int, dirs: str, timeout: float + ) -> ftpwrapper: ... # undocumented class UnknownHandler(BaseHandler): def unknown_open(self, req: Request) -> NoReturn: ... class HTTPErrorProcessor(BaseHandler): - def http_response(self, request, response) -> _UrlopenRet: ... - def https_response(self, request, response) -> _UrlopenRet: ... - -if sys.version_info >= (3, 6): - def urlretrieve(url: str, filename: Optional[Union[str, os.PathLike[Any]]] = ..., - reporthook: Optional[Callable[[int, int, int], None]] = ..., - data: Optional[bytes] = ...) -> Tuple[str, HTTPMessage]: ... -else: - def urlretrieve(url: str, filename: Optional[str] = ..., - reporthook: Optional[Callable[[int, int, int], None]] = ..., - data: Optional[bytes] = ...) -> Tuple[str, HTTPMessage]: ... + def http_response(self, request: Request, response: HTTPResponse) -> _UrlopenRet: ... + def https_response(self, request: Request, response: HTTPResponse) -> _UrlopenRet: ... + +def urlretrieve( + url: str, + filename: Optional[Union[str, os.PathLike[Any]]] = ..., + reporthook: Optional[Callable[[int, int, int], None]] = ..., + data: Optional[bytes] = ..., +) -> Tuple[str, HTTPMessage]: ... def urlcleanup() -> None: ... class URLopener: version: ClassVar[str] - def __init__(self, proxies: Optional[Dict[str, str]] = ..., - **x509: str) -> None: ... + def __init__(self, proxies: Optional[Dict[str, str]] = ..., **x509: str) -> None: ... def open(self, fullurl: str, data: Optional[bytes] = ...) -> _UrlopenRet: ... - def open_unknown(self, fullurl: str, - data: Optional[bytes] = ...) -> _UrlopenRet: ... - def retrieve(self, url: str, filename: Optional[str] = ..., - reporthook: Optional[Callable[[int, int, int], None]] = ..., - data: Optional[bytes] = ...) -> Tuple[str, Optional[Message]]: ... + def open_unknown(self, fullurl: str, data: Optional[bytes] = ...) -> _UrlopenRet: ... + def retrieve( + self, + url: str, + filename: Optional[str] = ..., + reporthook: Optional[Callable[[int, int, int], None]] = ..., + data: Optional[bytes] = ..., + ) -> Tuple[str, Optional[Message]]: ... + def addheader(self, *args: Tuple[str, str]) -> None: ... # undocumented + def cleanup(self) -> None: ... # undocumented + def close(self) -> None: ... # undocumented + def http_error( + self, url: str, fp: IO[bytes], errcode: int, errmsg: str, headers: Mapping[str, str], data: Optional[bytes] = ... + ) -> _UrlopenRet: ... # undocumented + def http_error_default( + self, url: str, fp: IO[bytes], errcode: int, errmsg: str, headers: Mapping[str, str] + ) -> _UrlopenRet: ... # undocumented + def open_data(self, url: str, data: Optional[bytes] = ...) -> addinfourl: ... # undocumented + def open_file(self, url: str) -> addinfourl: ... # undocumented + def open_ftp(self, url: str) -> addinfourl: ... # undocumented + def open_http(self, url: str, data: Optional[bytes] = ...) -> _UrlopenRet: ... # undocumented + def open_https(self, url: str, data: Optional[bytes] = ...) -> _UrlopenRet: ... # undocumented + def open_local_file(self, url: str) -> addinfourl: ... # undocumented + def open_unknown_proxy(self, proxy: str, fullurl: str, data: Optional[bytes] = ...) -> None: ... # undocumented class FancyURLopener(URLopener): def prompt_user_passwd(self, host: str, realm: str) -> Tuple[str, str]: ... + def get_user_passwd(self, host: str, realm: str, clear_cache: int = ...) -> Tuple[str, str]: ... # undocumented + def http_error_301( + self, url: str, fp: IO[str], errcode: int, errmsg: str, headers: Mapping[str, str], data: Optional[bytes] = ... + ) -> Optional[Union[_UrlopenRet, addinfourl]]: ... # undocumented + def http_error_302( + self, url: str, fp: IO[str], errcode: int, errmsg: str, headers: Mapping[str, str], data: Optional[bytes] = ... + ) -> Optional[Union[_UrlopenRet, addinfourl]]: ... # undocumented + def http_error_303( + self, url: str, fp: IO[str], errcode: int, errmsg: str, headers: Mapping[str, str], data: Optional[bytes] = ... + ) -> Optional[Union[_UrlopenRet, addinfourl]]: ... # undocumented + def http_error_307( + self, url: str, fp: IO[str], errcode: int, errmsg: str, headers: Mapping[str, str], data: Optional[bytes] = ... + ) -> Optional[Union[_UrlopenRet, addinfourl]]: ... # undocumented + def http_error_401( + self, + url: str, + fp: IO[str], + errcode: int, + errmsg: str, + headers: Mapping[str, str], + data: Optional[bytes] = ..., + retry: bool = ..., + ) -> Optional[_UrlopenRet]: ... # undocumented + def http_error_407( + self, + url: str, + fp: IO[str], + errcode: int, + errmsg: str, + headers: Mapping[str, str], + data: Optional[bytes] = ..., + retry: bool = ..., + ) -> Optional[_UrlopenRet]: ... # undocumented + def http_error_default( + self, url: str, fp: IO[bytes], errcode: int, errmsg: str, headers: Mapping[str, str] + ) -> addinfourl: ... # undocumented + def redirect_internal( + self, url: str, fp: IO[str], errcode: int, errmsg: str, headers: Mapping[str, str], data: Optional[bytes] + ) -> Optional[_UrlopenRet]: ... # undocumented + def retry_http_basic_auth( + self, url: str, realm: str, data: Optional[bytes] = ... + ) -> Optional[_UrlopenRet]: ... # undocumented + def retry_https_basic_auth( + self, url: str, realm: str, data: Optional[bytes] = ... + ) -> Optional[_UrlopenRet]: ... # undocumented + def retry_proxy_http_basic_auth( + self, url: str, realm: str, data: Optional[bytes] = ... + ) -> Optional[_UrlopenRet]: ... # undocumented + def retry_proxy_https_basic_auth( + self, url: str, realm: str, data: Optional[bytes] = ... + ) -> Optional[_UrlopenRet]: ... # undocumented diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/urllib/response.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/urllib/response.pyi old mode 100755 new mode 100644 index dca0efac..c8f9d75d --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/urllib/response.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/urllib/response.pyi @@ -1,14 +1,16 @@ -# private module, we only expose what's needed - -from typing import BinaryIO, Iterable, List, Mapping, Optional, Type, TypeVar from email.message import Message from types import TracebackType +from typing import IO, Any, BinaryIO, Callable, Iterable, List, Optional, Tuple, Type, TypeVar _AIUT = TypeVar("_AIUT", bound=addbase) class addbase(BinaryIO): + fp: IO[bytes] + def __init__(self, fp: IO[bytes]) -> None: ... def __enter__(self: _AIUT) -> _AIUT: ... - def __exit__(self, type: Optional[Type[BaseException]], value: Optional[BaseException], traceback: Optional[TracebackType]) -> None: ... + def __exit__( + self, type: Optional[Type[BaseException]], value: Optional[BaseException], traceback: Optional[TracebackType] + ) -> None: ... def __iter__(self: _AIUT) -> _AIUT: ... def __next__(self) -> bytes: ... def close(self) -> None: ... @@ -31,12 +33,19 @@ class addbase(BinaryIO): def write(self, s: bytes) -> int: ... def writelines(self, lines: Iterable[bytes]) -> None: ... +class addclosehook(addbase): + closehook: Callable[..., object] + hookargs: Tuple[Any, ...] + def __init__(self, fp: IO[bytes], closehook: Callable[..., object], *hookargs: Any) -> None: ... + class addinfo(addbase): headers: Message + def __init__(self, fp: IO[bytes], headers: Message) -> None: ... def info(self) -> Message: ... class addinfourl(addinfo): url: str code: int + def __init__(self, fp: IO[bytes], headers: Message, url: str, code: Optional[int] = ...) -> None: ... def geturl(self) -> str: ... def getcode(self) -> int: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/urllib/robotparser.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/urllib/robotparser.pyi old mode 100755 new mode 100644 index 2c5b657b..ad96ca12 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/urllib/robotparser.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/urllib/robotparser.pyi @@ -1,7 +1,5 @@ -# Stubs for urllib.robotparser (Python 3.4) - -from typing import Iterable, NamedTuple, Optional import sys +from typing import Iterable, List, NamedTuple, Optional class _RequestRate(NamedTuple): requests: int @@ -15,6 +13,7 @@ class RobotFileParser: def can_fetch(self, user_agent: str, url: str) -> bool: ... def mtime(self) -> int: ... def modified(self) -> None: ... - if sys.version_info >= (3, 6): - def crawl_delay(self, useragent: str) -> Optional[str]: ... - def request_rate(self, useragent: str) -> Optional[_RequestRate]: ... + def crawl_delay(self, useragent: str) -> Optional[str]: ... + def request_rate(self, useragent: str) -> Optional[_RequestRate]: ... + if sys.version_info >= (3, 8): + def site_maps(self) -> Optional[List[str]]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/winreg.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/winreg.pyi new file mode 100644 index 00000000..90cf74ea --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/winreg.pyi @@ -0,0 +1,100 @@ +import sys +from types import TracebackType +from typing import Any, Optional, Tuple, Type, Union + +_KeyType = Union[HKEYType, int] + +def CloseKey(__hkey: _KeyType) -> None: ... +def ConnectRegistry(__computer_name: Optional[str], __key: _KeyType) -> HKEYType: ... +def CreateKey(__key: _KeyType, __sub_key: Optional[str]) -> HKEYType: ... +def CreateKeyEx(key: _KeyType, sub_key: Optional[str], reserved: int = ..., access: int = ...) -> HKEYType: ... +def DeleteKey(__key: _KeyType, __sub_key: str) -> None: ... +def DeleteKeyEx(key: _KeyType, sub_key: str, access: int = ..., reserved: int = ...) -> None: ... +def DeleteValue(__key: _KeyType, __value: str) -> None: ... +def EnumKey(__key: _KeyType, __index: int) -> str: ... +def EnumValue(__key: _KeyType, __index: int) -> Tuple[str, Any, int]: ... +def ExpandEnvironmentStrings(__str: str) -> str: ... +def FlushKey(__key: _KeyType) -> None: ... +def LoadKey(__key: _KeyType, __sub_key: str, __file_name: str) -> None: ... +def OpenKey(key: _KeyType, sub_key: str, reserved: int = ..., access: int = ...) -> HKEYType: ... +def OpenKeyEx(key: _KeyType, sub_key: str, reserved: int = ..., access: int = ...) -> HKEYType: ... +def QueryInfoKey(__key: _KeyType) -> Tuple[int, int, int]: ... +def QueryValue(__key: _KeyType, __sub_key: Optional[str]) -> str: ... +def QueryValueEx(__key: _KeyType, __name: str) -> Tuple[Any, int]: ... +def SaveKey(__key: _KeyType, __file_name: str) -> None: ... +def SetValue(__key: _KeyType, __sub_key: str, __type: int, __value: str) -> None: ... +def SetValueEx( + __key: _KeyType, __value_name: Optional[str], __reserved: Any, __type: int, __value: Union[str, int] +) -> None: ... # reserved is ignored +def DisableReflectionKey(__key: _KeyType) -> None: ... +def EnableReflectionKey(__key: _KeyType) -> None: ... +def QueryReflectionKey(__key: _KeyType) -> bool: ... + +HKEY_CLASSES_ROOT: int +HKEY_CURRENT_USER: int +HKEY_LOCAL_MACHINE: int +HKEY_USERS: int +HKEY_PERFORMANCE_DATA: int +HKEY_CURRENT_CONFIG: int +HKEY_DYN_DATA: int + +KEY_ALL_ACCESS: int +KEY_WRITE: int +KEY_READ: int +KEY_EXECUTE: int +KEY_QUERY_VALUE: int +KEY_SET_VALUE: int +KEY_CREATE_SUB_KEY: int +KEY_ENUMERATE_SUB_KEYS: int +KEY_NOTIFY: int +KEY_CREATE_LINK: int + +KEY_WOW64_64KEY: int +KEY_WOW64_32KEY: int + +REG_BINARY: int +REG_DWORD: int +REG_DWORD_LITTLE_ENDIAN: int +REG_DWORD_BIG_ENDIAN: int +REG_EXPAND_SZ: int +REG_LINK: int +REG_MULTI_SZ: int +REG_NONE: int +if sys.version_info >= (3, 6): + REG_QWORD: int + REG_QWORD_LITTLE_ENDIAN: int +REG_RESOURCE_LIST: int +REG_FULL_RESOURCE_DESCRIPTOR: int +REG_RESOURCE_REQUIREMENTS_LIST: int +REG_SZ: int + +REG_CREATED_NEW_KEY: int # undocumented +REG_LEGAL_CHANGE_FILTER: int # undocumented +REG_LEGAL_OPTION: int # undocumented +REG_NOTIFY_CHANGE_ATTRIBUTES: int # undocumented +REG_NOTIFY_CHANGE_LAST_SET: int # undocumented +REG_NOTIFY_CHANGE_NAME: int # undocumented +REG_NOTIFY_CHANGE_SECURITY: int # undocumented +REG_NO_LAZY_FLUSH: int # undocumented +REG_OPENED_EXISTING_KEY: int # undocumented +REG_OPTION_BACKUP_RESTORE: int # undocumented +REG_OPTION_CREATE_LINK: int # undocumented +REG_OPTION_NON_VOLATILE: int # undocumented +REG_OPTION_OPEN_LINK: int # undocumented +REG_OPTION_RESERVED: int # undocumented +REG_OPTION_VOLATILE: int # undocumented +REG_REFRESH_HIVE: int # undocumented +REG_WHOLE_HIVE_VOLATILE: int # undocumented + +error = OSError + +# Though this class has a __name__ of PyHKEY, it's exposed as HKEYType for some reason +class HKEYType: + def __bool__(self) -> bool: ... + def __int__(self) -> int: ... + def __enter__(self) -> HKEYType: ... + def __exit__( + self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType] + ) -> Optional[bool]: ... + def Close(self) -> None: ... + def Detach(self) -> int: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/xmlrpc/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/xmlrpc/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/xmlrpc/client.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/xmlrpc/client.pyi new file mode 100644 index 00000000..7bea294b --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/xmlrpc/client.pyi @@ -0,0 +1,308 @@ +import gzip +import http.client +import sys +import time +from _typeshed import SupportsRead, SupportsWrite +from datetime import datetime +from io import BytesIO +from types import TracebackType +from typing import Any, Callable, Dict, Iterable, List, Mapping, Optional, Protocol, Tuple, Type, Union, overload +from typing_extensions import Literal + +class _SupportsTimeTuple(Protocol): + def timetuple(self) -> time.struct_time: ... + +_DateTimeComparable = Union[DateTime, datetime, str, _SupportsTimeTuple] +_Marshallable = Union[None, bool, int, float, str, bytes, tuple, list, dict, datetime, DateTime, Binary] +_XMLDate = Union[int, datetime, Tuple[int, ...], time.struct_time] +_HostType = Union[Tuple[str, Dict[str, str]], str] + +def escape(s: str) -> str: ... # undocumented + +PARSE_ERROR: int # undocumented +SERVER_ERROR: int # undocumented +APPLICATION_ERROR: int # undocumented +SYSTEM_ERROR: int # undocumented +TRANSPORT_ERROR: int # undocumented + +NOT_WELLFORMED_ERROR: int # undocumented +UNSUPPORTED_ENCODING: int # undocumented +INVALID_ENCODING_CHAR: int # undocumented +INVALID_XMLRPC: int # undocumented +METHOD_NOT_FOUND: int # undocumented +INVALID_METHOD_PARAMS: int # undocumented +INTERNAL_ERROR: int # undocumented + +class Error(Exception): ... + +class ProtocolError(Error): + + url: str + errcode: int + errmsg: str + headers: Dict[str, str] + def __init__(self, url: str, errcode: int, errmsg: str, headers: Dict[str, str]) -> None: ... + +class ResponseError(Error): ... + +class Fault(Error): + + faultCode: str + faultString: str + def __init__(self, faultCode: str, faultString: str, **extra: Any) -> None: ... + +boolean = bool +Boolean = bool + +def _iso8601_format(value: datetime) -> str: ... # undocumented +def _strftime(value: _XMLDate) -> str: ... # undocumented + +class DateTime: + + value: str # undocumented + def __init__(self, value: Union[int, str, datetime, time.struct_time, Tuple[int, ...]] = ...) -> None: ... + def __lt__(self, other: _DateTimeComparable) -> bool: ... + def __le__(self, other: _DateTimeComparable) -> bool: ... + def __gt__(self, other: _DateTimeComparable) -> bool: ... + def __ge__(self, other: _DateTimeComparable) -> bool: ... + def __eq__(self, other: _DateTimeComparable) -> bool: ... # type: ignore + def make_comparable(self, other: _DateTimeComparable) -> Tuple[str, str]: ... # undocumented + def timetuple(self) -> time.struct_time: ... # undocumented + def decode(self, data: Any) -> None: ... + def encode(self, out: SupportsWrite[str]) -> None: ... + +def _datetime(data: Any) -> DateTime: ... # undocumented +def _datetime_type(data: str) -> datetime: ... # undocumented + +class Binary: + + data: bytes + def __init__(self, data: Optional[bytes] = ...) -> None: ... + def decode(self, data: bytes) -> None: ... + def encode(self, out: SupportsWrite[str]) -> None: ... + +def _binary(data: bytes) -> Binary: ... # undocumented + +WRAPPERS: Tuple[Type[DateTime], Type[Binary]] # undocumented + +class ExpatParser: # undocumented + def __init__(self, target: Unmarshaller) -> None: ... + def feed(self, data: Union[str, bytes]) -> None: ... + def close(self) -> None: ... + +class Marshaller: + + dispatch: Dict[ + Type[Any], Callable[[Marshaller, Any, Callable[[str], Any]], None] + ] = ... # TODO: Replace 'Any' with some kind of binding + + memo: Dict[Any, None] + data: None + encoding: Optional[str] + allow_none: bool + def __init__(self, encoding: Optional[str] = ..., allow_none: bool = ...) -> None: ... + def dumps(self, values: Union[Fault, Iterable[_Marshallable]]) -> str: ... + def __dump(self, value: Union[_Marshallable], write: Callable[[str], Any]) -> None: ... # undocumented + def dump_nil(self, value: None, write: Callable[[str], Any]) -> None: ... + def dump_bool(self, value: bool, write: Callable[[str], Any]) -> None: ... + def dump_long(self, value: int, write: Callable[[str], Any]) -> None: ... + def dump_int(self, value: int, write: Callable[[str], Any]) -> None: ... + def dump_double(self, value: float, write: Callable[[str], Any]) -> None: ... + def dump_unicode(self, value: str, write: Callable[[str], Any], escape: Callable[[str], str] = ...) -> None: ... + def dump_bytes(self, value: bytes, write: Callable[[str], Any]) -> None: ... + def dump_array(self, value: Iterable[_Marshallable], write: Callable[[str], Any]) -> None: ... + def dump_struct( + self, value: Mapping[str, _Marshallable], write: Callable[[str], Any], escape: Callable[[str], str] = ... + ) -> None: ... + def dump_datetime(self, value: _XMLDate, write: Callable[[str], Any]) -> None: ... + def dump_instance(self, value: object, write: Callable[[str], Any]) -> None: ... + +class Unmarshaller: + + dispatch: Dict[str, Callable[[Unmarshaller, str], None]] = ... + + _type: Optional[str] + _stack: List[_Marshallable] + _marks: List[int] + _data: List[str] + _value: bool + _methodname: Optional[str] + _encoding: str + append: Callable[[Any], None] + _use_datetime: bool + _use_builtin_types: bool + def __init__(self, use_datetime: bool = ..., use_builtin_types: bool = ...) -> None: ... + def close(self) -> Tuple[_Marshallable, ...]: ... + def getmethodname(self) -> Optional[str]: ... + def xml(self, encoding: str, standalone: Any) -> None: ... # Standalone is ignored + def start(self, tag: str, attrs: Dict[str, str]) -> None: ... + def data(self, text: str) -> None: ... + def end(self, tag: str) -> None: ... + def end_dispatch(self, tag: str, data: str) -> None: ... + def end_nil(self, data: str) -> None: ... + def end_boolean(self, data: str) -> None: ... + def end_int(self, data: str) -> None: ... + def end_double(self, data: str) -> None: ... + def end_bigdecimal(self, data: str) -> None: ... + def end_string(self, data: str) -> None: ... + def end_array(self, data: str) -> None: ... + def end_struct(self, data: str) -> None: ... + def end_base64(self, data: str) -> None: ... + def end_dateTime(self, data: str) -> None: ... + def end_value(self, data: str) -> None: ... + def end_params(self, data: str) -> None: ... + def end_fault(self, data: str) -> None: ... + def end_methodName(self, data: str) -> None: ... + +class _MultiCallMethod: # undocumented + + __call_list: List[Tuple[str, Tuple[_Marshallable, ...]]] + __name: str + def __init__(self, call_list: List[Tuple[str, _Marshallable]], name: str) -> None: ... + def __getattr__(self, name: str) -> _MultiCallMethod: ... + def __call__(self, *args: _Marshallable) -> None: ... + +class MultiCallIterator: # undocumented + + results: List[List[_Marshallable]] + def __init__(self, results: List[List[_Marshallable]]) -> None: ... + def __getitem__(self, i: int) -> _Marshallable: ... + +class MultiCall: + + __server: ServerProxy + __call_list: List[Tuple[str, Tuple[_Marshallable, ...]]] + def __init__(self, server: ServerProxy) -> None: ... + def __getattr__(self, item: str) -> _MultiCallMethod: ... + def __call__(self) -> MultiCallIterator: ... + +# A little white lie +FastMarshaller: Optional[Marshaller] +FastParser: Optional[ExpatParser] +FastUnmarshaller: Optional[Unmarshaller] + +def getparser(use_datetime: bool = ..., use_builtin_types: bool = ...) -> Tuple[ExpatParser, Unmarshaller]: ... +def dumps( + params: Union[Fault, Tuple[_Marshallable, ...]], + methodname: Optional[str] = ..., + methodresponse: Optional[bool] = ..., + encoding: Optional[str] = ..., + allow_none: bool = ..., +) -> str: ... +def loads( + data: str, use_datetime: bool = ..., use_builtin_types: bool = ... +) -> Tuple[Tuple[_Marshallable, ...], Optional[str]]: ... +def gzip_encode(data: bytes) -> bytes: ... # undocumented +def gzip_decode(data: bytes, max_decode: int = ...) -> bytes: ... # undocumented + +class GzipDecodedResponse(gzip.GzipFile): # undocumented + + io: BytesIO + def __init__(self, response: SupportsRead[bytes]) -> None: ... + def close(self) -> None: ... + +class _Method: # undocumented + + __send: Callable[[str, Tuple[_Marshallable, ...]], _Marshallable] + __name: str + def __init__(self, send: Callable[[str, Tuple[_Marshallable, ...]], _Marshallable], name: str) -> None: ... + def __getattr__(self, name: str) -> _Method: ... + def __call__(self, *args: _Marshallable) -> _Marshallable: ... + +class Transport: + + user_agent: str = ... + accept_gzip_encoding: bool = ... + encode_threshold: Optional[int] = ... + + _use_datetime: bool + _use_builtin_types: bool + _connection: Tuple[Optional[_HostType], Optional[http.client.HTTPConnection]] + _headers: List[Tuple[str, str]] + _extra_headers: List[Tuple[str, str]] + + if sys.version_info >= (3, 8): + def __init__( + self, use_datetime: bool = ..., use_builtin_types: bool = ..., *, headers: Iterable[Tuple[str, str]] = ... + ) -> None: ... + else: + def __init__(self, use_datetime: bool = ..., use_builtin_types: bool = ...) -> None: ... + def request(self, host: _HostType, handler: str, request_body: bytes, verbose: bool = ...) -> Tuple[_Marshallable, ...]: ... + def single_request( + self, host: _HostType, handler: str, request_body: bytes, verbose: bool = ... + ) -> Tuple[_Marshallable, ...]: ... + def getparser(self) -> Tuple[ExpatParser, Unmarshaller]: ... + def get_host_info(self, host: _HostType) -> Tuple[str, List[Tuple[str, str]], Dict[str, str]]: ... + def make_connection(self, host: _HostType) -> http.client.HTTPConnection: ... + def close(self) -> None: ... + def send_request(self, host: _HostType, handler: str, request_body: bytes, debug: bool) -> http.client.HTTPConnection: ... + def send_headers(self, connection: http.client.HTTPConnection, headers: List[Tuple[str, str]]) -> None: ... + def send_content(self, connection: http.client.HTTPConnection, request_body: bytes) -> None: ... + def parse_response(self, response: http.client.HTTPResponse) -> Tuple[_Marshallable, ...]: ... + +class SafeTransport(Transport): + + if sys.version_info >= (3, 8): + def __init__( + self, + use_datetime: bool = ..., + use_builtin_types: bool = ..., + *, + headers: Iterable[Tuple[str, str]] = ..., + context: Optional[Any] = ..., + ) -> None: ... + else: + def __init__(self, use_datetime: bool = ..., use_builtin_types: bool = ..., *, context: Optional[Any] = ...) -> None: ... + def make_connection(self, host: _HostType) -> http.client.HTTPSConnection: ... + +class ServerProxy: + + __host: str + __handler: str + __transport: Transport + __encoding: str + __verbose: bool + __allow_none: bool + + if sys.version_info >= (3, 8): + def __init__( + self, + uri: str, + transport: Optional[Transport] = ..., + encoding: Optional[str] = ..., + verbose: bool = ..., + allow_none: bool = ..., + use_datetime: bool = ..., + use_builtin_types: bool = ..., + *, + headers: Iterable[Tuple[str, str]] = ..., + context: Optional[Any] = ..., + ) -> None: ... + else: + def __init__( + self, + uri: str, + transport: Optional[Transport] = ..., + encoding: Optional[str] = ..., + verbose: bool = ..., + allow_none: bool = ..., + use_datetime: bool = ..., + use_builtin_types: bool = ..., + *, + context: Optional[Any] = ..., + ) -> None: ... + def __getattr__(self, name: str) -> _Method: ... + @overload + def __call__(self, attr: Literal["close"]) -> Callable[[], None]: ... + @overload + def __call__(self, attr: Literal["transport"]) -> Transport: ... + @overload + def __call__(self, attr: str) -> Union[Callable[[], None], Transport]: ... + def __enter__(self) -> ServerProxy: ... + def __exit__( + self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType] + ) -> None: ... + def __close(self) -> None: ... # undocumented + def __request(self, methodname: str, params: Tuple[_Marshallable, ...]) -> Tuple[_Marshallable, ...]: ... # undocumented + +Server = ServerProxy diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/xmlrpc/server.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/xmlrpc/server.pyi new file mode 100644 index 00000000..8cdcf499 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/xmlrpc/server.pyi @@ -0,0 +1,160 @@ +import http.server +import pydoc +import socketserver +import sys +from datetime import datetime +from typing import Any, Callable, Dict, Iterable, List, Mapping, Optional, Pattern, Protocol, Tuple, Type, Union +from xmlrpc.client import Fault + +_Marshallable = Union[ + None, bool, int, float, str, bytes, tuple, list, dict, datetime +] # TODO: Recursive type on tuple, list, dict + +# The dispatch accepts anywhere from 0 to N arguments, no easy way to allow this in mypy +class _DispatchArity0(Protocol): + def __call__(self) -> _Marshallable: ... + +class _DispatchArity1(Protocol): + def __call__(self, __arg1: _Marshallable) -> _Marshallable: ... + +class _DispatchArity2(Protocol): + def __call__(self, __arg1: _Marshallable, __arg2: _Marshallable) -> _Marshallable: ... + +class _DispatchArity3(Protocol): + def __call__(self, __arg1: _Marshallable, __arg2: _Marshallable, __arg3: _Marshallable) -> _Marshallable: ... + +class _DispatchArity4(Protocol): + def __call__( + self, __arg1: _Marshallable, __arg2: _Marshallable, __arg3: _Marshallable, __arg4: _Marshallable + ) -> _Marshallable: ... + +class _DispatchArityN(Protocol): + def __call__(self, *args: _Marshallable) -> _Marshallable: ... + +_DispatchProtocol = Union[_DispatchArity0, _DispatchArity1, _DispatchArity2, _DispatchArity3, _DispatchArity4, _DispatchArityN] + +def resolve_dotted_attribute(obj: Any, attr: str, allow_dotted_names: bool = ...) -> Any: ... # undocumented +def list_public_methods(obj: Any) -> List[str]: ... # undocumented + +class SimpleXMLRPCDispatcher: # undocumented + + funcs: Dict[str, _DispatchProtocol] + instance: Optional[Any] + allow_none: bool + encoding: str + use_builtin_types: bool + def __init__(self, allow_none: bool = ..., encoding: Optional[str] = ..., use_builtin_types: bool = ...) -> None: ... + def register_instance(self, instance: Any, allow_dotted_names: bool = ...) -> None: ... + if sys.version_info >= (3, 7): + def register_function( + self, function: Optional[_DispatchProtocol] = ..., name: Optional[str] = ... + ) -> Callable[..., Any]: ... + else: + def register_function(self, function: _DispatchProtocol, name: Optional[str] = ...) -> Callable[..., Any]: ... + def register_introspection_functions(self) -> None: ... + def register_multicall_functions(self) -> None: ... + def _marshaled_dispatch( + self, + data: str, + dispatch_method: Optional[ + Callable[[Optional[str], Tuple[_Marshallable, ...]], Union[Fault, Tuple[_Marshallable, ...]]] + ] = ..., + path: Optional[Any] = ..., + ) -> str: ... # undocumented + def system_listMethods(self) -> List[str]: ... # undocumented + def system_methodSignature(self, method_name: str) -> str: ... # undocumented + def system_methodHelp(self, method_name: str) -> str: ... # undocumented + def system_multicall(self, call_list: List[Dict[str, _Marshallable]]) -> List[_Marshallable]: ... # undocumented + def _dispatch(self, method: str, params: Iterable[_Marshallable]) -> _Marshallable: ... # undocumented + +class SimpleXMLRPCRequestHandler(http.server.BaseHTTPRequestHandler): + + rpc_paths: Tuple[str, str] = ... + encode_threshold: int = ... # undocumented + aepattern: Pattern[str] # undocumented + def accept_encodings(self) -> Dict[str, float]: ... + def is_rpc_path_valid(self) -> bool: ... + def do_POST(self) -> None: ... + def decode_request_content(self, data: bytes) -> Optional[bytes]: ... + def report_404(self) -> None: ... + def log_request(self, code: Union[int, str] = ..., size: Union[int, str] = ...) -> None: ... + +class SimpleXMLRPCServer(socketserver.TCPServer, SimpleXMLRPCDispatcher): + + allow_reuse_address: bool = ... + _send_traceback_handler: bool = ... + def __init__( + self, + addr: Tuple[str, int], + requestHandler: Type[SimpleXMLRPCRequestHandler] = ..., + logRequests: bool = ..., + allow_none: bool = ..., + encoding: Optional[str] = ..., + bind_and_activate: bool = ..., + use_builtin_types: bool = ..., + ) -> None: ... + +class MultiPathXMLRPCServer(SimpleXMLRPCServer): # undocumented + + dispatchers: Dict[str, SimpleXMLRPCDispatcher] + allow_none: bool + encoding: str + def __init__( + self, + addr: Tuple[str, int], + requestHandler: Type[SimpleXMLRPCRequestHandler] = ..., + logRequests: bool = ..., + allow_none: bool = ..., + encoding: Optional[str] = ..., + bind_and_activate: bool = ..., + use_builtin_types: bool = ..., + ) -> None: ... + def add_dispatcher(self, path: str, dispatcher: SimpleXMLRPCDispatcher) -> SimpleXMLRPCDispatcher: ... + def get_dispatcher(self, path: str) -> SimpleXMLRPCDispatcher: ... + def _marshaled_dispatch( + self, + data: str, + dispatch_method: Optional[ + Callable[[Optional[str], Tuple[_Marshallable, ...]], Union[Fault, Tuple[_Marshallable, ...]]] + ] = ..., + path: Optional[Any] = ..., + ) -> str: ... + +class CGIXMLRPCRequestHandler(SimpleXMLRPCDispatcher): + def __init__(self, allow_none: bool = ..., encoding: Optional[str] = ..., use_builtin_types: bool = ...) -> None: ... + def handle_xmlrpc(self, request_text: str) -> None: ... + def handle_get(self) -> None: ... + def handle_request(self, request_text: Optional[str] = ...) -> None: ... + +class ServerHTMLDoc(pydoc.HTMLDoc): # undocumented + def docroutine(self, object: object, name: str, mod: Optional[str] = ..., funcs: Mapping[str, str] = ..., classes: Mapping[str, str] = ..., methods: Mapping[str, str] = ..., cl: Optional[type] = ...) -> str: ... # type: ignore + def docserver(self, server_name: str, package_documentation: str, methods: Dict[str, str]) -> str: ... + +class XMLRPCDocGenerator: # undocumented + + server_name: str + server_documentation: str + server_title: str + def __init__(self) -> None: ... + def set_server_title(self, server_title: str) -> None: ... + def set_server_name(self, server_name: str) -> None: ... + def set_server_documentation(self, server_documentation: str) -> None: ... + def generate_html_documentation(self) -> str: ... + +class DocXMLRPCRequestHandler(SimpleXMLRPCRequestHandler): + def do_GET(self) -> None: ... + +class DocXMLRPCServer(SimpleXMLRPCServer, XMLRPCDocGenerator): + def __init__( + self, + addr: Tuple[str, int], + requestHandler: Type[SimpleXMLRPCRequestHandler] = ..., + logRequests: bool = ..., + allow_none: bool = ..., + encoding: Optional[str] = ..., + bind_and_activate: bool = ..., + use_builtin_types: bool = ..., + ) -> None: ... + +class DocCGIXMLRPCRequestHandler(CGIXMLRPCRequestHandler, XMLRPCDocGenerator): + def __init__(self) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/xxlimited.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/xxlimited.pyi new file mode 100644 index 00000000..e4769458 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/xxlimited.pyi @@ -0,0 +1,13 @@ +from typing import Any + +class Null: ... +class Str: ... + +class Xxo: + def demo(self) -> None: ... + +class error: ... + +def foo(__i: int, __j: int) -> Any: ... +def new() -> Xxo: ... +def roj(__b: Any) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/zipapp.pyi b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/zipapp.pyi old mode 100755 new mode 100644 index b90b7559..e1b38e97 --- a/anaconda_lib/jedi/third_party/typeshed/stdlib/3/zipapp.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/stdlib/3/zipapp.pyi @@ -1,16 +1,24 @@ -# Stubs for zipapp (Python 3.5+) - -from pathlib import Path import sys +from pathlib import Path from typing import BinaryIO, Callable, Optional, Union _Path = Union[str, Path, BinaryIO] -class ZipAppError(Exception): ... +class ZipAppError(ValueError): ... if sys.version_info >= (3, 7): - def create_archive(source: _Path, target: Optional[_Path] = ..., interpreter: Optional[str] = ..., main: Optional[str] = ..., - filter: Optional[Callable[[Path], bool]] = ..., compressed: bool = ...) -> None: ... + def create_archive( + source: _Path, + target: Optional[_Path] = ..., + interpreter: Optional[str] = ..., + main: Optional[str] = ..., + filter: Optional[Callable[[Path], bool]] = ..., + compressed: bool = ..., + ) -> None: ... + else: - def create_archive(source: _Path, target: Optional[_Path] = ..., interpreter: Optional[str] = ..., main: Optional[str] = ...) -> None: ... + def create_archive( + source: _Path, target: Optional[_Path] = ..., interpreter: Optional[str] = ..., main: Optional[str] = ... + ) -> None: ... + def get_interpreter(archive: _Path) -> str: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/tests/check_consistent.py b/anaconda_lib/jedi/third_party/typeshed/tests/check_consistent.py new file mode 100755 index 00000000..8abb0961 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/tests/check_consistent.py @@ -0,0 +1,38 @@ +#!/usr/bin/env python3 + +# For various reasons we need the contents of certain files to be +# duplicated in two places, for example stdlib/2/builtins.pyi and +# stdlib/2/__builtin__.pyi must be identical. In the past we used +# symlinks but that doesn't always work on Windows, so now you must +# manually update both files, and this test verifies that they are +# identical. The list below indicates which sets of files must match. + +import filecmp +import os + +consistent_files = [ + {"stdlib/2/builtins.pyi", "stdlib/2/__builtin__.pyi"}, + {"stdlib/2and3/threading.pyi", "stdlib/2and3/_dummy_threading.pyi"}, +] + + +def main(): + files = [os.path.join(root, file) for root, dir, files in os.walk(".") for file in files] + no_symlink = "You cannot use symlinks in typeshed, please copy {} to its link." + for file in files: + _, ext = os.path.splitext(file) + if ext == ".pyi" and os.path.islink(file): + raise ValueError(no_symlink.format(file)) + for file1, *others in consistent_files: + f1 = os.path.join(os.getcwd(), file1) + for file2 in others: + f2 = os.path.join(os.getcwd(), file2) + if not filecmp.cmp(f1, f2): + raise ValueError( + "File {f1} does not match file {f2}. Please copy it to {f2}\n" + "Run either:\ncp {f1} {f2}\nOr:\ncp {f2} {f1}".format(f1=file1, f2=file2) + ) + + +if __name__ == "__main__": + main() diff --git a/anaconda_lib/jedi/third_party/typeshed/tests/mypy_exclude_list.txt b/anaconda_lib/jedi/third_party/typeshed/tests/mypy_exclude_list.txt new file mode 100644 index 00000000..e69de29b diff --git a/anaconda_lib/jedi/third_party/typeshed/tests/mypy_self_check.py b/anaconda_lib/jedi/third_party/typeshed/tests/mypy_self_check.py new file mode 100755 index 00000000..8d8c7792 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/tests/mypy_self_check.py @@ -0,0 +1,39 @@ +#!/usr/bin/env python3 +"""Script to run mypy against its own code base.""" + +import subprocess +import sys +import tempfile +from pathlib import Path + +MYPY_VERSION = "0.790" + + +if __name__ == "__main__": + with tempfile.TemporaryDirectory() as tempdir: + dirpath = Path(tempdir) + subprocess.run( + ["git", "clone", "--depth", "1", "git://github.com/python/mypy", dirpath], + check=True, + ) + try: + subprocess.run([sys.executable, "-m", "pip", "install", f"mypy=={MYPY_VERSION}"], check=True) + subprocess.run([sys.executable, "-m", "pip", "install", "-r", dirpath / "test-requirements.txt"], check=True) + subprocess.run( + [ + "mypy", + "--config-file", + dirpath / "mypy_self_check.ini", + "--custom-typeshed-dir", + ".", + dirpath / "mypy", + dirpath / "mypyc", + ], + check=True, + ) + except subprocess.CalledProcessError as e: + print("mypy self test failed", file=sys.stderr) + sys.exit(e.returncode) + else: + print("mypy self test succeeded", file=sys.stderr) + sys.exit(0) diff --git a/anaconda_lib/jedi/third_party/typeshed/tests/mypy_test.py b/anaconda_lib/jedi/third_party/typeshed/tests/mypy_test.py new file mode 100755 index 00000000..29e9a31c --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/tests/mypy_test.py @@ -0,0 +1,162 @@ +#!/usr/bin/env python3 +"""Test runner for typeshed. + +Depends on mypy being installed. + +Approach: + +1. Parse sys.argv +2. Compute appropriate arguments for mypy +3. Stuff those arguments into sys.argv +4. Run mypy.main('') +5. Repeat steps 2-4 for other mypy runs (e.g. --py2) +""" + +import argparse +import os +import re +import sys + +parser = argparse.ArgumentParser(description="Test runner for typeshed. " "Patterns are unanchored regexps on the full path.") +parser.add_argument("-v", "--verbose", action="count", default=0, help="More output") +parser.add_argument("-n", "--dry-run", action="store_true", help="Don't actually run mypy") +parser.add_argument("-x", "--exclude", type=str, nargs="*", help="Exclude pattern") +parser.add_argument("-p", "--python-version", type=str, nargs="*", help="These versions only (major[.minor])") +parser.add_argument("--platform", help="Run mypy for a certain OS platform (defaults to sys.platform)") +parser.add_argument( + "--warn-unused-ignores", + action="store_true", + help="Run mypy with --warn-unused-ignores " + "(hint: only get rid of warnings that are " + "unused for all platforms and Python versions)", +) + +parser.add_argument("filter", type=str, nargs="*", help="Include pattern (default all)") + + +def log(args, *varargs): + if args.verbose >= 2: + print(*varargs) + + +def match(fn, args, exclude_list): + if exclude_list.match(fn): + log(args, fn, "exluded by exclude list") + return False + if not args.filter and not args.exclude: + log(args, fn, "accept by default") + return True + if args.exclude: + for f in args.exclude: + if re.search(f, fn): + log(args, fn, "excluded by pattern", f) + return False + if args.filter: + for f in args.filter: + if re.search(f, fn): + log(args, fn, "accepted by pattern", f) + return True + if args.filter: + log(args, fn, "rejected (no pattern matches)") + return False + log(args, fn, "accepted (no exclude pattern matches)") + return True + + +def libpath(major, minor): + versions = ["%d.%d" % (major, minor) for minor in reversed(range(minor + 1))] + versions.append(str(major)) + versions.append("2and3") + paths = [] + for v in versions: + for top in ["stdlib", "third_party"]: + p = os.path.join(top, v) + if os.path.isdir(p): + paths.append(p) + return paths + + +def main(): + args = parser.parse_args() + + with open(os.path.join(os.path.dirname(__file__), "mypy_exclude_list.txt")) as f: + exclude_list = re.compile("(%s)$" % "|".join(re.findall(r"^\s*([^\s#]+)\s*(?:#.*)?$", f.read(), flags=re.M))) + + try: + from mypy.main import main as mypy_main + except ImportError: + print("Cannot import mypy. Did you install it?") + sys.exit(1) + + versions = [(3, 9), (3, 8), (3, 7), (3, 6), (3, 5), (2, 7)] + if args.python_version: + versions = [v for v in versions if any(("%d.%d" % v).startswith(av) for av in args.python_version)] + if not versions: + print("--- no versions selected ---") + sys.exit(1) + + code = 0 + runs = 0 + for major, minor in versions: + roots = libpath(major, minor) + files = [] + seen = {"__builtin__", "builtins", "typing"} # Always ignore these. + for root in roots: + names = os.listdir(root) + for name in names: + full = os.path.join(root, name) + mod, ext = os.path.splitext(name) + if mod in seen or mod.startswith("."): + continue + if ext in [".pyi", ".py"]: + if match(full, args, exclude_list): + seen.add(mod) + files.append(full) + elif os.path.isfile(os.path.join(full, "__init__.pyi")) or os.path.isfile(os.path.join(full, "__init__.py")): + for r, ds, fs in os.walk(full): + ds.sort() + fs.sort() + for f in fs: + m, x = os.path.splitext(f) + if x in [".pyi", ".py"]: + fn = os.path.join(r, f) + if match(fn, args, exclude_list): + seen.add(mod) + files.append(fn) + if files: + runs += 1 + flags = ["--python-version", "%d.%d" % (major, minor)] + flags.append("--strict-optional") + flags.append("--no-site-packages") + flags.append("--show-traceback") + flags.append("--no-implicit-optional") + flags.append("--disallow-any-generics") + flags.append("--disallow-subclassing-any") + # Setting custom typeshed dir prevents mypy from falling back to its bundled typeshed in + # case of stub deletions + flags.append("--custom-typeshed-dir") + flags.append(os.path.dirname(os.path.dirname(__file__))) + if args.warn_unused_ignores: + flags.append("--warn-unused-ignores") + if args.platform: + flags.extend(["--platform", args.platform]) + sys.argv = ["mypy"] + flags + files + if args.verbose: + print("running", " ".join(sys.argv)) + else: + print("running mypy", " ".join(flags), "# with", len(files), "files") + try: + if not args.dry_run: + mypy_main("", sys.stdout, sys.stderr) + except SystemExit as err: + code = max(code, err.code) + if code: + print("--- exit status", code, "---") + sys.exit(code) + if not runs: + print("--- nothing to do; exit 1 ---") + sys.exit(1) + + +if __name__ == "__main__": + main() diff --git a/anaconda_lib/jedi/third_party/typeshed/tests/mypy_test_suite.py b/anaconda_lib/jedi/third_party/typeshed/tests/mypy_test_suite.py new file mode 100755 index 00000000..22fc8f85 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/tests/mypy_test_suite.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python3 +"""Script to run mypy's test suite against this version of typeshed.""" + +import shutil +import subprocess +import sys +import tempfile +from pathlib import Path + +if __name__ == "__main__": + with tempfile.TemporaryDirectory() as tempdir: + dirpath = Path(tempdir) + subprocess.run(["git", "clone", "--depth", "1", "git://github.com/python/mypy", dirpath / "mypy"], check=True) + + subprocess.run(["python2.7", "-m", "pip", "install", "--user", "typing"], check=True) + subprocess.run( + [sys.executable, "-m", "pip", "install", "-U", "-r", dirpath / "mypy/test-requirements.txt"], check=True + ) + shutil.copytree("stdlib", dirpath / "mypy/mypy/typeshed/stdlib") + shutil.copytree("third_party", dirpath / "mypy/mypy/typeshed/third_party") + try: + subprocess.run([sys.executable, "runtests.py", "typeshed-ci"], cwd=dirpath / "mypy", check=True) + except subprocess.CalledProcessError as e: + print("mypy tests failed", file=sys.stderr) + sys.exit(e.returncode) + else: + print("mypy tests succeeded", file=sys.stderr) + sys.exit(0) diff --git a/anaconda_lib/jedi/third_party/typeshed/tests/pytype_exclude_list.txt b/anaconda_lib/jedi/third_party/typeshed/tests/pytype_exclude_list.txt new file mode 100644 index 00000000..76064dee --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/tests/pytype_exclude_list.txt @@ -0,0 +1,48 @@ +# Pytype exclude list. Files will not be tested with pytype. + +# pytype has its own version of these files, and thus doesn't mind if it +# can't parse the typeshed version: +stdlib/2/__builtin__.pyi +stdlib/2/builtins.pyi +stdlib/2/typing.pyi +stdlib/3/builtins.pyi +stdlib/3/typing.pyi + +# third_party stubs with constructs that pytype doesn't yet support: +third_party/2/fb303/FacebookService.pyi +third_party/2/scribe/scribe.pyi +third_party/2and3/attr/__init__.pyi +third_party/2and3/attr/converters.pyi +third_party/2and3/attr/filters.pyi +third_party/2and3/attr/validators.pyi +third_party/2and3/paramiko/_winapi.pyi +third_party/2and3/paramiko/win_pageant.pyi +third_party/2and3/pynamodb/models.pyi + +# _pb2.pyi have some constructs that break pytype +# Eg +# pytype.pyi.parser.ParseError: File: "/Users/nipunn/src/typeshed/third_party/2and3/google/protobuf/descriptor_pb2.pyi", line 195 +# b"TypeValue = typing___NewType('TypeValue', builtin___int)" +third_party/2and3/google/protobuf/any_pb2.pyi +third_party/2and3/google/protobuf/api_pb2.pyi +third_party/2and3/google/protobuf/compiler/plugin_pb2.pyi +third_party/2and3/google/protobuf/descriptor.pyi +third_party/2and3/google/protobuf/descriptor_pb2.pyi +third_party/2and3/google/protobuf/duration_pb2.pyi +third_party/2and3/google/protobuf/empty_pb2.pyi +third_party/2and3/google/protobuf/field_mask_pb2.pyi +third_party/2and3/google/protobuf/internal/containers.pyi +third_party/2and3/google/protobuf/internal/enum_type_wrapper.pyi +third_party/2and3/google/protobuf/internal/extension_dict.pyi +third_party/2and3/google/protobuf/json_format.pyi +third_party/2and3/google/protobuf/message.pyi +third_party/2and3/google/protobuf/message_factory.pyi +third_party/2and3/google/protobuf/service.pyi +third_party/2and3/google/protobuf/source_context_pb2.pyi +third_party/2and3/google/protobuf/struct_pb2.pyi +third_party/2and3/google/protobuf/symbol_database.pyi +third_party/2and3/google/protobuf/timestamp_pb2.pyi +third_party/2and3/google/protobuf/type_pb2.pyi +third_party/2and3/google/protobuf/util/json_format_pb2.pyi +third_party/2and3/google/protobuf/util/json_format_proto3_pb2.pyi +third_party/2and3/google/protobuf/wrappers_pb2.pyi diff --git a/anaconda_lib/jedi/third_party/typeshed/tests/pytype_test.py b/anaconda_lib/jedi/third_party/typeshed/tests/pytype_test.py new file mode 100755 index 00000000..898867fd --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/tests/pytype_test.py @@ -0,0 +1,202 @@ +#!/usr/bin/env python3 +"""Test runner for typeshed. + +Depends on pytype being installed. + +If pytype is installed: + 1. For every pyi, do nothing if it is in pytype_exclude_list.txt. + 2. Otherwise, call 'pytype.io.parse_pyi'. +Option two will load the file and all the builtins, typeshed dependencies. This +will also discover incorrect usage of imported modules. +""" + +import argparse +import os +import re +import sys +import traceback +from typing import List, Match, Optional, Sequence, Tuple + +from pytype import config as pytype_config, io as pytype_io + +TYPESHED_SUBDIRS = ["stdlib", "third_party"] + + +TYPESHED_HOME = "TYPESHED_HOME" +UNSET = object() # marker for tracking the TYPESHED_HOME environment variable + + +def main() -> None: + args = create_parser().parse_args() + typeshed_location = args.typeshed_location or os.getcwd() + subdir_paths = [os.path.join(typeshed_location, d) for d in TYPESHED_SUBDIRS] + check_subdirs_discoverable(subdir_paths) + files_to_test = determine_files_to_test(typeshed_location=typeshed_location, paths=args.files or subdir_paths) + run_all_tests( + files_to_test=files_to_test, + typeshed_location=typeshed_location, + print_stderr=args.print_stderr, + dry_run=args.dry_run, + ) + + +def create_parser() -> argparse.ArgumentParser: + parser = argparse.ArgumentParser(description="Pytype/typeshed tests.") + parser.add_argument("-n", "--dry-run", action="store_true", default=False, help="Don't actually run tests") + # Default to '' so that symlinking typeshed subdirs in cwd will work. + parser.add_argument("--typeshed-location", type=str, default="", help="Path to typeshed installation.") + # Set to true to print a stack trace every time an exception is thrown. + parser.add_argument( + "--print-stderr", action="store_true", default=False, help="Print stderr every time an error is encountered." + ) + parser.add_argument( + "files", + metavar="FILE", + type=str, + nargs="*", + help="Files or directories to check. (Default: Check all files.)", + ) + return parser + + +class PathMatcher: + def __init__(self, patterns: Sequence[str]) -> None: + patterns = [re.escape(os.path.join(*x.split("/"))) for x in patterns] + self.matcher = re.compile(r"({})$".format("|".join(patterns))) if patterns else None + + def search(self, path: str) -> Optional[Match[str]]: + if not self.matcher: + return None + return self.matcher.search(path) + + +def load_exclude_list(typeshed_location: str) -> List[str]: + filename = os.path.join(typeshed_location, "tests", "pytype_exclude_list.txt") + skip_re = re.compile(r"^\s*([^\s#]+)\s*(?:#.*)?$") + skip = [] + + with open(filename) as f: + for line in f: + skip_match = skip_re.match(line) + if skip_match: + skip.append(skip_match.group(1)) + + return skip + + +def run_pytype(*, filename: str, python_version: str, typeshed_location: str) -> Optional[str]: + """Runs pytype, returning the stderr if any.""" + options = pytype_config.Options.create( + filename, module_name=_get_module_name(filename), parse_pyi=True, python_version=python_version + ) + old_typeshed_home = os.environ.get(TYPESHED_HOME, UNSET) + os.environ[TYPESHED_HOME] = typeshed_location + try: + pytype_io.parse_pyi(options) + except Exception: + stderr = traceback.format_exc() + else: + stderr = None + if old_typeshed_home is UNSET: + del os.environ[TYPESHED_HOME] + else: + os.environ[TYPESHED_HOME] = old_typeshed_home + return stderr + + +def _get_relative(filename: str) -> str: + top = 0 + for d in TYPESHED_SUBDIRS: + try: + top = filename.index(d) + except ValueError: + continue + else: + break + return filename[top:] + + +def _get_module_name(filename: str) -> str: + """Converts a filename {subdir}/m.n/module/foo to module.foo.""" + return ".".join(_get_relative(filename).split(os.path.sep)[2:]).replace(".pyi", "").replace(".__init__", "") + + +def _is_version(path: str, version: str) -> bool: + return any("{}{}{}".format(d, os.path.sep, version) in path for d in TYPESHED_SUBDIRS) + + +def check_subdirs_discoverable(subdir_paths: List[str]) -> None: + for p in subdir_paths: + if not os.path.isdir(p): + raise SystemExit("Cannot find typeshed subdir at {} (specify parent dir via --typeshed-location)".format(p)) + + +def determine_files_to_test(*, typeshed_location: str, paths: Sequence[str]) -> List[Tuple[str, int]]: + """Determine all files to test, checking if it's in the exclude list and which Python versions to use. + + Returns a list of pairs of the file path and Python version as an int.""" + skipped = PathMatcher(load_exclude_list(typeshed_location)) + filenames = find_stubs_in_paths(paths) + files = [] + for f in sorted(filenames): + rel = _get_relative(f) + if skipped.search(rel): + continue + if _is_version(f, "2and3"): + files.append((f, 2)) + files.append((f, 3)) + elif _is_version(f, "2"): + files.append((f, 2)) + elif _is_version(f, "3"): + files.append((f, 3)) + else: + print("Unrecognized path: {}".format(f)) + return files + + +def find_stubs_in_paths(paths: Sequence[str]) -> List[str]: + filenames = [] + for path in paths: + if os.path.isdir(path): + for root, _, fns in os.walk(path): + filenames.extend(os.path.join(root, fn) for fn in fns if fn.endswith(".pyi")) + else: + filenames.append(path) + return filenames + + +def run_all_tests(*, files_to_test: Sequence[Tuple[str, int]], typeshed_location: str, print_stderr: bool, dry_run: bool) -> None: + bad = [] + errors = 0 + total_tests = len(files_to_test) + print("Testing files with pytype...") + for i, (f, version) in enumerate(files_to_test): + stderr = ( + run_pytype( + filename=f, + python_version="2.7" if version == 2 else "{0.major}.{0.minor}".format(sys.version_info), + typeshed_location=typeshed_location, + ) + if not dry_run + else None + ) + if stderr: + if print_stderr: + print(stderr) + errors += 1 + stacktrace_final_line = stderr.rstrip().rsplit("\n", 1)[-1] + bad.append((_get_relative(f), stacktrace_final_line)) + + runs = i + 1 + if runs % 25 == 0: + print(" {:3d}/{:d} with {:3d} errors".format(runs, total_tests, errors)) + + print("Ran pytype with {:d} pyis, got {:d} errors.".format(total_tests, errors)) + for f, err in bad: + print("{}: {}".format(f, err)) + if errors: + raise SystemExit("\nRun again with --print-stderr to get the full stacktrace.") + + +if __name__ == "__main__": + main() diff --git a/anaconda_lib/jedi/third_party/typeshed/tests/stubtest_test.py b/anaconda_lib/jedi/third_party/typeshed/tests/stubtest_test.py new file mode 100755 index 00000000..18d6c5e0 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/tests/stubtest_test.py @@ -0,0 +1,77 @@ +#!/usr/bin/env python3 +"""Test typeshed using stubtest + +stubtest is a script in the mypy project that compares stubs to the actual objects at runtime. +Note that therefore the output of stubtest depends on which Python version it is run with. +In typeshed CI, we run stubtest with each currently supported Python minor version, except 2.7. + +We pin the version of mypy / stubtest we use in .travis.yml so changes to those don't break +typeshed CI. + +""" + +import subprocess +import sys +from pathlib import Path + + +def run_stubtest(typeshed_dir: Path) -> int: + whitelist_dir = typeshed_dir / "tests" / "stubtest_whitelists" + version_whitelist = "py{}{}.txt".format(sys.version_info.major, sys.version_info.minor) + platform_whitelist = "{}.txt".format(sys.platform) + combined_whitelist = "{}-py{}{}.txt".format(sys.platform, sys.version_info.major, sys.version_info.minor) + + ignore_unused_whitelist = "--ignore-unused-whitelist" in sys.argv[1:] + + cmd = [ + sys.executable, + "-m", + "mypy.stubtest", + # Use --ignore-missing-stub, because if someone makes a correct addition, they'll need to + # also make a whitelist change and if someone makes an incorrect addition, they'll run into + # false negatives. + "--ignore-missing-stub", + "--check-typeshed", + "--custom-typeshed-dir", + str(typeshed_dir), + "--whitelist", + str(whitelist_dir / "py3_common.txt"), + "--whitelist", + str(whitelist_dir / version_whitelist), + ] + if ignore_unused_whitelist: + cmd += ["--ignore-unused-whitelist"] + if (whitelist_dir / platform_whitelist).exists(): + cmd += [ + "--whitelist", + str(whitelist_dir / platform_whitelist), + ] + if (whitelist_dir / combined_whitelist).exists(): + cmd += [ + "--whitelist", + str(whitelist_dir / combined_whitelist), + ] + if sys.version_info < (3, 9): + # As discussed in https://github.com/python/typeshed/issues/3693, we only aim for + # positional-only arg accuracy for the latest Python version. + cmd += ["--ignore-positional-only"] + try: + print(" ".join(cmd), file=sys.stderr) + subprocess.run(cmd, check=True) + except subprocess.CalledProcessError as e: + print( + "\nNB: stubtest output depends on the Python version (and system) it is run with. " + "See README.md for more details.\n" + "NB: We only check positional-only arg accuracy for Python 3.9.\n" + "\nCommand run was: {}\n".format(" ".join(cmd)), + file=sys.stderr, + ) + print("stubtest failed", file=sys.stderr) + return e.returncode + else: + print("stubtest succeeded", file=sys.stderr) + return 0 + + +if __name__ == "__main__": + sys.exit(run_stubtest(typeshed_dir=Path("."))) diff --git a/anaconda_lib/jedi/third_party/typeshed/tests/stubtest_unused.py b/anaconda_lib/jedi/third_party/typeshed/tests/stubtest_unused.py new file mode 100755 index 00000000..50a17e34 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/tests/stubtest_unused.py @@ -0,0 +1,52 @@ +#!/usr/bin/env python3 + +# Runs stubtest and prints each unused whitelist entry with filename. + +import os.path +import subprocess +import sys +from typing import List, Tuple + +_UNUSED_NOTE = "note: unused allowlist entry " +_WHITELIST_PATH = os.path.join("tests", "stubtest_whitelists") + + +def main() -> int: + unused = run_stubtest() + with_filenames = [] + for uu in unused: + with_filenames.extend(unused_files(uu)) + for file, uu in with_filenames: + print(file + ":" + uu) + return 1 if with_filenames else 0 + + +def run_stubtest() -> List[str]: + proc = subprocess.run(["./tests/stubtest_test.py"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + output = proc.stdout.decode("utf-8").splitlines() + return [line[len(_UNUSED_NOTE) :].strip() for line in output if line.startswith(_UNUSED_NOTE)] + + +def unused_files(unused: str) -> List[Tuple[str, str]]: + version = "py{}{}".format(sys.version_info[0], sys.version_info[1]) + files = ["py3_common.txt", version + ".txt", sys.platform + ".txt", sys.platform + "-" + version + ".txt"] + found = [] + for file in files: + path = os.path.join(_WHITELIST_PATH, file) + if find_unused_in_file(unused, path): + found.append((path, unused)) + if not found: + raise ValueError("unused item {} not found in any whitelist file".format(unused)) + return found + + +def find_unused_in_file(unused: str, path: str) -> bool: + try: + with open(path) as f: + return any(line.strip().split(" ")[0] == unused for line in f) + except FileNotFoundError: + return False + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/anaconda_lib/jedi/third_party/typeshed/tests/stubtest_whitelists/linux-py36.txt b/anaconda_lib/jedi/third_party/typeshed/tests/stubtest_whitelists/linux-py36.txt new file mode 100644 index 00000000..e7b8e1ed --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/tests/stubtest_whitelists/linux-py36.txt @@ -0,0 +1,5 @@ +asyncio.unix_events._UnixSelectorEventLoop.create_unix_server +ctypes.wintypes +pwd.getpwnam +ssl.PROTOCOL_SSLv3 +ssl.RAND_egd diff --git a/anaconda_lib/jedi/third_party/typeshed/tests/stubtest_whitelists/linux-py37.txt b/anaconda_lib/jedi/third_party/typeshed/tests/stubtest_whitelists/linux-py37.txt new file mode 100644 index 00000000..6754d36e --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/tests/stubtest_whitelists/linux-py37.txt @@ -0,0 +1,4 @@ +ctypes.wintypes +pwd.getpwnam +time.CLOCK_PROF +time.CLOCK_UPTIME diff --git a/anaconda_lib/jedi/third_party/typeshed/tests/stubtest_whitelists/linux-py38.txt b/anaconda_lib/jedi/third_party/typeshed/tests/stubtest_whitelists/linux-py38.txt new file mode 100644 index 00000000..3eeef9f7 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/tests/stubtest_whitelists/linux-py38.txt @@ -0,0 +1,5 @@ +ctypes.wintypes +os.MFD_HUGE_32MB +os.MFD_HUGE_512MB +time.CLOCK_PROF +time.CLOCK_UPTIME diff --git a/anaconda_lib/jedi/third_party/typeshed/tests/stubtest_whitelists/linux.txt b/anaconda_lib/jedi/third_party/typeshed/tests/stubtest_whitelists/linux.txt new file mode 100644 index 00000000..f5c4569d --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/tests/stubtest_whitelists/linux.txt @@ -0,0 +1,55 @@ +_posixsubprocess.cloexec_pipe +builtins.WindowsError +curses.COLORS +curses.COLOR_PAIRS +curses.COLS +curses.LINES +distutils.command.bdist_msi +grp.getgrgid +grp.struct_group._asdict +grp.struct_group._make +grp.struct_group._replace +ntpath.realpath +os.EX_NOTFOUND +os.SF_MNOWAIT +os.SF_NODISKIO +os.SF_SYNC +os.chflags +os.lchflags +os.lchmod +os.listxattr +os.plock +posix.EX_NOTFOUND +select.EPOLL_RDHUP +socket.socketpair +spwd.getspnam +spwd.struct_spwd._asdict +spwd.struct_spwd._make +spwd.struct_spwd._replace +time.CLOCK_HIGHRES +urllib.request.proxy_bypass + +# ========== +# Whitelist entries that cannot or should not be fixed +# ========== + +# Modules that do not exist on Linux systems +_msi +_winapi +asyncio.windows_events +asyncio.windows_utils +msilib(.[a-z]+)? +msvcrt +winreg +winsound + +# NamedTuple like, but not actually NamedTuples +posix.[a-z]+_(param|result)._(asdict|make|replace) + +# Platform differences that cannot be captured by the type system +fcntl.[A-Z0-9_]+ +os.SCHED_[A-Z_]+ + +# Loadable SQLite extensions are disabled on GitHub runners +(sqlite3(.dbapi2)?.Connection.enable_load_extension)? +(sqlite3(.dbapi2)?.Connection.load_extension)? diff --git a/anaconda_lib/jedi/third_party/typeshed/tests/stubtest_whitelists/py36.txt b/anaconda_lib/jedi/third_party/typeshed/tests/stubtest_whitelists/py36.txt new file mode 100644 index 00000000..9f56f014 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/tests/stubtest_whitelists/py36.txt @@ -0,0 +1,84 @@ +asyncio.Future.__init__ +asyncio.exceptions # Added in Python 3.8 +asyncio.format_helpers # Added in Python 3.7 +asyncio.futures.Future.__init__ +asyncio.futures._TracebackLogger.__init__ +asyncio.runners +asyncio.staggered # Added in Python 3.8 +asyncio.threads # Added in Python 3.9 +asyncio.trsock # Added in Python 3.8 +builtins.str.maketrans +cmath.log +codecs.StreamRecoder.seek +collections.AsyncGenerator.ag_await +collections.AsyncGenerator.ag_code +collections.AsyncGenerator.ag_frame +collections.AsyncGenerator.ag_running +collections.UserString.maketrans +collections.abc.AsyncGenerator.ag_await +collections.abc.AsyncGenerator.ag_code +collections.abc.AsyncGenerator.ag_frame +collections.abc.AsyncGenerator.ag_running +contextlib._GeneratorContextManager.__init__ +copy.PyStringMap +ctypes.CDLL.__init__ +email.message.MIMEPart.as_string +enum.Enum._generate_next_value_ +fractions.Fraction.__new__ # overload is too complicated for stubtest to resolve +hmac.HMAC.__init__ +importlib.metadata +importlib.resources +io.StringIO.readline +ipaddress._BaseNetwork.__init__ +json.loads +mmap.ACCESS_DEFAULT +multiprocessing.shared_memory +nntplib._NNTPBase.starttls +os.utime +plistlib.Dict.__init__ +pyexpat.XMLParserType.ExternalEntityParserCreate +random.Random.randrange # missing undocumented arg _int +random.randrange # missing undocumented arg _int +secrets.SystemRandom.getstate +smtplib.SMTP.sendmail +sre_compile.dis +ssl.SSLSocket.__init__ +typing.AsyncGenerator.ag_await +typing.AsyncGenerator.ag_code +typing.AsyncGenerator.ag_frame +typing.AsyncGenerator.ag_running +typing.Coroutine.cr_await +typing.Coroutine.cr_code +typing.Coroutine.cr_frame +typing.Coroutine.cr_running +typing.Generator.__new__ +typing.Generator.gi_code +typing.Generator.gi_frame +typing.Generator.gi_running +typing.Generator.gi_yieldfrom +typing.GenericMeta.__new__ +typing.IO.closed # Incorrect definition in CPython, fixed in bpo-39493 +typing.Mapping.get +typing.NamedTuple.__new__ +typing.NamedTuple._asdict +typing.NamedTuple._make +typing.NamedTuple._replace +typing.Sequence.index +typing.runtime_checkable +unittest.async_case # Added in Python 3.8 +urllib.parse.parse_qs +urllib.parse.parse_qsl +uuid.UUID.int +webbrowser.Opera.raise_opts +xml.etree.ElementTree.TreeBuilder.start # Discrepancy between Python and C modules, fixed in bpo-39495 +xml.etree.cElementTree.TreeBuilder.start # bpo-39495 +xml.parsers.expat.XMLParserType.ExternalEntityParserCreate +# These enums derive from (int, IntEnum) or (str, Enum). See comment in py3_common.txt +enum.IntFlag.__new__ +re.RegexFlag.__new__ +socket.AddressInfo.__new__ +socket.MsgFlag.__new__ +ssl.Options.__new__ +ssl.VerifyFlags.__new__ +ssl.VerifyMode.__new__ +tkinter.EventType.__new__ diff --git a/anaconda_lib/jedi/third_party/typeshed/tests/stubtest_whitelists/py37.txt b/anaconda_lib/jedi/third_party/typeshed/tests/stubtest_whitelists/py37.txt new file mode 100644 index 00000000..8319eb0b --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/tests/stubtest_whitelists/py37.txt @@ -0,0 +1,82 @@ +asyncio.AbstractEventLoop.sock_sendfile +asyncio.compat # Removed in 3.7 +asyncio.Future.__init__ +asyncio.Future._callbacks +asyncio.events.AbstractEventLoop.sock_sendfile +asyncio.exceptions # Added in Python 3.8 +asyncio.futures.Future.__init__ +asyncio.futures.Future._callbacks +asyncio.staggered # Added in Python 3.8 +asyncio.threads # Added in Python 3.9 +asyncio.trsock # Added in Python 3.8 +builtins.dict.get +builtins.str.maketrans +cmath.log +collections.AsyncGenerator.ag_await +collections.AsyncGenerator.ag_code +collections.AsyncGenerator.ag_frame +collections.AsyncGenerator.ag_running +collections.UserString.maketrans +collections.abc.AsyncGenerator.ag_await +collections.abc.AsyncGenerator.ag_code +collections.abc.AsyncGenerator.ag_frame +collections.abc.AsyncGenerator.ag_running +contextvars.Context.__init__ +contextvars.Context.get +contextvars.ContextVar.get +copy.PyStringMap +ctypes.CDLL.__init__ +dataclasses.Field.__init__ +dataclasses.field +email.message.MIMEPart.as_string +enum.Enum._generate_next_value_ +fractions.Fraction.__new__ # overload is too complicated for stubtest to resolve +hmac.HMAC.__init__ +http.client.HTTPSConnection.__init__ +http.server.SimpleHTTPRequestHandler.__init__ +importlib.metadata +ipaddress._BaseNetwork.__init__ +json.loads +macurl2path # removed in 3.7 +multiprocessing.shared_memory +nntplib._NNTPBase.starttls +os.utime +pyexpat.XMLParserType.ExternalEntityParserCreate +queue.SimpleQueue.__init__ +random.Random.randrange # missing undocumented arg _int +random.randrange # missing undocumented arg _int +secrets.SystemRandom.getstate +smtplib.SMTP.sendmail +sre_constants.RANGE_IGNORE +ssl.PROTOCOL_SSLv3 +ssl.RAND_egd +types.ClassMethodDescriptorType.__get__ +types.MethodDescriptorType.__get__ +types.WrapperDescriptorType.__get__ +typing.NamedTuple._asdict +typing.NamedTuple._make +typing.NamedTuple._replace +typing._SpecialForm.__init__ +typing._SpecialForm.__new__ +typing.runtime_checkable +unittest.async_case # Added in Python 3.8 +urllib.parse.parse_qs +urllib.parse.parse_qsl +uuid.UUID.int +uuid.UUID.is_safe +uuid.getnode # undocumented, unused parameter getters that was later removed +webbrowser.Opera.raise_opts +xml.etree.ElementTree.TreeBuilder.start # Discrepancy between Python and C modules, fixed in bpo-39495 +xml.etree.cElementTree.TreeBuilder.start # bpo-39495 +xml.parsers.expat.XMLParserType.ExternalEntityParserCreate +# These enums derive from (int, IntEnum) or (str, Enum). See comment in py3_common.txt +enum.IntFlag.__new__ +pstats.SortKey.__new__ +re.RegexFlag.__new__ +socket.AddressInfo.__new__ +socket.MsgFlag.__new__ +ssl.Options.__new__ +ssl.TLSVersion.__new__ +ssl.VerifyFlags.__new__ +ssl.VerifyMode.__new__ +tkinter.EventType.__new__ diff --git a/anaconda_lib/jedi/third_party/typeshed/tests/stubtest_whitelists/py38.txt b/anaconda_lib/jedi/third_party/typeshed/tests/stubtest_whitelists/py38.txt new file mode 100644 index 00000000..69944340 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/tests/stubtest_whitelists/py38.txt @@ -0,0 +1,112 @@ +ast.Bytes.__new__ +ast.Ellipsis.__new__ +ast.NameConstant.__new__ +ast.Num.__new__ +ast.Str.__new__ +asyncio.AbstractEventLoop.sock_sendfile +asyncio.compat # removed in 3.7 +asyncio.Future.__init__ +asyncio.Future._callbacks +asyncio.events.AbstractEventLoop.sock_sendfile +asyncio.futures.Future.__init__ +asyncio.futures.Future._callbacks +asyncio.proactor_events._ProactorBasePipeTransport.__del__ +asyncio.run # Bugfix involving this was backported to 3.8 +asyncio.runners.run # It just hasn't been released yet +asyncio.threads # Added in Python 3.9 +builtins.dict.get +collections.AsyncGenerator.ag_await +collections.AsyncGenerator.ag_code +collections.AsyncGenerator.ag_frame +collections.AsyncGenerator.ag_running +collections.ItemsView.__reversed__ +collections.KeysView.__reversed__ +collections.ValuesView.__reversed__ +collections.abc.AsyncGenerator.ag_await +collections.abc.AsyncGenerator.ag_code +collections.abc.AsyncGenerator.ag_frame +collections.abc.AsyncGenerator.ag_running +collections.abc.ItemsView.__reversed__ +collections.abc.KeysView.__reversed__ +collections.abc.ValuesView.__reversed__ +contextvars.Context.__init__ +contextvars.Context.get +copy.PyStringMap +dataclasses.Field.__init__ +dataclasses.InitVar.__init__ +dataclasses.field +email.message.MIMEPart.as_string +enum.Enum._generate_next_value_ +fractions.Fraction.__new__ # overload is too complicated for stubtest to resolve +functools.partialmethod.__get__ +functools.singledispatchmethod.__call__ # A lie to reflect that the descriptor get returns a callable +gettext.install +gettext.translation +hmac.new # Stub is a white lie; see comments in the stub +http.client.HTTPSConnection.__init__ +http.cookiejar.DefaultCookiePolicy.__init__ +http.server.SimpleHTTPRequestHandler.__init__ +importlib.metadata.DistributionFinder.Context.pattern +importlib.metadata.EntryPointBase +ipaddress.IPv4Interface.hostmask +ipaddress.IPv6Interface.hostmask +ipaddress._BaseNetwork.broadcast_address +ipaddress._BaseNetwork.hostmask +macpath +macurl2path # removed in 3.7 +mmap.MADV_[A-Z_]+ +multiprocessing.managers.SharedMemoryServer.__init__ +multiprocessing.pool.CLOSE +multiprocessing.pool.RUN +multiprocessing.pool.TERMINATE +multiprocessing.spawn._main +nntplib._NNTPBase.starttls +pickle.Pickler.reducer_override +platform.DEV_NULL +queue.SimpleQueue.__init__ +random.Random.randrange # missing undocumented arg _int +random.randrange # missing undocumented arg _int +secrets.SystemRandom.getstate +select.epoll.register +smtplib.SMTP.sendmail +sre_constants.RANGE_IGNORE +ssl.PROTOCOL_SSLv3 +ssl.RAND_egd +sys.UnraisableHookArgs +types.ClassMethodDescriptorType.__get__ +types.CodeType.replace +types.MethodDescriptorType.__get__ +types.WrapperDescriptorType.__get__ +typing.NamedTuple.__new__ +typing.NamedTuple._asdict +typing.NamedTuple._make +typing.NamedTuple._replace +typing.SupportsAbs.__init__ +typing.SupportsBytes.__init__ +typing.SupportsComplex.__init__ +typing.SupportsFloat.__init__ +typing.SupportsIndex.__init__ +typing.SupportsInt.__init__ +typing.SupportsRound.__init__ +typing._SpecialForm.__init__ +typing._SpecialForm.__new__ +unittest.doModuleCleanups +uuid.getnode # undocumented, unused parameter getters that was later removed +weakref.WeakValueDictionary.update +webbrowser.Opera.raise_opts +xml.etree.ElementTree.TreeBuilder.start # Discrepancy between Python and C modules, fixed in bpo-39495 +xml.etree.ElementTree.XMLParser.__init__ +xml.etree.cElementTree.TreeBuilder.start # bpo-39495 +xml.etree.cElementTree.XMLParser.__init__ +zipfile.Path.open +# These enums derive from (int, IntEnum) or (str, Enum). See comment in py3_common.txt +enum.IntFlag.__new__ +pstats.SortKey.__new__ +re.RegexFlag.__new__ +socket.AddressInfo.__new__ +socket.MsgFlag.__new__ +ssl.Options.__new__ +ssl.TLSVersion.__new__ +ssl.VerifyFlags.__new__ +ssl.VerifyMode.__new__ +tkinter.EventType.__new__ diff --git a/anaconda_lib/jedi/third_party/typeshed/tests/stubtest_whitelists/py39.txt b/anaconda_lib/jedi/third_party/typeshed/tests/stubtest_whitelists/py39.txt new file mode 100644 index 00000000..0c97dcd8 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/tests/stubtest_whitelists/py39.txt @@ -0,0 +1,192 @@ +_ast.ImportFrom.level +_dummy_thread +ast.Bytes.__new__ +ast.Ellipsis.__new__ +ast.ExtSlice.__new__ +ast.ImportFrom.level +ast.Index.__new__ +ast.NameConstant.__new__ +ast.Num.__new__ +ast.Str.__new__ +asyncio.AbstractEventLoop.sock_sendfile +asyncio.compat # module removed in 3.7 +asyncio.Future.__init__ +asyncio.Future._callbacks +asyncio.events.AbstractEventLoop.sock_sendfile +asyncio.futures.Future.__init__ +asyncio.futures.Future._callbacks +asyncio.proactor_events._ProactorBasePipeTransport.__del__ +builtins.dict.get +collections.AsyncGenerator.ag_await +collections.AsyncGenerator.ag_code +collections.AsyncGenerator.ag_frame +collections.AsyncGenerator.ag_running +collections.ItemsView.__reversed__ +collections.KeysView.__reversed__ +collections.ValuesView.__reversed__ +collections.abc.AsyncGenerator.ag_await +collections.abc.AsyncGenerator.ag_code +collections.abc.AsyncGenerator.ag_frame +collections.abc.AsyncGenerator.ag_running +collections.abc.ItemsView.__reversed__ +collections.abc.KeysView.__reversed__ +collections.abc.ValuesView.__reversed__ +contextvars.Context.__init__ +contextvars.Context.get +copy.PyStringMap +dataclasses.Field.__init__ +dataclasses.InitVar.__init__ +dataclasses.field +dummy_threading +email.message.MIMEPart.as_string +enum.Enum._generate_next_value_ +fractions.Fraction.__new__ # overload is too complicated for stubtest to resolve +ftplib.FTP.__init__ +ftplib.FTP_TLS.__init__ +functools.partialmethod.__get__ +functools.singledispatchmethod.__call__ +gettext.install +gettext.translation +hmac.new # Stub is a white lie; see comments in the stub +http.client.HTTPSConnection.__init__ +http.cookiejar.DefaultCookiePolicy.__init__ +http.server.SimpleHTTPRequestHandler.__init__ +importlib.abc.Traversable.__init__ # Inherits __init__ from typing.Protocol +importlib.metadata.DistributionFinder.Context.pattern +importlib.metadata.EntryPointBase +ipaddress.IPv4Interface.hostmask +ipaddress.IPv6Interface.hostmask +ipaddress._BaseNetwork.broadcast_address +ipaddress._BaseNetwork.hostmask +logging.FileHandler.__init__ +logging.handlers.BaseRotatingHandler.__init__ +logging.handlers.RotatingFileHandler.__init__ +logging.handlers.TimedRotatingFileHandler.__init__ +logging.handlers.WatchedFileHandler.__init__ +macpath # module removed in 3.8 +macurl2path # module removed in 3.7 +mmap.MADV_[A-Z_]+ # platform dependent constants +multiprocessing.managers.SharedMemoryServer.__init__ +multiprocessing.pool.CLOSE +multiprocessing.pool.RUN +multiprocessing.pool.TERMINATE +multiprocessing.spawn._main +nntplib.NNTP.starttls +os.MFD_HUGE_32MB +os.MFD_HUGE_512MB +os.getgrouplist +os.sendfile +pickle.Pickler.reducer_override +# platform.uname_result's processor field is now dynamically made to exist +platform.uname_result.__new__ +platform.uname_result._fields +platform.uname_result.processor +queue.SimpleQueue.__init__ +secrets.SystemRandom.getstate +select.epoll.register +smtplib.LMTP.__init__ +smtplib.SMTP.sendmail +sre_constants.RANGE_IGNORE +ssl.AF_INET +ssl.PROTOCOL_SSLv3 +ssl.RAND_egd +symtable.SymbolTable.has_exec +sys.UnraisableHookArgs +time.CLOCK_PROF +time.CLOCK_UPTIME +types.ClassMethodDescriptorType.__get__ +types.CodeType.replace +types.GenericAlias.__getattr__ +types.MethodDescriptorType.__get__ +types.WrapperDescriptorType.__get__ +typing.ForwardRef._evaluate +typing.SupportsAbs.__init__ +typing.SupportsBytes.__init__ +typing.SupportsComplex.__init__ +typing.SupportsFloat.__init__ +typing.SupportsIndex.__init__ +typing.SupportsInt.__init__ +typing.SupportsRound.__init__ +typing._SpecialForm.__init__ +typing._TypedDict.__delitem__ +typing._TypedDict.copy +typing._TypedDict.items +typing._TypedDict.keys +typing._TypedDict.pop +typing._TypedDict.setdefault +typing._TypedDict.update +typing._TypedDict.values +unittest.doModuleCleanups +weakref.WeakValueDictionary.update +webbrowser.Opera.raise_opts +xml.etree.ElementTree.XMLParser.__init__ +xml.etree.cElementTree.XMLParser.__init__ + +# positional-only complaints +builtins.bytearray.pop +builtins.bytearray.remove +bz2.BZ2Compressor.compress +bz2.BZ2File.read +bz2.BZ2File.read1 +bz2.BZ2File.readline +bz2.BZ2File.seek +collections.AsyncGenerator.asend +collections.AsyncGenerator.athrow +collections.Container.__contains__ +collections.Coroutine.send +collections.Coroutine.throw +collections.Generator.send +collections.Generator.throw +collections.OrderedDict.fromkeys +collections.OrderedDict.setdefault +collections.abc.AsyncGenerator.asend +collections.abc.AsyncGenerator.athrow +collections.abc.Container.__contains__ +collections.abc.Coroutine.send +collections.abc.Coroutine.throw +collections.abc.Generator.send +collections.abc.Generator.throw +contextlib.AsyncExitStack.callback +contextlib.AsyncExitStack.push_async_callback +contextlib.ExitStack.callback +contextvars.ContextVar.reset +contextvars.ContextVar.set +dataclasses.dataclass +dataclasses.replace +io.IncrementalNewlineDecoder.setstate +itertools.tee +lzma.LZMACompressor.compress +lzma.is_check_supported +os.initgroups +os.pipe2 +os.posix_fadvise +os.posix_fallocate +os.sched_getaffinity +os.sched_getparam +os.sched_getscheduler +os.sched_rr_get_interval +os.sched_setaffinity +os.sched_setparam +os.sched_setscheduler +os.setresgid +os.setresuid +os.waitid +pwd.getpwnam +pwd.getpwuid +random.SystemRandom.getrandbits +secrets.SystemRandom.getrandbits +signal.sigtimedwait +signal.sigwaitinfo +trace.Trace.runfunc +zipfile.ZipExtFile.seek +# These enums derive from (int, IntEnum) or (str, Enum). See comment in py3_common.txt +enum.IntFlag.__new__ +pstats.SortKey.__new__ +re.RegexFlag.__new__ +socket.AddressInfo.__new__ +socket.MsgFlag.__new__ +ssl.Options.__new__ +ssl.TLSVersion.__new__ +ssl.VerifyFlags.__new__ +ssl.VerifyMode.__new__ +tkinter.EventType.__new__ diff --git a/anaconda_lib/jedi/third_party/typeshed/tests/stubtest_whitelists/py3_common.txt b/anaconda_lib/jedi/third_party/typeshed/tests/stubtest_whitelists/py3_common.txt new file mode 100644 index 00000000..efe45169 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/tests/stubtest_whitelists/py3_common.txt @@ -0,0 +1,463 @@ +__future__._Feature.__init__ +_csv.Dialect.__init__ +_dummy_threading +_importlib_modulespec +_operator.methodcaller +_threading_local.local.__new__ +_typeshed.* # Utility types for typeshed, doesn't exist at runtime +_weakref.CallableProxyType.__getattr__ +_weakref.ProxyType.__getattr__ +_weakref.ReferenceType.__call__ +abc.ABCMeta.__new__ +abc.abstractclassmethod +abc.abstractmethod +abc.abstractstaticmethod +argparse.Namespace.__getattr__ # The whole point of this class is its attributes are dynamic +asyncio.BaseEventLoop.subprocess_exec +asyncio.Condition.acquire +asyncio.Condition.locked +asyncio.Condition.release +asyncio.Task.get_stack +asyncio.Task.print_stack +asyncio.base_events.BaseEventLoop.subprocess_exec +asyncio.base_events.Server.__init__ +asyncio.locks.Condition.acquire +asyncio.locks.Condition.locked +asyncio.locks.Condition.release +asyncio.proactor_events.BaseProactorEventLoop.sock_recv +asyncio.selector_events.BaseSelectorEventLoop.sock_recv +asyncio.streams.FlowControlMixin.__init__ +asyncio.tasks.Task.get_stack +asyncio.tasks.Task.print_stack +builtins.bytearray.__float__ +builtins.bytearray.__int__ +builtins.bytearray.append +builtins.bytearray.extend +builtins.bytearray.maketrans +builtins.bytes.__float__ +builtins.bytes.__int__ +builtins.bytes.maketrans +builtins.classmethod.__get__ +builtins.complex.__complex__ +builtins.ellipsis +builtins.function +builtins.memoryview.__contains__ +builtins.memoryview.__iter__ +builtins.memoryview.cast +builtins.object.__init__ +builtins.property.__get__ +builtins.property.fdel +builtins.property.fget +builtins.property.fset +builtins.staticmethod.__get__ +bz2.BZ2Decompressor.__init__ +bz2.BZ2File.readinto +bz2.BZ2File.readlines +bz2.BZ2File.write +bz2.BZ2File.writelines +codecs.BufferedIncrementalDecoder.decode +codecs.CodecInfo.decode +codecs.CodecInfo.encode +codecs.CodecInfo.incrementaldecoder +codecs.CodecInfo.incrementalencoder +codecs.CodecInfo.streamreader +codecs.CodecInfo.streamwriter +codecs.IncrementalEncoder.encode +codecs.StreamReader.__getattr__ +codecs.StreamReader.readline +codecs.StreamReader.readlines +codecs.StreamWriter.__getattr__ +codecs.StreamWriter.write +codecs.utf_16_be_decode +codecs.utf_16_be_encode +collections.Callable +collections.ChainMap.get +collections.ChainMap.maps +collections.ChainMap.new_child +collections.Coroutine.cr_await +collections.Coroutine.cr_code +collections.Coroutine.cr_frame +collections.Coroutine.cr_running +collections.Counter.fromkeys +collections.Generator.gi_code +collections.Generator.gi_frame +collections.Generator.gi_running +collections.Generator.gi_yieldfrom +collections.Mapping.get +collections.Sequence.index +collections.abc.Callable +collections.abc.Coroutine.cr_await +collections.abc.Coroutine.cr_code +collections.abc.Coroutine.cr_frame +collections.abc.Coroutine.cr_running +collections.abc.Generator.gi_code +collections.abc.Generator.gi_frame +collections.abc.Generator.gi_running +collections.abc.Generator.gi_yieldfrom +collections.abc.Mapping.get +collections.abc.Sequence.index +collections.deque.__hash__ +configparser.LegacyInterpolation.before_get +configparser.SectionProxy.__getattr__ +configparser.SectionProxy.getboolean +configparser.SectionProxy.getfloat +configparser.SectionProxy.getint +csv.Dialect.delimiter +csv.Dialect.doublequote +csv.Dialect.lineterminator +csv.Dialect.quoting +csv.Dialect.skipinitialspace +ctypes.Array.__iter__ +ctypes.CDLL._FuncPtr +ctypes.cast +ctypes.memmove +ctypes.memset +ctypes.pointer +ctypes.string_at +ctypes.wstring_at +dbm.error +difflib.SequenceMatcher.__init__ +distutils.archive_util.make_archive +distutils.archive_util.make_tarball +distutils.command.bdist_packager +distutils.core.Extension.__init__ +distutils.debug.DEBUG +distutils.extension.Extension.__init__ +distutils.fancy_getopt.OptionDummy.__init__ +distutils.filelist.FileList.__init__ +distutils.sysconfig.set_python_build +distutils.text_file.TextFile.warn +distutils.version.Version._cmp +distutils.version.Version.parse +email.errors.MessageDefect.__init__ +email.generator.BytesGenerator.__init__ +email.generator.DecodedGenerator.__init__ +email.generator.Generator.__init__ +email.headerregistry.AddressHeader.parse +email.headerregistry.BaseHeader.init +email.headerregistry.BaseHeader.max_count +email.headerregistry.ContentTransferEncodingHeader.parse +email.headerregistry.DateHeader.parse +email.headerregistry.HeaderRegistry.__init__ +email.headerregistry.MIMEVersionHeader.parse +email.headerregistry.ParameterizedMIMEHeader.parse +email.headerregistry.UnstructuredHeader.parse +email.message.MIMEPart.__init__ +email.message.Message.get_payload +email.message.Message.set_param +email.parser.HeaderParser.__init__ +email.parser.Parser.__init__ +email.utils.localtime +email.utils.mktime_tz +email.utils.parseaddr +email.utils.parsedate +email.utils.parsedate_to_datetime +email.utils.parsedate_tz +encodings.utf_8.IncrementalDecoder._buffer_decode +encodings.utf_8.StreamReader.decode +encodings.utf_8.StreamWriter.encode +encodings.utf_8.encode +enum.EnumMeta.__call__ +enum.EnumMeta.__new__ +getopt.GetoptError.__init__ +html.parser.HTMLParser.feed +http.HTTPStatus.description +http.HTTPStatus.phrase +http.client.BadStatusLine.__init__ +http.client.HTTPResponse.read1 +http.client.HTTPResponse.readinto +http.client.HTTPResponse.readline +http.client.IncompleteRead.__init__ +http.client.LineTooLong.__init__ +http.client.UnknownProtocol.__init__ +http.cookiejar.Cookie.is_expired +http.cookiejar.CookieJar.clear +http.cookiejar.FileCookieJar.__init__ +http.cookies.Morsel.__init__ +http.cookies.Morsel.setdefault +http.cookies.Morsel.update +http.server.HTTPServer.__init__ +imaplib.IMAP4_SSL.ssl +importlib.abc.FileLoader.get_filename +importlib.abc.Loader.exec_module +importlib.abc.MetaPathFinder.find_spec +importlib.abc.PathEntryFinder.find_spec +importlib.machinery.BuiltinImporter.find_module +importlib.machinery.BuiltinImporter.find_spec +importlib.machinery.ExtensionFileLoader.__init__ +importlib.machinery.ExtensionFileLoader.get_filename +importlib.machinery.FrozenImporter.find_module +importlib.machinery.FrozenImporter.find_spec +importlib.machinery.FrozenImporter.module_repr +importlib.machinery.SourceFileLoader.set_data +importlib.machinery.WindowsRegistryFinder.find_module +importlib.machinery.WindowsRegistryFinder.find_spec +importlib.util.spec_from_file_location +importlib.util.spec_from_loader +inspect.Parameter.KEYWORD_ONLY +inspect.Parameter.POSITIONAL_ONLY +inspect.Parameter.POSITIONAL_OR_KEYWORD +inspect.Parameter.VAR_KEYWORD +inspect.Parameter.VAR_POSITIONAL +inspect.Parameter.replace +inspect.Signature.replace +io.BufferedRandom.truncate +io.BufferedReader.seek +io.BufferedReader.truncate +io.BufferedWriter.seek +io.BufferedWriter.truncate +io.BytesIO.readlines +io.BytesIO.seek # Parameter name for a positional-only param differs from its name in the inherited method +io.FileIO.seek +io.StringIO.seek +io.StringIO.truncate +io.TextIOWrapper.truncate +ipaddress._BaseAddress.is_global +ipaddress._BaseAddress.is_link_local +ipaddress._BaseAddress.is_loopback +ipaddress._BaseAddress.is_multicast +ipaddress._BaseAddress.is_private +ipaddress._BaseAddress.is_reserved +ipaddress._BaseAddress.is_unspecified +ipaddress._BaseAddress.max_prefixlen +ipaddress._BaseAddress.packed +ipaddress._BaseNetwork.max_prefixlen +itertools.accumulate +itertools.chain.from_iterable +itertools.combinations_with_replacement +itertools.compress +itertools.count +itertools.dropwhile +itertools.filterfalse +itertools.permutations +itertools.starmap +itertools.takewhile +itertools.zip_longest +lib2to3.pygram.pattern_symbols +lib2to3.pygram.python_symbols +lib2to3.pytree.Base.__new__ +lib2to3.pytree.Base.children +lib2to3.pytree.Base.type +lib2to3.pytree.BasePattern.__new__ +lib2to3.pytree.BasePattern.type +lib2to3.pytree.NegatedPattern.match +lib2to3.pytree.NegatedPattern.match_seq +mailbox.Babyl.__init__ +mailbox.MH.__init__ +mailbox.MMDF.__init__ +mailbox._mboxMMDF.get_bytes +mailbox._mboxMMDF.get_file +mailbox._mboxMMDF.get_string +mailbox.mbox.__init__ +mimetypes.read_mime_types +mmap.mmap.__iter__ +multiprocessing.JoinableQueue +multiprocessing.Queue +multiprocessing.SimpleQueue +multiprocessing.managers.BaseManager.shutdown +multiprocessing.managers.Server.__init__ +multiprocessing.managers.SyncManager.Event +multiprocessing.managers.SyncManager.Lock +multiprocessing.managers.SyncManager.Namespace +multiprocessing.managers.SyncManager.RLock +multiprocessing.pool.ApplyResult.__init__ +multiprocessing.pool.IMapIterator.__init__ +multiprocessing.pool.MapResult.__init__ +multiprocessing.queues.JoinableQueue.__init__ +multiprocessing.queues.Queue.__init__ +multiprocessing.queues.Queue.put_nowait +multiprocessing.queues.SimpleQueue.__init__ +multiprocessing.queues.SimpleQueue.put +multiprocessing.synchronize.Barrier.__init__ +multiprocessing.synchronize.Condition.acquire +multiprocessing.synchronize.Condition.release +multiprocessing.synchronize.Event.__init__ +multiprocessing.synchronize.SemLock.__init__ +multiprocessing.synchronize.SemLock.acquire +multiprocessing.synchronize.SemLock.release +netrc.NetrcParseError.__init__ +netrc.netrc.__init__ +ntpath.join +numbers.Number.__hash__ +operator.methodcaller +optparse.HelpFormatter._format__Text +optparse.OptionParser.__init__ +optparse.Values.__getattr__ +optparse.Values.read_file +optparse.Values.read_module +os._Environ.__init__ +os._Environ.setdefault +os._wrap_close.__init__ +pickle.Pickler.persistent_id +pickle.Unpickler.persistent_load +pipes.Template.copy +pkgutil.ImpImporter.__init__ +poplib.POP3_SSL.stls +pydoc.HTMLDoc.docdata +pydoc.HTMLDoc.docproperty +pydoc.HTMLDoc.docroutine +pydoc.TextDoc.docdata +pydoc.TextDoc.docmodule +pydoc.TextDoc.docother +pydoc.TextDoc.docproperty +pydoc.TextDoc.docroutine +random.SystemRandom.getstate +re.error.__init__ +runpy.run_path +sched.Event.__doc__ +select.poll +selectors.DevpollSelector +selectors.KqueueSelector +shlex.shlex.__init__ +shlex.shlex.error_leader +shlex.shlex.sourcehook +shutil.register_unpack_format +signal.SIGEMT +signal.SIGINFO +smtpd.MailmanProxy.process_message +smtpd.PureProxy.process_message +smtplib.SMTP.send_message +socketserver.BaseServer.fileno +socketserver.BaseServer.get_request +socketserver.BaseServer.server_bind +sqlite3.Row.__len__ +sqlite3.dbapi2.Row.__len__ +sqlite3.dbapi2.version_info +sqlite3.version_info +sre_constants.error.__init__ +ssl.PROTOCOL_SSLv2 +ssl.Purpose.__new__ +ssl.SSLContext.__new__ +ssl.SSLObject.__init__ +ssl.SSLSocket.connect +ssl.SSLSocket.connect_ex +ssl.SSLSocket.recv +ssl.SSLSocket.recv_into +ssl.SSLSocket.recvfrom +ssl.SSLSocket.recvfrom_into +ssl.SSLSocket.sendto +ssl._ASN1Object.__new__ +subprocess.Popen.__init__ +sunau.Au_write.getmark +sunau.Au_write.getmarkers +sunau.Au_write.setcomptype +sunau.Au_write.setmark +symtable.Symbol.__init__ +symtable.SymbolTable.__init__ +sys.gettotalrefcount +sys.implementation +sysconfig.is_python_build +sysconfig.parse_config_h +tarfile.TarFile.errors +tempfile.SpooledTemporaryFile.__next__ +tempfile.SpooledTemporaryFile.readable +tempfile.SpooledTemporaryFile.seekable +tempfile.SpooledTemporaryFile.writable +threading.Condition.acquire +threading.Condition.release +threading.Lock +threading.Semaphore.__enter__ +threading.Semaphore.acquire +threading.Thread.__init__ +timeit.main +tkinter.Misc.grid_propagate +tkinter.Misc.pack_propagate +tkinter.Tk.report_callback_exception # A bit of a lie, since it's actually a method, but typing it as an attribute allows it to be assigned to +trace.CoverageResults.__init__ +traceback.FrameSummary.__init__ +traceback.TracebackException.__init__ +traceback.TracebackException.from_exception +types.GetSetDescriptorType.__get__ +types.GetSetDescriptorType.__set__ +types.MemberDescriptorType.__get__ +types.MemberDescriptorType.__set__ +types.SimpleNamespace.__init__ +types.coroutine +types.new_class +types.prepare_class +typing.AwaitableGenerator +typing.IO.__iter__ +typing.IO.__next__ +typing.type_check_only +unittest.mock.patch # It's a complicated overload and I haven't been able to figure out why stubtest doesn't like it +urllib.error.ContentTooShortError.__init__ +urllib.error.URLError.__init__ +urllib.parse._DefragResultBase.__new__ +urllib.request.BaseHandler.http_error_nnn +urllib.request.HTTPPasswordMgrWithPriorAuth.__init__ +urllib.robotparser.RobotFileParser.can_fetch +warnings.catch_warnings.__init__ +weakref.CallableProxyType.__getattr__ +weakref.ProxyType.__getattr__ +weakref.ReferenceType.__call__ +weakref.WeakKeyDictionary.get +weakref.WeakKeyDictionary.update +weakref.WeakValueDictionary.get +webbrowser.Mozilla.raise_opts +webbrowser.UnixBrowser.raise_opts +webbrowser.UnixBrowser.remote_action +webbrowser.UnixBrowser.remote_action_newtab +webbrowser.UnixBrowser.remote_action_newwin +wsgiref.types # Doesn't exist, see comments in file +xml.etree.ElementPath._SelectorContext.parent_map +xml.sax.xmlreader.AttributesImpl.has_key +zipfile.ZipExtFile.read +zipfile.ZipExtFile.readline +zlib.compressobj + +# These enums derive from (int, IntEnum) or (str, Enum). Strangely, +# at runtime, they inherit Enum.__new__, not int.__new__ or +# str.__new__ as the mro would dictate, which is why stubtest balks. +enum.IntEnum.__new__ +http.HTTPStatus.__new__ +inspect._ParameterKind.__new__ +signal.Handlers.__new__ +signal.Sigmasks.__new__ +signal.Signals.__new__ +socket.AddressFamily.__new__ +socket.SocketKind.__new__ + +# ========== +# Whitelist entries that cannot or should not be fixed +# ========== +_pydecimal.* # See comments in file +ast.NodeVisitor.visit_\w+ # Methods are discovered dynamically, see #3796 +# Weird special builtins that are typed as functions, but aren't functions +builtins.copyright +builtins.credits +builtins.exit +builtins.help +builtins.license +builtins.quit +# Builtins that mypy pretends exist +builtins.reveal_locals +builtins.reveal_type +# Various classes in typing aren't types at runtime. In addition, mypy thinks some special forms are tautologically defined. +typing.[A-Z]\w+ +# We can't distinguish not having a default value from having a default value of inspect.Parameter.empty +inspect.Parameter.__init__ +inspect.Signature.__init__ +# Any field can be set on Namespace +multiprocessing.(dummy|managers).Namespace.__[gs]etattr__ +os.[a-z]+_(param|result)._(asdict|make|replace) # NamedTuple like, but not actually NamedTuples +# sys attributes that are not always defined +sys.last_traceback +sys.last_type +sys.last_value +sys.ps1 +sys.ps2 +sys.tracebacklimit +# See comments in file. List out methods that are delegated by __getattr__ at runtime. +# Used to make the relevant class satisfy BinaryIO interface. +codecs.StreamReaderWriter.\w+ +codecs.StreamRecoder.\w+ +urllib.response.addbase.\w+ + +# Platform differences that cannot be captured by the type system +errno.[A-Z0-9]+ +os.O_[A-Z_]+ +(posix.O_[A-Z_]+)? +(posix.ST_[A-Z]+)? +socket.AF_DECnet +socket.[A-Z0-9_]+ +(termios.[A-Z0-9_]+)? diff --git a/anaconda_lib/jedi/third_party/typeshed/tests/stubtest_whitelists/win32-py36.txt b/anaconda_lib/jedi/third_party/typeshed/tests/stubtest_whitelists/win32-py36.txt new file mode 100644 index 00000000..4d948912 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/tests/stubtest_whitelists/win32-py36.txt @@ -0,0 +1,3 @@ +hashlib.scrypt +os.startfile +posixpath.splitunc # This doesn't exist, but our hands are tied by check_consistent diff --git a/anaconda_lib/jedi/third_party/typeshed/tests/stubtest_whitelists/win32-py37.txt b/anaconda_lib/jedi/third_party/typeshed/tests/stubtest_whitelists/win32-py37.txt new file mode 100644 index 00000000..902e132e --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/tests/stubtest_whitelists/win32-py37.txt @@ -0,0 +1 @@ +os.startfile \ No newline at end of file diff --git a/anaconda_lib/jedi/third_party/typeshed/tests/stubtest_whitelists/win32-py38.txt b/anaconda_lib/jedi/third_party/typeshed/tests/stubtest_whitelists/win32-py38.txt new file mode 100644 index 00000000..f375ee5e --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/tests/stubtest_whitelists/win32-py38.txt @@ -0,0 +1 @@ +importlib.metadata.DistributionFinder.Context.pattern diff --git a/anaconda_lib/jedi/third_party/typeshed/tests/stubtest_whitelists/win32.txt b/anaconda_lib/jedi/third_party/typeshed/tests/stubtest_whitelists/win32.txt new file mode 100644 index 00000000..c61df1aa --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/tests/stubtest_whitelists/win32.txt @@ -0,0 +1,41 @@ +ctypes.GetLastError # Is actually a pointer +locale.[A-Z0-9_]+ # Constants that should be moved to _locale and re-exported conditionally +locale.nl_langinfo # Function that should be moved to _locale and re-exported conditionally +os.path.join # Parameter name mismatch +posixpath.altsep # Type mismatch +posixpath.realpath # Parameter name mismatch +urllib.request.pathname2url # Parameter name mismatch +urllib.request.url2pathname # Same + +# ========== +# Whitelist entries that cannot or should not be fixed +# ========== + +# Modules that do not exist on Windows systems +_curses +_posixsubprocess +asyncio.unix_events +crypt +dbm.gnu +dbm.ndbm +fcntl +grp +nis +posix +pwd +readline +resource +spwd +syslog +termios +xxlimited + +# Modules that rely on _curses +curses +curses.ascii +curses.panel +curses.textpad + +# Modules that rely on termios +pty +tty diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/OpenSSL/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/OpenSSL/__init__.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/OpenSSL/crypto.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/OpenSSL/crypto.pyi old mode 100755 new mode 100644 index 395e6309..9fcf3993 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2/OpenSSL/crypto.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2/OpenSSL/crypto.pyi @@ -1,9 +1,7 @@ -# Stubs for OpenSSL.crypto (Python 2) - +from datetime import datetime from typing import Any, Callable, Iterable, List, Optional, Set, Text, Tuple, Union from cryptography.hazmat.primitives.asymmetric import dsa, rsa -from datetime import datetime FILETYPE_PEM: int FILETYPE_ASN1: int @@ -51,8 +49,9 @@ class X509Name: def get_components(self) -> List[Tuple[str, str]]: ... class X509Extension: - def __init__(self, type_name: bytes, critical: bool, value: bytes, subject: Optional[X509] = ..., - issuer: Optional[X509] = ...) -> None: ... + def __init__( + self, type_name: bytes, critical: bool, value: bytes, subject: Optional[X509] = ..., issuer: Optional[X509] = ... + ) -> None: ... def get_critical(self) -> bool: ... def get_short_name(self) -> str: ... def get_data(self) -> str: ... @@ -128,8 +127,9 @@ class X509StoreContext: def load_certificate(type: int, buffer: Union[str, unicode]) -> X509: ... def dump_certificate(type: int, cert: X509) -> bytes: ... def dump_publickey(type: int, pkey: PKey) -> bytes: ... -def dump_privatekey(type: int, pkey: PKey, cipher: Optional[str] = ..., - passphrase: Optional[Union[str, Callable[[int], int]]] = ...) -> bytes: ... +def dump_privatekey( + type: int, pkey: PKey, cipher: Optional[str] = ..., passphrase: Optional[Union[str, Callable[[int], int]]] = ... +) -> bytes: ... class Revoked: def __init__(self) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/concurrent/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/concurrent/__init__.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/concurrent/futures/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/concurrent/futures/__init__.pyi old mode 100755 new mode 100644 index 4439dcad..1f93f021 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2/concurrent/futures/__init__.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2/concurrent/futures/__init__.pyi @@ -1,3 +1,13 @@ -from ._base import * # noqa: F403 -from .thread import * # noqa: F403 -from .process import * # noqa: F403 +from ._base import ( + ALL_COMPLETED as ALL_COMPLETED, + FIRST_COMPLETED as FIRST_COMPLETED, + FIRST_EXCEPTION as FIRST_EXCEPTION, + CancelledError as CancelledError, + Executor as Executor, + Future as Future, + TimeoutError as TimeoutError, + as_completed as as_completed, + wait as wait, +) +from .process import ProcessPoolExecutor as ProcessPoolExecutor +from .thread import ThreadPoolExecutor as ThreadPoolExecutor diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/concurrent/futures/_base.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/concurrent/futures/_base.pyi old mode 100755 new mode 100644 index 00ff41d7..40a98627 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2/concurrent/futures/_base.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2/concurrent/futures/_base.pyi @@ -1,8 +1,8 @@ import threading +from abc import abstractmethod from logging import Logger -from typing import TypeVar, Generic, Any, Iterable, Iterator, Callable, Tuple, Optional, Set, List from types import TracebackType -import sys +from typing import Any, Callable, Container, Generic, Iterable, Iterator, List, Optional, Protocol, Set, Tuple, TypeVar FIRST_COMPLETED: str FIRST_EXCEPTION: str @@ -18,10 +18,16 @@ class Error(Exception): ... class CancelledError(Error): ... class TimeoutError(Error): ... -if sys.version_info >= (3, 7): - class BrokenExecutor(RuntimeError): ... +_T = TypeVar("_T") -_T = TypeVar('_T') +_T_co = TypeVar("_T_co", covariant=True) + +# Copied over Collection implementation as it does not exist in Python 2 and <3.6. +# Also to solve pytype issues with _Collection. +class _Collection(Iterable[_T_co], Container[_T_co], Protocol[_T_co]): + # Implement Sized (but don't have it as a base class). + @abstractmethod + def __len__(self) -> int: ... class Future(Generic[_T]): def __init__(self) -> None: ... @@ -33,32 +39,22 @@ class Future(Generic[_T]): def result(self, timeout: Optional[float] = ...) -> _T: ... def set_running_or_notify_cancel(self) -> bool: ... def set_result(self, result: _T) -> None: ... - - if sys.version_info >= (3,): - def exception(self, timeout: Optional[float] = ...) -> Optional[BaseException]: ... - def set_exception(self, exception: Optional[BaseException]) -> None: ... - else: - def exception(self, timeout: Optional[float] = ...) -> Any: ... - def exception_info(self, timeout: Optional[float] = ...) -> Tuple[Any, Optional[TracebackType]]: ... - def set_exception(self, exception: Any) -> None: ... - def set_exception_info(self, exception: Any, traceback: Optional[TracebackType]) -> None: ... - + def exception(self, timeout: Optional[float] = ...) -> Any: ... + def exception_info(self, timeout: Optional[float] = ...) -> Tuple[Any, Optional[TracebackType]]: ... + def set_exception(self, exception: Any) -> None: ... + def set_exception_info(self, exception: Any, traceback: Optional[TracebackType]) -> None: ... class Executor: def submit(self, fn: Callable[..., _T], *args: Any, **kwargs: Any) -> Future[_T]: ... - if sys.version_info >= (3, 5): - def map(self, func: Callable[..., _T], *iterables: Iterable[Any], timeout: Optional[float] = ..., - chunksize: int = ...) -> Iterator[_T]: ... - else: - def map(self, func: Callable[..., _T], *iterables: Iterable[Any], timeout: Optional[float] = ...,) -> Iterator[_T]: ... + def map(self, func: Callable[..., _T], *iterables: Iterable[Any], timeout: Optional[float] = ...) -> Iterator[_T]: ... def shutdown(self, wait: bool = ...) -> None: ... def __enter__(self: _T) -> _T: ... def __exit__(self, exc_type: Any, exc_val: Any, exc_tb: Any) -> Optional[bool]: ... def as_completed(fs: Iterable[Future[_T]], timeout: Optional[float] = ...) -> Iterator[Future[_T]]: ... - -def wait(fs: Iterable[Future[_T]], timeout: Optional[float] = ..., return_when: str = ...) -> Tuple[Set[Future[_T]], - Set[Future[_T]]]: ... +def wait( + fs: _Collection[Future[_T]], timeout: Optional[float] = ..., return_when: str = ... +) -> Tuple[Set[Future[_T]], Set[Future[_T]]]: ... class _Waiter: event: threading.Event @@ -68,7 +64,6 @@ class _Waiter: def add_exception(self, future: Future[Any]) -> None: ... def add_cancelled(self, future: Future[Any]) -> None: ... - class _AsCompletedWaiter(_Waiter): lock: threading.Lock def __init__(self) -> None: ... @@ -76,13 +71,11 @@ class _AsCompletedWaiter(_Waiter): def add_exception(self, future: Future[Any]) -> None: ... def add_cancelled(self, future: Future[Any]) -> None: ... - class _FirstCompletedWaiter(_Waiter): def add_result(self, future: Future[Any]) -> None: ... def add_exception(self, future: Future[Any]) -> None: ... def add_cancelled(self, future: Future[Any]) -> None: ... - class _AllCompletedWaiter(_Waiter): num_pending_calls: int stop_on_exception: bool @@ -92,7 +85,6 @@ class _AllCompletedWaiter(_Waiter): def add_exception(self, future: Future[Any]) -> None: ... def add_cancelled(self, future: Future[Any]) -> None: ... - class _AcquireFutures: futures: Iterable[Future[Any]] def __init__(self, futures: Iterable[Future[Any]]) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/concurrent/futures/process.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/concurrent/futures/process.pyi old mode 100755 new mode 100644 index ca22879c..d56902c4 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2/concurrent/futures/process.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2/concurrent/futures/process.pyi @@ -1,20 +1,8 @@ -from typing import Any, Callable, Optional, Tuple +from typing import Any, Optional + from ._base import Executor -import sys EXTRA_QUEUED_CALLS: Any -if sys.version_info >= (3,): - class BrokenProcessPool(RuntimeError): ... - -if sys.version_info >= (3, 7): - from multiprocessing.context import BaseContext - - class ProcessPoolExecutor(Executor): - def __init__(self, max_workers: Optional[int] = ..., - mp_context: Optional[BaseContext] = ..., - initializer: Optional[Callable[..., None]] = ..., - initargs: Tuple[Any, ...] = ...) -> None: ... -else: - class ProcessPoolExecutor(Executor): - def __init__(self, max_workers: Optional[int] = ...) -> None: ... +class ProcessPoolExecutor(Executor): + def __init__(self, max_workers: Optional[int] = ...) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/concurrent/futures/thread.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/concurrent/futures/thread.pyi old mode 100755 new mode 100644 index 82c8ddd0..fa572002 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2/concurrent/futures/thread.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2/concurrent/futures/thread.pyi @@ -1,25 +1,11 @@ -from typing import Any, Callable, Iterable, Mapping, Optional, Tuple, TypeVar, Generic -from ._base import Executor, Future -import sys +from typing import Any, Callable, Generic, Iterable, Mapping, Optional, Tuple, TypeVar -if sys.version_info >= (3, 7): - from ._base import BrokenExecutor - class BrokenThreadPool(BrokenExecutor): ... +from ._base import Executor, Future -_S = TypeVar('_S') +_S = TypeVar("_S") class ThreadPoolExecutor(Executor): - if sys.version_info >= (3, 7): - def __init__(self, max_workers: Optional[int] = ..., - thread_name_prefix: str = ..., - initializer: Optional[Callable[..., None]] = ..., - initargs: Tuple[Any, ...] = ...) -> None: ... - elif sys.version_info >= (3, 6) or sys.version_info < (3,): - def __init__(self, max_workers: Optional[int] = ..., - thread_name_prefix: str = ...) -> None: ... - else: - def __init__(self, max_workers: Optional[int] = ...) -> None: ... - + def __init__(self, max_workers: Optional[int] = ..., thread_name_prefix: str = ...) -> None: ... class _WorkItem(Generic[_S]): future: Future[_S] diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/enum.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/enum.pyi old mode 100755 new mode 100644 index be22d386..1a1dcf00 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2/enum.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2/enum.pyi @@ -1,10 +1,9 @@ -# NB: third_party/2/enum.pyi and stdlib/3.4/enum.pyi must remain consistent! import sys -from typing import Any, Dict, Iterator, List, Mapping, Type, TypeVar, Union from abc import ABCMeta +from typing import Any, Dict, Iterator, List, Mapping, Type, TypeVar, Union -_T = TypeVar('_T') -_S = TypeVar('_S', bound=Type[Enum]) +_T = TypeVar("_T") +_S = TypeVar("_S", bound=Type[Enum]) # Note: EnumMeta actually subclasses type directly, not ABCMeta. # This is a temporary workaround to allow multiple creation of enums with builtins @@ -30,12 +29,12 @@ class Enum(metaclass=EnumMeta): _value2member_map_: Dict[int, Enum] # undocumented if sys.version_info >= (3, 7): _ignore_: Union[str, List[str]] - if sys.version_info >= (3, 6): - _order_: str - @classmethod - def _missing_(cls, value: object) -> Any: ... - @staticmethod - def _generate_next_value_(name: str, start: int, count: int, last_values: List[Any]) -> Any: ... + _order_: str + __order__: str + @classmethod + def _missing_(cls, value: object) -> Any: ... + @staticmethod + def _generate_next_value_(name: str, start: int, count: int, last_values: List[Any]) -> Any: ... def __new__(cls: Type[_T], value: object) -> _T: ... def __repr__(self) -> str: ... def __str__(self) -> str: ... @@ -49,27 +48,26 @@ class IntEnum(int, Enum): def unique(enumeration: _S) -> _S: ... -if sys.version_info >= (3, 6): - _auto_null: Any +_auto_null: Any - # subclassing IntFlag so it picks up all implemented base functions, best modeling behavior of enum.auto() - class auto(IntFlag): - value: Any +# subclassing IntFlag so it picks up all implemented base functions, best modeling behavior of enum.auto() +class auto(IntFlag): + value: Any - class Flag(Enum): - def __contains__(self: _T, other: _T) -> bool: ... - def __repr__(self) -> str: ... - def __str__(self) -> str: ... - def __bool__(self) -> bool: ... - def __or__(self: _T, other: _T) -> _T: ... - def __and__(self: _T, other: _T) -> _T: ... - def __xor__(self: _T, other: _T) -> _T: ... - def __invert__(self: _T) -> _T: ... +class Flag(Enum): + def __contains__(self: _T, other: _T) -> bool: ... + def __repr__(self) -> str: ... + def __str__(self) -> str: ... + def __bool__(self) -> bool: ... + def __or__(self: _T, other: _T) -> _T: ... + def __and__(self: _T, other: _T) -> _T: ... + def __xor__(self: _T, other: _T) -> _T: ... + def __invert__(self: _T) -> _T: ... - class IntFlag(int, Flag): - def __or__(self: _T, other: Union[int, _T]) -> _T: ... - def __and__(self: _T, other: Union[int, _T]) -> _T: ... - def __xor__(self: _T, other: Union[int, _T]) -> _T: ... - __ror__ = __or__ - __rand__ = __and__ - __rxor__ = __xor__ +class IntFlag(int, Flag): + def __or__(self: _T, other: Union[int, _T]) -> _T: ... + def __and__(self: _T, other: Union[int, _T]) -> _T: ... + def __xor__(self: _T, other: Union[int, _T]) -> _T: ... + __ror__ = __or__ + __rand__ = __and__ + __rxor__ = __xor__ diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/fb303/FacebookService.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/fb303/FacebookService.pyi old mode 100755 new mode 100644 index ead5d24f..73296cbc --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2/fb303/FacebookService.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2/fb303/FacebookService.pyi @@ -1,4 +1,5 @@ from typing import Any + from thrift.Thrift import TProcessor # type: ignore fastbinary: Any @@ -58,7 +59,7 @@ class Client(Iface): def shutdown(self): ... def send_shutdown(self): ... -class Processor(Iface, TProcessor): +class Processor(Iface, TProcessor): # type: ignore def __init__(self, handler) -> None: ... def process(self, iprot, oprot): ... def process_getName(self, seqid, iprot, oprot): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/fb303/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/fb303/__init__.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/ipaddress.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/ipaddress.pyi old mode 100755 new mode 100644 index 6b6a45d1..5d0c7dd6 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2/ipaddress.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2/ipaddress.pyi @@ -1,5 +1,4 @@ -from typing import (Any, Container, Generic, Iterable, Iterator, Optional, - overload, SupportsInt, Text, Tuple, TypeVar) +from typing import Any, Container, Generic, Iterable, Iterator, Optional, SupportsInt, Text, Tuple, TypeVar, overload # Undocumented length constants IPV4LENGTH: int @@ -84,7 +83,7 @@ class _BaseNetwork(_IPAddressBase, Container[_A], Iterable[_A], Generic[_A]): def max_prefixlen(self) -> int: ... @property def num_addresses(self) -> int: ... - def overlaps(self: _T, other: _T) -> bool: ... + def overlaps(self, other: _BaseNetwork[_A]) -> bool: ... @property def prefixlen(self) -> int: ... def subnets(self: _T, prefixlen_diff: int = ..., new_prefix: Optional[int] = ...) -> Iterator[_T]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/kazoo/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/kazoo/__init__.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/kazoo/client.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/kazoo/client.pyi old mode 100755 new mode 100644 index 0d3fc008..ea69edef --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2/kazoo/client.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2/kazoo/client.pyi @@ -34,8 +34,21 @@ class KazooClient: SetPartitioner: Any Semaphore: Any ShallowParty: Any - def __init__(self, hosts=..., timeout=..., client_id=..., handler=..., default_acl=..., auth_data=..., read_only=..., - randomize_hosts=..., connection_retry=..., command_retry=..., logger=..., **kwargs) -> None: ... + def __init__( + self, + hosts=..., + timeout=..., + client_id=..., + handler=..., + default_acl=..., + auth_data=..., + read_only=..., + randomize_hosts=..., + connection_retry=..., + command_retry=..., + logger=..., + **kwargs, + ) -> None: ... @property def client_state(self): ... @property @@ -93,5 +106,4 @@ class TransactionRequest: def __enter__(self): ... def __exit__(self, exc_type, exc_value, exc_tb): ... -class KazooState: - ... +class KazooState: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/kazoo/exceptions.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/kazoo/exceptions.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/kazoo/recipe/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/kazoo/recipe/__init__.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/kazoo/recipe/watchers.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/kazoo/recipe/watchers.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/pathlib2.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/pathlib2.pyi old mode 100755 new mode 100644 index fb925e60..ce9bbc1d --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2/pathlib2.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2/pathlib2.pyi @@ -1,14 +1,15 @@ -from typing import Any, Generator, IO, Optional, Sequence, Tuple, Type, TypeVar, Union, List -from types import TracebackType import os import sys +from _typeshed import OpenBinaryMode, OpenBinaryModeReading, OpenBinaryModeUpdating, OpenBinaryModeWriting, OpenTextMode +from io import BufferedRandom, BufferedReader, BufferedWriter, FileIO, TextIOWrapper +from types import TracebackType +from typing import IO, Any, BinaryIO, Generator, List, Optional, Sequence, Text, TextIO, Tuple, Type, TypeVar, Union, overload +from typing_extensions import Literal -_P = TypeVar('_P', bound=PurePath) +_P = TypeVar("_P", bound=PurePath) -if sys.version_info >= (3, 6): - _PurePathBase = os.PathLike[str] -else: - _PurePathBase = object +_PurePathBase = object +_PathLike = PurePath class PurePath(_PurePathBase): parts: Tuple[str, ...] @@ -19,42 +20,25 @@ class PurePath(_PurePathBase): suffix: str suffixes: List[str] stem: str - if sys.version_info < (3, 5): - def __init__(self, *pathsegments: str) -> None: ... - elif sys.version_info < (3, 6): - def __new__(cls: Type[_P], *args: Union[str, PurePath]) -> _P: ... - else: - def __new__(cls: Type[_P], *args: Union[str, os.PathLike[str]]) -> _P: ... + def __new__(cls: Type[_P], *args: Union[str, _PathLike]) -> _P: ... def __hash__(self) -> int: ... def __lt__(self, other: PurePath) -> bool: ... def __le__(self, other: PurePath) -> bool: ... def __gt__(self, other: PurePath) -> bool: ... def __ge__(self, other: PurePath) -> bool: ... - if sys.version_info < (3, 6): - def __truediv__(self: _P, key: Union[str, PurePath]) -> _P: ... - def __rtruediv__(self: _P, key: Union[str, PurePath]) -> _P: ... - else: - def __truediv__(self: _P, key: Union[str, os.PathLike[str]]) -> _P: ... - def __rtruediv__(self: _P, key: Union[str, os.PathLike[str]]) -> _P: ... - if sys.version_info < (3,): - def __div__(self: _P, key: Union[str, PurePath]) -> _P: ... + def __truediv__(self: _P, key: Union[str, _PathLike]) -> _P: ... + def __rtruediv__(self: _P, key: Union[str, _PathLike]) -> _P: ... + def __div__(self: _P, key: Union[str, PurePath]) -> _P: ... def __bytes__(self) -> bytes: ... def as_posix(self) -> str: ... def as_uri(self) -> str: ... def is_absolute(self) -> bool: ... def is_reserved(self) -> bool: ... def match(self, path_pattern: str) -> bool: ... - if sys.version_info < (3, 6): - def relative_to(self: _P, *other: Union[str, PurePath]) -> _P: ... - else: - def relative_to(self: _P, *other: Union[str, os.PathLike[str]]) -> _P: ... + def relative_to(self: _P, *other: Union[str, _PathLike]) -> _P: ... def with_name(self: _P, name: str) -> _P: ... def with_suffix(self: _P, suffix: str) -> _P: ... - if sys.version_info < (3, 6): - def joinpath(self: _P, *other: Union[str, PurePath]) -> _P: ... - else: - def joinpath(self: _P, *other: Union[str, os.PathLike[str]]) -> _P: ... - + def joinpath(self: _P, *other: Union[str, _PathLike]) -> _P: ... @property def parents(self: _P) -> Sequence[_P]: ... @property @@ -64,10 +48,11 @@ class PurePosixPath(PurePath): ... class PureWindowsPath(PurePath): ... class Path(PurePath): + def __new__(cls: Type[_P], *args: Union[str, _PathLike], **kwargs: Any) -> _P: ... def __enter__(self) -> Path: ... - def __exit__(self, exc_type: Optional[Type[BaseException]], - exc_value: Optional[BaseException], - traceback: Optional[TracebackType]) -> Optional[bool]: ... + def __exit__( + self, exc_type: Optional[Type[BaseException]], exc_value: Optional[BaseException], traceback: Optional[TracebackType] + ) -> Optional[bool]: ... @classmethod def cwd(cls: Type[_P]) -> _P: ... def stat(self) -> os.stat_result: ... @@ -85,51 +70,34 @@ class Path(PurePath): def iterdir(self) -> Generator[Path, None, None]: ... def lchmod(self, mode: int) -> None: ... def lstat(self) -> os.stat_result: ... - if sys.version_info < (3, 5): - def mkdir(self, mode: int = ..., - parents: bool = ...) -> None: ... - else: - def mkdir(self, mode: int = ..., parents: bool = ..., - exist_ok: bool = ...) -> None: ... - def open(self, mode: str = ..., buffering: int = ..., - encoding: Optional[str] = ..., errors: Optional[str] = ..., - newline: Optional[str] = ...) -> IO[Any]: ... + def mkdir(self, mode: int = ..., parents: bool = ...) -> None: ... + # Adapted from _io.open + def open( + self, + mode: Text = ..., + buffering: int = ..., + encoding: Optional[Text] = ..., + errors: Optional[Text] = ..., + newline: Optional[Text] = ..., + ) -> IO[Any]: ... def owner(self) -> str: ... def rename(self, target: Union[str, PurePath]) -> None: ... def replace(self, target: Union[str, PurePath]) -> None: ... - if sys.version_info < (3, 6): - def resolve(self: _P) -> _P: ... - else: - def resolve(self: _P, strict: bool = ...) -> _P: ... + def resolve(self: _P) -> _P: ... def rglob(self, pattern: str) -> Generator[Path, None, None]: ... def rmdir(self) -> None: ... - def symlink_to(self, target: Union[str, Path], - target_is_directory: bool = ...) -> None: ... + def symlink_to(self, target: Union[str, Path], target_is_directory: bool = ...) -> None: ... def touch(self, mode: int = ..., exist_ok: bool = ...) -> None: ... def unlink(self) -> None: ... - - if sys.version_info >= (3, 5): - @classmethod - def home(cls: Type[_P]) -> _P: ... - if sys.version_info < (3, 6): - def __new__(cls: Type[_P], *args: Union[str, PurePath], - **kwargs: Any) -> _P: ... - else: - def __new__(cls: Type[_P], *args: Union[str, os.PathLike[str]], - **kwargs: Any) -> _P: ... - - def absolute(self: _P) -> _P: ... - def expanduser(self: _P) -> _P: ... - def read_bytes(self) -> bytes: ... - def read_text(self, encoding: Optional[str] = ..., - errors: Optional[str] = ...) -> str: ... - def samefile(self, other_path: Union[str, bytes, int, Path]) -> bool: ... - def write_bytes(self, data: bytes) -> int: ... - def write_text(self, data: str, encoding: Optional[str] = ..., - errors: Optional[str] = ...) -> int: ... - if sys.version_info >= (3, 8): - def link_to(self, target: Union[str, bytes, os.PathLike[str]]) -> None: ... - + @classmethod + def home(cls: Type[_P]) -> _P: ... + def absolute(self: _P) -> _P: ... + def expanduser(self: _P) -> _P: ... + def read_bytes(self) -> bytes: ... + def read_text(self, encoding: Optional[str] = ..., errors: Optional[str] = ...) -> str: ... + def samefile(self, other_path: Union[str, bytes, int, Path]) -> bool: ... + def write_bytes(self, data: bytes) -> int: ... + def write_text(self, data: str, encoding: Optional[str] = ..., errors: Optional[str] = ...) -> int: ... class PosixPath(Path, PurePosixPath): ... class WindowsPath(Path, PureWindowsPath): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/pymssql.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/pymssql.pyi old mode 100755 new mode 100644 index 8e08ee35..4f625626 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2/pymssql.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2/pymssql.pyi @@ -1,13 +1,11 @@ -from datetime import datetime, date, time - -from typing import Any, Dict, Tuple, Iterable, List, Optional, Union, Sequence +from datetime import date, datetime, time +from typing import Any, Dict, Iterable, List, Optional, Sequence, Tuple, Union Scalar = Union[int, float, str, datetime, date, time] Result = Union[Tuple[Scalar, ...], Dict[str, Scalar]] class Connection(object): - def __init__(self, user, password, host, database, timeout, - login_timeout, charset, as_dict) -> None: ... + def __init__(self, user, password, host, database, timeout, login_timeout, charset, as_dict) -> None: ... def autocommit(self, status: bool) -> None: ... def close(self) -> None: ... def commit(self) -> None: ... @@ -20,29 +18,27 @@ class Cursor(object): def __next__(self) -> Any: ... def callproc(self, procname: str, **kwargs) -> None: ... def close(self) -> None: ... - def execute(self, stmt: str, - params: Optional[Union[Scalar, Tuple[Scalar, ...], - Dict[str, Scalar]]]) -> None: ... - def executemany(self, stmt: str, - params: Optional[Sequence[Tuple[Scalar, ...]]]) -> None: ... + def execute(self, stmt: str, params: Optional[Union[Scalar, Tuple[Scalar, ...], Dict[str, Scalar]]]) -> None: ... + def executemany(self, stmt: str, params: Optional[Sequence[Tuple[Scalar, ...]]]) -> None: ... def fetchall(self) -> List[Result]: ... def fetchmany(self, size: Optional[int]) -> List[Result]: ... def fetchone(self) -> Result: ... -def connect(server: Optional[str], - user: Optional[str], - password: Optional[str], - database: Optional[str], - timeout: Optional[int], - login_timeout: Optional[int], - charset: Optional[str], - as_dict: Optional[bool], - host: Optional[str], - appname: Optional[str], - port: Optional[str], - - conn_properties: Optional[Union[str, Sequence[str]]], - autocommit: Optional[bool], - tds_version: Optional[str]) -> Connection: ... +def connect( + server: Optional[str], + user: Optional[str], + password: Optional[str], + database: Optional[str], + timeout: Optional[int], + login_timeout: Optional[int], + charset: Optional[str], + as_dict: Optional[bool], + host: Optional[str], + appname: Optional[str], + port: Optional[str], + conn_properties: Optional[Union[str, Sequence[str]]], + autocommit: Optional[bool], + tds_version: Optional[str], +) -> Connection: ... def get_max_connections() -> int: ... def set_max_connections(n: int) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/routes/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/routes/__init__.pyi old mode 100755 new mode 100644 index 8a1261f5..c80116a2 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2/routes/__init__.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2/routes/__init__.pyi @@ -1,5 +1,4 @@ -from . import mapper -from . import util +from . import mapper, util class _RequestConfig: def __getattr__(self, name): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/routes/mapper.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/routes/mapper.pyi old mode 100755 new mode 100644 index f834d084..a3e21e8d --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2/routes/mapper.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2/routes/mapper.pyi @@ -7,8 +7,18 @@ def strip_slashes(name): ... class SubMapperParent: def submapper(self, **kargs): ... - def collection(self, collection_name, resource_name, path_prefix=..., member_prefix=..., controller=..., - collection_actions=..., member_actions=..., member_options=..., **kwargs): ... + def collection( + self, + collection_name, + resource_name, + path_prefix=..., + member_prefix=..., + controller=..., + collection_actions=..., + member_actions=..., + member_options=..., + **kwargs, + ): ... class SubMapper(SubMapperParent): kwargs: Any diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/routes/util.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/routes/util.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/scribe/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/scribe/__init__.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/scribe/scribe.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/scribe/scribe.pyi old mode 100755 new mode 100644 index 3530bf80..8988087a --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2/scribe/scribe.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2/scribe/scribe.pyi @@ -1,9 +1,10 @@ from typing import Any import fb303.FacebookService -from .ttypes import * # noqa: F403 from thrift.Thrift import TProcessor # type: ignore # We don't have thrift stubs in typeshed +from .ttypes import * # noqa: F403 + class Iface(fb303.FacebookService.Iface): def Log(self, messages): ... @@ -13,7 +14,7 @@ class Client(fb303.FacebookService.Client, Iface): def send_Log(self, messages): ... def recv_Log(self): ... -class Processor(fb303.FacebookService.Processor, Iface, TProcessor): +class Processor(fb303.FacebookService.Processor, Iface, TProcessor): # type: ignore def __init__(self, handler) -> None: ... def process(self, iprot, oprot): ... def process_Log(self, seqid, iprot, oprot): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/scribe/ttypes.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/scribe/ttypes.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/__init__.pyi old mode 100755 new mode 100644 index 3bed0500..f6d6af1e --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/__init__.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/__init__.pyi @@ -1,25 +1,41 @@ -# Stubs for six (Python 2.7) - from __future__ import print_function import types -from typing import ( - Any, AnyStr, Callable, Dict, Iterable, Mapping, NoReturn, Optional, - Pattern, Text, Tuple, Type, TypeVar, Union, overload, ValuesView, KeysView, ItemsView, -) import typing import unittest - -# Exports from __builtin__ import unichr as unichr -from StringIO import StringIO as StringIO, StringIO as BytesIO from functools import wraps as wraps +from StringIO import StringIO as StringIO +from typing import ( + Any, + AnyStr, + Callable, + Dict, + ItemsView, + Iterable, + KeysView, + Mapping, + NoReturn, + Optional, + Pattern, + Text, + Tuple, + Type, + TypeVar, + Union, + ValuesView, + overload, +) + from . import moves +BytesIO = StringIO + +_T = TypeVar("_T") +_K = TypeVar("_K") +_V = TypeVar("_V") -_T = TypeVar('_T') -_K = TypeVar('_K') -_V = TypeVar('_V') +__version__: str # TODO make constant, then move this stub to 2and3 # https://github.com/python/typeshed/issues/17 @@ -35,14 +51,11 @@ binary_type = str MAXSIZE: int -# def add_move -# def remove_move - def advance_iterator(it: typing.Iterator[_T]) -> _T: ... + next = advance_iterator def callable(obj: object) -> bool: ... - def get_unbound_function(unbound: types.MethodType) -> types.FunctionType: ... def create_bound_method(func: types.FunctionType, obj: object) -> types.MethodType: ... def create_unbound_method(func: types.FunctionType, cls: Union[type, types.ClassType]) -> types.MethodType: ... @@ -56,33 +69,34 @@ def get_function_closure(fun: types.FunctionType) -> Optional[Tuple[types._Cell, def get_function_code(fun: types.FunctionType) -> types.CodeType: ... def get_function_defaults(fun: types.FunctionType) -> Optional[Tuple[Any, ...]]: ... def get_function_globals(fun: types.FunctionType) -> Dict[str, Any]: ... - def iterkeys(d: Mapping[_K, _V]) -> typing.Iterator[_K]: ... def itervalues(d: Mapping[_K, _V]) -> typing.Iterator[_V]: ... def iteritems(d: Mapping[_K, _V]) -> typing.Iterator[Tuple[_K, _V]]: ... + # def iterlists def viewkeys(d: Mapping[_K, _V]) -> KeysView[_K]: ... def viewvalues(d: Mapping[_K, _V]) -> ValuesView[_V]: ... def viewitems(d: Mapping[_K, _V]) -> ItemsView[_K, _V]: ... - def b(s: str) -> binary_type: ... def u(s: str) -> text_type: ... + int2byte = chr + def byte2int(bs: binary_type) -> int: ... def indexbytes(buf: binary_type, i: int) -> int: ... def iterbytes(buf: binary_type) -> typing.Iterator[int]: ... - def assertCountEqual(self: unittest.TestCase, first: Iterable[_T], second: Iterable[_T], msg: str = ...) -> None: ... @overload def assertRaisesRegex(self: unittest.TestCase, msg: str = ...) -> Any: ... @overload def assertRaisesRegex(self: unittest.TestCase, callable_obj: Callable[..., Any], *args: Any, **kwargs: Any) -> Any: ... -def assertRegex(self: unittest.TestCase, text: AnyStr, expected_regex: Union[AnyStr, Pattern[AnyStr]], - msg: str = ...) -> None: ... - -def reraise(tp: Optional[Type[BaseException]], value: Optional[BaseException], - tb: Optional[types.TracebackType] = ...) -> NoReturn: ... +def assertRegex( + self: unittest.TestCase, text: AnyStr, expected_regex: Union[AnyStr, Pattern[AnyStr]], msg: str = ... +) -> None: ... +def reraise( + tp: Optional[Type[BaseException]], value: Optional[BaseException], tb: Optional[types.TracebackType] = ... +) -> NoReturn: ... def exec_(_code_: Union[unicode, types.CodeType], _globs_: Dict[str, Any] = ..., _locs_: Dict[str, Any] = ...): ... def raise_from(value: Union[BaseException, Type[BaseException]], from_value: Optional[BaseException]) -> NoReturn: ... @@ -94,3 +108,23 @@ def ensure_binary(s: Union[bytes, Text], encoding: str = ..., errors: str = ...) def ensure_str(s: Union[bytes, Text], encoding: str = ..., errors: str = ...) -> str: ... def ensure_text(s: Union[bytes, Text], encoding: str = ..., errors: str = ...) -> Text: ... def python_2_unicode_compatible(klass: _T) -> _T: ... + +class _LazyDescriptor: + name: str + def __init__(self, name: str) -> None: ... + def __get__(self, obj: Optional[object], type: Optional[type] = ...) -> Any: ... + +class MovedModule(_LazyDescriptor): + mod: str + def __init__(self, name: str, old: str, new: Optional[str] = ...) -> None: ... + def __getattr__(self, attr: str) -> Any: ... + +class MovedAttribute(_LazyDescriptor): + mod: str + attr: str + def __init__( + self, name: str, old_mod: str, new_mod: str, old_attr: Optional[str] = ..., new_attr: Optional[str] = ... + ) -> None: ... + +def add_move(move: Union[MovedModule, MovedAttribute]) -> None: ... +def remove_move(name: str) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/BaseHTTPServer.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/BaseHTTPServer.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/CGIHTTPServer.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/CGIHTTPServer.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/SimpleHTTPServer.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/SimpleHTTPServer.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/__init__.pyi old mode 100755 new mode 100644 index 2bc82cbc..5f34153f --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/__init__.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/__init__.pyi @@ -2,47 +2,17 @@ # # Note: Commented out items means they weren't implemented at the time. # Uncomment them when the modules have been added to the typeshed. -from cStringIO import StringIO as cStringIO -from itertools import ifilter as filter -from itertools import ifilterfalse as filterfalse -from __builtin__ import raw_input as input -from __builtin__ import intern as intern -from itertools import imap as map -from os import getcwdu as getcwd -from os import getcwd as getcwdb -from __builtin__ import xrange as range -from __builtin__ import reload as reload_module -from __builtin__ import reduce as reduce -from pipes import quote as shlex_quote +import __builtin__ +import itertools +import os +import pipes +from __builtin__ import intern as intern, reduce as reduce, xrange as xrange +from cStringIO import StringIO as _cStringIO from StringIO import StringIO as StringIO from UserDict import UserDict as UserDict from UserList import UserList as UserList from UserString import UserString as UserString -from __builtin__ import xrange as xrange -from itertools import izip as zip -from itertools import izip_longest as zip_longest -import __builtin__ as builtins -from . import configparser -# import copy_reg as copyreg -# import gdbm as dbm_gnu -from . import _dummy_thread -from . import http_cookiejar -from . import http_cookies -from . import html_entities -from . import html_parser -from . import http_client -# import email.MIMEMultipart as email_mime_multipart -# import email.MIMENonMultipart as email_mime_nonmultipart -from . import email_mime_text -# import email.MIMEBase as email_mime_base -from . import BaseHTTPServer -from . import CGIHTTPServer -from . import SimpleHTTPServer -from . import cPickle -from . import queue -from . import reprlib -from . import socketserver -from . import _thread + # import Tkinter as tkinter # import Dialog as tkinter_dialog # import FileDialog as tkinter_filedialog @@ -58,9 +28,51 @@ from . import _thread # import tkFont as tkinter_font # import tkMessageBox as tkinter_messagebox # import tkSimpleDialog as tkinter_tksimpledialog -from . import urllib_parse -from . import urllib_error -from . import urllib -from . import urllib_robotparser -from . import xmlrpc_client +# import email.MIMEBase as email_mime_base +# import email.MIMEMultipart as email_mime_multipart +# import email.MIMENonMultipart as email_mime_nonmultipart +# import copy_reg as copyreg +# import gdbm as dbm_gnu +from . import ( + BaseHTTPServer, + CGIHTTPServer, + SimpleHTTPServer, + _dummy_thread, + _thread, + configparser, + cPickle, + email_mime_text, + html_entities, + html_parser, + http_client, + http_cookiejar, + http_cookies, + queue, + reprlib, + socketserver, + urllib, + urllib_error, + urllib_parse, + urllib_robotparser, + xmlrpc_client, +) + # import SimpleXMLRPCServer as xmlrpc_server + +builtins = __builtin__ +input = __builtin__.raw_input +reload_module = __builtin__.reload +range = __builtin__.xrange + +cStringIO = _cStringIO + +filter = itertools.ifilter +filterfalse = itertools.ifilterfalse +map = itertools.imap +zip = itertools.izip +zip_longest = itertools.izip_longest + +getcwdb = os.getcwd +getcwd = os.getcwdu + +shlex_quote = pipes.quote diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/_dummy_thread.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/_dummy_thread.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/_thread.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/_thread.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/cPickle.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/cPickle.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/collections_abc.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/collections_abc.pyi new file mode 100644 index 00000000..94005615 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/collections_abc.pyi @@ -0,0 +1 @@ +from collections import * diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/configparser.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/configparser.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/email_mime_base.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/email_mime_base.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/email_mime_multipart.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/email_mime_multipart.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/email_mime_nonmultipart.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/email_mime_nonmultipart.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/email_mime_text.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/email_mime_text.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/html_entities.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/html_entities.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/html_parser.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/html_parser.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/http_client.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/http_client.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/http_cookiejar.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/http_cookiejar.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/http_cookies.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/http_cookies.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/queue.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/queue.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/reprlib.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/reprlib.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/socketserver.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/socketserver.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib/__init__.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib/error.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib/error.pyi old mode 100755 new mode 100644 index 044327ee..0c6c1c3b --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib/error.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib/error.pyi @@ -1,3 +1,2 @@ -from urllib2 import URLError as URLError -from urllib2 import HTTPError as HTTPError from urllib import ContentTooShortError as ContentTooShortError +from urllib2 import HTTPError as HTTPError, URLError as URLError diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib/parse.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib/parse.pyi old mode 100755 new mode 100644 index 4096c27f..569b0732 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib/parse.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib/parse.pyi @@ -1,24 +1,29 @@ -# Stubs for six.moves.urllib.parse -from urlparse import ParseResult as ParseResult -from urlparse import SplitResult as SplitResult -from urlparse import parse_qs as parse_qs -from urlparse import parse_qsl as parse_qsl -from urlparse import urldefrag as urldefrag -from urlparse import urljoin as urljoin -from urlparse import urlparse as urlparse -from urlparse import urlsplit as urlsplit -from urlparse import urlunparse as urlunparse -from urlparse import urlunsplit as urlunsplit -from urllib import quote as quote -from urllib import quote_plus as quote_plus -from urllib import unquote as unquote -from urllib import unquote_plus as unquote_plus -from urllib import urlencode as urlencode -from urllib import splitquery as splitquery -from urllib import splittag as splittag -from urllib import splituser as splituser -from urlparse import uses_fragment as uses_fragment -from urlparse import uses_netloc as uses_netloc -from urlparse import uses_params as uses_params -from urlparse import uses_query as uses_query -from urlparse import uses_relative as uses_relative +from urllib import ( + quote as quote, + quote_plus as quote_plus, + splitquery as splitquery, + splittag as splittag, + splituser as splituser, + unquote as unquote, + unquote_plus as unquote_plus, + urlencode as urlencode, +) +from urlparse import ( + ParseResult as ParseResult, + SplitResult as SplitResult, + parse_qs as parse_qs, + parse_qsl as parse_qsl, + urldefrag as urldefrag, + urljoin as urljoin, + urlparse as urlparse, + urlsplit as urlsplit, + urlunparse as urlunparse, + urlunsplit as urlunsplit, + uses_fragment as uses_fragment, + uses_netloc as uses_netloc, + uses_params as uses_params, + uses_query as uses_query, + uses_relative as uses_relative, +) + +unquote_to_bytes = unquote diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib/request.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib/request.pyi old mode 100755 new mode 100644 index 6aadde16..549bd407 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib/request.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib/request.pyi @@ -1,36 +1,39 @@ -# Stubs for six.moves.urllib.request -from urllib2 import urlopen as urlopen -from urllib2 import install_opener as install_opener -from urllib2 import build_opener as build_opener -from urllib import pathname2url as pathname2url -from urllib import url2pathname as url2pathname -from urllib import getproxies as getproxies -from urllib2 import Request as Request -from urllib2 import OpenerDirector as OpenerDirector -from urllib2 import HTTPDefaultErrorHandler as HTTPDefaultErrorHandler -from urllib2 import HTTPRedirectHandler as HTTPRedirectHandler -from urllib2 import HTTPCookieProcessor as HTTPCookieProcessor -from urllib2 import ProxyHandler as ProxyHandler -from urllib2 import BaseHandler as BaseHandler -from urllib2 import HTTPPasswordMgr as HTTPPasswordMgr -from urllib2 import HTTPPasswordMgrWithDefaultRealm as HTTPPasswordMgrWithDefaultRealm -from urllib2 import AbstractBasicAuthHandler as AbstractBasicAuthHandler -from urllib2 import HTTPBasicAuthHandler as HTTPBasicAuthHandler -from urllib2 import ProxyBasicAuthHandler as ProxyBasicAuthHandler -from urllib2 import AbstractDigestAuthHandler as AbstractDigestAuthHandler -from urllib2 import HTTPDigestAuthHandler as HTTPDigestAuthHandler -from urllib2 import ProxyDigestAuthHandler as ProxyDigestAuthHandler -from urllib2 import HTTPHandler as HTTPHandler -from urllib2 import HTTPSHandler as HTTPSHandler -from urllib2 import FileHandler as FileHandler -from urllib2 import FTPHandler as FTPHandler -from urllib2 import CacheFTPHandler as CacheFTPHandler -from urllib2 import UnknownHandler as UnknownHandler -from urllib2 import HTTPErrorProcessor as HTTPErrorProcessor -from urllib import urlretrieve as urlretrieve -from urllib import urlcleanup as urlcleanup -from urllib import URLopener as URLopener -from urllib import FancyURLopener as FancyURLopener -from urllib import proxy_bypass as proxy_bypass -from urllib2 import parse_http_list as parse_http_list -from urllib2 import parse_keqv_list as parse_keqv_list +from urllib import ( + FancyURLopener as FancyURLopener, + URLopener as URLopener, + getproxies as getproxies, + pathname2url as pathname2url, + proxy_bypass as proxy_bypass, + url2pathname as url2pathname, + urlcleanup as urlcleanup, + urlretrieve as urlretrieve, +) +from urllib2 import ( + AbstractBasicAuthHandler as AbstractBasicAuthHandler, + AbstractDigestAuthHandler as AbstractDigestAuthHandler, + BaseHandler as BaseHandler, + CacheFTPHandler as CacheFTPHandler, + FileHandler as FileHandler, + FTPHandler as FTPHandler, + HTTPBasicAuthHandler as HTTPBasicAuthHandler, + HTTPCookieProcessor as HTTPCookieProcessor, + HTTPDefaultErrorHandler as HTTPDefaultErrorHandler, + HTTPDigestAuthHandler as HTTPDigestAuthHandler, + HTTPErrorProcessor as HTTPErrorProcessor, + HTTPHandler as HTTPHandler, + HTTPPasswordMgr as HTTPPasswordMgr, + HTTPPasswordMgrWithDefaultRealm as HTTPPasswordMgrWithDefaultRealm, + HTTPRedirectHandler as HTTPRedirectHandler, + HTTPSHandler as HTTPSHandler, + OpenerDirector as OpenerDirector, + ProxyBasicAuthHandler as ProxyBasicAuthHandler, + ProxyDigestAuthHandler as ProxyDigestAuthHandler, + ProxyHandler as ProxyHandler, + Request as Request, + UnknownHandler as UnknownHandler, + build_opener as build_opener, + install_opener as install_opener, + parse_http_list as parse_http_list, + parse_keqv_list as parse_keqv_list, + urlopen as urlopen, +) diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib/response.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib/response.pyi old mode 100755 new mode 100644 index 83e117fb..b560da8a --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib/response.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib/response.pyi @@ -1,5 +1 @@ -# Stubs for six.moves.urllib.response -from urllib import addbase as addbase -from urllib import addclosehook as addclosehook -from urllib import addinfo as addinfo -from urllib import addinfourl as addinfourl +from urllib import addbase as addbase, addclosehook as addclosehook, addinfo as addinfo, addinfourl as addinfourl diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib/robotparser.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib/robotparser.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib_error.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib_error.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib_parse.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib_parse.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib_request.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib_request.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib_response.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib_response.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib_robotparser.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/urllib_robotparser.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/xmlrpc_client.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/six/moves/xmlrpc_client.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/tornado/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/tornado/__init__.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/tornado/concurrent.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/tornado/concurrent.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/tornado/gen.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/tornado/gen.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/tornado/httpclient.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/tornado/httpclient.pyi old mode 100755 new mode 100644 index f1070933..16bdb285 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2/tornado/httpclient.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2/tornado/httpclient.pyi @@ -1,4 +1,5 @@ from typing import Any + from tornado.util import Configurable class HTTPClient: @@ -52,12 +53,41 @@ class HTTPRequest: ssl_options: Any expect_100_continue: Any start_time: Any - def __init__(self, url, method=..., headers=..., body=..., auth_username=..., auth_password=..., auth_mode=..., - connect_timeout=..., request_timeout=..., if_modified_since=..., follow_redirects=..., max_redirects=..., - user_agent=..., use_gzip=..., network_interface=..., streaming_callback=..., header_callback=..., - prepare_curl_callback=..., proxy_host=..., proxy_port=..., proxy_username=..., proxy_password=..., - allow_nonstandard_methods=..., validate_cert=..., ca_certs=..., allow_ipv6=..., client_key=..., client_cert=..., - body_producer=..., expect_100_continue=..., decompress_response=..., ssl_options=...) -> None: ... + def __init__( + self, + url, + method=..., + headers=..., + body=..., + auth_username=..., + auth_password=..., + auth_mode=..., + connect_timeout=..., + request_timeout=..., + if_modified_since=..., + follow_redirects=..., + max_redirects=..., + user_agent=..., + use_gzip=..., + network_interface=..., + streaming_callback=..., + header_callback=..., + prepare_curl_callback=..., + proxy_host=..., + proxy_port=..., + proxy_username=..., + proxy_password=..., + allow_nonstandard_methods=..., + validate_cert=..., + ca_certs=..., + allow_ipv6=..., + client_key=..., + client_cert=..., + body_producer=..., + expect_100_continue=..., + decompress_response=..., + ssl_options=..., + ) -> None: ... @property def headers(self): ... @headers.setter @@ -77,9 +107,10 @@ class HTTPResponse: error: Any request_time: Any time_info: Any - def __init__(self, request, code, headers=..., buffer=..., effective_url=..., error=..., request_time=..., time_info=..., - reason=...) -> None: ... - body: Any + def __init__( + self, request, code, headers=..., buffer=..., effective_url=..., error=..., request_time=..., time_info=..., reason=... + ) -> None: ... + body: bytes def rethrow(self): ... class HTTPError(Exception): diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/tornado/httpserver.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/tornado/httpserver.pyi old mode 100755 new mode 100644 index 9bcf99a8..60806f1d --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2/tornado/httpserver.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2/tornado/httpserver.pyi @@ -1,4 +1,5 @@ from typing import Any + from tornado import httputil from tornado.tcpserver import TCPServer from tornado.util import Configurable @@ -10,9 +11,22 @@ class HTTPServer(TCPServer, Configurable, httputil.HTTPServerConnectionDelegate) xheaders: Any protocol: Any conn_params: Any - def initialize(self, request_callback, no_keep_alive=..., io_loop=..., xheaders=..., ssl_options=..., protocol=..., - decompress_request=..., chunk_size=..., max_header_size=..., idle_connection_timeout=..., body_timeout=..., - max_body_size=..., max_buffer_size=...): ... + def initialize( + self, + request_callback, + no_keep_alive=..., + io_loop=..., + xheaders=..., + ssl_options=..., + protocol=..., + decompress_request=..., + chunk_size=..., + max_header_size=..., + idle_connection_timeout=..., + body_timeout=..., + max_body_size=..., + max_buffer_size=..., + ): ... @classmethod def configurable_base(cls): ... @classmethod diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/tornado/httputil.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/tornado/httputil.pyi old mode 100755 new mode 100644 index 85a08ebc..436adc98 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2/tornado/httputil.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2/tornado/httputil.pyi @@ -1,4 +1,4 @@ -from typing import Any, Dict, NamedTuple +from typing import Any, Dict, List, NamedTuple, Optional from tornado.util import ObjectDict @@ -29,21 +29,24 @@ class HTTPHeaders(Dict[Any, Any]): def __deepcopy__(self, memo_dict): ... class HTTPServerRequest: - method: Any - uri: Any - version: Any - headers: Any - body: Any + path: str + query: str + method: Optional[str] + uri: Optional[str] + version: str + headers: HTTPHeaders + body: bytes remote_ip: Any protocol: Any - host: Any - files: Any - connection: Any - arguments: Any - query_arguments: Any - body_arguments: Any - def __init__(self, method=..., uri=..., version=..., headers=..., body=..., host=..., files=..., connection=..., - start_line=...) -> None: ... + host: str + files: Dict[str, List[HTTPFile]] + connection: Optional[HTTPConnection] + arguments: Dict[str, List[bytes]] + query_arguments: Dict[str, List[bytes]] + body_arguments: Dict[str, List[bytes]] + def __init__( + self, method=..., uri=..., version=..., headers=..., body=..., host=..., files=..., connection=..., start_line=... + ) -> None: ... def supports_http_1_1(self): ... @property def cookies(self): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/tornado/ioloop.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/tornado/ioloop.pyi old mode 100755 new mode 100644 index 92c3548e..541c5868 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2/tornado/ioloop.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2/tornado/ioloop.pyi @@ -1,4 +1,5 @@ from typing import Any + from tornado.util import Configurable signal: Any diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/tornado/locks.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/tornado/locks.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/tornado/netutil.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/tornado/netutil.pyi old mode 100755 new mode 100644 index 53c8fc70..ca8af80a --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2/tornado/netutil.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2/tornado/netutil.pyi @@ -1,4 +1,5 @@ from typing import Any + from tornado.util import Configurable ssl: Any diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/tornado/process.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/tornado/process.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/tornado/tcpserver.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/tornado/tcpserver.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/tornado/testing.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/tornado/testing.pyi old mode 100755 new mode 100644 index c1002581..cfc46945 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2/tornado/testing.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2/tornado/testing.pyi @@ -1,6 +1,6 @@ -from typing import Any, Callable, Generator, Optional, overload -import unittest import logging +import unittest +from typing import Any, Callable, Generator, Optional, overload AsyncHTTPClient: Any gen: Any diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/tornado/util.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/tornado/util.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/tornado/web.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2/tornado/web.pyi old mode 100755 new mode 100644 index c63f414d..0c594bae --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2/tornado/web.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2/tornado/web.pyi @@ -1,4 +1,6 @@ -from typing import Any +import sys +from typing import Any, Callable, Dict, List, Optional + from tornado import httputil MIN_SUPPORTED_SIGNED_VALUE_VERSION: Any @@ -6,24 +8,31 @@ MAX_SUPPORTED_SIGNED_VALUE_VERSION: Any DEFAULT_SIGNED_VALUE_VERSION: Any DEFAULT_SIGNED_VALUE_MIN_VERSION: Any +if sys.version_info >= (3, 5): + from typing import Awaitable + + _MethodType = Callable[..., Optional[Awaitable[None]]] +else: + _MethodType = Callable[..., Any] + class RequestHandler: SUPPORTED_METHODS: Any - application: Any - request: Any - path_args: Any - path_kwargs: Any + application: Application + request: httputil.HTTPServerRequest + path_args: List[str] + path_kwargs: Dict[str, str] ui: Any def __init__(self, application, request, **kwargs) -> None: ... - def initialize(self): ... + initialize: Callable[..., None] = ... @property def settings(self): ... - def head(self, *args, **kwargs): ... - def get(self, *args, **kwargs): ... - def post(self, *args, **kwargs): ... - def delete(self, *args, **kwargs): ... - def patch(self, *args, **kwargs): ... - def put(self, *args, **kwargs): ... - def options(self, *args, **kwargs): ... + head: _MethodType + get: _MethodType + post: _MethodType + delete: _MethodType + patch: _MethodType + put: _MethodType + options: _MethodType def prepare(self): ... def on_finish(self): ... def on_connection_close(self): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/AES.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/AES.pyi deleted file mode 100755 index 144ccfa0..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/AES.pyi +++ /dev/null @@ -1,19 +0,0 @@ -from typing import Any, Union, Text -from .blockalgo import BlockAlgo - -__revision__: str - -class AESCipher(BlockAlgo): - def __init__(self, key: Union[bytes, Text], *args, **kwargs) -> None: ... - -def new(key: Union[bytes, Text], *args, **kwargs) -> AESCipher: ... - -MODE_ECB: int -MODE_CBC: int -MODE_CFB: int -MODE_PGP: int -MODE_OFB: int -MODE_CTR: int -MODE_OPENPGP: int -block_size: int -key_size: int diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/ARC2.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/ARC2.pyi deleted file mode 100755 index 24a12ea1..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/ARC2.pyi +++ /dev/null @@ -1,19 +0,0 @@ -from typing import Any, Union, Text -from .blockalgo import BlockAlgo - -__revision__: str - -class RC2Cipher(BlockAlgo): - def __init__(self, key: Union[bytes, Text], *args, **kwargs) -> None: ... - -def new(key: Union[bytes, Text], *args, **kwargs) -> RC2Cipher: ... - -MODE_ECB: int -MODE_CBC: int -MODE_CFB: int -MODE_PGP: int -MODE_OFB: int -MODE_CTR: int -MODE_OPENPGP: int -block_size: int -key_size: int diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/ARC4.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/ARC4.pyi deleted file mode 100755 index 109e2bfd..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/ARC4.pyi +++ /dev/null @@ -1,15 +0,0 @@ -from typing import Any, Union, Text - -__revision__: str - -class ARC4Cipher: - block_size: int - key_size: int - def __init__(self, key: Union[bytes, Text], *args, **kwargs) -> None: ... - def encrypt(self, plaintext): ... - def decrypt(self, ciphertext): ... - -def new(key: Union[bytes, Text], *args, **kwargs) -> ARC4Cipher: ... - -block_size: int -key_size: int diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/Blowfish.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/Blowfish.pyi deleted file mode 100755 index e29ca6b1..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/Blowfish.pyi +++ /dev/null @@ -1,19 +0,0 @@ -from typing import Any, Union, Text -from .blockalgo import BlockAlgo - -__revision__: str - -class BlowfishCipher(BlockAlgo): - def __init__(self, key: Union[bytes, Text], *args, **kwargs) -> None: ... - -def new(key: Union[bytes, Text], *args, **kwargs) -> BlowfishCipher: ... - -MODE_ECB: int -MODE_CBC: int -MODE_CFB: int -MODE_PGP: int -MODE_OFB: int -MODE_CTR: int -MODE_OPENPGP: int -block_size: int -key_size: Any diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/CAST.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/CAST.pyi deleted file mode 100755 index b2919193..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/CAST.pyi +++ /dev/null @@ -1,19 +0,0 @@ -from typing import Any, Union, Text -from .blockalgo import BlockAlgo - -__revision__: str - -class CAST128Cipher(BlockAlgo): - def __init__(self, key: Union[bytes, Text], *args, **kwargs) -> None: ... - -def new(key: Union[bytes, Text], *args, **kwargs) -> CAST128Cipher: ... - -MODE_ECB: int -MODE_CBC: int -MODE_CFB: int -MODE_PGP: int -MODE_OFB: int -MODE_CTR: int -MODE_OPENPGP: int -block_size: int -key_size: Any diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/DES.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/DES.pyi deleted file mode 100755 index 30a40dd4..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/DES.pyi +++ /dev/null @@ -1,19 +0,0 @@ -from typing import Any, Union, Text -from .blockalgo import BlockAlgo - -__revision__: str - -class DESCipher(BlockAlgo): - def __init__(self, key: Union[bytes, Text], *args, **kwargs) -> None: ... - -def new(key: Union[bytes, Text], *args, **kwargs) -> DESCipher: ... - -MODE_ECB: int -MODE_CBC: int -MODE_CFB: int -MODE_PGP: int -MODE_OFB: int -MODE_CTR: int -MODE_OPENPGP: int -block_size: int -key_size: int diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/DES3.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/DES3.pyi deleted file mode 100755 index 59ccd8f2..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/DES3.pyi +++ /dev/null @@ -1,20 +0,0 @@ -from typing import Any, Union, Text - -from .blockalgo import BlockAlgo - -__revision__: str - -class DES3Cipher(BlockAlgo): - def __init__(self, key: Union[bytes, Text], *args, **kwargs) -> None: ... - -def new(key: Union[bytes, Text], *args, **kwargs) -> DES3Cipher: ... - -MODE_ECB: int -MODE_CBC: int -MODE_CFB: int -MODE_PGP: int -MODE_OFB: int -MODE_CTR: int -MODE_OPENPGP: int -block_size: int -key_size: Any diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/PKCS1_OAEP.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/PKCS1_OAEP.pyi deleted file mode 100755 index 50980a46..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/PKCS1_OAEP.pyi +++ /dev/null @@ -1,13 +0,0 @@ -from typing import Any, Optional, Union, Text - -from Crypto.PublicKey.RSA import _RSAobj - -class PKCS1OAEP_Cipher: - def __init__(self, key: _RSAobj, hashAlgo: Any, mgfunc: Any, label: Any) -> None: ... - def can_encrypt(self): ... - def can_decrypt(self): ... - def encrypt(self, message: Union[bytes, Text]) -> bytes: ... - def decrypt(self, ct: bytes) -> bytes: ... - - -def new(key: _RSAobj, hashAlgo: Optional[Any] = ..., mgfunc: Optional[Any] = ..., label: Any = ...) -> PKCS1OAEP_Cipher: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/PKCS1_v1_5.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/PKCS1_v1_5.pyi deleted file mode 100755 index c2b9ea1a..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/PKCS1_v1_5.pyi +++ /dev/null @@ -1,13 +0,0 @@ -from typing import Any, Union, Text - -from Crypto.PublicKey.RSA import _RSAobj - -class PKCS115_Cipher: - def __init__(self, key: _RSAobj) -> None: ... - def can_encrypt(self) -> bool: ... - def can_decrypt(self) -> bool: ... - rf: Any - def encrypt(self, message: Union[bytes, Text]) -> bytes: ... - def decrypt(self, ct: bytes, sentinel: Any) -> bytes: ... - -def new(key: _RSAobj) -> PKCS115_Cipher: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/XOR.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/XOR.pyi deleted file mode 100755 index 4c952c22..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/XOR.pyi +++ /dev/null @@ -1,16 +0,0 @@ -from typing import Any, Union, Text - -__revision__: str - -class XORCipher: - block_size: int - key_size: int - def __init__(self, key: Union[bytes, Text], *args, **kwargs) -> None: ... - def encrypt(self, plaintext: Union[bytes, Text]) -> bytes: ... - def decrypt(self, ciphertext: bytes) -> bytes: ... - - -def new(key: Union[bytes, Text], *args, **kwargs) -> XORCipher: ... - -block_size: int -key_size: int diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/__init__.pyi deleted file mode 100755 index 309f2746..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/__init__.pyi +++ /dev/null @@ -1,11 +0,0 @@ -# Names in __all__ with no definition: -# AES -# ARC2 -# ARC4 -# Blowfish -# CAST -# DES -# DES3 -# PKCS1_OAEP -# PKCS1_v1_5 -# XOR diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/blockalgo.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/blockalgo.pyi deleted file mode 100755 index 8286b7a3..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/blockalgo.pyi +++ /dev/null @@ -1,17 +0,0 @@ -from typing import Any, Union, Text - -MODE_ECB: int -MODE_CBC: int -MODE_CFB: int -MODE_PGP: int -MODE_OFB: int -MODE_CTR: int -MODE_OPENPGP: int - -class BlockAlgo: - mode: int - block_size: int - IV: Any - def __init__(self, factory: Any, key: Union[bytes, Text], *args, **kwargs) -> None: ... - def encrypt(self, plaintext: Union[bytes, Text]) -> bytes: ... - def decrypt(self, ciphertext: bytes) -> bytes: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/HMAC.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/HMAC.pyi deleted file mode 100755 index 5e2337d1..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/HMAC.pyi +++ /dev/null @@ -1,16 +0,0 @@ -from typing import Any, Optional - -digest_size: Any - -class HMAC: - digest_size: Any - digestmod: Any - outer: Any - inner: Any - def __init__(self, key, msg: Optional[Any] = ..., digestmod: Optional[Any] = ...) -> None: ... - def update(self, msg): ... - def copy(self): ... - def digest(self): ... - def hexdigest(self): ... - -def new(key, msg: Optional[Any] = ..., digestmod: Optional[Any] = ...): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/MD2.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/MD2.pyi deleted file mode 100755 index 1575b114..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/MD2.pyi +++ /dev/null @@ -1,13 +0,0 @@ -from typing import Any, Optional -from Crypto.Hash.hashalgo import HashAlgo - -class MD2Hash(HashAlgo): - oid: Any - digest_size: int - block_size: int - def __init__(self, data: Optional[Any] = ...) -> None: ... - def new(self, data: Optional[Any] = ...): ... - -def new(data: Optional[Any] = ...): ... - -digest_size: Any diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/MD4.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/MD4.pyi deleted file mode 100755 index 644b3bdb..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/MD4.pyi +++ /dev/null @@ -1,13 +0,0 @@ -from typing import Any, Optional -from Crypto.Hash.hashalgo import HashAlgo - -class MD4Hash(HashAlgo): - oid: Any - digest_size: int - block_size: int - def __init__(self, data: Optional[Any] = ...) -> None: ... - def new(self, data: Optional[Any] = ...): ... - -def new(data: Optional[Any] = ...): ... - -digest_size: Any diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/MD5.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/MD5.pyi deleted file mode 100755 index 52261ab3..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/MD5.pyi +++ /dev/null @@ -1,13 +0,0 @@ -from typing import Any, Optional -from Crypto.Hash.hashalgo import HashAlgo - -class MD5Hash(HashAlgo): - oid: Any - digest_size: int - block_size: int - def __init__(self, data: Optional[Any] = ...) -> None: ... - def new(self, data: Optional[Any] = ...): ... - -def new(data: Optional[Any] = ...): ... - -digest_size: Any diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/RIPEMD.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/RIPEMD.pyi deleted file mode 100755 index 3fe4ac53..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/RIPEMD.pyi +++ /dev/null @@ -1,13 +0,0 @@ -from typing import Any, Optional -from Crypto.Hash.hashalgo import HashAlgo - -class RIPEMD160Hash(HashAlgo): - oid: Any - digest_size: int - block_size: int - def __init__(self, data: Optional[Any] = ...) -> None: ... - def new(self, data: Optional[Any] = ...): ... - -def new(data: Optional[Any] = ...): ... - -digest_size: Any diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA.pyi deleted file mode 100755 index 145abd89..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA.pyi +++ /dev/null @@ -1,13 +0,0 @@ -from typing import Any, Optional -from Crypto.Hash.hashalgo import HashAlgo - -class SHA1Hash(HashAlgo): - oid: Any - digest_size: int - block_size: int - def __init__(self, data: Optional[Any] = ...) -> None: ... - def new(self, data: Optional[Any] = ...): ... - -def new(data: Optional[Any] = ...): ... - -digest_size: Any diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA224.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA224.pyi deleted file mode 100755 index fcd170fc..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA224.pyi +++ /dev/null @@ -1,13 +0,0 @@ -from typing import Any, Optional -from Crypto.Hash.hashalgo import HashAlgo - -class SHA224Hash(HashAlgo): - oid: Any - digest_size: int - block_size: int - def __init__(self, data: Optional[Any] = ...) -> None: ... - def new(self, data: Optional[Any] = ...): ... - -def new(data: Optional[Any] = ...): ... - -digest_size: Any diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA256.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA256.pyi deleted file mode 100755 index 2ee94720..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA256.pyi +++ /dev/null @@ -1,13 +0,0 @@ -from typing import Any, Optional -from Crypto.Hash.hashalgo import HashAlgo - -class SHA256Hash(HashAlgo): - oid: Any - digest_size: int - block_size: int - def __init__(self, data: Optional[Any] = ...) -> None: ... - def new(self, data: Optional[Any] = ...): ... - -def new(data: Optional[Any] = ...): ... - -digest_size: Any diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA384.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA384.pyi deleted file mode 100755 index ce63a32e..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA384.pyi +++ /dev/null @@ -1,13 +0,0 @@ -from typing import Any, Optional -from Crypto.Hash.hashalgo import HashAlgo - -class SHA384Hash(HashAlgo): - oid: Any - digest_size: int - block_size: int - def __init__(self, data: Optional[Any] = ...) -> None: ... - def new(self, data: Optional[Any] = ...): ... - -def new(data: Optional[Any] = ...): ... - -digest_size: Any diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA512.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA512.pyi deleted file mode 100755 index c59eb765..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA512.pyi +++ /dev/null @@ -1,13 +0,0 @@ -from typing import Any, Optional -from Crypto.Hash.hashalgo import HashAlgo - -class SHA512Hash(HashAlgo): - oid: Any - digest_size: int - block_size: int - def __init__(self, data: Optional[Any] = ...) -> None: ... - def new(self, data: Optional[Any] = ...): ... - -def new(data: Optional[Any] = ...): ... - -digest_size: Any diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/__init__.pyi deleted file mode 100755 index 9af06f41..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/__init__.pyi +++ /dev/null @@ -1,11 +0,0 @@ -# Names in __all__ with no definition: -# HMAC -# MD2 -# MD4 -# MD5 -# RIPEMD -# SHA -# SHA224 -# SHA256 -# SHA384 -# SHA512 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/hashalgo.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/hashalgo.pyi deleted file mode 100755 index 7c57e034..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/hashalgo.pyi +++ /dev/null @@ -1,11 +0,0 @@ -from typing import Any, Optional - -class HashAlgo: - digest_size: Any - block_size: Any - def __init__(self, hashFactory, data: Optional[Any] = ...) -> None: ... - def update(self, data): ... - def digest(self): ... - def hexdigest(self): ... - def copy(self): ... - def new(self, data: Optional[Any] = ...): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Protocol/AllOrNothing.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Protocol/AllOrNothing.pyi deleted file mode 100755 index a7ae7d66..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Protocol/AllOrNothing.pyi +++ /dev/null @@ -1,10 +0,0 @@ -from typing import Any, Optional - -__revision__: str - -def isInt(x): ... - -class AllOrNothing: - def __init__(self, ciphermodule, mode: Optional[Any] = ..., IV: Optional[Any] = ...) -> None: ... - def digest(self, text): ... - def undigest(self, blocks): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Protocol/Chaffing.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Protocol/Chaffing.pyi deleted file mode 100755 index d70e9f64..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Protocol/Chaffing.pyi +++ /dev/null @@ -1,5 +0,0 @@ -__revision__: str - -class Chaff: - def __init__(self, factor: float = ..., blocksper: int = ...) -> None: ... - def chaff(self, blocks): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Protocol/KDF.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Protocol/KDF.pyi deleted file mode 100755 index a10d8399..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Protocol/KDF.pyi +++ /dev/null @@ -1,7 +0,0 @@ -from typing import Any, Optional -from Crypto.Hash import SHA as SHA1 - -__revision__: str - -def PBKDF1(password, salt, dkLen, count: int = ..., hashAlgo: Optional[Any] = ...): ... -def PBKDF2(password, salt, dkLen: int = ..., count: int = ..., prf: Optional[Any] = ...): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Protocol/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Protocol/__init__.pyi deleted file mode 100755 index e3744e5e..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Protocol/__init__.pyi +++ /dev/null @@ -1,4 +0,0 @@ -# Names in __all__ with no definition: -# AllOrNothing -# Chaffing -# KDF diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/DSA.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/DSA.pyi deleted file mode 100755 index bc48d230..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/DSA.pyi +++ /dev/null @@ -1,27 +0,0 @@ -from typing import Any, Optional -from .pubkey import pubkey - -class _DSAobj(pubkey): - keydata: Any - implementation: Any - key: Any - def __init__(self, implementation, key) -> None: ... - def __getattr__(self, attrname): ... - def sign(self, M, K): ... - def verify(self, M, signature): ... - def has_private(self): ... - def size(self): ... - def can_blind(self): ... - def can_encrypt(self): ... - def can_sign(self): ... - def publickey(self): ... - -class DSAImplementation: - error: Any - def __init__(self, **kwargs) -> None: ... - def generate(self, bits, randfunc: Optional[Any] = ..., progress_func: Optional[Any] = ...): ... - def construct(self, tup): ... - -generate: Any -construct: Any -error: Any diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/ElGamal.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/ElGamal.pyi deleted file mode 100755 index 1a256a34..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/ElGamal.pyi +++ /dev/null @@ -1,19 +0,0 @@ -from typing import Any, Optional - -from Crypto.PublicKey.pubkey import pubkey -from Crypto.PublicKey.pubkey import * # noqa: F403 - -class error(Exception): ... - -def generate(bits, randfunc, progress_func: Optional[Any] = ...): ... -def construct(tup): ... - -class ElGamalobj(pubkey): - keydata: Any - def encrypt(self, plaintext, K): ... - def decrypt(self, ciphertext): ... - def sign(self, M, K): ... - def verify(self, M, signature): ... - def size(self): ... - def has_private(self): ... - def publickey(self): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/RSA.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/RSA.pyi deleted file mode 100755 index 5ce7b910..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/RSA.pyi +++ /dev/null @@ -1,32 +0,0 @@ -from typing import Any, Optional, Union, Text -from .pubkey import pubkey - -class _RSAobj(pubkey): - keydata: Any - implementation: Any - key: Any - def __init__(self, implementation, key, randfunc: Optional[Any] = ...) -> None: ... - def __getattr__(self, attrname): ... - def encrypt(self, plaintext, K): ... - def decrypt(self, ciphertext): ... - def sign(self, M, K): ... - def verify(self, M, signature): ... - def has_private(self): ... - def size(self): ... - def can_blind(self): ... - def can_encrypt(self): ... - def can_sign(self): ... - def publickey(self): ... - def exportKey(self, format: str = ..., passphrase: Optional[Any] = ..., pkcs: int = ...): ... - -class RSAImplementation: - error: Any - def __init__(self, **kwargs) -> None: ... - def generate(self, bits, randfunc: Optional[Any] = ..., progress_func: Optional[Any] = ..., e: int = ...): ... - def construct(self, tup): ... - def importKey(self, externKey: Any, passphrase: Union[None, bytes, Text] = ...) -> _RSAobj: ... - -generate: Any -construct: Any -importKey: Any -error: Any diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/__init__.pyi deleted file mode 100755 index 36d9e943..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/__init__.pyi +++ /dev/null @@ -1,4 +0,0 @@ -# Names in __all__ with no definition: -# DSA -# ElGamal -# RSA diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/pubkey.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/pubkey.pyi deleted file mode 100755 index b9281adb..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/pubkey.pyi +++ /dev/null @@ -1,21 +0,0 @@ -from Crypto.Util.number import * # noqa: F403 - -__revision__: str - -class pubkey: - def __init__(self) -> None: ... - def encrypt(self, plaintext, K): ... - def decrypt(self, ciphertext): ... - def sign(self, M, K): ... - def verify(self, M, signature): ... - def validate(self, M, signature): ... - def blind(self, M, B): ... - def unblind(self, M, B): ... - def can_sign(self): ... - def can_encrypt(self): ... - def can_blind(self): ... - def size(self): ... - def has_private(self): ... - def publickey(self): ... - def __eq__(self, other): ... - def __ne__(self, other): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/Fortuna/FortunaAccumulator.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/Fortuna/FortunaAccumulator.pyi deleted file mode 100755 index 40149bf1..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/Fortuna/FortunaAccumulator.pyi +++ /dev/null @@ -1,25 +0,0 @@ -from typing import Any - -__revision__: str - -class FortunaPool: - digest_size: Any - def __init__(self) -> None: ... - def append(self, data): ... - def digest(self): ... - def hexdigest(self): ... - length: int - def reset(self): ... - -def which_pools(r): ... - -class FortunaAccumulator: - min_pool_size: int - reseed_interval: float - reseed_count: int - generator: Any - last_reseed: Any - pools: Any - def __init__(self) -> None: ... - def random_data(self, bytes): ... - def add_random_event(self, source_number, pool_number, data): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/Fortuna/FortunaGenerator.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/Fortuna/FortunaGenerator.pyi deleted file mode 100755 index 047ac937..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/Fortuna/FortunaGenerator.pyi +++ /dev/null @@ -1,16 +0,0 @@ -from typing import Any - -__revision__: str - -class AESGenerator: - block_size: Any - key_size: int - max_blocks_per_request: Any - counter: Any - key: Any - block_size_shift: Any - blocks_per_key: Any - max_bytes_per_request: Any - def __init__(self) -> None: ... - def reseed(self, seed): ... - def pseudo_random_data(self, bytes): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/Fortuna/SHAd256.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/Fortuna/SHAd256.pyi deleted file mode 100755 index 1fbd51fe..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/Fortuna/SHAd256.pyi +++ /dev/null @@ -1,13 +0,0 @@ -from typing import Any, Optional - -class _SHAd256: - digest_size: Any - def __init__(self, internal_api_check, sha256_hash_obj) -> None: ... - def copy(self): ... - def digest(self): ... - def hexdigest(self): ... - def update(self, data): ... - -digest_size: Any - -def new(data: Optional[Any] = ...): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/OSRNG/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/OSRNG/__init__.pyi deleted file mode 100755 index d1f1427d..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/OSRNG/__init__.pyi +++ /dev/null @@ -1 +0,0 @@ -__revision__: str diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/OSRNG/fallback.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/OSRNG/fallback.pyi deleted file mode 100755 index 72df987c..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/OSRNG/fallback.pyi +++ /dev/null @@ -1,5 +0,0 @@ -from .rng_base import BaseRNG - -class PythonOSURandomRNG(BaseRNG): - name: str - def __init__(self) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/OSRNG/posix.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/OSRNG/posix.pyi deleted file mode 100755 index bbaf7404..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/OSRNG/posix.pyi +++ /dev/null @@ -1,6 +0,0 @@ -from typing import Any, Optional -from .rng_base import BaseRNG - -class DevURandomRNG(BaseRNG): - name: str - def __init__(self, devname: Optional[Any] = ...) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/OSRNG/rng_base.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/OSRNG/rng_base.pyi deleted file mode 100755 index 12e3d812..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/OSRNG/rng_base.pyi +++ /dev/null @@ -1,11 +0,0 @@ -__revision__: str - -class BaseRNG: - closed: bool - def __init__(self) -> None: ... - def __del__(self): ... - def __enter__(self): ... - def __exit__(self): ... - def close(self): ... - def flush(self): ... - def read(self, N: int = ...): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/__init__.pyi deleted file mode 100755 index f30acfd3..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/__init__.pyi +++ /dev/null @@ -1 +0,0 @@ -def new(*args, **kwargs): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/random.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/random.pyi deleted file mode 100755 index 88ea62e3..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/random.pyi +++ /dev/null @@ -1,17 +0,0 @@ -from typing import Any, Optional - -class StrongRandom: - def __init__(self, rng: Optional[Any] = ..., randfunc: Optional[Any] = ...) -> None: ... - def getrandbits(self, k): ... - def randrange(self, *args): ... - def randint(self, a, b): ... - def choice(self, seq): ... - def shuffle(self, x): ... - def sample(self, population, k): ... - -getrandbits: Any -randrange: Any -randint: Any -choice: Any -shuffle: Any -sample: Any diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Signature/PKCS1_PSS.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Signature/PKCS1_PSS.pyi deleted file mode 100755 index 8341c2b4..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Signature/PKCS1_PSS.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing import Any, Optional - -class PSS_SigScheme: - def __init__(self, key, mgfunc, saltLen) -> None: ... - def can_sign(self): ... - def sign(self, mhash): ... - def verify(self, mhash, S): ... - -def new(key, mgfunc: Optional[Any] = ..., saltLen: Optional[Any] = ...): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Signature/PKCS1_v1_5.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Signature/PKCS1_v1_5.pyi deleted file mode 100755 index 4a2b2253..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Signature/PKCS1_v1_5.pyi +++ /dev/null @@ -1,7 +0,0 @@ -class PKCS115_SigScheme: - def __init__(self, key) -> None: ... - def can_sign(self): ... - def sign(self, mhash): ... - def verify(self, mhash, S): ... - -def new(key): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Signature/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Signature/__init__.pyi deleted file mode 100755 index 560f06fd..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Signature/__init__.pyi +++ /dev/null @@ -1,3 +0,0 @@ -# Names in __all__ with no definition: -# PKCS1_PSS -# PKCS1_v1_5 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/Counter.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/Counter.pyi deleted file mode 100755 index 4aae7f26..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/Counter.pyi +++ /dev/null @@ -1,3 +0,0 @@ -from typing import Any - -def new(nbits, prefix: Any = ..., suffix: Any = ..., initial_value: int = ..., overflow: int = ..., little_endian: bool = ..., allow_wraparound: bool = ..., disable_shortcut: bool = ...): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/RFC1751.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/RFC1751.pyi deleted file mode 100755 index e1e8f5ef..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/RFC1751.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing import Any - -__revision__: str -binary: Any - -def key_to_english(key): ... -def english_to_key(s): ... - -wordlist: Any diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/__init__.pyi deleted file mode 100755 index 17472995..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/__init__.pyi +++ /dev/null @@ -1,6 +0,0 @@ -# Names in __all__ with no definition: -# RFC1751 -# asn1 -# number -# randpool -# strxor diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/asn1.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/asn1.pyi deleted file mode 100755 index 03d4b29f..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/asn1.pyi +++ /dev/null @@ -1,45 +0,0 @@ -from typing import Any, Optional - -class DerObject: - typeTags: Any - typeTag: Any - payload: Any - def __init__(self, ASN1Type: Optional[Any] = ..., payload: Any = ...) -> None: ... - def isType(self, ASN1Type): ... - def encode(self): ... - def decode(self, derEle, noLeftOvers: int = ...): ... - -class DerInteger(DerObject): - value: Any - def __init__(self, value: int = ...) -> None: ... - payload: Any - def encode(self): ... - def decode(self, derEle, noLeftOvers: int = ...): ... - -class DerSequence(DerObject): - def __init__(self, startSeq: Optional[Any] = ...) -> None: ... - def __delitem__(self, n): ... - def __getitem__(self, n): ... - def __setitem__(self, key, value): ... - def __setslice__(self, i, j, sequence): ... - def __delslice__(self, i, j): ... - def __getslice__(self, i, j): ... - def __len__(self): ... - def append(self, item): ... - def hasInts(self): ... - def hasOnlyInts(self): ... - payload: Any - def encode(self): ... - def decode(self, derEle, noLeftOvers: int = ...): ... - -class DerOctetString(DerObject): - payload: Any - def __init__(self, value: Any = ...) -> None: ... - def decode(self, derEle, noLeftOvers: int = ...): ... - -class DerNull(DerObject): - def __init__(self) -> None: ... - -class DerObjectId(DerObject): - def __init__(self) -> None: ... - def decode(self, derEle, noLeftOvers: int = ...): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/number.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/number.pyi deleted file mode 100755 index 4ffbd032..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/number.pyi +++ /dev/null @@ -1,22 +0,0 @@ -from typing import Any, Optional -from warnings import warn as _warn - -__revision__: str -bignum: Any - -def size(N): ... -def getRandomNumber(N, randfunc: Optional[Any] = ...): ... -def getRandomInteger(N, randfunc: Optional[Any] = ...): ... -def getRandomRange(a, b, randfunc: Optional[Any] = ...): ... -def getRandomNBitInteger(N, randfunc: Optional[Any] = ...): ... -def GCD(x, y): ... -def inverse(u, v): ... -def getPrime(N, randfunc: Optional[Any] = ...): ... -def getStrongPrime(N, e: int = ..., false_positive_prob: float = ..., randfunc: Optional[Any] = ...): ... -def isPrime(N, false_positive_prob: float = ..., randfunc: Optional[Any] = ...): ... -def long_to_bytes(n, blocksize: int = ...): ... -def bytes_to_long(s): ... -def long2str(n, blocksize: int = ...): ... -def str2long(s): ... - -sieve_base: Any diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/randpool.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/randpool.pyi deleted file mode 100755 index 4d90f920..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/randpool.pyi +++ /dev/null @@ -1,16 +0,0 @@ -from typing import Any, Optional - -__revision__: str - -class RandomPool: - bytes: Any - bits: Any - entropy: Any - def __init__(self, numbytes: int = ..., cipher: Optional[Any] = ..., hash: Optional[Any] = ..., file: Optional[Any] = ...) -> None: ... - def get_bytes(self, N): ... - def randomize(self, N: int = ...): ... - def stir(self, s: str = ...): ... - def stir_n(self, N: int = ...): ... - def add_event(self, s: str = ...): ... - def getBytes(self, N): ... - def addEvent(self, event, s: str = ...): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/strxor.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/strxor.pyi deleted file mode 100755 index cb6269bb..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/strxor.pyi +++ /dev/null @@ -1,2 +0,0 @@ -def strxor(*args, **kwargs): ... -def strxor_c(*args, **kwargs): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/__init__.pyi deleted file mode 100755 index 6d8e1248..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/__init__.pyi +++ /dev/null @@ -1,7 +0,0 @@ -# Names in __all__ with no definition: -# Cipher -# Hash -# Protocol -# PublicKey -# Signature -# Util diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/pct_warnings.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/pct_warnings.pyi deleted file mode 100755 index b77e975b..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/Crypto/pct_warnings.pyi +++ /dev/null @@ -1,7 +0,0 @@ -class CryptoWarning(Warning): ... -class CryptoDeprecationWarning(DeprecationWarning, CryptoWarning): ... -class CryptoRuntimeWarning(RuntimeWarning, CryptoWarning): ... -class RandomPool_DeprecationWarning(CryptoDeprecationWarning): ... -class ClockRewindWarning(CryptoRuntimeWarning): ... -class GetRandomNumber_DeprecationWarning(CryptoDeprecationWarning): ... -class PowmInsecureWarning(CryptoRuntimeWarning): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/atomicwrites/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/atomicwrites/__init__.pyi old mode 100755 new mode 100644 index cecbd10b..adf6803d --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/atomicwrites/__init__.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/atomicwrites/__init__.pyi @@ -1,15 +1,16 @@ -from typing import Any, AnyStr, Callable, ContextManager, Generic, IO, Optional, Text, Type, Union +from _typeshed import AnyPath +from typing import IO, Any, AnyStr, Callable, ContextManager, Optional, Text, Type def replace_atomic(src: AnyStr, dst: AnyStr) -> None: ... def move_atomic(src: AnyStr, dst: AnyStr) -> None: ... + class AtomicWriter(object): - def __init__(self, path: Union[Text, bytes], mode: Text = ..., overwrite: bool = ...) -> None: ... + def __init__(self, path: AnyPath, mode: Text = ..., overwrite: bool = ...) -> None: ... def open(self) -> ContextManager[IO[Any]]: ... def _open(self, get_fileobject: Callable[..., IO[AnyStr]]) -> ContextManager[IO[AnyStr]]: ... - def get_fileobject(self, dir: Union[None, Text, bytes] = ..., **kwargs: Any) -> IO[Any]: ... + def get_fileobject(self, dir: Optional[AnyPath] = ..., **kwargs: Any) -> IO[Any]: ... def sync(self, f: IO[Any]) -> None: ... def commit(self, f: IO[Any]) -> None: ... def rollback(self, f: IO[Any]) -> None: ... -def atomic_write( - path: Union[Text, bytes], writer_cls: Type[AtomicWriter] = ..., **cls_kwargs: object, -) -> ContextManager[IO[Any]]: ... + +def atomic_write(path: AnyPath, writer_cls: Type[AtomicWriter] = ..., **cls_kwargs: object) -> ContextManager[IO[Any]]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/attr/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/attr/__init__.pyi old mode 100755 new mode 100644 index fcb93b18..4c4b6964 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/attr/__init__.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/attr/__init__.pyi @@ -1,24 +1,19 @@ -from typing import ( - Any, - Callable, - Dict, - Generic, - List, - Optional, - Sequence, - Mapping, - Tuple, - Type, - TypeVar, - Union, - overload, -) +from typing import Any, Callable, Dict, Generic, List, Mapping, Optional, Sequence, Tuple, Type, TypeVar, Union, overload # `import X as X` is required to make these public -from . import exceptions as exceptions -from . import filters as filters -from . import converters as converters -from . import validators as validators +from . import converters as converters, exceptions as exceptions, filters as filters, validators as validators +from ._version_info import VersionInfo + +__version__: str +__version_info__: VersionInfo +__title__: str +__description__: str +__url__: str +__uri__: str +__author__: str +__email__: str +__license__: str +__copyright__: str _T = TypeVar("_T") _C = TypeVar("_C", bound=type) @@ -26,6 +21,8 @@ _C = TypeVar("_C", bound=type) _ValidatorType = Callable[[Any, Attribute[_T], _T], Any] _ConverterType = Callable[[Any], _T] _FilterType = Callable[[Attribute[_T], _T], bool] +_ReprType = Callable[[Any], str] +_ReprArgType = Union[bool, _ReprType] # FIXME: in reality, if multiple validators are passed they must be in a list or tuple, # but those are invariant and so would prevent subtypes of _ValidatorType from working # when passed in a list or tuple. @@ -40,27 +37,22 @@ NOTHING: object @overload def Factory(factory: Callable[[], _T]) -> _T: ... @overload -def Factory( - factory: Union[Callable[[Any], _T], Callable[[], _T]], - takes_self: bool = ..., -) -> _T: ... +def Factory(factory: Union[Callable[[Any], _T], Callable[[], _T]], takes_self: bool = ...) -> _T: ... class Attribute(Generic[_T]): name: str default: Optional[_T] validator: Optional[_ValidatorType[_T]] - repr: bool + repr: _ReprArgType cmp: bool + eq: bool + order: bool hash: Optional[bool] init: bool converter: Optional[_ConverterType[_T]] metadata: Dict[Any, Any] type: Optional[Type[_T]] kw_only: bool - def __lt__(self, x: Attribute[_T]) -> bool: ... - def __le__(self, x: Attribute[_T]) -> bool: ... - def __gt__(self, x: Attribute[_T]) -> bool: ... - def __ge__(self, x: Attribute[_T]) -> bool: ... # NOTE: We had several choices for the annotation to use for type arg: # 1) Type[_T] @@ -89,16 +81,17 @@ class Attribute(Generic[_T]): def attrib( default: None = ..., validator: None = ..., - repr: bool = ..., - cmp: bool = ..., + repr: _ReprArgType = ..., + cmp: Optional[bool] = ..., hash: Optional[bool] = ..., init: bool = ..., - convert: None = ..., metadata: Optional[Mapping[Any, Any]] = ..., type: None = ..., converter: None = ..., factory: None = ..., kw_only: bool = ..., + eq: Optional[bool] = ..., + order: Optional[bool] = ..., ) -> Any: ... # This form catches an explicit None or no default and infers the type from the other arguments. @@ -106,16 +99,17 @@ def attrib( def attrib( default: None = ..., validator: Optional[_ValidatorArgType[_T]] = ..., - repr: bool = ..., - cmp: bool = ..., + repr: _ReprArgType = ..., + cmp: Optional[bool] = ..., hash: Optional[bool] = ..., init: bool = ..., - convert: Optional[_ConverterType[_T]] = ..., metadata: Optional[Mapping[Any, Any]] = ..., type: Optional[Type[_T]] = ..., converter: Optional[_ConverterType[_T]] = ..., factory: Optional[Callable[[], _T]] = ..., kw_only: bool = ..., + eq: Optional[bool] = ..., + order: Optional[bool] = ..., ) -> _T: ... # This form catches an explicit default argument. @@ -123,16 +117,17 @@ def attrib( def attrib( default: _T, validator: Optional[_ValidatorArgType[_T]] = ..., - repr: bool = ..., - cmp: bool = ..., + repr: _ReprArgType = ..., + cmp: Optional[bool] = ..., hash: Optional[bool] = ..., init: bool = ..., - convert: Optional[_ConverterType[_T]] = ..., metadata: Optional[Mapping[Any, Any]] = ..., type: Optional[Type[_T]] = ..., converter: Optional[_ConverterType[_T]] = ..., factory: Optional[Callable[[], _T]] = ..., kw_only: bool = ..., + eq: Optional[bool] = ..., + order: Optional[bool] = ..., ) -> _T: ... # This form covers type=non-Type: e.g. forward references (str), Any @@ -140,16 +135,17 @@ def attrib( def attrib( default: Optional[_T] = ..., validator: Optional[_ValidatorArgType[_T]] = ..., - repr: bool = ..., - cmp: bool = ..., + repr: _ReprArgType = ..., + cmp: Optional[bool] = ..., hash: Optional[bool] = ..., init: bool = ..., - convert: Optional[_ConverterType[_T]] = ..., metadata: Optional[Mapping[Any, Any]] = ..., type: object = ..., converter: Optional[_ConverterType[_T]] = ..., factory: Optional[Callable[[], _T]] = ..., kw_only: bool = ..., + eq: Optional[bool] = ..., + order: Optional[bool] = ..., ) -> Any: ... @overload def attrs( @@ -157,7 +153,7 @@ def attrs( these: Optional[Dict[str, Any]] = ..., repr_ns: Optional[str] = ..., repr: bool = ..., - cmp: bool = ..., + cmp: Optional[bool] = ..., hash: Optional[bool] = ..., init: bool = ..., slots: bool = ..., @@ -168,6 +164,8 @@ def attrs( kw_only: bool = ..., cache_hash: bool = ..., auto_exc: bool = ..., + eq: Optional[bool] = ..., + order: Optional[bool] = ..., ) -> _C: ... @overload def attrs( @@ -175,7 +173,7 @@ def attrs( these: Optional[Dict[str, Any]] = ..., repr_ns: Optional[str] = ..., repr: bool = ..., - cmp: bool = ..., + cmp: Optional[bool] = ..., hash: Optional[bool] = ..., init: bool = ..., slots: bool = ..., @@ -186,6 +184,8 @@ def attrs( kw_only: bool = ..., cache_hash: bool = ..., auto_exc: bool = ..., + eq: Optional[bool] = ..., + order: Optional[bool] = ..., ) -> Callable[[_C], _C]: ... # TODO: add support for returning NamedTuple from the mypy plugin @@ -204,7 +204,7 @@ def make_class( bases: Tuple[type, ...] = ..., repr_ns: Optional[str] = ..., repr: bool = ..., - cmp: bool = ..., + cmp: Optional[bool] = ..., hash: Optional[bool] = ..., init: bool = ..., slots: bool = ..., @@ -215,6 +215,8 @@ def make_class( kw_only: bool = ..., cache_hash: bool = ..., auto_exc: bool = ..., + eq: Optional[bool] = ..., + order: Optional[bool] = ..., ) -> type: ... # _funcs -- diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/attr/_version_info.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/attr/_version_info.pyi new file mode 100644 index 00000000..45ced086 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/attr/_version_info.pyi @@ -0,0 +1,9 @@ +class VersionInfo: + @property + def year(self) -> int: ... + @property + def minor(self) -> int: ... + @property + def micro(self) -> int: ... + @property + def releaselevel(self) -> str: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/attr/converters.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/attr/converters.pyi old mode 100755 new mode 100644 index 63b2a386..70cb2606 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/attr/converters.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/attr/converters.pyi @@ -1,11 +1,10 @@ -from typing import TypeVar, Optional, Callable, overload +from typing import Callable, Optional, TypeVar, overload + from . import _ConverterType _T = TypeVar("_T") -def optional( - converter: _ConverterType[_T] -) -> _ConverterType[Optional[_T]]: ... +def optional(converter: _ConverterType[_T]) -> _ConverterType[Optional[_T]]: ... @overload def default_if_none(default: _T) -> _ConverterType[_T]: ... @overload diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/attr/exceptions.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/attr/exceptions.pyi old mode 100755 new mode 100644 index 48fffcc1..736fde2e --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/attr/exceptions.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/attr/exceptions.pyi @@ -1,3 +1,5 @@ +from typing import Any + class FrozenInstanceError(AttributeError): msg: str = ... @@ -5,3 +7,9 @@ class AttrsAttributeNotFoundError(ValueError): ... class NotAnAttrsClassError(ValueError): ... class DefaultAlreadySetError(RuntimeError): ... class UnannotatedAttributeError(RuntimeError): ... +class PythonTooOldError(RuntimeError): ... + +class NotCallableError(TypeError): + msg: str = ... + value: Any = ... + def __init__(self, msg: str, value: Any) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/attr/filters.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/attr/filters.pyi old mode 100755 new mode 100644 index 68368fe2..99386686 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/attr/filters.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/attr/filters.pyi @@ -1,4 +1,5 @@ -from typing import Union, Any +from typing import Any, Union + from . import Attribute, _FilterType def include(*what: Union[type, Attribute[Any]]) -> _FilterType[Any]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/attr/validators.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/attr/validators.pyi old mode 100755 new mode 100644 index 01af0684..49a7cbad --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/attr/validators.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/attr/validators.pyi @@ -1,24 +1,54 @@ -from typing import Container, List, Union, TypeVar, Type, Any, Optional, Tuple +from typing import ( + Any, + AnyStr, + Callable, + Container, + Iterable, + List, + Mapping, + Match, + Optional, + Tuple, + Type, + TypeVar, + Union, + overload, +) + from . import _ValidatorType _T = TypeVar("_T") +_T1 = TypeVar("_T1") +_T2 = TypeVar("_T2") +_T3 = TypeVar("_T3") +_I = TypeVar("_I", bound=Iterable) +_K = TypeVar("_K") +_V = TypeVar("_V") +_M = TypeVar("_M", bound=Mapping) -def instance_of( - type: Union[Tuple[Type[_T], ...], Type[_T]] -) -> _ValidatorType[_T]: ... +# To be more precise on instance_of use some overloads. +# If there are more than 3 items in the tuple then we fall back to Any +@overload +def instance_of(type: Type[_T]) -> _ValidatorType[_T]: ... +@overload +def instance_of(type: Tuple[Type[_T]]) -> _ValidatorType[_T]: ... +@overload +def instance_of(type: Tuple[Type[_T1], Type[_T2]]) -> _ValidatorType[Union[_T1, _T2]]: ... +@overload +def instance_of(type: Tuple[Type[_T1], Type[_T2], Type[_T3]]) -> _ValidatorType[Union[_T1, _T2, _T3]]: ... +@overload +def instance_of(type: Tuple[type, ...]) -> _ValidatorType[Any]: ... def provides(interface: Any) -> _ValidatorType[Any]: ... -def optional( - validator: Union[_ValidatorType[_T], List[_ValidatorType[_T]]] -) -> _ValidatorType[Optional[_T]]: ... +def optional(validator: Union[_ValidatorType[_T], List[_ValidatorType[_T]]]) -> _ValidatorType[Optional[_T]]: ... def in_(options: Container[_T]) -> _ValidatorType[_T]: ... def and_(*validators: _ValidatorType[_T]) -> _ValidatorType[_T]: ... +def matches_re( + regex: AnyStr, flags: int = ..., func: Optional[Callable[[AnyStr, AnyStr, int], Optional[Match[AnyStr]]]] = ... +) -> _ValidatorType[AnyStr]: ... def deep_iterable( - member_validator: _ValidatorType[_T], - iterable_validator: Optional[_ValidatorType[_T]], -) -> _ValidatorType[_T]: ... + member_validator: _ValidatorType[_T], iterable_validator: Optional[_ValidatorType[_I]] = ... +) -> _ValidatorType[_I]: ... def deep_mapping( - key_validator: _ValidatorType[_T], - value_validator: _ValidatorType[_T], - mapping_validator: Optional[_ValidatorType[_T]], -) -> _ValidatorType[_T]: ... + key_validator: _ValidatorType[_K], value_validator: _ValidatorType[_V], mapping_validator: Optional[_ValidatorType[_M]] = ... +) -> _ValidatorType[_M]: ... def is_callable() -> _ValidatorType[_T]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/backports/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/backports/__init__.pyi old mode 100755 new mode 100644 index e69de29b..cb0474fb --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/backports/__init__.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/backports/__init__.pyi @@ -0,0 +1,4 @@ +from typing import Any + +# Explicitly mark this package as incomplete. +def __getattr__(name: str) -> Any: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/backports/ssl_match_hostname.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/backports/ssl_match_hostname.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/backports_abc.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/backports_abc.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/bleach/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/bleach/__init__.pyi old mode 100755 new mode 100644 index 3a1ad2c4..82af5aad --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/bleach/__init__.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/bleach/__init__.pyi @@ -1,6 +1,6 @@ from typing import Any, Container, Iterable, Optional, Text -from bleach.linkifier import DEFAULT_CALLBACKS as DEFAULT_CALLBACKS, Linker as Linker +from bleach.linkifier import DEFAULT_CALLBACKS as DEFAULT_CALLBACKS, Linker as Linker, _Callback from bleach.sanitizer import ( ALLOWED_ATTRIBUTES as ALLOWED_ATTRIBUTES, ALLOWED_PROTOCOLS as ALLOWED_PROTOCOLS, @@ -9,8 +9,6 @@ from bleach.sanitizer import ( Cleaner as Cleaner, ) -from .linkifier import _Callback - __releasedate__: Text __version__: Text VERSION: Any # packaging.version.Version @@ -25,8 +23,5 @@ def clean( strip_comments: bool = ..., ) -> Text: ... def linkify( - text: Text, - callbacks: Iterable[_Callback] = ..., - skip_tags: Optional[Container[Text]] = ..., - parse_email: bool = ..., + text: Text, callbacks: Iterable[_Callback] = ..., skip_tags: Optional[Container[Text]] = ..., parse_email: bool = ... ) -> Text: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/bleach/callbacks.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/bleach/callbacks.pyi old mode 100755 new mode 100644 index 25c5c01e..d89fe1ea --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/bleach/callbacks.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/bleach/callbacks.pyi @@ -1,4 +1,4 @@ -from typing import MutableMapping, Any, Text +from typing import Any, MutableMapping, Text _Attrs = MutableMapping[Any, Text] diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/bleach/linkifier.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/bleach/linkifier.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/bleach/sanitizer.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/bleach/sanitizer.pyi old mode 100755 new mode 100644 index c6a7283c..669d7189 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/bleach/sanitizer.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/bleach/sanitizer.pyi @@ -1,4 +1,4 @@ -from typing import Any, Callable, Container, Dict, Iterable, List, Optional, Pattern, Text, Type, Union +from typing import Any, Callable, Container, Dict, Iterable, List, Optional, Pattern, Text, Union ALLOWED_TAGS: List[Text] ALLOWED_ATTRIBUTES: Dict[Text, List[Text]] diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/bleach/utils.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/bleach/utils.pyi old mode 100755 new mode 100644 index 984c554b..90940f08 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/bleach/utils.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/bleach/utils.pyi @@ -1,8 +1,8 @@ from collections import OrderedDict -from typing import overload, Mapping, Any, Text +from typing import Any, Mapping, Text, overload +def force_unicode(text: Text) -> Text: ... @overload def alphabetize_attributes(attrs: None) -> None: ... @overload def alphabetize_attributes(attrs: Mapping[Any, Text]) -> OrderedDict[Any, Text]: ... -def force_unicode(text: Text) -> Text: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/__init__.pyi old mode 100755 new mode 100644 index 8426785a..c298f74c --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/__init__.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/__init__.pyi @@ -1,5 +1,5 @@ -from typing import Any, Optional, Text import logging +from typing import Any, Optional, Text from .s3.connection import S3Connection @@ -23,7 +23,9 @@ perflog: Any def set_file_logger(name, filepath, level: Any = ..., format_string: Optional[Any] = ...): ... def set_stream_logger(name, level: Any = ..., format_string: Optional[Any] = ...): ... def connect_sqs(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... -def connect_s3(aws_access_key_id: Optional[Text] = ..., aws_secret_access_key: Optional[Text] = ..., **kwargs) -> S3Connection: ... +def connect_s3( + aws_access_key_id: Optional[Text] = ..., aws_secret_access_key: Optional[Text] = ..., **kwargs +) -> S3Connection: ... def connect_gs(gs_access_key_id: Optional[Any] = ..., gs_secret_access_key: Optional[Any] = ..., **kwargs): ... def connect_ec2(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... def connect_elb(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... @@ -41,17 +43,37 @@ def connect_sns(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: O def connect_iam(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... def connect_route53(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... def connect_cloudformation(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... -def connect_euca(host: Optional[Any] = ..., aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., port: int = ..., path: str = ..., is_secure: bool = ..., **kwargs): ... +def connect_euca( + host: Optional[Any] = ..., + aws_access_key_id: Optional[Any] = ..., + aws_secret_access_key: Optional[Any] = ..., + port: int = ..., + path: str = ..., + is_secure: bool = ..., + **kwargs, +): ... def connect_glacier(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... def connect_ec2_endpoint(url, aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... -def connect_walrus(host: Optional[Any] = ..., aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., port: int = ..., path: str = ..., is_secure: bool = ..., **kwargs): ... +def connect_walrus( + host: Optional[Any] = ..., + aws_access_key_id: Optional[Any] = ..., + aws_secret_access_key: Optional[Any] = ..., + port: int = ..., + path: str = ..., + is_secure: bool = ..., + **kwargs, +): ... def connect_ses(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... def connect_sts(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... -def connect_ia(ia_access_key_id: Optional[Any] = ..., ia_secret_access_key: Optional[Any] = ..., is_secure: bool = ..., **kwargs): ... +def connect_ia( + ia_access_key_id: Optional[Any] = ..., ia_secret_access_key: Optional[Any] = ..., is_secure: bool = ..., **kwargs +): ... def connect_dynamodb(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... def connect_swf(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... def connect_cloudsearch(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... -def connect_cloudsearch2(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., sign_request: bool = ..., **kwargs): ... +def connect_cloudsearch2( + aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., sign_request: bool = ..., **kwargs +): ... def connect_cloudsearchdomain(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... def connect_beanstalk(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... def connect_elastictranscoder(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... @@ -72,5 +94,16 @@ def connect_configservice(aws_access_key_id: Optional[Any] = ..., aws_secret_acc def connect_cloudhsm(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... def connect_ec2containerservice(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... def connect_machinelearning(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... -def storage_uri(uri_str, default_scheme: str = ..., debug: int = ..., validate: bool = ..., bucket_storage_uri_class: Any = ..., suppress_consec_slashes: bool = ..., is_latest: bool = ...): ... +def storage_uri( + uri_str, + default_scheme: str = ..., + debug: int = ..., + validate: bool = ..., + bucket_storage_uri_class: Any = ..., + suppress_consec_slashes: bool = ..., + is_latest: bool = ..., +): ... def storage_uri_for_key(key): ... + +# Explicitly mark this package as incomplete. +def __getattr__(name: str) -> Any: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/auth.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/auth.pyi old mode 100755 new mode 100644 index 033d1d79..f5995501 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/auth.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/auth.pyi @@ -1,4 +1,5 @@ from typing import Any, Optional + from boto.auth_handler import AuthHandler SIGV4_DETECT: Any diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/auth_handler.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/auth_handler.pyi old mode 100755 new mode 100644 index 018e6d1d..7cc874bc --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/auth_handler.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/auth_handler.pyi @@ -1,4 +1,5 @@ from typing import Any + from boto.plugin import Plugin class NotReadyToAuthenticate(Exception): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/compat.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/compat.pyi old mode 100755 new mode 100644 index ce997030..f9e10d65 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/compat.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/compat.pyi @@ -1,9 +1,12 @@ import sys - from typing import Any -from base64 import encodestring as encodebytes -from six.moves import http_client +if sys.version_info >= (3,): + from base64 import encodebytes as encodebytes +else: + from base64 import encodestring + + encodebytes = encodestring expanduser: Any diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/connection.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/connection.pyi old mode 100755 new mode 100644 index 820d6e3a..425e56de --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/connection.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/connection.pyi @@ -1,4 +1,5 @@ -from typing import Any, Dict, Optional, Text +from typing import Any, Optional + from six.moves import http_client HAVE_HTTPS_CONNECTION: bool @@ -63,7 +64,26 @@ class AWSAuthConnection: provider: Any auth_service_name: Any request_hook: Any - def __init__(self, host, aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., is_secure: bool = ..., port: Optional[Any] = ..., proxy: Optional[Any] = ..., proxy_port: Optional[Any] = ..., proxy_user: Optional[Any] = ..., proxy_pass: Optional[Any] = ..., debug: int = ..., https_connection_factory: Optional[Any] = ..., path: str = ..., provider: str = ..., security_token: Optional[Any] = ..., suppress_consec_slashes: bool = ..., validate_certs: bool = ..., profile_name: Optional[Any] = ...) -> None: ... + def __init__( + self, + host, + aws_access_key_id: Optional[Any] = ..., + aws_secret_access_key: Optional[Any] = ..., + is_secure: bool = ..., + port: Optional[Any] = ..., + proxy: Optional[Any] = ..., + proxy_port: Optional[Any] = ..., + proxy_user: Optional[Any] = ..., + proxy_pass: Optional[Any] = ..., + debug: int = ..., + https_connection_factory: Optional[Any] = ..., + path: str = ..., + provider: str = ..., + security_token: Optional[Any] = ..., + suppress_consec_slashes: bool = ..., + validate_certs: bool = ..., + profile_name: Optional[Any] = ..., + ) -> None: ... auth_region_name: Any @property def connection(self): ... @@ -98,14 +118,53 @@ class AWSAuthConnection: def get_proxy_url_with_auth(self): ... def set_host_header(self, request): ... def set_request_hook(self, hook): ... - def build_base_http_request(self, method, path, auth_path, params: Optional[Any] = ..., headers: Optional[Any] = ..., data: str = ..., host: Optional[Any] = ...): ... - def make_request(self, method, path, headers: Optional[Any] = ..., data: str = ..., host: Optional[Any] = ..., auth_path: Optional[Any] = ..., sender: Optional[Any] = ..., override_num_retries: Optional[Any] = ..., params: Optional[Any] = ..., retry_handler: Optional[Any] = ...): ... + def build_base_http_request( + self, + method, + path, + auth_path, + params: Optional[Any] = ..., + headers: Optional[Any] = ..., + data: str = ..., + host: Optional[Any] = ..., + ): ... + def make_request( + self, + method, + path, + headers: Optional[Any] = ..., + data: str = ..., + host: Optional[Any] = ..., + auth_path: Optional[Any] = ..., + sender: Optional[Any] = ..., + override_num_retries: Optional[Any] = ..., + params: Optional[Any] = ..., + retry_handler: Optional[Any] = ..., + ): ... def close(self): ... class AWSQueryConnection(AWSAuthConnection): APIVersion: str ResponseError: Any - def __init__(self, aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., is_secure: bool = ..., port: Optional[Any] = ..., proxy: Optional[Any] = ..., proxy_port: Optional[Any] = ..., proxy_user: Optional[Any] = ..., proxy_pass: Optional[Any] = ..., host: Optional[Any] = ..., debug: int = ..., https_connection_factory: Optional[Any] = ..., path: str = ..., security_token: Optional[Any] = ..., validate_certs: bool = ..., profile_name: Optional[Any] = ..., provider: str = ...) -> None: ... + def __init__( + self, + aws_access_key_id: Optional[Any] = ..., + aws_secret_access_key: Optional[Any] = ..., + is_secure: bool = ..., + port: Optional[Any] = ..., + proxy: Optional[Any] = ..., + proxy_port: Optional[Any] = ..., + proxy_user: Optional[Any] = ..., + proxy_pass: Optional[Any] = ..., + host: Optional[Any] = ..., + debug: int = ..., + https_connection_factory: Optional[Any] = ..., + path: str = ..., + security_token: Optional[Any] = ..., + validate_certs: bool = ..., + profile_name: Optional[Any] = ..., + provider: str = ..., + ) -> None: ... def get_utf8_value(self, value): ... def make_request(self, action, params: Optional[Any] = ..., path: str = ..., verb: str = ..., *args, **kwargs): ... # type: ignore # https://github.com/python/mypy/issues/1237 def build_list_params(self, params, items, label): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/ec2/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/ec2/__init__.pyi old mode 100755 new mode 100644 index d671c904..d44f942d --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/ec2/__init__.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/ec2/__init__.pyi @@ -5,3 +5,6 @@ RegionData: Any def regions(**kw_params): ... def connect_to_region(region_name, **kw_params): ... def get_region(region_name, **kw_params): ... + +# Explicitly mark this package as incomplete. +def __getattr__(name: str) -> Any: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/elb/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/elb/__init__.pyi old mode 100755 new mode 100644 index 16cf5b48..d2a79d5f --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/elb/__init__.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/elb/__init__.pyi @@ -1,4 +1,5 @@ from typing import Any + from boto.connection import AWSQueryConnection RegionData: Any @@ -11,10 +12,29 @@ class ELBConnection(AWSQueryConnection): DefaultRegionName: Any DefaultRegionEndpoint: Any region: Any - def __init__(self, aws_access_key_id=..., aws_secret_access_key=..., is_secure=..., port=..., proxy=..., proxy_port=..., proxy_user=..., proxy_pass=..., debug=..., https_connection_factory=..., region=..., path=..., security_token=..., validate_certs=..., profile_name=...) -> None: ... + def __init__( + self, + aws_access_key_id=..., + aws_secret_access_key=..., + is_secure=..., + port=..., + proxy=..., + proxy_port=..., + proxy_user=..., + proxy_pass=..., + debug=..., + https_connection_factory=..., + region=..., + path=..., + security_token=..., + validate_certs=..., + profile_name=..., + ) -> None: ... def build_list_params(self, params, items, label): ... def get_all_load_balancers(self, load_balancer_names=..., marker=...): ... - def create_load_balancer(self, name, zones, listeners=..., subnets=..., security_groups=..., scheme=..., complex_listeners=...): ... + def create_load_balancer( + self, name, zones, listeners=..., subnets=..., security_groups=..., scheme=..., complex_listeners=... + ): ... def create_load_balancer_listeners(self, name, listeners=..., complex_listeners=...): ... def delete_load_balancer(self, name): ... def delete_load_balancer_listeners(self, name, ports): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/exception.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/exception.pyi old mode 100755 new mode 100644 index e83a0740..a8db84c1 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/exception.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/exception.pyi @@ -1,4 +1,5 @@ from typing import Any, Optional + from boto.compat import StandardError class BotoClientError(StandardError): diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/kms/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/kms/__init__.pyi old mode 100755 new mode 100644 index 41fff607..ec5dfacb --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/kms/__init__.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/kms/__init__.pyi @@ -1,4 +1,5 @@ from typing import List + import boto.regioninfo def regions() -> List[boto.regioninfo.RegionInfo]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/kms/exceptions.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/kms/exceptions.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/kms/layer1.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/kms/layer1.pyi old mode 100755 new mode 100644 index f48ce665..86c57245 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/kms/layer1.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/kms/layer1.pyi @@ -1,4 +1,5 @@ from typing import Any, Dict, List, Mapping, Optional, Type + from boto.connection import AWSQueryConnection class KMSConnection(AWSQueryConnection): @@ -11,27 +12,71 @@ class KMSConnection(AWSQueryConnection): region: Any def __init__(self, **kwargs) -> None: ... def create_alias(self, alias_name: str, target_key_id: str) -> Optional[Dict[str, Any]]: ... - def create_grant(self, key_id: str, grantee_principal: str, retiring_principal: Optional[str] = ..., operations: Optional[List[str]] = ..., constraints: Optional[Dict[str, Dict[str, str]]] = ..., grant_tokens: Optional[List[str]] = ...) -> Optional[Dict[str, Any]]: ... - def create_key(self, policy: Optional[str] = ..., description: Optional[str] = ..., key_usage: Optional[str] = ...) -> Optional[Dict[str, Any]]: ... - def decrypt(self, ciphertext_blob: bytes, encryption_context: Optional[Mapping[str, Any]] = ..., grant_tokens: Optional[List[str]] = ...) -> Optional[Dict[str, Any]]: ... + def create_grant( + self, + key_id: str, + grantee_principal: str, + retiring_principal: Optional[str] = ..., + operations: Optional[List[str]] = ..., + constraints: Optional[Dict[str, Dict[str, str]]] = ..., + grant_tokens: Optional[List[str]] = ..., + ) -> Optional[Dict[str, Any]]: ... + def create_key( + self, policy: Optional[str] = ..., description: Optional[str] = ..., key_usage: Optional[str] = ... + ) -> Optional[Dict[str, Any]]: ... + def decrypt( + self, + ciphertext_blob: bytes, + encryption_context: Optional[Mapping[str, Any]] = ..., + grant_tokens: Optional[List[str]] = ..., + ) -> Optional[Dict[str, Any]]: ... def delete_alias(self, alias_name: str) -> Optional[Dict[str, Any]]: ... def describe_key(self, key_id: str) -> Optional[Dict[str, Any]]: ... def disable_key(self, key_id: str) -> Optional[Dict[str, Any]]: ... def disable_key_rotation(self, key_id: str) -> Optional[Dict[str, Any]]: ... def enable_key(self, key_id: str) -> Optional[Dict[str, Any]]: ... def enable_key_rotation(self, key_id: str) -> Optional[Dict[str, Any]]: ... - def encrypt(self, key_id: str, plaintext: bytes, encryption_context: Optional[Mapping[str, Any]] = ..., grant_tokens: Optional[List[str]] = ...) -> Optional[Dict[str, Any]]: ... - def generate_data_key(self, key_id: str, encryption_context: Optional[Mapping[str, Any]] = ..., number_of_bytes: Optional[int] = ..., key_spec: Optional[str] = ..., grant_tokens: Optional[List[str]] = ...) -> Optional[Dict[str, Any]]: ... - def generate_data_key_without_plaintext(self, key_id: str, encryption_context: Optional[Mapping[str, Any]] = ..., key_spec: Optional[str] = ..., number_of_bytes: Optional[int] = ..., grant_tokens: Optional[List[str]] = ...) -> Optional[Dict[str, Any]]: ... + def encrypt( + self, + key_id: str, + plaintext: bytes, + encryption_context: Optional[Mapping[str, Any]] = ..., + grant_tokens: Optional[List[str]] = ..., + ) -> Optional[Dict[str, Any]]: ... + def generate_data_key( + self, + key_id: str, + encryption_context: Optional[Mapping[str, Any]] = ..., + number_of_bytes: Optional[int] = ..., + key_spec: Optional[str] = ..., + grant_tokens: Optional[List[str]] = ..., + ) -> Optional[Dict[str, Any]]: ... + def generate_data_key_without_plaintext( + self, + key_id: str, + encryption_context: Optional[Mapping[str, Any]] = ..., + key_spec: Optional[str] = ..., + number_of_bytes: Optional[int] = ..., + grant_tokens: Optional[List[str]] = ..., + ) -> Optional[Dict[str, Any]]: ... def generate_random(self, number_of_bytes: Optional[int] = ...) -> Optional[Dict[str, Any]]: ... def get_key_policy(self, key_id: str, policy_name: str) -> Optional[Dict[str, Any]]: ... def get_key_rotation_status(self, key_id: str) -> Optional[Dict[str, Any]]: ... def list_aliases(self, limit: Optional[int] = ..., marker: Optional[str] = ...) -> Optional[Dict[str, Any]]: ... def list_grants(self, key_id: str, limit: Optional[int] = ..., marker: Optional[str] = ...) -> Optional[Dict[str, Any]]: ... - def list_key_policies(self, key_id: str, limit: Optional[int] = ..., marker: Optional[str] = ...) -> Optional[Dict[str, Any]]: ... + def list_key_policies( + self, key_id: str, limit: Optional[int] = ..., marker: Optional[str] = ... + ) -> Optional[Dict[str, Any]]: ... def list_keys(self, limit: Optional[int] = ..., marker: Optional[str] = ...) -> Optional[Dict[str, Any]]: ... def put_key_policy(self, key_id: str, policy_name: str, policy: str) -> Optional[Dict[str, Any]]: ... - def re_encrypt(self, ciphertext_blob: bytes, destination_key_id: str, source_encryption_context: Optional[Mapping[str, Any]] = ..., destination_encryption_context: Optional[Mapping[str, Any]] = ..., grant_tokens: Optional[List[str]] = ...) -> Optional[Dict[str, Any]]: ... + def re_encrypt( + self, + ciphertext_blob: bytes, + destination_key_id: str, + source_encryption_context: Optional[Mapping[str, Any]] = ..., + destination_encryption_context: Optional[Mapping[str, Any]] = ..., + grant_tokens: Optional[List[str]] = ..., + ) -> Optional[Dict[str, Any]]: ... def retire_grant(self, grant_token: str) -> Optional[Dict[str, Any]]: ... def revoke_grant(self, key_id: str, grant_id: str) -> Optional[Dict[str, Any]]: ... def update_key_description(self, key_id: str, description: str) -> Optional[Dict[str, Any]]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/plugin.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/plugin.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/regioninfo.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/regioninfo.pyi old mode 100755 new mode 100644 index 525b5655..20322edb --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/regioninfo.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/regioninfo.pyi @@ -10,7 +10,13 @@ class RegionInfo: name: Any endpoint: Any connection_cls: Any - def __init__(self, connection: Optional[Any] = ..., name: Optional[Any] = ..., endpoint: Optional[Any] = ..., connection_cls: Optional[Any] = ...) -> None: ... + def __init__( + self, + connection: Optional[Any] = ..., + name: Optional[Any] = ..., + endpoint: Optional[Any] = ..., + connection_cls: Optional[Any] = ..., + ) -> None: ... def startElement(self, name, attrs, connection): ... def endElement(self, name, value, connection): ... def connect(self, **kw_params): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/__init__.pyi old mode 100755 new mode 100644 index d88955e0..05f4b8ab --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/__init__.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/__init__.pyi @@ -1,14 +1,18 @@ -from typing import Optional - -from .connection import S3Connection +from typing import List, Optional, Text, Type from boto.connection import AWSAuthConnection from boto.regioninfo import RegionInfo -from typing import List, Type, Text +from .connection import S3Connection class S3RegionInfo(RegionInfo): - def connect(self, name: Optional[Text] = ..., endpoint: Optional[str] = ..., connection_cls: Optional[Type[AWSAuthConnection]] = ..., **kw_params) -> S3Connection: ... + def connect( + self, + name: Optional[Text] = ..., + endpoint: Optional[str] = ..., + connection_cls: Optional[Type[AWSAuthConnection]] = ..., + **kw_params, + ) -> S3Connection: ... def regions() -> List[S3RegionInfo]: ... def connect_to_region(region_name: Text, **kw_params): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/acl.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/acl.pyi old mode 100755 new mode 100644 index 168f914a..2afabb75 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/acl.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/acl.pyi @@ -1,6 +1,7 @@ +from typing import Any, Dict, List, Optional, Text, Union + from .connection import S3Connection from .user import User -from typing import Any, Dict, Optional, List, Text, Union CannedACLStrings: List[str] @@ -33,7 +34,15 @@ class Grant: uri: Text email_address: Text type: Text - def __init__(self, permission: Optional[Text] = ..., type: Optional[Text] = ..., id: Optional[Text] = ..., display_name: Optional[Text] = ..., uri: Optional[Text] = ..., email_address: Optional[Text] = ...) -> None: ... + def __init__( + self, + permission: Optional[Text] = ..., + type: Optional[Text] = ..., + id: Optional[Text] = ..., + display_name: Optional[Text] = ..., + uri: Optional[Text] = ..., + email_address: Optional[Text] = ..., + ) -> None: ... def startElement(self, name, attrs, connection): ... def endElement(self, name: Text, value: Any, connection: S3Connection) -> None: ... def to_xml(self) -> str: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/bucket.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/bucket.pyi old mode 100755 new mode 100644 index daed5021..7e61cba5 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/bucket.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/bucket.pyi @@ -1,13 +1,13 @@ +from typing import Any, Dict, List, Optional, Text, Type + from .bucketlistresultset import BucketListResultSet from .connection import S3Connection from .key import Key -from typing import Any, Dict, Optional, Text, Type, List - class S3WebsiteEndpointTranslate: trans_region: Dict[str, str] @classmethod - def translate_region(self, reg: Text) -> str: ... + def translate_region(cls, reg: Text) -> str: ... S3Permissions: List[str] @@ -20,7 +20,9 @@ class Bucket: name: Text connection: S3Connection key_class: Type[Key] - def __init__(self, connection: Optional[S3Connection] = ..., name: Optional[Text] = ..., key_class: Type[Key] = ...) -> None: ... + def __init__( + self, connection: Optional[S3Connection] = ..., name: Optional[Text] = ..., key_class: Type[Key] = ... + ) -> None: ... def __iter__(self): ... def __contains__(self, key_name) -> bool: ... def startElement(self, name, attrs, connection): ... @@ -28,45 +30,128 @@ class Bucket: def endElement(self, name, value, connection): ... def set_key_class(self, key_class): ... def lookup(self, key_name, headers: Optional[Dict[Text, Text]] = ...): ... - def get_key(self, key_name, headers: Optional[Dict[Text, Text]] = ..., version_id: Optional[Any] = ..., response_headers: Optional[Dict[Text, Text]] = ..., validate: bool = ...) -> Key: ... - def list(self, prefix: Text = ..., delimiter: Text = ..., marker: Text = ..., headers: Optional[Dict[Text, Text]] = ..., encoding_type: Optional[Any] = ...) -> BucketListResultSet: ... - def list_versions(self, prefix: str = ..., delimiter: str = ..., key_marker: str = ..., version_id_marker: str = ..., headers: Optional[Dict[Text, Text]] = ..., encoding_type: Optional[Text] = ...) -> BucketListResultSet: ... - def list_multipart_uploads(self, key_marker: str = ..., upload_id_marker: str = ..., headers: Optional[Dict[Text, Text]] = ..., encoding_type: Optional[Any] = ...): ... + def get_key( + self, + key_name, + headers: Optional[Dict[Text, Text]] = ..., + version_id: Optional[Any] = ..., + response_headers: Optional[Dict[Text, Text]] = ..., + validate: bool = ..., + ) -> Key: ... + def list( + self, + prefix: Text = ..., + delimiter: Text = ..., + marker: Text = ..., + headers: Optional[Dict[Text, Text]] = ..., + encoding_type: Optional[Any] = ..., + ) -> BucketListResultSet: ... + def list_versions( + self, + prefix: str = ..., + delimiter: str = ..., + key_marker: str = ..., + version_id_marker: str = ..., + headers: Optional[Dict[Text, Text]] = ..., + encoding_type: Optional[Text] = ..., + ) -> BucketListResultSet: ... + def list_multipart_uploads( + self, + key_marker: str = ..., + upload_id_marker: str = ..., + headers: Optional[Dict[Text, Text]] = ..., + encoding_type: Optional[Any] = ..., + ): ... def validate_kwarg_names(self, kwargs, names): ... def get_all_keys(self, headers: Optional[Dict[Text, Text]] = ..., **params): ... def get_all_versions(self, headers: Optional[Dict[Text, Text]] = ..., **params): ... def validate_get_all_versions_params(self, params): ... def get_all_multipart_uploads(self, headers: Optional[Dict[Text, Text]] = ..., **params): ... def new_key(self, key_name: Optional[Any] = ...): ... - def generate_url(self, expires_in, method: str = ..., headers: Optional[Dict[Text, Text]] = ..., force_http: bool = ..., response_headers: Optional[Dict[Text, Text]] = ..., expires_in_absolute: bool = ...): ... + def generate_url( + self, + expires_in, + method: str = ..., + headers: Optional[Dict[Text, Text]] = ..., + force_http: bool = ..., + response_headers: Optional[Dict[Text, Text]] = ..., + expires_in_absolute: bool = ..., + ): ... def delete_keys(self, keys, quiet: bool = ..., mfa_token: Optional[Any] = ..., headers: Optional[Dict[Text, Text]] = ...): ... - def delete_key(self, key_name, headers: Optional[Dict[Text, Text]] = ..., version_id: Optional[Any] = ..., mfa_token: Optional[Any] = ...): ... - def copy_key(self, new_key_name, src_bucket_name, src_key_name, metadata: Optional[Any] = ..., src_version_id: Optional[Any] = ..., storage_class: str = ..., preserve_acl: bool = ..., encrypt_key: bool = ..., headers: Optional[Dict[Text, Text]] = ..., query_args: Optional[Any] = ...): ... - def set_canned_acl(self, acl_str, key_name: str = ..., headers: Optional[Dict[Text, Text]] = ..., version_id: Optional[Any] = ...): ... + def delete_key( + self, key_name, headers: Optional[Dict[Text, Text]] = ..., version_id: Optional[Any] = ..., mfa_token: Optional[Any] = ... + ): ... + def copy_key( + self, + new_key_name, + src_bucket_name, + src_key_name, + metadata: Optional[Any] = ..., + src_version_id: Optional[Any] = ..., + storage_class: str = ..., + preserve_acl: bool = ..., + encrypt_key: bool = ..., + headers: Optional[Dict[Text, Text]] = ..., + query_args: Optional[Any] = ..., + ): ... + def set_canned_acl( + self, acl_str, key_name: str = ..., headers: Optional[Dict[Text, Text]] = ..., version_id: Optional[Any] = ... + ): ... def get_xml_acl(self, key_name: str = ..., headers: Optional[Dict[Text, Text]] = ..., version_id: Optional[Any] = ...): ... - def set_xml_acl(self, acl_str, key_name: str = ..., headers: Optional[Dict[Text, Text]] = ..., version_id: Optional[Any] = ..., query_args: str = ...): ... - def set_acl(self, acl_or_str, key_name: str = ..., headers: Optional[Dict[Text, Text]] = ..., version_id: Optional[Any] = ...): ... + def set_xml_acl( + self, + acl_str, + key_name: str = ..., + headers: Optional[Dict[Text, Text]] = ..., + version_id: Optional[Any] = ..., + query_args: str = ..., + ): ... + def set_acl( + self, acl_or_str, key_name: str = ..., headers: Optional[Dict[Text, Text]] = ..., version_id: Optional[Any] = ... + ): ... def get_acl(self, key_name: str = ..., headers: Optional[Dict[Text, Text]] = ..., version_id: Optional[Any] = ...): ... - def set_subresource(self, subresource, value, key_name: str = ..., headers: Optional[Dict[Text, Text]] = ..., version_id: Optional[Any] = ...): ... - def get_subresource(self, subresource, key_name: str = ..., headers: Optional[Dict[Text, Text]] = ..., version_id: Optional[Any] = ...): ... + def set_subresource( + self, subresource, value, key_name: str = ..., headers: Optional[Dict[Text, Text]] = ..., version_id: Optional[Any] = ... + ): ... + def get_subresource( + self, subresource, key_name: str = ..., headers: Optional[Dict[Text, Text]] = ..., version_id: Optional[Any] = ... + ): ... def make_public(self, recursive: bool = ..., headers: Optional[Dict[Text, Text]] = ...): ... def add_email_grant(self, permission, email_address, recursive: bool = ..., headers: Optional[Dict[Text, Text]] = ...): ... - def add_user_grant(self, permission, user_id, recursive: bool = ..., headers: Optional[Dict[Text, Text]] = ..., display_name: Optional[Any] = ...): ... + def add_user_grant( + self, + permission, + user_id, + recursive: bool = ..., + headers: Optional[Dict[Text, Text]] = ..., + display_name: Optional[Any] = ..., + ): ... def list_grants(self, headers: Optional[Dict[Text, Text]] = ...): ... def get_location(self): ... def set_xml_logging(self, logging_str, headers: Optional[Dict[Text, Text]] = ...): ... - def enable_logging(self, target_bucket, target_prefix: str = ..., grants: Optional[Any] = ..., headers: Optional[Dict[Text, Text]] = ...): ... + def enable_logging( + self, target_bucket, target_prefix: str = ..., grants: Optional[Any] = ..., headers: Optional[Dict[Text, Text]] = ... + ): ... def disable_logging(self, headers: Optional[Dict[Text, Text]] = ...): ... def get_logging_status(self, headers: Optional[Dict[Text, Text]] = ...): ... def set_as_logging_target(self, headers: Optional[Dict[Text, Text]] = ...): ... def get_request_payment(self, headers: Optional[Dict[Text, Text]] = ...): ... def set_request_payment(self, payer: str = ..., headers: Optional[Dict[Text, Text]] = ...): ... - def configure_versioning(self, versioning, mfa_delete: bool = ..., mfa_token: Optional[Any] = ..., headers: Optional[Dict[Text, Text]] = ...): ... + def configure_versioning( + self, versioning, mfa_delete: bool = ..., mfa_token: Optional[Any] = ..., headers: Optional[Dict[Text, Text]] = ... + ): ... def get_versioning_status(self, headers: Optional[Dict[Text, Text]] = ...): ... def configure_lifecycle(self, lifecycle_config, headers: Optional[Dict[Text, Text]] = ...): ... def get_lifecycle_config(self, headers: Optional[Dict[Text, Text]] = ...): ... def delete_lifecycle_configuration(self, headers: Optional[Dict[Text, Text]] = ...): ... - def configure_website(self, suffix: Optional[Any] = ..., error_key: Optional[Any] = ..., redirect_all_requests_to: Optional[Any] = ..., routing_rules: Optional[Any] = ..., headers: Optional[Dict[Text, Text]] = ...): ... + def configure_website( + self, + suffix: Optional[Any] = ..., + error_key: Optional[Any] = ..., + redirect_all_requests_to: Optional[Any] = ..., + routing_rules: Optional[Any] = ..., + headers: Optional[Dict[Text, Text]] = ..., + ): ... def set_website_configuration(self, config, headers: Optional[Dict[Text, Text]] = ...): ... def set_website_configuration_xml(self, xml, headers: Optional[Dict[Text, Text]] = ...): ... def get_website_configuration(self, headers: Optional[Dict[Text, Text]] = ...): ... @@ -83,7 +168,15 @@ class Bucket: def get_cors_xml(self, headers: Optional[Dict[Text, Text]] = ...): ... def get_cors(self, headers: Optional[Dict[Text, Text]] = ...): ... def delete_cors(self, headers: Optional[Dict[Text, Text]] = ...): ... - def initiate_multipart_upload(self, key_name, headers: Optional[Dict[Text, Text]] = ..., reduced_redundancy: bool = ..., metadata: Optional[Any] = ..., encrypt_key: bool = ..., policy: Optional[Any] = ...): ... + def initiate_multipart_upload( + self, + key_name, + headers: Optional[Dict[Text, Text]] = ..., + reduced_redundancy: bool = ..., + metadata: Optional[Any] = ..., + encrypt_key: bool = ..., + policy: Optional[Any] = ..., + ): ... def complete_multipart_upload(self, key_name, upload_id, xml_body, headers: Optional[Dict[Text, Text]] = ...): ... def cancel_multipart_upload(self, key_name, upload_id, headers: Optional[Dict[Text, Text]] = ...): ... def delete(self, headers: Optional[Dict[Text, Text]] = ...): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/bucketlistresultset.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/bucketlistresultset.pyi old mode 100755 new mode 100644 index b33d84d9..9a50278a --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/bucketlistresultset.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/bucketlistresultset.pyi @@ -1,9 +1,15 @@ -from .bucket import Bucket -from .key import Key - from typing import Any, Iterable, Iterator, Optional -def bucket_lister(bucket, prefix: str = ..., delimiter: str = ..., marker: str = ..., headers: Optional[Any] = ..., encoding_type: Optional[Any] = ...): ... +from .key import Key + +def bucket_lister( + bucket, + prefix: str = ..., + delimiter: str = ..., + marker: str = ..., + headers: Optional[Any] = ..., + encoding_type: Optional[Any] = ..., +): ... class BucketListResultSet(Iterable[Key]): bucket: Any @@ -12,10 +18,26 @@ class BucketListResultSet(Iterable[Key]): marker: Any headers: Any encoding_type: Any - def __init__(self, bucket: Optional[Any] = ..., prefix: str = ..., delimiter: str = ..., marker: str = ..., headers: Optional[Any] = ..., encoding_type: Optional[Any] = ...) -> None: ... + def __init__( + self, + bucket: Optional[Any] = ..., + prefix: str = ..., + delimiter: str = ..., + marker: str = ..., + headers: Optional[Any] = ..., + encoding_type: Optional[Any] = ..., + ) -> None: ... def __iter__(self) -> Iterator[Key]: ... -def versioned_bucket_lister(bucket, prefix: str = ..., delimiter: str = ..., key_marker: str = ..., version_id_marker: str = ..., headers: Optional[Any] = ..., encoding_type: Optional[Any] = ...): ... +def versioned_bucket_lister( + bucket, + prefix: str = ..., + delimiter: str = ..., + key_marker: str = ..., + version_id_marker: str = ..., + headers: Optional[Any] = ..., + encoding_type: Optional[Any] = ..., +): ... class VersionedBucketListResultSet: bucket: Any @@ -25,10 +47,21 @@ class VersionedBucketListResultSet: version_id_marker: Any headers: Any encoding_type: Any - def __init__(self, bucket: Optional[Any] = ..., prefix: str = ..., delimiter: str = ..., key_marker: str = ..., version_id_marker: str = ..., headers: Optional[Any] = ..., encoding_type: Optional[Any] = ...) -> None: ... + def __init__( + self, + bucket: Optional[Any] = ..., + prefix: str = ..., + delimiter: str = ..., + key_marker: str = ..., + version_id_marker: str = ..., + headers: Optional[Any] = ..., + encoding_type: Optional[Any] = ..., + ) -> None: ... def __iter__(self) -> Iterator[Key]: ... -def multipart_upload_lister(bucket, key_marker: str = ..., upload_id_marker: str = ..., headers: Optional[Any] = ..., encoding_type: Optional[Any] = ...): ... +def multipart_upload_lister( + bucket, key_marker: str = ..., upload_id_marker: str = ..., headers: Optional[Any] = ..., encoding_type: Optional[Any] = ... +): ... class MultiPartUploadListResultSet: bucket: Any @@ -36,5 +69,12 @@ class MultiPartUploadListResultSet: upload_id_marker: Any headers: Any encoding_type: Any - def __init__(self, bucket: Optional[Any] = ..., key_marker: str = ..., upload_id_marker: str = ..., headers: Optional[Any] = ..., encoding_type: Optional[Any] = ...) -> None: ... + def __init__( + self, + bucket: Optional[Any] = ..., + key_marker: str = ..., + upload_id_marker: str = ..., + headers: Optional[Any] = ..., + encoding_type: Optional[Any] = ..., + ) -> None: ... def __iter__(self): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/bucketlogging.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/bucketlogging.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/connection.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/connection.pyi old mode 100755 new mode 100644 index 9148e683..7cb5f7b8 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/connection.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/connection.pyi @@ -1,9 +1,10 @@ -from .bucket import Bucket - from typing import Any, Dict, Optional, Text, Type + from boto.connection import AWSAuthConnection from boto.exception import BotoClientError +from .bucket import Bucket + def check_lowercase_bucketname(n): ... def assert_case_insensitive(f): ... @@ -49,19 +50,79 @@ class S3Connection(AWSAuthConnection): calling_format: Any bucket_class: Type[Bucket] anon: Any - def __init__(self, aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., is_secure: bool = ..., port: Optional[Any] = ..., proxy: Optional[Any] = ..., proxy_port: Optional[Any] = ..., proxy_user: Optional[Any] = ..., proxy_pass: Optional[Any] = ..., host: Any = ..., debug: int = ..., https_connection_factory: Optional[Any] = ..., calling_format: Any = ..., path: str = ..., provider: str = ..., bucket_class: Type[Bucket] = ..., security_token: Optional[Any] = ..., suppress_consec_slashes: bool = ..., anon: bool = ..., validate_certs: Optional[Any] = ..., profile_name: Optional[Any] = ...) -> None: ... + def __init__( + self, + aws_access_key_id: Optional[Any] = ..., + aws_secret_access_key: Optional[Any] = ..., + is_secure: bool = ..., + port: Optional[Any] = ..., + proxy: Optional[Any] = ..., + proxy_port: Optional[Any] = ..., + proxy_user: Optional[Any] = ..., + proxy_pass: Optional[Any] = ..., + host: Any = ..., + debug: int = ..., + https_connection_factory: Optional[Any] = ..., + calling_format: Any = ..., + path: str = ..., + provider: str = ..., + bucket_class: Type[Bucket] = ..., + security_token: Optional[Any] = ..., + suppress_consec_slashes: bool = ..., + anon: bool = ..., + validate_certs: Optional[Any] = ..., + profile_name: Optional[Any] = ..., + ) -> None: ... def __iter__(self): ... def __contains__(self, bucket_name): ... def set_bucket_class(self, bucket_class: Type[Bucket]) -> None: ... def build_post_policy(self, expiration_time, conditions): ... - def build_post_form_args(self, bucket_name, key, expires_in: int = ..., acl: Optional[Any] = ..., success_action_redirect: Optional[Any] = ..., max_content_length: Optional[Any] = ..., http_method: str = ..., fields: Optional[Any] = ..., conditions: Optional[Any] = ..., storage_class: str = ..., server_side_encryption: Optional[Any] = ...): ... - def generate_url_sigv4(self, expires_in, method, bucket: str = ..., key: str = ..., headers: Optional[Dict[Text, Text]] = ..., force_http: bool = ..., response_headers: Optional[Dict[Text, Text]] = ..., version_id: Optional[Any] = ..., iso_date: Optional[Any] = ...): ... - def generate_url(self, expires_in, method, bucket: str = ..., key: str = ..., headers: Optional[Dict[Text, Text]] = ..., query_auth: bool = ..., force_http: bool = ..., response_headers: Optional[Dict[Text, Text]] = ..., expires_in_absolute: bool = ..., version_id: Optional[Any] = ...): ... + def build_post_form_args( + self, + bucket_name, + key, + expires_in: int = ..., + acl: Optional[Any] = ..., + success_action_redirect: Optional[Any] = ..., + max_content_length: Optional[Any] = ..., + http_method: str = ..., + fields: Optional[Any] = ..., + conditions: Optional[Any] = ..., + storage_class: str = ..., + server_side_encryption: Optional[Any] = ..., + ): ... + def generate_url_sigv4( + self, + expires_in, + method, + bucket: str = ..., + key: str = ..., + headers: Optional[Dict[Text, Text]] = ..., + force_http: bool = ..., + response_headers: Optional[Dict[Text, Text]] = ..., + version_id: Optional[Any] = ..., + iso_date: Optional[Any] = ..., + ): ... + def generate_url( + self, + expires_in, + method, + bucket: str = ..., + key: str = ..., + headers: Optional[Dict[Text, Text]] = ..., + query_auth: bool = ..., + force_http: bool = ..., + response_headers: Optional[Dict[Text, Text]] = ..., + expires_in_absolute: bool = ..., + version_id: Optional[Any] = ..., + ): ... def get_all_buckets(self, headers: Optional[Dict[Text, Text]] = ...): ... def get_canonical_user_id(self, headers: Optional[Dict[Text, Text]] = ...): ... def get_bucket(self, bucket_name: Text, validate: bool = ..., headers: Optional[Dict[Text, Text]] = ...) -> Bucket: ... def head_bucket(self, bucket_name, headers: Optional[Dict[Text, Text]] = ...): ... def lookup(self, bucket_name, validate: bool = ..., headers: Optional[Dict[Text, Text]] = ...): ... - def create_bucket(self, bucket_name, headers: Optional[Dict[Text, Text]] = ..., location: Any = ..., policy: Optional[Any] = ...): ... + def create_bucket( + self, bucket_name, headers: Optional[Dict[Text, Text]] = ..., location: Any = ..., policy: Optional[Any] = ... + ): ... def delete_bucket(self, bucket, headers: Optional[Dict[Text, Text]] = ...): ... def make_request(self, method, bucket: str = ..., key: str = ..., headers: Optional[Any] = ..., data: str = ..., query_args: Optional[Any] = ..., sender: Optional[Any] = ..., override_num_retries: Optional[Any] = ..., retry_handler: Optional[Any] = ..., *args, **kwargs): ... # type: ignore # https://github.com/python/mypy/issues/1237 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/cors.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/cors.pyi old mode 100755 new mode 100644 index af34ab81..45fe04a6 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/cors.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/cors.pyi @@ -7,7 +7,15 @@ class CORSRule: allowed_header: Any max_age_seconds: Any expose_header: Any - def __init__(self, allowed_method: Optional[Any] = ..., allowed_origin: Optional[Any] = ..., id: Optional[Any] = ..., allowed_header: Optional[Any] = ..., max_age_seconds: Optional[Any] = ..., expose_header: Optional[Any] = ...) -> None: ... + def __init__( + self, + allowed_method: Optional[Any] = ..., + allowed_origin: Optional[Any] = ..., + id: Optional[Any] = ..., + allowed_header: Optional[Any] = ..., + max_age_seconds: Optional[Any] = ..., + expose_header: Optional[Any] = ..., + ) -> None: ... def startElement(self, name, attrs, connection): ... def endElement(self, name, value, connection): ... def to_xml(self) -> str: ... @@ -16,4 +24,12 @@ class CORSConfiguration(List[CORSRule]): def startElement(self, name, attrs, connection): ... def endElement(self, name, value, connection): ... def to_xml(self) -> str: ... - def add_rule(self, allowed_method, allowed_origin, id: Optional[Any] = ..., allowed_header: Optional[Any] = ..., max_age_seconds: Optional[Any] = ..., expose_header: Optional[Any] = ...): ... + def add_rule( + self, + allowed_method, + allowed_origin, + id: Optional[Any] = ..., + allowed_header: Optional[Any] = ..., + max_age_seconds: Optional[Any] = ..., + expose_header: Optional[Any] = ..., + ): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/deletemarker.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/deletemarker.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/key.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/key.pyi old mode 100755 new mode 100644 index 4200e7ab..179b4947 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/key.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/key.pyi @@ -222,7 +222,8 @@ class Key: torrent: bool = ..., version_id: Optional[Any] = ..., response_headers: Optional[Dict[Text, Text]] = ..., - *, encoding: Text, + *, + encoding: Text, ) -> Text: ... def add_email_grant(self, permission, email_address, headers: Optional[Dict[Text, Text]] = ...): ... def add_user_grant( diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/keyfile.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/keyfile.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/lifecycle.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/lifecycle.pyi old mode 100755 new mode 100644 index fb42bb20..f34c112e --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/lifecycle.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/lifecycle.pyi @@ -6,7 +6,14 @@ class Rule: status: Any expiration: Any transition: Any - def __init__(self, id: Optional[Any] = ..., prefix: Optional[Any] = ..., status: Optional[Any] = ..., expiration: Optional[Any] = ..., transition: Optional[Any] = ...) -> None: ... + def __init__( + self, + id: Optional[Any] = ..., + prefix: Optional[Any] = ..., + status: Optional[Any] = ..., + expiration: Optional[Any] = ..., + transition: Optional[Any] = ..., + ) -> None: ... def startElement(self, name, attrs, connection): ... def endElement(self, name, value, connection): ... def to_xml(self): ... @@ -48,4 +55,11 @@ class Lifecycle(List[Rule]): def startElement(self, name, attrs, connection): ... def endElement(self, name, value, connection): ... def to_xml(self): ... - def add_rule(self, id: Optional[Any] = ..., prefix: str = ..., status: str = ..., expiration: Optional[Any] = ..., transition: Optional[Any] = ...): ... + def add_rule( + self, + id: Optional[Any] = ..., + prefix: str = ..., + status: str = ..., + expiration: Optional[Any] = ..., + transition: Optional[Any] = ..., + ): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/multidelete.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/multidelete.pyi old mode 100755 new mode 100644 index fa0c8dd3..b7f91651 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/multidelete.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/multidelete.pyi @@ -5,7 +5,13 @@ class Deleted: version_id: Any delete_marker: Any delete_marker_version_id: Any - def __init__(self, key: Optional[Any] = ..., version_id: Optional[Any] = ..., delete_marker: bool = ..., delete_marker_version_id: Optional[Any] = ...) -> None: ... + def __init__( + self, + key: Optional[Any] = ..., + version_id: Optional[Any] = ..., + delete_marker: bool = ..., + delete_marker_version_id: Optional[Any] = ..., + ) -> None: ... def startElement(self, name, attrs, connection): ... def endElement(self, name, value, connection): ... @@ -14,7 +20,9 @@ class Error: version_id: Any code: Any message: Any - def __init__(self, key: Optional[Any] = ..., version_id: Optional[Any] = ..., code: Optional[Any] = ..., message: Optional[Any] = ...) -> None: ... + def __init__( + self, key: Optional[Any] = ..., version_id: Optional[Any] = ..., code: Optional[Any] = ..., message: Optional[Any] = ... + ) -> None: ... def startElement(self, name, attrs, connection): ... def endElement(self, name, value, connection): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/multipart.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/multipart.pyi old mode 100755 new mode 100644 index 8463c4dd..f7dd85d4 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/multipart.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/multipart.pyi @@ -42,8 +42,29 @@ class MultiPartUpload: def to_xml(self): ... def startElement(self, name, attrs, connection): ... def endElement(self, name, value, connection): ... - def get_all_parts(self, max_parts: Optional[Any] = ..., part_number_marker: Optional[Any] = ..., encoding_type: Optional[Any] = ...): ... - def upload_part_from_file(self, fp, part_num, headers: Optional[Any] = ..., replace: bool = ..., cb: Optional[Any] = ..., num_cb: int = ..., md5: Optional[Any] = ..., size: Optional[Any] = ...): ... - def copy_part_from_key(self, src_bucket_name, src_key_name, part_num, start: Optional[Any] = ..., end: Optional[Any] = ..., src_version_id: Optional[Any] = ..., headers: Optional[Any] = ...): ... + def get_all_parts( + self, max_parts: Optional[Any] = ..., part_number_marker: Optional[Any] = ..., encoding_type: Optional[Any] = ... + ): ... + def upload_part_from_file( + self, + fp, + part_num, + headers: Optional[Any] = ..., + replace: bool = ..., + cb: Optional[Any] = ..., + num_cb: int = ..., + md5: Optional[Any] = ..., + size: Optional[Any] = ..., + ): ... + def copy_part_from_key( + self, + src_bucket_name, + src_key_name, + part_num, + start: Optional[Any] = ..., + end: Optional[Any] = ..., + src_version_id: Optional[Any] = ..., + headers: Optional[Any] = ..., + ): ... def complete_upload(self): ... def cancel_upload(self): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/prefix.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/prefix.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/tagging.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/tagging.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/user.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/user.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/website.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/website.pyi old mode 100755 new mode 100644 index 6bc90471..ef871f03 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/website.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/s3/website.pyi @@ -7,7 +7,13 @@ class WebsiteConfiguration: error_key: Any redirect_all_requests_to: Any routing_rules: Any - def __init__(self, suffix: Optional[Any] = ..., error_key: Optional[Any] = ..., redirect_all_requests_to: Optional[Any] = ..., routing_rules: Optional[Any] = ...) -> None: ... + def __init__( + self, + suffix: Optional[Any] = ..., + error_key: Optional[Any] = ..., + redirect_all_requests_to: Optional[Any] = ..., + routing_rules: Optional[Any] = ..., + ) -> None: ... def startElement(self, name, attrs, connection): ... def endElement(self, name, value, connection): ... def to_xml(self): ... @@ -42,7 +48,14 @@ class RoutingRule: def to_xml(self): ... @classmethod def when(cls, key_prefix: Optional[Any] = ..., http_error_code: Optional[Any] = ...): ... - def then_redirect(self, hostname: Optional[Any] = ..., protocol: Optional[Any] = ..., replace_key: Optional[Any] = ..., replace_key_prefix: Optional[Any] = ..., http_redirect_code: Optional[Any] = ...): ... + def then_redirect( + self, + hostname: Optional[Any] = ..., + protocol: Optional[Any] = ..., + replace_key: Optional[Any] = ..., + replace_key_prefix: Optional[Any] = ..., + http_redirect_code: Optional[Any] = ..., + ): ... class Condition(_XMLKeyValue): TRANSLATOR: Any @@ -58,5 +71,12 @@ class Redirect(_XMLKeyValue): replace_key: Any replace_key_prefix: Any http_redirect_code: Any - def __init__(self, hostname: Optional[Any] = ..., protocol: Optional[Any] = ..., replace_key: Optional[Any] = ..., replace_key_prefix: Optional[Any] = ..., http_redirect_code: Optional[Any] = ...) -> None: ... + def __init__( + self, + hostname: Optional[Any] = ..., + protocol: Optional[Any] = ..., + replace_key: Optional[Any] = ..., + replace_key_prefix: Optional[Any] = ..., + http_redirect_code: Optional[Any] = ..., + ) -> None: ... def to_xml(self): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/utils.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/utils.pyi old mode 100755 new mode 100644 index 7c927d83..c32370ad --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/utils.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/boto/utils.pyi @@ -3,14 +3,12 @@ import logging.handlers import subprocess import sys import time - -import boto.connection from typing import ( + IO, Any, Callable, ContextManager, Dict, - IO, Iterable, List, Mapping, @@ -22,24 +20,30 @@ from typing import ( Union, ) -_KT = TypeVar('_KT') -_VT = TypeVar('_VT') +import boto.connection + +_KT = TypeVar("_KT") +_VT = TypeVar("_VT") if sys.version_info >= (3,): # TODO move _StringIO definition into boto.compat once stubs exist and rename to StringIO import io + _StringIO = io.StringIO from hashlib import _Hash + _HashType = _Hash from email.message import Message as _Message else: # TODO move _StringIO definition into boto.compat once stubs exist and rename to StringIO import StringIO + _StringIO = StringIO.StringIO[Any] from hashlib import _hash + _HashType = _hash # TODO use email.message.Message once stubs exist @@ -48,11 +52,9 @@ else: _Provider = Any # TODO replace this with boto.provider.Provider once stubs exist _LockType = Any # TODO replace this with _thread.LockType once stubs exist - JSONDecodeError: Type[ValueError] qsa_of_interest: List[str] - def unquote_v(nv: str) -> Union[str, Tuple[str, str]]: ... def canonical_string( method: str, @@ -62,48 +64,22 @@ def canonical_string( provider: Optional[_Provider] = ..., ) -> str: ... def merge_meta( - headers: Mapping[str, str], - metadata: Mapping[str, str], - provider: Optional[_Provider] = ..., -) -> Mapping[str, str]: ... -def get_aws_metadata( - headers: Mapping[str, str], - provider: Optional[_Provider] = ..., + headers: Mapping[str, str], metadata: Mapping[str, str], provider: Optional[_Provider] = ... ) -> Mapping[str, str]: ... -def retry_url( - url: str, - retry_on_404: bool = ..., - num_retries: int = ..., - timeout: Optional[int] = ..., -) -> str: ... +def get_aws_metadata(headers: Mapping[str, str], provider: Optional[_Provider] = ...) -> Mapping[str, str]: ... +def retry_url(url: str, retry_on_404: bool = ..., num_retries: int = ..., timeout: Optional[int] = ...) -> str: ... class LazyLoadMetadata(Dict[_KT, _VT]): - def __init__( - self, - url: str, - num_retries: int, - timeout: Optional[int] = ..., - ) -> None: ... + def __init__(self, url: str, num_retries: int, timeout: Optional[int] = ...) -> None: ... def get_instance_metadata( - version: str = ..., - url: str = ..., - data: str = ..., - timeout: Optional[int] = ..., - num_retries: int = ..., + version: str = ..., url: str = ..., data: str = ..., timeout: Optional[int] = ..., num_retries: int = ... ) -> Optional[LazyLoadMetadata[Any, Any]]: ... def get_instance_identity( - version: str = ..., - url: str = ..., - timeout: Optional[int] = ..., - num_retries: int = ..., + version: str = ..., url: str = ..., timeout: Optional[int] = ..., num_retries: int = ... ) -> Optional[Mapping[str, Any]]: ... def get_instance_userdata( - version: str = ..., - sep: Optional[str] = ..., - url: str = ..., - timeout: Optional[int] = ..., - num_retries: int = ..., + version: str = ..., sep: Optional[str] = ..., url: str = ..., timeout: Optional[int] = ..., num_retries: int = ... ) -> Mapping[str, str]: ... ISO8601: str @@ -117,10 +93,7 @@ def parse_ts(ts: str) -> datetime.datetime: ... def find_class(module_name: str, class_name: Optional[str] = ...) -> Optional[Type[Any]]: ... def update_dme(username: str, password: str, dme_id: str, ip_address: str) -> str: ... def fetch_file( - uri: str, - file: Optional[IO[str]] = ..., - username: Optional[str] = ..., - password: Optional[str] = ..., + uri: str, file: Optional[IO[str]] = ..., username: Optional[str] = ..., password: Optional[str] = ... ) -> Optional[IO[str]]: ... class ShellCommand: @@ -129,38 +102,22 @@ class ShellCommand: log_fp: _StringIO wait: bool fail_fast: bool - def __init__( - self, - command: subprocess._CMD, - wait: bool = ..., - fail_fast: bool = ..., - cwd: Optional[subprocess._TXT] = ..., + self, command: subprocess._CMD, wait: bool = ..., fail_fast: bool = ..., cwd: Optional[subprocess._TXT] = ... ) -> None: ... - process: subprocess.Popen[Any] - def run(self, cwd: Optional[subprocess._CMD] = ...) -> Optional[int]: ... def setReadOnly(self, value) -> None: ... def getStatus(self) -> Optional[int]: ... - status: Optional[int] - def getOutput(self) -> str: ... - output: str class AuthSMTPHandler(logging.handlers.SMTPHandler): username: str password: str def __init__( - self, - mailhost: str, - username: str, - password: str, - fromaddr: str, - toaddrs: Sequence[str], - subject: str, + self, mailhost: str, username: str, password: str, fromaddr: str, toaddrs: Sequence[str], subject: str ) -> None: ... class LRUCache(Dict[_KT, _VT]): @@ -170,27 +127,19 @@ class LRUCache(Dict[_KT, _VT]): key = ... value = ... def __init__(self, key, value) -> None: ... - _dict: Dict[_KT, LRUCache._Item] capacity: int head: Optional[LRUCache._Item] tail: Optional[LRUCache._Item] - def __init__(self, capacity: int) -> None: ... - # This exists to work around Password.str's name shadowing the str type _str = str class Password: hashfunc: Callable[[bytes], _HashType] str: Optional[_str] - - def __init__( - self, - str: Optional[_str] = ..., - hashfunc: Optional[Callable[[bytes], _HashType]] = ..., - ) -> None: ... + def __init__(self, str: Optional[_str] = ..., hashfunc: Optional[Callable[[bytes], _HashType]] = ...) -> None: ... def set(self, value: Union[bytes, _str]) -> None: ... def __eq__(self, other: Any) -> bool: ... def __len__(self) -> int: ... @@ -207,32 +156,19 @@ def get_utf8_value(value: str) -> bytes: ... def mklist(value: Any) -> List[Any]: ... def pythonize_name(name: str) -> str: ... def write_mime_multipart( - content: List[Tuple[str, str]], - compress: bool = ..., - deftype: str = ..., - delimiter: str = ..., + content: List[Tuple[str, str]], compress: bool = ..., deftype: str = ..., delimiter: str = ... ) -> str: ... def guess_mime_type(content: str, deftype: str) -> str: ... -def compute_md5( - fp: IO[Any], - buf_size: int = ..., - size: Optional[int] = ..., -) -> Tuple[str, str, int]: ... +def compute_md5(fp: IO[Any], buf_size: int = ..., size: Optional[int] = ...) -> Tuple[str, str, int]: ... def compute_hash( - fp: IO[Any], - buf_size: int = ..., - size: Optional[int] = ..., - hash_algorithm: Any = ..., + fp: IO[Any], buf_size: int = ..., size: Optional[int] = ..., hash_algorithm: Any = ... ) -> Tuple[str, str, int]: ... def find_matching_headers(name: str, headers: Mapping[str, Optional[str]]) -> List[str]: ... def merge_headers_by_name(name: str, headers: Mapping[str, Optional[str]]) -> str: ... class RequestHook: def handle_request_data( - self, - request: boto.connection.HTTPRequest, - response: boto.connection.HTTPResponse, - error: bool = ..., + self, request: boto.connection.HTTPRequest, response: boto.connection.HTTPResponse, error: bool = ... ) -> Any: ... def host_is_ipv6(hostname: str) -> bool: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cachetools/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cachetools/__init__.pyi new file mode 100644 index 00000000..c6a9eaa9 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cachetools/__init__.pyi @@ -0,0 +1,6 @@ +from .cache import Cache as Cache +from .decorators import cached as cached, cachedmethod as cachedmethod +from .lfu import LFUCache as LFUCache +from .lru import LRUCache as LRUCache +from .rr import RRCache as RRCache +from .ttl import TTLCache as TTLCache diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cachetools/abc.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cachetools/abc.pyi new file mode 100644 index 00000000..a1f0fbbd --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cachetools/abc.pyi @@ -0,0 +1,7 @@ +from abc import ABCMeta +from typing import MutableMapping, TypeVar + +_KT = TypeVar("_KT") +_VT = TypeVar("_VT") + +class DefaultMapping(MutableMapping[_KT, _VT], metaclass=ABCMeta): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cachetools/cache.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cachetools/cache.pyi new file mode 100644 index 00000000..f79bbd21 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cachetools/cache.pyi @@ -0,0 +1,20 @@ +from typing import Callable, Generic, Iterator, Optional, TypeVar + +from .abc import DefaultMapping as DefaultMapping + +_KT = TypeVar("_KT") +_VT = TypeVar("_VT") + +class Cache(DefaultMapping[_KT, _VT], Generic[_KT, _VT]): + def __init__(self, maxsize: int, getsizeof: Optional[Callable[[_VT], int]] = ...) -> None: ... + def __getitem__(self, key: _KT) -> _VT: ... + def __setitem__(self, key: _KT, value: _VT) -> None: ... + def __delitem__(self, key: _KT) -> None: ... + def __iter__(self) -> Iterator[_KT]: ... + def __len__(self) -> int: ... + @property + def maxsize(self) -> int: ... + @property + def currsize(self) -> int: ... + @staticmethod + def getsizeof(value: _VT) -> int: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cachetools/decorators.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cachetools/decorators.pyi new file mode 100644 index 00000000..4cd43748 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cachetools/decorators.pyi @@ -0,0 +1,16 @@ +from typing import Any, Callable, ContextManager, MutableMapping, Optional, TypeVar + +_KT = TypeVar("_KT") +_VT = TypeVar("_VT") +_T = TypeVar("_T", bound=Callable[..., Any]) +_T_co = TypeVar("_T_co", covariant=True) +_T_self = TypeVar("_T_self") + +def cached( + cache: Optional[MutableMapping[_KT, _VT]], key: Callable[..., _KT] = ..., lock: Optional[ContextManager[_T_co]] = ... +) -> Callable[[_T], _T]: ... +def cachedmethod( + cache: Callable[[_T_self], Optional[MutableMapping[_KT, _VT]]], + key: Callable[..., _KT] = ..., + lock: Optional[ContextManager[_T_co]] = ..., +) -> Callable[[_T], _T]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cachetools/func.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cachetools/func.pyi new file mode 100644 index 00000000..04f72b94 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cachetools/func.pyi @@ -0,0 +1,11 @@ +from typing import Any, Callable, Optional, Sequence, TypeVar + +_T = TypeVar("_T") + +_F = TypeVar("_F", bound=Callable[..., Any]) +_RET = Callable[[_F], _F] + +def lfu_cache(maxsize: int = ..., typed: bool = ...) -> _RET: ... +def lru_cache(maxsize: int = ..., typed: bool = ...) -> _RET: ... +def rr_cache(maxsize: int = ..., choice: Optional[Callable[[Sequence[_T]], _T]] = ..., typed: bool = ...) -> _RET: ... +def ttl_cache(maxsize: int = ..., ttl: float = ..., timer: float = ..., typed: bool = ...) -> _RET: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cachetools/lfu.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cachetools/lfu.pyi new file mode 100644 index 00000000..5673027c --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cachetools/lfu.pyi @@ -0,0 +1,14 @@ +from typing import Callable, Iterator, Optional, TypeVar + +from .cache import Cache + +_KT = TypeVar("_KT") +_VT = TypeVar("_VT") + +class LFUCache(Cache[_KT, _VT]): + def __init__(self, maxsize: int, getsizeof: Optional[Callable[[_VT], int]] = ...) -> None: ... + def __getitem__(self, key: _KT, cache_getitem: Callable[[_KT], _VT] = ...) -> _VT: ... + def __setitem__(self, key: _KT, value: _VT, cache_setitem: Callable[[_KT, _VT], None] = ...) -> None: ... + def __delitem__(self, key: _KT, cache_delitem: Callable[[_KT], None] = ...) -> None: ... + def __iter__(self) -> Iterator[_KT]: ... + def __len__(self) -> int: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cachetools/lru.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cachetools/lru.pyi new file mode 100644 index 00000000..7fa865ac --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cachetools/lru.pyi @@ -0,0 +1,13 @@ +from typing import Callable, Iterator, Optional, TypeVar + +from .cache import Cache as Cache + +_KT = TypeVar("_KT") +_VT = TypeVar("_VT") + +class LRUCache(Cache[_KT, _VT]): + def __init__(self, maxsize: int, getsizeof: Optional[Callable[[_VT], int]] = ...) -> None: ... + def __getitem__(self, key: _KT, cache_getitem: Callable[[_KT], _VT] = ...) -> _VT: ... + def __setitem__(self, key: _KT, value: _VT, cache_setitem: Callable[[_KT, _VT], None] = ...) -> None: ... + def __delitem__(self, key: _KT, cache_delitem: Callable[[_KT], None] = ...) -> None: ... + def __iter__(self) -> Iterator[_KT]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cachetools/rr.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cachetools/rr.pyi new file mode 100644 index 00000000..8b34c395 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cachetools/rr.pyi @@ -0,0 +1,21 @@ +from typing import Callable, Iterator, Optional, Sequence, TypeVar + +from .cache import Cache as Cache + +_KT = TypeVar("_KT") +_VT = TypeVar("_VT") + +class RRCache(Cache[_KT, _VT]): + def __init__( + self, + maxsize: int, + choice: Optional[Callable[[Sequence[_KT]], _KT]] = ..., + getsizeof: Optional[Callable[[_VT], int]] = ..., + ) -> None: ... + def __getitem__(self, key: _KT) -> _VT: ... + def __setitem__(self, key: _KT, value: _VT) -> None: ... + def __delitem__(self, key: _KT) -> None: ... + def __iter__(self) -> Iterator[_KT]: ... + def __len__(self) -> int: ... + @property + def choice(self) -> Callable[[Sequence[_KT]], _KT]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cachetools/ttl.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cachetools/ttl.pyi new file mode 100644 index 00000000..db761845 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cachetools/ttl.pyi @@ -0,0 +1,23 @@ +from typing import Callable, Iterator, Optional, TypeVar + +from .cache import Cache + +_KT = TypeVar("_KT") +_VT = TypeVar("_VT") + +class TTLCache(Cache[_KT, _VT]): + def __init__( + self, maxsize: int, ttl: float, timer: Callable[[], float] = ..., getsizeof: Optional[Callable[[_VT], int]] = ... + ) -> None: ... + def __getitem__(self, key: _KT, cache_getitem: Callable[[_KT], _VT] = ...) -> _VT: ... + def __setitem__(self, key: _KT, value: _VT, cache_setitem: Callable[[_KT, _VT], None] = ...) -> None: ... + def __delitem__(self, key: _KT, cache_delitem: Callable[[_KT], None] = ...) -> None: ... + def __iter__(self) -> Iterator[_KT]: ... + def __len__(self) -> int: ... + @property + def currsize(self) -> int: ... + @property + def timer(self) -> Callable[[], float]: ... + @property + def ttl(self) -> float: ... + def expire(self, time: Optional[Callable[[], float]] = ...) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/certifi.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/certifi.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/characteristic/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/characteristic/__init__.pyi old mode 100755 new mode 100644 index 61c8c8a1..e014cd9e --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/characteristic/__init__.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/characteristic/__init__.pyi @@ -1,15 +1,14 @@ -from typing import Sequence, Callable, Union, Any, Optional, AnyStr, TypeVar, Type, Dict +from typing import Any, AnyStr, Callable, Dict, Optional, Sequence, Type, TypeVar, Union def with_repr(attrs: Sequence[Union[AnyStr, Attribute]]) -> Callable[..., Any]: ... def with_cmp(attrs: Sequence[Union[AnyStr, Attribute]]) -> Callable[..., Any]: ... def with_init(attrs: Sequence[Union[AnyStr, Attribute]]) -> Callable[..., Any]: ... def immutable(attrs: Sequence[Union[AnyStr, Attribute]]) -> Callable[..., Any]: ... - def strip_leading_underscores(attribute_name: AnyStr) -> AnyStr: ... NOTHING = Any -_T = TypeVar('_T') +_T = TypeVar("_T") def attributes( attrs: Sequence[Union[AnyStr, Attribute]], @@ -18,7 +17,8 @@ def attributes( apply_with_repr: bool = ..., apply_immutable: bool = ..., store_attributes: Optional[Callable[[type, Attribute], Any]] = ..., - **kw: Optional[Dict[Any, Any]]) -> Callable[[Type[_T]], Type[_T]]: ... + **kw: Optional[Dict[Any, Any]], +) -> Callable[[Type[_T]], Type[_T]]: ... class Attribute: def __init__( @@ -31,4 +31,5 @@ class Attribute: default_value: Any = ..., default_factory: Optional[Callable[[None], Any]] = ..., instance_of: Optional[Any] = ..., - init_aliaser: Optional[Callable[[AnyStr], AnyStr]] = ...) -> None: ... + init_aliaser: Optional[Callable[[AnyStr], AnyStr]] = ..., + ) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/chardet/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/chardet/__init__.pyi new file mode 100644 index 00000000..54e48f5c --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/chardet/__init__.pyi @@ -0,0 +1,26 @@ +import sys +from typing import Any, Tuple + +from .universaldetector import UniversalDetector as UniversalDetector + +def __getattr__(name: str) -> Any: ... # incomplete + +if sys.version_info >= (3, 8): + from typing import TypedDict +else: + from typing_extensions import TypedDict + +class _LangModelType(TypedDict): + char_to_order_map: Tuple[int, ...] + precedence_matrix: Tuple[int, ...] + typical_positive_ratio: float + keep_english_letter: bool + charset_name: str + language: str + +class _SMModelType(TypedDict): + class_table: Tuple[int, ...] + class_factor: int + state_table: Tuple[int, ...] + char_len_table: Tuple[int, ...] + name: str diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/chardet/enums.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/chardet/enums.pyi new file mode 100644 index 00000000..08116f11 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/chardet/enums.pyi @@ -0,0 +1,39 @@ +class InputState(object): + PURE_ASCII: int + ESC_ASCII: int + HIGH_BYTE: int + +class LanguageFilter(object): + CHINESE_SIMPLIFIED: int + CHINESE_TRADITIONAL: int + JAPANESE: int + KOREAN: int + NON_CJK: int + ALL: int + CHINESE: int + CJK: int + +class ProbingState(object): + DETECTING: int + FOUND_IT: int + NOT_ME: int + +class MachineState(object): + START: int + ERROR: int + ITS_ME: int + +class SequenceLikelihood(object): + NEGATIVE: int + UNLIKELY: int + LIKELY: int + POSITIVE: int + @classmethod + def get_num_categories(cls) -> int: ... + +class CharacterCategory(object): + UNDEFINED: int + LINE_BREAK: int + SYMBOL: int + DIGIT: int + CONTROL: int diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/chardet/langbulgarianmodel.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/chardet/langbulgarianmodel.pyi new file mode 100644 index 00000000..de07cfa7 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/chardet/langbulgarianmodel.pyi @@ -0,0 +1,9 @@ +from typing import Tuple + +from . import _LangModelType + +Latin5_BulgarianCharToOrderMap: Tuple[int, ...] +win1251BulgarianCharToOrderMap: Tuple[int, ...] +BulgarianLangModel: Tuple[int, ...] +Latin5BulgarianModel: _LangModelType +Win1251BulgarianModel: _LangModelType diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/chardet/langcyrillicmodel.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/chardet/langcyrillicmodel.pyi new file mode 100644 index 00000000..40a7044b --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/chardet/langcyrillicmodel.pyi @@ -0,0 +1,17 @@ +from typing import Tuple + +from . import _LangModelType + +KOI8R_char_to_order_map: Tuple[int, ...] +win1251_char_to_order_map: Tuple[int, ...] +latin5_char_to_order_map: Tuple[int, ...] +macCyrillic_char_to_order_map: Tuple[int, ...] +IBM855_char_to_order_map: Tuple[int, ...] +IBM866_char_to_order_map: Tuple[int, ...] +RussianLangModel: Tuple[int, ...] +Koi8rModel: _LangModelType +Win1251CyrillicModel: _LangModelType +Latin5CyrillicModel: _LangModelType +MacCyrillicModel: _LangModelType +Ibm866Model: _LangModelType +Ibm855Model: _LangModelType diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/chardet/langgreekmodel.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/chardet/langgreekmodel.pyi new file mode 100644 index 00000000..f0fa3e8c --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/chardet/langgreekmodel.pyi @@ -0,0 +1,9 @@ +from typing import Tuple + +from . import _LangModelType + +Latin7_char_to_order_map: Tuple[int, ...] +win1253_char_to_order_map: Tuple[int, ...] +GreekLangModel: Tuple[int, ...] +Latin7GreekModel: _LangModelType +Win1253GreekModel: _LangModelType diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/chardet/langhebrewmodel.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/chardet/langhebrewmodel.pyi new file mode 100644 index 00000000..08bfbc91 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/chardet/langhebrewmodel.pyi @@ -0,0 +1,7 @@ +from typing import Tuple + +from . import _LangModelType + +WIN1255_CHAR_TO_ORDER_MAP: Tuple[int, ...] +HEBREW_LANG_MODEL: Tuple[int, ...] +Win1255HebrewModel: _LangModelType diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/chardet/langhungarianmodel.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/chardet/langhungarianmodel.pyi new file mode 100644 index 00000000..01e4a443 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/chardet/langhungarianmodel.pyi @@ -0,0 +1,9 @@ +from typing import Tuple + +from . import _LangModelType + +Latin2_HungarianCharToOrderMap: Tuple[int, ...] +win1250HungarianCharToOrderMap: Tuple[int, ...] +HungarianLangModel: Tuple[int, ...] +Latin2HungarianModel: _LangModelType +Win1250HungarianModel: _LangModelType diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/chardet/langthaimodel.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/chardet/langthaimodel.pyi new file mode 100644 index 00000000..93149e72 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/chardet/langthaimodel.pyi @@ -0,0 +1,7 @@ +from typing import Tuple + +from . import _LangModelType + +TIS620CharToOrderMap: Tuple[int, ...] +ThaiLangModel: Tuple[int, ...] +TIS620ThaiModel: _LangModelType diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/chardet/langturkishmodel.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/chardet/langturkishmodel.pyi new file mode 100644 index 00000000..65b1bdcb --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/chardet/langturkishmodel.pyi @@ -0,0 +1,7 @@ +from typing import Tuple + +from . import _LangModelType + +Latin5_TurkishCharToOrderMap: Tuple[int, ...] +TurkishLangModel: Tuple[int, ...] +Latin5TurkishModel: _LangModelType diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/chardet/universaldetector.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/chardet/universaldetector.pyi new file mode 100644 index 00000000..08d2c479 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/chardet/universaldetector.pyi @@ -0,0 +1,29 @@ +from logging import Logger +from typing import Dict, Optional, Pattern +from typing_extensions import TypedDict + +class _FinalResultType(TypedDict): + encoding: str + confidence: float + language: str + +class _IntermediateResultType(TypedDict): + encoding: Optional[str] + confidence: float + language: Optional[str] + +class UniversalDetector(object): + MINIMUM_THRESHOLD: float + HIGH_BYTE_DETECTOR: Pattern[bytes] + ESC_DETECTOR: Pattern[bytes] + WIN_BYTE_DETECTOR: Pattern[bytes] + ISO_WIN_MAP: Dict[str, str] + + result: _IntermediateResultType + done: bool + lang_filter: int + logger: Logger + def __init__(self, lang_filter: int = ...) -> None: ... + def reset(self) -> None: ... + def feed(self, byte_str: bytes) -> None: ... + def close(self) -> _FinalResultType: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/chardet/version.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/chardet/version.pyi new file mode 100644 index 00000000..13b2534d --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/chardet/version.pyi @@ -0,0 +1,4 @@ +from typing import List + +__version__: str +VERSION: List[str] diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/click/README.md b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/click/README.md old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/click/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/click/__init__.pyi old mode 100755 new mode 100644 index 11eaa870..b588e6ce --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/click/__init__.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/click/__init__.pyi @@ -1,118 +1,84 @@ -# -*- coding: utf-8 -*- -""" - click - ~~~~~ - - Click is a simple Python module that wraps the stdlib's optparse to make - writing command line scripts fun. Unlike other modules, it's based around - a simple API that does not come with too much magic and is composable. - - In case optparse ever gets removed from the stdlib, it will be shipped by - this module. - - :copyright: (c) 2014 by Armin Ronacher. - :license: BSD, see LICENSE for more details. -""" - -# Core classes from .core import ( - Context as Context, + Argument as Argument, BaseCommand as BaseCommand, Command as Command, - MultiCommand as MultiCommand, - Group as Group, CommandCollection as CommandCollection, - Parameter as Parameter, + Context as Context, + Group as Group, + MultiCommand as MultiCommand, Option as Option, - Argument as Argument, + Parameter as Parameter, ) - -# Globals -from .globals import get_current_context as get_current_context - -# Decorators from .decorators import ( - pass_context as pass_context, - pass_obj as pass_obj, - make_pass_decorator as make_pass_decorator, + argument as argument, command as command, + confirmation_option as confirmation_option, group as group, - argument as argument, + help_option as help_option, + make_pass_decorator as make_pass_decorator, option as option, - confirmation_option as confirmation_option, + pass_context as pass_context, + pass_obj as pass_obj, password_option as password_option, version_option as version_option, - help_option as help_option, ) - -# Types +from .exceptions import ( + Abort as Abort, + BadArgumentUsage as BadArgumentUsage, + BadOptionUsage as BadOptionUsage, + BadParameter as BadParameter, + ClickException as ClickException, + FileError as FileError, + MissingParameter as MissingParameter, + NoSuchOption as NoSuchOption, + UsageError as UsageError, +) +from .formatting import HelpFormatter as HelpFormatter, wrap_text as wrap_text +from .globals import get_current_context as get_current_context +from .parser import OptionParser as OptionParser +from .termui import ( + clear as clear, + confirm as confirm, + echo_via_pager as echo_via_pager, + edit as edit, + get_terminal_size as get_terminal_size, + getchar as getchar, + launch as launch, + pause as pause, + progressbar as progressbar, + prompt as prompt, + secho as secho, + style as style, + unstyle as unstyle, +) from .types import ( - ParamType as ParamType, + BOOL as BOOL, + FLOAT as FLOAT, + INT as INT, + STRING as STRING, + UNPROCESSED as UNPROCESSED, + UUID as UUID, + Choice as Choice, + DateTime as DateTime, File as File, FloatRange as FloatRange, - DateTime as DateTime, - Path as Path, - Choice as Choice, IntRange as IntRange, + ParamType as ParamType, + Path as Path, Tuple as Tuple, - STRING as STRING, - INT as INT, - FLOAT as FLOAT, - BOOL as BOOL, - UUID as UUID, - UNPROCESSED as UNPROCESSED, ) - -# Utilities from .utils import ( echo as echo, - get_binary_stream as get_binary_stream, - get_text_stream as get_text_stream, - open_file as open_file, format_filename as format_filename, get_app_dir as get_app_dir, + get_binary_stream as get_binary_stream, get_os_args as get_os_args, + get_text_stream as get_text_stream, + open_file as open_file, ) -# Terminal functions -from .termui import ( - prompt as prompt, - confirm as confirm, - get_terminal_size as get_terminal_size, - echo_via_pager as echo_via_pager, - progressbar as progressbar, - clear as clear, - style as style, - unstyle as unstyle, - secho as secho, - edit as edit, - launch as launch, - getchar as getchar, - pause as pause, -) - -# Exceptions -from .exceptions import ( - ClickException as ClickException, - UsageError as UsageError, - BadParameter as BadParameter, - FileError as FileError, - Abort as Abort, - NoSuchOption as NoSuchOption, - BadOptionUsage as BadOptionUsage, - BadArgumentUsage as BadArgumentUsage, - MissingParameter as MissingParameter, -) - -# Formatting -from .formatting import HelpFormatter as HelpFormatter, wrap_text as wrap_text - -# Parsing -from .parser import OptionParser as OptionParser - # Controls if click should emit the warning about the use of unicode # literals. disable_unicode_literals_warning: bool - __version__: str diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/click/_termui_impl.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/click/_termui_impl.pyi old mode 100755 new mode 100644 index f938c1c9..43e98ac3 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/click/_termui_impl.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/click/_termui_impl.pyi @@ -1,8 +1,8 @@ -from typing import ContextManager, Iterator, Generic, TypeVar, Optional +from typing import Generic, Optional, TypeVar _T = TypeVar("_T") -class ProgressBar(object, Generic[_T]): +class ProgressBar(Generic[_T]): def update(self, n_steps: int) -> None: ... def finish(self) -> None: ... def __enter__(self) -> ProgressBar[_T]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/click/core.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/click/core.pyi old mode 100755 new mode 100644 index b084f3d5..ccc88d52 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/click/core.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/click/core.pyi @@ -3,7 +3,6 @@ from typing import ( Callable, ContextManager, Dict, - Generator, Iterable, List, Mapping, @@ -22,26 +21,12 @@ from click.parser import OptionParser _CC = TypeVar("_CC", bound=Callable[[], Any]) def invoke_param_callback( - callback: Callable[[Context, Parameter, Optional[str]], Any], - ctx: Context, - param: Parameter, - value: Optional[str] -) -> Any: - ... - - -def augment_usage_errors( - ctx: Context, param: Optional[Parameter] = ... -) -> ContextManager[None]: - ... - - + callback: Callable[[Context, Parameter, Optional[str]], Any], ctx: Context, param: Parameter, value: Optional[str] +) -> Any: ... +def augment_usage_errors(ctx: Context, param: Optional[Parameter] = ...) -> ContextManager[None]: ... def iter_params_for_processing( - invocation_order: Sequence[Parameter], - declaration_order: Iterable[Parameter], -) -> Iterable[Parameter]: - ... - + invocation_order: Sequence[Parameter], declaration_order: Iterable[Parameter] +) -> Iterable[Parameter]: ... class Context: parent: Optional[Context] @@ -66,7 +51,6 @@ class Context: _meta: Dict[str, Any] _close_callbacks: List[Any] _depth: int - def __init__( self, command: Command, @@ -83,56 +67,25 @@ class Context: ignore_unknown_options: Optional[bool] = ..., help_option_names: Optional[List[str]] = ..., token_normalize_func: Optional[Callable[[str], str]] = ..., - color: Optional[bool] = ... - ) -> None: - ... - + color: Optional[bool] = ..., + ) -> None: ... @property - def meta(self) -> Dict[str, Any]: - ... - + def meta(self) -> Dict[str, Any]: ... @property - def command_path(self) -> str: - ... - - def scope(self, cleanup: bool = ...) -> ContextManager[Context]: - ... - - def make_formatter(self) -> HelpFormatter: - ... - + def command_path(self) -> str: ... + def scope(self, cleanup: bool = ...) -> ContextManager[Context]: ... + def make_formatter(self) -> HelpFormatter: ... def call_on_close(self, f: _CC) -> _CC: ... - - def close(self) -> None: - ... - - def find_root(self) -> Context: - ... - - def find_object(self, object_type: type) -> Any: - ... - - def ensure_object(self, object_type: type) -> Any: - ... - - def lookup_default(self, name: str) -> Any: - ... - - def fail(self, message: str) -> NoReturn: - ... - - def abort(self) -> NoReturn: - ... - - def exit(self, code: Union[int, str] = ...) -> NoReturn: - ... - - def get_usage(self) -> str: - ... - - def get_help(self) -> str: - ... - + def close(self) -> None: ... + def find_root(self) -> Context: ... + def find_object(self, object_type: type) -> Any: ... + def ensure_object(self, object_type: type) -> Any: ... + def lookup_default(self, name: str) -> Any: ... + def fail(self, message: str) -> NoReturn: ... + def abort(self) -> NoReturn: ... + def exit(self, code: Union[int, str] = ...) -> NoReturn: ... + def get_usage(self) -> str: ... + def get_help(self) -> str: ... def invoke(self, callback: Union[Command, Callable[..., Any]], *args, **kwargs) -> Any: ... def forward(self, callback: Union[Command, Callable[..., Any]], *args, **kwargs) -> Any: ... @@ -143,37 +96,20 @@ class BaseCommand: name: str context_settings: Dict[Any, Any] def __init__(self, name: str, context_settings: Optional[Dict[Any, Any]] = ...) -> None: ... - - def get_usage(self, ctx: Context) -> str: - ... - - def get_help(self, ctx: Context) -> str: - ... - - def make_context( - self, info_name: str, args: List[str], parent: Optional[Context] = ..., **extra - ) -> Context: - ... - - def parse_args(self, ctx: Context, args: List[str]) -> List[str]: - ... - - def invoke(self, ctx: Context) -> Any: - ... - + def get_usage(self, ctx: Context) -> str: ... + def get_help(self, ctx: Context) -> str: ... + def make_context(self, info_name: str, args: List[str], parent: Optional[Context] = ..., **extra) -> Context: ... + def parse_args(self, ctx: Context, args: List[str]) -> List[str]: ... + def invoke(self, ctx: Context) -> Any: ... def main( self, args: Optional[List[str]] = ..., prog_name: Optional[str] = ..., complete_var: Optional[str] = ..., standalone_mode: bool = ..., - **extra - ) -> Any: - ... - - def __call__(self, *args, **kwargs) -> Any: - ... - + **extra, + ) -> Any: ... + def __call__(self, *args, **kwargs) -> Any: ... class Command(BaseCommand): callback: Optional[Callable[..., Any]] @@ -185,7 +121,6 @@ class Command(BaseCommand): add_help_option: bool hidden: bool deprecated: bool - def __init__( self, name: str, @@ -199,50 +134,21 @@ class Command(BaseCommand): add_help_option: bool = ..., hidden: bool = ..., deprecated: bool = ..., - ) -> None: - ... - - def get_params(self, ctx: Context) -> List[Parameter]: - ... - - def format_usage( - self, - ctx: Context, - formatter: HelpFormatter - ) -> None: - ... - - def collect_usage_pieces(self, ctx: Context) -> List[str]: - ... - - def get_help_option_names(self, ctx: Context) -> Set[str]: - ... - - def get_help_option(self, ctx: Context) -> Optional[Option]: - ... - - def make_parser(self, ctx: Context) -> OptionParser: - ... - - def get_short_help_str(self, limit: int = ...) -> str: - ... - - def format_help(self, ctx: Context, formatter: HelpFormatter) -> None: - ... - - def format_help_text(self, ctx: Context, formatter: HelpFormatter) -> None: - ... - - def format_options(self, ctx: Context, formatter: HelpFormatter) -> None: - ... - - def format_epilog(self, ctx: Context, formatter: HelpFormatter) -> None: - ... - - -_T = TypeVar('_T') -_F = TypeVar('_F', bound=Callable[..., Any]) - + ) -> None: ... + def get_params(self, ctx: Context) -> List[Parameter]: ... + def format_usage(self, ctx: Context, formatter: HelpFormatter) -> None: ... + def collect_usage_pieces(self, ctx: Context) -> List[str]: ... + def get_help_option_names(self, ctx: Context) -> Set[str]: ... + def get_help_option(self, ctx: Context) -> Optional[Option]: ... + def make_parser(self, ctx: Context) -> OptionParser: ... + def get_short_help_str(self, limit: int = ...) -> str: ... + def format_help(self, ctx: Context, formatter: HelpFormatter) -> None: ... + def format_help_text(self, ctx: Context, formatter: HelpFormatter) -> None: ... + def format_options(self, ctx: Context, formatter: HelpFormatter) -> None: ... + def format_epilog(self, ctx: Context, formatter: HelpFormatter) -> None: ... + +_T = TypeVar("_T") +_F = TypeVar("_F", bound=Callable[..., Any]) class MultiCommand(Command): no_args_is_help: bool @@ -250,7 +156,6 @@ class MultiCommand(Command): subcommand_metavar: str chain: bool result_callback: Callable[..., Any] - def __init__( self, name: Optional[str] = ..., @@ -259,95 +164,41 @@ class MultiCommand(Command): subcommand_metavar: Optional[str] = ..., chain: bool = ..., result_callback: Optional[Callable[..., Any]] = ..., - **attrs - ) -> None: - ... - - def resultcallback( - self, replace: bool = ... - ) -> Callable[[_F], _F]: - ... - - def format_commands(self, ctx: Context, formatter: HelpFormatter) -> None: - ... - - def resolve_command( - self, ctx: Context, args: List[str] - ) -> Tuple[str, Command, List[str]]: - ... - - def get_command(self, ctx: Context, cmd_name: str) -> Optional[Command]: - ... - - def list_commands(self, ctx: Context) -> Iterable[str]: - ... - + **attrs, + ) -> None: ... + def resultcallback(self, replace: bool = ...) -> Callable[[_F], _F]: ... + def format_commands(self, ctx: Context, formatter: HelpFormatter) -> None: ... + def resolve_command(self, ctx: Context, args: List[str]) -> Tuple[str, Command, List[str]]: ... + def get_command(self, ctx: Context, cmd_name: str) -> Optional[Command]: ... + def list_commands(self, ctx: Context) -> Iterable[str]: ... class Group(MultiCommand): commands: Dict[str, Command] - - def __init__( - self, name: Optional[str] = ..., commands: Optional[Dict[str, Command]] = ..., **attrs - ) -> None: - ... - - def add_command(self, cmd: Command, name: Optional[str] = ...): - ... - + def __init__(self, name: Optional[str] = ..., commands: Optional[Dict[str, Command]] = ..., **attrs) -> None: ... + def add_command(self, cmd: Command, name: Optional[str] = ...): ... def command(self, *args, **kwargs) -> Callable[[Callable[..., Any]], Command]: ... def group(self, *args, **kwargs) -> Callable[[Callable[..., Any]], Group]: ... - class CommandCollection(MultiCommand): sources: List[MultiCommand] - - def __init__( - self, name: Optional[str] = ..., sources: Optional[List[MultiCommand]] = ..., **attrs - ) -> None: - ... - - def add_source(self, multi_cmd: MultiCommand) -> None: - ... - + def __init__(self, name: Optional[str] = ..., sources: Optional[List[MultiCommand]] = ..., **attrs) -> None: ... + def add_source(self, multi_cmd: MultiCommand) -> None: ... class _ParamType: name: str is_composite: bool envvar_list_splitter: Optional[str] - - def __call__( - self, - value: Optional[str], - param: Optional[Parameter] = ..., - ctx: Optional[Context] = ..., - ) -> Any: - ... - - def get_metavar(self, param: Parameter) -> str: - ... - - def get_missing_message(self, param: Parameter) -> str: - ... - - def convert( - self, - value: str, - param: Optional[Parameter], - ctx: Optional[Context], - ) -> Any: - ... - - def split_envvar_value(self, rv: str) -> List[str]: - ... - - def fail(self, message: str, param: Optional[Parameter] = ..., ctx: Optional[Context] = ...) -> NoReturn: - ... - + def __call__(self, value: Optional[str], param: Optional[Parameter] = ..., ctx: Optional[Context] = ...) -> Any: ... + def get_metavar(self, param: Parameter) -> str: ... + def get_missing_message(self, param: Parameter) -> str: ... + def convert(self, value: str, param: Optional[Parameter], ctx: Optional[Context]) -> Any: ... + def split_envvar_value(self, rv: str) -> List[str]: ... + def fail(self, message: str, param: Optional[Parameter] = ..., ctx: Optional[Context] = ...) -> NoReturn: ... # This type is here to resolve https://github.com/python/mypy/issues/5275 -_ConvertibleType = Union[type, _ParamType, Tuple[Union[type, _ParamType], ...], - Callable[[str], Any], Callable[[Optional[str]], Any]] - +_ConvertibleType = Union[ + type, _ParamType, Tuple[Union[type, _ParamType], ...], Callable[[str], Any], Callable[[Optional[str]], Any] +] class Parameter: param_type_name: str @@ -364,7 +215,6 @@ class Parameter: is_eager: bool metavar: Optional[str] envvar: Union[str, List[str], None] - def __init__( self, param_decls: Optional[List[str]] = ..., @@ -376,58 +226,24 @@ class Parameter: metavar: Optional[str] = ..., expose_value: bool = ..., is_eager: bool = ..., - envvar: Optional[Union[str, List[str]]] = ... - ) -> None: - ... - + envvar: Optional[Union[str, List[str]]] = ..., + ) -> None: ... @property - def human_readable_name(self) -> str: - ... - - def make_metavar(self) -> str: - ... - - def get_default(self, ctx: Context) -> Any: - ... - - def add_to_parser(self, parser: OptionParser, ctx: Context) -> None: - ... - - def consume_value(self, ctx: Context, opts: Dict[str, Any]) -> Any: - ... - - def type_cast_value(self, ctx: Context, value: Any) -> Any: - ... - - def process_value(self, ctx: Context, value: Any) -> Any: - ... - - def value_is_missing(self, value: Any) -> bool: - ... - - def full_process_value(self, ctx: Context, value: Any) -> Any: - ... - - def resolve_envvar_value(self, ctx: Context) -> str: - ... - - def value_from_envvar(self, ctx: Context) -> Union[str, List[str]]: - ... - - def handle_parse_result( - self, ctx: Context, opts: Dict[str, Any], args: List[str] - ) -> Tuple[Any, List[str]]: - ... - - def get_help_record(self, ctx: Context) -> Tuple[str, str]: - ... - - def get_usage_pieces(self, ctx: Context) -> List[str]: - ... - - def get_error_hint(self, ctx: Context) -> str: - ... - + def human_readable_name(self) -> str: ... + def make_metavar(self) -> str: ... + def get_default(self, ctx: Context) -> Any: ... + def add_to_parser(self, parser: OptionParser, ctx: Context) -> None: ... + def consume_value(self, ctx: Context, opts: Dict[str, Any]) -> Any: ... + def type_cast_value(self, ctx: Context, value: Any) -> Any: ... + def process_value(self, ctx: Context, value: Any) -> Any: ... + def value_is_missing(self, value: Any) -> bool: ... + def full_process_value(self, ctx: Context, value: Any) -> Any: ... + def resolve_envvar_value(self, ctx: Context) -> str: ... + def value_from_envvar(self, ctx: Context) -> Union[str, List[str]]: ... + def handle_parse_result(self, ctx: Context, opts: Dict[str, Any], args: List[str]) -> Tuple[Any, List[str]]: ... + def get_help_record(self, ctx: Context) -> Tuple[str, str]: ... + def get_usage_pieces(self, ctx: Context) -> List[str]: ... + def get_error_hint(self, ctx: Context) -> str: ... class Option(Parameter): prompt: str # sic @@ -444,7 +260,6 @@ class Option(Parameter): show_default: bool show_choices: bool show_envvar: bool - def __init__( self, param_decls: Optional[List[str]] = ..., @@ -462,19 +277,9 @@ class Option(Parameter): hidden: bool = ..., show_choices: bool = ..., show_envvar: bool = ..., - **attrs - ) -> None: - ... - - def prompt_for_value(self, ctx: Context) -> Any: - ... - + **attrs, + ) -> None: ... + def prompt_for_value(self, ctx: Context) -> Any: ... class Argument(Parameter): - def __init__( - self, - param_decls: Optional[List[str]] = ..., - required: Optional[bool] = ..., - **attrs - ) -> None: - ... + def __init__(self, param_decls: Optional[List[str]] = ..., required: Optional[bool] = ..., **attrs) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/click/decorators.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/click/decorators.pyi old mode 100755 new mode 100644 index 2df9506a..94d1aecd --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/click/decorators.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/click/decorators.pyi @@ -1,32 +1,19 @@ from distutils.version import Version -from typing import Any, Callable, Dict, List, Optional, Tuple, Type, TypeVar, Union, Text, overload +from typing import Any, Callable, Dict, List, Optional, Protocol, Text, Tuple, Type, TypeVar, Union, overload -from click.core import Command, Group, Argument, Option, Parameter, Context, _ConvertibleType +from click.core import Argument, Command, Context, Group, Option, Parameter, _ConvertibleType -_T = TypeVar('_T') -_F = TypeVar('_F', bound=Callable[..., Any]) +_T = TypeVar("_T") +_F = TypeVar("_F", bound=Callable[..., Any]) -# Until https://github.com/python/mypy/issues/3924 is fixed you can't do the following: -# _Decorator = Callable[[_F], _F] +class _IdentityFunction(Protocol): + def __call__(self, __x: _T) -> _T: ... -_Callback = Callable[ - [Context, Union[Option, Parameter], Any], - Any -] - -def pass_context(_T) -> _T: - ... - - -def pass_obj(_T) -> _T: - ... - - -def make_pass_decorator( - object_type: type, ensure: bool = ... -) -> Callable[[_T], _T]: - ... +_Callback = Callable[[Context, Union[Option, Parameter], Any], Any] +def pass_context(__f: _T) -> _T: ... +def pass_obj(__f: _T) -> _T: ... +def make_pass_decorator(object_type: type, ensure: bool = ...) -> _IdentityFunction: ... # NOTE: Decorators below have **attrs converted to concrete constructor # arguments from core.pyi to help with type checking. @@ -69,9 +56,8 @@ def group( # User-defined **kwargs: Any, ) -> Callable[[Callable[..., Any]], Group]: ... - def argument( - *param_decls: str, + *param_decls: Text, cls: Type[Argument] = ..., # Argument required: Optional[bool] = ..., @@ -85,13 +71,10 @@ def argument( is_eager: bool = ..., envvar: Optional[Union[str, List[str]]] = ..., autocompletion: Optional[Callable[[Any, List[str], str], List[Union[str, Tuple[str, str]]]]] = ..., -) -> Callable[[_F], _F]: - ... - - +) -> _IdentityFunction: ... @overload def option( - *param_decls: str, + *param_decls: Text, cls: Type[Option] = ..., # Option show_default: Union[bool, Text] = ..., @@ -104,7 +87,7 @@ def option( count: bool = ..., allow_from_autoenv: bool = ..., type: Optional[_ConvertibleType] = ..., - help: Optional[str] = ..., + help: Optional[Text] = ..., show_choices: bool = ..., # Parameter default: Optional[Any] = ..., @@ -117,10 +100,7 @@ def option( envvar: Optional[Union[str, List[str]]] = ..., # User-defined **kwargs: Any, -) -> Callable[[_F], _F]: - ... - - +) -> _IdentityFunction: ... @overload def option( *param_decls: str, @@ -149,10 +129,7 @@ def option( envvar: Optional[Union[str, List[str]]] = ..., # User-defined **kwargs: Any, -) -> Callable[[_F], _F]: - ... - - +) -> _IdentityFunction: ... @overload def option( *param_decls: str, @@ -181,10 +158,7 @@ def option( envvar: Optional[Union[str, List[str]]] = ..., # User-defined **kwargs: Any, -) -> Callable[[_F], _F]: - ... - - +) -> _IdentityFunction: ... @overload def option( *param_decls: str, @@ -213,10 +187,7 @@ def option( envvar: Optional[Union[str, List[str]]] = ..., # User-defined **kwargs: Any, -) -> Callable[[_F], _F]: - ... - - +) -> _IdentityFunction: ... def confirmation_option( *param_decls: str, cls: Type[Option] = ..., @@ -240,11 +211,8 @@ def confirmation_option( metavar: Optional[str] = ..., expose_value: bool = ..., is_eager: bool = ..., - envvar: Optional[Union[str, List[str]]] = ... -) -> Callable[[_F], _F]: - ... - - + envvar: Optional[Union[str, List[str]]] = ..., +) -> _IdentityFunction: ... def password_option( *param_decls: str, cls: Type[Option] = ..., @@ -268,11 +236,8 @@ def password_option( metavar: Optional[str] = ..., expose_value: bool = ..., is_eager: bool = ..., - envvar: Optional[Union[str, List[str]]] = ... -) -> Callable[[_F], _F]: - ... - - + envvar: Optional[Union[str, List[str]]] = ..., +) -> _IdentityFunction: ... def version_option( version: Optional[Union[str, Version]] = ..., *param_decls: str, @@ -299,11 +264,8 @@ def version_option( metavar: Optional[str] = ..., expose_value: bool = ..., is_eager: bool = ..., - envvar: Optional[Union[str, List[str]]] = ... -) -> Callable[[_F], _F]: - ... - - + envvar: Optional[Union[str, List[str]]] = ..., +) -> _IdentityFunction: ... def help_option( *param_decls: str, cls: Type[Option] = ..., @@ -327,6 +289,5 @@ def help_option( metavar: Optional[str] = ..., expose_value: bool = ..., is_eager: bool = ..., - envvar: Optional[Union[str, List[str]]] = ... -) -> Callable[[_F], _F]: - ... + envvar: Optional[Union[str, List[str]]] = ..., +) -> _IdentityFunction: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/click/exceptions.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/click/exceptions.pyi old mode 100755 new mode 100644 index 3f0dda36..c6b97307 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/click/exceptions.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/click/exceptions.pyi @@ -1,93 +1,60 @@ -from typing import IO, List, Optional, Any +from typing import IO, Any, List, Optional from click.core import Context, Parameter - class ClickException(Exception): exit_code: int message: str - - def __init__(self, message: str) -> None: - ... - - def format_message(self) -> str: - ... - - def show(self, file: Optional[Any] = ...) -> None: - ... - + def __init__(self, message: str) -> None: ... + def format_message(self) -> str: ... + def show(self, file: Optional[Any] = ...) -> None: ... class UsageError(ClickException): ctx: Optional[Context] - def __init__(self, message: str, ctx: Optional[Context] = ...) -> None: ... def show(self, file: Optional[IO[Any]] = ...) -> None: ... - class BadParameter(UsageError): param: Optional[Parameter] param_hint: Optional[str] - def __init__( - self, - message: str, - ctx: Optional[Context] = ..., - param: Optional[Parameter] = ..., - param_hint: Optional[str] = ... - ) -> None: - ... - + self, message: str, ctx: Optional[Context] = ..., param: Optional[Parameter] = ..., param_hint: Optional[str] = ... + ) -> None: ... class MissingParameter(BadParameter): param_type: str # valid values: 'parameter', 'option', 'argument' - def __init__( self, message: Optional[str] = ..., ctx: Optional[Context] = ..., param: Optional[Parameter] = ..., param_hint: Optional[str] = ..., - param_type: Optional[str] = ... - ) -> None: - ... - + param_type: Optional[str] = ..., + ) -> None: ... class NoSuchOption(UsageError): option_name: str possibilities: Optional[List[str]] - def __init__( self, option_name: str, message: Optional[str] = ..., possibilities: Optional[List[str]] = ..., - ctx: Optional[Context] = ... - ) -> None: - ... - + ctx: Optional[Context] = ..., + ) -> None: ... class BadOptionUsage(UsageError): - def __init__(self, option_name: str, message: str, ctx: Optional[Context] = ...) -> None: - ... - + def __init__(self, option_name: str, message: str, ctx: Optional[Context] = ...) -> None: ... class BadArgumentUsage(UsageError): - def __init__(self, message: str, ctx: Optional[Context] = ...) -> None: - ... - + def __init__(self, message: str, ctx: Optional[Context] = ...) -> None: ... class FileError(ClickException): ui_filename: str filename: str + def __init__(self, filename: str, hint: Optional[str] = ...) -> None: ... - def __init__(self, filename: str, hint: Optional[str] = ...) -> None: - ... - - -class Abort(RuntimeError): - ... - +class Abort(RuntimeError): ... class Exit(RuntimeError): - def __init__(self, code: int = ...) -> None: - ... + def __init__(self, code: int = ...) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/click/formatting.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/click/formatting.pyi old mode 100755 new mode 100644 index bcd3048e..a1fbd23b --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/click/formatting.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/click/formatting.pyi @@ -1,86 +1,34 @@ from typing import ContextManager, Generator, Iterable, List, Optional, Tuple - FORCED_WIDTH: Optional[int] - -def measure_table(rows: Iterable[Iterable[str]]) -> Tuple[int, ...]: - ... - - -def iter_rows( - rows: Iterable[Iterable[str]], col_count: int -) -> Generator[Tuple[str, ...], None, None]: - ... - - +def measure_table(rows: Iterable[Iterable[str]]) -> Tuple[int, ...]: ... +def iter_rows(rows: Iterable[Iterable[str]], col_count: int) -> Generator[Tuple[str, ...], None, None]: ... def wrap_text( - text: str, - width: int = ..., - initial_indent: str = ..., - subsequent_indent: str = ..., - preserve_paragraphs: bool = ... -) -> str: - ... - + text: str, width: int = ..., initial_indent: str = ..., subsequent_indent: str = ..., preserve_paragraphs: bool = ... +) -> str: ... class HelpFormatter: indent_increment: int width: Optional[int] current_indent: int buffer: List[str] - - def __init__( - self, - indent_increment: int = ..., - width: Optional[int] = ..., - max_width: Optional[int] = ..., - ) -> None: - ... - - def write(self, string: str) -> None: - ... - - def indent(self) -> None: - ... - - def dedent(self) -> None: - ... - + def __init__(self, indent_increment: int = ..., width: Optional[int] = ..., max_width: Optional[int] = ...) -> None: ... + def write(self, string: str) -> None: ... + def indent(self) -> None: ... + def dedent(self) -> None: ... def write_usage( self, prog: str, args: str = ..., prefix: str = ..., - ): - ... - - def write_heading(self, heading: str) -> None: - ... - - def write_paragraph(self) -> None: - ... - - def write_text(self, text: str) -> None: - ... - - def write_dl( - self, - rows: Iterable[Iterable[str]], - col_max: int = ..., - col_spacing: int = ..., - ) -> None: - ... - - def section(self, name) -> ContextManager[None]: - ... - - def indentation(self) -> ContextManager[None]: - ... - - def getvalue(self) -> str: - ... - - -def join_options(options: List[str]) -> Tuple[str, bool]: - ... + ): ... + def write_heading(self, heading: str) -> None: ... + def write_paragraph(self) -> None: ... + def write_text(self, text: str) -> None: ... + def write_dl(self, rows: Iterable[Iterable[str]], col_max: int = ..., col_spacing: int = ...) -> None: ... + def section(self, name) -> ContextManager[None]: ... + def indentation(self) -> ContextManager[None]: ... + def getvalue(self) -> str: ... + +def join_options(options: List[str]) -> Tuple[str, bool]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/click/globals.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/click/globals.pyi old mode 100755 new mode 100644 index 11adce3f..64b399d4 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/click/globals.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/click/globals.pyi @@ -1,18 +1,8 @@ -from click.core import Context from typing import Optional +from click.core import Context -def get_current_context(silent: bool = ...) -> Context: - ... - - -def push_context(ctx: Context) -> None: - ... - - -def pop_context() -> None: - ... - - -def resolve_color_default(color: Optional[bool] = ...) -> Optional[bool]: - ... +def get_current_context(silent: bool = ...) -> Context: ... +def push_context(ctx: Context) -> None: ... +def pop_context() -> None: ... +def resolve_color_default(color: Optional[bool] = ...) -> Optional[bool]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/click/parser.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/click/parser.pyi old mode 100755 new mode 100644 index d790bacb..fdcc2eaf --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/click/parser.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/click/parser.pyi @@ -2,24 +2,10 @@ from typing import Any, Dict, Iterable, List, Optional, Set, Tuple from click.core import Context - -def _unpack_args( - args: Iterable[str], nargs_spec: Iterable[int] -) -> Tuple[Tuple[Optional[Tuple[str, ...]], ...], List[str]]: - ... - - -def split_opt(opt: str) -> Tuple[str, str]: - ... - - -def normalize_opt(opt: str, ctx: Context) -> str: - ... - - -def split_arg_string(string: str) -> List[str]: - ... - +def _unpack_args(args: Iterable[str], nargs_spec: Iterable[int]) -> Tuple[Tuple[Optional[Tuple[str, ...]], ...], List[str]]: ... +def split_opt(opt: str) -> Tuple[str, str]: ... +def normalize_opt(opt: str, ctx: Context) -> str: ... +def split_arg_string(string: str) -> List[str]: ... class Option: dest: str @@ -30,7 +16,6 @@ class Option: prefixes: Set[str] _short_opts: List[str] _long_opts: List[str] - def __init__( self, opts: Iterable[str], @@ -38,39 +23,25 @@ class Option: action: Optional[str] = ..., nargs: int = ..., const: Optional[Any] = ..., - obj: Optional[Any] = ... - ) -> None: - ... - + obj: Optional[Any] = ..., + ) -> None: ... @property - def takes_value(self) -> bool: - ... - - def process(self, value: Any, state: ParsingState) -> None: - ... - + def takes_value(self) -> bool: ... + def process(self, value: Any, state: ParsingState) -> None: ... class Argument: dest: str nargs: int obj: Any - - def __init__(self, dest: str, nargs: int = ..., obj: Optional[Any] = ...) -> None: - ... - - def process(self, value: Any, state: ParsingState) -> None: - ... - + def __init__(self, dest: str, nargs: int = ..., obj: Optional[Any] = ...) -> None: ... + def process(self, value: Any, state: ParsingState) -> None: ... class ParsingState: opts: Dict[str, Any] largs: List[str] rargs: List[str] order: List[Any] - - def __init__(self, rargs: List[str]) -> None: - ... - + def __init__(self, rargs: List[str]) -> None: ... class OptionParser: ctx: Optional[Context] @@ -80,10 +51,7 @@ class OptionParser: _long_opt: Dict[str, Option] _opt_prefixes: Set[str] _args: List[Argument] - - def __init__(self, ctx: Optional[Context] = ...) -> None: - ... - + def __init__(self, ctx: Optional[Context] = ...) -> None: ... def add_option( self, opts: Iterable[str], @@ -91,14 +59,7 @@ class OptionParser: action: Optional[str] = ..., nargs: int = ..., const: Optional[Any] = ..., - obj: Optional[Any] = ... - ) -> None: - ... - - def add_argument(self, dest: str, nargs: int = ..., obj: Optional[Any] = ...) -> None: - ... - - def parse_args( - self, args: List[str] - ) -> Tuple[Dict[str, Any], List[str], List[Any]]: - ... + obj: Optional[Any] = ..., + ) -> None: ... + def add_argument(self, dest: str, nargs: int = ..., obj: Optional[Any] = ...) -> None: ... + def parse_args(self, args: List[str]) -> Tuple[Dict[str, Any], List[str], List[Any]]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/click/termui.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/click/termui.pyi old mode 100755 new mode 100644 index 87e9bdcc..3225f678 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/click/termui.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/click/termui.pyi @@ -1,36 +1,10 @@ -from typing import ( - Any, - Callable, - Generator, - Iterable, - IO, - List, - Optional, - Text, - overload, - Text, - Tuple, - TypeVar, - Union, -) +from typing import IO, Any, Callable, Generator, Iterable, Optional, Text, Tuple, TypeVar, Union, overload -from click.core import _ConvertibleType from click._termui_impl import ProgressBar as _ProgressBar +from click.core import _ConvertibleType - -def hidden_prompt_func(prompt: str) -> str: - ... - - -def _build_prompt( - text: str, - suffix: str, - show_default: bool = ..., - default: Optional[str] = ..., -) -> str: - ... - - +def hidden_prompt_func(prompt: str) -> str: ... +def _build_prompt(text: str, suffix: str, show_default: bool = ..., default: Optional[str] = ...) -> str: ... def prompt( text: str, default: Optional[str] = ..., @@ -42,34 +16,16 @@ def prompt( show_default: bool = ..., err: bool = ..., show_choices: bool = ..., -) -> Any: - ... - - +) -> Any: ... def confirm( - text: str, - default: bool = ..., - abort: bool = ..., - prompt_suffix: str = ..., - show_default: bool = ..., - err: bool = ..., -) -> bool: - ... - - -def get_terminal_size() -> Tuple[int, int]: - ... - - + text: str, default: bool = ..., abort: bool = ..., prompt_suffix: str = ..., show_default: bool = ..., err: bool = ... +) -> bool: ... +def get_terminal_size() -> Tuple[int, int]: ... def echo_via_pager( - text_or_generator: Union[str, Iterable[str], Callable[[], Generator[str, None, None]]], - color: Optional[bool] = ..., -) -> None: - ... - - -_T = TypeVar('_T') + text_or_generator: Union[str, Iterable[str], Callable[[], Generator[str, None, None]]], color: Optional[bool] = ... +) -> None: ... +_T = TypeVar("_T") @overload def progressbar( iterable: Iterable[_T], @@ -86,9 +42,7 @@ def progressbar( width: int = ..., file: Optional[IO[Any]] = ..., color: Optional[bool] = ..., -) -> _ProgressBar[_T]: - ... - +) -> _ProgressBar[_T]: ... @overload def progressbar( iterable: None = ..., @@ -105,30 +59,20 @@ def progressbar( width: int = ..., file: Optional[IO[Any]] = ..., color: Optional[bool] = ..., -) -> _ProgressBar[int]: - ... - -def clear() -> None: - ... - - +) -> _ProgressBar[int]: ... +def clear() -> None: ... def style( text: Text, - fg: Optional[str] = ..., - bg: Optional[str] = ..., + fg: Optional[Text] = ..., + bg: Optional[Text] = ..., bold: Optional[bool] = ..., dim: Optional[bool] = ..., underline: Optional[bool] = ..., blink: Optional[bool] = ..., reverse: Optional[bool] = ..., reset: bool = ..., -) -> str: - ... - - -def unstyle(text: Text) -> str: - ... - +) -> str: ... +def unstyle(text: Text) -> str: ... # Styling options copied from style() for nicer type checking. def secho( @@ -145,10 +89,7 @@ def secho( blink: Optional[bool] = ..., reverse: Optional[bool] = ..., reset: bool = ..., -): - ... - - +): ... def edit( text: Optional[str] = ..., editor: Optional[str] = ..., @@ -156,19 +97,7 @@ def edit( require_save: bool = ..., extension: str = ..., filename: Optional[str] = ..., -) -> str: - ... - - -def launch(url: str, wait: bool = ..., locate: bool = ...) -> int: - ... - - -def getchar(echo: bool = ...) -> Text: - ... - - -def pause( - info: str = ..., err: bool = ... -) -> None: - ... +) -> str: ... +def launch(url: str, wait: bool = ..., locate: bool = ...) -> int: ... +def getchar(echo: bool = ...) -> Text: ... +def pause(info: str = ..., err: bool = ...) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/click/testing.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/click/testing.pyi old mode 100755 new mode 100644 index bd24c9be..d2b6e49f --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/click/testing.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/click/testing.pyi @@ -1,5 +1,4 @@ -from typing import (IO, Any, BinaryIO, ContextManager, Dict, Iterable, List, - Mapping, Optional, Text, Tuple, Union) +from typing import IO, Any, BinaryIO, ContextManager, Dict, Iterable, List, Mapping, Optional, Text, Union from .core import BaseCommand @@ -43,22 +42,17 @@ class CliRunner: env: Mapping[str, str] echo_stdin: bool mix_stderr: bool - def __init__( self, charset: Optional[Text] = ..., env: Optional[Mapping[str, str]] = ..., echo_stdin: bool = ..., mix_stderr: bool = ..., - ) -> None: - ... + ) -> None: ... def get_default_prog_name(self, cli: BaseCommand) -> str: ... def make_env(self, overrides: Optional[Mapping[str, str]] = ...) -> Dict[str, str]: ... def isolation( - self, - input: Optional[Union[bytes, Text, IO[Any]]] = ..., - env: Optional[Mapping[str, str]] = ..., - color: bool = ..., + self, input: Optional[Union[bytes, Text, IO[Any]]] = ..., env: Optional[Mapping[str, str]] = ..., color: bool = ... ) -> ContextManager[BinaryIO]: ... def invoke( self, @@ -69,6 +63,5 @@ class CliRunner: catch_exceptions: bool = ..., color: bool = ..., **extra: Any, - ) -> Result: - ... + ) -> Result: ... def isolated_filesystem(self) -> ContextManager[str]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/click/types.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/click/types.pyi old mode 100755 new mode 100644 index cf37a738..d4db0256 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/click/types.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/click/types.pyi @@ -1,88 +1,47 @@ -from typing import Any, Callable, Generic, IO, Iterable, List, Optional, TypeVar, Union, Tuple as _PyTuple, Type import datetime import uuid +from typing import IO, Any, Callable, Generic, Iterable, List, Optional, Sequence, Text, Tuple as _PyTuple, Type, TypeVar, Union -from click.core import Context, Parameter, _ParamType as ParamType, _ConvertibleType +from click.core import Context, Parameter, _ConvertibleType, _ParamType -class BoolParamType(ParamType): - def __call__( - self, - value: Optional[str], - param: Optional[Parameter] = ..., - ctx: Optional[Context] = ..., - ) -> bool: - ... - - def convert( - self, - value: str, - param: Optional[Parameter], - ctx: Optional[Context], - ) -> bool: - ... +ParamType = _ParamType +class BoolParamType(ParamType): + def __call__(self, value: Optional[str], param: Optional[Parameter] = ..., ctx: Optional[Context] = ...) -> bool: ... + def convert(self, value: str, param: Optional[Parameter], ctx: Optional[Context]) -> bool: ... class CompositeParamType(ParamType): arity: int - class Choice(ParamType): choices: Iterable[str] - def __init__( - self, - choices: Iterable[str], - case_sensitive: bool = ..., - ) -> None: - ... - + case_sensitive: bool + def __init__(self, choices: Iterable[str], case_sensitive: bool = ...) -> None: ... class DateTime(ParamType): - def __init__( - self, - formats: Optional[List[str]] = ..., - ) -> None: - ... - - def convert( - self, - value: str, - param: Optional[Parameter], - ctx: Optional[Context], - ) -> datetime.datetime: - ... - + formats: Sequence[str] + def __init__(self, formats: Optional[Sequence[str]] = ...) -> None: ... + def convert(self, value: str, param: Optional[Parameter], ctx: Optional[Context]) -> datetime.datetime: ... class FloatParamType(ParamType): - def __call__( - self, - value: Optional[str], - param: Optional[Parameter] = ..., - ctx: Optional[Context] = ..., - ) -> float: - ... - - def convert( - self, - value: str, - param: Optional[Parameter], - ctx: Optional[Context], - ) -> float: - ... - + def __call__(self, value: Optional[str], param: Optional[Parameter] = ..., ctx: Optional[Context] = ...) -> float: ... + def convert(self, value: str, param: Optional[Parameter], ctx: Optional[Context]) -> float: ... class FloatRange(FloatParamType): - def __init__( - self, - min: Optional[float] = ..., - max: Optional[float] = ..., - clamp: bool = ..., - ) -> None: - ... + min: Optional[float] + max: Optional[float] + clamp: bool + def __init__(self, min: Optional[float] = ..., max: Optional[float] = ..., clamp: bool = ...) -> None: ... class File(ParamType): + mode: str + encoding: Optional[str] + errors: Optional[str] + lazy: Optional[bool] + atomic: bool def __init__( self, - mode: str = ..., + mode: Text = ..., encoding: Optional[str] = ..., errors: Optional[str] = ..., lazy: Optional[bool] = ..., @@ -92,61 +51,37 @@ class File(ParamType): def convert(self, value: str, param: Optional[Parameter], ctx: Optional[Context]) -> IO[Any]: ... def resolve_lazy_flag(self, value: str) -> bool: ... -_F = TypeVar('_F') # result of the function +_F = TypeVar("_F") # result of the function _Func = Callable[[Optional[str]], _F] - class FuncParamType(ParamType, Generic[_F]): func: _Func[_F] - def __init__(self, func: _Func[_F]) -> None: ... - - def __call__( - self, - value: Optional[str], - param: Optional[Parameter] = ..., - ctx: Optional[Context] = ..., - ) -> _F: - ... - - def convert( - self, - value: str, - param: Optional[Parameter], - ctx: Optional[Context], - ) -> _F: - ... - + def __call__(self, value: Optional[str], param: Optional[Parameter] = ..., ctx: Optional[Context] = ...) -> _F: ... + def convert(self, value: str, param: Optional[Parameter], ctx: Optional[Context]) -> _F: ... class IntParamType(ParamType): - def __call__( - self, - value: Optional[str], - param: Optional[Parameter] = ..., - ctx: Optional[Context] = ..., - ) -> int: - ... - - def convert( - self, - value: str, - param: Optional[Parameter], - ctx: Optional[Context], - ) -> int: - ... - + def __call__(self, value: Optional[str], param: Optional[Parameter] = ..., ctx: Optional[Context] = ...) -> int: ... + def convert(self, value: str, param: Optional[Parameter], ctx: Optional[Context]) -> int: ... class IntRange(IntParamType): - def __init__( - self, min: Optional[int] = ..., max: Optional[int] = ..., clamp: bool = ... - ) -> None: - ... - - -_PathType = TypeVar('_PathType', str, bytes) + min: Optional[int] + max: Optional[int] + clamp: bool + def __init__(self, min: Optional[int] = ..., max: Optional[int] = ..., clamp: bool = ...) -> None: ... +_PathType = TypeVar("_PathType", str, bytes) +_PathTypeBound = Union[Type[str], Type[bytes]] class Path(ParamType): + exists: bool + file_okay: bool + dir_okay: bool + writable: bool + readable: bool + resolve_path: bool + allow_dash: bool + type: Optional[_PathTypeBound] def __init__( self, exists: bool = ..., @@ -157,93 +92,28 @@ class Path(ParamType): resolve_path: bool = ..., allow_dash: bool = ..., path_type: Optional[Type[_PathType]] = ..., - ) -> None: - ... - - def coerce_path_result(self, rv: Union[str, bytes]) -> _PathType: - ... - - def __call__( - self, - value: Optional[str], - param: Optional[Parameter] = ..., - ctx: Optional[Context] = ..., - ) -> _PathType: - ... - - def convert( - self, - value: str, - param: Optional[Parameter], - ctx: Optional[Context], - ) -> _PathType: - ... + ) -> None: ... + def coerce_path_result(self, rv: Union[str, bytes]) -> _PathType: ... + def __call__(self, value: Optional[str], param: Optional[Parameter] = ..., ctx: Optional[Context] = ...) -> _PathType: ... + def convert(self, value: str, param: Optional[Parameter], ctx: Optional[Context]) -> _PathType: ... class StringParamType(ParamType): - def __call__( - self, - value: Optional[str], - param: Optional[Parameter] = ..., - ctx: Optional[Context] = ..., - ) -> str: - ... - - def convert( - self, - value: str, - param: Optional[Parameter], - ctx: Optional[Context], - ) -> str: - ... - + def __call__(self, value: Optional[str], param: Optional[Parameter] = ..., ctx: Optional[Context] = ...) -> str: ... + def convert(self, value: str, param: Optional[Parameter], ctx: Optional[Context]) -> str: ... class Tuple(CompositeParamType): types: List[ParamType] + def __init__(self, types: Iterable[Any]) -> None: ... + def __call__(self, value: Optional[str], param: Optional[Parameter] = ..., ctx: Optional[Context] = ...) -> Tuple: ... + def convert(self, value: str, param: Optional[Parameter], ctx: Optional[Context]) -> Tuple: ... - def __init__(self, types: Iterable[Any]) -> None: - ... - - def __call__( - self, - value: Optional[str], - param: Optional[Parameter] = ..., - ctx: Optional[Context] = ..., - ) -> Tuple: - ... - - def convert( - self, - value: str, - param: Optional[Parameter], - ctx: Optional[Context], - ) -> Tuple: - ... - - -class UnprocessedParamType(ParamType): - ... - +class UnprocessedParamType(ParamType): ... class UUIDParameterType(ParamType): - def __call__( - self, - value: Optional[str], - param: Optional[Parameter] = ..., - ctx: Optional[Context] = ..., - ) -> uuid.UUID: - ... - - def convert( - self, - value: str, - param: Optional[Parameter], - ctx: Optional[Context], - ) -> uuid.UUID: - ... - + def __call__(self, value: Optional[str], param: Optional[Parameter] = ..., ctx: Optional[Context] = ...) -> uuid.UUID: ... + def convert(self, value: str, param: Optional[Parameter], ctx: Optional[Context]) -> uuid.UUID: ... -def convert_type(ty: Optional[_ConvertibleType], default: Optional[Any] = ...) -> ParamType: - ... +def convert_type(ty: Optional[_ConvertibleType], default: Optional[Any] = ...) -> ParamType: ... # parameter type shortcuts diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/click/utils.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/click/utils.pyi old mode 100755 new mode 100644 index d4fc17e9..7db0fbed --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/click/utils.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/click/utils.pyi @@ -1,23 +1,11 @@ -from typing import Any, AnyStr, Callable, Generic, Iterator, IO, List, Optional, TypeVar, Union, Text +from typing import IO, Any, AnyStr, Generic, Iterator, List, Optional, Text, TypeVar -_T = TypeVar('_T') - - -def _posixify(name: str) -> str: - ... - - -def safecall(func: _T) -> _T: - ... - - -def make_str(value: Any) -> str: - ... - - -def make_default_short_help(help: str, max_length: int = ...): - ... +_T = TypeVar("_T") +def _posixify(name: str) -> str: ... +def safecall(func: _T) -> _T: ... +def make_str(value: Any) -> str: ... +def make_default_short_help(help: str, max_length: int = ...): ... class LazyFile(object): name: str @@ -25,14 +13,8 @@ class LazyFile(object): encoding: Optional[str] errors: str atomic: bool - def __init__( - self, - filename: str, - mode: str = ..., - encoding: Optional[str] = ..., - errors: str = ..., - atomic: bool = ... + self, filename: str, mode: str = ..., encoding: Optional[str] = ..., errors: str = ..., atomic: bool = ... ) -> None: ... def open(self) -> IO[Any]: ... def close(self) -> None: ... @@ -49,40 +31,13 @@ class KeepOpenFile(Generic[AnyStr]): def __iter__(self) -> Iterator[AnyStr]: ... def echo( - message: object = ..., - file: Optional[IO[Text]] = ..., - nl: bool = ..., - err: bool = ..., - color: Optional[bool] = ..., -) -> None: - ... - - -def get_binary_stream(name: str) -> IO[bytes]: - ... - - -def get_text_stream( - name: str, encoding: Optional[str] = ..., errors: str = ... -) -> IO[str]: - ... - + message: object = ..., file: Optional[IO[Text]] = ..., nl: bool = ..., err: bool = ..., color: Optional[bool] = ... +) -> None: ... +def get_binary_stream(name: str) -> IO[bytes]: ... +def get_text_stream(name: str, encoding: Optional[str] = ..., errors: str = ...) -> IO[str]: ... def open_file( - filename: str, - mode: str = ..., - encoding: Optional[str] = ..., - errors: str = ..., - lazy: bool = ..., - atomic: bool = ... + filename: str, mode: str = ..., encoding: Optional[str] = ..., errors: str = ..., lazy: bool = ..., atomic: bool = ... ) -> Any: ... # really Union[IO, LazyFile, KeepOpenFile] -def get_os_args() -> List[str]: - ... - -def format_filename(filename: str, shorten: bool = ...) -> str: - ... - - -def get_app_dir( - app_name: str, roaming: bool = ..., force_posix: bool = ... -) -> str: - ... +def get_os_args() -> List[str]: ... +def format_filename(filename: str, shorten: bool = ...) -> str: ... +def get_app_dir(app_name: str, roaming: bool = ..., force_posix: bool = ...) -> str: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/croniter.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/croniter.pyi old mode 100755 new mode 100644 index 0d01b7e0..293825e0 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/croniter.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/croniter.pyi @@ -2,7 +2,7 @@ import datetime from typing import Any, Dict, Iterator, List, Optional, Text, Tuple, Type, TypeVar, Union _RetType = Union[Type[float], Type[datetime.datetime]] -_SelfT = TypeVar('_SelfT', bound=croniter) +_SelfT = TypeVar("_SelfT", bound=croniter) class CroniterError(ValueError): ... class CroniterBadCronError(CroniterError): ... @@ -22,7 +22,9 @@ class croniter(Iterator[Any]): start_time: float dst_start_time: float nth_weekday_of_month: Dict[str, Any] - def __init__(self, expr_format: Text, start_time: Optional[Union[float, datetime.datetime]] = ..., ret_type: Optional[_RetType] = ...) -> None: ... + def __init__( + self, expr_format: Text, start_time: Optional[Union[float, datetime.datetime]] = ..., ret_type: Optional[_RetType] = ... + ) -> None: ... # Most return value depend on ret_type, which can be passed in both as a method argument and as # a constructor argument. def get_next(self, ret_type: Optional[_RetType] = ...) -> Any: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/__init__.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/exceptions.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/exceptions.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/fernet.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/fernet.pyi old mode 100755 new mode 100644 index 8ce2d793..bdd985ae --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/fernet.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/fernet.pyi @@ -1,11 +1,16 @@ -from typing import List, Optional +from typing import List, Optional, Text, Union class InvalidToken(Exception): ... class Fernet(object): - def __init__(self, key: bytes) -> None: ... + def __init__(self, key: Union[bytes, Text]) -> None: ... def decrypt(self, token: bytes, ttl: Optional[int] = ...) -> bytes: ... + # decrypt_at_time accepts None ttl at runtime but it's an implementtion detail and it doesn't really + # make sense for the client code to use it like that, so the parameter is typed as int as opposed to + # Optional[int]. + def decrypt_at_time(self, token: bytes, ttl: int, current_time: int) -> bytes: ... def encrypt(self, data: bytes) -> bytes: ... + def encrypt_at_time(self, data: bytes, current_time: int) -> bytes: ... def extract_timestamp(self, token: bytes) -> int: ... @classmethod def generate_key(cls) -> bytes: ... @@ -13,5 +18,8 @@ class Fernet(object): class MultiFernet(object): def __init__(self, fernets: List[Fernet]) -> None: ... def decrypt(self, token: bytes, ttl: Optional[int] = ...) -> bytes: ... + # See a note above on the typing of the ttl parameter. + def decrypt_at_time(self, token: bytes, ttl: int, current_time: int) -> bytes: ... def encrypt(self, data: bytes) -> bytes: ... + def encrypt_at_time(self, data: bytes, current_time: int) -> bytes: ... def rotate(self, msg: bytes) -> bytes: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/__init__.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/backends/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/backends/__init__.pyi old mode 100755 new mode 100644 index 4e6d67af..d452202e --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/backends/__init__.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/backends/__init__.pyi @@ -1,3 +1,6 @@ from typing import Any def default_backend() -> Any: ... + +# TODO: add some backends +def __getattr__(name: str) -> Any: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/backends/interfaces.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/backends/interfaces.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/bindings/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/bindings/__init__.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/bindings/openssl/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/bindings/openssl/__init__.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/bindings/openssl/binding.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/bindings/openssl/binding.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/__init__.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/__init__.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/dh.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/dh.pyi old mode 100755 new mode 100644 index aa657e27..87dd3481 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/dh.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/dh.pyi @@ -28,7 +28,7 @@ class DHParameterNumbers(object): @property def q(self) -> int: ... def __init__(self, p: int, g: int, q: Optional[int]) -> None: ... - def parameters(self, backend: DHBackend) -> DHParameters: ... + def parameters(self, backend: Optional[DHBackend] = ...) -> DHParameters: ... class DHPrivateKey(metaclass=ABCMeta): key_size: int @@ -53,7 +53,7 @@ class DHPrivateNumbers(object): @property def x(self) -> int: ... def __init__(self, x: int, public_numbers: DHPublicNumbers) -> None: ... - def private_key(self, backend: DHBackend) -> DHPrivateKey: ... + def private_key(self, backend: Optional[DHBackend] = ...) -> DHPrivateKey: ... class DHPublicKey(metaclass=ABCMeta): @property @@ -74,4 +74,6 @@ class DHPublicNumbers(object): @property def y(self) -> int: ... def __init__(self, y: int, parameter_numbers: DHParameterNumbers) -> None: ... - def public_key(self, backend: DHBackend) -> DHPublicKey: ... + def public_key(self, backend: Optional[DHBackend] = ...) -> DHPublicKey: ... + +def generate_parameters(generator: int, key_size: int, backend: Optional[DHBackend] = ...) -> DHParameters: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/dsa.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/dsa.pyi old mode 100755 new mode 100644 index ba957813..2a2323d9 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/dsa.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/dsa.pyi @@ -1,6 +1,5 @@ from abc import ABCMeta, abstractmethod - -from typing import Union +from typing import Optional, Union from cryptography.hazmat.backends.interfaces import DSABackend from cryptography.hazmat.primitives.asymmetric import AsymmetricVerificationContext @@ -24,7 +23,7 @@ class DSAParameterNumbers(object): @property def g(self) -> int: ... def __init__(self, p: int, q: int, g: int) -> None: ... - def parameters(self, backend: DSABackend) -> DSAParameters: ... + def parameters(self, backend: Optional[DSABackend] = ...) -> DSAParameters: ... class DSAPrivateKey(metaclass=ABCMeta): @property @@ -61,8 +60,9 @@ class DSAPublicKey(metaclass=ABCMeta): @abstractmethod def public_numbers(self) -> DSAPublicNumbers: ... @abstractmethod - def verifier(self, signature: bytes, - signature_algorithm: Union[HashAlgorithm, Prehashed]) -> AsymmetricVerificationContext: ... + def verifier( + self, signature: bytes, signature_algorithm: Union[HashAlgorithm, Prehashed] + ) -> AsymmetricVerificationContext: ... @abstractmethod def verify(self, signature: bytes, data: bytes, algorithm: Union[HashAlgorithm, Prehashed]) -> None: ... @@ -75,5 +75,5 @@ class DSAPublicNumbers(object): def parameter_numbers(self) -> DSAParameterNumbers: ... def __init__(self, y: int, parameter_numbers: DSAParameterNumbers) -> None: ... -def generate_parameters(key_size: int, backend: DSABackend) -> DSAParameters: ... -def generate_private_key(key_size: int, backend: DSABackend) -> DSAPrivateKey: ... +def generate_parameters(key_size: int, backend: Optional[DSABackend] = ...) -> DSAParameters: ... +def generate_private_key(key_size: int, backend: Optional[DSABackend] = ...) -> DSAPrivateKey: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/ec.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/ec.pyi old mode 100755 new mode 100644 index af2893e8..cfdd031f --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/ec.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/ec.pyi @@ -1,9 +1,9 @@ from abc import ABCMeta, abstractmethod -from typing import ClassVar, Union +from typing import ClassVar, Optional, Union from cryptography.hazmat.backends.interfaces import EllipticCurveBackend -from cryptography.hazmat.primitives.asymmetric.utils import Prehashed from cryptography.hazmat.primitives.asymmetric import AsymmetricVerificationContext +from cryptography.hazmat.primitives.asymmetric.utils import Prehashed from cryptography.hazmat.primitives.hashes import HashAlgorithm from cryptography.hazmat.primitives.serialization import Encoding, KeySerializationEncryption, PrivateFormat, PublicFormat from cryptography.x509 import ObjectIdentifier @@ -17,118 +17,80 @@ class EllipticCurve(metaclass=ABCMeta): def name(self) -> str: ... class BrainpoolP256R1(EllipticCurve): - @property - def key_size(self) -> int: ... - @property - def name(self) -> str: ... + key_size: int = ... + name: str = ... class BrainpoolP384R1(EllipticCurve): - @property - def key_size(self) -> int: ... - @property - def name(self) -> str: ... + key_size: int = ... + name: str = ... class BrainpoolP512R1(EllipticCurve): - @property - def key_size(self) -> int: ... - @property - def name(self) -> str: ... + key_size: int = ... + name: str = ... class SECP192R1(EllipticCurve): - @property - def key_size(self) -> int: ... - @property - def name(self) -> str: ... + key_size: int = ... + name: str = ... class SECP224R1(EllipticCurve): - @property - def key_size(self) -> int: ... - @property - def name(self) -> str: ... + key_size: int = ... + name: str = ... class SECP256K1(EllipticCurve): - @property - def key_size(self) -> int: ... - @property - def name(self) -> str: ... + key_size: int = ... + name: str = ... class SECP256R1(EllipticCurve): - @property - def key_size(self) -> int: ... - @property - def name(self) -> str: ... + key_size: int = ... + name: str = ... class SECP384R1(EllipticCurve): - @property - def key_size(self) -> int: ... - @property - def name(self) -> str: ... + key_size: int = ... + name: str = ... class SECP521R1(EllipticCurve): - @property - def key_size(self) -> int: ... - @property - def name(self) -> str: ... + key_size: int = ... + name: str = ... class SECT163K1(EllipticCurve): - @property - def key_size(self) -> int: ... - @property - def name(self) -> str: ... + key_size: int = ... + name: str = ... class SECT163R2(EllipticCurve): - @property - def key_size(self) -> int: ... - @property - def name(self) -> str: ... + key_size: int = ... + name: str = ... class SECT233K1(EllipticCurve): - @property - def key_size(self) -> int: ... - @property - def name(self) -> str: ... + key_size: int = ... + name: str = ... class SECT233R1(EllipticCurve): - @property - def key_size(self) -> int: ... - @property - def name(self) -> str: ... + key_size: int = ... + name: str = ... class SECT283K1(EllipticCurve): - @property - def key_size(self) -> int: ... - @property - def name(self) -> str: ... + key_size: int = ... + name: str = ... class SECT283R1(EllipticCurve): - @property - def key_size(self) -> int: ... - @property - def name(self) -> str: ... + key_size: int = ... + name: str = ... class SECT409K1(EllipticCurve): - @property - def key_size(self) -> int: ... - @property - def name(self) -> str: ... + key_size: int = ... + name: str = ... class SECT409R1(EllipticCurve): - @property - def key_size(self) -> int: ... - @property - def name(self) -> str: ... + key_size: int = ... + name: str = ... class SECT571K1(EllipticCurve): - @property - def key_size(self) -> int: ... - @property - def name(self) -> str: ... + key_size: int = ... + name: str = ... class SECT571R1(EllipticCurve): - @property - def key_size(self) -> int: ... - @property - def name(self) -> str: ... + key_size: int = ... + name: str = ... class EllipticCurveOID(object): SECP192R1: ClassVar[ObjectIdentifier] @@ -179,7 +141,7 @@ class EllipticCurvePrivateNumbers(object): @property def public_numbers(self) -> EllipticCurvePublicNumbers: ... def __init__(self, private_value: int, public_numbers: EllipticCurvePublicNumbers) -> None: ... - def private_key(self, backend: EllipticCurveBackend) -> EllipticCurvePrivateKey: ... + def private_key(self, backend: Optional[EllipticCurveBackend] = ...) -> EllipticCurvePrivateKey: ... class EllipticCurvePublicKey(metaclass=ABCMeta): @property @@ -195,7 +157,9 @@ class EllipticCurvePublicKey(metaclass=ABCMeta): @abstractmethod def public_numbers(self) -> EllipticCurvePublicNumbers: ... @abstractmethod - def verifier(self, signature: bytes, signature_algorithm: EllipticCurveSignatureAlgorithm) -> AsymmetricVerificationContext: ... + def verifier( + self, signature: bytes, signature_algorithm: EllipticCurveSignatureAlgorithm + ) -> AsymmetricVerificationContext: ... @abstractmethod def verify(self, signature: bytes, data: bytes, signature_algorithm: EllipticCurveSignatureAlgorithm) -> None: ... @@ -211,7 +175,7 @@ class EllipticCurvePublicNumbers(object): def __init__(self, x: int, y: int, curve: EllipticCurve) -> None: ... @classmethod def from_encoded_point(cls, curve: EllipticCurve, data: bytes) -> EllipticCurvePublicNumbers: ... - def public_key(self, backend: EllipticCurveBackend) -> EllipticCurvePublicKey: ... + def public_key(self, backend: Optional[EllipticCurveBackend] = ...) -> EllipticCurvePublicKey: ... class EllipticCurveSignatureAlgorithm(metaclass=ABCMeta): @property @@ -221,10 +185,12 @@ class EllipticCurveSignatureAlgorithm(metaclass=ABCMeta): class ECDH(object): ... class ECDSA(EllipticCurveSignatureAlgorithm): - def __init__(self, algorithm: HashAlgorithm): ... + def __init__(self, algorithm: Union[HashAlgorithm, Prehashed]): ... @property def algorithm(self) -> Union[HashAlgorithm, Prehashed]: ... -def derive_private_key(private_value: int, curve: EllipticCurve, backend: EllipticCurveBackend) -> EllipticCurvePrivateKey: ... -def generate_private_key(curve: EllipticCurve, backend: EllipticCurveBackend) -> EllipticCurvePrivateKey: ... +def derive_private_key( + private_value: int, curve: EllipticCurve, backend: Optional[EllipticCurveBackend] = ... +) -> EllipticCurvePrivateKey: ... +def generate_private_key(curve: EllipticCurve, backend: Optional[EllipticCurveBackend] = ...) -> EllipticCurvePrivateKey: ... def get_curve_for_oid(oid: ObjectIdentifier) -> EllipticCurve: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/ed25519.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/ed25519.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/ed448.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/ed448.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/padding.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/padding.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/rsa.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/rsa.pyi old mode 100755 new mode 100644 index 30604dbe..35acc5b1 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/rsa.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/rsa.pyi @@ -1,5 +1,5 @@ from abc import ABCMeta, abstractmethod -from typing import Tuple, Union +from typing import Optional, Tuple, Union from cryptography.hazmat.backends.interfaces import RSABackend from cryptography.hazmat.primitives.asymmetric import AsymmetricVerificationContext @@ -38,15 +38,19 @@ class RSAPublicKey(metaclass=ABCMeta): @abstractmethod def public_numbers(self) -> RSAPublicNumbers: ... @abstractmethod - def verifier(self, signature: bytes, padding: AsymmetricPadding, - algorithm: Union[HashAlgorithm, Prehashed]) -> AsymmetricVerificationContext: ... + def verifier( + self, signature: bytes, padding: AsymmetricPadding, algorithm: Union[HashAlgorithm, Prehashed] + ) -> AsymmetricVerificationContext: ... @abstractmethod - def verify(self, signature: bytes, data: bytes, padding: AsymmetricPadding, - algorithm: Union[HashAlgorithm, Prehashed]) -> None: ... + def verify( + self, signature: bytes, data: bytes, padding: AsymmetricPadding, algorithm: Union[HashAlgorithm, Prehashed] + ) -> None: ... RSAPublicKeyWithSerialization = RSAPublicKey -def generate_private_key(public_exponent: int, key_size: int, backend: RSABackend) -> RSAPrivateKeyWithSerialization: ... +def generate_private_key( + public_exponent: int, key_size: int, backend: Optional[RSABackend] = ... +) -> RSAPrivateKeyWithSerialization: ... def rsa_crt_iqmp(p: int, q: int) -> int: ... def rsa_crt_dmp1(private_exponent: int, p: int) -> int: ... def rsa_crt_dmq1(private_exponent: int, q: int) -> int: ... @@ -68,12 +72,12 @@ class RSAPrivateNumbers(object): def iqmp(self) -> int: ... @property def public_numbers(self) -> RSAPublicNumbers: ... - def private_key(self, backend) -> RSAPrivateKey: ... + def private_key(self, backend: Optional[RSABackend] = ...) -> RSAPrivateKey: ... class RSAPublicNumbers(object): def __init__(self, e: int, n: int) -> None: ... @property - def p(self) -> int: ... + def e(self) -> int: ... @property - def q(self) -> int: ... - def public_key(self, backend) -> RSAPublicKey: ... + def n(self) -> int: ... + def public_key(self, backend: Optional[RSABackend] = ...) -> RSAPublicKey: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/utils.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/utils.pyi old mode 100755 new mode 100644 index 136d270d..5bd9f53a --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/utils.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/utils.pyi @@ -1,6 +1,12 @@ from typing import Tuple +from cryptography.hazmat.primitives.hashes import HashAlgorithm + def decode_dss_signature(signature: bytes) -> Tuple[int, int]: ... def encode_dss_signature(r: int, s: int) -> bytes: ... -class Prehashed(object): ... +class Prehashed(object): + _algorithm: HashAlgorithm # undocumented + _digest_size: int # undocumented + def __init__(self, algorithm: HashAlgorithm) -> None: ... + digest_size: int diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/x25519.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/x25519.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/x448.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/x448.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/ciphers/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/ciphers/__init__.pyi old mode 100755 new mode 100644 index 547a288d..08f4c746 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/ciphers/__init__.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/ciphers/__init__.pyi @@ -1,4 +1,5 @@ from abc import ABCMeta, abstractmethod +from typing import Optional from cryptography.hazmat.backends.interfaces import CipherBackend from cryptography.hazmat.primitives.ciphers.modes import Mode @@ -22,7 +23,7 @@ class BlockCipherAlgorithm(metaclass=ABCMeta): def block_size(self) -> int: ... class Cipher(object): - def __init__(self, algorithm: CipherAlgorithm, mode: Mode, backend: CipherBackend) -> None: ... + def __init__(self, algorithm: CipherAlgorithm, mode: Optional[Mode], backend: Optional[CipherBackend] = ...) -> None: ... def decryptor(self) -> CipherContext: ... def encryptor(self) -> CipherContext: ... @@ -40,4 +41,4 @@ class CipherContext(metaclass=ABCMeta): @abstractmethod def update(self, data: bytes) -> bytes: ... @abstractmethod - def update_into(self, data: bytes, buf) -> int: ... + def update_into(self, data: bytes, buf: bytearray) -> int: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/ciphers/aead.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/ciphers/aead.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/ciphers/algorithms.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/ciphers/algorithms.pyi old mode 100755 new mode 100644 index 41940d54..78e44b2c --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/ciphers/algorithms.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/ciphers/algorithms.pyi @@ -1,55 +1,53 @@ +from typing import FrozenSet + from cryptography.hazmat.primitives.ciphers import BlockCipherAlgorithm, CipherAlgorithm from cryptography.hazmat.primitives.ciphers.modes import ModeWithNonce class AES(BlockCipherAlgorithm, CipherAlgorithm): def __init__(self, key: bytes) -> None: ... - @property - def block_size(self) -> int: ... + block_size: int = ... + name: str = ... + key_sizes: FrozenSet[int] = ... @property def key_size(self) -> int: ... - @property - def name(self) -> str: ... class ARC4(CipherAlgorithm): def __init__(self, key: bytes) -> None: ... @property def key_size(self) -> int: ... - @property - def name(self) -> str: ... + name: str = ... + key_sizes: FrozenSet[int] = ... class Blowfish(BlockCipherAlgorithm, CipherAlgorithm): def __init__(self, key: bytes) -> None: ... @property - def block_size(self) -> int: ... - @property def key_size(self) -> int: ... - @property - def name(self) -> str: ... + block_size: int = ... + name: str = ... + key_sizes: FrozenSet[int] = ... -class Camelia(BlockCipherAlgorithm, CipherAlgorithm): +class Camellia(BlockCipherAlgorithm, CipherAlgorithm): def __init__(self, key: bytes) -> None: ... @property - def block_size(self) -> int: ... - @property def key_size(self) -> int: ... - @property - def name(self) -> str: ... + block_size: int = ... + name: str = ... + key_sizes: FrozenSet[int] = ... class CAST5(BlockCipherAlgorithm, CipherAlgorithm): def __init__(self, key: bytes) -> None: ... @property - def block_size(self) -> int: ... - @property def key_size(self) -> int: ... - @property - def name(self) -> str: ... + block_size: int = ... + name: str = ... + key_sizes: FrozenSet[int] = ... class ChaCha20(CipherAlgorithm, ModeWithNonce): def __init__(self, key: bytes, nonce: bytes) -> None: ... @property def key_size(self) -> int: ... - @property - def name(self) -> str: ... + name: str = ... + key_sizes: FrozenSet[int] = ... @property def nonce(self) -> bytes: ... @@ -57,23 +55,22 @@ class IDEA(CipherAlgorithm): def __init__(self, key: bytes) -> None: ... @property def key_size(self) -> int: ... - @property - def name(self) -> str: ... + block_size: int = ... + name: str = ... + key_sizes: FrozenSet[int] = ... class SEED(BlockCipherAlgorithm, CipherAlgorithm): def __init__(self, key: bytes) -> None: ... @property - def block_size(self) -> int: ... - @property def key_size(self) -> int: ... - @property - def name(self) -> str: ... + block_size: int = ... + name: str = ... + key_sizes: FrozenSet[int] = ... class TripleDES(BlockCipherAlgorithm, CipherAlgorithm): def __init__(self, key: bytes) -> None: ... @property - def block_size(self) -> int: ... - @property def key_size(self) -> int: ... - @property - def name(self) -> str: ... + block_size: int = ... + name: str = ... + key_sizes: FrozenSet[int] = ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/ciphers/modes.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/ciphers/modes.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/cmac.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/cmac.pyi old mode 100755 new mode 100644 index 8a2b4635..60c30134 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/cmac.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/cmac.pyi @@ -1,8 +1,10 @@ +from typing import Optional + from cryptography.hazmat.backends.interfaces import CMACBackend from cryptography.hazmat.primitives.ciphers import BlockCipherAlgorithm class CMAC(object): - def __init__(self, algorithm: BlockCipherAlgorithm, backend: CMACBackend) -> None: ... + def __init__(self, algorithm: BlockCipherAlgorithm, backend: Optional[CMACBackend] = ...) -> None: ... def copy(self) -> CMAC: ... def finalize(self) -> bytes: ... def update(self, data: bytes) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/constant_time.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/constant_time.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/hashes.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/hashes.pyi old mode 100755 new mode 100644 index 2b62df92..d6e31dc0 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/hashes.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/hashes.pyi @@ -1,4 +1,5 @@ from abc import ABCMeta, abstractmethod +from typing import Optional from cryptography.hazmat.backends.interfaces import HashBackend @@ -37,7 +38,7 @@ class SHAKE256(HashAlgorithm): def __init__(self, digest_size: int) -> None: ... class Hash(HashContext): - def __init__(self, algorithm: HashAlgorithm, backend: HashBackend): ... + def __init__(self, algorithm: HashAlgorithm, backend: Optional[HashBackend] = ...): ... def copy(self) -> Hash: ... def finalize(self) -> bytes: ... def update(self, data: bytes) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/hmac.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/hmac.pyi old mode 100755 new mode 100644 index 200f719a..15420ca2 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/hmac.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/hmac.pyi @@ -1,8 +1,10 @@ +from typing import Optional + from cryptography.hazmat.backends.interfaces import HMACBackend from cryptography.hazmat.primitives.hashes import HashAlgorithm class HMAC(object): - def __init__(self, key: bytes, algorithm: HashAlgorithm, backend: HMACBackend) -> None: ... + def __init__(self, key: bytes, algorithm: HashAlgorithm, backend: Optional[HMACBackend] = ...) -> None: ... def copy(self) -> HMAC: ... def finalize(self) -> bytes: ... def update(self, msg: bytes) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/kdf/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/kdf/__init__.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/kdf/concatkdf.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/kdf/concatkdf.pyi old mode 100755 new mode 100644 index a995a5fa..7e0b36ff --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/kdf/concatkdf.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/kdf/concatkdf.pyi @@ -5,13 +5,20 @@ from cryptography.hazmat.primitives.hashes import HashAlgorithm from cryptography.hazmat.primitives.kdf import KeyDerivationFunction class ConcatKDFHash(KeyDerivationFunction): - def __init__(self, algorithm: HashAlgorithm, length: int, otherinfo: Optional[bytes], backend: HashBackend): ... + def __init__( + self, algorithm: HashAlgorithm, length: int, otherinfo: Optional[bytes], backend: Optional[HashBackend] = ... + ): ... def derive(self, key_material: bytes) -> bytes: ... def verify(self, key_material: bytes, expected_key: bytes) -> None: ... class ConcatKDFHMAC(KeyDerivationFunction): def __init__( - self, algorithm: HashAlgorithm, length: int, salt: Optional[bytes], otherinfo: Optional[bytes], backend: HMACBackend + self, + algorithm: HashAlgorithm, + length: int, + salt: Optional[bytes], + otherinfo: Optional[bytes], + backend: Optional[HMACBackend] = ..., ): ... def derive(self, key_material: bytes) -> bytes: ... def verify(self, key_material: bytes, expected_key: bytes) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/kdf/hkdf.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/kdf/hkdf.pyi old mode 100755 new mode 100644 index 112a7307..16997ab5 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/kdf/hkdf.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/kdf/hkdf.pyi @@ -6,12 +6,17 @@ from cryptography.hazmat.primitives.kdf import KeyDerivationFunction class HKDF(KeyDerivationFunction): def __init__( - self, algorithm: HashAlgorithm, length: int, salt: Optional[bytes], info: Optional[bytes], backend: HMACBackend + self, + algorithm: HashAlgorithm, + length: int, + salt: Optional[bytes], + info: Optional[bytes], + backend: Optional[HMACBackend] = ..., ): ... def derive(self, key_material: bytes) -> bytes: ... def verify(self, key_material: bytes, expected_key: bytes) -> None: ... class HKDFExpand(KeyDerivationFunction): - def __init__(self, algorithm: HashAlgorithm, length: int, info: Optional[bytes], backend: HMACBackend): ... + def __init__(self, algorithm: HashAlgorithm, length: int, info: Optional[bytes], backend: Optional[HMACBackend] = ...): ... def derive(self, key_material: bytes) -> bytes: ... def verify(self, key_material: bytes, expected_key: bytes) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/kdf/kbkdf.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/kdf/kbkdf.pyi old mode 100755 new mode 100644 index a96c34c9..1e8b69eb --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/kdf/kbkdf.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/kdf/kbkdf.pyi @@ -24,7 +24,7 @@ class KBKDFHMAC(KeyDerivationFunction): label: Optional[bytes], context: Optional[bytes], fixed: Optional[bytes], - backend: HMACBackend, + backend: Optional[HMACBackend] = ..., ): ... def derive(self, key_material: bytes) -> bytes: ... def verify(self, key_material: bytes, expected_key: bytes) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/kdf/pbkdf2.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/kdf/pbkdf2.pyi old mode 100755 new mode 100644 index 5e217bf8..8953cf97 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/kdf/pbkdf2.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/kdf/pbkdf2.pyi @@ -1,8 +1,12 @@ +from typing import Optional + from cryptography.hazmat.backends.interfaces import PBKDF2HMACBackend from cryptography.hazmat.primitives.hashes import HashAlgorithm from cryptography.hazmat.primitives.kdf import KeyDerivationFunction class PBKDF2HMAC(KeyDerivationFunction): - def __init__(self, algorithm: HashAlgorithm, length: int, salt: bytes, iterations: int, backend: PBKDF2HMACBackend): ... + def __init__( + self, algorithm: HashAlgorithm, length: int, salt: bytes, iterations: int, backend: Optional[PBKDF2HMACBackend] = ... + ): ... def derive(self, key_material: bytes) -> bytes: ... def verify(self, key_material: bytes, expected_key: bytes) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/kdf/scrypt.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/kdf/scrypt.pyi old mode 100755 new mode 100644 index a0880292..7f24125f --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/kdf/scrypt.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/kdf/scrypt.pyi @@ -1,7 +1,9 @@ +from typing import Optional + from cryptography.hazmat.backends.interfaces import ScryptBackend from cryptography.hazmat.primitives.kdf import KeyDerivationFunction class Scrypt(KeyDerivationFunction): - def __init__(self, salt: bytes, length: int, n: int, r: int, p: int, backend: ScryptBackend): ... + def __init__(self, salt: bytes, length: int, n: int, r: int, p: int, backend: Optional[ScryptBackend] = ...): ... def derive(self, key_material: bytes) -> bytes: ... def verify(self, key_material: bytes, expected_key: bytes) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/kdf/x963kdf.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/kdf/x963kdf.pyi old mode 100755 new mode 100644 index 324bc179..80aa289c --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/kdf/x963kdf.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/kdf/x963kdf.pyi @@ -5,6 +5,8 @@ from cryptography.hazmat.primitives.hashes import HashAlgorithm from cryptography.hazmat.primitives.kdf import KeyDerivationFunction class X963KDF(KeyDerivationFunction): - def __init__(self, algorithm: HashAlgorithm, length: int, sharedinfo: Optional[bytes], backend: HashBackend): ... + def __init__( + self, algorithm: HashAlgorithm, length: int, sharedinfo: Optional[bytes], backend: Optional[HashBackend] = ... + ): ... def derive(self, key_material: bytes) -> bytes: ... def verify(self, key_material: bytes, expected_key: bytes) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/keywrap.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/keywrap.pyi old mode 100755 new mode 100644 index b26f1fb8..6aa3e64b --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/keywrap.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/keywrap.pyi @@ -1,8 +1,10 @@ +from typing import Optional + from cryptography.hazmat.backends.interfaces import CipherBackend -def aes_key_wrap(wrapping_key: bytes, key_to_wrap: bytes, backend: CipherBackend) -> bytes: ... -def aes_key_wrap_with_padding(wrapping_key: bytes, key_to_wrap: bytes, backend: CipherBackend) -> bytes: ... -def aes_key_unwrap(wrapping_key: bytes, wrapped_key: bytes, backend: CipherBackend) -> bytes: ... -def aes_key_unwrap_with_padding(wrapping_key: bytes, wrapped_key: bytes, backend: CipherBackend) -> bytes: ... +def aes_key_wrap(wrapping_key: bytes, key_to_wrap: bytes, backend: Optional[CipherBackend] = ...) -> bytes: ... +def aes_key_wrap_with_padding(wrapping_key: bytes, key_to_wrap: bytes, backend: Optional[CipherBackend] = ...) -> bytes: ... +def aes_key_unwrap(wrapping_key: bytes, wrapped_key: bytes, backend: Optional[CipherBackend] = ...) -> bytes: ... +def aes_key_unwrap_with_padding(wrapping_key: bytes, wrapped_key: bytes, backend: Optional[CipherBackend] = ...) -> bytes: ... class InvalidUnwrap(Exception): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/padding.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/padding.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/poly1305.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/poly1305.pyi old mode 100755 new mode 100644 index f8cb5304..886f6702 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/poly1305.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/poly1305.pyi @@ -1,6 +1,3 @@ -from cryptography.hazmat.backends.interfaces import HMACBackend -from cryptography.hazmat.primitives.hashes import HashAlgorithm - class Poly1305(object): def __init__(self, key: bytes) -> None: ... def finalize(self) -> bytes: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/serialization/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/serialization/__init__.pyi old mode 100755 new mode 100644 index 10304878..93575117 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/serialization/__init__.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/serialization/__init__.pyi @@ -1,12 +1,35 @@ from abc import ABCMeta from enum import Enum -from typing import Optional - -def load_pem_private_key(data: bytes, password: Optional[bytes], backend): ... -def load_pem_public_key(data: bytes, backend): ... -def load_der_private_key(data: bytes, password: Optional[bytes], backend): ... -def load_der_public_key(data: bytes, backend): ... -def load_ssh_public_key(data: bytes, backend): ... +from typing import Any, Optional, Union + +from cryptography.hazmat.backends.interfaces import ( + DERSerializationBackend, + DSABackend, + EllipticCurveBackend, + PEMSerializationBackend, + RSABackend, +) +from cryptography.hazmat.primitives.asymmetric.dh import DHPrivateKey, DHPublicKey +from cryptography.hazmat.primitives.asymmetric.dsa import DSAPrivateKey, DSAPublicKey +from cryptography.hazmat.primitives.asymmetric.ec import EllipticCurvePrivateKey, EllipticCurvePublicKey +from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PublicKey +from cryptography.hazmat.primitives.asymmetric.rsa import RSAPrivateKey, RSAPublicKey + +def load_pem_private_key( + data: bytes, password: Optional[bytes], backend: Optional[PEMSerializationBackend] = ... +) -> Any: ... # actually Union[RSAPrivateKey, DSAPrivateKey, DHPrivateKey, EllipticCurvePrivateKey] +def load_pem_public_key( + data: bytes, backend: Optional[PEMSerializationBackend] = ... +) -> Any: ... # actually Union[RSAPublicKey, DSAPublicKey, DHPublicKey, EllipticCurvePublicKey] +def load_der_private_key( + data: bytes, password: Optional[bytes], backend: Optional[DERSerializationBackend] = ... +) -> Any: ... # actually Union[RSAPrivateKey, DSAPrivateKey, DHPrivateKey, EllipticCurvePrivateKey] +def load_der_public_key( + data: bytes, backend: Optional[DERSerializationBackend] = ... +) -> Any: ... # actually Union[RSAPublicKey, DSAPublicKey, DHPublicKey, EllipticCurvePublicKey] +def load_ssh_public_key( + data: bytes, backend: Union[RSABackend, DSABackend, EllipticCurveBackend, None] +) -> Any: ... # actually Union[RSAPublicKey, DSAPublicKey, DHPublicKey, EllipticCurvePublicKey, Ed25519PublicKey] class Encoding(Enum): PEM: str diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/serialization/pkcs12.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/serialization/pkcs12.pyi old mode 100755 new mode 100644 index d903ae47..101eb26f --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/serialization/pkcs12.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/serialization/pkcs12.pyi @@ -1,3 +1,18 @@ -from typing import Optional +from typing import Any, List, Optional, Tuple, Union -def load_key_and_certificates(data: bytes, password: Optional[bytes], backend): ... +from cryptography.hazmat.primitives.asymmetric.dsa import DSAPrivateKeyWithSerialization +from cryptography.hazmat.primitives.asymmetric.ec import EllipticCurvePrivateKeyWithSerialization +from cryptography.hazmat.primitives.asymmetric.rsa import RSAPrivateKeyWithSerialization +from cryptography.hazmat.primitives.serialization import KeySerializationEncryption +from cryptography.x509 import Certificate + +def load_key_and_certificates( + data: bytes, password: Optional[bytes], backend: Optional[Any] = ... +) -> Tuple[Optional[Any], Optional[Certificate], List[Certificate]]: ... +def serialize_key_and_certificates( + name: bytes, + key: Union[RSAPrivateKeyWithSerialization, EllipticCurvePrivateKeyWithSerialization, DSAPrivateKeyWithSerialization], + cert: Optional[Certificate], + cas: Optional[List[Certificate]], + enc: KeySerializationEncryption, +) -> bytes: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/twofactor/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/twofactor/__init__.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/twofactor/hotp.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/twofactor/hotp.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/twofactor/totp.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/twofactor/totp.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/x509.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/x509/__init__.pyi old mode 100755 new mode 100644 similarity index 65% rename from anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/x509.pyi rename to anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/x509/__init__.pyi index d851d3f6..316e0ecc --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/x509.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/x509/__init__.pyi @@ -2,7 +2,7 @@ import datetime from abc import ABCMeta, abstractmethod from enum import Enum from ipaddress import IPv4Address, IPv4Network, IPv6Address, IPv6Network -from typing import Any, ClassVar, Generator, List, Optional, Union, Text, Iterable, Sequence, Type +from typing import Any, ClassVar, Generator, Generic, Iterable, List, Optional, Sequence, Text, Type, TypeVar, Union from cryptography.hazmat.backends.interfaces import X509Backend from cryptography.hazmat.primitives.asymmetric.dsa import DSAPrivateKey, DSAPublicKey @@ -14,8 +14,8 @@ from cryptography.hazmat.primitives.hashes import HashAlgorithm from cryptography.hazmat.primitives.serialization import Encoding class ObjectIdentifier(object): + dotted_string: str def __init__(self, dotted_string: str) -> None: ... - def dotted_string(self) -> str: ... class CRLEntryExtensionOID(object): CERTIFICATE_ISSUER: ClassVar[ObjectIdentifier] @@ -96,6 +96,15 @@ class SignatureAlgorithmOID(object): RSA_WITH_SHA384: ClassVar[ObjectIdentifier] RSA_WITH_SHA512: ClassVar[ObjectIdentifier] +class ExtendedKeyUsageOID(object): + SERVER_AUTH: ClassVar[ObjectIdentifier] + CLIENT_AUTH: ClassVar[ObjectIdentifier] + CODE_SIGNING: ClassVar[ObjectIdentifier] + EMAIL_PROTECTION: ClassVar[ObjectIdentifier] + TIME_STAMPING: ClassVar[ObjectIdentifier] + OCSP_SIGNING: ClassVar[ObjectIdentifier] + ANY_EXTENDED_KEY_USAGE: ClassVar[ObjectIdentifier] + class NameAttribute(object): oid: ObjectIdentifier value: Text @@ -114,7 +123,7 @@ class Name(object): def __iter__(self) -> Generator[NameAttribute, None, None]: ... def __len__(self) -> int: ... def get_attributes_for_oid(self, oid: ObjectIdentifier) -> List[NameAttribute]: ... - def public_bytes(self, backend: X509Backend) -> bytes: ... + def public_bytes(self, backend: Optional[X509Backend] = ...) -> bytes: ... def rfc4514_string(self) -> str: ... class Version(Enum): @@ -141,12 +150,16 @@ class Certificate(metaclass=ABCMeta): def public_key(self) -> Union[DSAPublicKey, Ed25519PublicKey, Ed448PublicKey, EllipticCurvePublicKey, RSAPublicKey]: ... class CertificateBuilder(object): - def __init__(self, issuer_name: Optional[Name] = ..., subject_name: Optional[Name] = ..., - public_key: Union[DSAPublicKey, Ed25519PublicKey, Ed448PublicKey, EllipticCurvePublicKey, RSAPublicKey, None] = ..., - serial_number: Optional[int] = ..., - not_valid_before: Optional[datetime.datetime] = ..., - not_valid_after: Optional[datetime.datetime] = ..., - extensions: Optional[Iterable[ExtensionType]] = ...) -> None: ... + def __init__( + self, + issuer_name: Optional[Name] = ..., + subject_name: Optional[Name] = ..., + public_key: Union[DSAPublicKey, Ed25519PublicKey, Ed448PublicKey, EllipticCurvePublicKey, RSAPublicKey, None] = ..., + serial_number: Optional[int] = ..., + not_valid_before: Optional[datetime.datetime] = ..., + not_valid_after: Optional[datetime.datetime] = ..., + extensions: Optional[Iterable[ExtensionType]] = ..., + ) -> None: ... def add_extension(self, extension: ExtensionType, critical: bool) -> CertificateBuilder: ... def issuer_name(self, name: Name) -> CertificateBuilder: ... def not_valid_after(self, time: datetime.datetime) -> CertificateBuilder: ... @@ -159,7 +172,7 @@ class CertificateBuilder(object): self, private_key: Union[DSAPrivateKey, Ed25519PrivateKey, Ed448PrivateKey, EllipticCurvePrivateKey, RSAPrivateKey], algorithm: Optional[HashAlgorithm], - backend: X509Backend, + backend: Optional[X509Backend] = ..., ) -> Certificate: ... def subject_name(self, name: Name) -> CertificateBuilder: ... @@ -193,7 +206,7 @@ class CertificateRevocationListBuilder(object): self, private_key: Union[DSAPrivateKey, Ed25519PrivateKey, Ed448PrivateKey, EllipticCurvePrivateKey, RSAPrivateKey], algorithm: Optional[HashAlgorithm], - backend: X509Backend, + backend: Optional[X509Backend] = ..., ) -> CertificateRevocationList: ... class CertificateSigningRequest(metaclass=ABCMeta): @@ -216,7 +229,7 @@ class CertificateSigningRequestBuilder(object): self, private_key: Union[DSAPrivateKey, Ed25519PrivateKey, Ed448PrivateKey, EllipticCurvePrivateKey, RSAPrivateKey], algorithm: Optional[HashAlgorithm], - backend: X509Backend, + backend: Optional[X509Backend] = ..., ) -> CertificateSigningRequest: ... class RevokedCertificate(metaclass=ABCMeta): @@ -226,7 +239,7 @@ class RevokedCertificate(metaclass=ABCMeta): class RevokedCertificateBuilder(object): def add_extension(self, extension: ExtensionType, critical: bool) -> RevokedCertificateBuilder: ... - def build(self, backend: X509Backend) -> RevokedCertificate: ... + def build(self, backend: Optional[X509Backend] = ...) -> RevokedCertificate: ... def revocation_date(self, time: datetime.datetime) -> RevokedCertificateBuilder: ... def serial_number(self, serial_number: int) -> RevokedCertificateBuilder: ... @@ -266,19 +279,29 @@ class UniformResourceIdentifier(GeneralName): # X.509 Extensions -class Extension(object): - critical: bool - oid: ExtensionOID - value: ExtensionType - class ExtensionType(metaclass=ABCMeta): - oid: ExtensionOID + oid: ObjectIdentifier + +_T = TypeVar("_T", bound="ExtensionType") + +class Extension(Generic[_T]): + critical: bool + oid: ObjectIdentifier + value: _T class Extensions(object): - def __init__(self, general_names: List[Extension]) -> None: ... - def __iter__(self) -> Generator[Extension, None, None]: ... - def get_extension_for_oid(self, oid: ObjectIdentifier) -> Extension: ... - def get_extension_for_class(self, extclass: Type[ExtensionType]) -> Extension: ... + def __init__(self, general_names: List[Extension[Any]]) -> None: ... + def __iter__(self) -> Generator[Extension[Any], None, None]: ... + def get_extension_for_oid(self, oid: ObjectIdentifier) -> Extension[Any]: ... + def get_extension_for_class(self, extclass: Type[_T]) -> Extension[_T]: ... + +class DuplicateExtension(Exception): + oid: ObjectIdentifier + def __init__(self, msg: str, oid: ObjectIdentifier) -> None: ... + +class ExtensionNotFound(Exception): + oid: ObjectIdentifier + def __init__(self, msg: str, oid: ObjectIdentifier) -> None: ... class IssuerAlternativeName(ExtensionType): def __init__(self, general_names: List[GeneralName]) -> None: ... @@ -290,10 +313,108 @@ class SubjectAlternativeName(ExtensionType): def __iter__(self) -> Generator[GeneralName, None, None]: ... def get_values_for_type(self, type: Type[GeneralName]) -> List[Any]: ... -def load_der_x509_certificate(data: bytes, backend: X509Backend) -> Certificate: ... -def load_pem_x509_certificate(data: bytes, backend: X509Backend) -> Certificate: ... -def load_der_x509_crl(data: bytes, backend: X509Backend) -> CertificateRevocationList: ... -def load_pem_x509_crl(data: bytes, backend: X509Backend) -> CertificateRevocationList: ... -def load_der_x509_csr(data: bytes, backend: X509Backend) -> CertificateSigningRequest: ... -def load_pem_x509_csr(data: bytes, backend: X509Backend) -> CertificateSigningRequest: ... +class AuthorityKeyIdentifier(ExtensionType): + @property + def key_identifier(self) -> bytes: ... + @property + def authority_cert_issuer(self) -> Optional[List[GeneralName]]: ... + @property + def authority_cert_serial_number(self) -> Optional[int]: ... + def __init__( + self, + key_identifier: bytes, + authority_cert_issuer: Optional[Iterable[GeneralName]], + authority_cert_serial_number: Optional[int], + ) -> None: ... + @classmethod + def from_issuer_public_key( + cls, public_key: Union[RSAPublicKey, DSAPublicKey, EllipticCurvePublicKey, Ed25519PublicKey, Ed448PublicKey] + ) -> AuthorityKeyIdentifier: ... + @classmethod + def from_issuer_subject_key_identifier(cls, ski: SubjectKeyIdentifier) -> AuthorityKeyIdentifier: ... + +class SubjectKeyIdentifier(ExtensionType): + @property + def digest(self) -> bytes: ... + def __init__(self, digest: bytes) -> None: ... + @classmethod + def from_public_key( + cls, public_key: Union[RSAPublicKey, DSAPublicKey, EllipticCurvePublicKey, Ed25519PublicKey, Ed448PublicKey] + ) -> SubjectKeyIdentifier: ... + +class AccessDescription: + @property + def access_method(self) -> ObjectIdentifier: ... + @property + def access_location(self) -> GeneralName: ... + def __init__(self, access_method: ObjectIdentifier, access_location: GeneralName) -> None: ... + +class AuthorityInformationAccess(ExtensionType): + def __init__(self, descriptions: Iterable[AccessDescription]) -> None: ... + def __len__(self) -> int: ... + def __iter__(self) -> Generator[AccessDescription, None, None]: ... + def __getitem__(self, item: int) -> AccessDescription: ... + +class SubjectInformationAccess(ExtensionType): + def __init__(self, descriptions: Iterable[AccessDescription]) -> None: ... + def __len__(self) -> int: ... + def __iter__(self) -> Generator[AccessDescription, None, None]: ... + def __getitem__(self, item: int) -> AccessDescription: ... + +class BasicConstraints(ExtensionType): + @property + def ca(self) -> bool: ... + @property + def path_length(self) -> Optional[int]: ... + def __init__(self, ca: bool, path_length: Optional[int]) -> None: ... + +class KeyUsage(ExtensionType): + @property + def digital_signature(self) -> bool: ... + @property + def content_commitment(self) -> bool: ... + @property + def key_encipherment(self) -> bool: ... + @property + def data_encipherment(self) -> bool: ... + @property + def key_agreement(self) -> bool: ... + @property + def key_cert_sign(self) -> bool: ... + @property + def crl_sign(self) -> bool: ... + @property + def encipher_only(self) -> bool: ... + @property + def decipher_only(self) -> bool: ... + def __init__( + self, + digital_signature: bool, + content_commitment: bool, + key_encipherment: bool, + data_encipherment: bool, + key_agreement: bool, + key_cert_sign: bool, + crl_sign: bool, + encipher_only: bool, + decipher_only: bool, + ) -> None: ... + +class ExtendedKeyUsage(ExtensionType): + def __init__(self, usages: Iterable[ObjectIdentifier]) -> None: ... + def __len__(self) -> int: ... + def __iter__(self) -> Generator[ObjectIdentifier, None, None]: ... + def __getitem__(self, item: int) -> ObjectIdentifier: ... + +class UnrecognizedExtension(ExtensionType): + @property + def value(self) -> bytes: ... + def __init__(self, oid: ObjectIdentifier, value: bytes) -> None: ... + +def load_der_x509_certificate(data: bytes, backend: Optional[X509Backend] = ...) -> Certificate: ... +def load_pem_x509_certificate(data: bytes, backend: Optional[X509Backend] = ...) -> Certificate: ... +def load_der_x509_crl(data: bytes, backend: Optional[X509Backend] = ...) -> CertificateRevocationList: ... +def load_pem_x509_crl(data: bytes, backend: Optional[X509Backend] = ...) -> CertificateRevocationList: ... +def load_der_x509_csr(data: bytes, backend: Optional[X509Backend] = ...) -> CertificateSigningRequest: ... +def load_pem_x509_csr(data: bytes, backend: Optional[X509Backend] = ...) -> CertificateSigningRequest: ... def __getattr__(name: str) -> Any: ... # incomplete diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/x509/extensions.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/x509/extensions.pyi new file mode 100644 index 00000000..a9b2ad08 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/x509/extensions.pyi @@ -0,0 +1,22 @@ +from typing import Any, Iterator + +from cryptography.x509 import GeneralName, ObjectIdentifier + +class Extension: + value: Any = ... + +class GeneralNames: + def __iter__(self) -> Iterator[GeneralName]: ... + +class DistributionPoint: + full_name: GeneralNames = ... + +class CRLDistributionPoints: + def __iter__(self) -> Iterator[DistributionPoint]: ... + +class AccessDescription: + access_method: ObjectIdentifier = ... + access_location: GeneralName = ... + +class AuthorityInformationAccess: + def __iter__(self) -> Iterator[AccessDescription]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/x509/oid.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/x509/oid.pyi new file mode 100644 index 00000000..5168feed --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/cryptography/x509/oid.pyi @@ -0,0 +1,106 @@ +from typing import Dict, Optional + +from cryptography.hazmat.primitives.hashes import HashAlgorithm +from cryptography.x509 import ObjectIdentifier + +class ExtensionOID: + SUBJECT_DIRECTORY_ATTRIBUTES: ObjectIdentifier = ... + SUBJECT_KEY_IDENTIFIER: ObjectIdentifier = ... + KEY_USAGE: ObjectIdentifier = ... + SUBJECT_ALTERNATIVE_NAME: ObjectIdentifier = ... + ISSUER_ALTERNATIVE_NAME: ObjectIdentifier = ... + BASIC_CONSTRAINTS: ObjectIdentifier = ... + NAME_CONSTRAINTS: ObjectIdentifier = ... + CRL_DISTRIBUTION_POINTS: ObjectIdentifier = ... + CERTIFICATE_POLICIES: ObjectIdentifier = ... + POLICY_MAPPINGS: ObjectIdentifier = ... + AUTHORITY_KEY_IDENTIFIER: ObjectIdentifier = ... + POLICY_CONSTRAINTS: ObjectIdentifier = ... + EXTENDED_KEY_USAGE: ObjectIdentifier = ... + FRESHEST_CRL: ObjectIdentifier = ... + INHIBIT_ANY_POLICY: ObjectIdentifier = ... + ISSUING_DISTRIBUTION_POINT: ObjectIdentifier = ... + AUTHORITY_INFORMATION_ACCESS: ObjectIdentifier = ... + SUBJECT_INFORMATION_ACCESS: ObjectIdentifier = ... + OCSP_NO_CHECK: ObjectIdentifier = ... + TLS_FEATURE: ObjectIdentifier = ... + CRL_NUMBER: ObjectIdentifier = ... + DELTA_CRL_INDICATOR: ObjectIdentifier = ... + PRECERT_SIGNED_CERTIFICATE_TIMESTAMPS: ObjectIdentifier = ... + PRECERT_POISON: ObjectIdentifier = ... + +class OCSPExtensionOID: + NONCE: ObjectIdentifier = ... + +class CRLEntryExtensionOID: + CERTIFICATE_ISSUER: ObjectIdentifier = ... + CRL_REASON: ObjectIdentifier = ... + INVALIDITY_DATE: ObjectIdentifier = ... + +class NameOID: + COMMON_NAME: ObjectIdentifier = ... + COUNTRY_NAME: ObjectIdentifier = ... + LOCALITY_NAME: ObjectIdentifier = ... + STATE_OR_PROVINCE_NAME: ObjectIdentifier = ... + STREET_ADDRESS: ObjectIdentifier = ... + ORGANIZATION_NAME: ObjectIdentifier = ... + ORGANIZATIONAL_UNIT_NAME: ObjectIdentifier = ... + SERIAL_NUMBER: ObjectIdentifier = ... + SURNAME: ObjectIdentifier = ... + GIVEN_NAME: ObjectIdentifier = ... + TITLE: ObjectIdentifier = ... + GENERATION_QUALIFIER: ObjectIdentifier = ... + X500_UNIQUE_IDENTIFIER: ObjectIdentifier = ... + DN_QUALIFIER: ObjectIdentifier = ... + PSEUDONYM: ObjectIdentifier = ... + USER_ID: ObjectIdentifier = ... + DOMAIN_COMPONENT: ObjectIdentifier = ... + EMAIL_ADDRESS: ObjectIdentifier = ... + JURISDICTION_COUNTRY_NAME: ObjectIdentifier = ... + JURISDICTION_LOCALITY_NAME: ObjectIdentifier = ... + JURISDICTION_STATE_OR_PROVINCE_NAME: ObjectIdentifier = ... + BUSINESS_CATEGORY: ObjectIdentifier = ... + POSTAL_ADDRESS: ObjectIdentifier = ... + POSTAL_CODE: ObjectIdentifier = ... + +class SignatureAlgorithmOID: + RSA_WITH_MD5: ObjectIdentifier = ... + RSA_WITH_SHA1: ObjectIdentifier = ... + _RSA_WITH_SHA1: ObjectIdentifier = ... + RSA_WITH_SHA224: ObjectIdentifier = ... + RSA_WITH_SHA256: ObjectIdentifier = ... + RSA_WITH_SHA384: ObjectIdentifier = ... + RSA_WITH_SHA512: ObjectIdentifier = ... + RSASSA_PSS: ObjectIdentifier = ... + ECDSA_WITH_SHA1: ObjectIdentifier = ... + ECDSA_WITH_SHA224: ObjectIdentifier = ... + ECDSA_WITH_SHA256: ObjectIdentifier = ... + ECDSA_WITH_SHA384: ObjectIdentifier = ... + ECDSA_WITH_SHA512: ObjectIdentifier = ... + DSA_WITH_SHA1: ObjectIdentifier = ... + DSA_WITH_SHA224: ObjectIdentifier = ... + DSA_WITH_SHA256: ObjectIdentifier = ... + ED25519: ObjectIdentifier = ... + ED448: ObjectIdentifier = ... + +class ExtendedKeyUsageOID: + SERVER_AUTH: ObjectIdentifier = ... + CLIENT_AUTH: ObjectIdentifier = ... + CODE_SIGNING: ObjectIdentifier = ... + EMAIL_PROTECTION: ObjectIdentifier = ... + TIME_STAMPING: ObjectIdentifier = ... + OCSP_SIGNING: ObjectIdentifier = ... + ANY_EXTENDED_KEY_USAGE: ObjectIdentifier = ... + +class AuthorityInformationAccessOID: + CA_ISSUERS: ObjectIdentifier = ... + OCSP: ObjectIdentifier = ... + +class CertificatePoliciesOID: + CPS_QUALIFIER: ObjectIdentifier = ... + CPS_USER_NOTICE: ObjectIdentifier = ... + ANY_POLICY: ObjectIdentifier = ... + +_OID_NAMES: Dict[ObjectIdentifier, str] = ... + +_SIG_OIDS_TO_HASH: Dict[ObjectIdentifier, Optional[HashAlgorithm]] = ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/dateparser.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/dateparser.pyi new file mode 100644 index 00000000..dcb053eb --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/dateparser.pyi @@ -0,0 +1,14 @@ +import datetime +from typing import Any, List, Mapping, Optional, Set, Tuple, Union + +__version__: str + +def parse( + date_string: str, + date_formats: Optional[Union[List[str], Tuple[str], Set[str]]] = ..., + languages: Optional[Union[List[str], Tuple[str], Set[str]]] = ..., + locales: Optional[Union[List[str], Tuple[str], Set[str]]] = ..., + region: Optional[str] = ..., + settings: Optional[Mapping[str, Any]] = ..., +) -> Optional[datetime.datetime]: ... +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/datetimerange/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/datetimerange/__init__.pyi new file mode 100644 index 00000000..4b9f1372 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/datetimerange/__init__.pyi @@ -0,0 +1,47 @@ +import datetime +from typing import Iterable, Optional, Union + +from dateutil.relativedelta import relativedelta + +class DateTimeRange(object): + NOT_A_TIME_STR: str + start_time_format: str + end_time_format: str + is_output_elapse: bool + separator: str + def __init__( + self, + start_datetime: Optional[Union[datetime.datetime, str]] = ..., + end_datetime: Optional[Union[datetime.datetime, str]] = ..., + start_time_format: str = ..., + end_time_format: str = ..., + ) -> None: ... + def __eq__(self, other) -> bool: ... + def __ne__(self, other) -> bool: ... + def __add__(self, other) -> DateTimeRange: ... + def __iadd__(self, other) -> DateTimeRange: ... + def __sub__(self, other) -> DateTimeRange: ... + def __isub__(self, other) -> DateTimeRange: ... + def __contains__(self, x) -> bool: ... + @property + def start_datetime(self) -> datetime.datetime: ... + @property + def end_datetime(self) -> datetime.datetime: ... + @property + def timedelta(self) -> datetime.timedelta: ... + def is_set(self) -> bool: ... + def validate_time_inversion(self) -> None: ... + def is_valid_timerange(self) -> bool: ... + def is_intersection(self, x) -> bool: ... + def get_start_time_str(self) -> str: ... + def get_end_time_str(self) -> str: ... + def get_timedelta_second(self) -> float: ... + def set_start_datetime(self, value: Optional[Union[datetime.datetime, str]], timezone: Optional[str] = ...) -> None: ... + def set_end_datetime(self, value: Optional[Union[datetime.datetime, str]], timezone: Optional[str] = ...) -> None: ... + def set_time_range( + self, start: Optional[Union[datetime.datetime, str]], end: Optional[Union[datetime.datetime, str]] + ) -> None: ... + def range(self, step: Union[datetime.timedelta, relativedelta]) -> Iterable[datetime.datetime]: ... + def intersection(self, x: DateTimeRange) -> DateTimeRange: ... + def encompass(self, x: DateTimeRange) -> DateTimeRange: ... + def truncate(self, percentage: float) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/dateutil/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/dateutil/__init__.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/dateutil/_common.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/dateutil/_common.pyi old mode 100755 new mode 100644 index 7f1b2395..0a6d8e00 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/dateutil/_common.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/dateutil/_common.pyi @@ -4,14 +4,9 @@ _T = TypeVar("_T") class weekday(object): def __init__(self, weekday: int, n: Optional[int] = ...) -> None: ... - def __call__(self: _T, n: int) -> _T: ... - def __eq__(self, other) -> bool: ... - def __repr__(self) -> str: ... - def __hash__(self) -> int: ... - weekday: int n: int diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/dateutil/easter.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/dateutil/easter.pyi new file mode 100644 index 00000000..33e366d4 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/dateutil/easter.pyi @@ -0,0 +1,8 @@ +from datetime import date +from typing_extensions import Literal + +EASTER_JULIAN: Literal[1] +EASTER_ORTHODOX: Literal[2] +EASTER_WESTERN: Literal[3] + +def easter(year: int, method: Literal[1, 2, 3] = ...) -> date: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/dateutil/parser.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/dateutil/parser.pyi old mode 100755 new mode 100644 index 045a7934..78c6965a --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/dateutil/parser.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/dateutil/parser.pyi @@ -1,9 +1,8 @@ -from typing import List, Tuple, Optional, Callable, Union, IO, Any, Dict, Mapping, Text from datetime import datetime, tzinfo +from typing import IO, Any, Dict, List, Mapping, Optional, Text, Tuple, Union _FileOrStr = Union[bytes, Text, IO[str], IO[Any]] - class parserinfo(object): JUMP: List[str] WEEKDAYS: List[Tuple[str, str]] @@ -13,7 +12,6 @@ class parserinfo(object): UTCZONE: List[str] PERTAIN: List[str] TZOFFSET: Dict[str, int] - def __init__(self, dayfirst: bool = ..., yearfirst: bool = ...) -> None: ... def jump(self, name: Text) -> bool: ... def weekday(self, name: Text) -> Optional[int]: ... @@ -28,15 +26,21 @@ class parserinfo(object): class parser(object): def __init__(self, info: Optional[parserinfo] = ...) -> None: ... - def parse(self, timestr: _FileOrStr, - default: Optional[datetime] = ..., - ignoretz: bool = ..., tzinfos: Optional[Mapping[Text, tzinfo]] = ..., - **kwargs: Any) -> datetime: ... + def parse( + self, + timestr: _FileOrStr, + default: Optional[datetime] = ..., + ignoretz: bool = ..., + tzinfos: Optional[Mapping[Text, tzinfo]] = ..., + **kwargs: Any, + ) -> datetime: ... def isoparse(dt_str: Union[str, bytes, IO[str], IO[bytes]]) -> datetime: ... DEFAULTPARSER: parser + def parse(timestr: _FileOrStr, parserinfo: Optional[parserinfo] = ..., **kwargs: Any) -> datetime: ... + class _tzparser: ... DEFAULTTZPARSER: _tzparser @@ -44,3 +48,4 @@ DEFAULTTZPARSER: _tzparser class InvalidDatetimeError(ValueError): ... class InvalidDateError(InvalidDatetimeError): ... class InvalidTimeError(InvalidDatetimeError): ... +class ParserError(ValueError): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/dateutil/relativedelta.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/dateutil/relativedelta.pyi old mode 100755 new mode 100644 index 40ee586f..a0de3e7f --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/dateutil/relativedelta.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/dateutil/relativedelta.pyi @@ -1,11 +1,10 @@ -from typing import overload, Any, List, Optional, SupportsFloat, TypeVar, Union from datetime import date, datetime, timedelta +from typing import Optional, SupportsFloat, TypeVar, Union, overload from ._common import weekday - -_SelfT = TypeVar('_SelfT', bound=relativedelta) -_DateT = TypeVar('_DateT', date, datetime) +_SelfT = TypeVar("_SelfT", bound=relativedelta) +_DateT = TypeVar("_DateT", date, datetime) # Work around attribute and type having the same name. _weekday = weekday @@ -17,7 +16,6 @@ FR: weekday SA: weekday SU: weekday - class relativedelta(object): years: int months: int @@ -35,22 +33,30 @@ class relativedelta(object): minute: Optional[int] second: Optional[int] microsecond: Optional[int] - def __init__(self, - dt1: Optional[date] = ..., - dt2: Optional[date] = ..., - years: Optional[int] = ..., months: Optional[int] = ..., - days: Optional[int] = ..., leapdays: Optional[int] = ..., - weeks: Optional[int] = ..., - hours: Optional[int] = ..., minutes: Optional[int] = ..., - seconds: Optional[int] = ..., microseconds: Optional[int] = ..., - year: Optional[int] = ..., month: Optional[int] = ..., - day: Optional[int] = ..., - weekday: Optional[Union[int, _weekday]] = ..., - yearday: Optional[int] = ..., - nlyearday: Optional[int] = ..., - hour: Optional[int] = ..., minute: Optional[int] = ..., - second: Optional[int] = ..., - microsecond: Optional[int] = ...) -> None: ... + def __init__( + self, + dt1: Optional[date] = ..., + dt2: Optional[date] = ..., + years: Optional[int] = ..., + months: Optional[int] = ..., + days: Optional[int] = ..., + leapdays: Optional[int] = ..., + weeks: Optional[int] = ..., + hours: Optional[int] = ..., + minutes: Optional[int] = ..., + seconds: Optional[int] = ..., + microseconds: Optional[int] = ..., + year: Optional[int] = ..., + month: Optional[int] = ..., + day: Optional[int] = ..., + weekday: Optional[Union[int, _weekday]] = ..., + yearday: Optional[int] = ..., + nlyearday: Optional[int] = ..., + hour: Optional[int] = ..., + minute: Optional[int] = ..., + second: Optional[int] = ..., + microsecond: Optional[int] = ..., + ) -> None: ... @property def weeks(self) -> int: ... @weeks.setter diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/dateutil/rrule.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/dateutil/rrule.pyi old mode 100755 new mode 100644 index a459abe3..a0b9af35 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/dateutil/rrule.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/dateutil/rrule.pyi @@ -1,6 +1,7 @@ -from ._common import weekday as weekdaybase -from typing import Any, Iterable, Optional, Union import datetime +from typing import Any, Iterable, Optional, Union + +from ._common import weekday as weekdaybase YEARLY: int MONTHLY: int @@ -10,8 +11,7 @@ HOURLY: int MINUTELY: int SECONDLY: int -class weekday(weekdaybase): - ... +class weekday(weekdaybase): ... MO: weekday TU: weekday @@ -33,24 +33,26 @@ class rrulebase: def between(self, after, before, inc: bool = ..., count: int = ...): ... class rrule(rrulebase): - def __init__(self, - freq, - dtstart: Optional[datetime.date] = ..., - interval: int = ..., - wkst: Optional[Union[weekday, int]] = ..., - count: Optional[int] = ..., - until: Optional[Union[datetime.date, int]] = ..., - bysetpos: Optional[Union[int, Iterable[int]]] = ..., - bymonth: Optional[Union[int, Iterable[int]]] = ..., - bymonthday: Optional[Union[int, Iterable[int]]] = ..., - byyearday: Optional[Union[int, Iterable[int]]] = ..., - byeaster: Optional[Union[int, Iterable[int]]] = ..., - byweekno: Optional[Union[int, Iterable[int]]] = ..., - byweekday: Optional[Union[int, weekday, Iterable[int], Iterable[weekday]]] = ..., - byhour: Optional[Union[int, Iterable[int]]] = ..., - byminute: Optional[Union[int, Iterable[int]]] = ..., - bysecond: Optional[Union[int, Iterable[int]]] = ..., - cache: bool = ...) -> None: ... + def __init__( + self, + freq, + dtstart: Optional[datetime.date] = ..., + interval: int = ..., + wkst: Optional[Union[weekday, int]] = ..., + count: Optional[int] = ..., + until: Optional[Union[datetime.date, int]] = ..., + bysetpos: Optional[Union[int, Iterable[int]]] = ..., + bymonth: Optional[Union[int, Iterable[int]]] = ..., + bymonthday: Optional[Union[int, Iterable[int]]] = ..., + byyearday: Optional[Union[int, Iterable[int]]] = ..., + byeaster: Optional[Union[int, Iterable[int]]] = ..., + byweekno: Optional[Union[int, Iterable[int]]] = ..., + byweekday: Optional[Union[int, weekday, Iterable[int], Iterable[weekday]]] = ..., + byhour: Optional[Union[int, Iterable[int]]] = ..., + byminute: Optional[Union[int, Iterable[int]]] = ..., + bysecond: Optional[Union[int, Iterable[int]]] = ..., + cache: bool = ..., + ) -> None: ... def replace(self, **kwargs): ... class _iterinfo: diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/dateutil/tz/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/dateutil/tz/__init__.pyi old mode 100755 new mode 100644 index 5a5e45fe..334ca482 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/dateutil/tz/__init__.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/dateutil/tz/__init__.pyi @@ -1,15 +1,15 @@ from .tz import ( - tzutc as tzutc, - tzoffset as tzoffset, - tzlocal as tzlocal, + datetime_ambiguous as datetime_ambiguous, + datetime_exists as datetime_exists, + gettz as gettz, + resolve_imaginary as resolve_imaginary, tzfile as tzfile, + tzical as tzical, + tzlocal as tzlocal, + tzoffset as tzoffset, tzrange as tzrange, tzstr as tzstr, - tzical as tzical, - gettz as gettz, - datetime_exists as datetime_exists, - datetime_ambiguous as datetime_ambiguous, - resolve_imaginary as resolve_imaginary, + tzutc as tzutc, ) UTC: tzutc diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/dateutil/tz/_common.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/dateutil/tz/_common.pyi old mode 100755 new mode 100644 index 32b06ed2..b185f0dc --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/dateutil/tz/_common.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/dateutil/tz/_common.pyi @@ -1,5 +1,5 @@ +from datetime import datetime, timedelta, tzinfo from typing import Any, Optional -from datetime import datetime, tzinfo, timedelta def tzname_in_python2(namefunc): ... def enfold(dt: datetime, fold: int = ...): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/dateutil/tz/tz.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/dateutil/tz/tz.pyi old mode 100755 new mode 100644 index 71395070..ee7e6a53 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/dateutil/tz/tz.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/dateutil/tz/tz.pyi @@ -1,8 +1,8 @@ -from typing import Any, Optional, Union, IO, Text, Tuple, List import datetime -from ._common import tzname_in_python2 as tzname_in_python2, _tzinfo as _tzinfo -from ._common import tzrangebase as tzrangebase, enfold as enfold +from typing import IO, Any, List, Optional, Text, Tuple, Union + from ..relativedelta import relativedelta +from ._common import _tzinfo as _tzinfo, enfold as enfold, tzname_in_python2 as tzname_in_python2, tzrangebase as tzrangebase _FileObj = Union[str, Text, IO[str], IO[Text]] @@ -30,7 +30,6 @@ class tzoffset(datetime.tzinfo): __hash__: Any def __ne__(self, other): ... __reduce__: Any - @classmethod def instance(cls, name, offset) -> tzoffset: ... @@ -65,14 +64,21 @@ class tzfile(_tzinfo): class tzrange(tzrangebase): hasdst: bool - def __init__(self, stdabbr: Text, stdoffset: Union[int, datetime.timedelta, None] = ..., dstabbr: Optional[Text] = ..., dstoffset: Union[int, datetime.timedelta, None] = ..., start: Optional[relativedelta] = ..., end: Optional[relativedelta] = ...) -> None: ... + def __init__( + self, + stdabbr: Text, + stdoffset: Union[int, datetime.timedelta, None] = ..., + dstabbr: Optional[Text] = ..., + dstoffset: Union[int, datetime.timedelta, None] = ..., + start: Optional[relativedelta] = ..., + end: Optional[relativedelta] = ..., + ) -> None: ... def transitions(self, year: int) -> Tuple[datetime.datetime, datetime.datetime]: ... def __eq__(self, other): ... class tzstr(tzrange): hasdst: bool def __init__(self, s: Union[bytes, _FileObj], posix_offset: bool = ...) -> None: ... - @classmethod def instance(cls, name, offset) -> tzoffset: ... @@ -88,7 +94,6 @@ def datetime_exists(dt: datetime.datetime, tz: Optional[datetime.tzinfo] = ...) def datetime_ambiguous(dt: datetime.datetime, tz: Optional[datetime.tzinfo] = ...) -> bool: ... def resolve_imaginary(dt: datetime.datetime) -> datetime.datetime: ... - class _GetTZ: def __call__(self, name: Optional[Text] = ...) -> Optional[datetime.tzinfo]: ... def nocache(self, name: Optional[Text]) -> Optional[datetime.tzinfo]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/dateutil/utils.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/dateutil/utils.pyi old mode 100755 new mode 100644 index b722053e..1eaa6668 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/dateutil/utils.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/dateutil/utils.pyi @@ -1,6 +1,5 @@ +from datetime import datetime, timedelta, tzinfo from typing import Optional -from datetime import datetime, tzinfo, timedelta - def default_tzinfo(dt: datetime, tzinfo: tzinfo) -> datetime: ... def today(tzinfo: Optional[tzinfo] = ...) -> datetime: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/decorator.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/decorator.pyi old mode 100755 new mode 100644 index adf5ebe7..0d6238e7 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/decorator.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/decorator.pyi @@ -8,8 +8,7 @@ _T = TypeVar("_T") def get_init(cls): ... if sys.version_info >= (3,): - from inspect import iscoroutinefunction as iscoroutinefunction - from inspect import getfullargspec as getfullargspec + from inspect import getfullargspec as getfullargspec, iscoroutinefunction as iscoroutinefunction else: class FullArgSpec(NamedTuple): args: List[str] @@ -51,15 +50,11 @@ class FunctionMaker(object): defaults: Optional[Tuple[Any, ...]] = ..., doc: Optional[Text] = ..., module: Optional[Text] = ..., - funcdict: Optional[Dict[Text, Any]] = ... + funcdict: Optional[Dict[Text, Any]] = ..., ) -> None: ... def update(self, func: Any, **kw: Any) -> None: ... def make( - self, - src_templ: Text, - evaldict: Optional[Dict[Text, Any]] = ..., - addsource: bool = ..., - **attrs: Any + self, src_templ: Text, evaldict: Optional[Dict[Text, Any]] = ..., addsource: bool = ..., **attrs: Any ) -> Callable[..., Any]: ... @classmethod def create( @@ -71,11 +66,13 @@ class FunctionMaker(object): doc: Optional[Text] = ..., module: Optional[Text] = ..., addsource: bool = ..., - **attrs: Any + **attrs: Any, ) -> Callable[..., Any]: ... def decorate(func: _Func, caller: Callable[..., Any], extras: Any = ...) -> _Func: ... -def decorator(caller: Callable[..., Any], _func: Optional[Callable[..., Any]] = ...) -> Callable[[Callable[..., Any]], Callable[..., Any]]: ... +def decorator( + caller: Callable[..., Any], _func: Optional[Callable[..., Any]] = ... +) -> Callable[[Callable[..., Any]], Callable[..., Any]]: ... class ContextManager(_GeneratorContextManager[_T]): def __call__(self, func: _C) -> _C: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/deprecated/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/deprecated/__init__.pyi new file mode 100644 index 00000000..25df2432 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/deprecated/__init__.pyi @@ -0,0 +1 @@ +from .classic import deprecated as deprecated diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/deprecated/classic.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/deprecated/classic.pyi new file mode 100644 index 00000000..5ee2352c --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/deprecated/classic.pyi @@ -0,0 +1,21 @@ +from typing import Any, Callable, Optional, Type, TypeVar, overload + +_F = TypeVar("_F", bound=Callable[..., Any]) + +class ClassicAdapter: + reason: str + version: str + action: Optional[str] + category: Type[DeprecationWarning] + def __init__( + self, reason: str = ..., version: str = ..., action: Optional[str] = ..., category: Type[DeprecationWarning] = ... + ) -> None: ... + def get_deprecated_msg(self, wrapped: Callable[..., Any], instance: object) -> str: ... + def __call__(self, wrapped: _F) -> Callable[[_F], _F]: ... + +@overload +def deprecated(__wrapped: _F) -> _F: ... +@overload +def deprecated( + reason: str = ..., *, version: str = ..., action: Optional[str] = ..., category: Optional[Type[DeprecationWarning]] = ... +) -> Callable[[_F], _F]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/deprecated/sphinx.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/deprecated/sphinx.pyi new file mode 100644 index 00000000..41b4a22f --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/deprecated/sphinx.pyi @@ -0,0 +1,31 @@ +from typing import Any, Callable, Optional, Type, TypeVar, overload +from typing_extensions import Literal + +from .classic import ClassicAdapter + +_F = TypeVar("_F", bound=Callable[..., Any]) + +class SphinxAdapter(ClassicAdapter): + directive: Literal["versionadded", "versionchanged", "deprecated"] + reason: str + version: str + action: Optional[str] + category: Type[DeprecationWarning] + def __init__( + self, + directive: Literal["versionadded", "versionchanged", "deprecated"], + reason: str = ..., + version: str = ..., + action: Optional[str] = ..., + category: Type[DeprecationWarning] = ..., + ) -> None: ... + def __call__(self, wrapped: _F) -> Callable[[_F], _F]: ... + +def versionadded(reason: str = ..., version: str = ...) -> Callable[[_F], _F]: ... +def versionchanged(reason: str = ..., version: str = ...) -> Callable[[_F], _F]: ... +@overload +def deprecated(__wrapped: _F) -> _F: ... +@overload +def deprecated( + reason: str = ..., *, version: str = ..., action: Optional[str] = ..., category: Optional[Type[DeprecationWarning]] = ... +) -> Callable[[_F], _F]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/emoji.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/emoji.pyi deleted file mode 100755 index 695018e5..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/emoji.pyi +++ /dev/null @@ -1,18 +0,0 @@ -from typing import Tuple, Pattern, List, Dict, Union, Text - -_DEFAULT_DELIMITER: str - -def emojize( - string: str, - use_aliases: bool = ..., - delimiters: Tuple[str, str] = ... -) -> str: ... - -def demojize( - string: str, - delimiters: Tuple[str, str] = ... -) -> str: ... - -def get_emoji_regexp() -> Pattern[Text]: ... - -def emoji_lis(string: str) -> List[Dict[str, Union[int, str]]]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/emoji/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/emoji/__init__.pyi new file mode 100644 index 00000000..054778ca --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/emoji/__init__.pyi @@ -0,0 +1,13 @@ +from .core import ( + demojize as demojize, + emoji_count as emoji_count, + emoji_lis as emoji_lis, + emojize as emojize, + get_emoji_regexp as get_emoji_regexp, +) +from .unicode_codes import ( + EMOJI_ALIAS_UNICODE as EMOJI_ALIAS_UNICODE, + EMOJI_UNICODE as EMOJI_UNICODE, + UNICODE_EMOJI as UNICODE_EMOJI, + UNICODE_EMOJI_ALIAS as UNICODE_EMOJI_ALIAS, +) diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/emoji/core.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/emoji/core.pyi new file mode 100644 index 00000000..3372d4c2 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/emoji/core.pyi @@ -0,0 +1,9 @@ +from typing import Dict, List, Optional, Pattern, Text, Tuple, Union + +_DEFAULT_DELIMITER: str + +def emojize(string: str, use_aliases: bool = ..., delimiters: Tuple[str, str] = ...) -> str: ... +def demojize(string: str, delimiters: Tuple[str, str] = ...) -> str: ... +def get_emoji_regexp() -> Pattern[Text]: ... +def emoji_lis(string: str) -> List[Dict[str, Union[int, str]]]: ... +def emoji_count(string: str) -> int: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/emoji/unicode_codes.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/emoji/unicode_codes.pyi new file mode 100644 index 00000000..ee1403cf --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/emoji/unicode_codes.pyi @@ -0,0 +1,6 @@ +from typing import Dict, Text + +EMOJI_ALIAS_UNICODE: Dict[Text, Text] +EMOJI_UNICODE: Dict[Text, Text] +UNICODE_EMOJI: Dict[Text, Text] +UNICODE_EMOJI_ALIAS: Dict[Text, Text] diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/first.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/first.pyi old mode 100755 new mode 100644 index f03f3a35..32f4736b --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/first.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/first.pyi @@ -1,8 +1,7 @@ -from typing import Any, Callable, Iterable, Optional, overload, TypeVar, Union - -_T = TypeVar('_T') -_S = TypeVar('_S') +from typing import Any, Callable, Iterable, Optional, TypeVar, Union, overload +_T = TypeVar("_T") +_S = TypeVar("_S") @overload def first(iterable: Iterable[_T]) -> Optional[_T]: ... @overload diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/__init__.pyi old mode 100755 new mode 100644 index caeac5e2..4e66d4d0 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/__init__.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/__init__.pyi @@ -1,45 +1,41 @@ -# Stubs for flask (Python 3.6) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. +from jinja2 import Markup as Markup, escape as escape +from werkzeug.exceptions import abort as abort +from werkzeug.utils import redirect as redirect from .app import Flask as Flask from .blueprints import Blueprint as Blueprint from .config import Config as Config -from .ctx import after_this_request as after_this_request -from .ctx import copy_current_request_context as copy_current_request_context -from .ctx import has_app_context as has_app_context -from .ctx import has_request_context as has_request_context -from .globals import current_app as current_app -from .globals import g as g -from .globals import request as request -from .globals import session as session -from .helpers import flash as flash -from .helpers import get_flashed_messages as get_flashed_messages -from .helpers import get_template_attribute as get_template_attribute -from .helpers import make_response as make_response -from .helpers import safe_join as safe_join -from .helpers import send_file as send_file -from .helpers import send_from_directory as send_from_directory -from .helpers import stream_with_context as stream_with_context -from .helpers import url_for as url_for +from .ctx import ( + after_this_request as after_this_request, + copy_current_request_context as copy_current_request_context, + has_app_context as has_app_context, + has_request_context as has_request_context, +) +from .globals import current_app as current_app, g as g, request as request, session as session +from .helpers import ( + flash as flash, + get_flashed_messages as get_flashed_messages, + get_template_attribute as get_template_attribute, + make_response as make_response, + safe_join as safe_join, + send_file as send_file, + send_from_directory as send_from_directory, + stream_with_context as stream_with_context, + url_for as url_for, +) from .json import jsonify as jsonify -from .signals import appcontext_popped as appcontext_popped -from .signals import appcontext_pushed as appcontext_pushed -from .signals import appcontext_tearing_down as appcontext_tearing_down -from .signals import before_render_template as before_render_template -from .signals import got_request_exception as got_request_exception -from .signals import message_flashed as message_flashed -from .signals import request_finished as request_finished -from .signals import request_started as request_started -from .signals import request_tearing_down as request_tearing_down -from .signals import signals_available as signals_available -from .signals import template_rendered as template_rendered -from .templating import render_template as render_template -from .templating import render_template_string as render_template_string -from .wrappers import Request as Request -from .wrappers import Response as Response - -from werkzeug.exceptions import abort as abort -from werkzeug.utils import redirect as redirect -from jinja2 import Markup as Markup -from jinja2 import escape as escape +from .signals import ( + appcontext_popped as appcontext_popped, + appcontext_pushed as appcontext_pushed, + appcontext_tearing_down as appcontext_tearing_down, + before_render_template as before_render_template, + got_request_exception as got_request_exception, + message_flashed as message_flashed, + request_finished as request_finished, + request_started as request_started, + request_tearing_down as request_tearing_down, + signals_available as signals_available, + template_rendered as template_rendered, +) +from .templating import render_template as render_template, render_template_string as render_template_string +from .wrappers import Request as Request, Response as Response diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/app.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/app.pyi old mode 100755 new mode 100644 index 654d41c1..30a47632 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/app.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/app.pyi @@ -1,41 +1,32 @@ -# Stubs for flask.app (Python 3.6) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from .blueprints import Blueprint -from .config import Config, ConfigAttribute -from .ctx import AppContext, RequestContext, _AppCtxGlobals -from .globals import _request_ctx_stack, g, request, session -from .helpers import _PackageBoundObject, find_package, get_debug_flag, get_env, get_flashed_messages, get_load_dotenv, locked_cached_property, url_for -from .logging import create_logger -from .sessions import SecureCookieSessionInterface -from .signals import appcontext_tearing_down, got_request_exception, request_finished, request_started, request_tearing_down -from .templating import DispatchingJinjaLoader, Environment -from .wrappers import Request, Response -from .testing import FlaskClient +from datetime import timedelta from types import TracebackType from typing import ( Any, + ByteString, Callable, ContextManager, Dict, + Iterable, List, + NoReturn, Optional, + Text, + Tuple, Type, TypeVar, Union, - Text, - Tuple, - NoReturn, - Iterable, - ByteString ) -from datetime import timedelta -def setupmethod(f: Any): ... +from .blueprints import Blueprint +from .config import Config +from .ctx import AppContext, RequestContext +from .helpers import _PackageBoundObject +from .testing import FlaskClient +from .wrappers import Response -_T = TypeVar('_T') +def setupmethod(f: Any): ... +_T = TypeVar("_T") _ExcInfo = Tuple[Optional[Type[BaseException]], Optional[BaseException], Optional[TracebackType]] _StartResponse = Callable[[str, List[Tuple[str, str]], Optional[_ExcInfo]], Callable[[bytes], Any]] @@ -44,19 +35,10 @@ _WSGICallable = Callable[[Dict[Text, Any], _StartResponse], Iterable[bytes]] _Status = Union[str, int] _Headers = Union[Dict[Any, Any], List[Tuple[Any, Any]]] _Body = Union[Text, ByteString, Dict[Text, Any], Response, _WSGICallable] -_ViewFuncReturnType = Union[ - _Body, - Tuple[_Body, _Status, _Headers], - Tuple[_Body, _Status], - Tuple[_Body, _Headers], -] - -_ViewFunc = Union[ - Callable[..., NoReturn], - Callable[..., _ViewFuncReturnType], -] -_VT = TypeVar('_VT', bound=_ViewFunc) +_ViewFuncReturnType = Union[_Body, Tuple[_Body, _Status, _Headers], Tuple[_Body, _Status], Tuple[_Body, _Headers]] +_ViewFunc = Union[Callable[..., NoReturn], Callable[..., _ViewFuncReturnType]] +_VT = TypeVar("_VT", bound=_ViewFunc) class Flask(_PackageBoundObject): request_class: type = ... @@ -80,7 +62,7 @@ class Flask(_PackageBoundObject): session_interface: Any = ... import_name: str = ... template_folder: str = ... - root_path: Optional[Union[str, Text]] = ... + root_path: Union[str, Text] = ... static_url_path: Any = ... static_folder: Optional[str] = ... instance_path: Union[str, Text] = ... @@ -102,7 +84,19 @@ class Flask(_PackageBoundObject): url_map: Any = ... subdomain_matching: Any = ... cli: Any = ... - def __init__(self, import_name: str, static_url_path: Optional[str] = ..., static_folder: Optional[str] = ..., static_host: Optional[str] = ..., host_matching: bool = ..., subdomain_matching: bool = ..., template_folder: str = ..., instance_path: Optional[str] = ..., instance_relative_config: bool = ..., root_path: Optional[str] = ...) -> None: ... + def __init__( + self, + import_name: str, + static_url_path: Optional[str] = ..., + static_folder: Optional[str] = ..., + static_host: Optional[str] = ..., + host_matching: bool = ..., + subdomain_matching: bool = ..., + template_folder: str = ..., + instance_path: Optional[str] = ..., + instance_relative_config: bool = ..., + root_path: Optional[str] = ..., + ) -> None: ... @property def name(self) -> str: ... @property @@ -126,7 +120,14 @@ class Flask(_PackageBoundObject): def make_shell_context(self): ... env: Optional[str] = ... debug: bool = ... - def run(self, host: Optional[str] = ..., port: Optional[Union[int, str]] = ..., debug: Optional[bool] = ..., load_dotenv: bool = ..., **options: Any) -> None: ... + def run( + self, + host: Optional[str] = ..., + port: Optional[Union[int, str]] = ..., + debug: Optional[bool] = ..., + load_dotenv: bool = ..., + **options: Any, + ) -> None: ... def test_client(self, use_cookies: bool = ..., **kwargs: Any) -> FlaskClient[Response]: ... def test_cli_runner(self, **kwargs: Any): ... def open_session(self, request: Any): ... @@ -134,10 +135,19 @@ class Flask(_PackageBoundObject): def make_null_session(self): ... def register_blueprint(self, blueprint: Blueprint, **options: Any) -> None: ... def iter_blueprints(self): ... - def add_url_rule(self, rule: str, endpoint: Optional[str] = ..., view_func: _ViewFunc = ..., provide_automatic_options: Optional[bool] = ..., **options: Any) -> None: ... + def add_url_rule( + self, + rule: str, + endpoint: Optional[str] = ..., + view_func: _ViewFunc = ..., + provide_automatic_options: Optional[bool] = ..., + **options: Any, + ) -> None: ... def route(self, rule: str, **options: Any) -> Callable[[_VT], _VT]: ... def endpoint(self, endpoint: str) -> Callable[[Callable[..., _T]], Callable[..., _T]]: ... - def errorhandler(self, code_or_exception: Union[int, Type[Exception]]) -> Callable[[Callable[..., _T]], Callable[..., _T]]: ... + def errorhandler( + self, code_or_exception: Union[int, Type[Exception]] + ) -> Callable[[Callable[..., _T]], Callable[..., _T]]: ... def register_error_handler(self, code_or_exception: Union[int, Type[Exception]], f: Callable[..., Any]) -> None: ... def template_filter(self, name: Optional[Any] = ...): ... def add_template_filter(self, f: Any, name: Optional[Any] = ...) -> None: ... @@ -174,12 +184,11 @@ class Flask(_PackageBoundObject): def process_response(self, response: Any): ... def do_teardown_request(self, exc: Any = ...) -> None: ... def do_teardown_appcontext(self, exc: Any = ...) -> None: ... - def app_context(self): ... + def app_context(self) -> AppContext: ... def request_context(self, environ: Any): ... def test_request_context(self, *args: Any, **kwargs: Any) -> ContextManager[RequestContext]: ... def wsgi_app(self, environ: Any, start_response: Any): ... def __call__(self, environ: Any, start_response: Any): ... - # These are not preset at runtime but we add them since monkeypatching this # class is quite common. def __setattr__(self, name: str, value: Any): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/blueprints.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/blueprints.pyi old mode 100755 new mode 100644 index d534ac8a..a003452b --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/blueprints.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/blueprints.pyi @@ -1,13 +1,12 @@ -# Stubs for flask.blueprints (Python 3.6) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. +from typing import Any, Callable, Optional, Type, TypeVar, Union -from .helpers import _PackageBoundObject from .app import _ViewFunc -from typing import Any, Callable, Optional, Type, TypeVar, Union +from .helpers import _PackageBoundObject + +_T = TypeVar("_T") +_VT = TypeVar("_VT", bound=_ViewFunc) -_T = TypeVar('_T') -_VT = TypeVar('_VT', bound=_ViewFunc) +class _Sentinel(object): ... class BlueprintSetupState: app: Any = ... @@ -34,7 +33,20 @@ class Blueprint(_PackageBoundObject): static_url_path: Optional[str] = ... deferred_functions: Any = ... url_values_defaults: Any = ... - def __init__(self, name: str, import_name: str, static_folder: Optional[str] = ..., static_url_path: Optional[str] = ..., template_folder: Optional[str] = ..., url_prefix: Optional[str] = ..., subdomain: Optional[str] = ..., url_defaults: Optional[Any] = ..., root_path: Optional[str] = ...) -> None: ... + cli_group: Union[Optional[str], _Sentinel] = ... + def __init__( + self, + name: str, + import_name: str, + static_folder: Optional[str] = ..., + static_url_path: Optional[str] = ..., + template_folder: Optional[str] = ..., + url_prefix: Optional[str] = ..., + subdomain: Optional[str] = ..., + url_defaults: Optional[Any] = ..., + root_path: Optional[str] = ..., + cli_group: Union[Optional[str], _Sentinel] = ..., + ) -> None: ... def record(self, func: Any) -> None: ... def record_once(self, func: Any): ... def make_setup_state(self, app: Any, options: Any, first_registration: bool = ...): ... @@ -62,5 +74,7 @@ class Blueprint(_PackageBoundObject): def url_defaults(self, f: Any): ... def app_url_value_preprocessor(self, f: Any): ... def app_url_defaults(self, f: Any): ... - def errorhandler(self, code_or_exception: Union[int, Type[Exception]]) -> Callable[[Callable[..., _T]], Callable[..., _T]]: ... + def errorhandler( + self, code_or_exception: Union[int, Type[Exception]] + ) -> Callable[[Callable[..., _T]], Callable[..., _T]]: ... def register_error_handler(self, code_or_exception: Union[int, Type[Exception]], f: Callable[..., Any]) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/cli.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/cli.pyi old mode 100755 new mode 100644 index 15d3243f..9083ebd5 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/cli.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/cli.pyi @@ -1,11 +1,6 @@ -# Stubs for flask.cli (Python 3.6) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. +from typing import Any, Optional import click -from .globals import current_app -from .helpers import get_debug_flag, get_env, get_load_dotenv -from typing import Any, Optional class NoAppException(click.UsageError): ... @@ -41,7 +36,14 @@ class AppGroup(click.Group): class FlaskGroup(AppGroup): create_app: Any = ... load_dotenv: Any = ... - def __init__(self, add_default_commands: bool = ..., create_app: Optional[Any] = ..., add_version_option: bool = ..., load_dotenv: bool = ..., **extra: Any) -> None: ... + def __init__( + self, + add_default_commands: bool = ..., + create_app: Optional[Any] = ..., + add_version_option: bool = ..., + load_dotenv: bool = ..., + **extra: Any, + ) -> None: ... def get_command(self, ctx: Any, name: Any): ... def list_commands(self, ctx: Any): ... def main(self, *args: Any, **kwargs: Any): ... @@ -55,7 +57,9 @@ class CertParamType(click.ParamType): def __init__(self) -> None: ... def convert(self, value: Any, param: Any, ctx: Any): ... -def run_command(info: Any, host: Any, port: Any, reload: Any, debugger: Any, eager_loading: Any, with_threads: Any, cert: Any) -> None: ... +def run_command( + info: Any, host: Any, port: Any, reload: Any, debugger: Any, eager_loading: Any, with_threads: Any, cert: Any +) -> None: ... def shell_command() -> None: ... def routes_command(sort: Any, all_methods: Any): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/config.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/config.pyi old mode 100755 new mode 100644 index 6b925e72..2b005422 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/config.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/config.pyi @@ -1,8 +1,4 @@ -# Stubs for flask.config (Python 3.6) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any, Optional, Dict +from typing import Any, Dict, Optional class ConfigAttribute: __name__: Any = ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/ctx.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/ctx.pyi old mode 100755 new mode 100644 index 09fdea3a..c3dd934a --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/ctx.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/ctx.pyi @@ -1,9 +1,3 @@ -# Stubs for flask.ctx (Python 3.6) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from .globals import _app_ctx_stack, _request_ctx_stack -from .signals import appcontext_popped, appcontext_pushed from typing import Any, Optional class _AppCtxGlobals: diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/debughelpers.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/debughelpers.pyi old mode 100755 new mode 100644 index 5a4cbea0..45255a95 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/debughelpers.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/debughelpers.pyi @@ -1,10 +1,3 @@ -# Stubs for flask.debughelpers (Python 3.6) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from .app import Flask -from .blueprints import Blueprint -from .globals import _request_ctx_stack from typing import Any class UnexpectedUnicodeError(AssertionError, UnicodeError): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/globals.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/globals.pyi old mode 100755 new mode 100644 index 8ce1caf1..c6043c72 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/globals.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/globals.pyi @@ -1,11 +1,9 @@ -# Stubs for flask.globals (Python 3.6) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. +from typing import Any + +from werkzeug.local import LocalStack from .app import Flask from .wrappers import Request -from typing import Any -from werkzeug.local import LocalStack class _FlaskLocalProxy(Flask): def _get_current_object(self) -> Flask: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/helpers.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/helpers.pyi old mode 100755 new mode 100644 index 726f8a03..928f8837 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/helpers.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/helpers.pyi @@ -1,23 +1,29 @@ -# Stubs for flask.helpers (Python 3.6) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from .globals import _app_ctx_stack, _request_ctx_stack, current_app, request, session -from .signals import message_flashed from typing import Any, Optional +from .cli import AppGroup +from .wrappers import Response + def get_env(): ... def get_debug_flag(): ... def get_load_dotenv(default: bool = ...): ... def stream_with_context(generator_or_function: Any): ... -def make_response(*args: Any): ... -def url_for(endpoint: Any, **values: Any): ... +def make_response(*args: Any) -> Response: ... +def url_for(endpoint: str, **values: Any) -> str: ... def get_template_attribute(template_name: Any, attribute: Any): ... def flash(message: Any, category: str = ...) -> None: ... def get_flashed_messages(with_categories: bool = ..., category_filter: Any = ...): ... -def send_file(filename_or_fp: Any, mimetype: Optional[Any] = ..., as_attachment: bool = ..., attachment_filename: Optional[Any] = ..., add_etags: bool = ..., cache_timeout: Optional[Any] = ..., conditional: bool = ..., last_modified: Optional[Any] = ...): ... +def send_file( + filename_or_fp: Any, + mimetype: Optional[Any] = ..., + as_attachment: bool = ..., + attachment_filename: Optional[Any] = ..., + add_etags: bool = ..., + cache_timeout: Optional[Any] = ..., + conditional: bool = ..., + last_modified: Optional[Any] = ..., +) -> Response: ... def safe_join(directory: Any, *pathnames: Any): ... -def send_from_directory(directory: Any, filename: Any, **options: Any): ... +def send_from_directory(directory: Any, filename: Any, **options: Any) -> Response: ... def get_root_path(import_name: Any): ... def find_package(import_name: Any): ... @@ -34,6 +40,7 @@ class _PackageBoundObject: import_name: Any = ... template_folder: Any = ... root_path: Any = ... + cli: AppGroup = ... def __init__(self, import_name: Any, template_folder: Optional[Any] = ..., root_path: Optional[Any] = ...) -> None: ... static_folder: Any = ... static_url_path: Any = ... @@ -41,7 +48,7 @@ class _PackageBoundObject: def has_static_folder(self): ... def jinja_loader(self): ... def get_send_file_max_age(self, filename: Any): ... - def send_static_file(self, filename: Any): ... + def send_static_file(self, filename: Any) -> Response: ... def open_resource(self, resource: Any, mode: str = ...): ... def total_seconds(td: Any): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/json/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/json/__init__.pyi old mode 100755 new mode 100644 index f2dea4d1..efdc8974 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/json/__init__.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/json/__init__.pyi @@ -1,6 +1,6 @@ -# Stubs for flask.json (Python 3.6) import json as _json from typing import Any + from jinja2 import Markup class JSONEncoder(_json.JSONEncoder): diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/json/tag.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/json/tag.pyi old mode 100755 new mode 100644 index b1648dc7..c4dcf283 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/json/tag.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/json/tag.pyi @@ -1,7 +1,3 @@ -# Stubs for flask.json.tag (Python 3.6) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - from typing import Any, Optional class JSONTag: diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/logging.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/logging.pyi old mode 100755 new mode 100644 index e43d51d8..75354ced --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/logging.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/logging.pyi @@ -1,8 +1,3 @@ -# Stubs for flask.logging (Python 3.6) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from .globals import request from typing import Any def wsgi_errors_stream(): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/sessions.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/sessions.pyi old mode 100755 new mode 100644 index aa6cb6ef..77c008b7 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/sessions.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/sessions.pyi @@ -1,9 +1,6 @@ -# Stubs for flask.sessions (Python 3.6) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - from abc import ABCMeta from typing import Any, MutableMapping, Optional + from werkzeug.datastructures import CallbackDict class SessionMixin(MutableMapping[str, Any], metaclass=ABCMeta): diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/signals.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/signals.pyi old mode 100755 new mode 100644 index 0aa7ac32..66238d0a --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/signals.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/signals.pyi @@ -1,7 +1,3 @@ -# Stubs for flask.signals (Python 3.6) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - from typing import Any, Optional signals_available: bool diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/templating.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/templating.pyi old mode 100755 new mode 100644 index 87d77152..3f7aaae4 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/templating.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/templating.pyi @@ -1,11 +1,6 @@ -# Stubs for flask.templating (Python 3.6) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. +from typing import Any, Iterable, Text, Union -from .globals import _app_ctx_stack, _request_ctx_stack -from .signals import before_render_template, template_rendered from jinja2 import BaseLoader, Environment as BaseEnvironment -from typing import Any, Text, Iterable, Union class Environment(BaseEnvironment): app: Any = ... @@ -17,8 +12,5 @@ class DispatchingJinjaLoader(BaseLoader): def get_source(self, environment: Any, template: Any): ... def list_templates(self): ... -def render_template( - template_name_or_list: Union[Text, Iterable[Text]], - **context: Any -) -> Text: ... +def render_template(template_name_or_list: Union[Text, Iterable[Text]], **context: Any) -> Text: ... def render_template_string(source: Text, **context: Any) -> Text: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/testing.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/testing.pyi old mode 100755 new mode 100644 index 45a0065b..c3a65241 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/testing.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/testing.pyi @@ -1,18 +1,13 @@ -# Stubs for flask.testing (Python 3.6) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. +from typing import IO, Any, Iterable, Mapping, Optional, Text, TypeVar, Union from click import BaseCommand from click.testing import CliRunner, Result -from typing import Any, IO, Iterable, Mapping, Optional, Text, TypeVar, Union -from werkzeug.test import Client - -def make_test_environ_builder(app: Any, path: str = ..., base_url: Optional[Any] = ..., subdomain: Optional[Any] = ..., url_scheme: Optional[Any] = ..., *args: Any, **kwargs: Any): ... +from werkzeug.test import Client, EnvironBuilder as WerkzeugEnvironBuilder # Response type for the client below. # By default _R is Tuple[Iterable[Any], Union[Text, int], werkzeug.datastructures.Headers], however # most commonly it is wrapped in a Reponse object. -_R = TypeVar('_R') +_R = TypeVar("_R") class FlaskClient(Client[_R]): preserve_context: bool = ... @@ -34,5 +29,28 @@ class FlaskCliRunner(CliRunner): catch_exceptions: bool = ..., color: bool = ..., **extra: Any, - ) -> Result: - ... + ) -> Result: ... + +class EnvironBuilder(WerkzeugEnvironBuilder): + app: Any + def __init__( + self, + app: Any, + path: str = ..., + base_url: Optional[Any] = ..., + subdomain: Optional[Any] = ..., + url_scheme: Optional[Any] = ..., + *args: Any, + **kwargs: Any, + ) -> None: ... + def json_dumps(self, obj: Any, **kwargs: Any) -> str: ... + +def make_test_environ_builder( + app: Any, + path: str = ..., + base_url: Optional[Any] = ..., + subdomain: Optional[Any] = ..., + url_scheme: Optional[Any] = ..., + *args: Any, + **kwargs: Any, +): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/views.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/views.pyi old mode 100755 new mode 100644 index a2637b3b..e6112637 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/views.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/views.pyi @@ -1,8 +1,3 @@ -# Stubs for flask.views (Python 3.6) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from .globals import request from typing import Any http_method_funcs: Any diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/wrappers.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/wrappers.pyi old mode 100755 new mode 100644 index df8869e0..590bea0b --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/wrappers.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/flask/wrappers.pyi @@ -1,8 +1,5 @@ -# Stubs for flask.wrappers (Python 3.6) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - from typing import Any, Dict, Optional + from werkzeug.exceptions import HTTPException from werkzeug.routing import Rule from werkzeug.wrappers import Request as RequestBase, Response as ResponseBase @@ -30,6 +27,6 @@ class Request(RequestBase, JSONMixin): def blueprint(self) -> Optional[str]: ... class Response(ResponseBase, JSONMixin): - default_mimetype: str = ... + default_mimetype: Optional[str] = ... @property def max_cookie_size(self) -> int: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/geoip2/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/geoip2/__init__.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/geoip2/database.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/geoip2/database.pyi old mode 100755 new mode 100644 index 7a899116..eec539d6 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/geoip2/database.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/geoip2/database.pyi @@ -1,15 +1,20 @@ from types import TracebackType from typing import Optional, Sequence, Text, Type +from geoip2.models import ASN, ISP, AnonymousIP, City, ConnectionType, Country, Domain, Enterprise from maxminddb.reader import Metadata -from geoip2.models import AnonymousIP, ASN, City, ConnectionType, Country, Domain, Enterprise, ISP _Locales = Optional[Sequence[Text]] class Reader: def __init__(self, filename: Text, locales: _Locales = ..., mode: int = ...) -> None: ... def __enter__(self) -> Reader: ... - def __exit__(self, exc_type: Optional[Type[BaseException]] = ..., exc_val: Optional[BaseException] = ..., exc_tb: Optional[TracebackType] = ...) -> None: ... + def __exit__( + self, + exc_type: Optional[Type[BaseException]] = ..., + exc_val: Optional[BaseException] = ..., + exc_tb: Optional[TracebackType] = ..., + ) -> None: ... def country(self, ip_address: Text) -> Country: ... def city(self, ip_address: Text) -> City: ... def anonymous_ip(self, ip_address: Text) -> AnonymousIP: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/geoip2/errors.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/geoip2/errors.pyi old mode 100755 new mode 100644 index d5b703c3..5e2997d3 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/geoip2/errors.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/geoip2/errors.pyi @@ -1,9 +1,7 @@ from typing import Optional, Text class GeoIP2Error(RuntimeError): ... - class AddressNotFoundError(GeoIP2Error): ... - class AuthenticationError(GeoIP2Error): ... class HTTPError(GeoIP2Error): @@ -12,7 +10,5 @@ class HTTPError(GeoIP2Error): def __init__(self, message: Text, http_status: Optional[int] = ..., uri: Optional[Text] = ...) -> None: ... class InvalidRequestError(GeoIP2Error): ... - class OutOfQueriesError(GeoIP2Error): ... - class PermissionRequiredError(GeoIP2Error): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/geoip2/mixins.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/geoip2/mixins.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/geoip2/models.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/geoip2/models.pyi old mode 100755 new mode 100644 index d9330ef8..96af74b8 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/geoip2/models.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/geoip2/models.pyi @@ -1,7 +1,6 @@ from typing import Any, Mapping, Optional, Sequence, Text from geoip2 import records - from geoip2.mixins import SimpleEquality _Locales = Optional[Sequence[Text]] @@ -25,9 +24,7 @@ class City(Country): def __init__(self, raw_response: _RawResponse, locales: _Locales = ...) -> None: ... class Insights(City): ... - class Enterprise(City): ... - class SimpleModel(SimpleEquality): ... class AnonymousIP(SimpleModel): diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/geoip2/records.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/geoip2/records.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2/gflags.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/gflags.pyi old mode 100755 new mode 100644 similarity index 71% rename from anaconda_lib/jedi/third_party/typeshed/third_party/2/gflags.pyi rename to anaconda_lib/jedi/third_party/typeshed/third_party/2and3/gflags.pyi index 88eb2578..a4c487d3 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2/gflags.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/gflags.pyi @@ -1,19 +1,19 @@ -from typing import Any, Callable, Dict, Iterable, IO, List, Optional, Sequence, Union from types import ModuleType +from typing import IO, Any, Callable, Dict, Iterable, List, Optional, Sequence, Text, Union class Error(Exception): ... + FlagsError = Error class DuplicateFlag(FlagsError): ... - class CantOpenFlagFileError(FlagsError): ... - class DuplicateFlagCannotPropagateNoneToSwig(DuplicateFlag): ... class DuplicateFlagError(DuplicateFlag): def __init__(self, flagname: str, flag_values: FlagValues, other_flag_values: FlagValues = ...) -> None: ... class IllegalFlagValueError(FlagsError): ... + IllegalFlagValue = IllegalFlagValueError class UnrecognizedFlag(FlagsError): ... @@ -22,11 +22,15 @@ class UnrecognizedFlagError(UnrecognizedFlag): def __init__(self, flagname: str, flagvalue: str = ...) -> None: ... def get_help_width() -> int: ... + GetHelpWidth = get_help_width -def CutCommonSpacePrefix(text) -> str: ... + def text_wrap(text: str, length: int = ..., indent: str = ..., firstline_indent: str = ..., tabs: str = ...) -> str: ... + TextWrap = text_wrap + def doc_to_help(doc: str) -> str: ... + DocToHelp = doc_to_help class FlagValues: @@ -53,7 +57,7 @@ class FlagValues: def __setitem__(self, name: str, flag: Flag) -> None: ... def __getitem__(self, name: str) -> Flag: ... def __getattr__(self, name: str) -> Any: ... - def __setattr__(self, name: str, value: Any): ... + def __setattr__(self, name: str, value: Any) -> None: ... def __delattr__(self, flag_name: str) -> None: ... def set_default(self, name: str, value: Any) -> None: ... SetDefault = set_default @@ -85,6 +89,8 @@ class FlagValues: WriteHelpInXMLFormat = write_help_in_xml_format # TODO validator: gflags_validators.Validator def AddValidator(self, validator: Any) -> None: ... + def is_parsed(self) -> bool: ... + IsParsed = is_parsed FLAGS: FlagValues @@ -100,10 +106,17 @@ class Flag: parser: ArgumentParser serializer: ArgumentSerializer allow_override = False - - def __init__(self, parser: ArgumentParser, serializer: ArgumentSerializer, name: str, - default: Optional[str], help_string: str, short_name: str = ..., boolean: bool = ..., - allow_override: bool = ...) -> None: ... + def __init__( + self, + parser: ArgumentParser, + serializer: ArgumentSerializer, + name: str, + default: Optional[str], + help_string: str, + short_name: str = ..., + boolean: bool = ..., + allow_override: bool = ..., + ) -> None: ... def Parse(self, argument: Any) -> Any: ... def Unparse(self) -> None: ... def Serialize(self) -> str: ... @@ -121,35 +134,56 @@ class ArgumentParser(object): def WriteCustomInfoInXMLFormat(self, outfile: IO[str], indent: str) -> None: ... class ArgumentSerializer: - def Serialize(self, value: Any) -> unicode: ... + def Serialize(self, value: Any) -> Text: ... class ListSerializer(ArgumentSerializer): def __init__(self, list_sep: str) -> None: ... def Serialize(self, value: List[Any]) -> str: ... -def register_validator(flag_name: str, - checker: Callable[[Any], bool], - message: str = ..., - flag_values: FlagValues = ...) -> None: ... +def register_validator( + flag_name: str, checker: Callable[[Any], bool], message: str = ..., flag_values: FlagValues = ... +) -> None: ... + RegisterValidator = register_validator + def mark_flag_as_required(flag_name: str, flag_values: FlagValues = ...) -> None: ... + MarkFlagAsRequired = mark_flag_as_required -def DEFINE(parser: ArgumentParser, name: str, default: Any, help: str, - flag_values: FlagValues = ..., serializer: ArgumentSerializer = ..., **args: Any) -> None: ... +def mark_flags_as_required(flag_names: Iterable[str], flag_values: FlagValues = ...) -> None: ... + +MarkFlagsAsRequired = mark_flags_as_required + +def mark_flags_as_mutual_exclusive(flag_names: Iterable[str], required: bool = ..., flag_values: FlagValues = ...) -> None: ... + +MarkFlagsAsMutualExclusive = mark_flags_as_mutual_exclusive + +def DEFINE( + parser: ArgumentParser, + name: str, + default: Any, + help: str, + flag_values: FlagValues = ..., + serializer: ArgumentSerializer = ..., + **args: Any, +) -> None: ... def DEFINE_flag(flag: Flag, flag_values: FlagValues = ...) -> None: ... def declare_key_flag(flag_name: str, flag_values: FlagValues = ...) -> None: ... + DECLARE_key_flag = declare_key_flag + def adopt_module_key_flags(module: ModuleType, flag_values: FlagValues = ...) -> None: ... + ADOPT_module_key_flags = adopt_module_key_flags -def DEFINE_string(name: str, default: Optional[str], help: str, flag_values: FlagValues = ..., **args: Any): ... + +def DEFINE_string(name: str, default: Optional[str], help: str, flag_values: FlagValues = ..., **args: Any) -> None: ... class BooleanParser(ArgumentParser): def Convert(self, argument: Any) -> bool: ... def Parse(self, argument: Any) -> bool: ... class BooleanFlag(Flag): - def __init__(self, name: str, default: Optional[bool], help: str, short_name=..., **args: Any) -> None: ... + def __init__(self, name: str, default: Optional[bool], help: str, short_name: str = ..., **args: Any) -> None: ... def DEFINE_boolean(name: str, default: Optional[bool], help: str, flag_values: FlagValues = ..., **args: Any) -> None: ... @@ -180,8 +214,15 @@ class FloatParser(NumericParser): def __init__(self, lower_bound: float = ..., upper_bound: float = ...) -> None: ... def Convert(self, argument: Any) -> float: ... -def DEFINE_float(name: str, default: Optional[float], help: str, lower_bound: float = ..., - upper_bound: float = ..., flag_values: FlagValues = ..., **args: Any) -> None: ... +def DEFINE_float( + name: str, + default: Optional[float], + help: str, + lower_bound: float = ..., + upper_bound: float = ..., + flag_values: FlagValues = ..., + **args: Any, +) -> None: ... class IntegerParser(NumericParser): number_article: str @@ -190,19 +231,28 @@ class IntegerParser(NumericParser): def __init__(self, lower_bound: int = ..., upper_bound: int = ...) -> None: ... def Convert(self, argument: Any) -> int: ... -def DEFINE_integer(name: str, default: Optional[int], help: str, lower_bound: int = ..., - upper_bound: int = ..., flag_values: FlagValues = ..., **args: Any) -> None: ... +def DEFINE_integer( + name: str, + default: Optional[int], + help: str, + lower_bound: int = ..., + upper_bound: int = ..., + flag_values: FlagValues = ..., + **args: Any, +) -> None: ... class EnumParser(ArgumentParser): def __init__(self, enum_values: List[str]) -> None: ... def Parse(self, argument: Any) -> Any: ... class EnumFlag(Flag): - def __init__(self, name: str, default: Optional[str], help: str, enum_values: List[str], - short_name: str, **args: Any) -> None: ... + def __init__( + self, name: str, default: Optional[str], help: str, enum_values: List[str], short_name: str, **args: Any + ) -> None: ... -def DEFINE_enum(name: str, default: Optional[str], enum_values: List[str], help: str, - flag_values: FlagValues = ..., **args: Any) -> None: ... +def DEFINE_enum( + name: str, default: Optional[str], enum_values: Iterable[str], help: str, flag_values: FlagValues = ..., **args: Any +) -> None: ... class BaseListParser(ArgumentParser): def __init__(self, token: str = ..., name: str = ...) -> None: ... @@ -210,33 +260,53 @@ class BaseListParser(ArgumentParser): class ListParser(BaseListParser): def __init__(self) -> None: ... - def WriteCustomInfoInXMLFormat(self, outfile: IO[str], indent: str): ... class WhitespaceSeparatedListParser(BaseListParser): def __init__(self) -> None: ... - def WriteCustomInfoInXMLFormat(self, outfile: IO[str], indent: str): ... def DEFINE_list(name: str, default: Optional[List[str]], help: str, flag_values: FlagValues = ..., **args: Any) -> None: ... -def DEFINE_spaceseplist(name: str, default: Optional[List[str]], help: str, flag_values: FlagValues = ..., - **args: Any) -> None: ... +def DEFINE_spaceseplist( + name: str, default: Optional[List[str]], help: str, flag_values: FlagValues = ..., **args: Any +) -> None: ... class MultiFlag(Flag): def __init__(self, *args: Any, **kwargs: Any) -> None: ... def Parse(self, arguments: Any) -> None: ... def Serialize(self) -> str: ... -def DEFINE_multi_string(name: str, default: Optional[Union[str, List[str]]], help: str, - flag_values: FlagValues = ..., **args: Any) -> None: ... +def DEFINE_multi_string( + name: str, default: Optional[Union[str, List[str]]], help: str, flag_values: FlagValues = ..., **args: Any +) -> None: ... + DEFINE_multistring = DEFINE_multi_string -def DEFINE_multi_integer(name: str, default: Optional[Union[int, List[int]]], help: str, lower_bound: int = ..., - upper_bound: int = ..., flag_values: FlagValues = ..., **args: Any) -> None: ... -DEFINE_multi_int = DEFINE_multi_integer +def DEFINE_multi_integer( + name: str, + default: Optional[Union[int, List[int]]], + help: str, + lower_bound: int = ..., + upper_bound: int = ..., + flag_values: FlagValues = ..., + **args: Any, +) -> None: ... -def DEFINE_multi_float(name: str, default: Optional[Union[float, List[float]]], help: str, - lower_bound: float = ..., upper_bound: float = ..., - flag_values: FlagValues = ..., **args: Any) -> None: ... +DEFINE_multi_int = DEFINE_multi_integer -def DEFINE_multi_enum(name: str, default: Optional[Union[Sequence[str], str]], - enum_values: Sequence[str], help: str, - flag_values: FlagValues = ..., case_sensitive: bool = ..., **args: Any): ... +def DEFINE_multi_float( + name: str, + default: Optional[Union[float, List[float]]], + help: str, + lower_bound: float = ..., + upper_bound: float = ..., + flag_values: FlagValues = ..., + **args: Any, +) -> None: ... +def DEFINE_multi_enum( + name: str, + default: Optional[Union[Sequence[str], str]], + enum_values: Sequence[str], + help: str, + flag_values: FlagValues = ..., + case_sensitive: bool = ..., + **args: Any, +) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/__init__.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/__init__.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/any_pb2.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/any_pb2.pyi old mode 100755 new mode 100644 index 4b868072..32f27cbe --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/any_pb2.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/any_pb2.pyi @@ -1,9 +1,47 @@ -from google.protobuf.message import Message -from google.protobuf.internal import well_known_types +""" +@generated by mypy-protobuf. Do not edit manually! +isort:skip_file +""" +from google.protobuf.descriptor import ( + Descriptor as google___protobuf___descriptor___Descriptor, + FileDescriptor as google___protobuf___descriptor___FileDescriptor, +) -from typing import Optional, Text +from google.protobuf.internal.well_known_types import ( + Any as google___protobuf___internal___well_known_types___Any, +) -class Any(Message, well_known_types.Any_): - type_url: Text - value: bytes - def __init__(self, type_url: Optional[Text] = ..., value: Optional[bytes] = ...) -> None: ... +from google.protobuf.message import ( + Message as google___protobuf___message___Message, +) + +from typing import ( + Optional as typing___Optional, + Text as typing___Text, +) + +from typing_extensions import ( + Literal as typing_extensions___Literal, +) + + +builtin___bool = bool +builtin___bytes = bytes +builtin___float = float +builtin___int = int + + +DESCRIPTOR: google___protobuf___descriptor___FileDescriptor = ... + +class Any(google___protobuf___message___Message, google___protobuf___internal___well_known_types___Any): + DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... + type_url: typing___Text = ... + value: builtin___bytes = ... + + def __init__(self, + *, + type_url : typing___Optional[typing___Text] = None, + value : typing___Optional[builtin___bytes] = None, + ) -> None: ... + def ClearField(self, field_name: typing_extensions___Literal[u"type_url",b"type_url",u"value",b"value"]) -> None: ... +type___Any = Any diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/any_test_pb2.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/any_test_pb2.pyi deleted file mode 100755 index 67985f5e..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/any_test_pb2.pyi +++ /dev/null @@ -1,14 +0,0 @@ -from google.protobuf.any_pb2 import Any -from google.protobuf.internal.containers import RepeatedCompositeFieldContainer -from google.protobuf.message import Message -from typing import Iterable, Optional - -class TestAny(Message): - int32_value: int - @property - def any_value(self) -> Any: ... - @property - def repeated_any_value(self) -> RepeatedCompositeFieldContainer[Any]: ... - def __init__( - self, int32_value: Optional[int] = ..., any_value: Optional[Any] = ..., repeated_any_value: Optional[Iterable[Any]] = ... - ) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/api_pb2.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/api_pb2.pyi old mode 100755 new mode 100644 index f1f76548..5bc4de79 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/api_pb2.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/api_pb2.pyi @@ -1,53 +1,114 @@ -from google.protobuf.internal.containers import RepeatedCompositeFieldContainer -from google.protobuf.message import Message -from google.protobuf.source_context_pb2 import SourceContext -from google.protobuf.type_pb2 import Option, Syntax -from typing import Iterable, Optional, Text - -class Api(Message): - name: Text - version: Text - syntax: Syntax +""" +@generated by mypy-protobuf. Do not edit manually! +isort:skip_file +""" +from google.protobuf.descriptor import ( + Descriptor as google___protobuf___descriptor___Descriptor, + FileDescriptor as google___protobuf___descriptor___FileDescriptor, +) + +from google.protobuf.internal.containers import ( + RepeatedCompositeFieldContainer as google___protobuf___internal___containers___RepeatedCompositeFieldContainer, +) + +from google.protobuf.message import ( + Message as google___protobuf___message___Message, +) + +from google.protobuf.source_context_pb2 import ( + SourceContext as google___protobuf___source_context_pb2___SourceContext, +) + +from google.protobuf.type_pb2 import ( + Option as google___protobuf___type_pb2___Option, + SyntaxValue as google___protobuf___type_pb2___SyntaxValue, +) + +from typing import ( + Iterable as typing___Iterable, + Optional as typing___Optional, + Text as typing___Text, +) + +from typing_extensions import ( + Literal as typing_extensions___Literal, +) + + +builtin___bool = bool +builtin___bytes = bytes +builtin___float = float +builtin___int = int + + +DESCRIPTOR: google___protobuf___descriptor___FileDescriptor = ... + +class Api(google___protobuf___message___Message): + DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... + name: typing___Text = ... + version: typing___Text = ... + syntax: google___protobuf___type_pb2___SyntaxValue = ... + @property - def methods(self) -> RepeatedCompositeFieldContainer[Method]: ... + def methods(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[type___Method]: ... + @property - def options(self) -> RepeatedCompositeFieldContainer[Option]: ... + def options(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[google___protobuf___type_pb2___Option]: ... + @property - def source_context(self) -> SourceContext: ... + def source_context(self) -> google___protobuf___source_context_pb2___SourceContext: ... + @property - def mixins(self) -> RepeatedCompositeFieldContainer[Mixin]: ... - def __init__( - self, - name: Optional[Text] = ..., - methods: Optional[Iterable[Method]] = ..., - options: Optional[Iterable[Option]] = ..., - version: Optional[Text] = ..., - source_context: Optional[SourceContext] = ..., - mixins: Optional[Iterable[Mixin]] = ..., - syntax: Optional[Syntax] = ..., - ) -> None: ... - -class Method(Message): - name: Text - request_type_url: Text - request_streaming: bool - response_type_url: Text - response_streaming: bool - syntax: Syntax + def mixins(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[type___Mixin]: ... + + def __init__(self, + *, + name : typing___Optional[typing___Text] = None, + methods : typing___Optional[typing___Iterable[type___Method]] = None, + options : typing___Optional[typing___Iterable[google___protobuf___type_pb2___Option]] = None, + version : typing___Optional[typing___Text] = None, + source_context : typing___Optional[google___protobuf___source_context_pb2___SourceContext] = None, + mixins : typing___Optional[typing___Iterable[type___Mixin]] = None, + syntax : typing___Optional[google___protobuf___type_pb2___SyntaxValue] = None, + ) -> None: ... + def HasField(self, field_name: typing_extensions___Literal[u"source_context",b"source_context"]) -> builtin___bool: ... + def ClearField(self, field_name: typing_extensions___Literal[u"methods",b"methods",u"mixins",b"mixins",u"name",b"name",u"options",b"options",u"source_context",b"source_context",u"syntax",b"syntax",u"version",b"version"]) -> None: ... +type___Api = Api + +class Method(google___protobuf___message___Message): + DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... + name: typing___Text = ... + request_type_url: typing___Text = ... + request_streaming: builtin___bool = ... + response_type_url: typing___Text = ... + response_streaming: builtin___bool = ... + syntax: google___protobuf___type_pb2___SyntaxValue = ... + @property - def options(self) -> RepeatedCompositeFieldContainer[Option]: ... - def __init__( - self, - name: Optional[Text] = ..., - request_type_url: Optional[Text] = ..., - request_streaming: Optional[bool] = ..., - response_type_url: Optional[Text] = ..., - response_streaming: Optional[bool] = ..., - options: Optional[Iterable[Option]] = ..., - syntax: Optional[Syntax] = ..., - ) -> None: ... - -class Mixin(Message): - name: Text - root: Text - def __init__(self, name: Optional[Text] = ..., root: Optional[Text] = ...) -> None: ... + def options(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[google___protobuf___type_pb2___Option]: ... + + def __init__(self, + *, + name : typing___Optional[typing___Text] = None, + request_type_url : typing___Optional[typing___Text] = None, + request_streaming : typing___Optional[builtin___bool] = None, + response_type_url : typing___Optional[typing___Text] = None, + response_streaming : typing___Optional[builtin___bool] = None, + options : typing___Optional[typing___Iterable[google___protobuf___type_pb2___Option]] = None, + syntax : typing___Optional[google___protobuf___type_pb2___SyntaxValue] = None, + ) -> None: ... + def ClearField(self, field_name: typing_extensions___Literal[u"name",b"name",u"options",b"options",u"request_streaming",b"request_streaming",u"request_type_url",b"request_type_url",u"response_streaming",b"response_streaming",u"response_type_url",b"response_type_url",u"syntax",b"syntax"]) -> None: ... +type___Method = Method + +class Mixin(google___protobuf___message___Message): + DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... + name: typing___Text = ... + root: typing___Text = ... + + def __init__(self, + *, + name : typing___Optional[typing___Text] = None, + root : typing___Optional[typing___Text] = None, + ) -> None: ... + def ClearField(self, field_name: typing_extensions___Literal[u"name",b"name",u"root",b"root"]) -> None: ... +type___Mixin = Mixin diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/compiler/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/compiler/__init__.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/compiler/plugin_pb2.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/compiler/plugin_pb2.pyi old mode 100755 new mode 100644 index 7ed1a665..5c75e8bd --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/compiler/plugin_pb2.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/compiler/plugin_pb2.pyi @@ -1,41 +1,136 @@ -from google.protobuf.descriptor_pb2 import FileDescriptorProto -from google.protobuf.internal.containers import RepeatedCompositeFieldContainer, RepeatedScalarFieldContainer -from google.protobuf.message import Message -from typing import Iterable, Optional, Text - -class Version(Message): - major: int - minor: int - patch: int - suffix: Text - def __init__( - self, major: Optional[int] = ..., minor: Optional[int] = ..., patch: Optional[int] = ..., suffix: Optional[Text] = ... - ) -> None: ... - -class CodeGeneratorRequest(Message): - file_to_generate: RepeatedScalarFieldContainer[Text] - parameter: Text +""" +@generated by mypy-protobuf. Do not edit manually! +isort:skip_file +""" +from google.protobuf.descriptor import ( + Descriptor as google___protobuf___descriptor___Descriptor, + EnumDescriptor as google___protobuf___descriptor___EnumDescriptor, + FileDescriptor as google___protobuf___descriptor___FileDescriptor, +) + +from google.protobuf.descriptor_pb2 import ( + FileDescriptorProto as google___protobuf___descriptor_pb2___FileDescriptorProto, + GeneratedCodeInfo as google___protobuf___descriptor_pb2___GeneratedCodeInfo, +) + +from google.protobuf.internal.containers import ( + RepeatedCompositeFieldContainer as google___protobuf___internal___containers___RepeatedCompositeFieldContainer, + RepeatedScalarFieldContainer as google___protobuf___internal___containers___RepeatedScalarFieldContainer, +) + +from google.protobuf.internal.enum_type_wrapper import ( + _EnumTypeWrapper as google___protobuf___internal___enum_type_wrapper____EnumTypeWrapper, +) + +from google.protobuf.message import ( + Message as google___protobuf___message___Message, +) + +from typing import ( + Iterable as typing___Iterable, + NewType as typing___NewType, + Optional as typing___Optional, + Text as typing___Text, + cast as typing___cast, +) + +from typing_extensions import ( + Literal as typing_extensions___Literal, +) + + +builtin___bool = bool +builtin___bytes = bytes +builtin___float = float +builtin___int = int + + +DESCRIPTOR: google___protobuf___descriptor___FileDescriptor = ... + +class Version(google___protobuf___message___Message): + DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... + major: builtin___int = ... + minor: builtin___int = ... + patch: builtin___int = ... + suffix: typing___Text = ... + + def __init__(self, + *, + major : typing___Optional[builtin___int] = None, + minor : typing___Optional[builtin___int] = None, + patch : typing___Optional[builtin___int] = None, + suffix : typing___Optional[typing___Text] = None, + ) -> None: ... + def HasField(self, field_name: typing_extensions___Literal[u"major",b"major",u"minor",b"minor",u"patch",b"patch",u"suffix",b"suffix"]) -> builtin___bool: ... + def ClearField(self, field_name: typing_extensions___Literal[u"major",b"major",u"minor",b"minor",u"patch",b"patch",u"suffix",b"suffix"]) -> None: ... +type___Version = Version + +class CodeGeneratorRequest(google___protobuf___message___Message): + DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... + file_to_generate: google___protobuf___internal___containers___RepeatedScalarFieldContainer[typing___Text] = ... + parameter: typing___Text = ... + @property - def proto_file(self) -> RepeatedCompositeFieldContainer[FileDescriptorProto]: ... + def proto_file(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[google___protobuf___descriptor_pb2___FileDescriptorProto]: ... + @property - def compiler_version(self) -> Version: ... - def __init__( - self, - file_to_generate: Optional[Iterable[Text]] = ..., - parameter: Optional[Text] = ..., - proto_file: Optional[Iterable[FileDescriptorProto]] = ..., - compiler_version: Optional[Version] = ..., - ) -> None: ... - -class CodeGeneratorResponse(Message): - class File(Message): - name: Text - insertion_point: Text - content: Text - def __init__( - self, name: Optional[Text] = ..., insertion_point: Optional[Text] = ..., content: Optional[Text] = ... + def compiler_version(self) -> type___Version: ... + + def __init__(self, + *, + file_to_generate : typing___Optional[typing___Iterable[typing___Text]] = None, + parameter : typing___Optional[typing___Text] = None, + proto_file : typing___Optional[typing___Iterable[google___protobuf___descriptor_pb2___FileDescriptorProto]] = None, + compiler_version : typing___Optional[type___Version] = None, ) -> None: ... - error: Text + def HasField(self, field_name: typing_extensions___Literal[u"compiler_version",b"compiler_version",u"parameter",b"parameter"]) -> builtin___bool: ... + def ClearField(self, field_name: typing_extensions___Literal[u"compiler_version",b"compiler_version",u"file_to_generate",b"file_to_generate",u"parameter",b"parameter",u"proto_file",b"proto_file"]) -> None: ... +type___CodeGeneratorRequest = CodeGeneratorRequest + +class CodeGeneratorResponse(google___protobuf___message___Message): + DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... + FeatureValue = typing___NewType('FeatureValue', builtin___int) + type___FeatureValue = FeatureValue + Feature: _Feature + class _Feature(google___protobuf___internal___enum_type_wrapper____EnumTypeWrapper[CodeGeneratorResponse.FeatureValue]): + DESCRIPTOR: google___protobuf___descriptor___EnumDescriptor = ... + FEATURE_NONE = typing___cast(CodeGeneratorResponse.FeatureValue, 0) + FEATURE_PROTO3_OPTIONAL = typing___cast(CodeGeneratorResponse.FeatureValue, 1) + FEATURE_NONE = typing___cast(CodeGeneratorResponse.FeatureValue, 0) + FEATURE_PROTO3_OPTIONAL = typing___cast(CodeGeneratorResponse.FeatureValue, 1) + + class File(google___protobuf___message___Message): + DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... + name: typing___Text = ... + insertion_point: typing___Text = ... + content: typing___Text = ... + + @property + def generated_code_info(self) -> google___protobuf___descriptor_pb2___GeneratedCodeInfo: ... + + def __init__(self, + *, + name : typing___Optional[typing___Text] = None, + insertion_point : typing___Optional[typing___Text] = None, + content : typing___Optional[typing___Text] = None, + generated_code_info : typing___Optional[google___protobuf___descriptor_pb2___GeneratedCodeInfo] = None, + ) -> None: ... + def HasField(self, field_name: typing_extensions___Literal[u"content",b"content",u"generated_code_info",b"generated_code_info",u"insertion_point",b"insertion_point",u"name",b"name"]) -> builtin___bool: ... + def ClearField(self, field_name: typing_extensions___Literal[u"content",b"content",u"generated_code_info",b"generated_code_info",u"insertion_point",b"insertion_point",u"name",b"name"]) -> None: ... + type___File = File + + error: typing___Text = ... + supported_features: builtin___int = ... + @property - def file(self) -> RepeatedCompositeFieldContainer[CodeGeneratorResponse.File]: ... - def __init__(self, error: Optional[Text] = ..., file: Optional[Iterable[CodeGeneratorResponse.File]] = ...) -> None: ... + def file(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[type___CodeGeneratorResponse.File]: ... + + def __init__(self, + *, + error : typing___Optional[typing___Text] = None, + supported_features : typing___Optional[builtin___int] = None, + file : typing___Optional[typing___Iterable[type___CodeGeneratorResponse.File]] = None, + ) -> None: ... + def HasField(self, field_name: typing_extensions___Literal[u"error",b"error",u"supported_features",b"supported_features"]) -> builtin___bool: ... + def ClearField(self, field_name: typing_extensions___Literal[u"error",b"error",u"file",b"file",u"supported_features",b"supported_features"]) -> None: ... +type___CodeGeneratorResponse = CodeGeneratorResponse diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/descriptor.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/descriptor.pyi old mode 100755 new mode 100644 index 39d08aba..94fabb6f --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/descriptor.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/descriptor.pyi @@ -1,6 +1,5 @@ from typing import Any -from .message import Message from .descriptor_pb2 import ( EnumOptions, EnumValueOptions, @@ -11,6 +10,7 @@ from .descriptor_pb2 import ( OneofOptions, ServiceOptions, ) +from .message import Message class Error(Exception): ... class TypeTransformationError(Error): ... @@ -20,7 +20,7 @@ class DescriptorMetaclass(type): class DescriptorBase(metaclass=DescriptorMetaclass): has_options: Any - def __init__(self, options, options_class_name) -> None: ... + def __init__(self, options, serialized_options, options_class_name) -> None: ... def GetOptions(self): ... class _NestedDescriptorBase(DescriptorBase): @@ -29,7 +29,16 @@ class _NestedDescriptorBase(DescriptorBase): file: Any containing_type: Any def __init__( - self, options, options_class_name, name, full_name, file, containing_type, serialized_start=..., serialized_end=... + self, + options, + options_class_name, + name, + full_name, + file, + containing_type, + serialized_start=..., + serialized_end=..., + serialized_options=..., ) -> None: ... def GetTopLevelContainingType(self): ... def CopyToProto(self, proto): ... @@ -46,6 +55,7 @@ class Descriptor(_NestedDescriptorBase): enum_types, extensions, options=..., + serialized_options=..., is_extendable=..., extension_ranges=..., oneofs=..., @@ -80,6 +90,7 @@ class Descriptor(_NestedDescriptorBase): enum_types, extensions, options=..., + serialized_options=..., is_extendable=..., extension_ranges=..., oneofs=..., @@ -146,6 +157,7 @@ class FieldDescriptor(DescriptorBase): is_extension, extension_scope, options=..., + serialized_options=..., file=..., has_default_value=..., containing_oneof=..., @@ -181,6 +193,7 @@ class FieldDescriptor(DescriptorBase): is_extension, extension_scope, options=..., + serialized_options=..., file=..., has_default_value=..., containing_oneof=..., @@ -198,6 +211,7 @@ class EnumDescriptor(_NestedDescriptorBase): values, containing_type=..., options=..., + serialized_options=..., file=..., serialized_start=..., serialized_end=..., @@ -213,6 +227,7 @@ class EnumDescriptor(_NestedDescriptorBase): values, containing_type=..., options=..., + serialized_options=..., file=..., serialized_start=..., serialized_end=..., @@ -221,12 +236,12 @@ class EnumDescriptor(_NestedDescriptorBase): def GetOptions(self) -> EnumOptions: ... class EnumValueDescriptor(DescriptorBase): - def __new__(cls, name, index, number, type=..., options=...): ... + def __new__(cls, name, index, number, type=..., options=..., serialized_options=...): ... name: Any index: Any number: Any type: Any - def __init__(self, name, index, number, type=..., options=...) -> None: ... + def __init__(self, name, index, number, type=..., options=..., serialized_options=...) -> None: ... def GetOptions(self) -> EnumValueOptions: ... class OneofDescriptor: @@ -244,7 +259,16 @@ class ServiceDescriptor(_NestedDescriptorBase): methods: Any methods_by_name: Any def __init__( - self, name, full_name, index, methods, options=..., file=..., serialized_start=..., serialized_end=... + self, + name, + full_name, + index, + methods, + options=..., + serialized_options=..., + file=..., + serialized_start=..., + serialized_end=..., ) -> None: ... def FindMethodByName(self, name): ... def CopyToProto(self, proto): ... @@ -257,12 +281,23 @@ class MethodDescriptor(DescriptorBase): containing_service: Any input_type: Any output_type: Any - def __init__(self, name, full_name, index, containing_service, input_type, output_type, options=...) -> None: ... + def __init__( + self, name, full_name, index, containing_service, input_type, output_type, options=..., serialized_options=... + ) -> None: ... def GetOptions(self) -> MethodOptions: ... class FileDescriptor(DescriptorBase): def __new__( - cls, name, package, options=..., serialized_pb=..., dependencies=..., public_dependencies=..., syntax=..., pool=... + cls, + name, + package, + options=..., + serialized_options=..., + serialized_pb=..., + dependencies=..., + public_dependencies=..., + syntax=..., + pool=..., ): ... _options: Any pool: Any @@ -277,7 +312,16 @@ class FileDescriptor(DescriptorBase): dependencies: Any public_dependencies: Any def __init__( - self, name, package, options=..., serialized_pb=..., dependencies=..., public_dependencies=..., syntax=..., pool=... + self, + name, + package, + options=..., + serialized_options=..., + serialized_pb=..., + dependencies=..., + public_dependencies=..., + syntax=..., + pool=..., ) -> None: ... def CopyToProto(self, proto): ... def GetOptions(self) -> FileOptions: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/descriptor_pb2.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/descriptor_pb2.pyi old mode 100755 new mode 100644 index 4588c1bc..67b3ad55 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/descriptor_pb2.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/descriptor_pb2.pyi @@ -1,471 +1,734 @@ -from google.protobuf.internal.containers import RepeatedCompositeFieldContainer, RepeatedScalarFieldContainer -from google.protobuf.message import Message -from typing import Iterable, List, Optional, Text, Tuple, cast - -class FileDescriptorSet(Message): - @property - def file(self) -> RepeatedCompositeFieldContainer[FileDescriptorProto]: ... - def __init__(self, file: Optional[Iterable[FileDescriptorProto]] = ...) -> None: ... - -class FileDescriptorProto(Message): - name: Text - package: Text - dependency: RepeatedScalarFieldContainer[Text] - public_dependency: RepeatedScalarFieldContainer[int] - weak_dependency: RepeatedScalarFieldContainer[int] - syntax: Text - @property - def message_type(self) -> RepeatedCompositeFieldContainer[DescriptorProto]: ... - @property - def enum_type(self) -> RepeatedCompositeFieldContainer[EnumDescriptorProto]: ... - @property - def service(self) -> RepeatedCompositeFieldContainer[ServiceDescriptorProto]: ... - @property - def extension(self) -> RepeatedCompositeFieldContainer[FieldDescriptorProto]: ... - @property - def options(self) -> FileOptions: ... - @property - def source_code_info(self) -> SourceCodeInfo: ... - def __init__( - self, - name: Optional[Text] = ..., - package: Optional[Text] = ..., - dependency: Optional[Iterable[Text]] = ..., - public_dependency: Optional[Iterable[int]] = ..., - weak_dependency: Optional[Iterable[int]] = ..., - message_type: Optional[Iterable[DescriptorProto]] = ..., - enum_type: Optional[Iterable[EnumDescriptorProto]] = ..., - service: Optional[Iterable[ServiceDescriptorProto]] = ..., - extension: Optional[Iterable[FieldDescriptorProto]] = ..., - options: Optional[FileOptions] = ..., - source_code_info: Optional[SourceCodeInfo] = ..., - syntax: Optional[Text] = ..., - ) -> None: ... - -class DescriptorProto(Message): - class ExtensionRange(Message): - start: int - end: int +""" +@generated by mypy-protobuf. Do not edit manually! +isort:skip_file +""" +from google.protobuf.descriptor import ( + Descriptor as google___protobuf___descriptor___Descriptor, + EnumDescriptor as google___protobuf___descriptor___EnumDescriptor, + FileDescriptor as google___protobuf___descriptor___FileDescriptor, +) + +from google.protobuf.internal.containers import ( + RepeatedCompositeFieldContainer as google___protobuf___internal___containers___RepeatedCompositeFieldContainer, + RepeatedScalarFieldContainer as google___protobuf___internal___containers___RepeatedScalarFieldContainer, +) + +from google.protobuf.internal.enum_type_wrapper import ( + _EnumTypeWrapper as google___protobuf___internal___enum_type_wrapper____EnumTypeWrapper, +) + +from google.protobuf.message import ( + Message as google___protobuf___message___Message, +) + +from typing import ( + Iterable as typing___Iterable, + NewType as typing___NewType, + Optional as typing___Optional, + Text as typing___Text, + cast as typing___cast, +) + +from typing_extensions import ( + Literal as typing_extensions___Literal, +) + + +builtin___bool = bool +builtin___bytes = bytes +builtin___float = float +builtin___int = int + + +DESCRIPTOR: google___protobuf___descriptor___FileDescriptor = ... + +class FileDescriptorSet(google___protobuf___message___Message): + DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... + + @property + def file(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[type___FileDescriptorProto]: ... + + def __init__(self, + *, + file : typing___Optional[typing___Iterable[type___FileDescriptorProto]] = None, + ) -> None: ... + def ClearField(self, field_name: typing_extensions___Literal[u"file",b"file"]) -> None: ... +type___FileDescriptorSet = FileDescriptorSet + +class FileDescriptorProto(google___protobuf___message___Message): + DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... + name: typing___Text = ... + package: typing___Text = ... + dependency: google___protobuf___internal___containers___RepeatedScalarFieldContainer[typing___Text] = ... + public_dependency: google___protobuf___internal___containers___RepeatedScalarFieldContainer[builtin___int] = ... + weak_dependency: google___protobuf___internal___containers___RepeatedScalarFieldContainer[builtin___int] = ... + syntax: typing___Text = ... + + @property + def message_type(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[type___DescriptorProto]: ... + + @property + def enum_type(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[type___EnumDescriptorProto]: ... + + @property + def service(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[type___ServiceDescriptorProto]: ... + + @property + def extension(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[type___FieldDescriptorProto]: ... + + @property + def options(self) -> type___FileOptions: ... + + @property + def source_code_info(self) -> type___SourceCodeInfo: ... + + def __init__(self, + *, + name : typing___Optional[typing___Text] = None, + package : typing___Optional[typing___Text] = None, + dependency : typing___Optional[typing___Iterable[typing___Text]] = None, + public_dependency : typing___Optional[typing___Iterable[builtin___int]] = None, + weak_dependency : typing___Optional[typing___Iterable[builtin___int]] = None, + message_type : typing___Optional[typing___Iterable[type___DescriptorProto]] = None, + enum_type : typing___Optional[typing___Iterable[type___EnumDescriptorProto]] = None, + service : typing___Optional[typing___Iterable[type___ServiceDescriptorProto]] = None, + extension : typing___Optional[typing___Iterable[type___FieldDescriptorProto]] = None, + options : typing___Optional[type___FileOptions] = None, + source_code_info : typing___Optional[type___SourceCodeInfo] = None, + syntax : typing___Optional[typing___Text] = None, + ) -> None: ... + def HasField(self, field_name: typing_extensions___Literal[u"name",b"name",u"options",b"options",u"package",b"package",u"source_code_info",b"source_code_info",u"syntax",b"syntax"]) -> builtin___bool: ... + def ClearField(self, field_name: typing_extensions___Literal[u"dependency",b"dependency",u"enum_type",b"enum_type",u"extension",b"extension",u"message_type",b"message_type",u"name",b"name",u"options",b"options",u"package",b"package",u"public_dependency",b"public_dependency",u"service",b"service",u"source_code_info",b"source_code_info",u"syntax",b"syntax",u"weak_dependency",b"weak_dependency"]) -> None: ... +type___FileDescriptorProto = FileDescriptorProto + +class DescriptorProto(google___protobuf___message___Message): + DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... + class ExtensionRange(google___protobuf___message___Message): + DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... + start: builtin___int = ... + end: builtin___int = ... + @property - def options(self) -> ExtensionRangeOptions: ... - def __init__( - self, start: Optional[int] = ..., end: Optional[int] = ..., options: Optional[ExtensionRangeOptions] = ... + def options(self) -> type___ExtensionRangeOptions: ... + + def __init__(self, + *, + start : typing___Optional[builtin___int] = None, + end : typing___Optional[builtin___int] = None, + options : typing___Optional[type___ExtensionRangeOptions] = None, + ) -> None: ... + def HasField(self, field_name: typing_extensions___Literal[u"end",b"end",u"options",b"options",u"start",b"start"]) -> builtin___bool: ... + def ClearField(self, field_name: typing_extensions___Literal[u"end",b"end",u"options",b"options",u"start",b"start"]) -> None: ... + type___ExtensionRange = ExtensionRange + + class ReservedRange(google___protobuf___message___Message): + DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... + start: builtin___int = ... + end: builtin___int = ... + + def __init__(self, + *, + start : typing___Optional[builtin___int] = None, + end : typing___Optional[builtin___int] = None, + ) -> None: ... + def HasField(self, field_name: typing_extensions___Literal[u"end",b"end",u"start",b"start"]) -> builtin___bool: ... + def ClearField(self, field_name: typing_extensions___Literal[u"end",b"end",u"start",b"start"]) -> None: ... + type___ReservedRange = ReservedRange + + name: typing___Text = ... + reserved_name: google___protobuf___internal___containers___RepeatedScalarFieldContainer[typing___Text] = ... + + @property + def field(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[type___FieldDescriptorProto]: ... + + @property + def extension(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[type___FieldDescriptorProto]: ... + + @property + def nested_type(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[type___DescriptorProto]: ... + + @property + def enum_type(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[type___EnumDescriptorProto]: ... + + @property + def extension_range(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[type___DescriptorProto.ExtensionRange]: ... + + @property + def oneof_decl(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[type___OneofDescriptorProto]: ... + + @property + def options(self) -> type___MessageOptions: ... + + @property + def reserved_range(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[type___DescriptorProto.ReservedRange]: ... + + def __init__(self, + *, + name : typing___Optional[typing___Text] = None, + field : typing___Optional[typing___Iterable[type___FieldDescriptorProto]] = None, + extension : typing___Optional[typing___Iterable[type___FieldDescriptorProto]] = None, + nested_type : typing___Optional[typing___Iterable[type___DescriptorProto]] = None, + enum_type : typing___Optional[typing___Iterable[type___EnumDescriptorProto]] = None, + extension_range : typing___Optional[typing___Iterable[type___DescriptorProto.ExtensionRange]] = None, + oneof_decl : typing___Optional[typing___Iterable[type___OneofDescriptorProto]] = None, + options : typing___Optional[type___MessageOptions] = None, + reserved_range : typing___Optional[typing___Iterable[type___DescriptorProto.ReservedRange]] = None, + reserved_name : typing___Optional[typing___Iterable[typing___Text]] = None, + ) -> None: ... + def HasField(self, field_name: typing_extensions___Literal[u"name",b"name",u"options",b"options"]) -> builtin___bool: ... + def ClearField(self, field_name: typing_extensions___Literal[u"enum_type",b"enum_type",u"extension",b"extension",u"extension_range",b"extension_range",u"field",b"field",u"name",b"name",u"nested_type",b"nested_type",u"oneof_decl",b"oneof_decl",u"options",b"options",u"reserved_name",b"reserved_name",u"reserved_range",b"reserved_range"]) -> None: ... +type___DescriptorProto = DescriptorProto + +class ExtensionRangeOptions(google___protobuf___message___Message): + DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... + + @property + def uninterpreted_option(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[type___UninterpretedOption]: ... + + def __init__(self, + *, + uninterpreted_option : typing___Optional[typing___Iterable[type___UninterpretedOption]] = None, + ) -> None: ... + def ClearField(self, field_name: typing_extensions___Literal[u"uninterpreted_option",b"uninterpreted_option"]) -> None: ... +type___ExtensionRangeOptions = ExtensionRangeOptions + +class FieldDescriptorProto(google___protobuf___message___Message): + DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... + TypeValue = typing___NewType('TypeValue', builtin___int) + type___TypeValue = TypeValue + Type: _Type + class _Type(google___protobuf___internal___enum_type_wrapper____EnumTypeWrapper[FieldDescriptorProto.TypeValue]): + DESCRIPTOR: google___protobuf___descriptor___EnumDescriptor = ... + TYPE_DOUBLE = typing___cast(FieldDescriptorProto.TypeValue, 1) + TYPE_FLOAT = typing___cast(FieldDescriptorProto.TypeValue, 2) + TYPE_INT64 = typing___cast(FieldDescriptorProto.TypeValue, 3) + TYPE_UINT64 = typing___cast(FieldDescriptorProto.TypeValue, 4) + TYPE_INT32 = typing___cast(FieldDescriptorProto.TypeValue, 5) + TYPE_FIXED64 = typing___cast(FieldDescriptorProto.TypeValue, 6) + TYPE_FIXED32 = typing___cast(FieldDescriptorProto.TypeValue, 7) + TYPE_BOOL = typing___cast(FieldDescriptorProto.TypeValue, 8) + TYPE_STRING = typing___cast(FieldDescriptorProto.TypeValue, 9) + TYPE_GROUP = typing___cast(FieldDescriptorProto.TypeValue, 10) + TYPE_MESSAGE = typing___cast(FieldDescriptorProto.TypeValue, 11) + TYPE_BYTES = typing___cast(FieldDescriptorProto.TypeValue, 12) + TYPE_UINT32 = typing___cast(FieldDescriptorProto.TypeValue, 13) + TYPE_ENUM = typing___cast(FieldDescriptorProto.TypeValue, 14) + TYPE_SFIXED32 = typing___cast(FieldDescriptorProto.TypeValue, 15) + TYPE_SFIXED64 = typing___cast(FieldDescriptorProto.TypeValue, 16) + TYPE_SINT32 = typing___cast(FieldDescriptorProto.TypeValue, 17) + TYPE_SINT64 = typing___cast(FieldDescriptorProto.TypeValue, 18) + TYPE_DOUBLE = typing___cast(FieldDescriptorProto.TypeValue, 1) + TYPE_FLOAT = typing___cast(FieldDescriptorProto.TypeValue, 2) + TYPE_INT64 = typing___cast(FieldDescriptorProto.TypeValue, 3) + TYPE_UINT64 = typing___cast(FieldDescriptorProto.TypeValue, 4) + TYPE_INT32 = typing___cast(FieldDescriptorProto.TypeValue, 5) + TYPE_FIXED64 = typing___cast(FieldDescriptorProto.TypeValue, 6) + TYPE_FIXED32 = typing___cast(FieldDescriptorProto.TypeValue, 7) + TYPE_BOOL = typing___cast(FieldDescriptorProto.TypeValue, 8) + TYPE_STRING = typing___cast(FieldDescriptorProto.TypeValue, 9) + TYPE_GROUP = typing___cast(FieldDescriptorProto.TypeValue, 10) + TYPE_MESSAGE = typing___cast(FieldDescriptorProto.TypeValue, 11) + TYPE_BYTES = typing___cast(FieldDescriptorProto.TypeValue, 12) + TYPE_UINT32 = typing___cast(FieldDescriptorProto.TypeValue, 13) + TYPE_ENUM = typing___cast(FieldDescriptorProto.TypeValue, 14) + TYPE_SFIXED32 = typing___cast(FieldDescriptorProto.TypeValue, 15) + TYPE_SFIXED64 = typing___cast(FieldDescriptorProto.TypeValue, 16) + TYPE_SINT32 = typing___cast(FieldDescriptorProto.TypeValue, 17) + TYPE_SINT64 = typing___cast(FieldDescriptorProto.TypeValue, 18) + + LabelValue = typing___NewType('LabelValue', builtin___int) + type___LabelValue = LabelValue + Label: _Label + class _Label(google___protobuf___internal___enum_type_wrapper____EnumTypeWrapper[FieldDescriptorProto.LabelValue]): + DESCRIPTOR: google___protobuf___descriptor___EnumDescriptor = ... + LABEL_OPTIONAL = typing___cast(FieldDescriptorProto.LabelValue, 1) + LABEL_REQUIRED = typing___cast(FieldDescriptorProto.LabelValue, 2) + LABEL_REPEATED = typing___cast(FieldDescriptorProto.LabelValue, 3) + LABEL_OPTIONAL = typing___cast(FieldDescriptorProto.LabelValue, 1) + LABEL_REQUIRED = typing___cast(FieldDescriptorProto.LabelValue, 2) + LABEL_REPEATED = typing___cast(FieldDescriptorProto.LabelValue, 3) + + name: typing___Text = ... + number: builtin___int = ... + label: type___FieldDescriptorProto.LabelValue = ... + type: type___FieldDescriptorProto.TypeValue = ... + type_name: typing___Text = ... + extendee: typing___Text = ... + default_value: typing___Text = ... + oneof_index: builtin___int = ... + json_name: typing___Text = ... + proto3_optional: builtin___bool = ... + + @property + def options(self) -> type___FieldOptions: ... + + def __init__(self, + *, + name : typing___Optional[typing___Text] = None, + number : typing___Optional[builtin___int] = None, + label : typing___Optional[type___FieldDescriptorProto.LabelValue] = None, + type : typing___Optional[type___FieldDescriptorProto.TypeValue] = None, + type_name : typing___Optional[typing___Text] = None, + extendee : typing___Optional[typing___Text] = None, + default_value : typing___Optional[typing___Text] = None, + oneof_index : typing___Optional[builtin___int] = None, + json_name : typing___Optional[typing___Text] = None, + options : typing___Optional[type___FieldOptions] = None, + proto3_optional : typing___Optional[builtin___bool] = None, + ) -> None: ... + def HasField(self, field_name: typing_extensions___Literal[u"default_value",b"default_value",u"extendee",b"extendee",u"json_name",b"json_name",u"label",b"label",u"name",b"name",u"number",b"number",u"oneof_index",b"oneof_index",u"options",b"options",u"proto3_optional",b"proto3_optional",u"type",b"type",u"type_name",b"type_name"]) -> builtin___bool: ... + def ClearField(self, field_name: typing_extensions___Literal[u"default_value",b"default_value",u"extendee",b"extendee",u"json_name",b"json_name",u"label",b"label",u"name",b"name",u"number",b"number",u"oneof_index",b"oneof_index",u"options",b"options",u"proto3_optional",b"proto3_optional",u"type",b"type",u"type_name",b"type_name"]) -> None: ... +type___FieldDescriptorProto = FieldDescriptorProto + +class OneofDescriptorProto(google___protobuf___message___Message): + DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... + name: typing___Text = ... + + @property + def options(self) -> type___OneofOptions: ... + + def __init__(self, + *, + name : typing___Optional[typing___Text] = None, + options : typing___Optional[type___OneofOptions] = None, + ) -> None: ... + def HasField(self, field_name: typing_extensions___Literal[u"name",b"name",u"options",b"options"]) -> builtin___bool: ... + def ClearField(self, field_name: typing_extensions___Literal[u"name",b"name",u"options",b"options"]) -> None: ... +type___OneofDescriptorProto = OneofDescriptorProto + +class EnumDescriptorProto(google___protobuf___message___Message): + DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... + class EnumReservedRange(google___protobuf___message___Message): + DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... + start: builtin___int = ... + end: builtin___int = ... + + def __init__(self, + *, + start : typing___Optional[builtin___int] = None, + end : typing___Optional[builtin___int] = None, + ) -> None: ... + def HasField(self, field_name: typing_extensions___Literal[u"end",b"end",u"start",b"start"]) -> builtin___bool: ... + def ClearField(self, field_name: typing_extensions___Literal[u"end",b"end",u"start",b"start"]) -> None: ... + type___EnumReservedRange = EnumReservedRange + + name: typing___Text = ... + reserved_name: google___protobuf___internal___containers___RepeatedScalarFieldContainer[typing___Text] = ... + + @property + def value(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[type___EnumValueDescriptorProto]: ... + + @property + def options(self) -> type___EnumOptions: ... + + @property + def reserved_range(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[type___EnumDescriptorProto.EnumReservedRange]: ... + + def __init__(self, + *, + name : typing___Optional[typing___Text] = None, + value : typing___Optional[typing___Iterable[type___EnumValueDescriptorProto]] = None, + options : typing___Optional[type___EnumOptions] = None, + reserved_range : typing___Optional[typing___Iterable[type___EnumDescriptorProto.EnumReservedRange]] = None, + reserved_name : typing___Optional[typing___Iterable[typing___Text]] = None, + ) -> None: ... + def HasField(self, field_name: typing_extensions___Literal[u"name",b"name",u"options",b"options"]) -> builtin___bool: ... + def ClearField(self, field_name: typing_extensions___Literal[u"name",b"name",u"options",b"options",u"reserved_name",b"reserved_name",u"reserved_range",b"reserved_range",u"value",b"value"]) -> None: ... +type___EnumDescriptorProto = EnumDescriptorProto + +class EnumValueDescriptorProto(google___protobuf___message___Message): + DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... + name: typing___Text = ... + number: builtin___int = ... + + @property + def options(self) -> type___EnumValueOptions: ... + + def __init__(self, + *, + name : typing___Optional[typing___Text] = None, + number : typing___Optional[builtin___int] = None, + options : typing___Optional[type___EnumValueOptions] = None, + ) -> None: ... + def HasField(self, field_name: typing_extensions___Literal[u"name",b"name",u"number",b"number",u"options",b"options"]) -> builtin___bool: ... + def ClearField(self, field_name: typing_extensions___Literal[u"name",b"name",u"number",b"number",u"options",b"options"]) -> None: ... +type___EnumValueDescriptorProto = EnumValueDescriptorProto + +class ServiceDescriptorProto(google___protobuf___message___Message): + DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... + name: typing___Text = ... + + @property + def method(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[type___MethodDescriptorProto]: ... + + @property + def options(self) -> type___ServiceOptions: ... + + def __init__(self, + *, + name : typing___Optional[typing___Text] = None, + method : typing___Optional[typing___Iterable[type___MethodDescriptorProto]] = None, + options : typing___Optional[type___ServiceOptions] = None, + ) -> None: ... + def HasField(self, field_name: typing_extensions___Literal[u"name",b"name",u"options",b"options"]) -> builtin___bool: ... + def ClearField(self, field_name: typing_extensions___Literal[u"method",b"method",u"name",b"name",u"options",b"options"]) -> None: ... +type___ServiceDescriptorProto = ServiceDescriptorProto + +class MethodDescriptorProto(google___protobuf___message___Message): + DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... + name: typing___Text = ... + input_type: typing___Text = ... + output_type: typing___Text = ... + client_streaming: builtin___bool = ... + server_streaming: builtin___bool = ... + + @property + def options(self) -> type___MethodOptions: ... + + def __init__(self, + *, + name : typing___Optional[typing___Text] = None, + input_type : typing___Optional[typing___Text] = None, + output_type : typing___Optional[typing___Text] = None, + options : typing___Optional[type___MethodOptions] = None, + client_streaming : typing___Optional[builtin___bool] = None, + server_streaming : typing___Optional[builtin___bool] = None, + ) -> None: ... + def HasField(self, field_name: typing_extensions___Literal[u"client_streaming",b"client_streaming",u"input_type",b"input_type",u"name",b"name",u"options",b"options",u"output_type",b"output_type",u"server_streaming",b"server_streaming"]) -> builtin___bool: ... + def ClearField(self, field_name: typing_extensions___Literal[u"client_streaming",b"client_streaming",u"input_type",b"input_type",u"name",b"name",u"options",b"options",u"output_type",b"output_type",u"server_streaming",b"server_streaming"]) -> None: ... +type___MethodDescriptorProto = MethodDescriptorProto + +class FileOptions(google___protobuf___message___Message): + DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... + OptimizeModeValue = typing___NewType('OptimizeModeValue', builtin___int) + type___OptimizeModeValue = OptimizeModeValue + OptimizeMode: _OptimizeMode + class _OptimizeMode(google___protobuf___internal___enum_type_wrapper____EnumTypeWrapper[FileOptions.OptimizeModeValue]): + DESCRIPTOR: google___protobuf___descriptor___EnumDescriptor = ... + SPEED = typing___cast(FileOptions.OptimizeModeValue, 1) + CODE_SIZE = typing___cast(FileOptions.OptimizeModeValue, 2) + LITE_RUNTIME = typing___cast(FileOptions.OptimizeModeValue, 3) + SPEED = typing___cast(FileOptions.OptimizeModeValue, 1) + CODE_SIZE = typing___cast(FileOptions.OptimizeModeValue, 2) + LITE_RUNTIME = typing___cast(FileOptions.OptimizeModeValue, 3) + + java_package: typing___Text = ... + java_outer_classname: typing___Text = ... + java_multiple_files: builtin___bool = ... + java_generate_equals_and_hash: builtin___bool = ... + java_string_check_utf8: builtin___bool = ... + optimize_for: type___FileOptions.OptimizeModeValue = ... + go_package: typing___Text = ... + cc_generic_services: builtin___bool = ... + java_generic_services: builtin___bool = ... + py_generic_services: builtin___bool = ... + php_generic_services: builtin___bool = ... + deprecated: builtin___bool = ... + cc_enable_arenas: builtin___bool = ... + objc_class_prefix: typing___Text = ... + csharp_namespace: typing___Text = ... + swift_prefix: typing___Text = ... + php_class_prefix: typing___Text = ... + php_namespace: typing___Text = ... + php_metadata_namespace: typing___Text = ... + ruby_package: typing___Text = ... + + @property + def uninterpreted_option(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[type___UninterpretedOption]: ... + + def __init__(self, + *, + java_package : typing___Optional[typing___Text] = None, + java_outer_classname : typing___Optional[typing___Text] = None, + java_multiple_files : typing___Optional[builtin___bool] = None, + java_generate_equals_and_hash : typing___Optional[builtin___bool] = None, + java_string_check_utf8 : typing___Optional[builtin___bool] = None, + optimize_for : typing___Optional[type___FileOptions.OptimizeModeValue] = None, + go_package : typing___Optional[typing___Text] = None, + cc_generic_services : typing___Optional[builtin___bool] = None, + java_generic_services : typing___Optional[builtin___bool] = None, + py_generic_services : typing___Optional[builtin___bool] = None, + php_generic_services : typing___Optional[builtin___bool] = None, + deprecated : typing___Optional[builtin___bool] = None, + cc_enable_arenas : typing___Optional[builtin___bool] = None, + objc_class_prefix : typing___Optional[typing___Text] = None, + csharp_namespace : typing___Optional[typing___Text] = None, + swift_prefix : typing___Optional[typing___Text] = None, + php_class_prefix : typing___Optional[typing___Text] = None, + php_namespace : typing___Optional[typing___Text] = None, + php_metadata_namespace : typing___Optional[typing___Text] = None, + ruby_package : typing___Optional[typing___Text] = None, + uninterpreted_option : typing___Optional[typing___Iterable[type___UninterpretedOption]] = None, + ) -> None: ... + def HasField(self, field_name: typing_extensions___Literal[u"cc_enable_arenas",b"cc_enable_arenas",u"cc_generic_services",b"cc_generic_services",u"csharp_namespace",b"csharp_namespace",u"deprecated",b"deprecated",u"go_package",b"go_package",u"java_generate_equals_and_hash",b"java_generate_equals_and_hash",u"java_generic_services",b"java_generic_services",u"java_multiple_files",b"java_multiple_files",u"java_outer_classname",b"java_outer_classname",u"java_package",b"java_package",u"java_string_check_utf8",b"java_string_check_utf8",u"objc_class_prefix",b"objc_class_prefix",u"optimize_for",b"optimize_for",u"php_class_prefix",b"php_class_prefix",u"php_generic_services",b"php_generic_services",u"php_metadata_namespace",b"php_metadata_namespace",u"php_namespace",b"php_namespace",u"py_generic_services",b"py_generic_services",u"ruby_package",b"ruby_package",u"swift_prefix",b"swift_prefix"]) -> builtin___bool: ... + def ClearField(self, field_name: typing_extensions___Literal[u"cc_enable_arenas",b"cc_enable_arenas",u"cc_generic_services",b"cc_generic_services",u"csharp_namespace",b"csharp_namespace",u"deprecated",b"deprecated",u"go_package",b"go_package",u"java_generate_equals_and_hash",b"java_generate_equals_and_hash",u"java_generic_services",b"java_generic_services",u"java_multiple_files",b"java_multiple_files",u"java_outer_classname",b"java_outer_classname",u"java_package",b"java_package",u"java_string_check_utf8",b"java_string_check_utf8",u"objc_class_prefix",b"objc_class_prefix",u"optimize_for",b"optimize_for",u"php_class_prefix",b"php_class_prefix",u"php_generic_services",b"php_generic_services",u"php_metadata_namespace",b"php_metadata_namespace",u"php_namespace",b"php_namespace",u"py_generic_services",b"py_generic_services",u"ruby_package",b"ruby_package",u"swift_prefix",b"swift_prefix",u"uninterpreted_option",b"uninterpreted_option"]) -> None: ... +type___FileOptions = FileOptions + +class MessageOptions(google___protobuf___message___Message): + DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... + message_set_wire_format: builtin___bool = ... + no_standard_descriptor_accessor: builtin___bool = ... + deprecated: builtin___bool = ... + map_entry: builtin___bool = ... + + @property + def uninterpreted_option(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[type___UninterpretedOption]: ... + + def __init__(self, + *, + message_set_wire_format : typing___Optional[builtin___bool] = None, + no_standard_descriptor_accessor : typing___Optional[builtin___bool] = None, + deprecated : typing___Optional[builtin___bool] = None, + map_entry : typing___Optional[builtin___bool] = None, + uninterpreted_option : typing___Optional[typing___Iterable[type___UninterpretedOption]] = None, ) -> None: ... - class ReservedRange(Message): - start: int - end: int - def __init__(self, start: Optional[int] = ..., end: Optional[int] = ...) -> None: ... - name: Text - reserved_name: RepeatedScalarFieldContainer[Text] - @property - def field(self) -> RepeatedCompositeFieldContainer[FieldDescriptorProto]: ... - @property - def extension(self) -> RepeatedCompositeFieldContainer[FieldDescriptorProto]: ... - @property - def nested_type(self) -> RepeatedCompositeFieldContainer[DescriptorProto]: ... - @property - def enum_type(self) -> RepeatedCompositeFieldContainer[EnumDescriptorProto]: ... - @property - def extension_range(self) -> RepeatedCompositeFieldContainer[DescriptorProto.ExtensionRange]: ... - @property - def oneof_decl(self) -> RepeatedCompositeFieldContainer[OneofDescriptorProto]: ... - @property - def options(self) -> MessageOptions: ... - @property - def reserved_range(self) -> RepeatedCompositeFieldContainer[DescriptorProto.ReservedRange]: ... - def __init__( - self, - name: Optional[Text] = ..., - field: Optional[Iterable[FieldDescriptorProto]] = ..., - extension: Optional[Iterable[FieldDescriptorProto]] = ..., - nested_type: Optional[Iterable[DescriptorProto]] = ..., - enum_type: Optional[Iterable[EnumDescriptorProto]] = ..., - extension_range: Optional[Iterable[DescriptorProto.ExtensionRange]] = ..., - oneof_decl: Optional[Iterable[OneofDescriptorProto]] = ..., - options: Optional[MessageOptions] = ..., - reserved_range: Optional[Iterable[DescriptorProto.ReservedRange]] = ..., - reserved_name: Optional[Iterable[Text]] = ..., - ) -> None: ... - -class ExtensionRangeOptions(Message): - @property - def uninterpreted_option(self) -> RepeatedCompositeFieldContainer[UninterpretedOption]: ... - def __init__(self, uninterpreted_option: Optional[Iterable[UninterpretedOption]] = ...) -> None: ... - -class FieldDescriptorProto(Message): - class Type(int): - @classmethod - def Name(cls, number: int) -> bytes: ... - @classmethod - def Value(cls, name: bytes) -> FieldDescriptorProto.Type: ... - @classmethod - def keys(cls) -> List[bytes]: ... - @classmethod - def values(cls) -> List[FieldDescriptorProto.Type]: ... - @classmethod - def items(cls) -> List[Tuple[bytes, FieldDescriptorProto.Type]]: ... - TYPE_DOUBLE: FieldDescriptorProto.Type - TYPE_FLOAT: FieldDescriptorProto.Type - TYPE_INT64: FieldDescriptorProto.Type - TYPE_UINT64: FieldDescriptorProto.Type - TYPE_INT32: FieldDescriptorProto.Type - TYPE_FIXED64: FieldDescriptorProto.Type - TYPE_FIXED32: FieldDescriptorProto.Type - TYPE_BOOL: FieldDescriptorProto.Type - TYPE_STRING: FieldDescriptorProto.Type - TYPE_GROUP: FieldDescriptorProto.Type - TYPE_MESSAGE: FieldDescriptorProto.Type - TYPE_BYTES: FieldDescriptorProto.Type - TYPE_UINT32: FieldDescriptorProto.Type - TYPE_ENUM: FieldDescriptorProto.Type - TYPE_SFIXED32: FieldDescriptorProto.Type - TYPE_SFIXED64: FieldDescriptorProto.Type - TYPE_SINT32: FieldDescriptorProto.Type - TYPE_SINT64: FieldDescriptorProto.Type - class Label(int): - @classmethod - def Name(cls, number: int) -> bytes: ... - @classmethod - def Value(cls, name: bytes) -> FieldDescriptorProto.Label: ... - @classmethod - def keys(cls) -> List[bytes]: ... - @classmethod - def values(cls) -> List[FieldDescriptorProto.Label]: ... - @classmethod - def items(cls) -> List[Tuple[bytes, FieldDescriptorProto.Label]]: ... - LABEL_OPTIONAL: FieldDescriptorProto.Label - LABEL_REQUIRED: FieldDescriptorProto.Label - LABEL_REPEATED: FieldDescriptorProto.Label - name: Text - number: int - label: FieldDescriptorProto.Label - type: FieldDescriptorProto.Type - type_name: Text - extendee: Text - default_value: Text - oneof_index: int - json_name: Text - @property - def options(self) -> FieldOptions: ... - def __init__( - self, - name: Optional[Text] = ..., - number: Optional[int] = ..., - label: Optional[FieldDescriptorProto.Label] = ..., - type: Optional[FieldDescriptorProto.Type] = ..., - type_name: Optional[Text] = ..., - extendee: Optional[Text] = ..., - default_value: Optional[Text] = ..., - oneof_index: Optional[int] = ..., - json_name: Optional[Text] = ..., - options: Optional[FieldOptions] = ..., - ) -> None: ... - -class OneofDescriptorProto(Message): - name: Text - @property - def options(self) -> OneofOptions: ... - def __init__(self, name: Optional[Text] = ..., options: Optional[OneofOptions] = ...) -> None: ... - -class EnumDescriptorProto(Message): - class EnumReservedRange(Message): - start: int - end: int - def __init__(self, start: Optional[int] = ..., end: Optional[int] = ...) -> None: ... - name: Text - reserved_name: RepeatedScalarFieldContainer[Text] - @property - def value(self) -> RepeatedCompositeFieldContainer[EnumValueDescriptorProto]: ... - @property - def options(self) -> EnumOptions: ... - @property - def reserved_range(self) -> RepeatedCompositeFieldContainer[EnumDescriptorProto.EnumReservedRange]: ... - def __init__( - self, - name: Optional[Text] = ..., - value: Optional[Iterable[EnumValueDescriptorProto]] = ..., - options: Optional[EnumOptions] = ..., - reserved_range: Optional[Iterable[EnumDescriptorProto.EnumReservedRange]] = ..., - reserved_name: Optional[Iterable[Text]] = ..., - ) -> None: ... - -class EnumValueDescriptorProto(Message): - name: Text - number: int - @property - def options(self) -> EnumValueOptions: ... - def __init__( - self, name: Optional[Text] = ..., number: Optional[int] = ..., options: Optional[EnumValueOptions] = ... - ) -> None: ... - -class ServiceDescriptorProto(Message): - name: Text - @property - def method(self) -> RepeatedCompositeFieldContainer[MethodDescriptorProto]: ... - @property - def options(self) -> ServiceOptions: ... - def __init__( - self, - name: Optional[Text] = ..., - method: Optional[Iterable[MethodDescriptorProto]] = ..., - options: Optional[ServiceOptions] = ..., - ) -> None: ... - -class MethodDescriptorProto(Message): - name: Text - input_type: Text - output_type: Text - client_streaming: bool - server_streaming: bool - @property - def options(self) -> MethodOptions: ... - def __init__( - self, - name: Optional[Text] = ..., - input_type: Optional[Text] = ..., - output_type: Optional[Text] = ..., - options: Optional[MethodOptions] = ..., - client_streaming: Optional[bool] = ..., - server_streaming: Optional[bool] = ..., - ) -> None: ... - -class FileOptions(Message): - class OptimizeMode(int): - @classmethod - def Name(cls, number: int) -> bytes: ... - @classmethod - def Value(cls, name: bytes) -> FileOptions.OptimizeMode: ... - @classmethod - def keys(cls) -> List[bytes]: ... - @classmethod - def values(cls) -> List[FileOptions.OptimizeMode]: ... - @classmethod - def items(cls) -> List[Tuple[bytes, FileOptions.OptimizeMode]]: ... - SPEED: FileOptions.OptimizeMode - CODE_SIZE: FileOptions.OptimizeMode - LITE_RUNTIME: FileOptions.OptimizeMode - java_package: Text - java_outer_classname: Text - java_multiple_files: bool - java_generate_equals_and_hash: bool - java_string_check_utf8: bool - optimize_for: FileOptions.OptimizeMode - go_package: Text - cc_generic_services: bool - java_generic_services: bool - py_generic_services: bool - php_generic_services: bool - deprecated: bool - cc_enable_arenas: bool - objc_class_prefix: Text - csharp_namespace: Text - swift_prefix: Text - php_class_prefix: Text - php_namespace: Text - @property - def uninterpreted_option(self) -> RepeatedCompositeFieldContainer[UninterpretedOption]: ... - def __init__( - self, - java_package: Optional[Text] = ..., - java_outer_classname: Optional[Text] = ..., - java_multiple_files: Optional[bool] = ..., - java_generate_equals_and_hash: Optional[bool] = ..., - java_string_check_utf8: Optional[bool] = ..., - optimize_for: Optional[FileOptions.OptimizeMode] = ..., - go_package: Optional[Text] = ..., - cc_generic_services: Optional[bool] = ..., - java_generic_services: Optional[bool] = ..., - py_generic_services: Optional[bool] = ..., - php_generic_services: Optional[bool] = ..., - deprecated: Optional[bool] = ..., - cc_enable_arenas: Optional[bool] = ..., - objc_class_prefix: Optional[Text] = ..., - csharp_namespace: Optional[Text] = ..., - swift_prefix: Optional[Text] = ..., - php_class_prefix: Optional[Text] = ..., - php_namespace: Optional[Text] = ..., - uninterpreted_option: Optional[Iterable[UninterpretedOption]] = ..., - ) -> None: ... - -class MessageOptions(Message): - message_set_wire_format: bool - no_standard_descriptor_accessor: bool - deprecated: bool - map_entry: bool - @property - def uninterpreted_option(self) -> RepeatedCompositeFieldContainer[UninterpretedOption]: ... - def __init__( - self, - message_set_wire_format: Optional[bool] = ..., - no_standard_descriptor_accessor: Optional[bool] = ..., - deprecated: Optional[bool] = ..., - map_entry: Optional[bool] = ..., - uninterpreted_option: Optional[Iterable[UninterpretedOption]] = ..., - ) -> None: ... - -class FieldOptions(Message): - class CType(int): - @classmethod - def Name(cls, number: int) -> bytes: ... - @classmethod - def Value(cls, name: bytes) -> FieldOptions.CType: ... - @classmethod - def keys(cls) -> List[bytes]: ... - @classmethod - def values(cls) -> List[FieldOptions.CType]: ... - @classmethod - def items(cls) -> List[Tuple[bytes, FieldOptions.CType]]: ... - STRING: FieldOptions.CType - CORD: FieldOptions.CType - STRING_PIECE: FieldOptions.CType - class JSType(int): - @classmethod - def Name(cls, number: int) -> bytes: ... - @classmethod - def Value(cls, name: bytes) -> FieldOptions.JSType: ... - @classmethod - def keys(cls) -> List[bytes]: ... - @classmethod - def values(cls) -> List[FieldOptions.JSType]: ... - @classmethod - def items(cls) -> List[Tuple[bytes, FieldOptions.JSType]]: ... - JS_NORMAL: FieldOptions.JSType - JS_STRING: FieldOptions.JSType - JS_NUMBER: FieldOptions.JSType - ctype: FieldOptions.CType - packed: bool - jstype: FieldOptions.JSType - lazy: bool - deprecated: bool - weak: bool - @property - def uninterpreted_option(self) -> RepeatedCompositeFieldContainer[UninterpretedOption]: ... - def __init__( - self, - ctype: Optional[FieldOptions.CType] = ..., - packed: Optional[bool] = ..., - jstype: Optional[FieldOptions.JSType] = ..., - lazy: Optional[bool] = ..., - deprecated: Optional[bool] = ..., - weak: Optional[bool] = ..., - uninterpreted_option: Optional[Iterable[UninterpretedOption]] = ..., - ) -> None: ... - -class OneofOptions(Message): - @property - def uninterpreted_option(self) -> RepeatedCompositeFieldContainer[UninterpretedOption]: ... - def __init__(self, uninterpreted_option: Optional[Iterable[UninterpretedOption]] = ...) -> None: ... - -class EnumOptions(Message): - allow_alias: bool - deprecated: bool - @property - def uninterpreted_option(self) -> RepeatedCompositeFieldContainer[UninterpretedOption]: ... - def __init__( - self, - allow_alias: Optional[bool] = ..., - deprecated: Optional[bool] = ..., - uninterpreted_option: Optional[Iterable[UninterpretedOption]] = ..., - ) -> None: ... - -class EnumValueOptions(Message): - deprecated: bool - @property - def uninterpreted_option(self) -> RepeatedCompositeFieldContainer[UninterpretedOption]: ... - def __init__( - self, deprecated: Optional[bool] = ..., uninterpreted_option: Optional[Iterable[UninterpretedOption]] = ... - ) -> None: ... - -class ServiceOptions(Message): - deprecated: bool - @property - def uninterpreted_option(self) -> RepeatedCompositeFieldContainer[UninterpretedOption]: ... - def __init__( - self, deprecated: Optional[bool] = ..., uninterpreted_option: Optional[Iterable[UninterpretedOption]] = ... - ) -> None: ... - -class MethodOptions(Message): - class IdempotencyLevel(int): - @classmethod - def Name(cls, number: int) -> bytes: ... - @classmethod - def Value(cls, name: bytes) -> MethodOptions.IdempotencyLevel: ... - @classmethod - def keys(cls) -> List[bytes]: ... - @classmethod - def values(cls) -> List[MethodOptions.IdempotencyLevel]: ... - @classmethod - def items(cls) -> List[Tuple[bytes, MethodOptions.IdempotencyLevel]]: ... - IDEMPOTENCY_UNKNOWN: MethodOptions.IdempotencyLevel - NO_SIDE_EFFECTS: MethodOptions.IdempotencyLevel - IDEMPOTENT: MethodOptions.IdempotencyLevel - deprecated: bool - idempotency_level: MethodOptions.IdempotencyLevel - @property - def uninterpreted_option(self) -> RepeatedCompositeFieldContainer[UninterpretedOption]: ... - def __init__( - self, - deprecated: Optional[bool] = ..., - idempotency_level: Optional[MethodOptions.IdempotencyLevel] = ..., - uninterpreted_option: Optional[Iterable[UninterpretedOption]] = ..., - ) -> None: ... - -class UninterpretedOption(Message): - class NamePart(Message): - name_part: Text - is_extension: bool - def __init__(self, name_part: Text, is_extension: bool) -> None: ... - identifier_value: Text - positive_int_value: int - negative_int_value: int - double_value: float - string_value: bytes - aggregate_value: Text - @property - def name(self) -> RepeatedCompositeFieldContainer[UninterpretedOption.NamePart]: ... - def __init__( - self, - name: Optional[Iterable[UninterpretedOption.NamePart]] = ..., - identifier_value: Optional[Text] = ..., - positive_int_value: Optional[int] = ..., - negative_int_value: Optional[int] = ..., - double_value: Optional[float] = ..., - string_value: Optional[bytes] = ..., - aggregate_value: Optional[Text] = ..., - ) -> None: ... - -class SourceCodeInfo(Message): - class Location(Message): - path: RepeatedScalarFieldContainer[int] - span: RepeatedScalarFieldContainer[int] - leading_comments: Text - trailing_comments: Text - leading_detached_comments: RepeatedScalarFieldContainer[Text] - def __init__( - self, - path: Optional[Iterable[int]] = ..., - span: Optional[Iterable[int]] = ..., - leading_comments: Optional[Text] = ..., - trailing_comments: Optional[Text] = ..., - leading_detached_comments: Optional[Iterable[Text]] = ..., + def HasField(self, field_name: typing_extensions___Literal[u"deprecated",b"deprecated",u"map_entry",b"map_entry",u"message_set_wire_format",b"message_set_wire_format",u"no_standard_descriptor_accessor",b"no_standard_descriptor_accessor"]) -> builtin___bool: ... + def ClearField(self, field_name: typing_extensions___Literal[u"deprecated",b"deprecated",u"map_entry",b"map_entry",u"message_set_wire_format",b"message_set_wire_format",u"no_standard_descriptor_accessor",b"no_standard_descriptor_accessor",u"uninterpreted_option",b"uninterpreted_option"]) -> None: ... +type___MessageOptions = MessageOptions + +class FieldOptions(google___protobuf___message___Message): + DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... + CTypeValue = typing___NewType('CTypeValue', builtin___int) + type___CTypeValue = CTypeValue + CType: _CType + class _CType(google___protobuf___internal___enum_type_wrapper____EnumTypeWrapper[FieldOptions.CTypeValue]): + DESCRIPTOR: google___protobuf___descriptor___EnumDescriptor = ... + STRING = typing___cast(FieldOptions.CTypeValue, 0) + CORD = typing___cast(FieldOptions.CTypeValue, 1) + STRING_PIECE = typing___cast(FieldOptions.CTypeValue, 2) + STRING = typing___cast(FieldOptions.CTypeValue, 0) + CORD = typing___cast(FieldOptions.CTypeValue, 1) + STRING_PIECE = typing___cast(FieldOptions.CTypeValue, 2) + + JSTypeValue = typing___NewType('JSTypeValue', builtin___int) + type___JSTypeValue = JSTypeValue + JSType: _JSType + class _JSType(google___protobuf___internal___enum_type_wrapper____EnumTypeWrapper[FieldOptions.JSTypeValue]): + DESCRIPTOR: google___protobuf___descriptor___EnumDescriptor = ... + JS_NORMAL = typing___cast(FieldOptions.JSTypeValue, 0) + JS_STRING = typing___cast(FieldOptions.JSTypeValue, 1) + JS_NUMBER = typing___cast(FieldOptions.JSTypeValue, 2) + JS_NORMAL = typing___cast(FieldOptions.JSTypeValue, 0) + JS_STRING = typing___cast(FieldOptions.JSTypeValue, 1) + JS_NUMBER = typing___cast(FieldOptions.JSTypeValue, 2) + + ctype: type___FieldOptions.CTypeValue = ... + packed: builtin___bool = ... + jstype: type___FieldOptions.JSTypeValue = ... + lazy: builtin___bool = ... + deprecated: builtin___bool = ... + weak: builtin___bool = ... + + @property + def uninterpreted_option(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[type___UninterpretedOption]: ... + + def __init__(self, + *, + ctype : typing___Optional[type___FieldOptions.CTypeValue] = None, + packed : typing___Optional[builtin___bool] = None, + jstype : typing___Optional[type___FieldOptions.JSTypeValue] = None, + lazy : typing___Optional[builtin___bool] = None, + deprecated : typing___Optional[builtin___bool] = None, + weak : typing___Optional[builtin___bool] = None, + uninterpreted_option : typing___Optional[typing___Iterable[type___UninterpretedOption]] = None, ) -> None: ... + def HasField(self, field_name: typing_extensions___Literal[u"ctype",b"ctype",u"deprecated",b"deprecated",u"jstype",b"jstype",u"lazy",b"lazy",u"packed",b"packed",u"weak",b"weak"]) -> builtin___bool: ... + def ClearField(self, field_name: typing_extensions___Literal[u"ctype",b"ctype",u"deprecated",b"deprecated",u"jstype",b"jstype",u"lazy",b"lazy",u"packed",b"packed",u"uninterpreted_option",b"uninterpreted_option",u"weak",b"weak"]) -> None: ... +type___FieldOptions = FieldOptions + +class OneofOptions(google___protobuf___message___Message): + DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... + @property - def location(self) -> RepeatedCompositeFieldContainer[SourceCodeInfo.Location]: ... - def __init__(self, location: Optional[Iterable[SourceCodeInfo.Location]] = ...) -> None: ... - -class GeneratedCodeInfo(Message): - class Annotation(Message): - path: RepeatedScalarFieldContainer[int] - source_file: Text - begin: int - end: int - def __init__( - self, - path: Optional[Iterable[int]] = ..., - source_file: Optional[Text] = ..., - begin: Optional[int] = ..., - end: Optional[int] = ..., + def uninterpreted_option(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[type___UninterpretedOption]: ... + + def __init__(self, + *, + uninterpreted_option : typing___Optional[typing___Iterable[type___UninterpretedOption]] = None, ) -> None: ... + def ClearField(self, field_name: typing_extensions___Literal[u"uninterpreted_option",b"uninterpreted_option"]) -> None: ... +type___OneofOptions = OneofOptions + +class EnumOptions(google___protobuf___message___Message): + DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... + allow_alias: builtin___bool = ... + deprecated: builtin___bool = ... + @property - def annotation(self) -> RepeatedCompositeFieldContainer[GeneratedCodeInfo.Annotation]: ... - def __init__(self, annotation: Optional[Iterable[GeneratedCodeInfo.Annotation]] = ...) -> None: ... + def uninterpreted_option(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[type___UninterpretedOption]: ... + + def __init__(self, + *, + allow_alias : typing___Optional[builtin___bool] = None, + deprecated : typing___Optional[builtin___bool] = None, + uninterpreted_option : typing___Optional[typing___Iterable[type___UninterpretedOption]] = None, + ) -> None: ... + def HasField(self, field_name: typing_extensions___Literal[u"allow_alias",b"allow_alias",u"deprecated",b"deprecated"]) -> builtin___bool: ... + def ClearField(self, field_name: typing_extensions___Literal[u"allow_alias",b"allow_alias",u"deprecated",b"deprecated",u"uninterpreted_option",b"uninterpreted_option"]) -> None: ... +type___EnumOptions = EnumOptions + +class EnumValueOptions(google___protobuf___message___Message): + DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... + deprecated: builtin___bool = ... + + @property + def uninterpreted_option(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[type___UninterpretedOption]: ... + + def __init__(self, + *, + deprecated : typing___Optional[builtin___bool] = None, + uninterpreted_option : typing___Optional[typing___Iterable[type___UninterpretedOption]] = None, + ) -> None: ... + def HasField(self, field_name: typing_extensions___Literal[u"deprecated",b"deprecated"]) -> builtin___bool: ... + def ClearField(self, field_name: typing_extensions___Literal[u"deprecated",b"deprecated",u"uninterpreted_option",b"uninterpreted_option"]) -> None: ... +type___EnumValueOptions = EnumValueOptions + +class ServiceOptions(google___protobuf___message___Message): + DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... + deprecated: builtin___bool = ... + + @property + def uninterpreted_option(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[type___UninterpretedOption]: ... + + def __init__(self, + *, + deprecated : typing___Optional[builtin___bool] = None, + uninterpreted_option : typing___Optional[typing___Iterable[type___UninterpretedOption]] = None, + ) -> None: ... + def HasField(self, field_name: typing_extensions___Literal[u"deprecated",b"deprecated"]) -> builtin___bool: ... + def ClearField(self, field_name: typing_extensions___Literal[u"deprecated",b"deprecated",u"uninterpreted_option",b"uninterpreted_option"]) -> None: ... +type___ServiceOptions = ServiceOptions + +class MethodOptions(google___protobuf___message___Message): + DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... + IdempotencyLevelValue = typing___NewType('IdempotencyLevelValue', builtin___int) + type___IdempotencyLevelValue = IdempotencyLevelValue + IdempotencyLevel: _IdempotencyLevel + class _IdempotencyLevel(google___protobuf___internal___enum_type_wrapper____EnumTypeWrapper[MethodOptions.IdempotencyLevelValue]): + DESCRIPTOR: google___protobuf___descriptor___EnumDescriptor = ... + IDEMPOTENCY_UNKNOWN = typing___cast(MethodOptions.IdempotencyLevelValue, 0) + NO_SIDE_EFFECTS = typing___cast(MethodOptions.IdempotencyLevelValue, 1) + IDEMPOTENT = typing___cast(MethodOptions.IdempotencyLevelValue, 2) + IDEMPOTENCY_UNKNOWN = typing___cast(MethodOptions.IdempotencyLevelValue, 0) + NO_SIDE_EFFECTS = typing___cast(MethodOptions.IdempotencyLevelValue, 1) + IDEMPOTENT = typing___cast(MethodOptions.IdempotencyLevelValue, 2) + + deprecated: builtin___bool = ... + idempotency_level: type___MethodOptions.IdempotencyLevelValue = ... + + @property + def uninterpreted_option(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[type___UninterpretedOption]: ... + + def __init__(self, + *, + deprecated : typing___Optional[builtin___bool] = None, + idempotency_level : typing___Optional[type___MethodOptions.IdempotencyLevelValue] = None, + uninterpreted_option : typing___Optional[typing___Iterable[type___UninterpretedOption]] = None, + ) -> None: ... + def HasField(self, field_name: typing_extensions___Literal[u"deprecated",b"deprecated",u"idempotency_level",b"idempotency_level"]) -> builtin___bool: ... + def ClearField(self, field_name: typing_extensions___Literal[u"deprecated",b"deprecated",u"idempotency_level",b"idempotency_level",u"uninterpreted_option",b"uninterpreted_option"]) -> None: ... +type___MethodOptions = MethodOptions + +class UninterpretedOption(google___protobuf___message___Message): + DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... + class NamePart(google___protobuf___message___Message): + DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... + name_part: typing___Text = ... + is_extension: builtin___bool = ... + + def __init__(self, + *, + name_part : typing___Optional[typing___Text] = None, + is_extension : typing___Optional[builtin___bool] = None, + ) -> None: ... + def HasField(self, field_name: typing_extensions___Literal[u"is_extension",b"is_extension",u"name_part",b"name_part"]) -> builtin___bool: ... + def ClearField(self, field_name: typing_extensions___Literal[u"is_extension",b"is_extension",u"name_part",b"name_part"]) -> None: ... + type___NamePart = NamePart + + identifier_value: typing___Text = ... + positive_int_value: builtin___int = ... + negative_int_value: builtin___int = ... + double_value: builtin___float = ... + string_value: builtin___bytes = ... + aggregate_value: typing___Text = ... + + @property + def name(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[type___UninterpretedOption.NamePart]: ... + + def __init__(self, + *, + name : typing___Optional[typing___Iterable[type___UninterpretedOption.NamePart]] = None, + identifier_value : typing___Optional[typing___Text] = None, + positive_int_value : typing___Optional[builtin___int] = None, + negative_int_value : typing___Optional[builtin___int] = None, + double_value : typing___Optional[builtin___float] = None, + string_value : typing___Optional[builtin___bytes] = None, + aggregate_value : typing___Optional[typing___Text] = None, + ) -> None: ... + def HasField(self, field_name: typing_extensions___Literal[u"aggregate_value",b"aggregate_value",u"double_value",b"double_value",u"identifier_value",b"identifier_value",u"negative_int_value",b"negative_int_value",u"positive_int_value",b"positive_int_value",u"string_value",b"string_value"]) -> builtin___bool: ... + def ClearField(self, field_name: typing_extensions___Literal[u"aggregate_value",b"aggregate_value",u"double_value",b"double_value",u"identifier_value",b"identifier_value",u"name",b"name",u"negative_int_value",b"negative_int_value",u"positive_int_value",b"positive_int_value",u"string_value",b"string_value"]) -> None: ... +type___UninterpretedOption = UninterpretedOption + +class SourceCodeInfo(google___protobuf___message___Message): + DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... + class Location(google___protobuf___message___Message): + DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... + path: google___protobuf___internal___containers___RepeatedScalarFieldContainer[builtin___int] = ... + span: google___protobuf___internal___containers___RepeatedScalarFieldContainer[builtin___int] = ... + leading_comments: typing___Text = ... + trailing_comments: typing___Text = ... + leading_detached_comments: google___protobuf___internal___containers___RepeatedScalarFieldContainer[typing___Text] = ... + + def __init__(self, + *, + path : typing___Optional[typing___Iterable[builtin___int]] = None, + span : typing___Optional[typing___Iterable[builtin___int]] = None, + leading_comments : typing___Optional[typing___Text] = None, + trailing_comments : typing___Optional[typing___Text] = None, + leading_detached_comments : typing___Optional[typing___Iterable[typing___Text]] = None, + ) -> None: ... + def HasField(self, field_name: typing_extensions___Literal[u"leading_comments",b"leading_comments",u"trailing_comments",b"trailing_comments"]) -> builtin___bool: ... + def ClearField(self, field_name: typing_extensions___Literal[u"leading_comments",b"leading_comments",u"leading_detached_comments",b"leading_detached_comments",u"path",b"path",u"span",b"span",u"trailing_comments",b"trailing_comments"]) -> None: ... + type___Location = Location + + + @property + def location(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[type___SourceCodeInfo.Location]: ... + + def __init__(self, + *, + location : typing___Optional[typing___Iterable[type___SourceCodeInfo.Location]] = None, + ) -> None: ... + def ClearField(self, field_name: typing_extensions___Literal[u"location",b"location"]) -> None: ... +type___SourceCodeInfo = SourceCodeInfo + +class GeneratedCodeInfo(google___protobuf___message___Message): + DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... + class Annotation(google___protobuf___message___Message): + DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... + path: google___protobuf___internal___containers___RepeatedScalarFieldContainer[builtin___int] = ... + source_file: typing___Text = ... + begin: builtin___int = ... + end: builtin___int = ... + + def __init__(self, + *, + path : typing___Optional[typing___Iterable[builtin___int]] = None, + source_file : typing___Optional[typing___Text] = None, + begin : typing___Optional[builtin___int] = None, + end : typing___Optional[builtin___int] = None, + ) -> None: ... + def HasField(self, field_name: typing_extensions___Literal[u"begin",b"begin",u"end",b"end",u"source_file",b"source_file"]) -> builtin___bool: ... + def ClearField(self, field_name: typing_extensions___Literal[u"begin",b"begin",u"end",b"end",u"path",b"path",u"source_file",b"source_file"]) -> None: ... + type___Annotation = Annotation + + + @property + def annotation(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[type___GeneratedCodeInfo.Annotation]: ... + + def __init__(self, + *, + annotation : typing___Optional[typing___Iterable[type___GeneratedCodeInfo.Annotation]] = None, + ) -> None: ... + def ClearField(self, field_name: typing_extensions___Literal[u"annotation",b"annotation"]) -> None: ... +type___GeneratedCodeInfo = GeneratedCodeInfo diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/descriptor_pool.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/descriptor_pool.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/duration_pb2.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/duration_pb2.pyi old mode 100755 new mode 100644 index a7e4bf3c..973efdd7 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/duration_pb2.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/duration_pb2.pyi @@ -1,9 +1,46 @@ -from google.protobuf.message import Message -from google.protobuf.internal import well_known_types +""" +@generated by mypy-protobuf. Do not edit manually! +isort:skip_file +""" +from google.protobuf.descriptor import ( + Descriptor as google___protobuf___descriptor___Descriptor, + FileDescriptor as google___protobuf___descriptor___FileDescriptor, +) -from typing import Optional +from google.protobuf.internal.well_known_types import ( + Duration as google___protobuf___internal___well_known_types___Duration, +) -class Duration(Message, well_known_types.Duration): - seconds: int - nanos: int - def __init__(self, seconds: Optional[int] = ..., nanos: Optional[int] = ...) -> None: ... +from google.protobuf.message import ( + Message as google___protobuf___message___Message, +) + +from typing import ( + Optional as typing___Optional, +) + +from typing_extensions import ( + Literal as typing_extensions___Literal, +) + + +builtin___bool = bool +builtin___bytes = bytes +builtin___float = float +builtin___int = int + + +DESCRIPTOR: google___protobuf___descriptor___FileDescriptor = ... + +class Duration(google___protobuf___message___Message, google___protobuf___internal___well_known_types___Duration): + DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... + seconds: builtin___int = ... + nanos: builtin___int = ... + + def __init__(self, + *, + seconds : typing___Optional[builtin___int] = None, + nanos : typing___Optional[builtin___int] = None, + ) -> None: ... + def ClearField(self, field_name: typing_extensions___Literal[u"nanos",b"nanos",u"seconds",b"seconds"]) -> None: ... +type___Duration = Duration diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/empty_pb2.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/empty_pb2.pyi old mode 100755 new mode 100644 index 7046e643..4fc287d7 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/empty_pb2.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/empty_pb2.pyi @@ -1,4 +1,22 @@ -from google.protobuf.message import Message +""" +@generated by mypy-protobuf. Do not edit manually! +isort:skip_file +""" +from google.protobuf.descriptor import ( + Descriptor as google___protobuf___descriptor___Descriptor, + FileDescriptor as google___protobuf___descriptor___FileDescriptor, +) -class Empty(Message): - def __init__(self,) -> None: ... +from google.protobuf.message import ( + Message as google___protobuf___message___Message, +) + + +DESCRIPTOR: google___protobuf___descriptor___FileDescriptor = ... + +class Empty(google___protobuf___message___Message): + DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... + + def __init__(self, + ) -> None: ... +type___Empty = Empty diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/field_mask_pb2.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/field_mask_pb2.pyi old mode 100755 new mode 100644 index 11855196..68c93054 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/field_mask_pb2.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/field_mask_pb2.pyi @@ -1,9 +1,50 @@ -from google.protobuf.internal.containers import RepeatedScalarFieldContainer -from google.protobuf.internal import well_known_types +""" +@generated by mypy-protobuf. Do not edit manually! +isort:skip_file +""" +from google.protobuf.descriptor import ( + Descriptor as google___protobuf___descriptor___Descriptor, + FileDescriptor as google___protobuf___descriptor___FileDescriptor, +) -from google.protobuf.message import Message -from typing import Iterable, Optional, Text +from google.protobuf.internal.containers import ( + RepeatedScalarFieldContainer as google___protobuf___internal___containers___RepeatedScalarFieldContainer, +) -class FieldMask(Message, well_known_types.FieldMask): - paths: RepeatedScalarFieldContainer[Text] - def __init__(self, paths: Optional[Iterable[Text]] = ...) -> None: ... +from google.protobuf.internal.well_known_types import ( + FieldMask as google___protobuf___internal___well_known_types___FieldMask, +) + +from google.protobuf.message import ( + Message as google___protobuf___message___Message, +) + +from typing import ( + Iterable as typing___Iterable, + Optional as typing___Optional, + Text as typing___Text, +) + +from typing_extensions import ( + Literal as typing_extensions___Literal, +) + + +builtin___bool = bool +builtin___bytes = bytes +builtin___float = float +builtin___int = int + + +DESCRIPTOR: google___protobuf___descriptor___FileDescriptor = ... + +class FieldMask(google___protobuf___message___Message, google___protobuf___internal___well_known_types___FieldMask): + DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... + paths: google___protobuf___internal___containers___RepeatedScalarFieldContainer[typing___Text] = ... + + def __init__(self, + *, + paths : typing___Optional[typing___Iterable[typing___Text]] = None, + ) -> None: ... + def ClearField(self, field_name: typing_extensions___Literal[u"paths",b"paths"]) -> None: ... +type___FieldMask = FieldMask diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/__init__.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/containers.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/containers.pyi old mode 100755 new mode 100644 index fc97c733..4d7b019e --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/containers.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/containers.pyi @@ -1,9 +1,26 @@ +from typing import ( + Any, + Callable, + Iterable, + Iterator, + List, + Mapping as Mapping, + MutableMapping as MutableMapping, + Optional, + Sequence, + TypeVar, + Union, + overload, +) + from google.protobuf.descriptor import Descriptor from google.protobuf.internal.message_listener import MessageListener -from google.protobuf.message import Message -from typing import Sequence, TypeVar, Generic, Any, Iterator, Iterable, Union, Optional, Callable, overload, List +from google.protobuf.internal.python_message import GeneratedProtocolMessageType _T = TypeVar("_T") +_K = TypeVar("_K") +_V = TypeVar("_V") +_M = TypeVar("_M") class BaseContainer(Sequence[_T]): def __init__(self, message_listener: MessageListener) -> None: ... @@ -22,7 +39,7 @@ class RepeatedScalarFieldContainer(BaseContainer[_T]): def append(self, value: _T) -> None: ... def insert(self, key: int, value: _T) -> None: ... def extend(self, elem_seq: Optional[Iterable[_T]]) -> None: ... - def MergeFrom(self, other: RepeatedScalarFieldContainer[_T]) -> None: ... + def MergeFrom(self: _M, other: _M) -> None: ... def remove(self, elem: _T) -> None: ... def pop(self, key: int = ...) -> _T: ... @overload @@ -41,7 +58,7 @@ class RepeatedCompositeFieldContainer(BaseContainer[_T]): def append(self, value: _T) -> None: ... def insert(self, key: int, value: _T) -> None: ... def extend(self, elem_seq: Iterable[_T]) -> None: ... - def MergeFrom(self, other: RepeatedCompositeFieldContainer[_T]) -> None: ... + def MergeFrom(self: _M, other: _M) -> None: ... def remove(self, elem: _T) -> None: ... def pop(self, key: int = ...) -> _T: ... def __getslice__(self, start: int, stop: int) -> List[_T]: ... @@ -49,8 +66,25 @@ class RepeatedCompositeFieldContainer(BaseContainer[_T]): def __delslice__(self, start: int, stop: int) -> None: ... def __eq__(self, other: object) -> bool: ... -# Classes not yet typed -class Mapping(Any): ... -class MutableMapping(Mapping): ... -class ScalarMap(MutableMapping): ... -class MessageMap(MutableMapping): ... +class ScalarMap(MutableMapping[_K, _V]): + def __setitem__(self, k: _K, v: _V) -> None: ... + def __delitem__(self, v: _K) -> None: ... + def __getitem__(self, k: _K) -> _V: ... + def __len__(self) -> int: ... + def __iter__(self) -> Iterator[_K]: ... + def __eq__(self, other: object) -> bool: ... + def MergeFrom(self: _M, other: _M): ... + def InvalidateIterators(self) -> None: ... + def GetEntryClass(self) -> GeneratedProtocolMessageType: ... + +class MessageMap(MutableMapping[_K, _V]): + def __setitem__(self, k: _K, v: _V) -> None: ... + def __delitem__(self, v: _K) -> None: ... + def __getitem__(self, k: _K) -> _V: ... + def __len__(self) -> int: ... + def __iter__(self) -> Iterator[_K]: ... + def __eq__(self, other: object) -> bool: ... + def get_or_create(self, key: _K) -> _V: ... + def MergeFrom(self: _M, other: _M): ... + def InvalidateIterators(self) -> None: ... + def GetEntryClass(self) -> GeneratedProtocolMessageType: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/decoder.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/decoder.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/encoder.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/encoder.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/enum_type_wrapper.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/enum_type_wrapper.pyi old mode 100755 new mode 100644 index 174002d7..bb983403 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/enum_type_wrapper.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/enum_type_wrapper.pyi @@ -1,10 +1,18 @@ -from typing import Any, List, Tuple - -class EnumTypeWrapper(object): - def __init__(self, enum_type: Any) -> None: ... - def Name(self, number: int) -> bytes: ... - def Value(self, name: bytes) -> int: ... - def keys(self) -> List[bytes]: ... - def values(self) -> List[int]: ... - @classmethod - def items(cls) -> List[Tuple[bytes, int]]: ... +from typing import Generic, List, Tuple, TypeVar + +from google.protobuf.descriptor import EnumDescriptor + +_V = TypeVar("_V", bound=int) + +# Expose a generic version so that those using mypy-protobuf +# can get autogenerated NewType wrapper around the int values +class _EnumTypeWrapper(Generic[_V]): + DESCRIPTOR: EnumDescriptor + def __init__(self, enum_type: EnumDescriptor) -> None: ... + def Name(self, number: _V) -> str: ... + def Value(self, name: str) -> _V: ... + def keys(self) -> List[str]: ... + def values(self) -> List[_V]: ... + def items(self) -> List[Tuple[str, _V]]: ... + +class EnumTypeWrapper(_EnumTypeWrapper[int]): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/extension_dict.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/extension_dict.pyi new file mode 100644 index 00000000..ba939cff --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/extension_dict.pyi @@ -0,0 +1,36 @@ +from typing import Any, Generic, Iterator, TypeVar, overload + +from google.protobuf.descriptor import FieldDescriptor +from google.protobuf.message import Message + +_ContainerMessageT = TypeVar("_ContainerMessageT", bound=Message) +_ExtenderMessageT = TypeVar("_ExtenderMessageT", bound=Message) + +class _ExtensionFieldDescriptor(FieldDescriptor, Generic[_ContainerMessageT, _ExtenderMessageT]): ... + +class _ExtensionDict(Generic[_ContainerMessageT]): + def __init__(self, extended_message: _ContainerMessageT) -> None: ... + # Dummy fallback overloads with FieldDescriptor are for backward compatibility with + # mypy-protobuf <= 1.23. We can drop them a few months after 1.24 releases. + @overload + def __getitem__( + self, extension_handle: _ExtensionFieldDescriptor[_ContainerMessageT, _ExtenderMessageT] + ) -> _ExtenderMessageT: ... + @overload + def __getitem__(self, extension_handle: FieldDescriptor) -> Any: ... + @overload + def __setitem__( + self, extension_handle: _ExtensionFieldDescriptor[_ContainerMessageT, _ExtenderMessageT], value: _ExtenderMessageT + ) -> None: ... + @overload + def __setitem__(self, extension_handle: FieldDescriptor, value: Any) -> None: ... + @overload + def __delitem__(self, extension_handle: _ExtensionFieldDescriptor[_ContainerMessageT, _ExtenderMessageT]) -> None: ... + @overload + def __delitem__(self, extension_handle: FieldDescriptor) -> None: ... + @overload + def __contains__(self, extension_handle: _ExtensionFieldDescriptor[_ContainerMessageT, _ExtenderMessageT]) -> bool: ... + @overload + def __contains__(self, extension_handle: FieldDescriptor) -> bool: ... + def __iter__(self) -> Iterator[_ExtensionFieldDescriptor[_ContainerMessageT, Any]]: ... + def __len__(self) -> int: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/message_listener.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/message_listener.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/python_message.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/python_message.pyi new file mode 100644 index 00000000..538d70b4 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/python_message.pyi @@ -0,0 +1 @@ +class GeneratedProtocolMessageType(type): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/well_known_types.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/well_known_types.pyi old mode 100755 new mode 100644 index fc0344f7..b8a64b31 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/well_known_types.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/well_known_types.pyi @@ -1,94 +1,94 @@ -from typing import Any, Optional -from datetime import datetime +from datetime import datetime, timedelta +from typing import Any as tAny, Dict, Optional, Text, Type class Error(Exception): ... class ParseError(Error): ... -# This is named 'Any' in the original, but that conflicts with typing.Any, -# and we really only need this file to mix in. -class Any_: - type_url: Any = ... - value: Any = ... - def Pack(self, msg: Any, type_url_prefix: bytes = ..., deterministic: Optional[Any] = ...) -> None: ... - def Unpack(self, msg: Any): ... +class Any: + type_url: tAny = ... + value: tAny = ... + def Pack(self, msg: tAny, type_url_prefix: bytes = ..., deterministic: Optional[tAny] = ...) -> None: ... + def Unpack(self, msg: tAny): ... def TypeName(self): ... - def Is(self, descriptor: Any): ... + def Is(self, descriptor: tAny): ... class Timestamp: def ToJsonString(self) -> str: ... - seconds: Any = ... - nanos: Any = ... - def FromJsonString(self, value: Any) -> None: ... + seconds: int = ... + nanos: int = ... + def FromJsonString(self, value: str) -> None: ... def GetCurrentTime(self) -> None: ... - def ToNanoseconds(self): ... - def ToMicroseconds(self): ... - def ToMilliseconds(self): ... - def ToSeconds(self): ... - def FromNanoseconds(self, nanos: Any) -> None: ... - def FromMicroseconds(self, micros: Any) -> None: ... - def FromMilliseconds(self, millis: Any) -> None: ... - def FromSeconds(self, seconds: Any) -> None: ... + def ToNanoseconds(self) -> int: ... + def ToMicroseconds(self) -> int: ... + def ToMilliseconds(self) -> int: ... + def ToSeconds(self) -> int: ... + def FromNanoseconds(self, nanos: int) -> None: ... + def FromMicroseconds(self, micros: int) -> None: ... + def FromMilliseconds(self, millis: int) -> None: ... + def FromSeconds(self, seconds: int) -> None: ... def ToDatetime(self) -> datetime: ... def FromDatetime(self, dt: datetime) -> None: ... class Duration: def ToJsonString(self) -> str: ... - seconds: Any = ... - nanos: Any = ... - def FromJsonString(self, value: Any) -> None: ... - def ToNanoseconds(self): ... - def ToMicroseconds(self): ... - def ToMilliseconds(self): ... - def ToSeconds(self): ... - def FromNanoseconds(self, nanos: Any) -> None: ... - def FromMicroseconds(self, micros: Any) -> None: ... - def FromMilliseconds(self, millis: Any) -> None: ... - def FromSeconds(self, seconds: Any) -> None: ... - def ToTimedelta(self): ... - def FromTimedelta(self, td: Any) -> None: ... + seconds: int = ... + nanos: int = ... + def FromJsonString(self, value: tAny) -> None: ... + def ToNanoseconds(self) -> int: ... + def ToMicroseconds(self) -> int: ... + def ToMilliseconds(self) -> int: ... + def ToSeconds(self) -> int: ... + def FromNanoseconds(self, nanos: int) -> None: ... + def FromMicroseconds(self, micros: int) -> None: ... + def FromMilliseconds(self, millis: int) -> None: ... + def FromSeconds(self, seconds: int) -> None: ... + def ToTimedelta(self) -> timedelta: ... + def FromTimedelta(self, td: timedelta) -> None: ... class FieldMask: def ToJsonString(self) -> str: ... - def FromJsonString(self, value: Any) -> None: ... - def IsValidForDescriptor(self, message_descriptor: Any): ... - def AllFieldsFromDescriptor(self, message_descriptor: Any) -> None: ... - def CanonicalFormFromMask(self, mask: Any) -> None: ... - def Union(self, mask1: Any, mask2: Any) -> None: ... - def Intersect(self, mask1: Any, mask2: Any) -> None: ... + def FromJsonString(self, value: tAny) -> None: ... + def IsValidForDescriptor(self, message_descriptor: tAny): ... + def AllFieldsFromDescriptor(self, message_descriptor: tAny) -> None: ... + def CanonicalFormFromMask(self, mask: tAny) -> None: ... + def Union(self, mask1: tAny, mask2: tAny) -> None: ... + def Intersect(self, mask1: tAny, mask2: tAny) -> None: ... def MergeMessage( - self, source: Any, destination: Any, replace_message_field: bool = ..., replace_repeated_field: bool = ... + self, source: tAny, destination: tAny, replace_message_field: bool = ..., replace_repeated_field: bool = ... ) -> None: ... class _FieldMaskTree: - def __init__(self, field_mask: Optional[Any] = ...) -> None: ... - def MergeFromFieldMask(self, field_mask: Any) -> None: ... - def AddPath(self, path: Any): ... - def ToFieldMask(self, field_mask: Any) -> None: ... - def IntersectPath(self, path: Any, intersection: Any): ... - def AddLeafNodes(self, prefix: Any, node: Any) -> None: ... - def MergeMessage(self, source: Any, destination: Any, replace_message: Any, replace_repeated: Any) -> None: ... + def __init__(self, field_mask: Optional[tAny] = ...) -> None: ... + def MergeFromFieldMask(self, field_mask: tAny) -> None: ... + def AddPath(self, path: tAny): ... + def ToFieldMask(self, field_mask: tAny) -> None: ... + def IntersectPath(self, path: tAny, intersection: tAny): ... + def AddLeafNodes(self, prefix: tAny, node: tAny) -> None: ... + def MergeMessage(self, source: tAny, destination: tAny, replace_message: tAny, replace_repeated: tAny) -> None: ... class Struct: - def __getitem__(self, key: Any): ... - def __contains__(self, item: Any): ... - def __setitem__(self, key: Any, value: Any) -> None: ... - def __delitem__(self, key: Any) -> None: ... + def __getitem__(self, key: tAny): ... + def __contains__(self, item: tAny): ... + def __setitem__(self, key: tAny, value: tAny) -> None: ... + def __delitem__(self, key: tAny) -> None: ... def __len__(self): ... def __iter__(self): ... def keys(self): ... def values(self): ... def items(self): ... - def get_or_create_list(self, key: Any): ... - def get_or_create_struct(self, key: Any): ... - def update(self, dictionary: Any) -> None: ... + def get_or_create_list(self, key: tAny): ... + def get_or_create_struct(self, key: tAny): ... + def update(self, dictionary: tAny) -> None: ... class ListValue: def __len__(self): ... - def append(self, value: Any) -> None: ... - def extend(self, elem_seq: Any) -> None: ... - def __getitem__(self, index: Any): ... - def __setitem__(self, index: Any, value: Any) -> None: ... - def __delitem__(self, key: Any) -> None: ... + def append(self, value: tAny) -> None: ... + def extend(self, elem_seq: tAny) -> None: ... + def __getitem__(self, index: tAny): ... + def __setitem__(self, index: tAny, value: tAny) -> None: ... + def __delitem__(self, key: tAny) -> None: ... def items(self) -> None: ... def add_struct(self): ... def add_list(self): ... + +WKTBASES: Dict[Text, Type] diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/wire_format.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/wire_format.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/json_format.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/json_format.pyi old mode 100755 new mode 100644 index 89024438..8ccc9057 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/json_format.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/json_format.pyi @@ -1,5 +1,5 @@ -import sys from typing import Any, Dict, Text, TypeVar, Union + from google.protobuf.message import Message _MessageVar = TypeVar("_MessageVar", bound=Message) diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/map_proto2_unittest_pb2.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/map_proto2_unittest_pb2.pyi deleted file mode 100755 index 71abad99..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/map_proto2_unittest_pb2.pyi +++ /dev/null @@ -1,198 +0,0 @@ -from google.protobuf.message import Message -from google.protobuf.unittest_import_pb2 import ImportEnumForMap -from typing import List, Mapping, MutableMapping, Optional, Text, Tuple, cast - -class Proto2MapEnum(int): - @classmethod - def Name(cls, number: int) -> bytes: ... - @classmethod - def Value(cls, name: bytes) -> Proto2MapEnum: ... - @classmethod - def keys(cls) -> List[bytes]: ... - @classmethod - def values(cls) -> List[Proto2MapEnum]: ... - @classmethod - def items(cls) -> List[Tuple[bytes, Proto2MapEnum]]: ... - -PROTO2_MAP_ENUM_FOO: Proto2MapEnum -PROTO2_MAP_ENUM_BAR: Proto2MapEnum -PROTO2_MAP_ENUM_BAZ: Proto2MapEnum - -class Proto2MapEnumPlusExtra(int): - @classmethod - def Name(cls, number: int) -> bytes: ... - @classmethod - def Value(cls, name: bytes) -> Proto2MapEnumPlusExtra: ... - @classmethod - def keys(cls) -> List[bytes]: ... - @classmethod - def values(cls) -> List[Proto2MapEnumPlusExtra]: ... - @classmethod - def items(cls) -> List[Tuple[bytes, Proto2MapEnumPlusExtra]]: ... - -E_PROTO2_MAP_ENUM_FOO: Proto2MapEnumPlusExtra -E_PROTO2_MAP_ENUM_BAR: Proto2MapEnumPlusExtra -E_PROTO2_MAP_ENUM_BAZ: Proto2MapEnumPlusExtra -E_PROTO2_MAP_ENUM_EXTRA: Proto2MapEnumPlusExtra - -class TestEnumMap(Message): - class KnownMapFieldEntry(Message): - key: int - value: Proto2MapEnum - def __init__(self, key: Optional[int] = ..., value: Optional[Proto2MapEnum] = ...) -> None: ... - class UnknownMapFieldEntry(Message): - key: int - value: Proto2MapEnum - def __init__(self, key: Optional[int] = ..., value: Optional[Proto2MapEnum] = ...) -> None: ... - @property - def known_map_field(self) -> MutableMapping[int, Proto2MapEnum]: ... - @property - def unknown_map_field(self) -> MutableMapping[int, Proto2MapEnum]: ... - def __init__( - self, - known_map_field: Optional[Mapping[int, Proto2MapEnum]] = ..., - unknown_map_field: Optional[Mapping[int, Proto2MapEnum]] = ..., - ) -> None: ... - -class TestEnumMapPlusExtra(Message): - class KnownMapFieldEntry(Message): - key: int - value: Proto2MapEnumPlusExtra - def __init__(self, key: Optional[int] = ..., value: Optional[Proto2MapEnumPlusExtra] = ...) -> None: ... - class UnknownMapFieldEntry(Message): - key: int - value: Proto2MapEnumPlusExtra - def __init__(self, key: Optional[int] = ..., value: Optional[Proto2MapEnumPlusExtra] = ...) -> None: ... - @property - def known_map_field(self) -> MutableMapping[int, Proto2MapEnumPlusExtra]: ... - @property - def unknown_map_field(self) -> MutableMapping[int, Proto2MapEnumPlusExtra]: ... - def __init__( - self, - known_map_field: Optional[Mapping[int, Proto2MapEnumPlusExtra]] = ..., - unknown_map_field: Optional[Mapping[int, Proto2MapEnumPlusExtra]] = ..., - ) -> None: ... - -class TestImportEnumMap(Message): - class ImportEnumAmpEntry(Message): - key: int - value: ImportEnumForMap - def __init__(self, key: Optional[int] = ..., value: Optional[ImportEnumForMap] = ...) -> None: ... - @property - def import_enum_amp(self) -> MutableMapping[int, ImportEnumForMap]: ... - def __init__(self, import_enum_amp: Optional[Mapping[int, ImportEnumForMap]] = ...) -> None: ... - -class TestIntIntMap(Message): - class MEntry(Message): - key: int - value: int - def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... - @property - def m(self) -> MutableMapping[int, int]: ... - def __init__(self, m: Optional[Mapping[int, int]] = ...) -> None: ... - -class TestMaps(Message): - class MInt32Entry(Message): - key: int - @property - def value(self) -> TestIntIntMap: ... - def __init__(self, key: Optional[int] = ..., value: Optional[TestIntIntMap] = ...) -> None: ... - class MInt64Entry(Message): - key: int - @property - def value(self) -> TestIntIntMap: ... - def __init__(self, key: Optional[int] = ..., value: Optional[TestIntIntMap] = ...) -> None: ... - class MUint32Entry(Message): - key: int - @property - def value(self) -> TestIntIntMap: ... - def __init__(self, key: Optional[int] = ..., value: Optional[TestIntIntMap] = ...) -> None: ... - class MUint64Entry(Message): - key: int - @property - def value(self) -> TestIntIntMap: ... - def __init__(self, key: Optional[int] = ..., value: Optional[TestIntIntMap] = ...) -> None: ... - class MSint32Entry(Message): - key: int - @property - def value(self) -> TestIntIntMap: ... - def __init__(self, key: Optional[int] = ..., value: Optional[TestIntIntMap] = ...) -> None: ... - class MSint64Entry(Message): - key: int - @property - def value(self) -> TestIntIntMap: ... - def __init__(self, key: Optional[int] = ..., value: Optional[TestIntIntMap] = ...) -> None: ... - class MFixed32Entry(Message): - key: int - @property - def value(self) -> TestIntIntMap: ... - def __init__(self, key: Optional[int] = ..., value: Optional[TestIntIntMap] = ...) -> None: ... - class MFixed64Entry(Message): - key: int - @property - def value(self) -> TestIntIntMap: ... - def __init__(self, key: Optional[int] = ..., value: Optional[TestIntIntMap] = ...) -> None: ... - class MSfixed32Entry(Message): - key: int - @property - def value(self) -> TestIntIntMap: ... - def __init__(self, key: Optional[int] = ..., value: Optional[TestIntIntMap] = ...) -> None: ... - class MSfixed64Entry(Message): - key: int - @property - def value(self) -> TestIntIntMap: ... - def __init__(self, key: Optional[int] = ..., value: Optional[TestIntIntMap] = ...) -> None: ... - class MBoolEntry(Message): - key: bool - @property - def value(self) -> TestIntIntMap: ... - def __init__(self, key: Optional[bool] = ..., value: Optional[TestIntIntMap] = ...) -> None: ... - class MStringEntry(Message): - key: Text - @property - def value(self) -> TestIntIntMap: ... - def __init__(self, key: Optional[Text] = ..., value: Optional[TestIntIntMap] = ...) -> None: ... - @property - def m_int32(self) -> MutableMapping[int, TestIntIntMap]: ... - @property - def m_int64(self) -> MutableMapping[int, TestIntIntMap]: ... - @property - def m_uint32(self) -> MutableMapping[int, TestIntIntMap]: ... - @property - def m_uint64(self) -> MutableMapping[int, TestIntIntMap]: ... - @property - def m_sint32(self) -> MutableMapping[int, TestIntIntMap]: ... - @property - def m_sint64(self) -> MutableMapping[int, TestIntIntMap]: ... - @property - def m_fixed32(self) -> MutableMapping[int, TestIntIntMap]: ... - @property - def m_fixed64(self) -> MutableMapping[int, TestIntIntMap]: ... - @property - def m_sfixed32(self) -> MutableMapping[int, TestIntIntMap]: ... - @property - def m_sfixed64(self) -> MutableMapping[int, TestIntIntMap]: ... - @property - def m_bool(self) -> MutableMapping[bool, TestIntIntMap]: ... - @property - def m_string(self) -> MutableMapping[Text, TestIntIntMap]: ... - def __init__( - self, - m_int32: Optional[Mapping[int, TestIntIntMap]] = ..., - m_int64: Optional[Mapping[int, TestIntIntMap]] = ..., - m_uint32: Optional[Mapping[int, TestIntIntMap]] = ..., - m_uint64: Optional[Mapping[int, TestIntIntMap]] = ..., - m_sint32: Optional[Mapping[int, TestIntIntMap]] = ..., - m_sint64: Optional[Mapping[int, TestIntIntMap]] = ..., - m_fixed32: Optional[Mapping[int, TestIntIntMap]] = ..., - m_fixed64: Optional[Mapping[int, TestIntIntMap]] = ..., - m_sfixed32: Optional[Mapping[int, TestIntIntMap]] = ..., - m_sfixed64: Optional[Mapping[int, TestIntIntMap]] = ..., - m_bool: Optional[Mapping[bool, TestIntIntMap]] = ..., - m_string: Optional[Mapping[Text, TestIntIntMap]] = ..., - ) -> None: ... - -class TestSubmessageMaps(Message): - @property - def m(self) -> TestMaps: ... - def __init__(self, m: Optional[TestMaps] = ...) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/map_unittest_pb2.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/map_unittest_pb2.pyi deleted file mode 100755 index e802bb76..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/map_unittest_pb2.pyi +++ /dev/null @@ -1,375 +0,0 @@ -from google.protobuf.message import Message -from google.protobuf.unittest_no_arena_pb2 import ForeignMessage -from google.protobuf.unittest_pb2 import ForeignMessage as ForeignMessage1, TestAllTypes, TestRequired -from typing import List, Mapping, MutableMapping, Optional, Text, Tuple, cast - -class MapEnum(int): - @classmethod - def Name(cls, number: int) -> bytes: ... - @classmethod - def Value(cls, name: bytes) -> MapEnum: ... - @classmethod - def keys(cls) -> List[bytes]: ... - @classmethod - def values(cls) -> List[MapEnum]: ... - @classmethod - def items(cls) -> List[Tuple[bytes, MapEnum]]: ... - -MAP_ENUM_FOO: MapEnum -MAP_ENUM_BAR: MapEnum -MAP_ENUM_BAZ: MapEnum - -class TestMap(Message): - class MapInt32Int32Entry(Message): - key: int - value: int - def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... - class MapInt64Int64Entry(Message): - key: int - value: int - def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... - class MapUint32Uint32Entry(Message): - key: int - value: int - def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... - class MapUint64Uint64Entry(Message): - key: int - value: int - def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... - class MapSint32Sint32Entry(Message): - key: int - value: int - def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... - class MapSint64Sint64Entry(Message): - key: int - value: int - def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... - class MapFixed32Fixed32Entry(Message): - key: int - value: int - def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... - class MapFixed64Fixed64Entry(Message): - key: int - value: int - def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... - class MapSfixed32Sfixed32Entry(Message): - key: int - value: int - def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... - class MapSfixed64Sfixed64Entry(Message): - key: int - value: int - def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... - class MapInt32FloatEntry(Message): - key: int - value: float - def __init__(self, key: Optional[int] = ..., value: Optional[float] = ...) -> None: ... - class MapInt32DoubleEntry(Message): - key: int - value: float - def __init__(self, key: Optional[int] = ..., value: Optional[float] = ...) -> None: ... - class MapBoolBoolEntry(Message): - key: bool - value: bool - def __init__(self, key: Optional[bool] = ..., value: Optional[bool] = ...) -> None: ... - class MapStringStringEntry(Message): - key: Text - value: Text - def __init__(self, key: Optional[Text] = ..., value: Optional[Text] = ...) -> None: ... - class MapInt32BytesEntry(Message): - key: int - value: bytes - def __init__(self, key: Optional[int] = ..., value: Optional[bytes] = ...) -> None: ... - class MapInt32EnumEntry(Message): - key: int - value: MapEnum - def __init__(self, key: Optional[int] = ..., value: Optional[MapEnum] = ...) -> None: ... - class MapInt32ForeignMessageEntry(Message): - key: int - @property - def value(self) -> ForeignMessage1: ... - def __init__(self, key: Optional[int] = ..., value: Optional[ForeignMessage1] = ...) -> None: ... - class MapStringForeignMessageEntry(Message): - key: Text - @property - def value(self) -> ForeignMessage1: ... - def __init__(self, key: Optional[Text] = ..., value: Optional[ForeignMessage1] = ...) -> None: ... - class MapInt32AllTypesEntry(Message): - key: int - @property - def value(self) -> TestAllTypes: ... - def __init__(self, key: Optional[int] = ..., value: Optional[TestAllTypes] = ...) -> None: ... - @property - def map_int32_int32(self) -> MutableMapping[int, int]: ... - @property - def map_int64_int64(self) -> MutableMapping[int, int]: ... - @property - def map_uint32_uint32(self) -> MutableMapping[int, int]: ... - @property - def map_uint64_uint64(self) -> MutableMapping[int, int]: ... - @property - def map_sint32_sint32(self) -> MutableMapping[int, int]: ... - @property - def map_sint64_sint64(self) -> MutableMapping[int, int]: ... - @property - def map_fixed32_fixed32(self) -> MutableMapping[int, int]: ... - @property - def map_fixed64_fixed64(self) -> MutableMapping[int, int]: ... - @property - def map_sfixed32_sfixed32(self) -> MutableMapping[int, int]: ... - @property - def map_sfixed64_sfixed64(self) -> MutableMapping[int, int]: ... - @property - def map_int32_float(self) -> MutableMapping[int, float]: ... - @property - def map_int32_double(self) -> MutableMapping[int, float]: ... - @property - def map_bool_bool(self) -> MutableMapping[bool, bool]: ... - @property - def map_string_string(self) -> MutableMapping[Text, Text]: ... - @property - def map_int32_bytes(self) -> MutableMapping[int, bytes]: ... - @property - def map_int32_enum(self) -> MutableMapping[int, MapEnum]: ... - @property - def map_int32_foreign_message(self) -> MutableMapping[int, ForeignMessage1]: ... - @property - def map_string_foreign_message(self) -> MutableMapping[Text, ForeignMessage1]: ... - @property - def map_int32_all_types(self) -> MutableMapping[int, TestAllTypes]: ... - def __init__( - self, - map_int32_int32: Optional[Mapping[int, int]] = ..., - map_int64_int64: Optional[Mapping[int, int]] = ..., - map_uint32_uint32: Optional[Mapping[int, int]] = ..., - map_uint64_uint64: Optional[Mapping[int, int]] = ..., - map_sint32_sint32: Optional[Mapping[int, int]] = ..., - map_sint64_sint64: Optional[Mapping[int, int]] = ..., - map_fixed32_fixed32: Optional[Mapping[int, int]] = ..., - map_fixed64_fixed64: Optional[Mapping[int, int]] = ..., - map_sfixed32_sfixed32: Optional[Mapping[int, int]] = ..., - map_sfixed64_sfixed64: Optional[Mapping[int, int]] = ..., - map_int32_float: Optional[Mapping[int, float]] = ..., - map_int32_double: Optional[Mapping[int, float]] = ..., - map_bool_bool: Optional[Mapping[bool, bool]] = ..., - map_string_string: Optional[Mapping[Text, Text]] = ..., - map_int32_bytes: Optional[Mapping[int, bytes]] = ..., - map_int32_enum: Optional[Mapping[int, MapEnum]] = ..., - map_int32_foreign_message: Optional[Mapping[int, ForeignMessage1]] = ..., - map_string_foreign_message: Optional[Mapping[Text, ForeignMessage1]] = ..., - map_int32_all_types: Optional[Mapping[int, TestAllTypes]] = ..., - ) -> None: ... - -class TestMapSubmessage(Message): - @property - def test_map(self) -> TestMap: ... - def __init__(self, test_map: Optional[TestMap] = ...) -> None: ... - -class TestMessageMap(Message): - class MapInt32MessageEntry(Message): - key: int - @property - def value(self) -> TestAllTypes: ... - def __init__(self, key: Optional[int] = ..., value: Optional[TestAllTypes] = ...) -> None: ... - @property - def map_int32_message(self) -> MutableMapping[int, TestAllTypes]: ... - def __init__(self, map_int32_message: Optional[Mapping[int, TestAllTypes]] = ...) -> None: ... - -class TestSameTypeMap(Message): - class Map1Entry(Message): - key: int - value: int - def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... - class Map2Entry(Message): - key: int - value: int - def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... - @property - def map1(self) -> MutableMapping[int, int]: ... - @property - def map2(self) -> MutableMapping[int, int]: ... - def __init__(self, map1: Optional[Mapping[int, int]] = ..., map2: Optional[Mapping[int, int]] = ...) -> None: ... - -class TestRequiredMessageMap(Message): - class MapFieldEntry(Message): - key: int - @property - def value(self) -> TestRequired: ... - def __init__(self, key: Optional[int] = ..., value: Optional[TestRequired] = ...) -> None: ... - @property - def map_field(self) -> MutableMapping[int, TestRequired]: ... - def __init__(self, map_field: Optional[Mapping[int, TestRequired]] = ...) -> None: ... - -class TestArenaMap(Message): - class MapInt32Int32Entry(Message): - key: int - value: int - def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... - class MapInt64Int64Entry(Message): - key: int - value: int - def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... - class MapUint32Uint32Entry(Message): - key: int - value: int - def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... - class MapUint64Uint64Entry(Message): - key: int - value: int - def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... - class MapSint32Sint32Entry(Message): - key: int - value: int - def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... - class MapSint64Sint64Entry(Message): - key: int - value: int - def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... - class MapFixed32Fixed32Entry(Message): - key: int - value: int - def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... - class MapFixed64Fixed64Entry(Message): - key: int - value: int - def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... - class MapSfixed32Sfixed32Entry(Message): - key: int - value: int - def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... - class MapSfixed64Sfixed64Entry(Message): - key: int - value: int - def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... - class MapInt32FloatEntry(Message): - key: int - value: float - def __init__(self, key: Optional[int] = ..., value: Optional[float] = ...) -> None: ... - class MapInt32DoubleEntry(Message): - key: int - value: float - def __init__(self, key: Optional[int] = ..., value: Optional[float] = ...) -> None: ... - class MapBoolBoolEntry(Message): - key: bool - value: bool - def __init__(self, key: Optional[bool] = ..., value: Optional[bool] = ...) -> None: ... - class MapStringStringEntry(Message): - key: Text - value: Text - def __init__(self, key: Optional[Text] = ..., value: Optional[Text] = ...) -> None: ... - class MapInt32BytesEntry(Message): - key: int - value: bytes - def __init__(self, key: Optional[int] = ..., value: Optional[bytes] = ...) -> None: ... - class MapInt32EnumEntry(Message): - key: int - value: MapEnum - def __init__(self, key: Optional[int] = ..., value: Optional[MapEnum] = ...) -> None: ... - class MapInt32ForeignMessageEntry(Message): - key: int - @property - def value(self) -> ForeignMessage1: ... - def __init__(self, key: Optional[int] = ..., value: Optional[ForeignMessage1] = ...) -> None: ... - class MapInt32ForeignMessageNoArenaEntry(Message): - key: int - @property - def value(self) -> ForeignMessage: ... - def __init__(self, key: Optional[int] = ..., value: Optional[ForeignMessage] = ...) -> None: ... - @property - def map_int32_int32(self) -> MutableMapping[int, int]: ... - @property - def map_int64_int64(self) -> MutableMapping[int, int]: ... - @property - def map_uint32_uint32(self) -> MutableMapping[int, int]: ... - @property - def map_uint64_uint64(self) -> MutableMapping[int, int]: ... - @property - def map_sint32_sint32(self) -> MutableMapping[int, int]: ... - @property - def map_sint64_sint64(self) -> MutableMapping[int, int]: ... - @property - def map_fixed32_fixed32(self) -> MutableMapping[int, int]: ... - @property - def map_fixed64_fixed64(self) -> MutableMapping[int, int]: ... - @property - def map_sfixed32_sfixed32(self) -> MutableMapping[int, int]: ... - @property - def map_sfixed64_sfixed64(self) -> MutableMapping[int, int]: ... - @property - def map_int32_float(self) -> MutableMapping[int, float]: ... - @property - def map_int32_double(self) -> MutableMapping[int, float]: ... - @property - def map_bool_bool(self) -> MutableMapping[bool, bool]: ... - @property - def map_string_string(self) -> MutableMapping[Text, Text]: ... - @property - def map_int32_bytes(self) -> MutableMapping[int, bytes]: ... - @property - def map_int32_enum(self) -> MutableMapping[int, MapEnum]: ... - @property - def map_int32_foreign_message(self) -> MutableMapping[int, ForeignMessage1]: ... - @property - def map_int32_foreign_message_no_arena(self) -> MutableMapping[int, ForeignMessage]: ... - def __init__( - self, - map_int32_int32: Optional[Mapping[int, int]] = ..., - map_int64_int64: Optional[Mapping[int, int]] = ..., - map_uint32_uint32: Optional[Mapping[int, int]] = ..., - map_uint64_uint64: Optional[Mapping[int, int]] = ..., - map_sint32_sint32: Optional[Mapping[int, int]] = ..., - map_sint64_sint64: Optional[Mapping[int, int]] = ..., - map_fixed32_fixed32: Optional[Mapping[int, int]] = ..., - map_fixed64_fixed64: Optional[Mapping[int, int]] = ..., - map_sfixed32_sfixed32: Optional[Mapping[int, int]] = ..., - map_sfixed64_sfixed64: Optional[Mapping[int, int]] = ..., - map_int32_float: Optional[Mapping[int, float]] = ..., - map_int32_double: Optional[Mapping[int, float]] = ..., - map_bool_bool: Optional[Mapping[bool, bool]] = ..., - map_string_string: Optional[Mapping[Text, Text]] = ..., - map_int32_bytes: Optional[Mapping[int, bytes]] = ..., - map_int32_enum: Optional[Mapping[int, MapEnum]] = ..., - map_int32_foreign_message: Optional[Mapping[int, ForeignMessage1]] = ..., - map_int32_foreign_message_no_arena: Optional[Mapping[int, ForeignMessage]] = ..., - ) -> None: ... - -class MessageContainingEnumCalledType(Message): - class Type(int): - @classmethod - def Name(cls, number: int) -> bytes: ... - @classmethod - def Value(cls, name: bytes) -> MessageContainingEnumCalledType.Type: ... - @classmethod - def keys(cls) -> List[bytes]: ... - @classmethod - def values(cls) -> List[MessageContainingEnumCalledType.Type]: ... - @classmethod - def items(cls) -> List[Tuple[bytes, MessageContainingEnumCalledType.Type]]: ... - TYPE_FOO: MessageContainingEnumCalledType.Type - class TypeEntry(Message): - key: Text - @property - def value(self) -> MessageContainingEnumCalledType: ... - def __init__(self, key: Optional[Text] = ..., value: Optional[MessageContainingEnumCalledType] = ...) -> None: ... - @property - def type(self) -> MutableMapping[Text, MessageContainingEnumCalledType]: ... - def __init__(self, type: Optional[Mapping[Text, MessageContainingEnumCalledType]] = ...) -> None: ... - -class MessageContainingMapCalledEntry(Message): - class EntryEntry(Message): - key: int - value: int - def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... - @property - def entry(self) -> MutableMapping[int, int]: ... - def __init__(self, entry: Optional[Mapping[int, int]] = ...) -> None: ... - -class TestRecursiveMapMessage(Message): - class AEntry(Message): - key: Text - @property - def value(self) -> TestRecursiveMapMessage: ... - def __init__(self, key: Optional[Text] = ..., value: Optional[TestRecursiveMapMessage] = ...) -> None: ... - @property - def a(self) -> MutableMapping[Text, TestRecursiveMapMessage]: ... - def __init__(self, a: Optional[Mapping[Text, TestRecursiveMapMessage]] = ...) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/message.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/message.pyi old mode 100755 new mode 100644 index 215fb2b4..177602be --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/message.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/message.pyi @@ -1,46 +1,50 @@ import sys +from typing import Any, ByteString, Sequence, Tuple, Type, TypeVar, Union, overload -from typing import Any, Sequence, Optional, Tuple, Type, TypeVar, Union - -from .descriptor import DescriptorBase, FieldDescriptor +from .descriptor import Descriptor, FieldDescriptor +from .internal.extension_dict import _ExtensionDict, _ExtensionFieldDescriptor class Error(Exception): ... class DecodeError(Error): ... class EncodeError(Error): ... -class _ExtensionDict: - def __getitem__(self, extension_handle: DescriptorBase) -> Any: ... - def __setitem__(self, extension_handle: DescriptorBase, value: Any) -> None: ... - -_T = TypeVar("_T") +_M = TypeVar("_M", bound=Message) # message type (of self) if sys.version_info < (3,): _Serialized = Union[bytes, buffer, unicode] else: - _Serialized = bytes + _Serialized = ByteString class Message: - DESCRIPTOR: Any + DESCRIPTOR: Descriptor def __deepcopy__(self, memo=...): ... def __eq__(self, other_msg): ... def __ne__(self, other_msg): ... - def MergeFrom(self, other_msg: Message) -> None: ... - def CopyFrom(self, other_msg: Message) -> None: ... + def MergeFrom(self: _M, other_msg: _M) -> None: ... + def CopyFrom(self: _M, other_msg: _M) -> None: ... def Clear(self) -> None: ... def SetInParent(self) -> None: ... def IsInitialized(self) -> bool: ... def MergeFromString(self, serialized: _Serialized) -> int: ... - def ParseFromString(self, serialized: _Serialized) -> None: ... + def ParseFromString(self, serialized: _Serialized) -> int: ... def SerializeToString(self, deterministic: bool = ...) -> bytes: ... def SerializePartialToString(self, deterministic: bool = ...) -> bytes: ... def ListFields(self) -> Sequence[Tuple[FieldDescriptor, Any]]: ... - def HasExtension(self, extension_handle): ... - def ClearExtension(self, extension_handle): ... + # Dummy fallback overloads with FieldDescriptor are for backward compatibility with + # mypy-protobuf <= 1.23. We can drop them a few months after 1.24 releases. + @overload + def HasExtension(self: _M, extension_handle: _ExtensionFieldDescriptor[_M, Any]) -> bool: ... + @overload + def HasExtension(self, extension_handle: FieldDescriptor) -> bool: ... + @overload + def ClearExtension(self: _M, extension_handle: _ExtensionFieldDescriptor[_M, Any]) -> None: ... + @overload + def ClearExtension(self, extension_handle: FieldDescriptor) -> None: ... def ByteSize(self) -> int: ... @classmethod - def FromString(cls: Type[_T], s: _Serialized) -> _T: ... + def FromString(cls: Type[_M], s: _Serialized) -> _M: ... @property - def Extensions(self) -> _ExtensionDict: ... + def Extensions(self: _M) -> _ExtensionDict[_M]: ... # Intentionally left out typing on these three methods, because they are # stringly typed and it is not useful to call them on a Message directly. # We prefer more specific typing on individual subclasses of Message diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/message_factory.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/message_factory.pyi old mode 100755 new mode 100644 index ad31e22f..d8a42d30 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/message_factory.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/message_factory.pyi @@ -1,13 +1,14 @@ from typing import Any, Dict, Iterable, Optional, Type -from .message import Message -from .descriptor import Descriptor -from .descriptor_pool import DescriptorPool +from google.protobuf.descriptor import Descriptor +from google.protobuf.descriptor_pb2 import FileDescriptorProto +from google.protobuf.descriptor_pool import DescriptorPool +from google.protobuf.message import Message class MessageFactory: pool: Any def __init__(self, pool: Optional[DescriptorPool] = ...) -> None: ... def GetPrototype(self, descriptor: Descriptor) -> Type[Message]: ... - def GetMessages(self, files: Iterable[bytes]) -> Dict[bytes, Type[Message]]: ... + def GetMessages(self, files: Iterable[str]) -> Dict[str, Type[Message]]: ... -def GetMessages(file_protos: Iterable[bytes]) -> Dict[bytes, Type[Message]]: ... +def GetMessages(file_protos: Iterable[FileDescriptorProto]) -> Dict[str, Type[Message]]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/reflection.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/reflection.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/service.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/service.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/source_context_pb2.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/source_context_pb2.pyi old mode 100755 new mode 100644 index 5d5cc8b7..4f78be6a --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/source_context_pb2.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/source_context_pb2.pyi @@ -1,6 +1,41 @@ -from google.protobuf.message import Message -from typing import Optional, Text +""" +@generated by mypy-protobuf. Do not edit manually! +isort:skip_file +""" +from google.protobuf.descriptor import ( + Descriptor as google___protobuf___descriptor___Descriptor, + FileDescriptor as google___protobuf___descriptor___FileDescriptor, +) -class SourceContext(Message): - file_name: Text - def __init__(self, file_name: Optional[Text] = ...) -> None: ... +from google.protobuf.message import ( + Message as google___protobuf___message___Message, +) + +from typing import ( + Optional as typing___Optional, + Text as typing___Text, +) + +from typing_extensions import ( + Literal as typing_extensions___Literal, +) + + +builtin___bool = bool +builtin___bytes = bytes +builtin___float = float +builtin___int = int + + +DESCRIPTOR: google___protobuf___descriptor___FileDescriptor = ... + +class SourceContext(google___protobuf___message___Message): + DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... + file_name: typing___Text = ... + + def __init__(self, + *, + file_name : typing___Optional[typing___Text] = None, + ) -> None: ... + def ClearField(self, field_name: typing_extensions___Literal[u"file_name",b"file_name"]) -> None: ... +type___SourceContext = SourceContext diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/struct_pb2.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/struct_pb2.pyi old mode 100755 new mode 100644 index 18a67215..57028561 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/struct_pb2.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/struct_pb2.pyi @@ -1,55 +1,126 @@ -from google.protobuf.internal.containers import RepeatedCompositeFieldContainer -from google.protobuf.internal import well_known_types - -from google.protobuf.message import Message -from typing import Iterable, List, Mapping, MutableMapping, Optional, Text, Tuple, cast - -class NullValue(int): - @classmethod - def Name(cls, number: int) -> bytes: ... - @classmethod - def Value(cls, name: bytes) -> NullValue: ... - @classmethod - def keys(cls) -> List[bytes]: ... - @classmethod - def values(cls) -> List[NullValue]: ... - @classmethod - def items(cls) -> List[Tuple[bytes, NullValue]]: ... - -NULL_VALUE: NullValue - -class Struct(Message, well_known_types.Struct): - class FieldsEntry(Message): - key: Text +""" +@generated by mypy-protobuf. Do not edit manually! +isort:skip_file +""" +from google.protobuf.descriptor import ( + Descriptor as google___protobuf___descriptor___Descriptor, + EnumDescriptor as google___protobuf___descriptor___EnumDescriptor, + FileDescriptor as google___protobuf___descriptor___FileDescriptor, +) + +from google.protobuf.internal.containers import ( + MessageMap as google___protobuf___internal___containers___MessageMap, + RepeatedCompositeFieldContainer as google___protobuf___internal___containers___RepeatedCompositeFieldContainer, +) + +from google.protobuf.internal.enum_type_wrapper import ( + _EnumTypeWrapper as google___protobuf___internal___enum_type_wrapper____EnumTypeWrapper, +) + +from google.protobuf.internal.well_known_types import ( + ListValue as google___protobuf___internal___well_known_types___ListValue, + Struct as google___protobuf___internal___well_known_types___Struct, +) + +from google.protobuf.message import ( + Message as google___protobuf___message___Message, +) + +from typing import ( + Iterable as typing___Iterable, + Mapping as typing___Mapping, + NewType as typing___NewType, + Optional as typing___Optional, + Text as typing___Text, + cast as typing___cast, +) + +from typing_extensions import ( + Literal as typing_extensions___Literal, +) + + +builtin___bool = bool +builtin___bytes = bytes +builtin___float = float +builtin___int = int + + +DESCRIPTOR: google___protobuf___descriptor___FileDescriptor = ... + +NullValueValue = typing___NewType('NullValueValue', builtin___int) +type___NullValueValue = NullValueValue +NullValue: _NullValue +class _NullValue(google___protobuf___internal___enum_type_wrapper____EnumTypeWrapper[NullValueValue]): + DESCRIPTOR: google___protobuf___descriptor___EnumDescriptor = ... + NULL_VALUE = typing___cast(NullValueValue, 0) +NULL_VALUE = typing___cast(NullValueValue, 0) + +class Struct(google___protobuf___message___Message, google___protobuf___internal___well_known_types___Struct): + DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... + class FieldsEntry(google___protobuf___message___Message): + DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... + key: typing___Text = ... + @property - def value(self) -> Value: ... - def __init__(self, key: Optional[Text] = ..., value: Optional[Value] = ...) -> None: ... + def value(self) -> type___Value: ... + + def __init__(self, + *, + key : typing___Optional[typing___Text] = None, + value : typing___Optional[type___Value] = None, + ) -> None: ... + def HasField(self, field_name: typing_extensions___Literal[u"value",b"value"]) -> builtin___bool: ... + def ClearField(self, field_name: typing_extensions___Literal[u"key",b"key",u"value",b"value"]) -> None: ... + type___FieldsEntry = FieldsEntry + + @property - def fields(self) -> MutableMapping[Text, Value]: ... - def __init__(self, fields: Optional[Mapping[Text, Value]] = ...) -> None: ... - -class _Value(Message): - null_value: NullValue - number_value: float - string_value: Text - bool_value: bool + def fields(self) -> google___protobuf___internal___containers___MessageMap[typing___Text, type___Value]: ... + + def __init__(self, + *, + fields : typing___Optional[typing___Mapping[typing___Text, type___Value]] = None, + ) -> None: ... + def ClearField(self, field_name: typing_extensions___Literal[u"fields",b"fields"]) -> None: ... +type___Struct = Struct + +class Value(google___protobuf___message___Message): + DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... + null_value: type___NullValueValue = ... + number_value: builtin___float = ... + string_value: typing___Text = ... + bool_value: builtin___bool = ... + @property - def struct_value(self) -> Struct: ... + def struct_value(self) -> type___Struct: ... + @property - def list_value(self) -> ListValue: ... - def __init__( - self, - null_value: Optional[NullValue] = ..., - number_value: Optional[float] = ..., - string_value: Optional[Text] = ..., - bool_value: Optional[bool] = ..., - struct_value: Optional[Struct] = ..., - list_value: Optional[ListValue] = ..., - ) -> None: ... - -Value = _Value - -class ListValue(Message, well_known_types.ListValue): + def list_value(self) -> type___ListValue: ... + + def __init__(self, + *, + null_value : typing___Optional[type___NullValueValue] = None, + number_value : typing___Optional[builtin___float] = None, + string_value : typing___Optional[typing___Text] = None, + bool_value : typing___Optional[builtin___bool] = None, + struct_value : typing___Optional[type___Struct] = None, + list_value : typing___Optional[type___ListValue] = None, + ) -> None: ... + def HasField(self, field_name: typing_extensions___Literal[u"bool_value",b"bool_value",u"kind",b"kind",u"list_value",b"list_value",u"null_value",b"null_value",u"number_value",b"number_value",u"string_value",b"string_value",u"struct_value",b"struct_value"]) -> builtin___bool: ... + def ClearField(self, field_name: typing_extensions___Literal[u"bool_value",b"bool_value",u"kind",b"kind",u"list_value",b"list_value",u"null_value",b"null_value",u"number_value",b"number_value",u"string_value",b"string_value",u"struct_value",b"struct_value"]) -> None: ... + def WhichOneof(self, oneof_group: typing_extensions___Literal[u"kind",b"kind"]) -> typing_extensions___Literal["null_value","number_value","string_value","bool_value","struct_value","list_value"]: ... +type___Value = Value + +class ListValue(google___protobuf___message___Message, google___protobuf___internal___well_known_types___ListValue): + DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... + @property - def values(self) -> RepeatedCompositeFieldContainer[Value]: ... - def __init__(self, values: Optional[Iterable[Value]] = ...) -> None: ... + def values(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[type___Value]: ... + + def __init__(self, + *, + values : typing___Optional[typing___Iterable[type___Value]] = None, + ) -> None: ... + def ClearField(self, field_name: typing_extensions___Literal[u"values",b"values"]) -> None: ... +type___ListValue = ListValue diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/symbol_database.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/symbol_database.pyi old mode 100755 new mode 100644 index 477d80e9..09e32e9d --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/symbol_database.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/symbol_database.pyi @@ -1,14 +1,16 @@ -from typing import Dict, Iterable, Type +from typing import Dict, Iterable, Type, Union -from .descriptor import EnumDescriptor, FileDescriptor -from .message import Message -from .message_factory import MessageFactory +from google.protobuf.descriptor import Descriptor, EnumDescriptor, FileDescriptor, ServiceDescriptor +from google.protobuf.message import Message +from google.protobuf.message_factory import MessageFactory class SymbolDatabase(MessageFactory): - def RegisterMessage(self, message: Type[Message]) -> Type[Message]: ... - def RegisterEnumDescriptor(self, enum_descriptor: Type[EnumDescriptor]) -> EnumDescriptor: ... - def RegisterFileDescriptor(self, file_descriptor: Type[FileDescriptor]) -> FileDescriptor: ... - def GetSymbol(self, symbol: bytes) -> Type[Message]: ... - def GetMessages(self, files: Iterable[bytes]) -> Dict[bytes, Type[Message]]: ... + def RegisterMessage(self, message: Union[Type[Message], Message]) -> Union[Type[Message], Message]: ... + def RegisterMessageDescriptor(self, message_descriptor: Descriptor) -> None: ... + def RegisterEnumDescriptor(self, enum_descriptor: EnumDescriptor) -> EnumDescriptor: ... + def RegisterServiceDescriptor(self, service_descriptor: ServiceDescriptor) -> None: ... + def RegisterFileDescriptor(self, file_descriptor: FileDescriptor) -> None: ... + def GetSymbol(self, symbol: str) -> Type[Message]: ... + def GetMessages(self, files: Iterable[str]) -> Dict[str, Type[Message]]: ... def Default(): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/test_messages_proto2_pb2.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/test_messages_proto2_pb2.pyi deleted file mode 100755 index 1795f81d..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/test_messages_proto2_pb2.pyi +++ /dev/null @@ -1,345 +0,0 @@ -from google.protobuf.internal.containers import RepeatedCompositeFieldContainer, RepeatedScalarFieldContainer -from google.protobuf.message import Message -import builtins -from typing import Iterable, List, Mapping, MutableMapping, Optional, Text, Tuple, cast - -class ForeignEnumProto2(int): - @classmethod - def Name(cls, number: int) -> bytes: ... - @classmethod - def Value(cls, name: bytes) -> ForeignEnumProto2: ... - @classmethod - def keys(cls) -> List[bytes]: ... - @classmethod - def values(cls) -> List[ForeignEnumProto2]: ... - @classmethod - def items(cls) -> List[Tuple[bytes, ForeignEnumProto2]]: ... - -FOREIGN_FOO: ForeignEnumProto2 -FOREIGN_BAR: ForeignEnumProto2 -FOREIGN_BAZ: ForeignEnumProto2 - -class TestAllTypesProto2(Message): - class NestedEnum(int): - @classmethod - def Name(cls, number: int) -> bytes: ... - @classmethod - def Value(cls, name: bytes) -> TestAllTypesProto2.NestedEnum: ... - @classmethod - def keys(cls) -> List[bytes]: ... - @classmethod - def values(cls) -> List[TestAllTypesProto2.NestedEnum]: ... - @classmethod - def items(cls) -> List[Tuple[bytes, TestAllTypesProto2.NestedEnum]]: ... - FOO: TestAllTypesProto2.NestedEnum - BAR: TestAllTypesProto2.NestedEnum - BAZ: TestAllTypesProto2.NestedEnum - NEG: TestAllTypesProto2.NestedEnum - class NestedMessage(Message): - a: int - @property - def corecursive(self) -> TestAllTypesProto2: ... - def __init__(self, a: Optional[int] = ..., corecursive: Optional[TestAllTypesProto2] = ...) -> None: ... - class MapInt32Int32Entry(Message): - key: int - value: int - def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... - class MapInt64Int64Entry(Message): - key: int - value: int - def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... - class MapUint32Uint32Entry(Message): - key: int - value: int - def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... - class MapUint64Uint64Entry(Message): - key: int - value: int - def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... - class MapSint32Sint32Entry(Message): - key: int - value: int - def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... - class MapSint64Sint64Entry(Message): - key: int - value: int - def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... - class MapFixed32Fixed32Entry(Message): - key: int - value: int - def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... - class MapFixed64Fixed64Entry(Message): - key: int - value: int - def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... - class MapSfixed32Sfixed32Entry(Message): - key: int - value: int - def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... - class MapSfixed64Sfixed64Entry(Message): - key: int - value: int - def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... - class MapInt32FloatEntry(Message): - key: int - value: float - def __init__(self, key: Optional[int] = ..., value: Optional[float] = ...) -> None: ... - class MapInt32DoubleEntry(Message): - key: int - value: float - def __init__(self, key: Optional[int] = ..., value: Optional[float] = ...) -> None: ... - class MapBoolBoolEntry(Message): - key: bool - value: bool - def __init__(self, key: Optional[bool] = ..., value: Optional[bool] = ...) -> None: ... - class MapStringStringEntry(Message): - key: Text - value: Text - def __init__(self, key: Optional[Text] = ..., value: Optional[Text] = ...) -> None: ... - class MapStringBytesEntry(Message): - key: Text - value: bytes - def __init__(self, key: Optional[Text] = ..., value: Optional[bytes] = ...) -> None: ... - class MapStringNestedMessageEntry(Message): - key: Text - @property - def value(self) -> TestAllTypesProto2.NestedMessage: ... - def __init__(self, key: Optional[Text] = ..., value: Optional[TestAllTypesProto2.NestedMessage] = ...) -> None: ... - class MapStringForeignMessageEntry(Message): - key: Text - @property - def value(self) -> ForeignMessageProto2: ... - def __init__(self, key: Optional[Text] = ..., value: Optional[ForeignMessageProto2] = ...) -> None: ... - class MapStringNestedEnumEntry(Message): - key: Text - value: TestAllTypesProto2.NestedEnum - def __init__(self, key: Optional[Text] = ..., value: Optional[TestAllTypesProto2.NestedEnum] = ...) -> None: ... - class MapStringForeignEnumEntry(Message): - key: Text - value: ForeignEnumProto2 - def __init__(self, key: Optional[Text] = ..., value: Optional[ForeignEnumProto2] = ...) -> None: ... - class Data(Message): - group_int32: int - group_uint32: int - def __init__(self, group_int32: Optional[int] = ..., group_uint32: Optional[int] = ...) -> None: ... - class MessageSetCorrect(Message): - def __init__(self,) -> None: ... - class MessageSetCorrectExtension1(Message): - bytes: Text - def __init__(self, bytes: Optional[Text] = ...) -> None: ... - class MessageSetCorrectExtension2(Message): - i: int - def __init__(self, i: Optional[int] = ...) -> None: ... - optional_int32: int - optional_int64: int - optional_uint32: int - optional_uint64: int - optional_sint32: int - optional_sint64: int - optional_fixed32: int - optional_fixed64: int - optional_sfixed32: int - optional_sfixed64: int - optional_float: float - optional_double: float - optional_bool: bool - optional_string: Text - optional_bytes: bytes - optional_nested_enum: TestAllTypesProto2.NestedEnum - optional_foreign_enum: ForeignEnumProto2 - optional_string_piece: Text - optional_cord: Text - repeated_int32: RepeatedScalarFieldContainer[int] - repeated_int64: RepeatedScalarFieldContainer[int] - repeated_uint32: RepeatedScalarFieldContainer[int] - repeated_uint64: RepeatedScalarFieldContainer[int] - repeated_sint32: RepeatedScalarFieldContainer[int] - repeated_sint64: RepeatedScalarFieldContainer[int] - repeated_fixed32: RepeatedScalarFieldContainer[int] - repeated_fixed64: RepeatedScalarFieldContainer[int] - repeated_sfixed32: RepeatedScalarFieldContainer[int] - repeated_sfixed64: RepeatedScalarFieldContainer[int] - repeated_float: RepeatedScalarFieldContainer[float] - repeated_double: RepeatedScalarFieldContainer[float] - repeated_bool: RepeatedScalarFieldContainer[bool] - repeated_string: RepeatedScalarFieldContainer[Text] - repeated_bytes: RepeatedScalarFieldContainer[bytes] - repeated_nested_enum: RepeatedScalarFieldContainer[TestAllTypesProto2.NestedEnum] - repeated_foreign_enum: RepeatedScalarFieldContainer[ForeignEnumProto2] - repeated_string_piece: RepeatedScalarFieldContainer[Text] - repeated_cord: RepeatedScalarFieldContainer[Text] - oneof_uint32: int - oneof_string: Text - oneof_bytes: bytes - oneof_bool: bool - oneof_uint64: int - oneof_float: float - oneof_double: float - oneof_enum: TestAllTypesProto2.NestedEnum - fieldname1: int - field_name2: int - _field_name3: int - field__name4_: int - field0name5: int - field_0_name6: int - fieldName7: int - FieldName8: int - field_Name9: int - Field_Name10: int - FIELD_NAME11: int - FIELD_name12: int - __field_name13: int - __Field_name14: int - field__name15: int - field__Name16: int - field_name17__: int - Field_name18__: int - @property - def optional_nested_message(self) -> TestAllTypesProto2.NestedMessage: ... - @property - def optional_foreign_message(self) -> ForeignMessageProto2: ... - @property - def recursive_message(self) -> TestAllTypesProto2: ... - @property - def repeated_nested_message(self) -> RepeatedCompositeFieldContainer[TestAllTypesProto2.NestedMessage]: ... - @property - def repeated_foreign_message(self) -> RepeatedCompositeFieldContainer[ForeignMessageProto2]: ... - @property - def map_int32_int32(self) -> MutableMapping[int, int]: ... - @property - def map_int64_int64(self) -> MutableMapping[int, int]: ... - @property - def map_uint32_uint32(self) -> MutableMapping[int, int]: ... - @property - def map_uint64_uint64(self) -> MutableMapping[int, int]: ... - @property - def map_sint32_sint32(self) -> MutableMapping[int, int]: ... - @property - def map_sint64_sint64(self) -> MutableMapping[int, int]: ... - @property - def map_fixed32_fixed32(self) -> MutableMapping[int, int]: ... - @property - def map_fixed64_fixed64(self) -> MutableMapping[int, int]: ... - @property - def map_sfixed32_sfixed32(self) -> MutableMapping[int, int]: ... - @property - def map_sfixed64_sfixed64(self) -> MutableMapping[int, int]: ... - @property - def map_int32_float(self) -> MutableMapping[int, float]: ... - @property - def map_int32_double(self) -> MutableMapping[int, float]: ... - @property - def map_bool_bool(self) -> MutableMapping[bool, bool]: ... - @property - def map_string_string(self) -> MutableMapping[Text, Text]: ... - @property - def map_string_bytes(self) -> MutableMapping[Text, bytes]: ... - @property - def map_string_nested_message(self) -> MutableMapping[Text, TestAllTypesProto2.NestedMessage]: ... - @property - def map_string_foreign_message(self) -> MutableMapping[Text, ForeignMessageProto2]: ... - @property - def map_string_nested_enum(self) -> MutableMapping[Text, TestAllTypesProto2.NestedEnum]: ... - @property - def map_string_foreign_enum(self) -> MutableMapping[Text, ForeignEnumProto2]: ... - @property - def oneof_nested_message(self) -> TestAllTypesProto2.NestedMessage: ... - @property - def data(self) -> TestAllTypesProto2.Data: ... - def __init__( - self, - optional_int32: Optional[int] = ..., - optional_int64: Optional[int] = ..., - optional_uint32: Optional[int] = ..., - optional_uint64: Optional[int] = ..., - optional_sint32: Optional[int] = ..., - optional_sint64: Optional[int] = ..., - optional_fixed32: Optional[int] = ..., - optional_fixed64: Optional[int] = ..., - optional_sfixed32: Optional[int] = ..., - optional_sfixed64: Optional[int] = ..., - optional_float: Optional[float] = ..., - optional_double: Optional[float] = ..., - optional_bool: Optional[bool] = ..., - optional_string: Optional[Text] = ..., - optional_bytes: Optional[bytes] = ..., - optional_nested_message: Optional[TestAllTypesProto2.NestedMessage] = ..., - optional_foreign_message: Optional[ForeignMessageProto2] = ..., - optional_nested_enum: Optional[TestAllTypesProto2.NestedEnum] = ..., - optional_foreign_enum: Optional[ForeignEnumProto2] = ..., - optional_string_piece: Optional[Text] = ..., - optional_cord: Optional[Text] = ..., - recursive_message: Optional[TestAllTypesProto2] = ..., - repeated_int32: Optional[Iterable[int]] = ..., - repeated_int64: Optional[Iterable[int]] = ..., - repeated_uint32: Optional[Iterable[int]] = ..., - repeated_uint64: Optional[Iterable[int]] = ..., - repeated_sint32: Optional[Iterable[int]] = ..., - repeated_sint64: Optional[Iterable[int]] = ..., - repeated_fixed32: Optional[Iterable[int]] = ..., - repeated_fixed64: Optional[Iterable[int]] = ..., - repeated_sfixed32: Optional[Iterable[int]] = ..., - repeated_sfixed64: Optional[Iterable[int]] = ..., - repeated_float: Optional[Iterable[float]] = ..., - repeated_double: Optional[Iterable[float]] = ..., - repeated_bool: Optional[Iterable[bool]] = ..., - repeated_string: Optional[Iterable[Text]] = ..., - repeated_bytes: Optional[Iterable[bytes]] = ..., - repeated_nested_message: Optional[Iterable[TestAllTypesProto2.NestedMessage]] = ..., - repeated_foreign_message: Optional[Iterable[ForeignMessageProto2]] = ..., - repeated_nested_enum: Optional[Iterable[TestAllTypesProto2.NestedEnum]] = ..., - repeated_foreign_enum: Optional[Iterable[ForeignEnumProto2]] = ..., - repeated_string_piece: Optional[Iterable[Text]] = ..., - repeated_cord: Optional[Iterable[Text]] = ..., - map_int32_int32: Optional[Mapping[int, int]] = ..., - map_int64_int64: Optional[Mapping[int, int]] = ..., - map_uint32_uint32: Optional[Mapping[int, int]] = ..., - map_uint64_uint64: Optional[Mapping[int, int]] = ..., - map_sint32_sint32: Optional[Mapping[int, int]] = ..., - map_sint64_sint64: Optional[Mapping[int, int]] = ..., - map_fixed32_fixed32: Optional[Mapping[int, int]] = ..., - map_fixed64_fixed64: Optional[Mapping[int, int]] = ..., - map_sfixed32_sfixed32: Optional[Mapping[int, int]] = ..., - map_sfixed64_sfixed64: Optional[Mapping[int, int]] = ..., - map_int32_float: Optional[Mapping[int, float]] = ..., - map_int32_double: Optional[Mapping[int, float]] = ..., - map_bool_bool: Optional[Mapping[bool, bool]] = ..., - map_string_string: Optional[Mapping[Text, Text]] = ..., - map_string_bytes: Optional[Mapping[Text, bytes]] = ..., - map_string_nested_message: Optional[Mapping[Text, TestAllTypesProto2.NestedMessage]] = ..., - map_string_foreign_message: Optional[Mapping[Text, ForeignMessageProto2]] = ..., - map_string_nested_enum: Optional[Mapping[Text, TestAllTypesProto2.NestedEnum]] = ..., - map_string_foreign_enum: Optional[Mapping[Text, ForeignEnumProto2]] = ..., - oneof_uint32: Optional[int] = ..., - oneof_nested_message: Optional[TestAllTypesProto2.NestedMessage] = ..., - oneof_string: Optional[Text] = ..., - oneof_bytes: Optional[bytes] = ..., - oneof_bool: Optional[bool] = ..., - oneof_uint64: Optional[int] = ..., - oneof_float: Optional[float] = ..., - oneof_double: Optional[float] = ..., - oneof_enum: Optional[TestAllTypesProto2.NestedEnum] = ..., - data: Optional[TestAllTypesProto2.Data] = ..., - fieldname1: Optional[int] = ..., - field_name2: Optional[int] = ..., - _field_name3: Optional[int] = ..., - field__name4_: Optional[int] = ..., - field0name5: Optional[int] = ..., - field_0_name6: Optional[int] = ..., - fieldName7: Optional[int] = ..., - FieldName8: Optional[int] = ..., - field_Name9: Optional[int] = ..., - Field_Name10: Optional[int] = ..., - FIELD_NAME11: Optional[int] = ..., - FIELD_name12: Optional[int] = ..., - __field_name13: Optional[int] = ..., - __Field_name14: Optional[int] = ..., - field__name15: Optional[int] = ..., - field__Name16: Optional[int] = ..., - field_name17__: Optional[int] = ..., - Field_name18__: Optional[int] = ..., - ) -> None: ... - -class ForeignMessageProto2(Message): - c: int - def __init__(self, c: Optional[int] = ...) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/test_messages_proto3_pb2.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/test_messages_proto3_pb2.pyi deleted file mode 100755 index d9f01cec..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/test_messages_proto3_pb2.pyi +++ /dev/null @@ -1,435 +0,0 @@ -from google.protobuf.any_pb2 import Any -from google.protobuf.duration_pb2 import Duration -from google.protobuf.field_mask_pb2 import FieldMask -from google.protobuf.internal.containers import RepeatedCompositeFieldContainer, RepeatedScalarFieldContainer -from google.protobuf.message import Message -from google.protobuf.struct_pb2 import Struct, Value -from google.protobuf.timestamp_pb2 import Timestamp -from google.protobuf.wrappers_pb2 import ( - BoolValue, - BytesValue, - DoubleValue, - FloatValue, - Int32Value, - Int64Value, - StringValue, - UInt32Value, - UInt64Value, -) -from typing import Iterable, List, Mapping, MutableMapping, Optional, Text, Tuple, cast - -class ForeignEnum(int): - @classmethod - def Name(cls, number: int) -> bytes: ... - @classmethod - def Value(cls, name: bytes) -> ForeignEnum: ... - @classmethod - def keys(cls) -> List[bytes]: ... - @classmethod - def values(cls) -> List[ForeignEnum]: ... - @classmethod - def items(cls) -> List[Tuple[bytes, ForeignEnum]]: ... - -FOREIGN_FOO: ForeignEnum -FOREIGN_BAR: ForeignEnum -FOREIGN_BAZ: ForeignEnum - -class TestAllTypesProto3(Message): - class NestedEnum(int): - @classmethod - def Name(cls, number: int) -> bytes: ... - @classmethod - def Value(cls, name: bytes) -> TestAllTypesProto3.NestedEnum: ... - @classmethod - def keys(cls) -> List[bytes]: ... - @classmethod - def values(cls) -> List[TestAllTypesProto3.NestedEnum]: ... - @classmethod - def items(cls) -> List[Tuple[bytes, TestAllTypesProto3.NestedEnum]]: ... - FOO: TestAllTypesProto3.NestedEnum - BAR: TestAllTypesProto3.NestedEnum - BAZ: TestAllTypesProto3.NestedEnum - NEG: TestAllTypesProto3.NestedEnum - class NestedMessage(Message): - a: int - @property - def corecursive(self) -> TestAllTypesProto3: ... - def __init__(self, a: Optional[int] = ..., corecursive: Optional[TestAllTypesProto3] = ...) -> None: ... - class MapInt32Int32Entry(Message): - key: int - value: int - def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... - class MapInt64Int64Entry(Message): - key: int - value: int - def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... - class MapUint32Uint32Entry(Message): - key: int - value: int - def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... - class MapUint64Uint64Entry(Message): - key: int - value: int - def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... - class MapSint32Sint32Entry(Message): - key: int - value: int - def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... - class MapSint64Sint64Entry(Message): - key: int - value: int - def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... - class MapFixed32Fixed32Entry(Message): - key: int - value: int - def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... - class MapFixed64Fixed64Entry(Message): - key: int - value: int - def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... - class MapSfixed32Sfixed32Entry(Message): - key: int - value: int - def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... - class MapSfixed64Sfixed64Entry(Message): - key: int - value: int - def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... - class MapInt32FloatEntry(Message): - key: int - value: float - def __init__(self, key: Optional[int] = ..., value: Optional[float] = ...) -> None: ... - class MapInt32DoubleEntry(Message): - key: int - value: float - def __init__(self, key: Optional[int] = ..., value: Optional[float] = ...) -> None: ... - class MapBoolBoolEntry(Message): - key: bool - value: bool - def __init__(self, key: Optional[bool] = ..., value: Optional[bool] = ...) -> None: ... - class MapStringStringEntry(Message): - key: Text - value: Text - def __init__(self, key: Optional[Text] = ..., value: Optional[Text] = ...) -> None: ... - class MapStringBytesEntry(Message): - key: Text - value: bytes - def __init__(self, key: Optional[Text] = ..., value: Optional[bytes] = ...) -> None: ... - class MapStringNestedMessageEntry(Message): - key: Text - @property - def value(self) -> TestAllTypesProto3.NestedMessage: ... - def __init__(self, key: Optional[Text] = ..., value: Optional[TestAllTypesProto3.NestedMessage] = ...) -> None: ... - class MapStringForeignMessageEntry(Message): - key: Text - @property - def value(self) -> ForeignMessage: ... - def __init__(self, key: Optional[Text] = ..., value: Optional[ForeignMessage] = ...) -> None: ... - class MapStringNestedEnumEntry(Message): - key: Text - value: TestAllTypesProto3.NestedEnum - def __init__(self, key: Optional[Text] = ..., value: Optional[TestAllTypesProto3.NestedEnum] = ...) -> None: ... - class MapStringForeignEnumEntry(Message): - key: Text - value: ForeignEnum - def __init__(self, key: Optional[Text] = ..., value: Optional[ForeignEnum] = ...) -> None: ... - optional_int32: int - optional_int64: int - optional_uint32: int - optional_uint64: int - optional_sint32: int - optional_sint64: int - optional_fixed32: int - optional_fixed64: int - optional_sfixed32: int - optional_sfixed64: int - optional_float: float - optional_double: float - optional_bool: bool - optional_string: Text - optional_bytes: bytes - optional_nested_enum: TestAllTypesProto3.NestedEnum - optional_foreign_enum: ForeignEnum - optional_string_piece: Text - optional_cord: Text - repeated_int32: RepeatedScalarFieldContainer[int] - repeated_int64: RepeatedScalarFieldContainer[int] - repeated_uint32: RepeatedScalarFieldContainer[int] - repeated_uint64: RepeatedScalarFieldContainer[int] - repeated_sint32: RepeatedScalarFieldContainer[int] - repeated_sint64: RepeatedScalarFieldContainer[int] - repeated_fixed32: RepeatedScalarFieldContainer[int] - repeated_fixed64: RepeatedScalarFieldContainer[int] - repeated_sfixed32: RepeatedScalarFieldContainer[int] - repeated_sfixed64: RepeatedScalarFieldContainer[int] - repeated_float: RepeatedScalarFieldContainer[float] - repeated_double: RepeatedScalarFieldContainer[float] - repeated_bool: RepeatedScalarFieldContainer[bool] - repeated_string: RepeatedScalarFieldContainer[Text] - repeated_bytes: RepeatedScalarFieldContainer[bytes] - repeated_nested_enum: RepeatedScalarFieldContainer[TestAllTypesProto3.NestedEnum] - repeated_foreign_enum: RepeatedScalarFieldContainer[ForeignEnum] - repeated_string_piece: RepeatedScalarFieldContainer[Text] - repeated_cord: RepeatedScalarFieldContainer[Text] - oneof_uint32: int - oneof_string: Text - oneof_bytes: bytes - oneof_bool: bool - oneof_uint64: int - oneof_float: float - oneof_double: float - oneof_enum: TestAllTypesProto3.NestedEnum - fieldname1: int - field_name2: int - _field_name3: int - field__name4_: int - field0name5: int - field_0_name6: int - fieldName7: int - FieldName8: int - field_Name9: int - Field_Name10: int - FIELD_NAME11: int - FIELD_name12: int - __field_name13: int - __Field_name14: int - field__name15: int - field__Name16: int - field_name17__: int - Field_name18__: int - @property - def optional_nested_message(self) -> TestAllTypesProto3.NestedMessage: ... - @property - def optional_foreign_message(self) -> ForeignMessage: ... - @property - def recursive_message(self) -> TestAllTypesProto3: ... - @property - def repeated_nested_message(self) -> RepeatedCompositeFieldContainer[TestAllTypesProto3.NestedMessage]: ... - @property - def repeated_foreign_message(self) -> RepeatedCompositeFieldContainer[ForeignMessage]: ... - @property - def map_int32_int32(self) -> MutableMapping[int, int]: ... - @property - def map_int64_int64(self) -> MutableMapping[int, int]: ... - @property - def map_uint32_uint32(self) -> MutableMapping[int, int]: ... - @property - def map_uint64_uint64(self) -> MutableMapping[int, int]: ... - @property - def map_sint32_sint32(self) -> MutableMapping[int, int]: ... - @property - def map_sint64_sint64(self) -> MutableMapping[int, int]: ... - @property - def map_fixed32_fixed32(self) -> MutableMapping[int, int]: ... - @property - def map_fixed64_fixed64(self) -> MutableMapping[int, int]: ... - @property - def map_sfixed32_sfixed32(self) -> MutableMapping[int, int]: ... - @property - def map_sfixed64_sfixed64(self) -> MutableMapping[int, int]: ... - @property - def map_int32_float(self) -> MutableMapping[int, float]: ... - @property - def map_int32_double(self) -> MutableMapping[int, float]: ... - @property - def map_bool_bool(self) -> MutableMapping[bool, bool]: ... - @property - def map_string_string(self) -> MutableMapping[Text, Text]: ... - @property - def map_string_bytes(self) -> MutableMapping[Text, bytes]: ... - @property - def map_string_nested_message(self) -> MutableMapping[Text, TestAllTypesProto3.NestedMessage]: ... - @property - def map_string_foreign_message(self) -> MutableMapping[Text, ForeignMessage]: ... - @property - def map_string_nested_enum(self) -> MutableMapping[Text, TestAllTypesProto3.NestedEnum]: ... - @property - def map_string_foreign_enum(self) -> MutableMapping[Text, ForeignEnum]: ... - @property - def oneof_nested_message(self) -> TestAllTypesProto3.NestedMessage: ... - @property - def optional_bool_wrapper(self) -> BoolValue: ... - @property - def optional_int32_wrapper(self) -> Int32Value: ... - @property - def optional_int64_wrapper(self) -> Int64Value: ... - @property - def optional_uint32_wrapper(self) -> UInt32Value: ... - @property - def optional_uint64_wrapper(self) -> UInt64Value: ... - @property - def optional_float_wrapper(self) -> FloatValue: ... - @property - def optional_double_wrapper(self) -> DoubleValue: ... - @property - def optional_string_wrapper(self) -> StringValue: ... - @property - def optional_bytes_wrapper(self) -> BytesValue: ... - @property - def repeated_bool_wrapper(self) -> RepeatedCompositeFieldContainer[BoolValue]: ... - @property - def repeated_int32_wrapper(self) -> RepeatedCompositeFieldContainer[Int32Value]: ... - @property - def repeated_int64_wrapper(self) -> RepeatedCompositeFieldContainer[Int64Value]: ... - @property - def repeated_uint32_wrapper(self) -> RepeatedCompositeFieldContainer[UInt32Value]: ... - @property - def repeated_uint64_wrapper(self) -> RepeatedCompositeFieldContainer[UInt64Value]: ... - @property - def repeated_float_wrapper(self) -> RepeatedCompositeFieldContainer[FloatValue]: ... - @property - def repeated_double_wrapper(self) -> RepeatedCompositeFieldContainer[DoubleValue]: ... - @property - def repeated_string_wrapper(self) -> RepeatedCompositeFieldContainer[StringValue]: ... - @property - def repeated_bytes_wrapper(self) -> RepeatedCompositeFieldContainer[BytesValue]: ... - @property - def optional_duration(self) -> Duration: ... - @property - def optional_timestamp(self) -> Timestamp: ... - @property - def optional_field_mask(self) -> FieldMask: ... - @property - def optional_struct(self) -> Struct: ... - @property - def optional_any(self) -> Any: ... - @property - def optional_value(self) -> Value: ... - @property - def repeated_duration(self) -> RepeatedCompositeFieldContainer[Duration]: ... - @property - def repeated_timestamp(self) -> RepeatedCompositeFieldContainer[Timestamp]: ... - @property - def repeated_fieldmask(self) -> RepeatedCompositeFieldContainer[FieldMask]: ... - @property - def repeated_struct(self) -> RepeatedCompositeFieldContainer[Struct]: ... - @property - def repeated_any(self) -> RepeatedCompositeFieldContainer[Any]: ... - @property - def repeated_value(self) -> RepeatedCompositeFieldContainer[Value]: ... - def __init__( - self, - optional_int32: Optional[int] = ..., - optional_int64: Optional[int] = ..., - optional_uint32: Optional[int] = ..., - optional_uint64: Optional[int] = ..., - optional_sint32: Optional[int] = ..., - optional_sint64: Optional[int] = ..., - optional_fixed32: Optional[int] = ..., - optional_fixed64: Optional[int] = ..., - optional_sfixed32: Optional[int] = ..., - optional_sfixed64: Optional[int] = ..., - optional_float: Optional[float] = ..., - optional_double: Optional[float] = ..., - optional_bool: Optional[bool] = ..., - optional_string: Optional[Text] = ..., - optional_bytes: Optional[bytes] = ..., - optional_nested_message: Optional[TestAllTypesProto3.NestedMessage] = ..., - optional_foreign_message: Optional[ForeignMessage] = ..., - optional_nested_enum: Optional[TestAllTypesProto3.NestedEnum] = ..., - optional_foreign_enum: Optional[ForeignEnum] = ..., - optional_string_piece: Optional[Text] = ..., - optional_cord: Optional[Text] = ..., - recursive_message: Optional[TestAllTypesProto3] = ..., - repeated_int32: Optional[Iterable[int]] = ..., - repeated_int64: Optional[Iterable[int]] = ..., - repeated_uint32: Optional[Iterable[int]] = ..., - repeated_uint64: Optional[Iterable[int]] = ..., - repeated_sint32: Optional[Iterable[int]] = ..., - repeated_sint64: Optional[Iterable[int]] = ..., - repeated_fixed32: Optional[Iterable[int]] = ..., - repeated_fixed64: Optional[Iterable[int]] = ..., - repeated_sfixed32: Optional[Iterable[int]] = ..., - repeated_sfixed64: Optional[Iterable[int]] = ..., - repeated_float: Optional[Iterable[float]] = ..., - repeated_double: Optional[Iterable[float]] = ..., - repeated_bool: Optional[Iterable[bool]] = ..., - repeated_string: Optional[Iterable[Text]] = ..., - repeated_bytes: Optional[Iterable[bytes]] = ..., - repeated_nested_message: Optional[Iterable[TestAllTypesProto3.NestedMessage]] = ..., - repeated_foreign_message: Optional[Iterable[ForeignMessage]] = ..., - repeated_nested_enum: Optional[Iterable[TestAllTypesProto3.NestedEnum]] = ..., - repeated_foreign_enum: Optional[Iterable[ForeignEnum]] = ..., - repeated_string_piece: Optional[Iterable[Text]] = ..., - repeated_cord: Optional[Iterable[Text]] = ..., - map_int32_int32: Optional[Mapping[int, int]] = ..., - map_int64_int64: Optional[Mapping[int, int]] = ..., - map_uint32_uint32: Optional[Mapping[int, int]] = ..., - map_uint64_uint64: Optional[Mapping[int, int]] = ..., - map_sint32_sint32: Optional[Mapping[int, int]] = ..., - map_sint64_sint64: Optional[Mapping[int, int]] = ..., - map_fixed32_fixed32: Optional[Mapping[int, int]] = ..., - map_fixed64_fixed64: Optional[Mapping[int, int]] = ..., - map_sfixed32_sfixed32: Optional[Mapping[int, int]] = ..., - map_sfixed64_sfixed64: Optional[Mapping[int, int]] = ..., - map_int32_float: Optional[Mapping[int, float]] = ..., - map_int32_double: Optional[Mapping[int, float]] = ..., - map_bool_bool: Optional[Mapping[bool, bool]] = ..., - map_string_string: Optional[Mapping[Text, Text]] = ..., - map_string_bytes: Optional[Mapping[Text, bytes]] = ..., - map_string_nested_message: Optional[Mapping[Text, TestAllTypesProto3.NestedMessage]] = ..., - map_string_foreign_message: Optional[Mapping[Text, ForeignMessage]] = ..., - map_string_nested_enum: Optional[Mapping[Text, TestAllTypesProto3.NestedEnum]] = ..., - map_string_foreign_enum: Optional[Mapping[Text, ForeignEnum]] = ..., - oneof_uint32: Optional[int] = ..., - oneof_nested_message: Optional[TestAllTypesProto3.NestedMessage] = ..., - oneof_string: Optional[Text] = ..., - oneof_bytes: Optional[bytes] = ..., - oneof_bool: Optional[bool] = ..., - oneof_uint64: Optional[int] = ..., - oneof_float: Optional[float] = ..., - oneof_double: Optional[float] = ..., - oneof_enum: Optional[TestAllTypesProto3.NestedEnum] = ..., - optional_bool_wrapper: Optional[BoolValue] = ..., - optional_int32_wrapper: Optional[Int32Value] = ..., - optional_int64_wrapper: Optional[Int64Value] = ..., - optional_uint32_wrapper: Optional[UInt32Value] = ..., - optional_uint64_wrapper: Optional[UInt64Value] = ..., - optional_float_wrapper: Optional[FloatValue] = ..., - optional_double_wrapper: Optional[DoubleValue] = ..., - optional_string_wrapper: Optional[StringValue] = ..., - optional_bytes_wrapper: Optional[BytesValue] = ..., - repeated_bool_wrapper: Optional[Iterable[BoolValue]] = ..., - repeated_int32_wrapper: Optional[Iterable[Int32Value]] = ..., - repeated_int64_wrapper: Optional[Iterable[Int64Value]] = ..., - repeated_uint32_wrapper: Optional[Iterable[UInt32Value]] = ..., - repeated_uint64_wrapper: Optional[Iterable[UInt64Value]] = ..., - repeated_float_wrapper: Optional[Iterable[FloatValue]] = ..., - repeated_double_wrapper: Optional[Iterable[DoubleValue]] = ..., - repeated_string_wrapper: Optional[Iterable[StringValue]] = ..., - repeated_bytes_wrapper: Optional[Iterable[BytesValue]] = ..., - optional_duration: Optional[Duration] = ..., - optional_timestamp: Optional[Timestamp] = ..., - optional_field_mask: Optional[FieldMask] = ..., - optional_struct: Optional[Struct] = ..., - optional_any: Optional[Any] = ..., - optional_value: Optional[Value] = ..., - repeated_duration: Optional[Iterable[Duration]] = ..., - repeated_timestamp: Optional[Iterable[Timestamp]] = ..., - repeated_fieldmask: Optional[Iterable[FieldMask]] = ..., - repeated_struct: Optional[Iterable[Struct]] = ..., - repeated_any: Optional[Iterable[Any]] = ..., - repeated_value: Optional[Iterable[Value]] = ..., - fieldname1: Optional[int] = ..., - field_name2: Optional[int] = ..., - _field_name3: Optional[int] = ..., - field__name4_: Optional[int] = ..., - field0name5: Optional[int] = ..., - field_0_name6: Optional[int] = ..., - fieldName7: Optional[int] = ..., - FieldName8: Optional[int] = ..., - field_Name9: Optional[int] = ..., - Field_Name10: Optional[int] = ..., - FIELD_NAME11: Optional[int] = ..., - FIELD_name12: Optional[int] = ..., - __field_name13: Optional[int] = ..., - __Field_name14: Optional[int] = ..., - field__name15: Optional[int] = ..., - field__Name16: Optional[int] = ..., - field_name17__: Optional[int] = ..., - Field_name18__: Optional[int] = ..., - ) -> None: ... - -class ForeignMessage(Message): - c: int - def __init__(self, c: Optional[int] = ...) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/timestamp_pb2.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/timestamp_pb2.pyi old mode 100755 new mode 100644 index c34570c6..f507acd2 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/timestamp_pb2.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/timestamp_pb2.pyi @@ -1,9 +1,46 @@ -from google.protobuf.message import Message -from google.protobuf.internal import well_known_types +""" +@generated by mypy-protobuf. Do not edit manually! +isort:skip_file +""" +from google.protobuf.descriptor import ( + Descriptor as google___protobuf___descriptor___Descriptor, + FileDescriptor as google___protobuf___descriptor___FileDescriptor, +) -from typing import Optional +from google.protobuf.internal.well_known_types import ( + Timestamp as google___protobuf___internal___well_known_types___Timestamp, +) -class Timestamp(Message, well_known_types.Timestamp): - seconds: int - nanos: int - def __init__(self, seconds: Optional[int] = ..., nanos: Optional[int] = ...) -> None: ... +from google.protobuf.message import ( + Message as google___protobuf___message___Message, +) + +from typing import ( + Optional as typing___Optional, +) + +from typing_extensions import ( + Literal as typing_extensions___Literal, +) + + +builtin___bool = bool +builtin___bytes = bytes +builtin___float = float +builtin___int = int + + +DESCRIPTOR: google___protobuf___descriptor___FileDescriptor = ... + +class Timestamp(google___protobuf___message___Message, google___protobuf___internal___well_known_types___Timestamp): + DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... + seconds: builtin___int = ... + nanos: builtin___int = ... + + def __init__(self, + *, + seconds : typing___Optional[builtin___int] = None, + nanos : typing___Optional[builtin___int] = None, + ) -> None: ... + def ClearField(self, field_name: typing_extensions___Literal[u"nanos",b"nanos",u"seconds",b"seconds"]) -> None: ... +type___Timestamp = Timestamp diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/type_pb2.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/type_pb2.pyi old mode 100755 new mode 100644 index 40c8633a..890f197c --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/type_pb2.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/type_pb2.pyi @@ -1,144 +1,237 @@ -from google.protobuf.any_pb2 import Any -from google.protobuf.internal.containers import RepeatedCompositeFieldContainer, RepeatedScalarFieldContainer -from google.protobuf.message import Message -from google.protobuf.source_context_pb2 import SourceContext -from typing import Iterable, List, Optional, Text, Tuple, cast - -class Syntax(int): - @classmethod - def Name(cls, number: int) -> bytes: ... - @classmethod - def Value(cls, name: bytes) -> Syntax: ... - @classmethod - def keys(cls) -> List[bytes]: ... - @classmethod - def values(cls) -> List[Syntax]: ... - @classmethod - def items(cls) -> List[Tuple[bytes, Syntax]]: ... - -SYNTAX_PROTO2: Syntax -SYNTAX_PROTO3: Syntax - -class Type(Message): - name: Text - oneofs: RepeatedScalarFieldContainer[Text] - syntax: Syntax +""" +@generated by mypy-protobuf. Do not edit manually! +isort:skip_file +""" +from google.protobuf.any_pb2 import ( + Any as google___protobuf___any_pb2___Any, +) + +from google.protobuf.descriptor import ( + Descriptor as google___protobuf___descriptor___Descriptor, + EnumDescriptor as google___protobuf___descriptor___EnumDescriptor, + FileDescriptor as google___protobuf___descriptor___FileDescriptor, +) + +from google.protobuf.internal.containers import ( + RepeatedCompositeFieldContainer as google___protobuf___internal___containers___RepeatedCompositeFieldContainer, + RepeatedScalarFieldContainer as google___protobuf___internal___containers___RepeatedScalarFieldContainer, +) + +from google.protobuf.internal.enum_type_wrapper import ( + _EnumTypeWrapper as google___protobuf___internal___enum_type_wrapper____EnumTypeWrapper, +) + +from google.protobuf.message import ( + Message as google___protobuf___message___Message, +) + +from google.protobuf.source_context_pb2 import ( + SourceContext as google___protobuf___source_context_pb2___SourceContext, +) + +from typing import ( + Iterable as typing___Iterable, + NewType as typing___NewType, + Optional as typing___Optional, + Text as typing___Text, + cast as typing___cast, +) + +from typing_extensions import ( + Literal as typing_extensions___Literal, +) + + +builtin___bool = bool +builtin___bytes = bytes +builtin___float = float +builtin___int = int + + +DESCRIPTOR: google___protobuf___descriptor___FileDescriptor = ... + +SyntaxValue = typing___NewType('SyntaxValue', builtin___int) +type___SyntaxValue = SyntaxValue +Syntax: _Syntax +class _Syntax(google___protobuf___internal___enum_type_wrapper____EnumTypeWrapper[SyntaxValue]): + DESCRIPTOR: google___protobuf___descriptor___EnumDescriptor = ... + SYNTAX_PROTO2 = typing___cast(SyntaxValue, 0) + SYNTAX_PROTO3 = typing___cast(SyntaxValue, 1) +SYNTAX_PROTO2 = typing___cast(SyntaxValue, 0) +SYNTAX_PROTO3 = typing___cast(SyntaxValue, 1) + +class Type(google___protobuf___message___Message): + DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... + name: typing___Text = ... + oneofs: google___protobuf___internal___containers___RepeatedScalarFieldContainer[typing___Text] = ... + syntax: type___SyntaxValue = ... + @property - def fields(self) -> RepeatedCompositeFieldContainer[Field]: ... + def fields(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[type___Field]: ... + @property - def options(self) -> RepeatedCompositeFieldContainer[Option]: ... + def options(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[type___Option]: ... + @property - def source_context(self) -> SourceContext: ... - def __init__( - self, - name: Optional[Text] = ..., - fields: Optional[Iterable[Field]] = ..., - oneofs: Optional[Iterable[Text]] = ..., - options: Optional[Iterable[Option]] = ..., - source_context: Optional[SourceContext] = ..., - syntax: Optional[Syntax] = ..., - ) -> None: ... - -class Field(Message): - class Kind(int): - @classmethod - def Name(cls, number: int) -> bytes: ... - @classmethod - def Value(cls, name: bytes) -> Field.Kind: ... - @classmethod - def keys(cls) -> List[bytes]: ... - @classmethod - def values(cls) -> List[Field.Kind]: ... - @classmethod - def items(cls) -> List[Tuple[bytes, Field.Kind]]: ... - TYPE_UNKNOWN: Field.Kind - TYPE_DOUBLE: Field.Kind - TYPE_FLOAT: Field.Kind - TYPE_INT64: Field.Kind - TYPE_UINT64: Field.Kind - TYPE_INT32: Field.Kind - TYPE_FIXED64: Field.Kind - TYPE_FIXED32: Field.Kind - TYPE_BOOL: Field.Kind - TYPE_STRING: Field.Kind - TYPE_GROUP: Field.Kind - TYPE_MESSAGE: Field.Kind - TYPE_BYTES: Field.Kind - TYPE_UINT32: Field.Kind - TYPE_ENUM: Field.Kind - TYPE_SFIXED32: Field.Kind - TYPE_SFIXED64: Field.Kind - TYPE_SINT32: Field.Kind - TYPE_SINT64: Field.Kind - class Cardinality(int): - @classmethod - def Name(cls, number: int) -> bytes: ... - @classmethod - def Value(cls, name: bytes) -> Field.Cardinality: ... - @classmethod - def keys(cls) -> List[bytes]: ... - @classmethod - def values(cls) -> List[Field.Cardinality]: ... - @classmethod - def items(cls) -> List[Tuple[bytes, Field.Cardinality]]: ... - CARDINALITY_UNKNOWN: Field.Cardinality - CARDINALITY_OPTIONAL: Field.Cardinality - CARDINALITY_REQUIRED: Field.Cardinality - CARDINALITY_REPEATED: Field.Cardinality - kind: Field.Kind - cardinality: Field.Cardinality - number: int - name: Text - type_url: Text - oneof_index: int - packed: bool - json_name: Text - default_value: Text + def source_context(self) -> google___protobuf___source_context_pb2___SourceContext: ... + + def __init__(self, + *, + name : typing___Optional[typing___Text] = None, + fields : typing___Optional[typing___Iterable[type___Field]] = None, + oneofs : typing___Optional[typing___Iterable[typing___Text]] = None, + options : typing___Optional[typing___Iterable[type___Option]] = None, + source_context : typing___Optional[google___protobuf___source_context_pb2___SourceContext] = None, + syntax : typing___Optional[type___SyntaxValue] = None, + ) -> None: ... + def HasField(self, field_name: typing_extensions___Literal[u"source_context",b"source_context"]) -> builtin___bool: ... + def ClearField(self, field_name: typing_extensions___Literal[u"fields",b"fields",u"name",b"name",u"oneofs",b"oneofs",u"options",b"options",u"source_context",b"source_context",u"syntax",b"syntax"]) -> None: ... +type___Type = Type + +class Field(google___protobuf___message___Message): + DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... + KindValue = typing___NewType('KindValue', builtin___int) + type___KindValue = KindValue + Kind: _Kind + class _Kind(google___protobuf___internal___enum_type_wrapper____EnumTypeWrapper[Field.KindValue]): + DESCRIPTOR: google___protobuf___descriptor___EnumDescriptor = ... + TYPE_UNKNOWN = typing___cast(Field.KindValue, 0) + TYPE_DOUBLE = typing___cast(Field.KindValue, 1) + TYPE_FLOAT = typing___cast(Field.KindValue, 2) + TYPE_INT64 = typing___cast(Field.KindValue, 3) + TYPE_UINT64 = typing___cast(Field.KindValue, 4) + TYPE_INT32 = typing___cast(Field.KindValue, 5) + TYPE_FIXED64 = typing___cast(Field.KindValue, 6) + TYPE_FIXED32 = typing___cast(Field.KindValue, 7) + TYPE_BOOL = typing___cast(Field.KindValue, 8) + TYPE_STRING = typing___cast(Field.KindValue, 9) + TYPE_GROUP = typing___cast(Field.KindValue, 10) + TYPE_MESSAGE = typing___cast(Field.KindValue, 11) + TYPE_BYTES = typing___cast(Field.KindValue, 12) + TYPE_UINT32 = typing___cast(Field.KindValue, 13) + TYPE_ENUM = typing___cast(Field.KindValue, 14) + TYPE_SFIXED32 = typing___cast(Field.KindValue, 15) + TYPE_SFIXED64 = typing___cast(Field.KindValue, 16) + TYPE_SINT32 = typing___cast(Field.KindValue, 17) + TYPE_SINT64 = typing___cast(Field.KindValue, 18) + TYPE_UNKNOWN = typing___cast(Field.KindValue, 0) + TYPE_DOUBLE = typing___cast(Field.KindValue, 1) + TYPE_FLOAT = typing___cast(Field.KindValue, 2) + TYPE_INT64 = typing___cast(Field.KindValue, 3) + TYPE_UINT64 = typing___cast(Field.KindValue, 4) + TYPE_INT32 = typing___cast(Field.KindValue, 5) + TYPE_FIXED64 = typing___cast(Field.KindValue, 6) + TYPE_FIXED32 = typing___cast(Field.KindValue, 7) + TYPE_BOOL = typing___cast(Field.KindValue, 8) + TYPE_STRING = typing___cast(Field.KindValue, 9) + TYPE_GROUP = typing___cast(Field.KindValue, 10) + TYPE_MESSAGE = typing___cast(Field.KindValue, 11) + TYPE_BYTES = typing___cast(Field.KindValue, 12) + TYPE_UINT32 = typing___cast(Field.KindValue, 13) + TYPE_ENUM = typing___cast(Field.KindValue, 14) + TYPE_SFIXED32 = typing___cast(Field.KindValue, 15) + TYPE_SFIXED64 = typing___cast(Field.KindValue, 16) + TYPE_SINT32 = typing___cast(Field.KindValue, 17) + TYPE_SINT64 = typing___cast(Field.KindValue, 18) + + CardinalityValue = typing___NewType('CardinalityValue', builtin___int) + type___CardinalityValue = CardinalityValue + Cardinality: _Cardinality + class _Cardinality(google___protobuf___internal___enum_type_wrapper____EnumTypeWrapper[Field.CardinalityValue]): + DESCRIPTOR: google___protobuf___descriptor___EnumDescriptor = ... + CARDINALITY_UNKNOWN = typing___cast(Field.CardinalityValue, 0) + CARDINALITY_OPTIONAL = typing___cast(Field.CardinalityValue, 1) + CARDINALITY_REQUIRED = typing___cast(Field.CardinalityValue, 2) + CARDINALITY_REPEATED = typing___cast(Field.CardinalityValue, 3) + CARDINALITY_UNKNOWN = typing___cast(Field.CardinalityValue, 0) + CARDINALITY_OPTIONAL = typing___cast(Field.CardinalityValue, 1) + CARDINALITY_REQUIRED = typing___cast(Field.CardinalityValue, 2) + CARDINALITY_REPEATED = typing___cast(Field.CardinalityValue, 3) + + kind: type___Field.KindValue = ... + cardinality: type___Field.CardinalityValue = ... + number: builtin___int = ... + name: typing___Text = ... + type_url: typing___Text = ... + oneof_index: builtin___int = ... + packed: builtin___bool = ... + json_name: typing___Text = ... + default_value: typing___Text = ... + @property - def options(self) -> RepeatedCompositeFieldContainer[Option]: ... - def __init__( - self, - kind: Optional[Field.Kind] = ..., - cardinality: Optional[Field.Cardinality] = ..., - number: Optional[int] = ..., - name: Optional[Text] = ..., - type_url: Optional[Text] = ..., - oneof_index: Optional[int] = ..., - packed: Optional[bool] = ..., - options: Optional[Iterable[Option]] = ..., - json_name: Optional[Text] = ..., - default_value: Optional[Text] = ..., - ) -> None: ... - -class Enum(Message): - name: Text - syntax: Syntax + def options(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[type___Option]: ... + + def __init__(self, + *, + kind : typing___Optional[type___Field.KindValue] = None, + cardinality : typing___Optional[type___Field.CardinalityValue] = None, + number : typing___Optional[builtin___int] = None, + name : typing___Optional[typing___Text] = None, + type_url : typing___Optional[typing___Text] = None, + oneof_index : typing___Optional[builtin___int] = None, + packed : typing___Optional[builtin___bool] = None, + options : typing___Optional[typing___Iterable[type___Option]] = None, + json_name : typing___Optional[typing___Text] = None, + default_value : typing___Optional[typing___Text] = None, + ) -> None: ... + def ClearField(self, field_name: typing_extensions___Literal[u"cardinality",b"cardinality",u"default_value",b"default_value",u"json_name",b"json_name",u"kind",b"kind",u"name",b"name",u"number",b"number",u"oneof_index",b"oneof_index",u"options",b"options",u"packed",b"packed",u"type_url",b"type_url"]) -> None: ... +type___Field = Field + +class Enum(google___protobuf___message___Message): + DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... + name: typing___Text = ... + syntax: type___SyntaxValue = ... + @property - def enumvalue(self) -> RepeatedCompositeFieldContainer[EnumValue]: ... + def enumvalue(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[type___EnumValue]: ... + @property - def options(self) -> RepeatedCompositeFieldContainer[Option]: ... + def options(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[type___Option]: ... + @property - def source_context(self) -> SourceContext: ... - def __init__( - self, - name: Optional[Text] = ..., - enumvalue: Optional[Iterable[EnumValue]] = ..., - options: Optional[Iterable[Option]] = ..., - source_context: Optional[SourceContext] = ..., - syntax: Optional[Syntax] = ..., - ) -> None: ... - -class EnumValue(Message): - name: Text - number: int + def source_context(self) -> google___protobuf___source_context_pb2___SourceContext: ... + + def __init__(self, + *, + name : typing___Optional[typing___Text] = None, + enumvalue : typing___Optional[typing___Iterable[type___EnumValue]] = None, + options : typing___Optional[typing___Iterable[type___Option]] = None, + source_context : typing___Optional[google___protobuf___source_context_pb2___SourceContext] = None, + syntax : typing___Optional[type___SyntaxValue] = None, + ) -> None: ... + def HasField(self, field_name: typing_extensions___Literal[u"source_context",b"source_context"]) -> builtin___bool: ... + def ClearField(self, field_name: typing_extensions___Literal[u"enumvalue",b"enumvalue",u"name",b"name",u"options",b"options",u"source_context",b"source_context",u"syntax",b"syntax"]) -> None: ... +type___Enum = Enum + +class EnumValue(google___protobuf___message___Message): + DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... + name: typing___Text = ... + number: builtin___int = ... + @property - def options(self) -> RepeatedCompositeFieldContainer[Option]: ... - def __init__( - self, name: Optional[Text] = ..., number: Optional[int] = ..., options: Optional[Iterable[Option]] = ... - ) -> None: ... + def options(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[type___Option]: ... + + def __init__(self, + *, + name : typing___Optional[typing___Text] = None, + number : typing___Optional[builtin___int] = None, + options : typing___Optional[typing___Iterable[type___Option]] = None, + ) -> None: ... + def ClearField(self, field_name: typing_extensions___Literal[u"name",b"name",u"number",b"number",u"options",b"options"]) -> None: ... +type___EnumValue = EnumValue + +class Option(google___protobuf___message___Message): + DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... + name: typing___Text = ... -class Option(Message): - name: Text @property - def value(self) -> Any: ... - def __init__(self, name: Optional[Text] = ..., value: Optional[Any] = ...) -> None: ... + def value(self) -> google___protobuf___any_pb2___Any: ... + + def __init__(self, + *, + name : typing___Optional[typing___Text] = None, + value : typing___Optional[google___protobuf___any_pb2___Any] = None, + ) -> None: ... + def HasField(self, field_name: typing_extensions___Literal[u"value",b"value"]) -> builtin___bool: ... + def ClearField(self, field_name: typing_extensions___Literal[u"name",b"name",u"value",b"value"]) -> None: ... +type___Option = Option diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_arena_pb2.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_arena_pb2.pyi deleted file mode 100755 index 8be9db18..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_arena_pb2.pyi +++ /dev/null @@ -1,19 +0,0 @@ -from google.protobuf.internal.containers import RepeatedCompositeFieldContainer -from google.protobuf.message import Message -from google.protobuf.unittest_no_arena_import_pb2 import ImportNoArenaNestedMessage -from typing import Iterable, Optional - -class NestedMessage(Message): - d: int - def __init__(self, d: Optional[int] = ...) -> None: ... - -class ArenaMessage(Message): - @property - def repeated_nested_message(self) -> RepeatedCompositeFieldContainer[NestedMessage]: ... - @property - def repeated_import_no_arena_message(self) -> RepeatedCompositeFieldContainer[ImportNoArenaNestedMessage]: ... - def __init__( - self, - repeated_nested_message: Optional[Iterable[NestedMessage]] = ..., - repeated_import_no_arena_message: Optional[Iterable[ImportNoArenaNestedMessage]] = ..., - ) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_custom_options_pb2.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_custom_options_pb2.pyi deleted file mode 100755 index 83c710db..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_custom_options_pb2.pyi +++ /dev/null @@ -1,226 +0,0 @@ -from google.protobuf.descriptor_pb2 import FileOptions -from google.protobuf.internal.containers import RepeatedCompositeFieldContainer, RepeatedScalarFieldContainer -from google.protobuf.message import Message -from typing import Iterable, List, Optional, Text, Tuple, cast - -class MethodOpt1(int): - @classmethod - def Name(cls, number: int) -> bytes: ... - @classmethod - def Value(cls, name: bytes) -> MethodOpt1: ... - @classmethod - def keys(cls) -> List[bytes]: ... - @classmethod - def values(cls) -> List[MethodOpt1]: ... - @classmethod - def items(cls) -> List[Tuple[bytes, MethodOpt1]]: ... - -METHODOPT1_VAL1: MethodOpt1 -METHODOPT1_VAL2: MethodOpt1 - -class AggregateEnum(int): - @classmethod - def Name(cls, number: int) -> bytes: ... - @classmethod - def Value(cls, name: bytes) -> AggregateEnum: ... - @classmethod - def keys(cls) -> List[bytes]: ... - @classmethod - def values(cls) -> List[AggregateEnum]: ... - @classmethod - def items(cls) -> List[Tuple[bytes, AggregateEnum]]: ... - -VALUE: AggregateEnum - -class TestMessageWithCustomOptions(Message): - class AnEnum(int): - @classmethod - def Name(cls, number: int) -> bytes: ... - @classmethod - def Value(cls, name: bytes) -> TestMessageWithCustomOptions.AnEnum: ... - @classmethod - def keys(cls) -> List[bytes]: ... - @classmethod - def values(cls) -> List[TestMessageWithCustomOptions.AnEnum]: ... - @classmethod - def items(cls) -> List[Tuple[bytes, TestMessageWithCustomOptions.AnEnum]]: ... - ANENUM_VAL1: TestMessageWithCustomOptions.AnEnum - ANENUM_VAL2: TestMessageWithCustomOptions.AnEnum - field1: Text - oneof_field: int - def __init__(self, field1: Optional[Text] = ..., oneof_field: Optional[int] = ...) -> None: ... - -class CustomOptionFooRequest(Message): - def __init__(self,) -> None: ... - -class CustomOptionFooResponse(Message): - def __init__(self,) -> None: ... - -class CustomOptionFooClientMessage(Message): - def __init__(self,) -> None: ... - -class CustomOptionFooServerMessage(Message): - def __init__(self,) -> None: ... - -class DummyMessageContainingEnum(Message): - class TestEnumType(int): - @classmethod - def Name(cls, number: int) -> bytes: ... - @classmethod - def Value(cls, name: bytes) -> DummyMessageContainingEnum.TestEnumType: ... - @classmethod - def keys(cls) -> List[bytes]: ... - @classmethod - def values(cls) -> List[DummyMessageContainingEnum.TestEnumType]: ... - @classmethod - def items(cls) -> List[Tuple[bytes, DummyMessageContainingEnum.TestEnumType]]: ... - TEST_OPTION_ENUM_TYPE1: DummyMessageContainingEnum.TestEnumType - TEST_OPTION_ENUM_TYPE2: DummyMessageContainingEnum.TestEnumType - def __init__(self,) -> None: ... - -class DummyMessageInvalidAsOptionType(Message): - def __init__(self,) -> None: ... - -class CustomOptionMinIntegerValues(Message): - def __init__(self,) -> None: ... - -class CustomOptionMaxIntegerValues(Message): - def __init__(self,) -> None: ... - -class CustomOptionOtherValues(Message): - def __init__(self,) -> None: ... - -class SettingRealsFromPositiveInts(Message): - def __init__(self,) -> None: ... - -class SettingRealsFromNegativeInts(Message): - def __init__(self,) -> None: ... - -class ComplexOptionType1(Message): - foo: int - foo2: int - foo3: int - foo4: RepeatedScalarFieldContainer[int] - def __init__( - self, foo: Optional[int] = ..., foo2: Optional[int] = ..., foo3: Optional[int] = ..., foo4: Optional[Iterable[int]] = ... - ) -> None: ... - -class ComplexOptionType2(Message): - class ComplexOptionType4(Message): - waldo: int - def __init__(self, waldo: Optional[int] = ...) -> None: ... - baz: int - @property - def bar(self) -> ComplexOptionType1: ... - @property - def fred(self) -> ComplexOptionType2.ComplexOptionType4: ... - @property - def barney(self) -> RepeatedCompositeFieldContainer[ComplexOptionType2.ComplexOptionType4]: ... - def __init__( - self, - bar: Optional[ComplexOptionType1] = ..., - baz: Optional[int] = ..., - fred: Optional[ComplexOptionType2.ComplexOptionType4] = ..., - barney: Optional[Iterable[ComplexOptionType2.ComplexOptionType4]] = ..., - ) -> None: ... - -class ComplexOptionType3(Message): - class ComplexOptionType5(Message): - plugh: int - def __init__(self, plugh: Optional[int] = ...) -> None: ... - qux: int - @property - def complexoptiontype5(self) -> ComplexOptionType3.ComplexOptionType5: ... - def __init__( - self, qux: Optional[int] = ..., complexoptiontype5: Optional[ComplexOptionType3.ComplexOptionType5] = ... - ) -> None: ... - -class ComplexOpt6(Message): - xyzzy: int - def __init__(self, xyzzy: Optional[int] = ...) -> None: ... - -class VariousComplexOptions(Message): - def __init__(self,) -> None: ... - -class AggregateMessageSet(Message): - def __init__(self,) -> None: ... - -class AggregateMessageSetElement(Message): - s: Text - def __init__(self, s: Optional[Text] = ...) -> None: ... - -class Aggregate(Message): - i: int - s: Text - @property - def sub(self) -> Aggregate: ... - @property - def file(self) -> FileOptions: ... - @property - def mset(self) -> AggregateMessageSet: ... - def __init__( - self, - i: Optional[int] = ..., - s: Optional[Text] = ..., - sub: Optional[Aggregate] = ..., - file: Optional[FileOptions] = ..., - mset: Optional[AggregateMessageSet] = ..., - ) -> None: ... - -class AggregateMessage(Message): - fieldname: int - def __init__(self, fieldname: Optional[int] = ...) -> None: ... - -class NestedOptionType(Message): - class NestedEnum(int): - @classmethod - def Name(cls, number: int) -> bytes: ... - @classmethod - def Value(cls, name: bytes) -> NestedOptionType.NestedEnum: ... - @classmethod - def keys(cls) -> List[bytes]: ... - @classmethod - def values(cls) -> List[NestedOptionType.NestedEnum]: ... - @classmethod - def items(cls) -> List[Tuple[bytes, NestedOptionType.NestedEnum]]: ... - NESTED_ENUM_VALUE: NestedOptionType.NestedEnum - class NestedMessage(Message): - nested_field: int - def __init__(self, nested_field: Optional[int] = ...) -> None: ... - def __init__(self,) -> None: ... - -class OldOptionType(Message): - class TestEnum(int): - @classmethod - def Name(cls, number: int) -> bytes: ... - @classmethod - def Value(cls, name: bytes) -> OldOptionType.TestEnum: ... - @classmethod - def keys(cls) -> List[bytes]: ... - @classmethod - def values(cls) -> List[OldOptionType.TestEnum]: ... - @classmethod - def items(cls) -> List[Tuple[bytes, OldOptionType.TestEnum]]: ... - OLD_VALUE: OldOptionType.TestEnum - value: OldOptionType.TestEnum - def __init__(self, value: OldOptionType.TestEnum) -> None: ... - -class NewOptionType(Message): - class TestEnum(int): - @classmethod - def Name(cls, number: int) -> bytes: ... - @classmethod - def Value(cls, name: bytes) -> NewOptionType.TestEnum: ... - @classmethod - def keys(cls) -> List[bytes]: ... - @classmethod - def values(cls) -> List[NewOptionType.TestEnum]: ... - @classmethod - def items(cls) -> List[Tuple[bytes, NewOptionType.TestEnum]]: ... - OLD_VALUE: NewOptionType.TestEnum - NEW_VALUE: NewOptionType.TestEnum - value: NewOptionType.TestEnum - def __init__(self, value: NewOptionType.TestEnum) -> None: ... - -class TestMessageWithRequiredEnumOption(Message): - def __init__(self,) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_import_pb2.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_import_pb2.pyi deleted file mode 100755 index 3d4b91cf..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_import_pb2.pyi +++ /dev/null @@ -1,38 +0,0 @@ -from google.protobuf.message import Message -from typing import List, Optional, Tuple, cast - -class ImportEnum(int): - @classmethod - def Name(cls, number: int) -> bytes: ... - @classmethod - def Value(cls, name: bytes) -> ImportEnum: ... - @classmethod - def keys(cls) -> List[bytes]: ... - @classmethod - def values(cls) -> List[ImportEnum]: ... - @classmethod - def items(cls) -> List[Tuple[bytes, ImportEnum]]: ... - -IMPORT_FOO: ImportEnum -IMPORT_BAR: ImportEnum -IMPORT_BAZ: ImportEnum - -class ImportEnumForMap(int): - @classmethod - def Name(cls, number: int) -> bytes: ... - @classmethod - def Value(cls, name: bytes) -> ImportEnumForMap: ... - @classmethod - def keys(cls) -> List[bytes]: ... - @classmethod - def values(cls) -> List[ImportEnumForMap]: ... - @classmethod - def items(cls) -> List[Tuple[bytes, ImportEnumForMap]]: ... - -UNKNOWN: ImportEnumForMap -FOO: ImportEnumForMap -BAR: ImportEnumForMap - -class ImportMessage(Message): - d: int - def __init__(self, d: Optional[int] = ...) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_import_public_pb2.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_import_public_pb2.pyi deleted file mode 100755 index db231560..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_import_public_pb2.pyi +++ /dev/null @@ -1,6 +0,0 @@ -from google.protobuf.message import Message -from typing import Optional - -class PublicImportMessage(Message): - e: int - def __init__(self, e: Optional[int] = ...) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_mset_pb2.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_mset_pb2.pyi deleted file mode 100755 index 60a204c2..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_mset_pb2.pyi +++ /dev/null @@ -1,27 +0,0 @@ -from google.protobuf.internal.containers import RepeatedCompositeFieldContainer -from google.protobuf.message import Message -from google.protobuf.unittest_mset_wire_format_pb2 import TestMessageSet -import builtins -from typing import Iterable, Optional, Text - -class TestMessageSetContainer(Message): - @property - def message_set(self) -> TestMessageSet: ... - def __init__(self, message_set: Optional[TestMessageSet] = ...) -> None: ... - -class TestMessageSetExtension1(Message): - i: int - def __init__(self, i: Optional[int] = ...) -> None: ... - -class TestMessageSetExtension2(Message): - str: Text - def __init__(self, bytes: Optional[Text] = ...) -> None: ... - -class RawMessageSet(Message): - class Item(Message): - type_id: int - message: bytes - def __init__(self, type_id: int, message: bytes) -> None: ... - @property - def item(self) -> RepeatedCompositeFieldContainer[RawMessageSet.Item]: ... - def __init__(self, item: Optional[Iterable[RawMessageSet.Item]] = ...) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_mset_wire_format_pb2.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_mset_wire_format_pb2.pyi deleted file mode 100755 index 2414cd08..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_mset_wire_format_pb2.pyi +++ /dev/null @@ -1,10 +0,0 @@ -from google.protobuf.message import Message -from typing import Optional - -class TestMessageSet(Message): - def __init__(self,) -> None: ... - -class TestMessageSetWireFormatContainer(Message): - @property - def message_set(self) -> TestMessageSet: ... - def __init__(self, message_set: Optional[TestMessageSet] = ...) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_no_arena_import_pb2.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_no_arena_import_pb2.pyi deleted file mode 100755 index e3032a68..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_no_arena_import_pb2.pyi +++ /dev/null @@ -1,6 +0,0 @@ -from google.protobuf.message import Message -from typing import Optional - -class ImportNoArenaNestedMessage(Message): - d: int - def __init__(self, d: Optional[int] = ...) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_no_arena_pb2.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_no_arena_pb2.pyi deleted file mode 100755 index 57c40294..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_no_arena_pb2.pyi +++ /dev/null @@ -1,225 +0,0 @@ -from google.protobuf.internal.containers import RepeatedCompositeFieldContainer, RepeatedScalarFieldContainer -from google.protobuf.message import Message -from google.protobuf.unittest_arena_pb2 import ArenaMessage -from google.protobuf.unittest_import_pb2 import ImportEnum, ImportMessage -from google.protobuf.unittest_import_public_pb2 import PublicImportMessage -from typing import Iterable, List, Optional, Text, Tuple, cast - -class ForeignEnum(int): - @classmethod - def Name(cls, number: int) -> bytes: ... - @classmethod - def Value(cls, name: bytes) -> ForeignEnum: ... - @classmethod - def keys(cls) -> List[bytes]: ... - @classmethod - def values(cls) -> List[ForeignEnum]: ... - @classmethod - def items(cls) -> List[Tuple[bytes, ForeignEnum]]: ... - -FOREIGN_FOO: ForeignEnum -FOREIGN_BAR: ForeignEnum -FOREIGN_BAZ: ForeignEnum - -class TestAllTypes(Message): - class NestedEnum(int): - @classmethod - def Name(cls, number: int) -> bytes: ... - @classmethod - def Value(cls, name: bytes) -> TestAllTypes.NestedEnum: ... - @classmethod - def keys(cls) -> List[bytes]: ... - @classmethod - def values(cls) -> List[TestAllTypes.NestedEnum]: ... - @classmethod - def items(cls) -> List[Tuple[bytes, TestAllTypes.NestedEnum]]: ... - FOO: TestAllTypes.NestedEnum - BAR: TestAllTypes.NestedEnum - BAZ: TestAllTypes.NestedEnum - NEG: TestAllTypes.NestedEnum - class NestedMessage(Message): - bb: int - def __init__(self, bb: Optional[int] = ...) -> None: ... - class OptionalGroup(Message): - a: int - def __init__(self, a: Optional[int] = ...) -> None: ... - class RepeatedGroup(Message): - a: int - def __init__(self, a: Optional[int] = ...) -> None: ... - optional_int32: int - optional_int64: int - optional_uint32: int - optional_uint64: int - optional_sint32: int - optional_sint64: int - optional_fixed32: int - optional_fixed64: int - optional_sfixed32: int - optional_sfixed64: int - optional_float: float - optional_double: float - optional_bool: bool - optional_string: Text - optional_bytes: bytes - optional_nested_enum: TestAllTypes.NestedEnum - optional_foreign_enum: ForeignEnum - optional_import_enum: ImportEnum - optional_string_piece: Text - optional_cord: Text - repeated_int32: RepeatedScalarFieldContainer[int] - repeated_int64: RepeatedScalarFieldContainer[int] - repeated_uint32: RepeatedScalarFieldContainer[int] - repeated_uint64: RepeatedScalarFieldContainer[int] - repeated_sint32: RepeatedScalarFieldContainer[int] - repeated_sint64: RepeatedScalarFieldContainer[int] - repeated_fixed32: RepeatedScalarFieldContainer[int] - repeated_fixed64: RepeatedScalarFieldContainer[int] - repeated_sfixed32: RepeatedScalarFieldContainer[int] - repeated_sfixed64: RepeatedScalarFieldContainer[int] - repeated_float: RepeatedScalarFieldContainer[float] - repeated_double: RepeatedScalarFieldContainer[float] - repeated_bool: RepeatedScalarFieldContainer[bool] - repeated_string: RepeatedScalarFieldContainer[Text] - repeated_bytes: RepeatedScalarFieldContainer[bytes] - repeated_nested_enum: RepeatedScalarFieldContainer[TestAllTypes.NestedEnum] - repeated_foreign_enum: RepeatedScalarFieldContainer[ForeignEnum] - repeated_import_enum: RepeatedScalarFieldContainer[ImportEnum] - repeated_string_piece: RepeatedScalarFieldContainer[Text] - repeated_cord: RepeatedScalarFieldContainer[Text] - default_int32: int - default_int64: int - default_uint32: int - default_uint64: int - default_sint32: int - default_sint64: int - default_fixed32: int - default_fixed64: int - default_sfixed32: int - default_sfixed64: int - default_float: float - default_double: float - default_bool: bool - default_string: Text - default_bytes: bytes - default_nested_enum: TestAllTypes.NestedEnum - default_foreign_enum: ForeignEnum - default_import_enum: ImportEnum - default_string_piece: Text - default_cord: Text - oneof_uint32: int - oneof_string: Text - oneof_bytes: bytes - @property - def optionalgroup(self) -> TestAllTypes.OptionalGroup: ... - @property - def optional_nested_message(self) -> TestAllTypes.NestedMessage: ... - @property - def optional_foreign_message(self) -> ForeignMessage: ... - @property - def optional_import_message(self) -> ImportMessage: ... - @property - def optional_public_import_message(self) -> PublicImportMessage: ... - @property - def optional_message(self) -> TestAllTypes.NestedMessage: ... - @property - def repeatedgroup(self) -> RepeatedCompositeFieldContainer[TestAllTypes.RepeatedGroup]: ... - @property - def repeated_nested_message(self) -> RepeatedCompositeFieldContainer[TestAllTypes.NestedMessage]: ... - @property - def repeated_foreign_message(self) -> RepeatedCompositeFieldContainer[ForeignMessage]: ... - @property - def repeated_import_message(self) -> RepeatedCompositeFieldContainer[ImportMessage]: ... - @property - def repeated_lazy_message(self) -> RepeatedCompositeFieldContainer[TestAllTypes.NestedMessage]: ... - @property - def oneof_nested_message(self) -> TestAllTypes.NestedMessage: ... - @property - def lazy_oneof_nested_message(self) -> TestAllTypes.NestedMessage: ... - def __init__( - self, - optional_int32: Optional[int] = ..., - optional_int64: Optional[int] = ..., - optional_uint32: Optional[int] = ..., - optional_uint64: Optional[int] = ..., - optional_sint32: Optional[int] = ..., - optional_sint64: Optional[int] = ..., - optional_fixed32: Optional[int] = ..., - optional_fixed64: Optional[int] = ..., - optional_sfixed32: Optional[int] = ..., - optional_sfixed64: Optional[int] = ..., - optional_float: Optional[float] = ..., - optional_double: Optional[float] = ..., - optional_bool: Optional[bool] = ..., - optional_string: Optional[Text] = ..., - optional_bytes: Optional[bytes] = ..., - optionalgroup: Optional[TestAllTypes.OptionalGroup] = ..., - optional_nested_message: Optional[TestAllTypes.NestedMessage] = ..., - optional_foreign_message: Optional[ForeignMessage] = ..., - optional_import_message: Optional[ImportMessage] = ..., - optional_nested_enum: Optional[TestAllTypes.NestedEnum] = ..., - optional_foreign_enum: Optional[ForeignEnum] = ..., - optional_import_enum: Optional[ImportEnum] = ..., - optional_string_piece: Optional[Text] = ..., - optional_cord: Optional[Text] = ..., - optional_public_import_message: Optional[PublicImportMessage] = ..., - optional_message: Optional[TestAllTypes.NestedMessage] = ..., - repeated_int32: Optional[Iterable[int]] = ..., - repeated_int64: Optional[Iterable[int]] = ..., - repeated_uint32: Optional[Iterable[int]] = ..., - repeated_uint64: Optional[Iterable[int]] = ..., - repeated_sint32: Optional[Iterable[int]] = ..., - repeated_sint64: Optional[Iterable[int]] = ..., - repeated_fixed32: Optional[Iterable[int]] = ..., - repeated_fixed64: Optional[Iterable[int]] = ..., - repeated_sfixed32: Optional[Iterable[int]] = ..., - repeated_sfixed64: Optional[Iterable[int]] = ..., - repeated_float: Optional[Iterable[float]] = ..., - repeated_double: Optional[Iterable[float]] = ..., - repeated_bool: Optional[Iterable[bool]] = ..., - repeated_string: Optional[Iterable[Text]] = ..., - repeated_bytes: Optional[Iterable[bytes]] = ..., - repeatedgroup: Optional[Iterable[TestAllTypes.RepeatedGroup]] = ..., - repeated_nested_message: Optional[Iterable[TestAllTypes.NestedMessage]] = ..., - repeated_foreign_message: Optional[Iterable[ForeignMessage]] = ..., - repeated_import_message: Optional[Iterable[ImportMessage]] = ..., - repeated_nested_enum: Optional[Iterable[TestAllTypes.NestedEnum]] = ..., - repeated_foreign_enum: Optional[Iterable[ForeignEnum]] = ..., - repeated_import_enum: Optional[Iterable[ImportEnum]] = ..., - repeated_string_piece: Optional[Iterable[Text]] = ..., - repeated_cord: Optional[Iterable[Text]] = ..., - repeated_lazy_message: Optional[Iterable[TestAllTypes.NestedMessage]] = ..., - default_int32: Optional[int] = ..., - default_int64: Optional[int] = ..., - default_uint32: Optional[int] = ..., - default_uint64: Optional[int] = ..., - default_sint32: Optional[int] = ..., - default_sint64: Optional[int] = ..., - default_fixed32: Optional[int] = ..., - default_fixed64: Optional[int] = ..., - default_sfixed32: Optional[int] = ..., - default_sfixed64: Optional[int] = ..., - default_float: Optional[float] = ..., - default_double: Optional[float] = ..., - default_bool: Optional[bool] = ..., - default_string: Optional[Text] = ..., - default_bytes: Optional[bytes] = ..., - default_nested_enum: Optional[TestAllTypes.NestedEnum] = ..., - default_foreign_enum: Optional[ForeignEnum] = ..., - default_import_enum: Optional[ImportEnum] = ..., - default_string_piece: Optional[Text] = ..., - default_cord: Optional[Text] = ..., - oneof_uint32: Optional[int] = ..., - oneof_nested_message: Optional[TestAllTypes.NestedMessage] = ..., - oneof_string: Optional[Text] = ..., - oneof_bytes: Optional[bytes] = ..., - lazy_oneof_nested_message: Optional[TestAllTypes.NestedMessage] = ..., - ) -> None: ... - -class ForeignMessage(Message): - c: int - def __init__(self, c: Optional[int] = ...) -> None: ... - -class TestNoArenaMessage(Message): - @property - def arena_message(self) -> ArenaMessage: ... - def __init__(self, arena_message: Optional[ArenaMessage] = ...) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_no_generic_services_pb2.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_no_generic_services_pb2.pyi deleted file mode 100755 index 2a9b7ae1..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_no_generic_services_pb2.pyi +++ /dev/null @@ -1,20 +0,0 @@ -from google.protobuf.message import Message -from typing import List, Optional, Tuple, cast - -class TestEnum(int): - @classmethod - def Name(cls, number: int) -> bytes: ... - @classmethod - def Value(cls, name: bytes) -> TestEnum: ... - @classmethod - def keys(cls) -> List[bytes]: ... - @classmethod - def values(cls) -> List[TestEnum]: ... - @classmethod - def items(cls) -> List[Tuple[bytes, TestEnum]]: ... - -FOO: TestEnum - -class TestMessage(Message): - a: int - def __init__(self, a: Optional[int] = ...) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_pb2.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_pb2.pyi deleted file mode 100755 index 26bc9173..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_pb2.pyi +++ /dev/null @@ -1,1083 +0,0 @@ -from google.protobuf.internal.containers import RepeatedCompositeFieldContainer, RepeatedScalarFieldContainer -from google.protobuf.message import Message -from google.protobuf.unittest_import_pb2 import ImportEnum, ImportMessage -from google.protobuf.unittest_import_public_pb2 import PublicImportMessage -from typing import Iterable, List, Mapping, MutableMapping, Optional, Text, Tuple, cast - -class ForeignEnum(int): - @classmethod - def Name(cls, number: int) -> bytes: ... - @classmethod - def Value(cls, name: bytes) -> ForeignEnum: ... - @classmethod - def keys(cls) -> List[bytes]: ... - @classmethod - def values(cls) -> List[ForeignEnum]: ... - @classmethod - def items(cls) -> List[Tuple[bytes, ForeignEnum]]: ... - -FOREIGN_FOO: ForeignEnum -FOREIGN_BAR: ForeignEnum -FOREIGN_BAZ: ForeignEnum - -class TestEnumWithDupValue(int): - @classmethod - def Name(cls, number: int) -> bytes: ... - @classmethod - def Value(cls, name: bytes) -> TestEnumWithDupValue: ... - @classmethod - def keys(cls) -> List[bytes]: ... - @classmethod - def values(cls) -> List[TestEnumWithDupValue]: ... - @classmethod - def items(cls) -> List[Tuple[bytes, TestEnumWithDupValue]]: ... - -FOO1: TestEnumWithDupValue -BAR1: TestEnumWithDupValue -BAZ: TestEnumWithDupValue -FOO2: TestEnumWithDupValue -BAR2: TestEnumWithDupValue - -class TestSparseEnum(int): - @classmethod - def Name(cls, number: int) -> bytes: ... - @classmethod - def Value(cls, name: bytes) -> TestSparseEnum: ... - @classmethod - def keys(cls) -> List[bytes]: ... - @classmethod - def values(cls) -> List[TestSparseEnum]: ... - @classmethod - def items(cls) -> List[Tuple[bytes, TestSparseEnum]]: ... - -SPARSE_A: TestSparseEnum -SPARSE_B: TestSparseEnum -SPARSE_C: TestSparseEnum -SPARSE_D: TestSparseEnum -SPARSE_E: TestSparseEnum -SPARSE_F: TestSparseEnum -SPARSE_G: TestSparseEnum - -class TestAllTypes(Message): - class NestedEnum(int): - @classmethod - def Name(cls, number: int) -> bytes: ... - @classmethod - def Value(cls, name: bytes) -> TestAllTypes.NestedEnum: ... - @classmethod - def keys(cls) -> List[bytes]: ... - @classmethod - def values(cls) -> List[TestAllTypes.NestedEnum]: ... - @classmethod - def items(cls) -> List[Tuple[bytes, TestAllTypes.NestedEnum]]: ... - FOO: TestAllTypes.NestedEnum - BAR: TestAllTypes.NestedEnum - BAZ: TestAllTypes.NestedEnum - NEG: TestAllTypes.NestedEnum - class NestedMessage(Message): - bb: int - def __init__(self, bb: Optional[int] = ...) -> None: ... - class OptionalGroup(Message): - a: int - def __init__(self, a: Optional[int] = ...) -> None: ... - class RepeatedGroup(Message): - a: int - def __init__(self, a: Optional[int] = ...) -> None: ... - optional_int32: int - optional_int64: int - optional_uint32: int - optional_uint64: int - optional_sint32: int - optional_sint64: int - optional_fixed32: int - optional_fixed64: int - optional_sfixed32: int - optional_sfixed64: int - optional_float: float - optional_double: float - optional_bool: bool - optional_string: Text - optional_bytes: bytes - optional_nested_enum: TestAllTypes.NestedEnum - optional_foreign_enum: ForeignEnum - optional_import_enum: ImportEnum - optional_string_piece: Text - optional_cord: Text - repeated_int32: RepeatedScalarFieldContainer[int] - repeated_int64: RepeatedScalarFieldContainer[int] - repeated_uint32: RepeatedScalarFieldContainer[int] - repeated_uint64: RepeatedScalarFieldContainer[int] - repeated_sint32: RepeatedScalarFieldContainer[int] - repeated_sint64: RepeatedScalarFieldContainer[int] - repeated_fixed32: RepeatedScalarFieldContainer[int] - repeated_fixed64: RepeatedScalarFieldContainer[int] - repeated_sfixed32: RepeatedScalarFieldContainer[int] - repeated_sfixed64: RepeatedScalarFieldContainer[int] - repeated_float: RepeatedScalarFieldContainer[float] - repeated_double: RepeatedScalarFieldContainer[float] - repeated_bool: RepeatedScalarFieldContainer[bool] - repeated_string: RepeatedScalarFieldContainer[Text] - repeated_bytes: RepeatedScalarFieldContainer[bytes] - repeated_nested_enum: RepeatedScalarFieldContainer[TestAllTypes.NestedEnum] - repeated_foreign_enum: RepeatedScalarFieldContainer[ForeignEnum] - repeated_import_enum: RepeatedScalarFieldContainer[ImportEnum] - repeated_string_piece: RepeatedScalarFieldContainer[Text] - repeated_cord: RepeatedScalarFieldContainer[Text] - default_int32: int - default_int64: int - default_uint32: int - default_uint64: int - default_sint32: int - default_sint64: int - default_fixed32: int - default_fixed64: int - default_sfixed32: int - default_sfixed64: int - default_float: float - default_double: float - default_bool: bool - default_string: Text - default_bytes: bytes - default_nested_enum: TestAllTypes.NestedEnum - default_foreign_enum: ForeignEnum - default_import_enum: ImportEnum - default_string_piece: Text - default_cord: Text - oneof_uint32: int - oneof_string: Text - oneof_bytes: bytes - @property - def optionalgroup(self) -> TestAllTypes.OptionalGroup: ... - @property - def optional_nested_message(self) -> TestAllTypes.NestedMessage: ... - @property - def optional_foreign_message(self) -> ForeignMessage: ... - @property - def optional_import_message(self) -> ImportMessage: ... - @property - def optional_public_import_message(self) -> PublicImportMessage: ... - @property - def optional_lazy_message(self) -> TestAllTypes.NestedMessage: ... - @property - def repeatedgroup(self) -> RepeatedCompositeFieldContainer[TestAllTypes.RepeatedGroup]: ... - @property - def repeated_nested_message(self) -> RepeatedCompositeFieldContainer[TestAllTypes.NestedMessage]: ... - @property - def repeated_foreign_message(self) -> RepeatedCompositeFieldContainer[ForeignMessage]: ... - @property - def repeated_import_message(self) -> RepeatedCompositeFieldContainer[ImportMessage]: ... - @property - def repeated_lazy_message(self) -> RepeatedCompositeFieldContainer[TestAllTypes.NestedMessage]: ... - @property - def oneof_nested_message(self) -> TestAllTypes.NestedMessage: ... - def __init__( - self, - optional_int32: Optional[int] = ..., - optional_int64: Optional[int] = ..., - optional_uint32: Optional[int] = ..., - optional_uint64: Optional[int] = ..., - optional_sint32: Optional[int] = ..., - optional_sint64: Optional[int] = ..., - optional_fixed32: Optional[int] = ..., - optional_fixed64: Optional[int] = ..., - optional_sfixed32: Optional[int] = ..., - optional_sfixed64: Optional[int] = ..., - optional_float: Optional[float] = ..., - optional_double: Optional[float] = ..., - optional_bool: Optional[bool] = ..., - optional_string: Optional[Text] = ..., - optional_bytes: Optional[bytes] = ..., - optionalgroup: Optional[TestAllTypes.OptionalGroup] = ..., - optional_nested_message: Optional[TestAllTypes.NestedMessage] = ..., - optional_foreign_message: Optional[ForeignMessage] = ..., - optional_import_message: Optional[ImportMessage] = ..., - optional_nested_enum: Optional[TestAllTypes.NestedEnum] = ..., - optional_foreign_enum: Optional[ForeignEnum] = ..., - optional_import_enum: Optional[ImportEnum] = ..., - optional_string_piece: Optional[Text] = ..., - optional_cord: Optional[Text] = ..., - optional_public_import_message: Optional[PublicImportMessage] = ..., - optional_lazy_message: Optional[TestAllTypes.NestedMessage] = ..., - repeated_int32: Optional[Iterable[int]] = ..., - repeated_int64: Optional[Iterable[int]] = ..., - repeated_uint32: Optional[Iterable[int]] = ..., - repeated_uint64: Optional[Iterable[int]] = ..., - repeated_sint32: Optional[Iterable[int]] = ..., - repeated_sint64: Optional[Iterable[int]] = ..., - repeated_fixed32: Optional[Iterable[int]] = ..., - repeated_fixed64: Optional[Iterable[int]] = ..., - repeated_sfixed32: Optional[Iterable[int]] = ..., - repeated_sfixed64: Optional[Iterable[int]] = ..., - repeated_float: Optional[Iterable[float]] = ..., - repeated_double: Optional[Iterable[float]] = ..., - repeated_bool: Optional[Iterable[bool]] = ..., - repeated_string: Optional[Iterable[Text]] = ..., - repeated_bytes: Optional[Iterable[bytes]] = ..., - repeatedgroup: Optional[Iterable[TestAllTypes.RepeatedGroup]] = ..., - repeated_nested_message: Optional[Iterable[TestAllTypes.NestedMessage]] = ..., - repeated_foreign_message: Optional[Iterable[ForeignMessage]] = ..., - repeated_import_message: Optional[Iterable[ImportMessage]] = ..., - repeated_nested_enum: Optional[Iterable[TestAllTypes.NestedEnum]] = ..., - repeated_foreign_enum: Optional[Iterable[ForeignEnum]] = ..., - repeated_import_enum: Optional[Iterable[ImportEnum]] = ..., - repeated_string_piece: Optional[Iterable[Text]] = ..., - repeated_cord: Optional[Iterable[Text]] = ..., - repeated_lazy_message: Optional[Iterable[TestAllTypes.NestedMessage]] = ..., - default_int32: Optional[int] = ..., - default_int64: Optional[int] = ..., - default_uint32: Optional[int] = ..., - default_uint64: Optional[int] = ..., - default_sint32: Optional[int] = ..., - default_sint64: Optional[int] = ..., - default_fixed32: Optional[int] = ..., - default_fixed64: Optional[int] = ..., - default_sfixed32: Optional[int] = ..., - default_sfixed64: Optional[int] = ..., - default_float: Optional[float] = ..., - default_double: Optional[float] = ..., - default_bool: Optional[bool] = ..., - default_string: Optional[Text] = ..., - default_bytes: Optional[bytes] = ..., - default_nested_enum: Optional[TestAllTypes.NestedEnum] = ..., - default_foreign_enum: Optional[ForeignEnum] = ..., - default_import_enum: Optional[ImportEnum] = ..., - default_string_piece: Optional[Text] = ..., - default_cord: Optional[Text] = ..., - oneof_uint32: Optional[int] = ..., - oneof_nested_message: Optional[TestAllTypes.NestedMessage] = ..., - oneof_string: Optional[Text] = ..., - oneof_bytes: Optional[bytes] = ..., - ) -> None: ... - -class NestedTestAllTypes(Message): - @property - def child(self) -> NestedTestAllTypes: ... - @property - def payload(self) -> TestAllTypes: ... - @property - def repeated_child(self) -> RepeatedCompositeFieldContainer[NestedTestAllTypes]: ... - def __init__( - self, - child: Optional[NestedTestAllTypes] = ..., - payload: Optional[TestAllTypes] = ..., - repeated_child: Optional[Iterable[NestedTestAllTypes]] = ..., - ) -> None: ... - -class TestDeprecatedFields(Message): - deprecated_int32: int - deprecated_int32_in_oneof: int - def __init__(self, deprecated_int32: Optional[int] = ..., deprecated_int32_in_oneof: Optional[int] = ...) -> None: ... - -class TestDeprecatedMessage(Message): - def __init__(self,) -> None: ... - -class ForeignMessage(Message): - c: int - d: int - def __init__(self, c: Optional[int] = ..., d: Optional[int] = ...) -> None: ... - -class TestReservedFields(Message): - def __init__(self,) -> None: ... - -class TestAllExtensions(Message): - def __init__(self,) -> None: ... - -class OptionalGroup_extension(Message): - a: int - def __init__(self, a: Optional[int] = ...) -> None: ... - -class RepeatedGroup_extension(Message): - a: int - def __init__(self, a: Optional[int] = ...) -> None: ... - -class TestGroup(Message): - class OptionalGroup(Message): - a: int - def __init__(self, a: Optional[int] = ...) -> None: ... - optional_foreign_enum: ForeignEnum - @property - def optionalgroup(self) -> TestGroup.OptionalGroup: ... - def __init__( - self, optionalgroup: Optional[TestGroup.OptionalGroup] = ..., optional_foreign_enum: Optional[ForeignEnum] = ... - ) -> None: ... - -class TestGroupExtension(Message): - def __init__(self,) -> None: ... - -class TestNestedExtension(Message): - class OptionalGroup_extension(Message): - a: int - def __init__(self, a: Optional[int] = ...) -> None: ... - def __init__(self,) -> None: ... - -class TestRequired(Message): - a: int - dummy2: int - b: int - dummy4: int - dummy5: int - dummy6: int - dummy7: int - dummy8: int - dummy9: int - dummy10: int - dummy11: int - dummy12: int - dummy13: int - dummy14: int - dummy15: int - dummy16: int - dummy17: int - dummy18: int - dummy19: int - dummy20: int - dummy21: int - dummy22: int - dummy23: int - dummy24: int - dummy25: int - dummy26: int - dummy27: int - dummy28: int - dummy29: int - dummy30: int - dummy31: int - dummy32: int - c: int - def __init__( - self, - a: int, - b: int, - c: int, - dummy2: Optional[int] = ..., - dummy4: Optional[int] = ..., - dummy5: Optional[int] = ..., - dummy6: Optional[int] = ..., - dummy7: Optional[int] = ..., - dummy8: Optional[int] = ..., - dummy9: Optional[int] = ..., - dummy10: Optional[int] = ..., - dummy11: Optional[int] = ..., - dummy12: Optional[int] = ..., - dummy13: Optional[int] = ..., - dummy14: Optional[int] = ..., - dummy15: Optional[int] = ..., - dummy16: Optional[int] = ..., - dummy17: Optional[int] = ..., - dummy18: Optional[int] = ..., - dummy19: Optional[int] = ..., - dummy20: Optional[int] = ..., - dummy21: Optional[int] = ..., - dummy22: Optional[int] = ..., - dummy23: Optional[int] = ..., - dummy24: Optional[int] = ..., - dummy25: Optional[int] = ..., - dummy26: Optional[int] = ..., - dummy27: Optional[int] = ..., - dummy28: Optional[int] = ..., - dummy29: Optional[int] = ..., - dummy30: Optional[int] = ..., - dummy31: Optional[int] = ..., - dummy32: Optional[int] = ..., - ) -> None: ... - -class TestRequiredForeign(Message): - dummy: int - @property - def optional_message(self) -> TestRequired: ... - @property - def repeated_message(self) -> RepeatedCompositeFieldContainer[TestRequired]: ... - def __init__( - self, - optional_message: Optional[TestRequired] = ..., - repeated_message: Optional[Iterable[TestRequired]] = ..., - dummy: Optional[int] = ..., - ) -> None: ... - -class TestRequiredMessage(Message): - @property - def optional_message(self) -> TestRequired: ... - @property - def repeated_message(self) -> RepeatedCompositeFieldContainer[TestRequired]: ... - @property - def required_message(self) -> TestRequired: ... - def __init__( - self, - required_message: TestRequired, - optional_message: Optional[TestRequired] = ..., - repeated_message: Optional[Iterable[TestRequired]] = ..., - ) -> None: ... - -class TestForeignNested(Message): - @property - def foreign_nested(self) -> TestAllTypes.NestedMessage: ... - def __init__(self, foreign_nested: Optional[TestAllTypes.NestedMessage] = ...) -> None: ... - -class TestEmptyMessage(Message): - def __init__(self,) -> None: ... - -class TestEmptyMessageWithExtensions(Message): - def __init__(self,) -> None: ... - -class TestMultipleExtensionRanges(Message): - def __init__(self,) -> None: ... - -class TestReallyLargeTagNumber(Message): - a: int - bb: int - def __init__(self, a: Optional[int] = ..., bb: Optional[int] = ...) -> None: ... - -class TestRecursiveMessage(Message): - i: int - @property - def a(self) -> TestRecursiveMessage: ... - def __init__(self, a: Optional[TestRecursiveMessage] = ..., i: Optional[int] = ...) -> None: ... - -class TestMutualRecursionA(Message): - class SubMessage(Message): - @property - def b(self) -> TestMutualRecursionB: ... - def __init__(self, b: Optional[TestMutualRecursionB] = ...) -> None: ... - class SubGroup(Message): - @property - def sub_message(self) -> TestMutualRecursionA.SubMessage: ... - @property - def not_in_this_scc(self) -> TestAllTypes: ... - def __init__( - self, sub_message: Optional[TestMutualRecursionA.SubMessage] = ..., not_in_this_scc: Optional[TestAllTypes] = ... - ) -> None: ... - @property - def bb(self) -> TestMutualRecursionB: ... - @property - def subgroup(self) -> TestMutualRecursionA.SubGroup: ... - def __init__( - self, bb: Optional[TestMutualRecursionB] = ..., subgroup: Optional[TestMutualRecursionA.SubGroup] = ... - ) -> None: ... - -class TestMutualRecursionB(Message): - optional_int32: int - @property - def a(self) -> TestMutualRecursionA: ... - def __init__(self, a: Optional[TestMutualRecursionA] = ..., optional_int32: Optional[int] = ...) -> None: ... - -class TestIsInitialized(Message): - class SubMessage(Message): - class SubGroup(Message): - i: int - def __init__(self, i: int) -> None: ... - @property - def subgroup(self) -> TestIsInitialized.SubMessage.SubGroup: ... - def __init__(self, subgroup: Optional[TestIsInitialized.SubMessage.SubGroup] = ...) -> None: ... - @property - def sub_message(self) -> TestIsInitialized.SubMessage: ... - def __init__(self, sub_message: Optional[TestIsInitialized.SubMessage] = ...) -> None: ... - -class TestDupFieldNumber(Message): - class Foo(Message): - a: int - def __init__(self, a: Optional[int] = ...) -> None: ... - class Bar(Message): - a: int - def __init__(self, a: Optional[int] = ...) -> None: ... - a: int - @property - def foo(self) -> TestDupFieldNumber.Foo: ... - @property - def bar(self) -> TestDupFieldNumber.Bar: ... - def __init__( - self, a: Optional[int] = ..., foo: Optional[TestDupFieldNumber.Foo] = ..., bar: Optional[TestDupFieldNumber.Bar] = ... - ) -> None: ... - -class TestEagerMessage(Message): - @property - def sub_message(self) -> TestAllTypes: ... - def __init__(self, sub_message: Optional[TestAllTypes] = ...) -> None: ... - -class TestLazyMessage(Message): - @property - def sub_message(self) -> TestAllTypes: ... - def __init__(self, sub_message: Optional[TestAllTypes] = ...) -> None: ... - -class TestNestedMessageHasBits(Message): - class NestedMessage(Message): - nestedmessage_repeated_int32: RepeatedScalarFieldContainer[int] - @property - def nestedmessage_repeated_foreignmessage(self) -> RepeatedCompositeFieldContainer[ForeignMessage]: ... - def __init__( - self, - nestedmessage_repeated_int32: Optional[Iterable[int]] = ..., - nestedmessage_repeated_foreignmessage: Optional[Iterable[ForeignMessage]] = ..., - ) -> None: ... - @property - def optional_nested_message(self) -> TestNestedMessageHasBits.NestedMessage: ... - def __init__(self, optional_nested_message: Optional[TestNestedMessageHasBits.NestedMessage] = ...) -> None: ... - -class TestCamelCaseFieldNames(Message): - PrimitiveField: int - StringField: Text - EnumField: ForeignEnum - StringPieceField: Text - CordField: Text - RepeatedPrimitiveField: RepeatedScalarFieldContainer[int] - RepeatedStringField: RepeatedScalarFieldContainer[Text] - RepeatedEnumField: RepeatedScalarFieldContainer[ForeignEnum] - RepeatedStringPieceField: RepeatedScalarFieldContainer[Text] - RepeatedCordField: RepeatedScalarFieldContainer[Text] - @property - def MessageField(self) -> ForeignMessage: ... - @property - def RepeatedMessageField(self) -> RepeatedCompositeFieldContainer[ForeignMessage]: ... - def __init__( - self, - PrimitiveField: Optional[int] = ..., - StringField: Optional[Text] = ..., - EnumField: Optional[ForeignEnum] = ..., - MessageField: Optional[ForeignMessage] = ..., - StringPieceField: Optional[Text] = ..., - CordField: Optional[Text] = ..., - RepeatedPrimitiveField: Optional[Iterable[int]] = ..., - RepeatedStringField: Optional[Iterable[Text]] = ..., - RepeatedEnumField: Optional[Iterable[ForeignEnum]] = ..., - RepeatedMessageField: Optional[Iterable[ForeignMessage]] = ..., - RepeatedStringPieceField: Optional[Iterable[Text]] = ..., - RepeatedCordField: Optional[Iterable[Text]] = ..., - ) -> None: ... - -class TestFieldOrderings(Message): - class NestedMessage(Message): - oo: int - bb: int - def __init__(self, oo: Optional[int] = ..., bb: Optional[int] = ...) -> None: ... - my_string: Text - my_int: int - my_float: float - @property - def optional_nested_message(self) -> TestFieldOrderings.NestedMessage: ... - def __init__( - self, - my_string: Optional[Text] = ..., - my_int: Optional[int] = ..., - my_float: Optional[float] = ..., - optional_nested_message: Optional[TestFieldOrderings.NestedMessage] = ..., - ) -> None: ... - -class TestExtensionOrderings1(Message): - my_string: Text - def __init__(self, my_string: Optional[Text] = ...) -> None: ... - -class TestExtensionOrderings2(Message): - class TestExtensionOrderings3(Message): - my_string: Text - def __init__(self, my_string: Optional[Text] = ...) -> None: ... - my_string: Text - def __init__(self, my_string: Optional[Text] = ...) -> None: ... - -class TestExtremeDefaultValues(Message): - escaped_bytes: bytes - large_uint32: int - large_uint64: int - small_int32: int - small_int64: int - really_small_int32: int - really_small_int64: int - utf8_string: Text - zero_float: float - one_float: float - small_float: float - negative_one_float: float - negative_float: float - large_float: float - small_negative_float: float - inf_double: float - neg_inf_double: float - nan_double: float - inf_float: float - neg_inf_float: float - nan_float: float - cpp_trigraph: Text - string_with_zero: Text - bytes_with_zero: bytes - string_piece_with_zero: Text - cord_with_zero: Text - replacement_string: Text - def __init__( - self, - escaped_bytes: Optional[bytes] = ..., - large_uint32: Optional[int] = ..., - large_uint64: Optional[int] = ..., - small_int32: Optional[int] = ..., - small_int64: Optional[int] = ..., - really_small_int32: Optional[int] = ..., - really_small_int64: Optional[int] = ..., - utf8_string: Optional[Text] = ..., - zero_float: Optional[float] = ..., - one_float: Optional[float] = ..., - small_float: Optional[float] = ..., - negative_one_float: Optional[float] = ..., - negative_float: Optional[float] = ..., - large_float: Optional[float] = ..., - small_negative_float: Optional[float] = ..., - inf_double: Optional[float] = ..., - neg_inf_double: Optional[float] = ..., - nan_double: Optional[float] = ..., - inf_float: Optional[float] = ..., - neg_inf_float: Optional[float] = ..., - nan_float: Optional[float] = ..., - cpp_trigraph: Optional[Text] = ..., - string_with_zero: Optional[Text] = ..., - bytes_with_zero: Optional[bytes] = ..., - string_piece_with_zero: Optional[Text] = ..., - cord_with_zero: Optional[Text] = ..., - replacement_string: Optional[Text] = ..., - ) -> None: ... - -class SparseEnumMessage(Message): - sparse_enum: TestSparseEnum - def __init__(self, sparse_enum: Optional[TestSparseEnum] = ...) -> None: ... - -class OneString(Message): - data: Text - def __init__(self, data: Optional[Text] = ...) -> None: ... - -class MoreString(Message): - data: RepeatedScalarFieldContainer[Text] - def __init__(self, data: Optional[Iterable[Text]] = ...) -> None: ... - -class OneBytes(Message): - data: bytes - def __init__(self, data: Optional[bytes] = ...) -> None: ... - -class MoreBytes(Message): - data: RepeatedScalarFieldContainer[bytes] - def __init__(self, data: Optional[Iterable[bytes]] = ...) -> None: ... - -class Int32Message(Message): - data: int - def __init__(self, data: Optional[int] = ...) -> None: ... - -class Uint32Message(Message): - data: int - def __init__(self, data: Optional[int] = ...) -> None: ... - -class Int64Message(Message): - data: int - def __init__(self, data: Optional[int] = ...) -> None: ... - -class Uint64Message(Message): - data: int - def __init__(self, data: Optional[int] = ...) -> None: ... - -class BoolMessage(Message): - data: bool - def __init__(self, data: Optional[bool] = ...) -> None: ... - -class TestOneof(Message): - class FooGroup(Message): - a: int - b: Text - def __init__(self, a: Optional[int] = ..., b: Optional[Text] = ...) -> None: ... - foo_int: int - foo_string: Text - @property - def foo_message(self) -> TestAllTypes: ... - @property - def foogroup(self) -> TestOneof.FooGroup: ... - def __init__( - self, - foo_int: Optional[int] = ..., - foo_string: Optional[Text] = ..., - foo_message: Optional[TestAllTypes] = ..., - foogroup: Optional[TestOneof.FooGroup] = ..., - ) -> None: ... - -class TestOneofBackwardsCompatible(Message): - class FooGroup(Message): - a: int - b: Text - def __init__(self, a: Optional[int] = ..., b: Optional[Text] = ...) -> None: ... - foo_int: int - foo_string: Text - @property - def foo_message(self) -> TestAllTypes: ... - @property - def foogroup(self) -> TestOneofBackwardsCompatible.FooGroup: ... - def __init__( - self, - foo_int: Optional[int] = ..., - foo_string: Optional[Text] = ..., - foo_message: Optional[TestAllTypes] = ..., - foogroup: Optional[TestOneofBackwardsCompatible.FooGroup] = ..., - ) -> None: ... - -class TestOneof2(Message): - class NestedEnum(int): - @classmethod - def Name(cls, number: int) -> bytes: ... - @classmethod - def Value(cls, name: bytes) -> TestOneof2.NestedEnum: ... - @classmethod - def keys(cls) -> List[bytes]: ... - @classmethod - def values(cls) -> List[TestOneof2.NestedEnum]: ... - @classmethod - def items(cls) -> List[Tuple[bytes, TestOneof2.NestedEnum]]: ... - FOO: TestOneof2.NestedEnum - BAR: TestOneof2.NestedEnum - BAZ: TestOneof2.NestedEnum - class FooGroup(Message): - a: int - b: Text - def __init__(self, a: Optional[int] = ..., b: Optional[Text] = ...) -> None: ... - class NestedMessage(Message): - qux_int: int - corge_int: RepeatedScalarFieldContainer[int] - def __init__(self, qux_int: Optional[int] = ..., corge_int: Optional[Iterable[int]] = ...) -> None: ... - foo_int: int - foo_string: Text - foo_cord: Text - foo_string_piece: Text - foo_bytes: bytes - foo_enum: TestOneof2.NestedEnum - bar_int: int - bar_string: Text - bar_cord: Text - bar_string_piece: Text - bar_bytes: bytes - bar_enum: TestOneof2.NestedEnum - baz_int: int - baz_string: Text - @property - def foo_message(self) -> TestOneof2.NestedMessage: ... - @property - def foogroup(self) -> TestOneof2.FooGroup: ... - @property - def foo_lazy_message(self) -> TestOneof2.NestedMessage: ... - def __init__( - self, - foo_int: Optional[int] = ..., - foo_string: Optional[Text] = ..., - foo_cord: Optional[Text] = ..., - foo_string_piece: Optional[Text] = ..., - foo_bytes: Optional[bytes] = ..., - foo_enum: Optional[TestOneof2.NestedEnum] = ..., - foo_message: Optional[TestOneof2.NestedMessage] = ..., - foogroup: Optional[TestOneof2.FooGroup] = ..., - foo_lazy_message: Optional[TestOneof2.NestedMessage] = ..., - bar_int: Optional[int] = ..., - bar_string: Optional[Text] = ..., - bar_cord: Optional[Text] = ..., - bar_string_piece: Optional[Text] = ..., - bar_bytes: Optional[bytes] = ..., - bar_enum: Optional[TestOneof2.NestedEnum] = ..., - baz_int: Optional[int] = ..., - baz_string: Optional[Text] = ..., - ) -> None: ... - -class TestRequiredOneof(Message): - class NestedMessage(Message): - required_double: float - def __init__(self, required_double: float) -> None: ... - foo_int: int - foo_string: Text - @property - def foo_message(self) -> TestRequiredOneof.NestedMessage: ... - def __init__( - self, - foo_int: Optional[int] = ..., - foo_string: Optional[Text] = ..., - foo_message: Optional[TestRequiredOneof.NestedMessage] = ..., - ) -> None: ... - -class TestPackedTypes(Message): - packed_int32: RepeatedScalarFieldContainer[int] - packed_int64: RepeatedScalarFieldContainer[int] - packed_uint32: RepeatedScalarFieldContainer[int] - packed_uint64: RepeatedScalarFieldContainer[int] - packed_sint32: RepeatedScalarFieldContainer[int] - packed_sint64: RepeatedScalarFieldContainer[int] - packed_fixed32: RepeatedScalarFieldContainer[int] - packed_fixed64: RepeatedScalarFieldContainer[int] - packed_sfixed32: RepeatedScalarFieldContainer[int] - packed_sfixed64: RepeatedScalarFieldContainer[int] - packed_float: RepeatedScalarFieldContainer[float] - packed_double: RepeatedScalarFieldContainer[float] - packed_bool: RepeatedScalarFieldContainer[bool] - packed_enum: RepeatedScalarFieldContainer[ForeignEnum] - def __init__( - self, - packed_int32: Optional[Iterable[int]] = ..., - packed_int64: Optional[Iterable[int]] = ..., - packed_uint32: Optional[Iterable[int]] = ..., - packed_uint64: Optional[Iterable[int]] = ..., - packed_sint32: Optional[Iterable[int]] = ..., - packed_sint64: Optional[Iterable[int]] = ..., - packed_fixed32: Optional[Iterable[int]] = ..., - packed_fixed64: Optional[Iterable[int]] = ..., - packed_sfixed32: Optional[Iterable[int]] = ..., - packed_sfixed64: Optional[Iterable[int]] = ..., - packed_float: Optional[Iterable[float]] = ..., - packed_double: Optional[Iterable[float]] = ..., - packed_bool: Optional[Iterable[bool]] = ..., - packed_enum: Optional[Iterable[ForeignEnum]] = ..., - ) -> None: ... - -class TestUnpackedTypes(Message): - unpacked_int32: RepeatedScalarFieldContainer[int] - unpacked_int64: RepeatedScalarFieldContainer[int] - unpacked_uint32: RepeatedScalarFieldContainer[int] - unpacked_uint64: RepeatedScalarFieldContainer[int] - unpacked_sint32: RepeatedScalarFieldContainer[int] - unpacked_sint64: RepeatedScalarFieldContainer[int] - unpacked_fixed32: RepeatedScalarFieldContainer[int] - unpacked_fixed64: RepeatedScalarFieldContainer[int] - unpacked_sfixed32: RepeatedScalarFieldContainer[int] - unpacked_sfixed64: RepeatedScalarFieldContainer[int] - unpacked_float: RepeatedScalarFieldContainer[float] - unpacked_double: RepeatedScalarFieldContainer[float] - unpacked_bool: RepeatedScalarFieldContainer[bool] - unpacked_enum: RepeatedScalarFieldContainer[ForeignEnum] - def __init__( - self, - unpacked_int32: Optional[Iterable[int]] = ..., - unpacked_int64: Optional[Iterable[int]] = ..., - unpacked_uint32: Optional[Iterable[int]] = ..., - unpacked_uint64: Optional[Iterable[int]] = ..., - unpacked_sint32: Optional[Iterable[int]] = ..., - unpacked_sint64: Optional[Iterable[int]] = ..., - unpacked_fixed32: Optional[Iterable[int]] = ..., - unpacked_fixed64: Optional[Iterable[int]] = ..., - unpacked_sfixed32: Optional[Iterable[int]] = ..., - unpacked_sfixed64: Optional[Iterable[int]] = ..., - unpacked_float: Optional[Iterable[float]] = ..., - unpacked_double: Optional[Iterable[float]] = ..., - unpacked_bool: Optional[Iterable[bool]] = ..., - unpacked_enum: Optional[Iterable[ForeignEnum]] = ..., - ) -> None: ... - -class TestPackedExtensions(Message): - def __init__(self,) -> None: ... - -class TestUnpackedExtensions(Message): - def __init__(self,) -> None: ... - -class TestDynamicExtensions(Message): - class DynamicEnumType(int): - @classmethod - def Name(cls, number: int) -> bytes: ... - @classmethod - def Value(cls, name: bytes) -> TestDynamicExtensions.DynamicEnumType: ... - @classmethod - def keys(cls) -> List[bytes]: ... - @classmethod - def values(cls) -> List[TestDynamicExtensions.DynamicEnumType]: ... - @classmethod - def items(cls) -> List[Tuple[bytes, TestDynamicExtensions.DynamicEnumType]]: ... - DYNAMIC_FOO: TestDynamicExtensions.DynamicEnumType - DYNAMIC_BAR: TestDynamicExtensions.DynamicEnumType - DYNAMIC_BAZ: TestDynamicExtensions.DynamicEnumType - class DynamicMessageType(Message): - dynamic_field: int - def __init__(self, dynamic_field: Optional[int] = ...) -> None: ... - scalar_extension: int - enum_extension: ForeignEnum - dynamic_enum_extension: TestDynamicExtensions.DynamicEnumType - repeated_extension: RepeatedScalarFieldContainer[Text] - packed_extension: RepeatedScalarFieldContainer[int] - @property - def message_extension(self) -> ForeignMessage: ... - @property - def dynamic_message_extension(self) -> TestDynamicExtensions.DynamicMessageType: ... - def __init__( - self, - scalar_extension: Optional[int] = ..., - enum_extension: Optional[ForeignEnum] = ..., - dynamic_enum_extension: Optional[TestDynamicExtensions.DynamicEnumType] = ..., - message_extension: Optional[ForeignMessage] = ..., - dynamic_message_extension: Optional[TestDynamicExtensions.DynamicMessageType] = ..., - repeated_extension: Optional[Iterable[Text]] = ..., - packed_extension: Optional[Iterable[int]] = ..., - ) -> None: ... - -class TestRepeatedScalarDifferentTagSizes(Message): - repeated_fixed32: RepeatedScalarFieldContainer[int] - repeated_int32: RepeatedScalarFieldContainer[int] - repeated_fixed64: RepeatedScalarFieldContainer[int] - repeated_int64: RepeatedScalarFieldContainer[int] - repeated_float: RepeatedScalarFieldContainer[float] - repeated_uint64: RepeatedScalarFieldContainer[int] - def __init__( - self, - repeated_fixed32: Optional[Iterable[int]] = ..., - repeated_int32: Optional[Iterable[int]] = ..., - repeated_fixed64: Optional[Iterable[int]] = ..., - repeated_int64: Optional[Iterable[int]] = ..., - repeated_float: Optional[Iterable[float]] = ..., - repeated_uint64: Optional[Iterable[int]] = ..., - ) -> None: ... - -class TestParsingMerge(Message): - class RepeatedFieldsGenerator(Message): - class Group1(Message): - @property - def field1(self) -> TestAllTypes: ... - def __init__(self, field1: Optional[TestAllTypes] = ...) -> None: ... - class Group2(Message): - @property - def field1(self) -> TestAllTypes: ... - def __init__(self, field1: Optional[TestAllTypes] = ...) -> None: ... - @property - def field1(self) -> RepeatedCompositeFieldContainer[TestAllTypes]: ... - @property - def field2(self) -> RepeatedCompositeFieldContainer[TestAllTypes]: ... - @property - def field3(self) -> RepeatedCompositeFieldContainer[TestAllTypes]: ... - @property - def group1(self) -> RepeatedCompositeFieldContainer[TestParsingMerge.RepeatedFieldsGenerator.Group1]: ... - @property - def group2(self) -> RepeatedCompositeFieldContainer[TestParsingMerge.RepeatedFieldsGenerator.Group2]: ... - @property - def ext1(self) -> RepeatedCompositeFieldContainer[TestAllTypes]: ... - @property - def ext2(self) -> RepeatedCompositeFieldContainer[TestAllTypes]: ... - def __init__( - self, - field1: Optional[Iterable[TestAllTypes]] = ..., - field2: Optional[Iterable[TestAllTypes]] = ..., - field3: Optional[Iterable[TestAllTypes]] = ..., - group1: Optional[Iterable[TestParsingMerge.RepeatedFieldsGenerator.Group1]] = ..., - group2: Optional[Iterable[TestParsingMerge.RepeatedFieldsGenerator.Group2]] = ..., - ext1: Optional[Iterable[TestAllTypes]] = ..., - ext2: Optional[Iterable[TestAllTypes]] = ..., - ) -> None: ... - class OptionalGroup(Message): - @property - def optional_group_all_types(self) -> TestAllTypes: ... - def __init__(self, optional_group_all_types: Optional[TestAllTypes] = ...) -> None: ... - class RepeatedGroup(Message): - @property - def repeated_group_all_types(self) -> TestAllTypes: ... - def __init__(self, repeated_group_all_types: Optional[TestAllTypes] = ...) -> None: ... - @property - def required_all_types(self) -> TestAllTypes: ... - @property - def optional_all_types(self) -> TestAllTypes: ... - @property - def repeated_all_types(self) -> RepeatedCompositeFieldContainer[TestAllTypes]: ... - @property - def optionalgroup(self) -> TestParsingMerge.OptionalGroup: ... - @property - def repeatedgroup(self) -> RepeatedCompositeFieldContainer[TestParsingMerge.RepeatedGroup]: ... - def __init__( - self, - required_all_types: TestAllTypes, - optional_all_types: Optional[TestAllTypes] = ..., - repeated_all_types: Optional[Iterable[TestAllTypes]] = ..., - optionalgroup: Optional[TestParsingMerge.OptionalGroup] = ..., - repeatedgroup: Optional[Iterable[TestParsingMerge.RepeatedGroup]] = ..., - ) -> None: ... - -class TestCommentInjectionMessage(Message): - a: Text - def __init__(self, a: Optional[Text] = ...) -> None: ... - -class FooRequest(Message): - def __init__(self,) -> None: ... - -class FooResponse(Message): - def __init__(self,) -> None: ... - -class FooClientMessage(Message): - def __init__(self,) -> None: ... - -class FooServerMessage(Message): - def __init__(self,) -> None: ... - -class BarRequest(Message): - def __init__(self,) -> None: ... - -class BarResponse(Message): - def __init__(self,) -> None: ... - -class TestJsonName(Message): - field_name1: int - fieldName2: int - FieldName3: int - _field_name4: int - FIELD_NAME5: int - field_name6: int - def __init__( - self, - field_name1: Optional[int] = ..., - fieldName2: Optional[int] = ..., - FieldName3: Optional[int] = ..., - _field_name4: Optional[int] = ..., - FIELD_NAME5: Optional[int] = ..., - field_name6: Optional[int] = ..., - ) -> None: ... - -class TestHugeFieldNumbers(Message): - class OptionalGroup(Message): - group_a: int - def __init__(self, group_a: Optional[int] = ...) -> None: ... - class StringStringMapEntry(Message): - key: Text - value: Text - def __init__(self, key: Optional[Text] = ..., value: Optional[Text] = ...) -> None: ... - optional_int32: int - fixed_32: int - repeated_int32: RepeatedScalarFieldContainer[int] - packed_int32: RepeatedScalarFieldContainer[int] - optional_enum: ForeignEnum - optional_string: Text - optional_bytes: bytes - oneof_uint32: int - oneof_string: Text - oneof_bytes: bytes - @property - def optional_message(self) -> ForeignMessage: ... - @property - def optionalgroup(self) -> TestHugeFieldNumbers.OptionalGroup: ... - @property - def string_string_map(self) -> MutableMapping[Text, Text]: ... - @property - def oneof_test_all_types(self) -> TestAllTypes: ... - def __init__( - self, - optional_int32: Optional[int] = ..., - fixed_32: Optional[int] = ..., - repeated_int32: Optional[Iterable[int]] = ..., - packed_int32: Optional[Iterable[int]] = ..., - optional_enum: Optional[ForeignEnum] = ..., - optional_string: Optional[Text] = ..., - optional_bytes: Optional[bytes] = ..., - optional_message: Optional[ForeignMessage] = ..., - optionalgroup: Optional[TestHugeFieldNumbers.OptionalGroup] = ..., - string_string_map: Optional[Mapping[Text, Text]] = ..., - oneof_uint32: Optional[int] = ..., - oneof_test_all_types: Optional[TestAllTypes] = ..., - oneof_string: Optional[Text] = ..., - oneof_bytes: Optional[bytes] = ..., - ) -> None: ... - -class TestExtensionInsideTable(Message): - field1: int - field2: int - field3: int - field4: int - field6: int - field7: int - field8: int - field9: int - field10: int - def __init__( - self, - field1: Optional[int] = ..., - field2: Optional[int] = ..., - field3: Optional[int] = ..., - field4: Optional[int] = ..., - field6: Optional[int] = ..., - field7: Optional[int] = ..., - field8: Optional[int] = ..., - field9: Optional[int] = ..., - field10: Optional[int] = ..., - ) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_proto3_arena_pb2.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_proto3_arena_pb2.pyi deleted file mode 100755 index 4fe5ea6e..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_proto3_arena_pb2.pyi +++ /dev/null @@ -1,248 +0,0 @@ -from google.protobuf.internal.containers import RepeatedCompositeFieldContainer, RepeatedScalarFieldContainer -from google.protobuf.message import Message -from google.protobuf.unittest_import_pb2 import ImportMessage -from google.protobuf.unittest_import_public_pb2 import PublicImportMessage -from typing import Iterable, List, Optional, Text, Tuple, cast - -class ForeignEnum(int): - @classmethod - def Name(cls, number: int) -> bytes: ... - @classmethod - def Value(cls, name: bytes) -> ForeignEnum: ... - @classmethod - def keys(cls) -> List[bytes]: ... - @classmethod - def values(cls) -> List[ForeignEnum]: ... - @classmethod - def items(cls) -> List[Tuple[bytes, ForeignEnum]]: ... - -FOREIGN_ZERO: ForeignEnum -FOREIGN_FOO: ForeignEnum -FOREIGN_BAR: ForeignEnum -FOREIGN_BAZ: ForeignEnum - -class TestAllTypes(Message): - class NestedEnum(int): - @classmethod - def Name(cls, number: int) -> bytes: ... - @classmethod - def Value(cls, name: bytes) -> TestAllTypes.NestedEnum: ... - @classmethod - def keys(cls) -> List[bytes]: ... - @classmethod - def values(cls) -> List[TestAllTypes.NestedEnum]: ... - @classmethod - def items(cls) -> List[Tuple[bytes, TestAllTypes.NestedEnum]]: ... - ZERO: TestAllTypes.NestedEnum - FOO: TestAllTypes.NestedEnum - BAR: TestAllTypes.NestedEnum - BAZ: TestAllTypes.NestedEnum - NEG: TestAllTypes.NestedEnum - class NestedMessage(Message): - bb: int - def __init__(self, bb: Optional[int] = ...) -> None: ... - optional_int32: int - optional_int64: int - optional_uint32: int - optional_uint64: int - optional_sint32: int - optional_sint64: int - optional_fixed32: int - optional_fixed64: int - optional_sfixed32: int - optional_sfixed64: int - optional_float: float - optional_double: float - optional_bool: bool - optional_string: Text - optional_bytes: bytes - optional_nested_enum: TestAllTypes.NestedEnum - optional_foreign_enum: ForeignEnum - optional_string_piece: Text - optional_cord: Text - repeated_int32: RepeatedScalarFieldContainer[int] - repeated_int64: RepeatedScalarFieldContainer[int] - repeated_uint32: RepeatedScalarFieldContainer[int] - repeated_uint64: RepeatedScalarFieldContainer[int] - repeated_sint32: RepeatedScalarFieldContainer[int] - repeated_sint64: RepeatedScalarFieldContainer[int] - repeated_fixed32: RepeatedScalarFieldContainer[int] - repeated_fixed64: RepeatedScalarFieldContainer[int] - repeated_sfixed32: RepeatedScalarFieldContainer[int] - repeated_sfixed64: RepeatedScalarFieldContainer[int] - repeated_float: RepeatedScalarFieldContainer[float] - repeated_double: RepeatedScalarFieldContainer[float] - repeated_bool: RepeatedScalarFieldContainer[bool] - repeated_string: RepeatedScalarFieldContainer[Text] - repeated_bytes: RepeatedScalarFieldContainer[bytes] - repeated_nested_enum: RepeatedScalarFieldContainer[TestAllTypes.NestedEnum] - repeated_foreign_enum: RepeatedScalarFieldContainer[ForeignEnum] - repeated_string_piece: RepeatedScalarFieldContainer[Text] - repeated_cord: RepeatedScalarFieldContainer[Text] - oneof_uint32: int - oneof_string: Text - oneof_bytes: bytes - @property - def optional_nested_message(self) -> TestAllTypes.NestedMessage: ... - @property - def optional_foreign_message(self) -> ForeignMessage: ... - @property - def optional_import_message(self) -> ImportMessage: ... - @property - def optional_public_import_message(self) -> PublicImportMessage: ... - @property - def optional_lazy_message(self) -> TestAllTypes.NestedMessage: ... - @property - def optional_lazy_import_message(self) -> ImportMessage: ... - @property - def repeated_nested_message(self) -> RepeatedCompositeFieldContainer[TestAllTypes.NestedMessage]: ... - @property - def repeated_foreign_message(self) -> RepeatedCompositeFieldContainer[ForeignMessage]: ... - @property - def repeated_import_message(self) -> RepeatedCompositeFieldContainer[ImportMessage]: ... - @property - def repeated_lazy_message(self) -> RepeatedCompositeFieldContainer[TestAllTypes.NestedMessage]: ... - @property - def oneof_nested_message(self) -> TestAllTypes.NestedMessage: ... - def __init__( - self, - optional_int32: Optional[int] = ..., - optional_int64: Optional[int] = ..., - optional_uint32: Optional[int] = ..., - optional_uint64: Optional[int] = ..., - optional_sint32: Optional[int] = ..., - optional_sint64: Optional[int] = ..., - optional_fixed32: Optional[int] = ..., - optional_fixed64: Optional[int] = ..., - optional_sfixed32: Optional[int] = ..., - optional_sfixed64: Optional[int] = ..., - optional_float: Optional[float] = ..., - optional_double: Optional[float] = ..., - optional_bool: Optional[bool] = ..., - optional_string: Optional[Text] = ..., - optional_bytes: Optional[bytes] = ..., - optional_nested_message: Optional[TestAllTypes.NestedMessage] = ..., - optional_foreign_message: Optional[ForeignMessage] = ..., - optional_import_message: Optional[ImportMessage] = ..., - optional_nested_enum: Optional[TestAllTypes.NestedEnum] = ..., - optional_foreign_enum: Optional[ForeignEnum] = ..., - optional_string_piece: Optional[Text] = ..., - optional_cord: Optional[Text] = ..., - optional_public_import_message: Optional[PublicImportMessage] = ..., - optional_lazy_message: Optional[TestAllTypes.NestedMessage] = ..., - optional_lazy_import_message: Optional[ImportMessage] = ..., - repeated_int32: Optional[Iterable[int]] = ..., - repeated_int64: Optional[Iterable[int]] = ..., - repeated_uint32: Optional[Iterable[int]] = ..., - repeated_uint64: Optional[Iterable[int]] = ..., - repeated_sint32: Optional[Iterable[int]] = ..., - repeated_sint64: Optional[Iterable[int]] = ..., - repeated_fixed32: Optional[Iterable[int]] = ..., - repeated_fixed64: Optional[Iterable[int]] = ..., - repeated_sfixed32: Optional[Iterable[int]] = ..., - repeated_sfixed64: Optional[Iterable[int]] = ..., - repeated_float: Optional[Iterable[float]] = ..., - repeated_double: Optional[Iterable[float]] = ..., - repeated_bool: Optional[Iterable[bool]] = ..., - repeated_string: Optional[Iterable[Text]] = ..., - repeated_bytes: Optional[Iterable[bytes]] = ..., - repeated_nested_message: Optional[Iterable[TestAllTypes.NestedMessage]] = ..., - repeated_foreign_message: Optional[Iterable[ForeignMessage]] = ..., - repeated_import_message: Optional[Iterable[ImportMessage]] = ..., - repeated_nested_enum: Optional[Iterable[TestAllTypes.NestedEnum]] = ..., - repeated_foreign_enum: Optional[Iterable[ForeignEnum]] = ..., - repeated_string_piece: Optional[Iterable[Text]] = ..., - repeated_cord: Optional[Iterable[Text]] = ..., - repeated_lazy_message: Optional[Iterable[TestAllTypes.NestedMessage]] = ..., - oneof_uint32: Optional[int] = ..., - oneof_nested_message: Optional[TestAllTypes.NestedMessage] = ..., - oneof_string: Optional[Text] = ..., - oneof_bytes: Optional[bytes] = ..., - ) -> None: ... - -class TestPackedTypes(Message): - packed_int32: RepeatedScalarFieldContainer[int] - packed_int64: RepeatedScalarFieldContainer[int] - packed_uint32: RepeatedScalarFieldContainer[int] - packed_uint64: RepeatedScalarFieldContainer[int] - packed_sint32: RepeatedScalarFieldContainer[int] - packed_sint64: RepeatedScalarFieldContainer[int] - packed_fixed32: RepeatedScalarFieldContainer[int] - packed_fixed64: RepeatedScalarFieldContainer[int] - packed_sfixed32: RepeatedScalarFieldContainer[int] - packed_sfixed64: RepeatedScalarFieldContainer[int] - packed_float: RepeatedScalarFieldContainer[float] - packed_double: RepeatedScalarFieldContainer[float] - packed_bool: RepeatedScalarFieldContainer[bool] - packed_enum: RepeatedScalarFieldContainer[ForeignEnum] - def __init__( - self, - packed_int32: Optional[Iterable[int]] = ..., - packed_int64: Optional[Iterable[int]] = ..., - packed_uint32: Optional[Iterable[int]] = ..., - packed_uint64: Optional[Iterable[int]] = ..., - packed_sint32: Optional[Iterable[int]] = ..., - packed_sint64: Optional[Iterable[int]] = ..., - packed_fixed32: Optional[Iterable[int]] = ..., - packed_fixed64: Optional[Iterable[int]] = ..., - packed_sfixed32: Optional[Iterable[int]] = ..., - packed_sfixed64: Optional[Iterable[int]] = ..., - packed_float: Optional[Iterable[float]] = ..., - packed_double: Optional[Iterable[float]] = ..., - packed_bool: Optional[Iterable[bool]] = ..., - packed_enum: Optional[Iterable[ForeignEnum]] = ..., - ) -> None: ... - -class TestUnpackedTypes(Message): - repeated_int32: RepeatedScalarFieldContainer[int] - repeated_int64: RepeatedScalarFieldContainer[int] - repeated_uint32: RepeatedScalarFieldContainer[int] - repeated_uint64: RepeatedScalarFieldContainer[int] - repeated_sint32: RepeatedScalarFieldContainer[int] - repeated_sint64: RepeatedScalarFieldContainer[int] - repeated_fixed32: RepeatedScalarFieldContainer[int] - repeated_fixed64: RepeatedScalarFieldContainer[int] - repeated_sfixed32: RepeatedScalarFieldContainer[int] - repeated_sfixed64: RepeatedScalarFieldContainer[int] - repeated_float: RepeatedScalarFieldContainer[float] - repeated_double: RepeatedScalarFieldContainer[float] - repeated_bool: RepeatedScalarFieldContainer[bool] - repeated_nested_enum: RepeatedScalarFieldContainer[TestAllTypes.NestedEnum] - def __init__( - self, - repeated_int32: Optional[Iterable[int]] = ..., - repeated_int64: Optional[Iterable[int]] = ..., - repeated_uint32: Optional[Iterable[int]] = ..., - repeated_uint64: Optional[Iterable[int]] = ..., - repeated_sint32: Optional[Iterable[int]] = ..., - repeated_sint64: Optional[Iterable[int]] = ..., - repeated_fixed32: Optional[Iterable[int]] = ..., - repeated_fixed64: Optional[Iterable[int]] = ..., - repeated_sfixed32: Optional[Iterable[int]] = ..., - repeated_sfixed64: Optional[Iterable[int]] = ..., - repeated_float: Optional[Iterable[float]] = ..., - repeated_double: Optional[Iterable[float]] = ..., - repeated_bool: Optional[Iterable[bool]] = ..., - repeated_nested_enum: Optional[Iterable[TestAllTypes.NestedEnum]] = ..., - ) -> None: ... - -class NestedTestAllTypes(Message): - @property - def child(self) -> NestedTestAllTypes: ... - @property - def payload(self) -> TestAllTypes: ... - @property - def repeated_child(self) -> RepeatedCompositeFieldContainer[NestedTestAllTypes]: ... - def __init__( - self, - child: Optional[NestedTestAllTypes] = ..., - payload: Optional[TestAllTypes] = ..., - repeated_child: Optional[Iterable[NestedTestAllTypes]] = ..., - ) -> None: ... - -class ForeignMessage(Message): - c: int - def __init__(self, c: Optional[int] = ...) -> None: ... - -class TestEmptyMessage(Message): - def __init__(self,) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/util/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/util/__init__.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/util/json_format_proto3_pb2.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/util/json_format_proto3_pb2.pyi deleted file mode 100755 index f4be1b9d..00000000 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/util/json_format_proto3_pb2.pyi +++ /dev/null @@ -1,341 +0,0 @@ -from google.protobuf.any_pb2 import Any -from google.protobuf.duration_pb2 import Duration -from google.protobuf.field_mask_pb2 import FieldMask -from google.protobuf.internal.containers import RepeatedCompositeFieldContainer, RepeatedScalarFieldContainer -from google.protobuf.message import Message -from google.protobuf.struct_pb2 import ListValue, Struct, Value -from google.protobuf.timestamp_pb2 import Timestamp -from google.protobuf.unittest_pb2 import TestAllExtensions -from google.protobuf.wrappers_pb2 import ( - BoolValue, - BytesValue, - DoubleValue, - FloatValue, - Int32Value, - Int64Value, - StringValue, - UInt32Value, - UInt64Value, -) -from typing import Iterable, List, Mapping, MutableMapping, Optional, Text, Tuple, cast - -class EnumType(int): - @classmethod - def Name(cls, number: int) -> bytes: ... - @classmethod - def Value(cls, name: bytes) -> EnumType: ... - @classmethod - def keys(cls) -> List[bytes]: ... - @classmethod - def values(cls) -> List[EnumType]: ... - @classmethod - def items(cls) -> List[Tuple[bytes, EnumType]]: ... - -FOO: EnumType -BAR: EnumType - -class MessageType(Message): - value: int - def __init__(self, value: Optional[int] = ...) -> None: ... - -class TestMessage(Message): - bool_value: bool - int32_value: int - int64_value: int - uint32_value: int - uint64_value: int - float_value: float - double_value: float - string_value: Text - bytes_value: bytes - enum_value: EnumType - repeated_bool_value: RepeatedScalarFieldContainer[bool] - repeated_int32_value: RepeatedScalarFieldContainer[int] - repeated_int64_value: RepeatedScalarFieldContainer[int] - repeated_uint32_value: RepeatedScalarFieldContainer[int] - repeated_uint64_value: RepeatedScalarFieldContainer[int] - repeated_float_value: RepeatedScalarFieldContainer[float] - repeated_double_value: RepeatedScalarFieldContainer[float] - repeated_string_value: RepeatedScalarFieldContainer[Text] - repeated_bytes_value: RepeatedScalarFieldContainer[bytes] - repeated_enum_value: RepeatedScalarFieldContainer[EnumType] - @property - def message_value(self) -> MessageType: ... - @property - def repeated_message_value(self) -> RepeatedCompositeFieldContainer[MessageType]: ... - def __init__( - self, - bool_value: Optional[bool] = ..., - int32_value: Optional[int] = ..., - int64_value: Optional[int] = ..., - uint32_value: Optional[int] = ..., - uint64_value: Optional[int] = ..., - float_value: Optional[float] = ..., - double_value: Optional[float] = ..., - string_value: Optional[Text] = ..., - bytes_value: Optional[bytes] = ..., - enum_value: Optional[EnumType] = ..., - message_value: Optional[MessageType] = ..., - repeated_bool_value: Optional[Iterable[bool]] = ..., - repeated_int32_value: Optional[Iterable[int]] = ..., - repeated_int64_value: Optional[Iterable[int]] = ..., - repeated_uint32_value: Optional[Iterable[int]] = ..., - repeated_uint64_value: Optional[Iterable[int]] = ..., - repeated_float_value: Optional[Iterable[float]] = ..., - repeated_double_value: Optional[Iterable[float]] = ..., - repeated_string_value: Optional[Iterable[Text]] = ..., - repeated_bytes_value: Optional[Iterable[bytes]] = ..., - repeated_enum_value: Optional[Iterable[EnumType]] = ..., - repeated_message_value: Optional[Iterable[MessageType]] = ..., - ) -> None: ... - -class TestOneof(Message): - oneof_int32_value: int - oneof_string_value: Text - oneof_bytes_value: bytes - oneof_enum_value: EnumType - @property - def oneof_message_value(self) -> MessageType: ... - def __init__( - self, - oneof_int32_value: Optional[int] = ..., - oneof_string_value: Optional[Text] = ..., - oneof_bytes_value: Optional[bytes] = ..., - oneof_enum_value: Optional[EnumType] = ..., - oneof_message_value: Optional[MessageType] = ..., - ) -> None: ... - -class TestMap(Message): - class BoolMapEntry(Message): - key: bool - value: int - def __init__(self, key: Optional[bool] = ..., value: Optional[int] = ...) -> None: ... - class Int32MapEntry(Message): - key: int - value: int - def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... - class Int64MapEntry(Message): - key: int - value: int - def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... - class Uint32MapEntry(Message): - key: int - value: int - def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... - class Uint64MapEntry(Message): - key: int - value: int - def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... - class StringMapEntry(Message): - key: Text - value: int - def __init__(self, key: Optional[Text] = ..., value: Optional[int] = ...) -> None: ... - @property - def bool_map(self) -> MutableMapping[bool, int]: ... - @property - def int32_map(self) -> MutableMapping[int, int]: ... - @property - def int64_map(self) -> MutableMapping[int, int]: ... - @property - def uint32_map(self) -> MutableMapping[int, int]: ... - @property - def uint64_map(self) -> MutableMapping[int, int]: ... - @property - def string_map(self) -> MutableMapping[Text, int]: ... - def __init__( - self, - bool_map: Optional[Mapping[bool, int]] = ..., - int32_map: Optional[Mapping[int, int]] = ..., - int64_map: Optional[Mapping[int, int]] = ..., - uint32_map: Optional[Mapping[int, int]] = ..., - uint64_map: Optional[Mapping[int, int]] = ..., - string_map: Optional[Mapping[Text, int]] = ..., - ) -> None: ... - -class TestNestedMap(Message): - class BoolMapEntry(Message): - key: bool - value: int - def __init__(self, key: Optional[bool] = ..., value: Optional[int] = ...) -> None: ... - class Int32MapEntry(Message): - key: int - value: int - def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... - class Int64MapEntry(Message): - key: int - value: int - def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... - class Uint32MapEntry(Message): - key: int - value: int - def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... - class Uint64MapEntry(Message): - key: int - value: int - def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... - class StringMapEntry(Message): - key: Text - value: int - def __init__(self, key: Optional[Text] = ..., value: Optional[int] = ...) -> None: ... - class MapMapEntry(Message): - key: Text - @property - def value(self) -> TestNestedMap: ... - def __init__(self, key: Optional[Text] = ..., value: Optional[TestNestedMap] = ...) -> None: ... - @property - def bool_map(self) -> MutableMapping[bool, int]: ... - @property - def int32_map(self) -> MutableMapping[int, int]: ... - @property - def int64_map(self) -> MutableMapping[int, int]: ... - @property - def uint32_map(self) -> MutableMapping[int, int]: ... - @property - def uint64_map(self) -> MutableMapping[int, int]: ... - @property - def string_map(self) -> MutableMapping[Text, int]: ... - @property - def map_map(self) -> MutableMapping[Text, TestNestedMap]: ... - def __init__( - self, - bool_map: Optional[Mapping[bool, int]] = ..., - int32_map: Optional[Mapping[int, int]] = ..., - int64_map: Optional[Mapping[int, int]] = ..., - uint32_map: Optional[Mapping[int, int]] = ..., - uint64_map: Optional[Mapping[int, int]] = ..., - string_map: Optional[Mapping[Text, int]] = ..., - map_map: Optional[Mapping[Text, TestNestedMap]] = ..., - ) -> None: ... - -class TestWrapper(Message): - @property - def bool_value(self) -> BoolValue: ... - @property - def int32_value(self) -> Int32Value: ... - @property - def int64_value(self) -> Int64Value: ... - @property - def uint32_value(self) -> UInt32Value: ... - @property - def uint64_value(self) -> UInt64Value: ... - @property - def float_value(self) -> FloatValue: ... - @property - def double_value(self) -> DoubleValue: ... - @property - def string_value(self) -> StringValue: ... - @property - def bytes_value(self) -> BytesValue: ... - @property - def repeated_bool_value(self) -> RepeatedCompositeFieldContainer[BoolValue]: ... - @property - def repeated_int32_value(self) -> RepeatedCompositeFieldContainer[Int32Value]: ... - @property - def repeated_int64_value(self) -> RepeatedCompositeFieldContainer[Int64Value]: ... - @property - def repeated_uint32_value(self) -> RepeatedCompositeFieldContainer[UInt32Value]: ... - @property - def repeated_uint64_value(self) -> RepeatedCompositeFieldContainer[UInt64Value]: ... - @property - def repeated_float_value(self) -> RepeatedCompositeFieldContainer[FloatValue]: ... - @property - def repeated_double_value(self) -> RepeatedCompositeFieldContainer[DoubleValue]: ... - @property - def repeated_string_value(self) -> RepeatedCompositeFieldContainer[StringValue]: ... - @property - def repeated_bytes_value(self) -> RepeatedCompositeFieldContainer[BytesValue]: ... - def __init__( - self, - bool_value: Optional[BoolValue] = ..., - int32_value: Optional[Int32Value] = ..., - int64_value: Optional[Int64Value] = ..., - uint32_value: Optional[UInt32Value] = ..., - uint64_value: Optional[UInt64Value] = ..., - float_value: Optional[FloatValue] = ..., - double_value: Optional[DoubleValue] = ..., - string_value: Optional[StringValue] = ..., - bytes_value: Optional[BytesValue] = ..., - repeated_bool_value: Optional[Iterable[BoolValue]] = ..., - repeated_int32_value: Optional[Iterable[Int32Value]] = ..., - repeated_int64_value: Optional[Iterable[Int64Value]] = ..., - repeated_uint32_value: Optional[Iterable[UInt32Value]] = ..., - repeated_uint64_value: Optional[Iterable[UInt64Value]] = ..., - repeated_float_value: Optional[Iterable[FloatValue]] = ..., - repeated_double_value: Optional[Iterable[DoubleValue]] = ..., - repeated_string_value: Optional[Iterable[StringValue]] = ..., - repeated_bytes_value: Optional[Iterable[BytesValue]] = ..., - ) -> None: ... - -class TestTimestamp(Message): - @property - def value(self) -> Timestamp: ... - @property - def repeated_value(self) -> RepeatedCompositeFieldContainer[Timestamp]: ... - def __init__(self, value: Optional[Timestamp] = ..., repeated_value: Optional[Iterable[Timestamp]] = ...) -> None: ... - -class TestDuration(Message): - @property - def value(self) -> Duration: ... - @property - def repeated_value(self) -> RepeatedCompositeFieldContainer[Duration]: ... - def __init__(self, value: Optional[Duration] = ..., repeated_value: Optional[Iterable[Duration]] = ...) -> None: ... - -class TestFieldMask(Message): - @property - def value(self) -> FieldMask: ... - def __init__(self, value: Optional[FieldMask] = ...) -> None: ... - -class TestStruct(Message): - @property - def value(self) -> Struct: ... - @property - def repeated_value(self) -> RepeatedCompositeFieldContainer[Struct]: ... - def __init__(self, value: Optional[Struct] = ..., repeated_value: Optional[Iterable[Struct]] = ...) -> None: ... - -class TestAny(Message): - @property - def value(self) -> Any: ... - @property - def repeated_value(self) -> RepeatedCompositeFieldContainer[Any]: ... - def __init__(self, value: Optional[Any] = ..., repeated_value: Optional[Iterable[Any]] = ...) -> None: ... - -class TestValue(Message): - @property - def value(self) -> Value: ... - @property - def repeated_value(self) -> RepeatedCompositeFieldContainer[Value]: ... - def __init__(self, value: Optional[Value] = ..., repeated_value: Optional[Iterable[Value]] = ...) -> None: ... - -class TestListValue(Message): - @property - def value(self) -> ListValue: ... - @property - def repeated_value(self) -> RepeatedCompositeFieldContainer[ListValue]: ... - def __init__(self, value: Optional[ListValue] = ..., repeated_value: Optional[Iterable[ListValue]] = ...) -> None: ... - -class TestBoolValue(Message): - class BoolMapEntry(Message): - key: bool - value: int - def __init__(self, key: Optional[bool] = ..., value: Optional[int] = ...) -> None: ... - bool_value: bool - @property - def bool_map(self) -> MutableMapping[bool, int]: ... - def __init__(self, bool_value: Optional[bool] = ..., bool_map: Optional[Mapping[bool, int]] = ...) -> None: ... - -class TestCustomJsonName(Message): - value: int - def __init__(self, value: Optional[int] = ...) -> None: ... - -class TestExtensions(Message): - @property - def extensions(self) -> TestAllExtensions: ... - def __init__(self, extensions: Optional[TestAllExtensions] = ...) -> None: ... - -class TestEnumValue(Message): - enum_value1: EnumType - enum_value2: EnumType - enum_value3: EnumType - def __init__( - self, enum_value1: Optional[EnumType] = ..., enum_value2: Optional[EnumType] = ..., enum_value3: Optional[EnumType] = ... - ) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/wrappers_pb2.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/wrappers_pb2.pyi old mode 100755 new mode 100644 index 342d0e04..c9f9940b --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/wrappers_pb2.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/google/protobuf/wrappers_pb2.pyi @@ -1,38 +1,129 @@ -from google.protobuf.message import Message -from typing import Optional, Text +""" +@generated by mypy-protobuf. Do not edit manually! +isort:skip_file +""" +from google.protobuf.descriptor import ( + Descriptor as google___protobuf___descriptor___Descriptor, + FileDescriptor as google___protobuf___descriptor___FileDescriptor, +) -class DoubleValue(Message): - value: float - def __init__(self, value: Optional[float] = ...) -> None: ... +from google.protobuf.message import ( + Message as google___protobuf___message___Message, +) -class FloatValue(Message): - value: float - def __init__(self, value: Optional[float] = ...) -> None: ... +from typing import ( + Optional as typing___Optional, + Text as typing___Text, +) -class Int64Value(Message): - value: int - def __init__(self, value: Optional[int] = ...) -> None: ... +from typing_extensions import ( + Literal as typing_extensions___Literal, +) -class UInt64Value(Message): - value: int - def __init__(self, value: Optional[int] = ...) -> None: ... -class Int32Value(Message): - value: int - def __init__(self, value: Optional[int] = ...) -> None: ... +builtin___bool = bool +builtin___bytes = bytes +builtin___float = float +builtin___int = int -class UInt32Value(Message): - value: int - def __init__(self, value: Optional[int] = ...) -> None: ... -class BoolValue(Message): - value: bool - def __init__(self, value: Optional[bool] = ...) -> None: ... +DESCRIPTOR: google___protobuf___descriptor___FileDescriptor = ... -class StringValue(Message): - value: Text - def __init__(self, value: Optional[Text] = ...) -> None: ... +class DoubleValue(google___protobuf___message___Message): + DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... + value: builtin___float = ... -class BytesValue(Message): - value: bytes - def __init__(self, value: Optional[bytes] = ...) -> None: ... + def __init__(self, + *, + value : typing___Optional[builtin___float] = None, + ) -> None: ... + def ClearField(self, field_name: typing_extensions___Literal[u"value",b"value"]) -> None: ... +type___DoubleValue = DoubleValue + +class FloatValue(google___protobuf___message___Message): + DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... + value: builtin___float = ... + + def __init__(self, + *, + value : typing___Optional[builtin___float] = None, + ) -> None: ... + def ClearField(self, field_name: typing_extensions___Literal[u"value",b"value"]) -> None: ... +type___FloatValue = FloatValue + +class Int64Value(google___protobuf___message___Message): + DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... + value: builtin___int = ... + + def __init__(self, + *, + value : typing___Optional[builtin___int] = None, + ) -> None: ... + def ClearField(self, field_name: typing_extensions___Literal[u"value",b"value"]) -> None: ... +type___Int64Value = Int64Value + +class UInt64Value(google___protobuf___message___Message): + DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... + value: builtin___int = ... + + def __init__(self, + *, + value : typing___Optional[builtin___int] = None, + ) -> None: ... + def ClearField(self, field_name: typing_extensions___Literal[u"value",b"value"]) -> None: ... +type___UInt64Value = UInt64Value + +class Int32Value(google___protobuf___message___Message): + DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... + value: builtin___int = ... + + def __init__(self, + *, + value : typing___Optional[builtin___int] = None, + ) -> None: ... + def ClearField(self, field_name: typing_extensions___Literal[u"value",b"value"]) -> None: ... +type___Int32Value = Int32Value + +class UInt32Value(google___protobuf___message___Message): + DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... + value: builtin___int = ... + + def __init__(self, + *, + value : typing___Optional[builtin___int] = None, + ) -> None: ... + def ClearField(self, field_name: typing_extensions___Literal[u"value",b"value"]) -> None: ... +type___UInt32Value = UInt32Value + +class BoolValue(google___protobuf___message___Message): + DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... + value: builtin___bool = ... + + def __init__(self, + *, + value : typing___Optional[builtin___bool] = None, + ) -> None: ... + def ClearField(self, field_name: typing_extensions___Literal[u"value",b"value"]) -> None: ... +type___BoolValue = BoolValue + +class StringValue(google___protobuf___message___Message): + DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... + value: typing___Text = ... + + def __init__(self, + *, + value : typing___Optional[typing___Text] = None, + ) -> None: ... + def ClearField(self, field_name: typing_extensions___Literal[u"value",b"value"]) -> None: ... +type___StringValue = StringValue + +class BytesValue(google___protobuf___message___Message): + DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... + value: builtin___bytes = ... + + def __init__(self, + *, + value : typing___Optional[builtin___bytes] = None, + ) -> None: ... + def ClearField(self, field_name: typing_extensions___Literal[u"value",b"value"]) -> None: ... +type___BytesValue = BytesValue diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/itsdangerous.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/itsdangerous.pyi old mode 100755 new mode 100644 index 6e627c77..84f59611 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/itsdangerous.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/itsdangerous.pyi @@ -1,5 +1,5 @@ from datetime import datetime -from typing import Any, Callable, IO, Mapping, MutableMapping, Optional, Tuple, Union, Text, Generator +from typing import IO, Any, Callable, Generator, Mapping, MutableMapping, Optional, Text, Tuple, Union _serializer = Any # must be an object that has "dumps" and "loads" attributes (e.g. the json module) @@ -24,7 +24,9 @@ class BadTimeSignature(BadSignature): class BadHeader(BadSignature): header: Any original_error: Any - def __init__(self, message, payload: Optional[Any] = ..., header: Optional[Any] = ..., original_error: Optional[Any] = ...) -> None: ... + def __init__( + self, message: str, payload: Optional[Any] = ..., header: Optional[Any] = ..., original_error: Optional[Any] = ... + ) -> None: ... class SignatureExpired(BadTimeSignature): ... @@ -54,14 +56,15 @@ class Signer(object): key_derivation: str digest_method: Callable[..., Any] algorithm: SigningAlgorithm - - def __init__(self, - secret_key: Union[Text, bytes], - salt: Optional[Union[Text, bytes]] = ..., - sep: Optional[Union[Text, bytes]] = ..., - key_derivation: Optional[str] = ..., - digest_method: Optional[Callable[..., Any]] = ..., - algorithm: Optional[SigningAlgorithm] = ...) -> None: ... + def __init__( + self, + secret_key: Union[Text, bytes], + salt: Optional[Union[Text, bytes]] = ..., + sep: Optional[Union[Text, bytes]] = ..., + key_derivation: Optional[str] = ..., + digest_method: Optional[Callable[..., Any]] = ..., + algorithm: Optional[SigningAlgorithm] = ..., + ) -> None: ... def derive_key(self) -> bytes: ... def get_signature(self, value: Union[Text, bytes]) -> bytes: ... def sign(self, value: Union[Text, bytes]) -> bytes: ... @@ -73,8 +76,9 @@ class TimestampSigner(Signer): def get_timestamp(self) -> int: ... def timestamp_to_datetime(self, ts: float) -> datetime: ... def sign(self, value: Union[Text, bytes]) -> bytes: ... - def unsign(self, value: Union[Text, bytes], max_age: Optional[int] = ..., - return_timestamp: bool = ...) -> Any: ... # morally -> Union[bytes, Tuple[bytes, datetime]] + def unsign( + self, value: Union[Text, bytes], max_age: Optional[int] = ..., return_timestamp: bool = ... + ) -> Any: ... # morally -> Union[bytes, Tuple[bytes, datetime]] def validate(self, signed_value: Union[Text, bytes], max_age: Optional[int] = ...) -> bool: ... class Serializer(object): @@ -87,10 +91,14 @@ class Serializer(object): is_text_serializer: bool signer: Callable[..., Signer] signer_kwargs: MutableMapping[str, Any] - - def __init__(self, secret_key: Union[Text, bytes], salt: Optional[Union[Text, bytes]] = ..., - serializer: Optional[_serializer] = ..., signer: Optional[Callable[..., Signer]] = ..., - signer_kwargs: Optional[MutableMapping[str, Any]] = ...) -> None: ... + def __init__( + self, + secret_key: Union[Text, bytes], + salt: Optional[Union[Text, bytes]] = ..., + serializer: Optional[_serializer] = ..., + signer: Optional[Callable[..., Signer]] = ..., + signer_kwargs: Optional[MutableMapping[str, Any]] = ..., + ) -> None: ... def load_payload(self, payload: bytes, serializer: Optional[_serializer] = ...) -> Any: ... def dump_payload(self, obj: Any) -> bytes: ... def make_signer(self, salt: Optional[Union[Text, bytes]] = ...) -> Signer: ... @@ -98,15 +106,21 @@ class Serializer(object): def dumps(self, obj: Any, salt: Optional[Union[Text, bytes]] = ...) -> Any: ... # morally -> Union[str, bytes] def dump(self, obj: Any, f: IO[Any], salt: Optional[Union[Text, bytes]] = ...) -> None: ... def loads(self, s: Union[Text, bytes], salt: Optional[Union[Text, bytes]] = ...) -> Any: ... - def load(self, f: IO[Any], salt: Optional[Union[Text, bytes]] = ...): ... + def load(self, f: IO[Any], salt: Optional[Union[Text, bytes]] = ...) -> Any: ... def loads_unsafe(self, s: Union[Text, bytes], salt: Optional[Union[Text, bytes]] = ...) -> Tuple[bool, Optional[Any]]: ... def load_unsafe(self, f: IO[Any], salt: Optional[Union[Text, bytes]] = ...) -> Tuple[bool, Optional[Any]]: ... class TimedSerializer(Serializer): - def loads(self, s: Union[Text, bytes], salt: Optional[Union[Text, bytes]] = ..., max_age: Optional[int] = ..., - return_timestamp: bool = ...) -> Any: ... # morally -> Union[Any, Tuple[Any, datetime]] - def loads_unsafe(self, s: Union[Text, bytes], salt: Optional[Union[Text, bytes]] = ..., - max_age: Optional[int] = ...) -> Tuple[bool, Any]: ... + def loads( + self, + s: Union[Text, bytes], + salt: Optional[Union[Text, bytes]] = ..., + max_age: Optional[int] = ..., + return_timestamp: bool = ..., + ) -> Any: ... # morally -> Union[Any, Tuple[Any, datetime]] + def loads_unsafe( + self, s: Union[Text, bytes], salt: Optional[Union[Text, bytes]] = ..., max_age: Optional[int] = ... + ) -> Tuple[bool, Any]: ... class JSONWebSignatureSerializer(Serializer): jws_algorithms: MutableMapping[Text, SigningAlgorithm] = ... @@ -115,32 +129,49 @@ class JSONWebSignatureSerializer(Serializer): algorithm_name: Text algorithm: SigningAlgorithm - - def __init__(self, secret_key: Union[Text, bytes], salt: Optional[Union[Text, bytes]] = ..., - serializer: Optional[_serializer] = ..., signer: Optional[Callable[..., Signer]] = ..., - signer_kwargs: Optional[MutableMapping[str, Any]] = ..., algorithm_name: Optional[Text] = ...) -> None: ... - def load_payload(self, payload: Union[Text, bytes], serializer: Optional[_serializer] = ..., - return_header: bool = ...) -> Any: ... # morally -> Union[Any, Tuple[Any, MutableMapping[str, Any]]] + def __init__( + self, + secret_key: Union[Text, bytes], + salt: Optional[Union[Text, bytes]] = ..., + serializer: Optional[_serializer] = ..., + signer: Optional[Callable[..., Signer]] = ..., + signer_kwargs: Optional[MutableMapping[str, Any]] = ..., + algorithm_name: Optional[Text] = ..., + ) -> None: ... + def load_payload( + self, payload: Union[Text, bytes], serializer: Optional[_serializer] = ..., return_header: bool = ... + ) -> Any: ... # morally -> Union[Any, Tuple[Any, MutableMapping[str, Any]]] def dump_payload(self, header: Mapping[str, Any], obj: Any) -> bytes: ... # type: ignore def make_algorithm(self, algorithm_name: Text) -> SigningAlgorithm: ... def make_signer(self, salt: Optional[Union[Text, bytes]] = ..., algorithm: SigningAlgorithm = ...) -> Signer: ... def make_header(self, header_fields: Optional[Mapping[str, Any]]) -> MutableMapping[str, Any]: ... - def dumps(self, obj: Any, salt: Optional[Union[Text, bytes]] = ..., - header_fields: Optional[Mapping[str, Any]] = ...) -> bytes: ... - def loads(self, s: Union[Text, bytes], salt: Optional[Union[Text, bytes]] = ..., - return_header: bool = ...) -> Any: ... # morally -> Union[Any, Tuple[Any, MutableMapping[str, Any]]] - def loads_unsafe(self, s: Union[Text, bytes], salt: Optional[Union[Text, bytes]] = ..., - return_header: bool = ...) -> Tuple[bool, Any]: ... + def dumps( + self, obj: Any, salt: Optional[Union[Text, bytes]] = ..., header_fields: Optional[Mapping[str, Any]] = ... + ) -> bytes: ... + def loads( + self, s: Union[Text, bytes], salt: Optional[Union[Text, bytes]] = ..., return_header: bool = ... + ) -> Any: ... # morally -> Union[Any, Tuple[Any, MutableMapping[str, Any]]] + def loads_unsafe( + self, s: Union[Text, bytes], salt: Optional[Union[Text, bytes]] = ..., return_header: bool = ... + ) -> Tuple[bool, Any]: ... class TimedJSONWebSignatureSerializer(JSONWebSignatureSerializer): DEFAULT_EXPIRES_IN: int = ... expires_in: int - def __init__(self, secret_key: Union[Text, bytes], expires_in: Optional[int] = ..., salt: Optional[Union[Text, bytes]] = ..., - serializer: Optional[_serializer] = ..., signer: Optional[Callable[..., Signer]] = ..., - signer_kwargs: Optional[MutableMapping[str, Any]] = ..., algorithm_name: Optional[Text] = ...) -> None: ... + def __init__( + self, + secret_key: Union[Text, bytes], + expires_in: Optional[int] = ..., + salt: Optional[Union[Text, bytes]] = ..., + serializer: Optional[_serializer] = ..., + signer: Optional[Callable[..., Signer]] = ..., + signer_kwargs: Optional[MutableMapping[str, Any]] = ..., + algorithm_name: Optional[Text] = ..., + ) -> None: ... def make_header(self, header_fields: Optional[Mapping[str, Any]]) -> MutableMapping[str, Any]: ... - def loads(self, s: Union[Text, bytes], salt: Optional[Union[Text, bytes]] = ..., - return_header: bool = ...) -> Any: ... # morally -> Union[Any, Tuple[Any, MutableMapping[str, Any]]] + def loads( + self, s: Union[Text, bytes], salt: Optional[Union[Text, bytes]] = ..., return_header: bool = ... + ) -> Any: ... # morally -> Union[Any, Tuple[Any, MutableMapping[str, Any]]] def get_issue_date(self, header: Mapping[str, Any]) -> Optional[datetime]: ... def now(self) -> int: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/__init__.pyi old mode 100755 new mode 100644 index 063f73d8..1121f8de --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/__init__.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/__init__.pyi @@ -1,7 +1,45 @@ +from jinja2.bccache import ( + BytecodeCache as BytecodeCache, + FileSystemBytecodeCache as FileSystemBytecodeCache, + MemcachedBytecodeCache as MemcachedBytecodeCache, +) from jinja2.environment import Environment as Environment, Template as Template -from jinja2.loaders import BaseLoader as BaseLoader, FileSystemLoader as FileSystemLoader, PackageLoader as PackageLoader, DictLoader as DictLoader, FunctionLoader as FunctionLoader, PrefixLoader as PrefixLoader, ChoiceLoader as ChoiceLoader, ModuleLoader as ModuleLoader -from jinja2.bccache import BytecodeCache as BytecodeCache, FileSystemBytecodeCache as FileSystemBytecodeCache, MemcachedBytecodeCache as MemcachedBytecodeCache -from jinja2.runtime import Undefined as Undefined, DebugUndefined as DebugUndefined, StrictUndefined as StrictUndefined, make_logging_undefined as make_logging_undefined -from jinja2.exceptions import TemplateError as TemplateError, UndefinedError as UndefinedError, TemplateNotFound as TemplateNotFound, TemplatesNotFound as TemplatesNotFound, TemplateSyntaxError as TemplateSyntaxError, TemplateAssertionError as TemplateAssertionError -from jinja2.filters import environmentfilter as environmentfilter, contextfilter as contextfilter, evalcontextfilter as evalcontextfilter -from jinja2.utils import Markup as Markup, escape as escape, clear_caches as clear_caches, environmentfunction as environmentfunction, evalcontextfunction as evalcontextfunction, contextfunction as contextfunction, is_undefined as is_undefined, select_autoescape as select_autoescape +from jinja2.exceptions import ( + TemplateAssertionError as TemplateAssertionError, + TemplateError as TemplateError, + TemplateNotFound as TemplateNotFound, + TemplatesNotFound as TemplatesNotFound, + TemplateSyntaxError as TemplateSyntaxError, + UndefinedError as UndefinedError, +) +from jinja2.filters import ( + contextfilter as contextfilter, + environmentfilter as environmentfilter, + evalcontextfilter as evalcontextfilter, +) +from jinja2.loaders import ( + BaseLoader as BaseLoader, + ChoiceLoader as ChoiceLoader, + DictLoader as DictLoader, + FileSystemLoader as FileSystemLoader, + FunctionLoader as FunctionLoader, + ModuleLoader as ModuleLoader, + PackageLoader as PackageLoader, + PrefixLoader as PrefixLoader, +) +from jinja2.runtime import ( + DebugUndefined as DebugUndefined, + StrictUndefined as StrictUndefined, + Undefined as Undefined, + make_logging_undefined as make_logging_undefined, +) +from jinja2.utils import ( + Markup as Markup, + clear_caches as clear_caches, + contextfunction as contextfunction, + environmentfunction as environmentfunction, + escape as escape, + evalcontextfunction as evalcontextfunction, + is_undefined as is_undefined, + select_autoescape as select_autoescape, +) diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/_compat.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/_compat.pyi old mode 100755 new mode 100644 index 1e37a7ab..4edf9286 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/_compat.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/_compat.pyi @@ -1,12 +1,14 @@ -from typing import Any, Optional import sys +from typing import Any, Optional -if sys.version_info[0] >= 3: - from io import BytesIO - from urllib.parse import quote_from_bytes as url_quote +if sys.version_info >= (3,): + from urllib.parse import quote_from_bytes + + url_quote = quote_from_bytes else: - from cStringIO import StringIO as BytesIO - from urllib import quote as url_quote + import urllib + + url_quote = urllib.quote PY2: Any PYPY: Any diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/_stringdefs.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/_stringdefs.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/bccache.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/bccache.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/compiler.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/compiler.pyi old mode 100755 new mode 100644 index 7b1a5377..ce29f720 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/compiler.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/compiler.pyi @@ -1,5 +1,6 @@ -from typing import Any, Optional from keyword import iskeyword as is_python_keyword +from typing import Any, Optional + from jinja2.visitor import NodeVisitor operators: Any diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/constants.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/constants.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/debug.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/debug.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/defaults.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/defaults.pyi old mode 100755 new mode 100644 index e89d3ce3..e311f828 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/defaults.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/defaults.pyi @@ -1,6 +1,10 @@ -from typing import Any -from jinja2.filters import FILTERS as DEFAULT_FILTERS -from jinja2.tests import TESTS as DEFAULT_TESTS +from typing import Any, Dict, Optional + +from jinja2.filters import FILTERS +from jinja2.tests import TESTS + +DEFAULT_FILTERS = FILTERS +DEFAULT_TESTS = TESTS BLOCK_START_STRING: str BLOCK_END_STRING: str @@ -8,14 +12,11 @@ VARIABLE_START_STRING: str VARIABLE_END_STRING: str COMMENT_START_STRING: str COMMENT_END_STRING: str -LINE_STATEMENT_PREFIX: Any -LINE_COMMENT_PREFIX: Any +LINE_STATEMENT_PREFIX: Optional[str] +LINE_COMMENT_PREFIX: Optional[str] TRIM_BLOCKS: bool LSTRIP_BLOCKS: bool NEWLINE_SEQUENCE: str KEEP_TRAILING_NEWLINE: bool -DEFAULT_NAMESPACE: Any - -# Names in __all__ with no definition: -# DEFAULT_FILTERS -# DEFAULT_TESTS +DEFAULT_NAMESPACE: Dict[str, Any] +DEFAULT_POLICIES = Dict[str, Any] diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/environment.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/environment.pyi old mode 100755 new mode 100644 index 29704c60..f09c1b5e --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/environment.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/environment.pyi @@ -1,12 +1,12 @@ import sys -from typing import Any, Callable, Dict, Iterator, List, Optional, Text, Type, Union +from typing import Any, Callable, Dict, Iterator, List, Optional, Sequence, Text, Type, Union from .bccache import BytecodeCache from .loaders import BaseLoader from .runtime import Context, Undefined if sys.version_info >= (3, 6): - from typing import Awaitable, AsyncIterator + from typing import AsyncIterator, Awaitable def get_spontaneous_environment(*args): ... def create_cache(size): ... @@ -99,34 +99,87 @@ class Environment: def iter_extensions(self): ... def getitem(self, obj, argument): ... def getattr(self, obj, attribute): ... - def call_filter(self, name, value, args: Optional[Any] = ..., kwargs: Optional[Any] = ..., context: Optional[Any] = ..., eval_ctx: Optional[Any] = ...): ... + def call_filter( + self, + name, + value, + args: Optional[Any] = ..., + kwargs: Optional[Any] = ..., + context: Optional[Any] = ..., + eval_ctx: Optional[Any] = ..., + ): ... def call_test(self, name, value, args: Optional[Any] = ..., kwargs: Optional[Any] = ...): ... def parse(self, source, name: Optional[Any] = ..., filename: Optional[Any] = ...): ... def lex(self, source, name: Optional[Any] = ..., filename: Optional[Any] = ...): ... def preprocess(self, source: Text, name: Optional[Any] = ..., filename: Optional[Any] = ...): ... - def compile(self, source, name: Optional[Any] = ..., filename: Optional[Any] = ..., raw: bool = ..., defer_init: bool = ...): ... + def compile( + self, source, name: Optional[Any] = ..., filename: Optional[Any] = ..., raw: bool = ..., defer_init: bool = ... + ): ... def compile_expression(self, source: Text, undefined_to_none: bool = ...): ... - def compile_templates(self, target, extensions: Optional[Any] = ..., filter_func: Optional[Any] = ..., zip: str = ..., log_function: Optional[Any] = ..., ignore_errors: bool = ..., py_compile: bool = ...): ... + def compile_templates( + self, + target, + extensions: Optional[Any] = ..., + filter_func: Optional[Any] = ..., + zip: str = ..., + log_function: Optional[Any] = ..., + ignore_errors: bool = ..., + py_compile: bool = ..., + ): ... def list_templates(self, extensions: Optional[Any] = ..., filter_func: Optional[Any] = ...): ... def handle_exception(self, exc_info: Optional[Any] = ..., rendered: bool = ..., source_hint: Optional[Any] = ...): ... def join_path(self, template: Union[Template, Text], parent: Text) -> Text: ... - def get_template(self, name: Union[Template, Text], parent: Optional[Text] = ..., globals: Optional[Any] = ...) -> Template: ... - def select_template(self, names: List[Union[Template, Text]], parent: Optional[Text] = ..., globals: Optional[Dict[str, Any]] = ...) -> Template: ... - def get_or_select_template(self, template_name_or_list: Union[Union[Template, Text], List[Union[Template, Text]]], parent: Optional[Text] = ..., globals: Optional[Dict[str, Any]] = ...) -> Template: ... - def from_string(self, source: Text, globals: Optional[Dict[str, Any]] = ..., template_class: Optional[Type[Template]] = ...) -> Template: ... + def get_template( + self, name: Union[Template, Text], parent: Optional[Text] = ..., globals: Optional[Any] = ... + ) -> Template: ... + def select_template( + self, names: Sequence[Union[Template, Text]], parent: Optional[Text] = ..., globals: Optional[Dict[str, Any]] = ... + ) -> Template: ... + def get_or_select_template( + self, + template_name_or_list: Union[Union[Template, Text], Sequence[Union[Template, Text]]], + parent: Optional[Text] = ..., + globals: Optional[Dict[str, Any]] = ..., + ) -> Template: ... + def from_string( + self, source: Text, globals: Optional[Dict[str, Any]] = ..., template_class: Optional[Type[Template]] = ... + ) -> Template: ... def make_globals(self, d: Optional[Dict[str, Any]]) -> Dict[str, Any]: ... - # Frequently added extensions are included here: # from InternationalizationExtension: - def install_gettext_translations(self, translations: Any, newstyle: Optional[bool]): ... - def install_null_translations(self, newstyle: Optional[bool]): ... - def install_gettext_callables(self, gettext: Callable[..., Any], ngettext: Callable[..., Any], newstyle: Optional[bool]): ... + def install_gettext_translations(self, translations: Any, newstyle: Optional[bool] = ...): ... + def install_null_translations(self, newstyle: Optional[bool] = ...): ... + def install_gettext_callables( + self, gettext: Callable[..., Any], ngettext: Callable[..., Any], newstyle: Optional[bool] = ... + ): ... def uninstall_gettext_translations(self, translations: Any): ... def extract_translations(self, source: Any, gettext_functions: Any): ... newstyle_gettext: bool class Template: - def __new__(cls, source, block_start_string: Any = ..., block_end_string: Any = ..., variable_start_string: Any = ..., variable_end_string: Any = ..., comment_start_string: Any = ..., comment_end_string: Any = ..., line_statement_prefix: Any = ..., line_comment_prefix: Any = ..., trim_blocks: Any = ..., lstrip_blocks: Any = ..., newline_sequence: Any = ..., keep_trailing_newline: Any = ..., extensions: Any = ..., optimized: bool = ..., undefined: Any = ..., finalize: Optional[Any] = ..., autoescape: bool = ...): ... + name: Optional[str] + filename: Optional[str] + def __new__( + cls, + source, + block_start_string: Any = ..., + block_end_string: Any = ..., + variable_start_string: Any = ..., + variable_end_string: Any = ..., + comment_start_string: Any = ..., + comment_end_string: Any = ..., + line_statement_prefix: Any = ..., + line_comment_prefix: Any = ..., + trim_blocks: Any = ..., + lstrip_blocks: Any = ..., + newline_sequence: Any = ..., + keep_trailing_newline: Any = ..., + extensions: Any = ..., + optimized: bool = ..., + undefined: Any = ..., + finalize: Optional[Any] = ..., + autoescape: bool = ..., + ): ... environment: Environment = ... @classmethod def from_code(cls, environment, code, globals, uptodate: Optional[Any] = ...): ... @@ -135,8 +188,12 @@ class Template: def render(self, *args, **kwargs) -> Text: ... def stream(self, *args, **kwargs) -> TemplateStream: ... def generate(self, *args, **kwargs) -> Iterator[Text]: ... - def new_context(self, vars: Optional[Dict[str, Any]] = ..., shared: bool = ..., locals: Optional[Dict[str, Any]] = ...) -> Context: ... - def make_module(self, vars: Optional[Dict[str, Any]] = ..., shared: bool = ..., locals: Optional[Dict[str, Any]] = ...) -> Context: ... + def new_context( + self, vars: Optional[Dict[str, Any]] = ..., shared: bool = ..., locals: Optional[Dict[str, Any]] = ... + ) -> Context: ... + def make_module( + self, vars: Optional[Dict[str, Any]] = ..., shared: bool = ..., locals: Optional[Dict[str, Any]] = ... + ) -> Context: ... @property def module(self) -> Any: ... def get_corresponding_lineno(self, lineno): ... @@ -144,12 +201,10 @@ class Template: def is_up_to_date(self) -> bool: ... @property def debug_info(self): ... - if sys.version_info >= (3, 6): def render_async(self, *args, **kwargs) -> Awaitable[Text]: ... def generate_async(self, *args, **kwargs) -> AsyncIterator[Text]: ... - class TemplateModule: __name__: Any def __init__(self, template, context) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/exceptions.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/exceptions.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/ext.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/ext.pyi old mode 100755 new mode 100644 index 28358603..cdf28922 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/ext.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/ext.pyi @@ -15,7 +15,15 @@ class Extension: def filter_stream(self, stream): ... def parse(self, parser): ... def attr(self, name, lineno: Optional[Any] = ...): ... - def call_method(self, name, args: Optional[Any] = ..., kwargs: Optional[Any] = ..., dyn_args: Optional[Any] = ..., dyn_kwargs: Optional[Any] = ..., lineno: Optional[Any] = ...): ... + def call_method( + self, + name, + args: Optional[Any] = ..., + kwargs: Optional[Any] = ..., + dyn_args: Optional[Any] = ..., + dyn_kwargs: Optional[Any] = ..., + lineno: Optional[Any] = ..., + ): ... class InternationalizationExtension(Extension): tags: Any diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/filters.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/filters.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/lexer.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/lexer.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/loaders.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/loaders.pyi old mode 100755 new mode 100644 index 95a8e3e9..9f5cd943 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/loaders.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/loaders.pyi @@ -1,8 +1,16 @@ -from typing import Any, Callable, Iterable, List, Optional, Text, Tuple, Union +import sys from types import ModuleType +from typing import Any, Callable, Iterable, List, Optional, Text, Tuple, Union from .environment import Environment +if sys.version_info >= (3, 7): + from os import PathLike + + _SearchPath = Union[Text, PathLike[str], Iterable[Union[Text, PathLike[str]]]] +else: + _SearchPath = Union[Text, Iterable[Text]] + def split_template_path(template: Text) -> List[Text]: ... class BaseLoader: @@ -15,7 +23,7 @@ class FileSystemLoader(BaseLoader): searchpath: Text encoding: Any followlinks: Any - def __init__(self, searchpath: Union[Text, Iterable[Text]], encoding: Text = ..., followlinks: bool = ...) -> None: ... + def __init__(self, searchpath: _SearchPath, encoding: Text = ..., followlinks: bool = ...) -> None: ... def get_source(self, environment: Environment, template: Text) -> Tuple[Text, Text, Callable[..., Any]]: ... def list_templates(self): ... @@ -39,7 +47,7 @@ class FunctionLoader(BaseLoader): load_func: Any def __init__(self, load_func) -> None: ... def get_source( - self, environment: Environment, template: Text, + self, environment: Environment, template: Text ) -> Tuple[Text, Optional[Text], Optional[Callable[..., Any]]]: ... class PrefixLoader(BaseLoader): diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/meta.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/meta.pyi old mode 100755 new mode 100644 index 46ca83b6..8f0b50be --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/meta.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/meta.pyi @@ -1,4 +1,5 @@ from typing import Any + from jinja2.compiler import CodeGenerator class TrackingCodeGenerator(CodeGenerator): diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/nodes.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/nodes.pyi old mode 100755 new mode 100644 index 4fb410d5..84871975 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/nodes.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/nodes.pyi @@ -1,3 +1,4 @@ +import typing from typing import Any, Optional class Impossible(Exception): ... @@ -54,6 +55,10 @@ class If(Stmt): class Macro(Stmt): fields: Any + name: str + args: typing.List[Any] + defaults: typing.List[Any] + body: typing.List[Any] class CallBlock(Stmt): fields: Any diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/optimizer.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/optimizer.pyi old mode 100755 new mode 100644 index b55b08aa..d0056acf --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/optimizer.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/optimizer.pyi @@ -1,4 +1,5 @@ from typing import Any + from jinja2.visitor import NodeTransformer def optimize(node, environment): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/parser.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/parser.pyi old mode 100755 new mode 100644 index a16ae8d0..ae5962f6 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/parser.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/parser.pyi @@ -7,7 +7,9 @@ class Parser: filename: Any closed: bool extensions: Any - def __init__(self, environment, source, name: Optional[Any] = ..., filename: Optional[Any] = ..., state: Optional[Any] = ...) -> None: ... + def __init__( + self, environment, source, name: Optional[Any] = ..., filename: Optional[Any] = ..., state: Optional[Any] = ... + ) -> None: ... def fail(self, msg, lineno: Optional[Any] = ..., exc: Any = ...): ... def fail_unknown_tag(self, name, lineno: Optional[Any] = ...): ... def fail_eof(self, end_tokens: Optional[Any] = ..., lineno: Optional[Any] = ...): ... @@ -46,7 +48,13 @@ class Parser: def parse_pow(self): ... def parse_unary(self, with_filter: bool = ...): ... def parse_primary(self): ... - def parse_tuple(self, simplified: bool = ..., with_condexpr: bool = ..., extra_end_rules: Optional[Any] = ..., explicit_parentheses: bool = ...): ... + def parse_tuple( + self, + simplified: bool = ..., + with_condexpr: bool = ..., + extra_end_rules: Optional[Any] = ..., + explicit_parentheses: bool = ..., + ): ... def parse_list(self): ... def parse_dict(self): ... def parse_postfix(self, node): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/runtime.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/runtime.pyi old mode 100755 new mode 100644 index 271c0eff..66ffe9d3 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/runtime.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/runtime.pyi @@ -1,8 +1,8 @@ from typing import Any, Dict, Optional, Text, Union -from jinja2.utils import Markup as Markup, escape as escape, missing as missing, concat as concat -from jinja2.exceptions import TemplateRuntimeError as TemplateRuntimeError, TemplateNotFound as TemplateNotFound from jinja2.environment import Environment +from jinja2.exceptions import TemplateNotFound as TemplateNotFound, TemplateRuntimeError as TemplateRuntimeError +from jinja2.utils import Markup as Markup, concat as concat, escape as escape, missing as missing to_string: Any identity: Any @@ -22,7 +22,9 @@ class Context: exported_vars: Any name: Text blocks: Dict[str, Any] - def __init__(self, environment: Environment, parent: Union[Context, Dict[str, Any]], name: Text, blocks: Dict[str, Any]) -> None: ... + def __init__( + self, environment: Environment, parent: Union[Context, Dict[str, Any]], name: Text, blocks: Dict[str, Any] + ) -> None: ... def super(self, name, current): ... def get(self, key, default: Optional[Any] = ...): ... def resolve(self, key): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/sandbox.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/sandbox.pyi old mode 100755 new mode 100644 index 518deca5..1fc319cf --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/sandbox.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/sandbox.pyi @@ -1,4 +1,5 @@ from typing import Any + from jinja2.environment import Environment MAX_RANGE: int diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/tests.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/tests.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/utils.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/utils.pyi old mode 100755 new mode 100644 index bf5ff835..3d1b1ccc --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/utils.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/utils.pyi @@ -1,4 +1,6 @@ -from typing import Any, Callable, Iterable, Optional +from _typeshed import AnyPath +from typing import IO, Any, Callable, Iterable, Optional, Protocol, Text, TypeVar, Union +from typing_extensions import Literal from markupsafe import Markup as Markup, escape as escape, soft_unicode as soft_unicode @@ -6,21 +8,45 @@ missing: Any internal_code: Any concat: Any -def contextfunction(f): ... -def evalcontextfunction(f): ... -def environmentfunction(f): ... -def internalcode(f): ... -def is_undefined(obj): ... -def select_autoescape(enabled_extensions: Iterable[str] = ..., disabled_extensions: Iterable[str] = ..., default_for_string: bool = ..., default: bool = ...) -> Callable[[str], bool]: ... -def consume(iterable): ... -def clear_caches(): ... -def import_string(import_name, silent: bool = ...): ... -def open_if_exists(filename, mode: str = ...): ... -def object_type_repr(obj): ... -def pformat(obj, verbose: bool = ...): ... -def urlize(text, trim_url_limit: Optional[Any] = ..., nofollow: bool = ..., target: Optional[Any] = ...): ... -def generate_lorem_ipsum(n: int = ..., html: bool = ..., min: int = ..., max: int = ...): ... -def unicode_urlencode(obj, charset: str = ..., for_qs: bool = ...): ... +_CallableT = TypeVar("_CallableT", bound=Callable[..., Any]) + +class _ContextFunction(Protocol[_CallableT]): + contextfunction: Literal[True] + __call__: _CallableT + +class _EvalContextFunction(Protocol[_CallableT]): + evalcontextfunction: Literal[True] + __call__: _CallableT + +class _EnvironmentFunction(Protocol[_CallableT]): + environmentfunction: Literal[True] + __call__: _CallableT + +def contextfunction(f: _CallableT) -> _ContextFunction[_CallableT]: ... +def evalcontextfunction(f: _CallableT) -> _EvalContextFunction[_CallableT]: ... +def environmentfunction(f: _CallableT) -> _EnvironmentFunction[_CallableT]: ... +def internalcode(f: _CallableT) -> _CallableT: ... +def is_undefined(obj: object) -> bool: ... +def select_autoescape( + enabled_extensions: Iterable[str] = ..., + disabled_extensions: Iterable[str] = ..., + default_for_string: bool = ..., + default: bool = ..., +) -> Callable[[str], bool]: ... +def consume(iterable: Iterable[object]) -> None: ... +def clear_caches() -> None: ... +def import_string(import_name: str, silent: bool = ...) -> Any: ... +def open_if_exists(filename: AnyPath, mode: str = ...) -> Optional[IO[Any]]: ... +def object_type_repr(obj: object) -> str: ... +def pformat(obj: object, verbose: bool = ...) -> str: ... +def urlize( + text: Union[Markup, Text], + trim_url_limit: Optional[int] = ..., + rel: Optional[Union[Markup, Text]] = ..., + target: Optional[Union[Markup, Text]] = ..., +) -> str: ... +def generate_lorem_ipsum(n: int = ..., html: bool = ..., min: int = ..., max: int = ...) -> Union[Markup, str]: ... +def unicode_urlencode(obj: object, charset: str = ..., for_qs: bool = ...) -> str: ... class LRUCache: capacity: Any diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/visitor.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/jinja2/visitor.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/__init__.pyi new file mode 100644 index 00000000..3f57adcc --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/__init__.pyi @@ -0,0 +1,2 @@ +from .core import Markdown as Markdown, markdown as markdown, markdownFromFile as markdownFromFile +from .extensions import Extension as Extension diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/__meta__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/__meta__.pyi new file mode 100644 index 00000000..4a5eacaf --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/__meta__.pyi @@ -0,0 +1,3 @@ +from typing import Any + +__version_info__: Any diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/blockparser.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/blockparser.pyi new file mode 100644 index 00000000..602ecca0 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/blockparser.pyi @@ -0,0 +1,18 @@ +from typing import Any + +class State(list): + def set(self, state) -> None: ... + def reset(self) -> None: ... + def isstate(self, state): ... + +class BlockParser: + blockprocessors: Any + state: Any + md: Any + def __init__(self, md) -> None: ... + @property + def markdown(self): ... + root: Any + def parseDocument(self, lines): ... + def parseChunk(self, parent, text) -> None: ... + def parseBlocks(self, parent, blocks) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/blockprocessors.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/blockprocessors.pyi new file mode 100644 index 00000000..0637d278 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/blockprocessors.pyi @@ -0,0 +1,59 @@ +from typing import Any, Pattern + +logger: Any + +def build_block_parser(md, **kwargs): ... + +class BlockProcessor: + parser: Any + tab_length: Any + def __init__(self, parser) -> None: ... + def lastChild(self, parent): ... + def detab(self, text): ... + def looseDetab(self, text, level: int = ...): ... + def test(self, parent, block) -> None: ... + def run(self, parent, blocks) -> None: ... + +class ListIndentProcessor(BlockProcessor): + ITEM_TYPES: Any + LIST_TYPES: Any + INDENT_RE: Pattern + def __init__(self, *args) -> None: ... + def create_item(self, parent, block) -> None: ... + def get_level(self, parent, block): ... + +class CodeBlockProcessor(BlockProcessor): ... + +class BlockQuoteProcessor(BlockProcessor): + RE: Pattern + def clean(self, line): ... + +class OListProcessor(BlockProcessor): + TAG: str = ... + STARTSWITH: str = ... + LAZY_OL: bool = ... + SIBLING_TAGS: Any + RE: Pattern + CHILD_RE: Pattern + INDENT_RE: Pattern + def __init__(self, parser) -> None: ... + def get_items(self, block): ... + +class UListProcessor(OListProcessor): + TAG: str = ... + RE: Pattern + def __init__(self, parser) -> None: ... + +class HashHeaderProcessor(BlockProcessor): + RE: Pattern + +class SetextHeaderProcessor(BlockProcessor): + RE: Pattern + +class HRProcessor(BlockProcessor): + RE: str = ... + SEARCH_RE: Pattern + match: Any + +class EmptyBlockProcessor(BlockProcessor): ... +class ParagraphProcessor(BlockProcessor): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/core.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/core.pyi new file mode 100644 index 00000000..4d8dadfa --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/core.pyi @@ -0,0 +1,63 @@ +from typing import Any, BinaryIO, Callable, ClassVar, Dict, List, Mapping, Optional, Sequence, Text, TextIO, Union +from typing_extensions import Literal +from xml.etree.ElementTree import Element + +from .blockparser import BlockParser +from .extensions import Extension +from .util import HtmlStash, Registry + +class Markdown: + preprocessors: Registry + inlinePatterns: Registry + treeprocessors: Registry + postprocessors: Registry + parser: BlockParser + htmlStash: HtmlStash + output_formats: ClassVar[Dict[Literal["xhtml", "html"], Callable[[Element], Text]]] + output_format: Literal["xhtml", "html"] + serializer: Callable[[Element], Text] + tab_length: int + block_level_elements: List[str] + def __init__( + self, + *, + extensions: Optional[Sequence[Union[str, Extension]]] = ..., + extension_configs: Optional[Mapping[str, Mapping[str, Any]]] = ..., + output_format: Optional[Literal["xhtml", "html"]] = ..., + tab_length: Optional[int] = ..., + ) -> None: ... + def build_parser(self) -> Markdown: ... + def registerExtensions( + self, extensions: Sequence[Union[Extension, str]], configs: Mapping[str, Mapping[str, Any]] + ) -> Markdown: ... + def build_extension(self, ext_name: Text, configs: Mapping[str, str]) -> Extension: ... + def registerExtension(self, extension: Extension) -> Markdown: ... + def reset(self: Markdown) -> Markdown: ... + def set_output_format(self, format: Literal["xhtml", "html"]) -> Markdown: ... + def is_block_level(self, tag: str) -> bool: ... + def convert(self, source: Text) -> Text: ... + def convertFile( + self, + input: Optional[Union[str, TextIO, BinaryIO]] = ..., + output: Optional[Union[str, TextIO, BinaryIO]] = ..., + encoding: Optional[str] = ..., + ) -> Markdown: ... + +def markdown( + text: Text, + *, + extensions: Optional[Sequence[Union[str, Extension]]] = ..., + extension_configs: Optional[Mapping[str, Mapping[str, Any]]] = ..., + output_format: Optional[Literal["xhtml", "html"]] = ..., + tab_length: Optional[int] = ..., +) -> Text: ... +def markdownFromFile( + *, + input: Optional[Union[str, TextIO, BinaryIO]] = ..., + output: Optional[Union[str, TextIO, BinaryIO]] = ..., + encoding: Optional[str] = ..., + extensions: Optional[Sequence[Union[str, Extension]]] = ..., + extension_configs: Optional[Mapping[str, Mapping[str, Any]]] = ..., + output_format: Optional[Literal["xhtml", "html"]] = ..., + tab_length: Optional[int] = ..., +) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/__init__.pyi new file mode 100644 index 00000000..11d3b305 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/__init__.pyi @@ -0,0 +1,13 @@ +from typing import Any, Dict, List, Mapping, Tuple + +from markdown.core import Markdown + +class Extension: + config: Mapping[str, List[Any]] = ... + def __init__(self, **kwargs: Any) -> None: ... + def getConfig(self, key: str, default: Any = ...) -> Any: ... + def getConfigs(self) -> Dict[str, Any]: ... + def getConfigInfo(self) -> List[Tuple[str, str]]: ... + def setConfig(self, key: str, value: Any) -> None: ... + def setConfigs(self, items: Mapping[str, Any]) -> None: ... + def extendMarkdown(self, md: Markdown) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/abbr.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/abbr.pyi new file mode 100644 index 00000000..9316c65f --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/abbr.pyi @@ -0,0 +1,16 @@ +from typing import Any, Pattern + +from markdown.blockprocessors import BlockProcessor +from markdown.extensions import Extension +from markdown.inlinepatterns import InlineProcessor + +ABBR_REF_RE: Pattern + +class AbbrExtension(Extension): ... +class AbbrPreprocessor(BlockProcessor): ... + +class AbbrInlineProcessor(InlineProcessor): + title: Any + def __init__(self, pattern, title) -> None: ... + +def makeExtension(**kwargs): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/admonition.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/admonition.pyi new file mode 100644 index 00000000..24005e29 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/admonition.pyi @@ -0,0 +1,15 @@ +from typing import Any, Pattern + +from markdown.blockprocessors import BlockProcessor +from markdown.extensions import Extension + +class AdmonitionExtension(Extension): ... + +class AdmonitionProcessor(BlockProcessor): + CLASSNAME: str = ... + CLASSNAME_TITLE: str = ... + RE: Pattern + RE_SPACES: Any + def get_class_and_title(self, match): ... + +def makeExtension(**kwargs): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/attr_list.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/attr_list.pyi new file mode 100644 index 00000000..d073b486 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/attr_list.pyi @@ -0,0 +1,20 @@ +from typing import Any, Pattern + +from markdown.extensions import Extension +from markdown.treeprocessors import Treeprocessor + +def get_attrs(str): ... +def isheader(elem): ... + +class AttrListTreeprocessor(Treeprocessor): + BASE_RE: str = ... + HEADER_RE: Pattern + BLOCK_RE: Pattern + INLINE_RE: Pattern + NAME_RE: Pattern + def assign_attrs(self, elem, attrs) -> None: ... + def sanitize_name(self, name): ... + +class AttrListExtension(Extension): ... + +def makeExtension(**kwargs): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/codehilite.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/codehilite.pyi new file mode 100644 index 00000000..b13652b3 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/codehilite.pyi @@ -0,0 +1,42 @@ +from typing import Any, Optional + +from markdown.extensions import Extension +from markdown.treeprocessors import Treeprocessor + +pygments: bool + +def parse_hl_lines(expr): ... + +class CodeHilite: + src: Any + lang: Any + linenums: Any + guess_lang: Any + css_class: Any + style: Any + noclasses: Any + tab_length: Any + hl_lines: Any + use_pygments: Any + def __init__( + self, + src: Optional[Any] = ..., + linenums: Optional[Any] = ..., + guess_lang: bool = ..., + css_class: str = ..., + lang: Optional[Any] = ..., + style: str = ..., + noclasses: bool = ..., + tab_length: int = ..., + hl_lines: Optional[Any] = ..., + use_pygments: bool = ..., + ) -> None: ... + def hilite(self): ... + +class HiliteTreeprocessor(Treeprocessor): + def code_unescape(self, text): ... + +class CodeHiliteExtension(Extension): + def __init__(self, **kwargs) -> None: ... + +def makeExtension(**kwargs): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/def_list.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/def_list.pyi new file mode 100644 index 00000000..f1d61ccc --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/def_list.pyi @@ -0,0 +1,13 @@ +from typing import Any, Pattern + +from markdown.blockprocessors import BlockProcessor, ListIndentProcessor +from markdown.extensions import Extension + +class DefListProcessor(BlockProcessor): + RE: Pattern + NO_INDENT_RE: Pattern + +class DefListIndentProcessor(ListIndentProcessor): ... +class DefListExtension(Extension): ... + +def makeExtension(**kwargs): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/extra.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/extra.pyi new file mode 100644 index 00000000..8d761845 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/extra.pyi @@ -0,0 +1,10 @@ +from typing import Any + +from markdown.extensions import Extension + +extensions: Any + +class ExtraExtension(Extension): + def __init__(self, **kwargs) -> None: ... + +def makeExtension(**kwargs): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/fenced_code.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/fenced_code.pyi new file mode 100644 index 00000000..3a216c43 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/fenced_code.pyi @@ -0,0 +1,16 @@ +from typing import Any, Pattern + +from markdown.extensions import Extension +from markdown.preprocessors import Preprocessor + +class FencedCodeExtension(Extension): ... + +class FencedBlockPreprocessor(Preprocessor): + FENCED_BLOCK_RE: Pattern + CODE_WRAP: str = ... + LANG_TAG: str = ... + checked_for_codehilite: bool = ... + codehilite_conf: Any + def __init__(self, md) -> None: ... + +def makeExtension(**kwargs): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/footnotes.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/footnotes.pyi new file mode 100644 index 00000000..d4b2953d --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/footnotes.pyi @@ -0,0 +1,57 @@ +from typing import Any, Pattern + +from markdown.extensions import Extension +from markdown.inlinepatterns import InlineProcessor +from markdown.postprocessors import Postprocessor +from markdown.preprocessors import Preprocessor +from markdown.treeprocessors import Treeprocessor + +FN_BACKLINK_TEXT: Any +NBSP_PLACEHOLDER: Any +DEF_RE: Pattern +TABBED_RE: Pattern +RE_REF_ID: Any + +class FootnoteExtension(Extension): + unique_prefix: int = ... + found_refs: Any + used_refs: Any + def __init__(self, **kwargs) -> None: ... + parser: Any + md: Any + footnotes: Any + def reset(self) -> None: ... + def unique_ref(self, reference, found: bool = ...): ... + def findFootnotesPlaceholder(self, root): ... + def setFootnote(self, id, text) -> None: ... + def get_separator(self): ... + def makeFootnoteId(self, id): ... + def makeFootnoteRefId(self, id, found: bool = ...): ... + def makeFootnotesDiv(self, root): ... + +class FootnotePreprocessor(Preprocessor): + footnotes: Any + def __init__(self, footnotes) -> None: ... + def detectTabbed(self, lines): ... + +class FootnoteInlineProcessor(InlineProcessor): + footnotes: Any + def __init__(self, pattern, footnotes) -> None: ... + +class FootnotePostTreeprocessor(Treeprocessor): + footnotes: Any + def __init__(self, footnotes) -> None: ... + def add_duplicates(self, li, duplicates) -> None: ... + def get_num_duplicates(self, li): ... + def handle_duplicates(self, parent) -> None: ... + offset: int = ... + +class FootnoteTreeprocessor(Treeprocessor): + footnotes: Any + def __init__(self, footnotes) -> None: ... + +class FootnotePostprocessor(Postprocessor): + footnotes: Any + def __init__(self, footnotes) -> None: ... + +def makeExtension(**kwargs): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/legacy_attrs.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/legacy_attrs.pyi new file mode 100644 index 00000000..e5e1a9c1 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/legacy_attrs.pyi @@ -0,0 +1,13 @@ +from typing import Any, Pattern + +from markdown.extensions import Extension +from markdown.treeprocessors import Treeprocessor + +ATTR_RE: Pattern + +class LegacyAttrs(Treeprocessor): + def handleAttributes(self, el, txt): ... + +class LegacyAttrExtension(Extension): ... + +def makeExtension(**kwargs): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/legacy_em.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/legacy_em.pyi new file mode 100644 index 00000000..c1de142b --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/legacy_em.pyi @@ -0,0 +1,13 @@ +from typing import Any + +from markdown.extensions import Extension +from markdown.inlinepatterns import UnderscoreProcessor + +EMPHASIS_RE: str +STRONG_RE: str +STRONG_EM_RE: str + +class LegacyUnderscoreProcessor(UnderscoreProcessor): ... +class LegacyEmExtension(Extension): ... + +def makeExtension(**kwargs): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/md_in_html.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/md_in_html.pyi new file mode 100644 index 00000000..3991a94d --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/md_in_html.pyi @@ -0,0 +1,9 @@ +from typing import Any, Optional + +from markdown.blockprocessors import BlockProcessor +from markdown.extensions import Extension + +class MarkdownInHtmlProcessor(BlockProcessor): ... +class MarkdownInHtmlExtension(Extension): ... + +def makeExtension(**kwargs): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/meta.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/meta.pyi new file mode 100644 index 00000000..dc5ac5b5 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/meta.pyi @@ -0,0 +1,18 @@ +from typing import Any, Pattern + +from markdown.extensions import Extension +from markdown.preprocessors import Preprocessor + +log: Any +META_RE: Pattern +META_MORE_RE: Pattern +BEGIN_RE: Pattern +END_RE: Pattern + +class MetaExtension(Extension): + md: Any + def reset(self) -> None: ... + +class MetaPreprocessor(Preprocessor): ... + +def makeExtension(**kwargs): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/nl2br.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/nl2br.pyi new file mode 100644 index 00000000..a569faba --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/nl2br.pyi @@ -0,0 +1,9 @@ +from typing import Any + +from markdown.extensions import Extension + +BR_RE: str + +class Nl2BrExtension(Extension): ... + +def makeExtension(**kwargs): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/sane_lists.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/sane_lists.pyi new file mode 100644 index 00000000..2a9cc86d --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/sane_lists.pyi @@ -0,0 +1,14 @@ +from typing import Any, Pattern + +from markdown.blockprocessors import OListProcessor, UListProcessor +from markdown.extensions import Extension + +class SaneOListProcessor(OListProcessor): + def __init__(self, parser) -> None: ... + +class SaneUListProcessor(UListProcessor): + def __init__(self, parser) -> None: ... + +class SaneListExtension(Extension): ... + +def makeExtension(**kwargs): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/smarty.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/smarty.pyi new file mode 100644 index 00000000..5ec9d30e --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/smarty.pyi @@ -0,0 +1,39 @@ +from typing import Any, Pattern + +from markdown.extensions import Extension +from markdown.inlinepatterns import HtmlInlineProcessor + +punctClass: str +endOfWordClass: str +closeClass: str +openingQuotesBase: str +substitutions: Any +singleQuoteStartRe: Any +doubleQuoteStartRe: Any +doubleQuoteSetsRe: str +singleQuoteSetsRe: str +decadeAbbrRe: str +openingDoubleQuotesRegex: Any +closingDoubleQuotesRegex: str +closingDoubleQuotesRegex2: Any +openingSingleQuotesRegex: Any +closingSingleQuotesRegex: Any +closingSingleQuotesRegex2: Any +remainingSingleQuotesRegex: str +remainingDoubleQuotesRegex: str +HTML_STRICT_RE: str + +class SubstituteTextPattern(HtmlInlineProcessor): + replace: Any + def __init__(self, pattern, replace, md) -> None: ... + +class SmartyExtension(Extension): + substitutions: Any + def __init__(self, **kwargs) -> None: ... + def educateDashes(self, md) -> None: ... + def educateEllipses(self, md) -> None: ... + def educateAngledQuotes(self, md) -> None: ... + def educateQuotes(self, md) -> None: ... + inlinePatterns: Any + +def makeExtension(**kwargs): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/tables.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/tables.pyi new file mode 100644 index 00000000..2250cae7 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/tables.pyi @@ -0,0 +1,19 @@ +from typing import Any + +from markdown.blockprocessors import BlockProcessor +from markdown.extensions import Extension + +PIPE_NONE: int +PIPE_LEFT: int +PIPE_RIGHT: int + +class TableProcessor(BlockProcessor): + RE_CODE_PIPES: Any + RE_END_BORDER: Any + border: bool = ... + separator: str = ... + def __init__(self, parser) -> None: ... + +class TableExtension(Extension): ... + +def makeExtension(**kwargs): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/toc.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/toc.pyi new file mode 100644 index 00000000..da6c9396 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/toc.pyi @@ -0,0 +1,44 @@ +from typing import Any, Pattern + +from markdown.extensions import Extension +from markdown.treeprocessors import Treeprocessor + +def slugify(value, separator): ... + +IDCOUNT_RE: Pattern + +def unique(id, ids): ... +def get_name(el): ... +def stashedHTML2text(text, md, strip_entities: bool = ...): ... +def unescape(text): ... +def nest_toc_tokens(toc_list): ... + +class TocTreeprocessor(Treeprocessor): + marker: Any + title: Any + base_level: Any + slugify: Any + sep: Any + use_anchors: Any + anchorlink_class: Any + use_permalinks: Any + permalink_class: Any + permalink_title: Any + header_rgx: Any + toc_top: int = ... + toc_bottom: Any + def __init__(self, md, config) -> None: ... + def iterparent(self, node) -> None: ... + def replace_marker(self, root, elem) -> None: ... + def set_level(self, elem) -> None: ... + def add_anchor(self, c, elem_id) -> None: ... + def add_permalink(self, c, elem_id) -> None: ... + def build_toc_div(self, toc_list): ... + +class TocExtension(Extension): + TreeProcessorClass: Any + def __init__(self, **kwargs) -> None: ... + md: Any + def reset(self) -> None: ... + +def makeExtension(**kwargs): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/wikilinks.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/wikilinks.pyi new file mode 100644 index 00000000..044edb0e --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/extensions/wikilinks.pyi @@ -0,0 +1,16 @@ +from typing import Any + +from markdown.extensions import Extension +from markdown.inlinepatterns import InlineProcessor + +def build_url(label, base, end): ... + +class WikiLinkExtension(Extension): + def __init__(self, **kwargs) -> None: ... + md: Any + +class WikiLinksInlineProcessor(InlineProcessor): + config: Any + def __init__(self, pattern, config) -> None: ... + +def makeExtension(**kwargs): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/inlinepatterns.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/inlinepatterns.pyi new file mode 100644 index 00000000..70f469ac --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/inlinepatterns.pyi @@ -0,0 +1,103 @@ +from typing import Any, Match, Optional, Tuple, Union +from xml.etree.ElementTree import Element + +def build_inlinepatterns(md, **kwargs): ... + +NOIMG: str +BACKTICK_RE: str +ESCAPE_RE: str +EMPHASIS_RE: str +STRONG_RE: str +SMART_STRONG_RE: str +SMART_EMPHASIS_RE: str +SMART_STRONG_EM_RE: str +EM_STRONG_RE: str +EM_STRONG2_RE: str +STRONG_EM_RE: str +STRONG_EM2_RE: str +STRONG_EM3_RE: str +LINK_RE: str +IMAGE_LINK_RE: str +REFERENCE_RE: str +IMAGE_REFERENCE_RE: str +NOT_STRONG_RE: str +AUTOLINK_RE: str +AUTOMAIL_RE: str +HTML_RE: str +ENTITY_RE: str +LINE_BREAK_RE: str + +def dequote(string): ... + +class EmStrongItem: ... + +class Pattern: + ANCESTOR_EXCLUDES: Any + pattern: Any + compiled_re: Any + md: Any + def __init__(self, pattern, md: Optional[Any] = ...) -> None: ... + @property + def markdown(self): ... + def getCompiledRegExp(self): ... + def handleMatch(self, m: Match) -> Optional[Union[str, Element]]: ... + def type(self): ... + def unescape(self, text): ... + +class InlineProcessor(Pattern): + safe_mode: bool = ... + def __init__(self, pattern, md: Optional[Any] = ...) -> None: ... + def handleMatch(self, m: Match, data) -> Union[Tuple[Element, int, int], Tuple[None, None, None]]: ... # type: ignore + +class SimpleTextPattern(Pattern): ... +class SimpleTextInlineProcessor(InlineProcessor): ... +class EscapeInlineProcessor(InlineProcessor): ... + +class SimpleTagPattern(Pattern): + tag: Any + def __init__(self, pattern, tag) -> None: ... + +class SimpleTagInlineProcessor(InlineProcessor): + tag: Any + def __init__(self, pattern, tag) -> None: ... + +class SubstituteTagPattern(SimpleTagPattern): ... +class SubstituteTagInlineProcessor(SimpleTagInlineProcessor): ... + +class BacktickInlineProcessor(InlineProcessor): + ESCAPED_BSLASH: Any + tag: str = ... + def __init__(self, pattern) -> None: ... + +class DoubleTagPattern(SimpleTagPattern): ... +class DoubleTagInlineProcessor(SimpleTagInlineProcessor): ... +class HtmlInlineProcessor(InlineProcessor): ... + +class AsteriskProcessor(InlineProcessor): + PATTERNS: Any + def build_single(self, m, tag, idx): ... + def build_double(self, m, tags, idx): ... + def build_double2(self, m, tags, idx): ... + def parse_sub_patterns(self, data, parent, last, idx) -> None: ... + def build_element(self, m, builder, tags, index): ... + +class UnderscoreProcessor(AsteriskProcessor): + PATTERNS: Any + +class LinkInlineProcessor(InlineProcessor): + RE_LINK: Any + RE_TITLE_CLEAN: Any + def getLink(self, data, index): ... + def getText(self, data, index): ... + +class ImageInlineProcessor(LinkInlineProcessor): ... + +class ReferenceInlineProcessor(LinkInlineProcessor): + NEWLINE_CLEANUP_RE: Pattern + def evalId(self, data, index, text): ... + def makeTag(self, href, title, text): ... + +class ShortReferenceInlineProcessor(ReferenceInlineProcessor): ... +class ImageReferenceInlineProcessor(ReferenceInlineProcessor): ... +class AutolinkInlineProcessor(InlineProcessor): ... +class AutomailInlineProcessor(InlineProcessor): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/pep562.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/pep562.pyi new file mode 100644 index 00000000..398bf66b --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/pep562.pyi @@ -0,0 +1,9 @@ +from typing import Any + +class Version: + def __new__(cls, major, minor, micro, release: str = ..., pre: int = ..., post: int = ..., dev: int = ...): ... + +class Pep562: + def __init__(self, name) -> None: ... + def __dir__(self): ... + def __getattr__(self, name): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/postprocessors.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/postprocessors.pyi new file mode 100644 index 00000000..42cddc12 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/postprocessors.pyi @@ -0,0 +1,17 @@ +from typing import Any, Pattern + +from . import util + +def build_postprocessors(md, **kwargs): ... + +class Postprocessor(util.Processor): + def run(self, text) -> None: ... + +class RawHtmlPostprocessor(Postprocessor): + def isblocklevel(self, html): ... + +class AndSubstitutePostprocessor(Postprocessor): ... + +class UnescapePostprocessor(Postprocessor): + RE: Pattern + def unescape(self, m): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/preprocessors.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/preprocessors.pyi new file mode 100644 index 00000000..b3ab45f5 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/preprocessors.pyi @@ -0,0 +1,23 @@ +from typing import Any, Iterable, List, Pattern + +from . import util + +def build_preprocessors(md, **kwargs): ... + +class Preprocessor(util.Processor): + def run(self, lines: List[str]) -> List[str]: ... + +class NormalizeWhitespace(Preprocessor): ... + +class HtmlBlockPreprocessor(Preprocessor): + right_tag_patterns: Any + attrs_pattern: str = ... + left_tag_pattern: Any + attrs_re: Any + left_tag_re: Any + markdown_in_raw: bool = ... + +class ReferencePreprocessor(Preprocessor): + TITLE: str = ... + RE: Pattern + TITLE_RE: Pattern diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/serializers.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/serializers.pyi new file mode 100644 index 00000000..cdad4b1b --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/serializers.pyi @@ -0,0 +1,4 @@ +from typing import Any + +def to_html_string(element): ... +def to_xhtml_string(element): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/treeprocessors.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/treeprocessors.pyi new file mode 100644 index 00000000..a213600a --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/treeprocessors.pyi @@ -0,0 +1,19 @@ +from typing import Any, Optional + +from . import util + +def build_treeprocessors(md, **kwargs): ... +def isString(s): ... + +class Treeprocessor(util.Processor): + def run(self, root) -> None: ... + +class InlineProcessor(Treeprocessor): + inlinePatterns: Any + ancestors: Any + def __init__(self, md) -> None: ... + stashed_nodes: Any + parent_map: Any + def run(self, tree, ancestors: Optional[Any] = ...): ... + +class PrettifyTreeprocessor(Treeprocessor): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/util.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/util.pyi new file mode 100644 index 00000000..66a6d7ad --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markdown/util.pyi @@ -0,0 +1,56 @@ +from collections import namedtuple +from typing import Any, Optional, Pattern + +PY37: Any +__deprecated__: Any +BLOCK_LEVEL_ELEMENTS: Any +STX: str +ETX: str +INLINE_PLACEHOLDER_PREFIX: Any +INLINE_PLACEHOLDER: Any +INLINE_PLACEHOLDER_RE: Pattern +AMP_SUBSTITUTE: Any +HTML_PLACEHOLDER: Any +HTML_PLACEHOLDER_RE: Pattern +TAG_PLACEHOLDER: Any +INSTALLED_EXTENSIONS: Any +RTL_BIDI_RANGES: Any + +def deprecated(message, stacklevel: int = ...): ... +def isBlockLevel(tag): ... +def parseBoolValue(value, fail_on_errors: bool = ..., preserve_none: bool = ...): ... +def code_escape(text): ... + +class AtomicString(str): ... + +class Processor: + md: Any + def __init__(self, md: Optional[Any] = ...) -> None: ... + @property + def markdown(self): ... + +class HtmlStash: + html_counter: int = ... + rawHtmlBlocks: Any + tag_counter: int = ... + tag_data: Any + def __init__(self) -> None: ... + def store(self, html): ... + def reset(self) -> None: ... + def get_placeholder(self, key): ... + def store_tag(self, tag, attrs, left_index, right_index): ... + +class Registry: + def __init__(self) -> None: ... + def __contains__(self, item): ... + def __iter__(self) -> Any: ... + def __getitem__(self, key): ... + def __len__(self): ... + def get_index_for_name(self, name): ... + def register(self, item, name, priority) -> None: ... + def deregister(self, name, strict: bool = ...) -> None: ... + def __setitem__(self, key, value) -> None: ... + def __delitem__(self, key) -> None: ... + def add(self, key, value, location) -> None: ... + +def __getattr__(name): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markupsafe/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markupsafe/__init__.pyi old mode 100755 new mode 100644 index 6bedd247..f73d05df --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markupsafe/__init__.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markupsafe/__init__.pyi @@ -1,9 +1,9 @@ +import string import sys - -from typing import Any, Callable, Dict, Iterable, List, Optional, Sequence, Text, Tuple, Union from collections import Mapping +from typing import Any, Callable, Iterable, List, Optional, Sequence, Text, Tuple, Union + from markupsafe._compat import text_type -import string from markupsafe._native import escape as escape, escape_silent as escape_silent, soft_unicode as soft_unicode class Markup(text_type): @@ -21,7 +21,7 @@ class Markup(text_type): def unescape(self) -> Text: ... def striptags(self) -> Text: ... @classmethod - def escape(cls, s: text_type) -> Markup: ... + def escape(cls, s: text_type) -> Markup: ... # noqa: F811 def partition(self, sep: text_type) -> Tuple[Markup, Markup, Markup]: ... def rpartition(self, sep: text_type) -> Tuple[Markup, Markup, Markup]: ... def format(self, *args, **kwargs) -> Markup: ... @@ -41,12 +41,14 @@ class Markup(text_type): def strip(self, chars: Optional[text_type] = ...) -> Markup: ... def center(self, width: int, fillchar: text_type = ...) -> Markup: ... def zfill(self, width: int) -> Markup: ... - def translate(self, table: Union[Mapping[int, Union[int, text_type, None]], Sequence[Union[int, text_type, None]]]) -> Markup: ... + def translate( + self, table: Union[Mapping[int, Union[int, text_type, None]], Sequence[Union[int, text_type, None]]] + ) -> Markup: ... def expandtabs(self, tabsize: int = ...) -> Markup: ... class EscapeFormatter(string.Formatter): escape: Callable[[text_type], Markup] - def __init__(self, escape: Callable[[text_type], Markup]) -> None: ... + def __init__(self, escape: Callable[[text_type], Markup]) -> None: ... # noqa: F811 def format_field(self, value: text_type, format_spec: text_type) -> Markup: ... if sys.version_info >= (3,): diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markupsafe/_compat.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markupsafe/_compat.pyi old mode 100755 new mode 100644 index 9ca94010..a3c2bc7f --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markupsafe/_compat.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markupsafe/_compat.pyi @@ -1,19 +1,21 @@ import sys +from typing import Iterator, Mapping, Tuple, TypeVar -from typing import Any, Iterator, Mapping, Text, Tuple, TypeVar - -_K = TypeVar('_K') -_V = TypeVar('_V') +_K = TypeVar("_K") +_V = TypeVar("_V") PY2: bool + def iteritems(d: Mapping[_K, _V]) -> Iterator[Tuple[_K, _V]]: ... + if sys.version_info >= (3,): text_type = str - string_types = str, + string_types = (str,) unichr = chr - int_types = int, + int_types = (int,) else: from __builtin__ import unichr as unichr + text_type = unicode string_types = (str, unicode) int_types = (int, long) diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markupsafe/_constants.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markupsafe/_constants.pyi old mode 100755 new mode 100644 index a0d67ed7..cd051158 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markupsafe/_constants.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markupsafe/_constants.pyi @@ -1,3 +1,3 @@ -from typing import Any, Dict, Text +from typing import Dict, Text HTML_ENTITIES: Dict[Text, int] diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markupsafe/_native.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markupsafe/_native.pyi old mode 100755 new mode 100644 index ecf20c60..01eb723f --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markupsafe/_native.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markupsafe/_native.pyi @@ -1,6 +1,7 @@ +from typing import Text, Union + from . import Markup -from ._compat import text_type, string_types -from typing import Union, Text +from ._compat import text_type def escape(s: Union[Markup, Text]) -> Markup: ... def escape_silent(s: Union[None, Markup, Text]) -> Markup: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markupsafe/_speedups.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markupsafe/_speedups.pyi old mode 100755 new mode 100644 index ecf20c60..01eb723f --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markupsafe/_speedups.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/markupsafe/_speedups.pyi @@ -1,6 +1,7 @@ +from typing import Text, Union + from . import Markup -from ._compat import text_type, string_types -from typing import Union, Text +from ._compat import text_type def escape(s: Union[Markup, Text]) -> Markup: ... def escape_silent(s: Union[None, Markup, Text]) -> Markup: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/maxminddb/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/maxminddb/__init__.pyi old mode 100755 new mode 100644 index fe20a1f4..d1d18bcb --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/maxminddb/__init__.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/maxminddb/__init__.pyi @@ -3,5 +3,4 @@ from typing import Text from maxminddb import reader def open_database(database: Text, mode: int = ...) -> reader.Reader: ... - def Reader(database: Text) -> reader.Reader: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/maxminddb/compat.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/maxminddb/compat.pyi old mode 100755 new mode 100644 index ca8e3ab2..c3de66ca --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/maxminddb/compat.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/maxminddb/compat.pyi @@ -1,5 +1,3 @@ -from ipaddress import IPv4Address, IPv6Address - from typing import Any def compat_ip_address(address: object) -> Any: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/maxminddb/const.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/maxminddb/const.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/maxminddb/decoder.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/maxminddb/decoder.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/maxminddb/errors.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/maxminddb/errors.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/maxminddb/extension.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/maxminddb/extension.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/maxminddb/reader.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/maxminddb/reader.pyi old mode 100755 new mode 100644 index 882a4987..b6cfb173 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/maxminddb/reader.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/maxminddb/reader.pyi @@ -1,5 +1,4 @@ from ipaddress import IPv4Address, IPv6Address - from types import TracebackType from typing import Any, Mapping, Optional, Sequence, Text, Tuple, Type, Union @@ -11,7 +10,12 @@ class Reader: def get_with_prefix_len(self, ip_address: Union[Text, IPv4Address, IPv6Address]) -> Tuple[Optional[Any], int]: ... def close(self) -> None: ... def __enter__(self) -> Reader: ... - def __exit__(self, exc_type: Optional[Type[BaseException]] = ..., exc_val: Optional[BaseException] = ..., exc_tb: Optional[TracebackType] = ...) -> None: ... + def __exit__( + self, + exc_type: Optional[Type[BaseException]] = ..., + exc_val: Optional[BaseException] = ..., + exc_tb: Optional[TracebackType] = ..., + ) -> None: ... class Metadata: node_count: int = ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/mock.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/mock.pyi old mode 100755 new mode 100644 index 396d806b..013a22a2 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/mock.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/mock.pyi @@ -1,9 +1,29 @@ -# Stubs for mock - import sys -from typing import Any, List, Optional, Text, Tuple, Type, TypeVar +from typing import Any, Callable, Generic, List, Mapping, Optional, Sequence, Text, Tuple, Type, TypeVar, Union, overload +_F = TypeVar("_F", bound=Callable[..., Any]) _T = TypeVar("_T") +_TT = TypeVar("_TT", bound=Type[Any]) +_R = TypeVar("_R") + +__all__ = [ + "Mock", + "MagicMock", + "patch", + "sentinel", + "DEFAULT", + "ANY", + "call", + "create_autospec", + "AsyncMock", + "FILTER_DIR", + "NonCallableMock", + "NonCallableMagicMock", + "mock_open", + "PropertyMock", + "seal", +] +__version__: str FILTER_DIR: Any @@ -20,7 +40,27 @@ class _Sentinel: sentinel: Any DEFAULT: Any -class _CallList(List[_T]): +class _Call(Tuple[Any, ...]): + def __new__( + cls, value: Any = ..., name: Optional[Any] = ..., parent: Optional[Any] = ..., two: bool = ..., from_kall: bool = ... + ) -> Any: ... + name: Any + parent: Any + from_kall: Any + def __init__( + self, value: Any = ..., name: Optional[Any] = ..., parent: Optional[Any] = ..., two: bool = ..., from_kall: bool = ... + ) -> None: ... + def __eq__(self, other: Any) -> bool: ... + __ne__: Any + def __call__(self, *args: Any, **kwargs: Any) -> _Call: ... + def __getattr__(self, attr: Any) -> Any: ... + def count(self, *args: Any, **kwargs: Any) -> Any: ... + def index(self, *args: Any, **kwargs: Any) -> Any: ... + def call_list(self) -> Any: ... + +call: _Call + +class _CallList(List[_Call]): def __contains__(self, value: Any) -> bool: ... class _MockIter: @@ -32,44 +72,167 @@ class _MockIter: class Base: def __init__(self, *args: Any, **kwargs: Any) -> None: ... -# TODO: Defining this and other mock classes as classes in this stub causes -# many false positives with mypy and production code. See if we can -# improve mypy somehow and use a class with an "Any" base class. -NonCallableMock = Any +class NonCallableMock(Base, Any): # type: ignore + def __new__(__cls, *args: Any, **kw: Any) -> NonCallableMock: ... + def __init__( + self, + spec: Union[List[str], object, Type[object], None] = ..., + wraps: Optional[Any] = ..., + name: Optional[str] = ..., + spec_set: Union[List[str], object, Type[object], None] = ..., + parent: Optional[NonCallableMock] = ..., + _spec_state: Optional[Any] = ..., + _new_name: str = ..., + _new_parent: Optional[NonCallableMock] = ..., + _spec_as_instance: bool = ..., + _eat_self: Optional[bool] = ..., + unsafe: bool = ..., + **kwargs: Any, + ) -> None: ... + def __getattr__(self, name: str) -> Any: ... + if sys.version_info >= (3, 8): + def _calls_repr(self, prefix: str = ...) -> str: ... + def assert_called_with(self, *args: Any, **kwargs: Any) -> None: ... + def assert_not_called(self) -> None: ... + def assert_called_once_with(self, *args: Any, **kwargs: Any) -> None: ... + def _format_mock_failure_message(self, args: Any, kwargs: Any, action: str = ...) -> str: ... + elif sys.version_info >= (3, 5): + def assert_called_with(_mock_self, *args: Any, **kwargs: Any) -> None: ... + def assert_not_called(_mock_self) -> None: ... + def assert_called_once_with(_mock_self, *args: Any, **kwargs: Any) -> None: ... + def _format_mock_failure_message(self, args: Any, kwargs: Any) -> str: ... + if sys.version_info >= (3, 8): + def assert_called(self) -> None: ... + def assert_called_once(self) -> None: ... + elif sys.version_info >= (3, 6): + def assert_called(_mock_self) -> None: ... + def assert_called_once(_mock_self) -> None: ... + if sys.version_info >= (3, 6): + def reset_mock(self, visited: Any = ..., *, return_value: bool = ..., side_effect: bool = ...) -> None: ... + elif sys.version_info >= (3, 5): + def reset_mock(self, visited: Any = ...) -> None: ... + if sys.version_info >= (3, 7): + def _extract_mock_name(self) -> str: ... + def _get_call_signature_from_name(self, name: str) -> Any: ... + def assert_any_call(self, *args: Any, **kwargs: Any) -> None: ... + def assert_has_calls(self, calls: Sequence[_Call], any_order: bool = ...) -> None: ... + def mock_add_spec(self, spec: Any, spec_set: bool = ...) -> None: ... + def _mock_add_spec(self, spec: Any, spec_set: bool, _spec_as_instance: bool = ..., _eat_self: bool = ...) -> None: ... + def attach_mock(self, mock: NonCallableMock, attribute: str) -> None: ... + def configure_mock(self, **kwargs: Any) -> None: ... + return_value: Any + side_effect: Any + called: bool + call_count: int + call_args: Any + call_args_list: _CallList + mock_calls: _CallList + def _format_mock_call_signature(self, args: Any, kwargs: Any) -> str: ... + def _call_matcher(self, _call: Tuple[_Call, ...]) -> _Call: ... + def _get_child_mock(self, **kw: Any) -> NonCallableMock: ... class CallableMixin(Base): side_effect: Any - def __init__(self, spec: Optional[Any] = ..., side_effect: Optional[Any] = ..., return_value: Any = ..., wraps: Optional[Any] = ..., name: Optional[Any] = ..., spec_set: Optional[Any] = ..., parent: Optional[Any] = ..., _spec_state: Optional[Any] = ..., _new_name: Any = ..., _new_parent: Optional[Any] = ..., **kwargs: Any) -> None: ... + def __init__( + self, + spec: Optional[Any] = ..., + side_effect: Optional[Any] = ..., + return_value: Any = ..., + wraps: Optional[Any] = ..., + name: Optional[Any] = ..., + spec_set: Optional[Any] = ..., + parent: Optional[Any] = ..., + _spec_state: Optional[Any] = ..., + _new_name: Any = ..., + _new_parent: Optional[Any] = ..., + **kwargs: Any, + ) -> None: ... def __call__(_mock_self, *args: Any, **kwargs: Any) -> Any: ... -Mock = Any +class Mock(CallableMixin, NonCallableMock): ... -class _patch: +class _patch(Generic[_T]): attribute_name: Any - getter: Any - attribute: Any - new: Any + getter: Callable[[], Any] + attribute: str + new: _T new_callable: Any spec: Any create: bool has_local: Any spec_set: Any autospec: Any - kwargs: Any + kwargs: Mapping[str, Any] additional_patchers: Any - def __init__(self, getter: Any, attribute: Any, new: Any, spec: Any, create: Any, spec_set: Any, autospec: Any, new_callable: Any, kwargs: Any) -> None: ... - def copy(self) -> Any: ... - def __call__(self, func: Any) -> Any: ... - def decorate_class(self, klass: Any) -> Any: ... - def decorate_callable(self, func: Any) -> Any: ... - def get_original(self) -> Any: ... + if sys.version_info >= (3, 8): + @overload + def __init__( + self: _patch[Union[MagicMock, AsyncMock]], + getter: Callable[[], Any], + attribute: str, + *, + spec: Optional[Any], + create: bool, + spec_set: Optional[Any], + autospec: Optional[Any], + new_callable: Optional[Any], + kwargs: Mapping[str, Any], + ) -> None: ... + # This overload also covers the case, where new==DEFAULT. In this case, self is _patch[Any]. + # Ideally we'd be able to add an overload for it so that self is _patch[MagicMock], + # but that's impossible with the current type system. + @overload + def __init__( + self: _patch[_T], + getter: Callable[[], Any], + attribute: str, + new: _T, + spec: Optional[Any], + create: bool, + spec_set: Optional[Any], + autospec: Optional[Any], + new_callable: Optional[Any], + kwargs: Mapping[str, Any], + ) -> None: ... + else: + @overload + def __init__( + self: _patch[MagicMock], + getter: Callable[[], Any], + attribute: str, + *, + spec: Optional[Any], + create: bool, + spec_set: Optional[Any], + autospec: Optional[Any], + new_callable: Optional[Any], + kwargs: Mapping[str, Any], + ) -> None: ... + @overload + def __init__( + self: _patch[_T], + getter: Callable[[], Any], + attribute: str, + new: _T, + spec: Optional[Any], + create: bool, + spec_set: Optional[Any], + autospec: Optional[Any], + new_callable: Optional[Any], + kwargs: Mapping[str, Any], + ) -> None: ... + def copy(self) -> _patch[_T]: ... + def __call__(self, func: Callable[..., _R]) -> Callable[..., _R]: ... + def decorate_class(self, klass: _TT) -> _TT: ... + def decorate_callable(self, func: _F) -> _F: ... + def get_original(self) -> Tuple[Any, bool]: ... target: Any temp_original: Any - is_local: Any - def __enter__(self) -> Any: ... - def __exit__(self, *exc_info: Any) -> Any: ... - def start(self) -> Any: ... - def stop(self) -> Any: ... + is_local: bool + def __enter__(self) -> _T: ... + def __exit__(self, *exc_info: Any) -> None: ... + def start(self) -> _T: ... + def stop(self) -> None: ... class _patch_dict: in_dict: Any @@ -86,9 +249,123 @@ class _patch_dict: class _patcher: TEST_PREFIX: str dict: Type[_patch_dict] - def __call__(self, target: Any, new: Optional[Any] = ..., spec: Optional[Any] = ..., create: bool = ..., spec_set: Optional[Any] = ..., autospec: Optional[Any] = ..., new_callable: Optional[Any] = ..., **kwargs: Any) -> _patch: ... - def object(self, target: Any, attribute: Text, new: Optional[Any] = ..., spec: Optional[Any] = ..., create: bool = ..., spec_set: Optional[Any] = ..., autospec: Optional[Any] = ..., new_callable: Optional[Any] = ..., **kwargs: Any) -> _patch: ... - def multiple(self, target: Any, spec: Optional[Any] = ..., create: bool = ..., spec_set: Optional[Any] = ..., autospec: Optional[Any] = ..., new_callable: Optional[Any] = ..., **kwargs: Any) -> _patch: ... + if sys.version_info >= (3, 8): + @overload + def __call__( # type: ignore + self, + target: Any, + *, + spec: Optional[Any] = ..., + create: bool = ..., + spec_set: Optional[Any] = ..., + autospec: Optional[Any] = ..., + new_callable: Optional[Any] = ..., + **kwargs: Any, + ) -> _patch[Union[MagicMock, AsyncMock]]: ... + # This overload also covers the case, where new==DEFAULT. In this case, the return type is _patch[Any]. + # Ideally we'd be able to add an overload for it so that the return type is _patch[MagicMock], + # but that's impossible with the current type system. + @overload + def __call__( + self, + target: Any, + new: _T, + spec: Optional[Any] = ..., + create: bool = ..., + spec_set: Optional[Any] = ..., + autospec: Optional[Any] = ..., + new_callable: Optional[Any] = ..., + **kwargs: Any, + ) -> _patch[_T]: ... + else: + @overload + def __call__( # type: ignore + self, + target: Any, + *, + spec: Optional[Any] = ..., + create: bool = ..., + spec_set: Optional[Any] = ..., + autospec: Optional[Any] = ..., + new_callable: Optional[Any] = ..., + **kwargs: Any, + ) -> _patch[MagicMock]: ... + @overload + def __call__( + self, + target: Any, + new: _T, + spec: Optional[Any] = ..., + create: bool = ..., + spec_set: Optional[Any] = ..., + autospec: Optional[Any] = ..., + new_callable: Optional[Any] = ..., + **kwargs: Any, + ) -> _patch[_T]: ... + if sys.version_info >= (3, 8): + @overload + def object( # type: ignore + self, + target: Any, + attribute: Text, + *, + spec: Optional[Any] = ..., + create: bool = ..., + spec_set: Optional[Any] = ..., + autospec: Optional[Any] = ..., + new_callable: Optional[Any] = ..., + **kwargs: Any, + ) -> _patch[Union[MagicMock, AsyncMock]]: ... + @overload + def object( + self, + target: Any, + attribute: Text, + new: _T = ..., + spec: Optional[Any] = ..., + create: bool = ..., + spec_set: Optional[Any] = ..., + autospec: Optional[Any] = ..., + new_callable: Optional[Any] = ..., + **kwargs: Any, + ) -> _patch[_T]: ... + else: + @overload + def object( # type: ignore + self, + target: Any, + attribute: Text, + *, + spec: Optional[Any] = ..., + create: bool = ..., + spec_set: Optional[Any] = ..., + autospec: Optional[Any] = ..., + new_callable: Optional[Any] = ..., + **kwargs: Any, + ) -> _patch[MagicMock]: ... + @overload + def object( + self, + target: Any, + attribute: Text, + new: _T = ..., + spec: Optional[Any] = ..., + create: bool = ..., + spec_set: Optional[Any] = ..., + autospec: Optional[Any] = ..., + new_callable: Optional[Any] = ..., + **kwargs: Any, + ) -> _patch[_T]: ... + def multiple( + self, + target: Any, + spec: Optional[Any] = ..., + create: bool = ..., + spec_set: Optional[Any] = ..., + autospec: Optional[Any] = ..., + new_callable: Optional[Any] = ..., + **kwargs: _T, + ) -> _patch[_T]: ... def stopall(self) -> None: ... patch: _patcher @@ -96,10 +373,30 @@ patch: _patcher class MagicMixin: def __init__(self, *args: Any, **kw: Any) -> None: ... -NonCallableMagicMock = Any -MagicMock = Any +class NonCallableMagicMock(MagicMixin, NonCallableMock): + def mock_add_spec(self, spec: Any, spec_set: bool = ...) -> None: ... + +class MagicMock(MagicMixin, Mock): + def mock_add_spec(self, spec: Any, spec_set: bool = ...) -> None: ... + if sys.version_info >= (3, 8): - AsyncMock = Any + class AsyncMockMixin(Base): + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + async def _execute_mock_call(self, *args: Any, **kwargs: Any) -> Any: ... + def assert_awaited(self) -> None: ... + def assert_awaited_once(self) -> None: ... + def assert_awaited_with(self, *args: Any, **kwargs: Any) -> None: ... + def assert_awaited_once_with(self, *args: Any, **kwargs: Any) -> None: ... + def assert_any_await(self, *args: Any, **kwargs: Any) -> None: ... + def assert_has_awaits(self, calls: _CallList, any_order: bool = ...) -> None: ... + def assert_not_awaited(self) -> None: ... + def reset_mock(self, *args, **kwargs) -> None: ... + await_count: int + await_args: Optional[_Call] + await_args_list: _CallList + class AsyncMagicMixin(MagicMixin): + def __init__(self, *args: Any, **kw: Any) -> None: ... + class AsyncMock(AsyncMockMixin, AsyncMagicMixin, Mock): ... class MagicProxy: name: Any @@ -115,23 +412,9 @@ class _ANY: ANY: Any -class _Call(Tuple[Any, ...]): - def __new__(cls, value: Any = ..., name: Optional[Any] = ..., parent: Optional[Any] = ..., two: bool = ..., from_kall: bool = ...) -> Any: ... - name: Any - parent: Any - from_kall: Any - def __init__(self, value: Any = ..., name: Optional[Any] = ..., parent: Optional[Any] = ..., two: bool = ..., from_kall: bool = ...) -> None: ... - def __eq__(self, other: Any) -> bool: ... - __ne__: Any - def __call__(self, *args: Any, **kwargs: Any) -> Any: ... - def __getattr__(self, attr: Any) -> Any: ... - def count(self, *args: Any, **kwargs: Any) -> Any: ... - def index(self, *args: Any, **kwargs: Any) -> Any: ... - def call_list(self) -> Any: ... - -call: Any - -def create_autospec(spec: Any, spec_set: Any = ..., instance: Any = ..., _parent: Optional[Any] = ..., _name: Optional[Any] = ..., **kwargs: Any) -> Any: ... +def create_autospec( + spec: Any, spec_set: Any = ..., instance: Any = ..., _parent: Optional[Any] = ..., _name: Optional[Any] = ..., **kwargs: Any +) -> Any: ... class _SpecState: spec: Any @@ -140,7 +423,15 @@ class _SpecState: parent: Any instance: Any name: Any - def __init__(self, spec: Any, spec_set: Any = ..., parent: Optional[Any] = ..., name: Optional[Any] = ..., ids: Optional[Any] = ..., instance: Any = ...) -> None: ... + def __init__( + self, + spec: Any, + spec_set: Any = ..., + parent: Optional[Any] = ..., + name: Optional[Any] = ..., + ids: Optional[Any] = ..., + instance: Any = ..., + ) -> None: ... def mock_open(mock: Optional[Any] = ..., read_data: Any = ...) -> Any: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/mypy_extensions.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/mypy_extensions.pyi old mode 100755 new mode 100644 index 19d99cc9..e5df53ff --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/mypy_extensions.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/mypy_extensions.pyi @@ -1,12 +1,9 @@ import abc import sys -from typing import ( - Dict, Type, TypeVar, Optional, Union, Any, Generic, Mapping, ItemsView, KeysView, ValuesView, - Callable, -) +from typing import Any, Callable, Dict, Generic, ItemsView, KeysView, Mapping, Optional, Type, TypeVar, Union, ValuesView -_T = TypeVar('_T') -_U = TypeVar('_U') +_T = TypeVar("_T") +_U = TypeVar("_U") # Internal mypy fallback type for all typed dicts (does not exist at runtime) class _TypedDict(Mapping[str, object], metaclass=abc.ABCMeta): @@ -22,10 +19,13 @@ class _TypedDict(Mapping[str, object], metaclass=abc.ABCMeta): def viewitems(self) -> ItemsView[str, object]: ... def viewkeys(self) -> KeysView[str]: ... def viewvalues(self) -> ValuesView[object]: ... + else: + def items(self) -> ItemsView[str, object]: ... + def keys(self) -> KeysView[str]: ... + def values(self) -> ValuesView[object]: ... def __delitem__(self, k: NoReturn) -> None: ... def TypedDict(typename: str, fields: Dict[str, Type[_T]], total: bool = ...) -> Type[Dict[str, Any]]: ... - def Arg(type: _T = ..., name: Optional[str] = ...) -> _T: ... def DefaultArg(type: _T = ..., name: Optional[str] = ...) -> _T: ... def NamedArg(type: _T = ..., name: Optional[str] = ...) -> _T: ... @@ -41,7 +41,6 @@ NoReturn = Union[None] # Deprecated: Use typing.NoReturn instead. # This is intended as a class decorator, but mypy rejects abstract classes # when a Type[_T] is expected, so we can't give it the type we want def trait(cls: Any) -> Any: ... - def mypyc_attr(*attrs: str, **kwattrs: object) -> Callable[[_T], _T]: ... class FlexibleAlias(Generic[_T, _U]): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/nmap/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/nmap/__init__.pyi new file mode 100644 index 00000000..d495f048 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/nmap/__init__.pyi @@ -0,0 +1 @@ +from .nmap import * diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/nmap/nmap.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/nmap/nmap.pyi new file mode 100644 index 00000000..bcf8ed96 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/nmap/nmap.pyi @@ -0,0 +1,122 @@ +from typing import Any, Callable, Dict, Iterable, Iterator, List, Optional, Text, Tuple, TypeVar +from typing_extensions import TypedDict + +_T = TypeVar("_T") +_Callback = Callable[[str, _Result], Any] + +class _Result(TypedDict): + nmap: _ResultNmap + scan: Dict[str, PortScannerHostDict] + +class _ResultNmap(TypedDict): + command_line: str + scaninfo: _ResultNmapInfo + scanstats: _ResultNampStats + +class _ResultNmapInfo(TypedDict, total=False): + error: str + warning: str + protocol: _ResultNampInfoProtocol + +class _ResultNampInfoProtocol(TypedDict): + method: str + services: str + +class _ResultNampStats(TypedDict): + timestr: str + elapsed: str + uphosts: str + downhosts: str + totalhosts: str + +class _ResulHostUptime(TypedDict): + seconds: str + lastboot: str + +class _ResultHostNames(TypedDict): + type: str + name: str + +class _ResultHostPort(TypedDict): + conf: str + cpe: str + extrainfo: str + name: str + product: str + reason: str + state: str + version: str + +__last_modification__: str + +class PortScanner(object): + def __init__(self, nmap_search_path: Iterable[str] = ...) -> None: ... + def get_nmap_last_output(self) -> Text: ... + def nmap_version(self) -> Tuple[int, int]: ... + def listscan(self, hosts: str = ...) -> List[str]: ... + def scan(self, hosts: Text = ..., ports: Optional[Text] = ..., arguments: Text = ..., sudo: bool = ...) -> _Result: ... + def analyse_nmap_xml_scan( + self, + nmap_xml_output: Optional[str] = ..., + nmap_err: str = ..., + nmap_err_keep_trace: str = ..., + nmap_warn_keep_trace: str = ..., + ) -> _Result: ... + def __getitem__(self, host: Text) -> PortScannerHostDict: ... + def all_hosts(self) -> List[str]: ... + def command_line(self) -> str: ... + def scaninfo(self) -> _ResultNmapInfo: ... + def scanstats(self) -> _ResultNampStats: ... + def has_host(self, host: str) -> bool: ... + def csv(self) -> str: ... + +def __scan_progressive__(self, hosts: Text, ports: Text, arguments: Text, callback: Optional[_Callback], sudo: bool) -> None: ... + +class PortScannerAsync(object): + def __init__(self) -> None: ... + def __del__(self) -> None: ... + def scan( + self, + hosts: Text = ..., + ports: Optional[Text] = ..., + arguments: Text = ..., + callback: Optional[_Callback] = ..., + sudo: bool = ..., + ) -> None: ... + def stop(self) -> None: ... + def wait(self, timeout: Optional[int] = ...) -> None: ... + def still_scanning(self) -> bool: ... + +class PortScannerYield(PortScannerAsync): + def __init__(self) -> None: ... + def scan( # type: ignore + self, hosts: str = ..., ports: Optional[str] = ..., arguments: str = ..., sudo: bool = ... + ) -> Iterator[Tuple[str, _Result]]: ... + def stop(self) -> None: ... + def wait(self, timeout: Optional[int] = ...) -> None: ... + def still_scanning(self) -> None: ... # type: ignore + +class PortScannerHostDict(Dict[str, Any]): + def hostnames(self) -> List[_ResultHostNames]: ... + def hostname(self) -> str: ... + def state(self) -> str: ... + def uptime(self) -> _ResulHostUptime: ... + def all_protocols(self) -> List[str]: ... + def all_tcp(self) -> List[int]: ... + def has_tcp(self, port: int) -> bool: ... + def tcp(self, port: int) -> _ResultHostPort: ... + def all_udp(self) -> List[int]: ... + def has_udp(self, port: int) -> bool: ... + def udp(self, port: int) -> _ResultHostPort: ... + def all_ip(self) -> List[int]: ... + def has_ip(self, port: int) -> bool: ... + def ip(self, port: int) -> _ResultHostPort: ... + def all_sctp(self) -> List[int]: ... + def has_sctp(self, port: int) -> bool: ... + def sctp(self, port: int) -> _ResultHostPort: ... + +class PortScannerError(Exception): + value: str + def __init__(self, value: str) -> None: ... + +def convert_nmap_output_to_encoding(value: _T, code: str = ...) -> _T: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/__init__.pyi new file mode 100644 index 00000000..f3e67d07 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/__init__.pyi @@ -0,0 +1,41 @@ +from paramiko.agent import Agent as Agent, AgentKey as AgentKey +from paramiko.channel import Channel as Channel +from paramiko.client import ( + AutoAddPolicy as AutoAddPolicy, + MissingHostKeyPolicy as MissingHostKeyPolicy, + RejectPolicy as RejectPolicy, + SSHClient as SSHClient, + WarningPolicy as WarningPolicy, +) +from paramiko.common import io_sleep as io_sleep +from paramiko.config import SSHConfig as SSHConfig +from paramiko.dsskey import DSSKey as DSSKey +from paramiko.ecdsakey import ECDSAKey as ECDSAKey +from paramiko.ed25519key import Ed25519Key as Ed25519Key +from paramiko.file import BufferedFile as BufferedFile +from paramiko.hostkeys import HostKeys as HostKeys +from paramiko.message import Message as Message +from paramiko.pkey import PKey as PKey +from paramiko.proxy import ProxyCommand as ProxyCommand +from paramiko.rsakey import RSAKey as RSAKey +from paramiko.server import ServerInterface as ServerInterface, SubsystemHandler as SubsystemHandler +from paramiko.sftp import SFTPError as SFTPError +from paramiko.sftp_attr import SFTPAttributes as SFTPAttributes +from paramiko.sftp_client import SFTP as SFTP, SFTPClient as SFTPClient +from paramiko.sftp_file import SFTPFile as SFTPFile +from paramiko.sftp_handle import SFTPHandle as SFTPHandle +from paramiko.sftp_server import SFTPServer as SFTPServer +from paramiko.sftp_si import SFTPServerInterface as SFTPServerInterface +from paramiko.ssh_exception import ( + AuthenticationException as AuthenticationException, + BadAuthenticationType as BadAuthenticationType, + BadHostKeyException as BadHostKeyException, + ChannelException as ChannelException, + PasswordRequiredException as PasswordRequiredException, + ProxyCommandFailure as ProxyCommandFailure, + SSHException as SSHException, +) +from paramiko.transport import SecurityOptions as SecurityOptions, Transport as Transport + +# Names in __all__ with no definition: +# util diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/_version.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/_version.pyi new file mode 100644 index 00000000..e75b9146 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/_version.pyi @@ -0,0 +1,3 @@ +from typing import Tuple + +__version_info__: Tuple[int, int, int] diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/_winapi.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/_winapi.pyi new file mode 100644 index 00000000..a8277fb1 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/_winapi.pyi @@ -0,0 +1,97 @@ +import builtins +import ctypes.wintypes +import sys +from types import TracebackType +from typing import Any, Optional, Type, TypeVar + +assert sys.platform == "win32" + +_T = TypeVar("_T") + +def format_system_message(errno: int) -> Optional[str]: ... + +class WindowsError(builtins.WindowsError): + def __init__(self, value: Optional[int] = ...) -> None: ... + @property + def message(self) -> str: ... + @property + def code(self) -> int: ... + +def handle_nonzero_success(result: int) -> None: ... + +GMEM_MOVEABLE: int +GlobalAlloc: Any +GlobalLock: Any +GlobalUnlock: Any +GlobalSize: Any +CreateFileMapping: Any +MapViewOfFile: Any +UnmapViewOfFile: Any +RtlMoveMemory: Any + +class MemoryMap: + name: str + length: int + security_attributes: Any = ... + pos: int + filemap: Any = ... + view: Any = ... + def __init__(self, name: str, length: int, security_attributes: Optional[Any] = ...) -> None: ... + def __enter__(self: _T) -> _T: ... + def seek(self, pos: int) -> None: ... + def write(self, msg: bytes) -> None: ... + def read(self, n: int) -> bytes: ... + def __exit__( + self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], tb: Optional[TracebackType] + ) -> None: ... + +READ_CONTROL: int +STANDARD_RIGHTS_REQUIRED: int +STANDARD_RIGHTS_READ: int +STANDARD_RIGHTS_WRITE: int +STANDARD_RIGHTS_EXECUTE: int +STANDARD_RIGHTS_ALL: int +POLICY_VIEW_LOCAL_INFORMATION: int +POLICY_VIEW_AUDIT_INFORMATION: int +POLICY_GET_PRIVATE_INFORMATION: int +POLICY_TRUST_ADMIN: int +POLICY_CREATE_ACCOUNT: int +POLICY_CREATE_SECRET: int +POLICY_CREATE_PRIVILEGE: int +POLICY_SET_DEFAULT_QUOTA_LIMITS: int +POLICY_SET_AUDIT_REQUIREMENTS: int +POLICY_AUDIT_LOG_ADMIN: int +POLICY_SERVER_ADMIN: int +POLICY_LOOKUP_NAMES: int +POLICY_NOTIFICATION: int +POLICY_ALL_ACCESS: int +POLICY_READ: int +POLICY_WRITE: int +POLICY_EXECUTE: int + +class TokenAccess: + TOKEN_QUERY: int + +class TokenInformationClass: + TokenUser: int + +class TOKEN_USER(ctypes.Structure): + num: int + +class SECURITY_DESCRIPTOR(ctypes.Structure): + SECURITY_DESCRIPTOR_CONTROL: Any + REVISION: int + +class SECURITY_ATTRIBUTES(ctypes.Structure): + nLength: int + lpSecurityDescriptor: Any + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + @property + def descriptor(self) -> Any: ... + @descriptor.setter + def descriptor(self, value: Any) -> None: ... + +def GetTokenInformation(token: Any, information_class: Any) -> Any: ... +def OpenProcessToken(proc_handle: Any, access: Any) -> Any: ... +def get_current_user() -> TOKEN_USER: ... +def get_security_attributes_for_user(user: Optional[TOKEN_USER] = ...) -> SECURITY_ATTRIBUTES: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/agent.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/agent.pyi new file mode 100644 index 00000000..3d5aa4bc --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/agent.pyi @@ -0,0 +1,67 @@ +from socket import _RetAddress, socket +from threading import Thread +from typing import Dict, Protocol, Tuple + +from paramiko.channel import Channel +from paramiko.message import Message +from paramiko.pkey import PKey +from paramiko.transport import Transport + +class _AgentProxy(Protocol): + def connect(self) -> None: ... + def close(self) -> None: ... + +cSSH2_AGENTC_REQUEST_IDENTITIES: bytes +SSH2_AGENT_IDENTITIES_ANSWER: int +cSSH2_AGENTC_SIGN_REQUEST: bytes +SSH2_AGENT_SIGN_RESPONSE: int + +class AgentSSH: + def __init__(self) -> None: ... + def get_keys(self) -> Tuple[AgentKey, ...]: ... + +class AgentProxyThread(Thread): + def __init__(self, agent: _AgentProxy) -> None: ... + def run(self) -> None: ... + +class AgentLocalProxy(AgentProxyThread): + def __init__(self, agent: AgentServerProxy) -> None: ... + def get_connection(self) -> Tuple[socket, _RetAddress]: ... + +class AgentRemoteProxy(AgentProxyThread): + def __init__(self, agent: AgentClientProxy, chan: Channel) -> None: ... + def get_connection(self) -> Tuple[socket, _RetAddress]: ... + +class AgentClientProxy: + thread: Thread + def __init__(self, chanRemote: Channel) -> None: ... + def __del__(self) -> None: ... + def connect(self) -> None: ... + def close(self) -> None: ... + +class AgentServerProxy(AgentSSH): + thread: Thread + def __init__(self, t: Transport) -> None: ... + def __del__(self) -> None: ... + def connect(self) -> None: ... + def close(self) -> None: ... + def get_env(self) -> Dict[str, str]: ... + +class AgentRequestHandler: + def __init__(self, chanClient: Channel) -> None: ... + def __del__(self) -> None: ... + def close(self) -> None: ... + +class Agent(AgentSSH): + def __init__(self) -> None: ... + def close(self) -> None: ... + +class AgentKey(PKey): + agent: AgentSSH + blob: bytes + public_blob: None + name: str + def __init__(self, agent: AgentSSH, blob: bytes) -> None: ... + def asbytes(self) -> bytes: ... + def get_name(self) -> str: ... + def sign_ssh_data(self, data: bytes) -> Message: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/auth_handler.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/auth_handler.pyi new file mode 100644 index 00000000..a631394b --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/auth_handler.pyi @@ -0,0 +1,49 @@ +from threading import Event +from typing import Callable, List, Optional, Tuple + +from paramiko.message import Message +from paramiko.pkey import PKey +from paramiko.server import InteractiveQuery +from paramiko.ssh_gss import _SSH_GSSAuth +from paramiko.transport import Transport + +_InteractiveCallback = Callable[[str, str, List[Tuple[str, bool]]], List[str]] + +class AuthHandler: + transport: Transport + username: Optional[str] + authenticated: bool + auth_event: Optional[Event] + auth_method: str + banner: Optional[str] + password: Optional[str] + private_key: Optional[PKey] + interactive_handler: Optional[_InteractiveCallback] + submethods: Optional[str] + auth_username: Optional[str] + auth_fail_count: int + gss_host: Optional[str] + gss_deleg_creds: bool + def __init__(self, transport: Transport) -> None: ... + def is_authenticated(self) -> bool: ... + def get_username(self) -> Optional[str]: ... + def auth_none(self, username: str, event: Event) -> None: ... + def auth_publickey(self, username: str, key: PKey, event: Event) -> None: ... + def auth_password(self, username: str, password: str, event: Event) -> None: ... + def auth_interactive(self, username: str, handler: _InteractiveCallback, event: Event, submethods: str = ...) -> None: ... + def auth_gssapi_with_mic(self, username: str, gss_host: str, gss_deleg_creds: bool, event: Event) -> None: ... + def auth_gssapi_keyex(self, username: str, event: Event) -> None: ... + def abort(self) -> None: ... + def wait_for_response(self, event: Event) -> List[str]: ... + +class GssapiWithMicAuthHandler: + method: str + sshgss: _SSH_GSSAuth + def __init__(self, delegate: AuthHandler, sshgss: _SSH_GSSAuth) -> None: ... + def abort(self) -> None: ... + @property + def transport(self) -> Transport: ... + @property + def auth_username(self) -> str: ... + @property + def gss_host(self) -> str: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/ber.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/ber.pyi new file mode 100644 index 00000000..700ebd16 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/ber.pyi @@ -0,0 +1,17 @@ +from typing import Any, Iterable, List, Union + +class BERException(Exception): ... + +class BER: + content: bytes + idx: int + def __init__(self, content: bytes = ...) -> None: ... + def asbytes(self) -> bytes: ... + def decode(self) -> Union[None, int, List[int]]: ... + def decode_next(self) -> Union[None, int, List[int]]: ... + @staticmethod + def decode_sequence(data: bytes) -> List[Union[int, List[int]]]: ... + def encode_tlv(self, ident: int, val: bytes) -> None: ... + def encode(self, x: Any) -> None: ... + @staticmethod + def encode_sequence(data: Iterable[str]) -> bytes: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/buffered_pipe.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/buffered_pipe.pyi new file mode 100644 index 00000000..e29b65de --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/buffered_pipe.pyi @@ -0,0 +1,16 @@ +from threading import Event +from typing import Generic, Optional, Text, TypeVar + +_T = TypeVar("_T", Text, bytes) + +class PipeTimeout(IOError): ... + +class BufferedPipe(Generic[_T]): + def __init__(self) -> None: ... + def set_event(self, event: Event) -> None: ... + def feed(self, data: _T) -> None: ... + def read_ready(self) -> bool: ... + def read(self, nbytes: int, timeout: Optional[float] = ...) -> _T: ... + def empty(self) -> _T: ... + def close(self) -> None: ... + def __len__(self) -> int: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/channel.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/channel.pyi new file mode 100644 index 00000000..f22a50d2 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/channel.pyi @@ -0,0 +1,99 @@ +from logging import Logger +from threading import Condition, Event, Lock +from typing import Any, Callable, Mapping, Optional, Tuple, TypeVar + +from paramiko.buffered_pipe import BufferedPipe, PipeTimeout +from paramiko.file import BufferedFile +from paramiko.message import Message +from paramiko.transport import Transport +from paramiko.util import ClosingContextManager + +_F = TypeVar("_F", bound=Callable[..., Any]) + +def open_only(func: _F) -> Callable[[_F], _F]: ... + +class Channel(ClosingContextManager): + chanid: int + remote_chanid: int + transport: Optional[Transport] + active: bool + eof_received: int + eof_sent: int + in_buffer: BufferedPipe + in_stderr_buffer: BufferedPipe + timeout: Optional[float] + closed: bool + ultra_debug: bool + lock: Lock + out_buffer_cv: Condition + in_window_size: int + out_window_size: int + in_max_packet_size: int + out_max_packet_size: int + in_window_threshold: int + in_window_sofar: int + status_event: Event + logger: Logger + event: Event + event_ready: bool + combine_stderr: bool + exit_status: int + origin_addr: None + def __init__(self, chanid: int) -> None: ... + def __del__(self) -> None: ... + def get_pty( + self, term: str = ..., width: int = ..., height: int = ..., width_pixels: int = ..., height_pixels: int = ... + ) -> None: ... + def invoke_shell(self) -> None: ... + def exec_command(self, command: str) -> None: ... + def invoke_subsystem(self, subsystem: str) -> None: ... + def resize_pty(self, width: int = ..., height: int = ..., width_pixels: int = ..., height_pixels: int = ...) -> None: ... + def update_environment(self, environment: Mapping[str, str]) -> None: ... + def set_environment_variable(self, name: str, value: str) -> None: ... + def exit_status_ready(self) -> bool: ... + def recv_exit_status(self) -> int: ... + def send_exit_status(self, status: int) -> None: ... + def request_x11( + self, + screen_number: int = ..., + auth_protocol: Optional[str] = ..., + auth_cookie: Optional[str] = ..., + single_connection: bool = ..., + handler: Optional[Callable[[Channel, Tuple[str, int]], None]] = ..., + ) -> bytes: ... + def request_forward_agent(self, handler: Callable[[Channel], None]) -> bool: ... + def get_transport(self) -> Transport: ... + def set_name(self, name: str) -> None: ... + def get_name(self) -> str: ... + def get_id(self) -> int: ... + def set_combine_stderr(self, combine: bool) -> bool: ... + def settimeout(self, timeout: Optional[float]) -> None: ... + def gettimeout(self) -> Optional[float]: ... + def setblocking(self, blocking: bool) -> None: ... + def getpeername(self) -> str: ... + def close(self) -> None: ... + def recv_ready(self) -> bool: ... + def recv(self, nbytes: int) -> bytes: ... + def recv_stderr_ready(self) -> bool: ... + def recv_stderr(self, nbytes: int) -> bytes: ... + def send_ready(self) -> bool: ... + def send(self, s: bytes) -> int: ... + def send_stderr(self, s: bytes) -> int: ... + def sendall(self, s: bytes) -> None: ... + def sendall_stderr(self, s: bytes) -> None: ... + def makefile(self, *params: Any) -> ChannelFile: ... + def makefile_stderr(self, *params: Any) -> ChannelStderrFile: ... + def makefile_stdin(self, *params: Any) -> ChannelStdinFile: ... + def fileno(self) -> int: ... + def shutdown(self, how: int) -> None: ... + def shutdown_read(self) -> None: ... + def shutdown_write(self) -> None: ... + +class ChannelFile(BufferedFile): + channel: Channel + def __init__(self, channel: Channel, mode: str = ..., bufsize: int = ...) -> None: ... + +class ChannelStderrFile(ChannelFile): ... + +class ChannelStdinFile(ChannelFile): + def close(self) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/client.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/client.pyi new file mode 100644 index 00000000..486e5a4c --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/client.pyi @@ -0,0 +1,74 @@ +from socket import socket +from typing import Any, Dict, Iterable, Mapping, NoReturn, Optional, Tuple, Type, Union + +from paramiko.agent import Agent +from paramiko.channel import Channel, ChannelFile, ChannelStderrFile, ChannelStdinFile +from paramiko.hostkeys import HostKeys +from paramiko.pkey import PKey +from paramiko.sftp_client import SFTPClient +from paramiko.transport import Transport +from paramiko.util import ClosingContextManager + +class SSHClient(ClosingContextManager): + def __init__(self) -> None: ... + def load_system_host_keys(self, filename: Optional[str] = ...) -> None: ... + def load_host_keys(self, filename: str) -> None: ... + def save_host_keys(self, filename: str) -> None: ... + def get_host_keys(self) -> HostKeys: ... + def set_log_channel(self, name: str) -> None: ... + def set_missing_host_key_policy(self, policy: Union[Type[MissingHostKeyPolicy], MissingHostKeyPolicy]) -> None: ... + def connect( + self, + hostname: str, + port: int = ..., + username: Optional[str] = ..., + password: Optional[str] = ..., + pkey: Optional[PKey] = ..., + key_filename: Optional[str] = ..., + timeout: Optional[float] = ..., + allow_agent: bool = ..., + look_for_keys: bool = ..., + compress: bool = ..., + sock: Optional[socket] = ..., + gss_auth: bool = ..., + gss_kex: bool = ..., + gss_deleg_creds: bool = ..., + gss_host: Optional[str] = ..., + banner_timeout: Optional[float] = ..., + auth_timeout: Optional[float] = ..., + gss_trust_dns: bool = ..., + passphrase: Optional[str] = ..., + disabled_algorithms: Optional[Dict[str, Iterable[str]]] = ..., + ) -> None: ... + def close(self) -> None: ... + def exec_command( + self, + command: str, + bufsize: int = ..., + timeout: Optional[float] = ..., + get_pty: bool = ..., + environment: Optional[Dict[str, str]] = ..., + ) -> Tuple[ChannelStdinFile, ChannelFile, ChannelStderrFile]: ... + def invoke_shell( + self, + term: str = ..., + width: int = ..., + height: int = ..., + width_pixels: int = ..., + height_pixels: int = ..., + environment: Optional[Mapping[str, str]] = ..., + ) -> Channel: ... + def open_sftp(self) -> Optional[SFTPClient]: ... + def get_transport(self) -> Optional[Transport]: ... + +class MissingHostKeyPolicy: + def missing_host_key(self, client: SSHClient, hostname: str, key: PKey) -> None: ... + +class AutoAddPolicy(MissingHostKeyPolicy): + def missing_host_key(self, client: SSHClient, hostname: str, key: PKey) -> None: ... + +class RejectPolicy(MissingHostKeyPolicy): + def missing_host_key(self, client: SSHClient, hostname: str, key: PKey) -> NoReturn: ... + +class WarningPolicy(MissingHostKeyPolicy): + def missing_host_key(self, client: SSHClient, hostname: str, key: PKey) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/common.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/common.pyi new file mode 100644 index 00000000..40855b4b --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/common.pyi @@ -0,0 +1,139 @@ +import sys +from typing import Any, Dict, Protocol, Text, Union + +MSG_DISCONNECT: int +MSG_IGNORE: int +MSG_UNIMPLEMENTED: int +MSG_DEBUG: int +MSG_SERVICE_REQUEST: int +MSG_SERVICE_ACCEPT: int +MSG_KEXINIT: int +MSG_NEWKEYS: int +MSG_USERAUTH_REQUEST: int +MSG_USERAUTH_FAILURE: int +MSG_USERAUTH_SUCCESS: int +MSG_USERAUTH_BANNER: int +MSG_USERAUTH_PK_OK: int +MSG_USERAUTH_INFO_REQUEST: int +MSG_USERAUTH_INFO_RESPONSE: int +MSG_USERAUTH_GSSAPI_RESPONSE: int +MSG_USERAUTH_GSSAPI_TOKEN: int +MSG_USERAUTH_GSSAPI_EXCHANGE_COMPLETE: int +MSG_USERAUTH_GSSAPI_ERROR: int +MSG_USERAUTH_GSSAPI_ERRTOK: int +MSG_USERAUTH_GSSAPI_MIC: int +HIGHEST_USERAUTH_MESSAGE_ID: int +MSG_GLOBAL_REQUEST: int +MSG_REQUEST_SUCCESS: int +MSG_REQUEST_FAILURE: int +MSG_CHANNEL_OPEN: int +MSG_CHANNEL_OPEN_SUCCESS: int +MSG_CHANNEL_OPEN_FAILURE: int +MSG_CHANNEL_WINDOW_ADJUST: int +MSG_CHANNEL_DATA: int +MSG_CHANNEL_EXTENDED_DATA: int +MSG_CHANNEL_EOF: int +MSG_CHANNEL_CLOSE: int +MSG_CHANNEL_REQUEST: int +MSG_CHANNEL_SUCCESS: int +MSG_CHANNEL_FAILURE: int + +cMSG_DISCONNECT: bytes +cMSG_IGNORE: bytes +cMSG_UNIMPLEMENTED: bytes +cMSG_DEBUG: bytes +cMSG_SERVICE_REQUEST: bytes +cMSG_SERVICE_ACCEPT: bytes +cMSG_KEXINIT: bytes +cMSG_NEWKEYS: bytes +cMSG_USERAUTH_REQUEST: bytes +cMSG_USERAUTH_FAILURE: bytes +cMSG_USERAUTH_SUCCESS: bytes +cMSG_USERAUTH_BANNER: bytes +cMSG_USERAUTH_PK_OK: bytes +cMSG_USERAUTH_INFO_REQUEST: bytes +cMSG_USERAUTH_INFO_RESPONSE: bytes +cMSG_USERAUTH_GSSAPI_RESPONSE: bytes +cMSG_USERAUTH_GSSAPI_TOKEN: bytes +cMSG_USERAUTH_GSSAPI_EXCHANGE_COMPLETE: bytes +cMSG_USERAUTH_GSSAPI_ERROR: bytes +cMSG_USERAUTH_GSSAPI_ERRTOK: bytes +cMSG_USERAUTH_GSSAPI_MIC: bytes +cMSG_GLOBAL_REQUEST: bytes +cMSG_REQUEST_SUCCESS: bytes +cMSG_REQUEST_FAILURE: bytes +cMSG_CHANNEL_OPEN: bytes +cMSG_CHANNEL_OPEN_SUCCESS: bytes +cMSG_CHANNEL_OPEN_FAILURE: bytes +cMSG_CHANNEL_WINDOW_ADJUST: bytes +cMSG_CHANNEL_DATA: bytes +cMSG_CHANNEL_EXTENDED_DATA: bytes +cMSG_CHANNEL_EOF: bytes +cMSG_CHANNEL_CLOSE: bytes +cMSG_CHANNEL_REQUEST: bytes +cMSG_CHANNEL_SUCCESS: bytes +cMSG_CHANNEL_FAILURE: bytes + +MSG_NAMES: Dict[int, str] + +AUTH_SUCCESSFUL: int +AUTH_PARTIALLY_SUCCESSFUL: int +AUTH_FAILED: int + +OPEN_SUCCEEDED: int +OPEN_FAILED_ADMINISTRATIVELY_PROHIBITED: int +OPEN_FAILED_CONNECT_FAILED: int +OPEN_FAILED_UNKNOWN_CHANNEL_TYPE: int +OPEN_FAILED_RESOURCE_SHORTAGE: int + +CONNECTION_FAILED_CODE: Dict[int, str] + +DISCONNECT_SERVICE_NOT_AVAILABLE: int +DISCONNECT_AUTH_CANCELLED_BY_USER: int +DISCONNECT_NO_MORE_AUTH_METHODS_AVAILABLE: int + +zero_byte: bytes +one_byte: bytes +four_byte: bytes +max_byte: bytes +cr_byte: bytes +linefeed_byte: bytes +crlf: bytes +if sys.version_info < (3, 0): + cr_byte_value: bytes + linefeed_byte_value: bytes +else: + cr_byte_value: int + linefeed_byte_value: int + +class _SupportsAsBytes(Protocol): + def asbytes(self) -> bytes: ... + +_LikeBytes = Union[bytes, Text, _SupportsAsBytes] + +def asbytes(s: _LikeBytes) -> bytes: ... + +xffffffff: int +x80000000: int +o666: int +o660: int +o644: int +o600: int +o777: int +o700: int +o70: int + +DEBUG: int +INFO: int +WARNING: int +ERROR: int +CRITICAL: int + +io_sleep: float + +DEFAULT_WINDOW_SIZE: int +DEFAULT_MAX_PACKET_SIZE: int + +MIN_WINDOW_SIZE: int +MIN_PACKET_SIZE: int +MAX_WINDOW_SIZE: int diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/compress.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/compress.pyi new file mode 100644 index 00000000..da039479 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/compress.pyi @@ -0,0 +1,11 @@ +from zlib import _Compress, _Decompress + +class ZlibCompressor: + z: _Compress + def __init__(self) -> None: ... + def __call__(self, data: bytes) -> bytes: ... + +class ZlibDecompressor: + z: _Decompress + def __init__(self) -> None: ... + def __call__(self, data: bytes) -> bytes: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/config.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/config.pyi new file mode 100644 index 00000000..5367be43 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/config.pyi @@ -0,0 +1,31 @@ +from typing import IO, Any, Dict, Iterable, List, Optional, Pattern, Set + +from paramiko.ssh_exception import ConfigParseError as ConfigParseError, CouldNotCanonicalize as CouldNotCanonicalize + +SSH_PORT: int + +class SSHConfig: + SETTINGS_REGEX: Pattern[str] + TOKENS_BY_CONFIG_KEY: Dict[str, List[str]] + def __init__(self) -> None: ... + @classmethod + def from_text(cls, text: str) -> SSHConfig: ... + @classmethod + def from_path(cls, path: str) -> SSHConfig: ... + @classmethod + def from_file(cls, flo: IO[str]) -> SSHConfig: ... + def parse(self, file_obj: IO[str]) -> None: ... + def lookup(self, hostname: str) -> SSHConfigDict: ... + def canonicalize(self, hostname: str, options: SSHConfigDict, domains: Iterable[str]) -> str: ... + def get_hostnames(self) -> Set[str]: ... + +class LazyFqdn: + fqdn: Optional[str] + config: SSHConfig + host: Optional[str] + def __init__(self, config: SSHConfigDict, host: Optional[str] = ...) -> None: ... + +class SSHConfigDict(Dict[str, str]): + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + def as_bool(self, key: str) -> bool: ... + def as_int(self, key: str) -> int: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/dsskey.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/dsskey.pyi new file mode 100644 index 00000000..91508772 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/dsskey.pyi @@ -0,0 +1,34 @@ +from typing import IO, Any, Callable, Optional, Tuple + +from paramiko.ber import BER +from paramiko.message import Message +from paramiko.pkey import PKey, PublicBlob + +class DSSKey(PKey): + p: Optional[int] + q: Optional[int] + g: Optional[int] + y: Optional[int] + x: Optional[int] + public_blob: None + size: int + def __init__( + self, + msg: Optional[Message] = ..., + data: Optional[bytes] = ..., + filename: Optional[str] = ..., + password: Optional[str] = ..., + vals: Optional[Tuple[int, int, int, int]] = ..., + file_obj: Optional[IO[str]] = ..., + ) -> None: ... + def asbytes(self) -> bytes: ... + def __hash__(self) -> int: ... + def get_name(self) -> str: ... + def get_bits(self) -> int: ... + def can_sign(self) -> bool: ... + def sign_ssh_data(self, data: bytes) -> Message: ... + def verify_ssh_sig(self, data: bytes, msg: Message) -> bool: ... + def write_private_key_file(self, filename: str, password: Optional[str] = ...) -> None: ... + def write_private_key(self, file_obj: IO[str], password: Optional[str] = ...) -> None: ... + @staticmethod + def generate(bits: int = ..., progress_func: Optional[Callable[..., Any]] = ...) -> DSSKey: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/ecdsakey.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/ecdsakey.pyi new file mode 100644 index 00000000..d5363252 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/ecdsakey.pyi @@ -0,0 +1,53 @@ +from typing import IO, Any, Callable, List, Optional, Sequence, Tuple, Type + +from cryptography.hazmat.primitives.asymmetric.ec2 import EllipticCurve, EllipticCurvePrivateKey, EllipticCurvePublicKey +from cryptography.hazmat.primitives.hashes import HashAlgorithm +from paramiko.message import Message +from paramiko.pkey import PKey + +class _ECDSACurve: + nist_name: str + key_length: int + key_format_identifier: str + hash_object: Type[HashAlgorithm] + curve_class: Type[EllipticCurve] + def __init__(self, curve_class: Type[EllipticCurve], nist_name: str) -> None: ... + +class _ECDSACurveSet: + ecdsa_curves: Sequence[_ECDSACurve] + def __init__(self, ecdsa_curves: Sequence[_ECDSACurve]) -> None: ... + def get_key_format_identifier_list(self) -> List[str]: ... + def get_by_curve_class(self, curve_class: Type[Any]) -> Optional[_ECDSACurve]: ... + def get_by_key_format_identifier(self, key_format_identifier: str) -> Optional[_ECDSACurve]: ... + def get_by_key_length(self, key_length: int) -> Optional[_ECDSACurve]: ... + +class ECDSAKey(PKey): + verifying_key: EllipticCurvePublicKey + signing_key: EllipticCurvePrivateKey + public_blob: None + ecdsa_curve: Optional[_ECDSACurve] + def __init__( + self, + msg: Optional[Message] = ..., + data: Optional[bytes] = ..., + filename: Optional[str] = ..., + password: Optional[str] = ..., + vals: Optional[Tuple[EllipticCurvePrivateKey, EllipticCurvePublicKey]] = ..., + file_obj: Optional[IO[str]] = ..., + validate_point: bool = ..., + ) -> None: ... + @classmethod + def supported_key_format_identifiers(cls: Any) -> List[str]: ... + def asbytes(self) -> bytes: ... + def __hash__(self) -> int: ... + def get_name(self) -> str: ... + def get_bits(self) -> int: ... + def can_sign(self) -> bool: ... + def sign_ssh_data(self, data: bytes) -> Message: ... + def verify_ssh_sig(self, data: bytes, msg: Message) -> bool: ... + def write_private_key_file(self, filename: str, password: Optional[str] = ...) -> None: ... + def write_private_key(self, file_obj: IO[str], password: Optional[str] = ...) -> None: ... + @classmethod + def generate( + cls, curve: EllipticCurve = ..., progress_func: Optional[Callable[..., Any]] = ..., bits: Optional[int] = ... + ) -> ECDSAKey: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/ed25519key.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/ed25519key.pyi new file mode 100644 index 00000000..9a72dbf2 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/ed25519key.pyi @@ -0,0 +1,22 @@ +from typing import IO, Any, Optional + +from paramiko.message import Message +from paramiko.pkey import PKey + +class Ed25519Key(PKey): + public_blob: None + def __init__( + self, + msg: Optional[Message] = ..., + data: Optional[bytes] = ..., + filename: Optional[str] = ..., + password: Optional[str] = ..., + file_obj: Optional[IO[str]] = ..., + ) -> None: ... + def asbytes(self) -> bytes: ... + def __hash__(self) -> int: ... + def get_name(self) -> str: ... + def get_bits(self) -> int: ... + def can_sign(self) -> bool: ... + def sign_ssh_data(self, data: bytes) -> Message: ... + def verify_ssh_sig(self, data: bytes, msg: Message) -> bool: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/file.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/file.pyi new file mode 100644 index 00000000..112b38d8 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/file.pyi @@ -0,0 +1,38 @@ +from typing import AnyStr, Generic, Iterable, List, Optional, Tuple, Union + +from paramiko.util import ClosingContextManager + +class BufferedFile(ClosingContextManager, Generic[AnyStr]): + SEEK_SET: int + SEEK_CUR: int + SEEK_END: int + + FLAG_READ: int + FLAG_WRITE: int + FLAG_APPEND: int + FLAG_BINARY: int + FLAG_BUFFERED: int + FLAG_LINE_BUFFERED: int + FLAG_UNIVERSAL_NEWLINE: int + + newlines: Union[None, AnyStr, Tuple[AnyStr, ...]] + def __init__(self) -> None: ... + def __del__(self) -> None: ... + def __iter__(self) -> BufferedFile: ... + def close(self) -> None: ... + def flush(self) -> None: ... + def __next__(self) -> AnyStr: ... + def readable(self) -> bool: ... + def writable(self) -> bool: ... + def seekable(self) -> bool: ... + def readinto(self, buff: bytearray) -> int: ... + def read(self, size: Optional[int] = ...) -> AnyStr: ... + def readline(self, size: Optional[int] = ...) -> AnyStr: ... + def readlines(self, sizehint: Optional[int] = ...) -> List[AnyStr]: ... + def seek(self, offset: int, whence: int = ...) -> None: ... + def tell(self) -> int: ... + def write(self, data: AnyStr) -> None: ... + def writelines(self, sequence: Iterable[AnyStr]) -> None: ... + def xreadlines(self) -> BufferedFile: ... + @property + def closed(self) -> bool: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/hostkeys.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/hostkeys.pyi new file mode 100644 index 00000000..f0cd193b --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/hostkeys.pyi @@ -0,0 +1,47 @@ +import collections +import typing +from typing import Dict, Iterator, List, Optional + +from paramiko.pkey import PKey + +class _SubDict(typing.MutableMapping[str, PKey]): + # Internal to HostKeys.lookup() + def __init__(self, hostname: str, entries: List[HostKeyEntry], hostkeys: HostKeys) -> None: ... + def __iter__(self) -> Iterator[str]: ... + def __len__(self) -> int: ... + def __delitem__(self, key: str) -> None: ... + def __getitem__(self, key: str) -> PKey: ... + def __setitem__(self, key: str, val: PKey) -> None: ... + def keys(self) -> List[str]: ... # type: ignore + +class HostKeys(collections.MutableMapping): + def __init__(self, filename: Optional[str] = ...) -> None: ... + def add(self, hostname: str, keytype: str, key: PKey) -> None: ... + def load(self, filename: str) -> None: ... + def save(self, filename: str) -> None: ... + def lookup(self, hostname: str) -> Optional[_SubDict]: ... + def check(self, hostname: str, key: PKey) -> bool: ... + def clear(self) -> None: ... + def __iter__(self) -> Iterator[str]: ... + def __len__(self) -> int: ... + def __getitem__(self, key: str) -> _SubDict: ... + def __delitem__(self, key: str) -> None: ... + def __setitem__(self, hostname: str, entry: Dict[str, PKey]) -> None: ... + def keys(self) -> List[str]: ... # type: ignore + def values(self) -> List[_SubDict]: ... # type: ignore + @staticmethod + def hash_host(hostname: str, salt: Optional[str] = ...) -> str: ... + +class InvalidHostKey(Exception): + line: str + exc: Exception + def __init__(self, line: str, exc: Exception) -> None: ... + +class HostKeyEntry: + valid: bool + hostnames: str + key: PKey + def __init__(self, hostnames: Optional[List[str]] = ..., key: Optional[PKey] = ...) -> None: ... + @classmethod + def from_line(cls, line: str, lineno: Optional[int] = ...) -> Optional[HostKeyEntry]: ... + def to_line(self) -> Optional[str]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/kex_curve25519.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/kex_curve25519.pyi new file mode 100644 index 00000000..b408c418 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/kex_curve25519.pyi @@ -0,0 +1,25 @@ +import sys +from _typeshed import ReadableBuffer as ReadableBuffer +from typing import Any, Callable, Optional + +from cryptography.hazmat.primitives.asymmetric.x25519 import X25519PrivateKey +from paramiko.message import Message +from paramiko.transport import Transport + +if sys.version_info < (3, 0): + from hashlib import _hash as _Hash +else: + from hashlib import _Hash + +c_MSG_KEXECDH_INIT: bytes +c_MSG_KEXECDH_REPLY: bytes + +class KexCurve25519: + hash_algo: Callable[[ReadableBuffer], _Hash] + transport: Transport + key: Optional[X25519PrivateKey] + def __init__(self, transport: Transport) -> None: ... + @classmethod + def is_available(cls) -> bool: ... + def start_kex(self) -> None: ... + def parse_next(self, ptype: int, m: Message) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/kex_ecdh_nist.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/kex_ecdh_nist.pyi new file mode 100644 index 00000000..223d7d4a --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/kex_ecdh_nist.pyi @@ -0,0 +1,37 @@ +import sys +from _typeshed import ReadableBuffer +from typing import Callable, Optional, Union + +from cryptography.hazmat.primitives.asymmetric.ec2 import EllipticCurve, EllipticCurvePrivateKey, EllipticCurvePublicKey +from paramiko.message import Message +from paramiko.transport import Transport + +if sys.version_info < (3, 0): + from hashlib import _hash as _Hash +else: + from hashlib import _Hash + +c_MSG_KEXECDH_INIT: bytes +c_MSG_KEXECDH_REPLY: bytes + +class KexNistp256: + name: str + hash_algo: Callable[[ReadableBuffer], _Hash] + curve: EllipticCurve + transport: Transport + P: Union[int, EllipticCurvePrivateKey] + Q_C: Optional[EllipticCurvePublicKey] + Q_S: Optional[EllipticCurvePublicKey] + def __init__(self, transport: Transport) -> None: ... + def start_kex(self) -> None: ... + def parse_next(self, ptype: int, m: Message) -> None: ... + +class KexNistp384(KexNistp256): + name: str + hash_algo: Callable[[ReadableBuffer], _Hash] + curve: EllipticCurve + +class KexNistp521(KexNistp256): + name: str + hash_algo: Callable[[ReadableBuffer], _Hash] + curve: EllipticCurve diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/kex_gex.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/kex_gex.pyi new file mode 100644 index 00000000..50bb4e4a --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/kex_gex.pyi @@ -0,0 +1,39 @@ +import sys +from _typeshed import ReadableBuffer +from typing import Callable, Optional + +from paramiko.message import Message +from paramiko.transport import Transport + +if sys.version_info < (3, 0): + from hashlib import _hash as _Hash +else: + from hashlib import _Hash + +c_MSG_KEXDH_GEX_REQUEST_OLD: bytes +c_MSG_KEXDH_GEX_GROUP: bytes +c_MSG_KEXDH_GEX_INIT: bytes +c_MSG_KEXDH_GEX_REPLY: bytes +c_MSG_KEXDH_GEX_REQUEST: bytes + +class KexGex: + name: str + min_bits: int + max_bits: int + preferred_bits: int + hash_algo: Callable[[ReadableBuffer], _Hash] = ... + transport: Transport + p: Optional[int] + q: Optional[int] + g: Optional[int] + x: Optional[int] + e: Optional[int] + f: Optional[int] + old_style: bool + def __init__(self, transport: Transport) -> None: ... + def start_kex(self, _test_old_style: bool = ...) -> None: ... + def parse_next(self, ptype: int, m: Message) -> None: ... + +class KexGexSHA256(KexGex): + name: str + hash_algo: Callable[[ReadableBuffer], _Hash] = ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/kex_group1.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/kex_group1.pyi new file mode 100644 index 00000000..8bdbe138 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/kex_group1.pyi @@ -0,0 +1,29 @@ +import sys +from _typeshed import ReadableBuffer +from typing import Callable + +from paramiko.message import Message +from paramiko.transport import Transport + +if sys.version_info < (3, 0): + from hashlib import _hash as _Hash +else: + from hashlib import _Hash + +c_MSG_KEXDH_INIT: bytes +c_MSG_KEXDH_REPLY: bytes +b7fffffffffffffff: bytes +b0000000000000000: bytes + +class KexGroup1: + P: int + G: int + name: str + hash_algo: Callable[[ReadableBuffer], _Hash] + transport: Transport + x: int + e: int + f: int + def __init__(self, transport: Transport) -> None: ... + def start_kex(self) -> None: ... + def parse_next(self, ptype: int, m: Message) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/kex_group14.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/kex_group14.pyi new file mode 100644 index 00000000..beaf4b4c --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/kex_group14.pyi @@ -0,0 +1,20 @@ +import sys +from _typeshed import ReadableBuffer +from typing import Callable + +from paramiko.kex_group1 import KexGroup1 as KexGroup1 + +if sys.version_info < (3, 0): + from hashlib import _hash as _Hash +else: + from hashlib import _Hash + +class KexGroup14(KexGroup1): + P: int + G: int + name: str + hash_algo: Callable[[ReadableBuffer], _Hash] + +class KexGroup14SHA256(KexGroup14): + name: str + hash_algo: Callable[[ReadableBuffer], _Hash] diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/kex_group16.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/kex_group16.pyi new file mode 100644 index 00000000..b495410c --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/kex_group16.pyi @@ -0,0 +1,16 @@ +import sys +from _typeshed import ReadableBuffer +from typing import Callable + +from paramiko.kex_group1 import KexGroup1 as KexGroup1 + +if sys.version_info < (3, 0): + from hashlib import _hash as _Hash +else: + from hashlib import _Hash + +class KexGroup16SHA512(KexGroup1): + name: str + P: int + G: int + hash_algo: Callable[[ReadableBuffer], _Hash] diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/kex_gss.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/kex_gss.pyi new file mode 100644 index 00000000..255aee3d --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/kex_gss.pyi @@ -0,0 +1,66 @@ +from typing import Optional + +from paramiko.message import Message +from paramiko.ssh_gss import _SSH_GSSAuth +from paramiko.transport import Transport + +MSG_KEXGSS_INIT: int +MSG_KEXGSS_CONTINUE: int +MSG_KEXGSS_COMPLETE: int +MSG_KEXGSS_HOSTKEY: int +MSG_KEXGSS_ERROR: int +MSG_KEXGSS_GROUPREQ: int +MSG_KEXGSS_GROUP: int + +c_MSG_KEXGSS_INIT: bytes +c_MSG_KEXGSS_CONTINUE: bytes +c_MSG_KEXGSS_COMPLETE: bytes +c_MSG_KEXGSS_HOSTKEY: bytes +c_MSG_KEXGSS_ERROR: bytes +c_MSG_KEXGSS_GROUPREQ: bytes +c_MSG_KEXGSS_GROUP: bytes + +class KexGSSGroup1: + P: int + G: int + b7fffffffffffffff: bytes + b0000000000000000: bytes + NAME: str + transport: Transport + kexgss: _SSH_GSSAuth + gss_host: Optional[str] + x: int + e: int + f: int + def __init__(self, transport: Transport) -> None: ... + def start_kex(self) -> None: ... + def parse_next(self, ptype: int, m: Message) -> None: ... + +class KexGSSGroup14(KexGSSGroup1): + P: int + G: int + NAME: str + +class KexGSSGex: + NAME: str + min_bits: int + max_bits: int + preferred_bits: int + transport: Transport + kexgss: _SSH_GSSAuth + gss_host: Optional[str] + p: Optional[int] + q: Optional[int] + g: Optional[int] + x: Optional[int] + e: Optional[int] + f: Optional[int] + old_style: bool + def __init__(self, transport: Transport) -> None: ... + def start_kex(self) -> None: ... + def parse_next(self, ptype: int, m: Message) -> None: ... + +class NullHostKey: + key: str + def __init__(self) -> None: ... + def get_name(self) -> str: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/message.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/message.pyi new file mode 100644 index 00000000..49614a2b --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/message.pyi @@ -0,0 +1,42 @@ +import sys +from typing import Any, Iterable, List, Optional, Text + +from .common import _LikeBytes + +if sys.version_info < (3, 0): + from StringIO import StringIO + + BytesIO = StringIO[bytes] +else: + from io import BytesIO + +class Message: + big_int: int + packet: BytesIO + seqno: int # only when packet.Packetizer.read_message() is used + def __init__(self, content: Optional[bytes] = ...) -> None: ... + def asbytes(self) -> bytes: ... + def rewind(self) -> None: ... + def get_remainder(self) -> bytes: ... + def get_so_far(self) -> bytes: ... + def get_bytes(self, n: int) -> bytes: ... + def get_byte(self) -> bytes: ... + def get_boolean(self) -> bool: ... + def get_adaptive_int(self) -> int: ... + def get_int(self) -> int: ... + def get_int64(self) -> int: ... + def get_mpint(self) -> int: ... + def get_string(self) -> bytes: ... + def get_text(self) -> Text: ... + def get_binary(self) -> bytes: ... + def get_list(self) -> List[str]: ... + def add_bytes(self, b: bytes) -> Message: ... + def add_byte(self, b: bytes) -> Message: ... + def add_boolean(self, b: bool) -> Message: ... + def add_int(self, n: int) -> Message: ... + def add_adaptive_int(self, n: int) -> Message: ... + def add_int64(self, n: int) -> Message: ... + def add_mpint(self, z: int) -> Message: ... + def add_string(self, s: _LikeBytes) -> Message: ... + def add_list(self, l: Iterable[str]) -> Message: ... + def add(self, *seq: Any) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/packet.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/packet.pyi new file mode 100644 index 00000000..fdd1e801 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/packet.pyi @@ -0,0 +1,60 @@ +import sys +from logging import Logger +from socket import socket +from typing import Any, Callable, Tuple + +from cryptography.hazmat.primitives.ciphers import Cipher +from paramiko.compress import ZlibCompressor, ZlibDecompressor +from paramiko.message import Message + +if sys.version_info < (3, 0): + from hashlib import _hash as _Hash +else: + from hashlib import _Hash + +def compute_hmac(key: bytes, message: bytes, digest_class: _Hash) -> bytes: ... + +class NeedRekeyException(Exception): ... + +def first_arg(e: Exception) -> Any: ... + +class Packetizer: + REKEY_PACKETS: int + REKEY_BYTES: int + REKEY_PACKETS_OVERFLOW_MAX: int + REKEY_BYTES_OVERFLOW_MAX: int + def __init__(self, socket: socket) -> None: ... + @property + def closed(self) -> bool: ... + def set_log(self, log: Logger) -> None: ... + def set_outbound_cipher( + self, + block_engine: Cipher, + block_size: int, + mac_engine: _Hash, + mac_size: int, + mac_key: bytes, + sdctr: bool = ..., + etm: bool = ..., + ) -> None: ... + def set_inbound_cipher( + self, block_engine: Cipher, block_size: int, mac_engine: _Hash, mac_size: int, mac_key: bytes, etm: bool = ... + ) -> None: ... + def set_outbound_compressor(self, compressor: ZlibCompressor) -> None: ... + def set_inbound_compressor(self, compressor: ZlibDecompressor) -> None: ... + def close(self) -> None: ... + def set_hexdump(self, hexdump: bool) -> None: ... + def get_hexdump(self) -> bool: ... + def get_mac_size_in(self) -> int: ... + def get_mac_size_out(self) -> int: ... + def need_rekey(self) -> bool: ... + def set_keepalive(self, interval: int, callback: Callable[[], None]) -> None: ... + def read_timer(self) -> None: ... + def start_handshake(self, timeout: float) -> None: ... + def handshake_timed_out(self) -> bool: ... + def complete_handshake(self) -> None: ... + def read_all(self, n: int, check_rekey: bool = ...) -> bytes: ... + def write_all(self, out: bytes) -> None: ... + def readline(self, timeout: float) -> str: ... + def send_message(self, data: Message) -> None: ... + def read_message(self) -> Tuple[int, Message]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/pipe.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/pipe.pyi new file mode 100644 index 00000000..92bf86fa --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/pipe.pyi @@ -0,0 +1,35 @@ +from typing import Protocol, Tuple + +class _BasePipe(Protocol): + def clear(self) -> None: ... + def set(self) -> None: ... + +class _Pipe(_BasePipe, Protocol): + def close(self) -> None: ... + def fileno(self) -> int: ... + def set_forever(self) -> None: ... + +def make_pipe() -> _Pipe: ... + +class PosixPipe(object): + def __init__(self) -> None: ... + def close(self) -> None: ... + def fileno(self) -> int: ... + def clear(self) -> None: ... + def set(self) -> None: ... + def set_forever(self) -> None: ... + +class WindowsPipe(object): + def __init__(self) -> None: ... + def close(self) -> None: ... + def fileno(self) -> int: ... + def clear(self) -> None: ... + def set(self) -> None: ... + def set_forever(self) -> None: ... + +class OrPipe: + def __init__(self, pipe: _Pipe) -> None: ... + def set(self) -> None: ... + def clear(self) -> None: ... + +def make_or_pipe(pipe: _Pipe) -> Tuple[OrPipe, OrPipe]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/pkey.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/pkey.pyi new file mode 100644 index 00000000..3cbe74a9 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/pkey.pyi @@ -0,0 +1,44 @@ +from typing import IO, Any, Optional, Pattern, Text, Union + +from paramiko.message import Message + +OPENSSH_AUTH_MAGIC: bytes = ... + +def _unpad_openssh(data: bytes) -> bytes: ... + +class PKey: + public_blob: Optional[PublicBlob] + BEGIN_TAG: Pattern[str] + END_TAG: Pattern[str] + def __init__(self, msg: Optional[Message] = ..., data: Optional[str] = ...) -> None: ... + def asbytes(self) -> bytes: ... + def __cmp__(self, other: object) -> int: ... + def __eq__(self, other: object) -> bool: ... + def get_name(self) -> str: ... + def get_bits(self) -> int: ... + def can_sign(self) -> bool: ... + def get_fingerprint(self) -> bytes: ... + def get_base64(self) -> str: ... + def sign_ssh_data(self, data: bytes) -> Message: ... + def verify_ssh_sig(self, data: bytes, msg: Message) -> bool: ... + @classmethod + def from_private_key_file(cls: Any, filename: str, password: Optional[str] = ...) -> PKey: ... + @classmethod + def from_private_key(cls, file_obj: IO[str], password: Optional[str] = ...) -> PKey: ... + def write_private_key_file(self, filename: str, password: Optional[str] = ...) -> None: ... + def write_private_key(self, file_obj: IO[str], password: Optional[str] = ...) -> None: ... + def load_certificate(self, value: Union[Message, str]) -> None: ... + +class PublicBlob: + key_type: str + key_blob: str + comment: str + def __init__(self, type_: str, blob: bytes, comment: Optional[str] = ...) -> None: ... + @classmethod + def from_file(cls, filename: str) -> PublicBlob: ... + @classmethod + def from_string(cls, string: str) -> PublicBlob: ... + @classmethod + def from_message(cls, message: Message) -> PublicBlob: ... + def __eq__(self, other: object) -> bool: ... + def __ne__(self, other: object) -> bool: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/primes.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/primes.pyi new file mode 100644 index 00000000..a8c716d4 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/primes.pyi @@ -0,0 +1,8 @@ +from typing import Dict, List, Tuple + +class ModulusPack: + pack: Dict[int, List[Tuple[int, int]]] + discarded: List[Tuple[int, str]] + def __init__(self) -> None: ... + def read_file(self, filename: str) -> None: ... + def get_modulus(self, min: int, prefer: int, max: int) -> Tuple[int, int]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/proxy.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/proxy.pyi new file mode 100644 index 00000000..da57f589 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/proxy.pyi @@ -0,0 +1,16 @@ +from subprocess import Popen +from typing import List, Optional + +from paramiko.util import ClosingContextManager + +class ProxyCommand(ClosingContextManager): + cmd: List[str] + process: Popen + timeout: Optional[float] + def __init__(self, command_line: str) -> None: ... + def send(self, content: bytes) -> int: ... + def recv(self, size: int) -> bytes: ... + def close(self) -> None: ... + @property + def closed(self) -> bool: ... + def settimeout(self, timeout: float) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/py3compat.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/py3compat.pyi new file mode 100644 index 00000000..b9a7a9b9 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/py3compat.pyi @@ -0,0 +1,41 @@ +import sys +from typing import Any, Iterable, Sequence, Text, Type, TypeVar, Union + +_T = TypeVar("_T") + +PY2: bool + +string_types: Union[Type, Sequence[Type]] +text_type: Union[Type, Sequence[Type]] +bytes_types: Union[Type, Sequence[Type]] +bytes = bytes +integer_types: Union[Type, Sequence[Type]] +long = int + +def input(prompt: Any) -> str: ... +def decodebytes(s: bytes) -> bytes: ... +def encodebytes(s: bytes) -> bytes: ... + +if sys.version_info < (3, 0): + import __builtin__ as builtins + import cStringIO + + StringIO = cStringIO.StringIO + BytesIO = StringIO +else: + import builtins as builtins + import io + + StringIO = io.StringIO + BytesIO = io.BytesIO + +def byte_ord(c: Union[int, str]) -> int: ... +def byte_chr(c: int) -> bytes: ... +def byte_mask(c: int, mask: int) -> bytes: ... +def b(s: Union[bytes, str], encoding: str = ...) -> bytes: ... +def u(s: Union[bytes, str], encoding: str = ...) -> Text: ... +def b2s(s: Union[bytes, str]) -> str: ... +def is_callable(c: Any) -> bool: ... +def next(c: Iterable[_T]) -> _T: ... + +MAXSIZE: int diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/rsakey.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/rsakey.pyi new file mode 100644 index 00000000..f0920d4a --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/rsakey.pyi @@ -0,0 +1,33 @@ +from typing import IO, Any, Callable, Optional, Union + +from cryptography.hazmat.primitives.asymmetric.rsa import RSAPrivateKey, RSAPublicKey, RSAPublicNumbers +from paramiko.message import Message +from paramiko.pkey import PKey + +class RSAKey(PKey): + key: Union[None, RSAPublicKey, RSAPrivateKey] + public_blob: None + def __init__( + self, + msg: Optional[Message] = ..., + data: Optional[bytes] = ..., + filename: Optional[str] = ..., + password: Optional[str] = ..., + key: Union[None, RSAPublicKey, RSAPrivateKey] = ..., + file_obj: Optional[IO[str]] = ..., + ) -> None: ... + @property + def size(self) -> int: ... + @property + def public_numbers(self) -> RSAPublicNumbers: ... + def asbytes(self) -> bytes: ... + def __hash__(self) -> int: ... + def get_name(self) -> str: ... + def get_bits(self) -> int: ... + def can_sign(self) -> bool: ... + def sign_ssh_data(self, data: bytes) -> Message: ... + def verify_ssh_sig(self, data: bytes, msg: Message) -> bool: ... + def write_private_key_file(self, filename: str, password: Optional[str] = ...) -> None: ... + def write_private_key(self, file_obj: IO[str], password: Optional[str] = ...) -> None: ... + @staticmethod + def generate(bits: int, progress_func: Optional[Callable[..., Any]] = ...) -> RSAKey: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/server.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/server.pyi new file mode 100644 index 00000000..584fb62f --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/server.pyi @@ -0,0 +1,51 @@ +import threading +from typing import Any, List, Optional, Tuple, Union + +from paramiko.channel import Channel +from paramiko.message import Message +from paramiko.pkey import PKey +from paramiko.transport import Transport + +class ServerInterface: + def check_channel_request(self, kind: str, chanid: int) -> int: ... + def get_allowed_auths(self, username: str) -> str: ... + def check_auth_none(self, username: str) -> int: ... + def check_auth_password(self, username: str, password: str) -> int: ... + def check_auth_publickey(self, username: str, key: PKey) -> int: ... + def check_auth_interactive(self, username: str, submethods: str) -> Union[int, InteractiveQuery]: ... + def check_auth_interactive_response(self, responses: List[str]) -> Union[int, InteractiveQuery]: ... + def check_auth_gssapi_with_mic(self, username: str, gss_authenticated: int = ..., cc_file: Optional[str] = ...) -> int: ... + def check_auth_gssapi_keyex(self, username: str, gss_authenticated: int = ..., cc_file: Optional[str] = ...) -> int: ... + def enable_auth_gssapi(self) -> bool: ... + def check_port_forward_request(self, address: str, port: int) -> int: ... + def cancel_port_forward_request(self, address: str, port: int) -> None: ... + def check_global_request(self, kind: str, msg: Message) -> Union[bool, Tuple[Any, ...]]: ... + def check_channel_pty_request( + self, channel: Channel, term: str, width: int, height: int, pixelwidth: int, pixelheight: int, modes: str + ) -> bool: ... + def check_channel_shell_request(self, channel: Channel) -> bool: ... + def check_channel_exec_request(self, channel: Channel, command: bytes) -> bool: ... + def check_channel_subsystem_request(self, channel: Channel, name: str) -> bool: ... + def check_channel_window_change_request( + self, channel: Channel, width: int, height: int, pixelwidth: int, pixelheight: int + ) -> bool: ... + def check_channel_x11_request( + self, channel: Channel, single_connection: bool, auth_protocol: str, auth_cookie: bytes, screen_number: int + ) -> bool: ... + def check_channel_forward_agent_request(self, channel: Channel) -> bool: ... + def check_channel_direct_tcpip_request(self, chanid: int, origin: Tuple[str, int], destination: Tuple[str, int]) -> int: ... + def check_channel_env_request(self, channel: Channel, name: str, value: str) -> bool: ... + def get_banner(self) -> Tuple[Optional[str], Optional[str]]: ... + +class InteractiveQuery: + name: str + instructions: str + prompts: List[Tuple[str, bool]] + def __init__(self, name: str = ..., instructions: str = ..., *prompts: Union[str, Tuple[str, bool]]) -> None: ... + def add_prompt(self, prompt: str, echo: bool = ...) -> None: ... + +class SubsystemHandler(threading.Thread): + def __init__(self, channel: Channel, name: str, server: ServerInterface) -> None: ... + def get_server(self) -> ServerInterface: ... + def start_subsystem(self, name: str, transport: Transport, channel: Channel) -> None: ... + def finish_subsystem(self) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/sftp.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/sftp.pyi new file mode 100644 index 00000000..d7a9ad7f --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/sftp.pyi @@ -0,0 +1,61 @@ +from logging import Logger +from typing import Dict, List, Optional + +from paramiko.channel import Channel + +CMD_INIT: int +CMD_VERSION: int +CMD_OPEN: int +CMD_CLOSE: int +CMD_READ: int +CMD_WRITE: int +CMD_LSTAT: int +CMD_FSTAT: int +CMD_SETSTAT: int +CMD_FSETSTAT: int +CMD_OPENDIR: int +CMD_READDIR: int +CMD_REMOVE: int +CMD_MKDIR: int +CMD_RMDIR: int +CMD_REALPATH: int +CMD_STAT: int +CMD_RENAME: int +CMD_READLINK: int +CMD_SYMLINK: int +CMD_STATUS: int +CMD_HANDLE: int +CMD_DATA: int +CMD_NAME: int +CMD_ATTRS: int +CMD_EXTENDED: int +CMD_EXTENDED_REPLY: int + +SFTP_OK: int +SFTP_EOF: int +SFTP_NO_SUCH_FILE: int +SFTP_PERMISSION_DENIED: int +SFTP_FAILURE: int +SFTP_BAD_MESSAGE: int +SFTP_NO_CONNECTION: int +SFTP_CONNECTION_LOST: int +SFTP_OP_UNSUPPORTED: int + +SFTP_DESC: List[str] + +SFTP_FLAG_READ: int +SFTP_FLAG_WRITE: int +SFTP_FLAG_APPEND: int +SFTP_FLAG_CREATE: int +SFTP_FLAG_TRUNC: int +SFTP_FLAG_EXCL: int + +CMD_NAMES: Dict[int, str] + +class SFTPError(Exception): ... + +class BaseSFTP: + logger: Logger + sock: Optional[Channel] + ultra_debug: bool + def __init__(self) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/sftp_attr.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/sftp_attr.pyi new file mode 100644 index 00000000..97f534a7 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/sftp_attr.pyi @@ -0,0 +1,22 @@ +from os import stat_result +from typing import Dict, Optional + +class SFTPAttributes: + FLAG_SIZE: int + FLAG_UIDGID: int + FLAG_PERMISSIONS: int + FLAG_AMTIME: int + FLAG_EXTENDED: int + st_size: Optional[int] + st_uid: Optional[int] + st_gid: Optional[int] + st_mode: Optional[int] + st_atime: Optional[int] + st_mtime: Optional[int] + filename: str # only when from_stat() is used + longname: str # only when from_stat() is used + attr: Dict[str, str] + def __init__(self) -> None: ... + @classmethod + def from_stat(cls, obj: stat_result, filename: Optional[str] = ...) -> SFTPAttributes: ... + def asbytes(self) -> bytes: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/sftp_client.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/sftp_client.pyi new file mode 100644 index 00000000..26d041f8 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/sftp_client.pyi @@ -0,0 +1,67 @@ +from logging import Logger +from typing import IO, Any, Callable, Iterator, List, Optional, Text, Tuple, Union + +from paramiko.channel import Channel +from paramiko.sftp import BaseSFTP +from paramiko.sftp_attr import SFTPAttributes +from paramiko.sftp_file import SFTPFile +from paramiko.transport import Transport +from paramiko.util import ClosingContextManager + +_Callback = Callable[[int, int], Any] + +b_slash: bytes + +class SFTPClient(BaseSFTP, ClosingContextManager): + sock: Channel + ultra_debug: bool + request_number: int + logger: Logger + def __init__(self, sock: Channel) -> None: ... + @classmethod + def from_transport( + cls, t: Transport, window_size: Optional[int] = ..., max_packet_size: Optional[int] = ... + ) -> Optional[SFTPClient]: ... + def close(self) -> None: ... + def get_channel(self) -> Optional[Channel]: ... + def listdir(self, path: str = ...) -> List[str]: ... + def listdir_attr(self, path: str = ...) -> List[SFTPAttributes]: ... + def listdir_iter(self, path: Union[bytes, Text] = ..., read_aheads: int = ...) -> Iterator[SFTPAttributes]: ... + def open(self, filename: Union[bytes, Text], mode: str = ..., bufsize: int = ...) -> SFTPFile: ... + file = open + def remove(self, path: Union[bytes, Text]) -> None: ... + unlink = remove + def rename(self, oldpath: Union[bytes, Text], newpath: Union[bytes, Text]) -> None: ... + def posix_rename(self, oldpath: Union[bytes, Text], newpath: Union[bytes, Text]) -> None: ... + def mkdir(self, path: Union[bytes, Text], mode: int = ...) -> None: ... + def rmdir(self, path: Union[bytes, Text]) -> None: ... + def stat(self, path: Union[bytes, Text]) -> SFTPAttributes: ... + def lstat(self, path: Union[bytes, Text]) -> SFTPAttributes: ... + def symlink(self, source: Union[bytes, Text], dest: Union[bytes, Text]) -> None: ... + def chmod(self, path: Union[bytes, Text], mode: int) -> None: ... + def chown(self, path: Union[bytes, Text], uid: int, gid: int) -> None: ... + def utime(self, path: Union[bytes, Text], times: Optional[Tuple[float, float]]) -> None: ... + def truncate(self, path: Union[bytes, Text], size: int) -> None: ... + def readlink(self, path: Union[bytes, Text]) -> Optional[Text]: ... + def normalize(self, path: Union[bytes, Text]) -> Text: ... + def chdir(self, path: Union[None, bytes, Text] = ...) -> None: ... + def getcwd(self) -> Optional[Text]: ... + def putfo( + self, + fl: IO[bytes], + remotepath: Union[bytes, Text], + file_size: int = ..., + callback: Optional[_Callback] = ..., + confirm: bool = ..., + ) -> SFTPAttributes: ... + def put( + self, + localpath: Union[bytes, Text], + remotepath: Union[bytes, Text], + callback: Optional[_Callback] = ..., + confirm: bool = ..., + ) -> SFTPAttributes: ... + def getfo(self, remotepath: Union[bytes, Text], fl: IO[bytes], callback: Optional[_Callback] = ...) -> int: ... + def get(self, remotepath: Union[bytes, Text], localpath: Union[bytes, Text], callback: Optional[_Callback] = ...) -> None: ... + +class SFTP(SFTPClient): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/sftp_file.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/sftp_file.pyi new file mode 100644 index 00000000..b2f4d5fa --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/sftp_file.pyi @@ -0,0 +1,29 @@ +from typing import Iterator, Optional, Sequence, Tuple + +from paramiko.file import BufferedFile +from paramiko.sftp_attr import SFTPAttributes +from paramiko.sftp_client import SFTPClient +from paramiko.sftp_handle import SFTPHandle + +class SFTPFile(BufferedFile): + MAX_REQUEST_SIZE: int + sftp: SFTPClient + handle: SFTPHandle + pipelined: bool + def __init__(self, sftp: SFTPClient, handle: bytes, mode: str = ..., bufsize: int = ...) -> None: ... + def __del__(self) -> None: ... + def close(self) -> None: ... + def settimeout(self, timeout: float) -> None: ... + def gettimeout(self) -> float: ... + def setblocking(self, blocking: bool) -> None: ... + def seekable(self) -> bool: ... + def seek(self, offset: int, whence: int = ...) -> None: ... + def stat(self) -> SFTPAttributes: ... + def chmod(self, mode: int) -> None: ... + def chown(self, uid: int, gid: int) -> None: ... + def utime(self, times: Optional[Tuple[float, float]]) -> None: ... + def truncate(self, size: int) -> None: ... + def check(self, hash_algorithm: str, offset: int = ..., length: int = ..., block_size: int = ...) -> bytes: ... + def set_pipelined(self, pipelined: bool = ...) -> None: ... + def prefetch(self, file_size: Optional[int] = ...) -> None: ... + def readv(self, chunks: Sequence[Tuple[int, int]]) -> Iterator[bytes]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/sftp_handle.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/sftp_handle.pyi new file mode 100644 index 00000000..ed089153 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/sftp_handle.pyi @@ -0,0 +1,13 @@ +from typing import Union + +from paramiko.sftp_attr import SFTPAttributes +from paramiko.sftp_server import SFTPServer +from paramiko.util import ClosingContextManager + +class SFTPHandle(ClosingContextManager): + def __init__(self, flags: int = ...) -> None: ... + def close(self) -> None: ... + def read(self, offset: int, length: int) -> Union[bytes, int]: ... + def write(self, offset: int, data: bytes) -> int: ... + def stat(self) -> Union[int, SFTPAttributes]: ... + def chattr(self, attr: SFTPAttributes) -> int: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/sftp_server.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/sftp_server.pyi new file mode 100644 index 00000000..7c0cb9de --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/sftp_server.pyi @@ -0,0 +1,28 @@ +from logging import Logger +from typing import Any, Dict, Optional, Type + +from paramiko.channel import Channel +from paramiko.server import ServerInterface, SubsystemHandler +from paramiko.sftp import BaseSFTP +from paramiko.sftp_attr import SFTPAttributes +from paramiko.sftp_handle import SFTPHandle +from paramiko.sftp_si import SFTPServerInterface +from paramiko.transport import Transport + +class SFTPServer(BaseSFTP, SubsystemHandler): + logger: Logger + ultra_debug: bool + next_handle: int + file_table: Dict[bytes, SFTPHandle] + folder_table: Dict[bytes, SFTPHandle] + server: SFTPServerInterface + sock: Optional[Channel] + def __init__( + self, channel: Channel, name: str, server: ServerInterface, sftp_si: Type[SFTPServerInterface], *largs: Any, **kwargs: Any + ) -> None: ... + def start_subsystem(self, name: str, transport: Transport, channel: Channel) -> None: ... + def finish_subsystem(self) -> None: ... + @staticmethod + def convert_errno(e: int) -> int: ... + @staticmethod + def set_file_attr(filename: str, attr: SFTPAttributes) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/sftp_si.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/sftp_si.pyi new file mode 100644 index 00000000..84905181 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/sftp_si.pyi @@ -0,0 +1,23 @@ +from typing import Any, List, Union + +from paramiko.server import ServerInterface +from paramiko.sftp_attr import SFTPAttributes +from paramiko.sftp_handle import SFTPHandle + +class SFTPServerInterface: + def __init__(self, server: ServerInterface, *largs: Any, **kwargs: Any) -> None: ... + def session_started(self) -> None: ... + def session_ended(self) -> None: ... + def open(self, path: str, flags: int, attr: SFTPAttributes) -> Union[SFTPHandle, int]: ... + def list_folder(self, path: str) -> Union[List[SFTPAttributes], int]: ... + def stat(self, path: str) -> Union[SFTPAttributes, int]: ... + def lstat(self, path: str) -> Union[SFTPAttributes, int]: ... + def remove(self, path: str) -> int: ... + def rename(self, oldpath: str, newpath: str) -> int: ... + def posix_rename(self, oldpath: str, newpath: str) -> int: ... + def mkdir(self, path: str, attr: SFTPAttributes) -> int: ... + def rmdir(self, path: str) -> int: ... + def chattr(self, path: str, attr: SFTPAttributes) -> int: ... + def canonicalize(self, path: str) -> str: ... + def readlink(self, path: str) -> Union[str, int]: ... + def symlink(self, target_path: str, path: str) -> int: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/ssh_exception.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/ssh_exception.pyi new file mode 100644 index 00000000..d9ba145f --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/ssh_exception.pyi @@ -0,0 +1,41 @@ +import socket +from typing import List, Mapping, Tuple, Union + +from paramiko.pkey import PKey + +class SSHException(Exception): ... +class AuthenticationException(SSHException): ... +class PasswordRequiredException(AuthenticationException): ... + +class BadAuthenticationType(AuthenticationException): + allowed_types: List[str] + explanation: str + def __init__(self, explanation: str, types: List[str]) -> None: ... + +class PartialAuthentication(AuthenticationException): + allowed_types: List[str] + def __init__(self, types: List[str]) -> None: ... + +class ChannelException(SSHException): + code: int + text: str + def __init__(self, code: int, text: str) -> None: ... + +class BadHostKeyException(SSHException): + hostname: str + key: PKey + expected_key: PKey + def __init__(self, hostname: str, got_key: PKey, expected_key: PKey) -> None: ... + +class ProxyCommandFailure(SSHException): + command: str + error: str + def __init__(self, command: str, error: str) -> None: ... + +class NoValidConnectionsError(socket.error): + errors: Mapping[Union[Tuple[str, int], Tuple[str, int, int, int]], Exception] + def __init__(self, errors: Mapping[Union[Tuple[str, int], Tuple[str, int, int, int]], Exception]) -> None: ... + def __reduce__(self) -> Tuple[type, Tuple[Mapping[Union[Tuple[str, int], Tuple[str, int, int, int]], Exception]]]: ... + +class CouldNotCanonicalize(SSHException): ... +class ConfigParseError(SSHException): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/ssh_gss.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/ssh_gss.pyi new file mode 100644 index 00000000..bbb8d7ed --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/ssh_gss.pyi @@ -0,0 +1,54 @@ +from typing import Any, Optional, Tuple, Type + +from paramiko.ssh_exception import SSHException + +GSS_AUTH_AVAILABLE: bool +GSS_EXCEPTIONS: Tuple[Type[Exception], ...] + +def GSSAuth(auth_method: str, gss_deleg_creds: bool = ...) -> _SSH_GSSAuth: ... + +class _SSH_GSSAuth: + cc_file: None + def __init__(self, auth_method: str, gss_deleg_creds: bool) -> None: ... + def set_service(self, service: str) -> None: ... + def set_username(self, username: str) -> None: ... + def ssh_gss_oids(self, mode: str = ...) -> bytes: ... + def ssh_check_mech(self, desired_mech: str) -> bool: ... + +class _SSH_GSSAPI_OLD(_SSH_GSSAuth): + def __init__(self, auth_method: str, gss_deleg_creds: bool) -> None: ... + def ssh_init_sec_context( + self, target: str, desired_mech: Optional[str] = ..., username: Optional[str] = ..., recv_token: Optional[str] = ... + ) -> Optional[str]: ... + def ssh_get_mic(self, session_id: bytes, gss_kex: bool = ...) -> Any: ... + def ssh_accept_sec_context(self, hostname: str, recv_token: str, username: Optional[str] = ...) -> Optional[str]: ... + def ssh_check_mic(self, mic_token: str, session_id: bytes, username: Optional[str] = ...) -> None: ... + @property + def credentials_delegated(self) -> bool: ... + def save_client_creds(self, client_token: str) -> None: ... + +_SSH_GSSAPI = _SSH_GSSAPI_OLD + +class _SSH_GSSAPI_NEW(_SSH_GSSAuth): + def __init__(self, auth_method: str, gss_deleg_creds: bool) -> None: ... + def ssh_init_sec_context( + self, target: str, desired_mech: Optional[str] = ..., username: Optional[str] = ..., recv_token: Optional[str] = ... + ) -> str: ... + def ssh_get_mic(self, session_id: bytes, gss_kex: bool = ...) -> Any: ... + def ssh_accept_sec_context(self, hostname: str, recv_token: str, username: Optional[str] = ...) -> Optional[str]: ... + def ssh_check_mic(self, mic_token: str, session_id: bytes, username: Optional[str] = ...) -> None: ... + @property + def credentials_delegated(self) -> bool: ... + def save_client_creds(self, client_token: str) -> None: ... + +class _SSH_SSPI(_SSH_GSSAuth): + def __init__(self, auth_method: str, gss_deleg_creds: bool) -> None: ... + def ssh_init_sec_context( + self, target: str, desired_mech: Optional[str] = ..., username: Optional[str] = ..., recv_token: Optional[str] = ... + ) -> str: ... + def ssh_get_mic(self, session_id: bytes, gss_kex: bool = ...) -> Any: ... + def ssh_accept_sec_context(self, hostname: str, username: str, recv_token: str) -> Optional[str]: ... + def ssh_check_mic(self, mic_token: str, session_id: bytes, username: Optional[str] = ...) -> None: ... + @property + def credentials_delegated(self) -> bool: ... + def save_client_creds(self, client_token: str) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/transport.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/transport.pyi new file mode 100644 index 00000000..aabc1b0e --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/transport.pyi @@ -0,0 +1,194 @@ +from logging import Logger +from socket import socket +from threading import Condition, Event, Lock, Thread +from types import ModuleType +from typing import Any, Callable, Dict, Iterable, List, Optional, Protocol, Sequence, Tuple, Type, Union + +from paramiko.auth_handler import AuthHandler, _InteractiveCallback +from paramiko.channel import Channel +from paramiko.compress import ZlibCompressor, ZlibDecompressor +from paramiko.message import Message +from paramiko.packet import NeedRekeyException, Packetizer +from paramiko.pkey import PKey +from paramiko.primes import ModulusPack +from paramiko.server import ServerInterface, SubsystemHandler +from paramiko.sftp_client import SFTPClient +from paramiko.ssh_gss import _SSH_GSSAuth +from paramiko.util import ClosingContextManager + +_Addr = Tuple[str, int] + +class _KexEngine(Protocol): + def start_kex(self) -> None: ... + def parse_next(self, ptype: int, m: Message) -> None: ... + +class Transport(Thread, ClosingContextManager): + active: bool + hostname: Optional[str] + sock: socket + packetizer: Packetizer + local_version: str + remote_version: str + local_cipher: str + local_kex_init: Optional[bytes] + local_mac: Optional[str] + local_compression: Optional[str] + session_id: Optional[bytes] + host_key_type: Optional[str] + host_key: Optional[PKey] + use_gss_kex: bool + gss_kex_used: bool + kexgss_ctxt: Optional[_SSH_GSSAuth] + gss_host: str + kex_engine: Optional[_KexEngine] + H: Optional[bytes] + K: Optional[int] + initial_kex_done: bool + in_kex: bool + authenticated: bool + lock: Lock + channel_events: Dict[int, Event] + channels_seen: Dict[int, bool] + default_max_packet_size: int + default_window_size: int + saved_exception: Optional[Exception] + clear_to_send: Event + clear_to_send_lock: Lock + clear_to_send_timeout: float + log_name: str + logger: Logger + auth_handler: Optional[AuthHandler] + global_response: Optional[Message] + completion_event: Optional[Event] + banner_timeout: float + handshake_timeout: float + auth_timeout: float + disabled_algorithms: Optional[Dict[str, Iterable[str]]] + server_mode: bool + server_object: Optional[ServerInterface] + server_key_dict: Dict[str, PKey] + server_accepts: List[Channel] + server_accept_cv: Condition + subsystem_table: Dict[str, Tuple[Type[SubsystemHandler], Tuple[Any, ...], Dict[str, Any]]] + sys: ModuleType + def __init__( + self, + sock: Union[str, Tuple[str, int], socket], + default_window_size: int = ..., + default_max_packet_size: int = ..., + gss_kex: bool = ..., + gss_deleg_creds: bool = ..., + disabled_algorithms: Optional[Dict[str, Iterable[str]]] = ..., + ) -> None: ... + @property + def preferred_ciphers(self) -> Sequence[str]: ... + @property + def preferred_macs(self) -> Sequence[str]: ... + @property + def preferred_keys(self) -> Sequence[str]: ... + @property + def preferred_kex(self) -> Sequence[str]: ... + @property + def preferred_compression(self) -> Sequence[str]: ... + def atfork(self) -> None: ... + def get_security_options(self) -> SecurityOptions: ... + def set_gss_host(self, gss_host: Optional[str], trust_dns: bool = ..., gssapi_requested: bool = ...) -> None: ... + def start_client(self, event: Optional[Event] = ..., timeout: Optional[float] = ...) -> None: ... + def start_server(self, event: Event = ..., server: Optional[ServerInterface] = ...) -> None: ... + def add_server_key(self, key: PKey) -> None: ... + def get_server_key(self) -> Optional[PKey]: ... + @staticmethod + def load_server_moduli(filename: Optional[str] = ...) -> bool: ... + def close(self) -> None: ... + def get_remote_server_key(self) -> PKey: ... + def is_active(self) -> bool: ... + def open_session( + self, window_size: Optional[int] = ..., max_packet_size: Optional[int] = ..., timeout: Optional[float] = ... + ) -> Channel: ... + def open_x11_channel(self, src_addr: _Addr = ...) -> Channel: ... + def open_forward_agent_channel(self) -> Channel: ... + def open_forwarded_tcpip_channel(self, src_addr: _Addr, dest_addr: _Addr) -> Channel: ... + def open_channel( + self, + kind: str, + dest_addr: Optional[_Addr] = ..., + src_addr: Optional[_Addr] = ..., + window_size: Optional[int] = ..., + max_packet_size: Optional[int] = ..., + timeout: Optional[float] = ..., + ) -> Channel: ... + def request_port_forward( + self, address: str, port: int, handler: Optional[Callable[[Channel, _Addr, _Addr], None]] = ... + ) -> int: ... + def cancel_port_forward(self, address: str, port: int) -> None: ... + def open_sftp_client(self) -> Optional[SFTPClient]: ... + def send_ignore(self, byte_count: int = ...) -> None: ... + def renegotiate_keys(self) -> None: ... + def set_keepalive(self, interval: int) -> None: ... + def global_request(self, kind: str, data: Optional[Iterable[Any]] = ..., wait: bool = ...) -> Optional[Message]: ... + def accept(self, timeout: Optional[float] = ...) -> Optional[Channel]: ... + def connect( + self, + hostkey: Optional[PKey] = ..., + username: str = ..., + password: Optional[str] = ..., + pkey: Optional[PKey] = ..., + gss_host: Optional[str] = ..., + gss_auth: bool = ..., + gss_kex: bool = ..., + gss_deleg_creds: bool = ..., + gss_trust_dns: bool = ..., + ) -> None: ... + def get_exception(self) -> Optional[Exception]: ... + def set_subsystem_handler(self, name: str, handler: Type[SubsystemHandler], *larg: Any, **kwarg: Any) -> None: ... + def is_authenticated(self) -> bool: ... + def get_username(self) -> Optional[str]: ... + def get_banner(self) -> Optional[str]: ... + def auth_none(self, username: str) -> List[str]: ... + def auth_password(self, username: str, password: str, event: Optional[Event] = ..., fallback: bool = ...) -> List[str]: ... + def auth_publickey(self, username: str, key: PKey, event: Optional[Event] = ...) -> List[str]: ... + def auth_interactive(self, username: str, handler: _InteractiveCallback, submethods: str = ...) -> List[str]: ... + def auth_interactive_dumb( + self, username: str, handler: Optional[_InteractiveCallback] = ..., submethods: str = ... + ) -> List[str]: ... + def auth_gssapi_with_mic(self, username: str, gss_host: str, gss_deleg_creds: bool) -> List[str]: ... + def auth_gssapi_keyex(self, username: str) -> List[str]: ... + def set_log_channel(self, name: str) -> None: ... + def get_log_channel(self) -> str: ... + def set_hexdump(self, hexdump: bool) -> None: ... + def get_hexdump(self) -> bool: ... + def use_compression(self, compress: bool = ...) -> None: ... + def getpeername(self) -> Tuple[str, int]: ... + def stop_thread(self) -> None: ... + def run(self) -> None: ... + +class SecurityOptions: + def __init__(self, transport: Transport) -> None: ... + @property + def ciphers(self) -> Sequence[str]: ... + @ciphers.setter + def ciphers(self, x: Sequence[str]) -> None: ... + @property + def digests(self) -> Sequence[str]: ... + @digests.setter + def digests(self, x: Sequence[str]) -> None: ... + @property + def key_types(self) -> Sequence[str]: ... + @key_types.setter + def key_types(self, x: Sequence[str]) -> None: ... + @property + def kex(self) -> Sequence[str]: ... + @kex.setter + def kex(self, x: Sequence[str]) -> None: ... + @property + def compression(self) -> Sequence[str]: ... + @compression.setter + def compression(self, x: Sequence[str]) -> None: ... + +class ChannelMap: + def __init__(self) -> None: ... + def put(self, chanid: int, chan: Channel) -> None: ... + def get(self, chanid: int) -> Channel: ... + def delete(self, chanid: int) -> None: ... + def values(self) -> List[Channel]: ... + def __len__(self) -> int: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/util.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/util.pyi new file mode 100644 index 00000000..404017e4 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/util.pyi @@ -0,0 +1,52 @@ +import sys +from logging import Logger, LogRecord +from types import TracebackType +from typing import IO, AnyStr, Callable, Generic, List, Optional, Protocol, Text, Type, TypeVar, Union + +from paramiko.config import SSHConfig, SSHConfigDict +from paramiko.hostkeys import HostKeys + +if sys.version_info < (3, 0): + from hashlib import _hash as _Hash +else: + from hashlib import _Hash + +class SupportsClose(Protocol): + def close(self) -> None: ... + +_T = TypeVar("_T") +_TC = TypeVar("_TC", bound=SupportsClose) + +def inflate_long(s: bytes, always_positive: bool = ...) -> int: ... + +deflate_zero: int +deflate_ff: int + +def deflate_long(n: int, add_sign_padding: bool = ...) -> bytes: ... +def format_binary(data: bytes, prefix: str = ...) -> List[str]: ... +def format_binary_line(data: bytes) -> str: ... +def safe_string(s: bytes) -> bytes: ... +def bit_length(n: int) -> int: ... +def tb_strings() -> List[str]: ... +def generate_key_bytes(hash_alg: Type[_Hash], salt: bytes, key: Union[bytes, str], nbytes: int) -> bytes: ... +def load_host_keys(filename: str) -> HostKeys: ... +def parse_ssh_config(file_obj: IO[str]) -> SSHConfig: ... +def lookup_ssh_host_config(hostname: str, config: SSHConfig) -> SSHConfigDict: ... +def mod_inverse(x: int, m: int) -> int: ... +def get_thread_id() -> int: ... +def log_to_file(filename: str, level: int = ...) -> None: ... + +class PFilter: + def filter(self, record: LogRecord) -> bool: ... + +def get_logger(name: str) -> Logger: ... +def retry_on_signal(function: Callable[[], _T]) -> _T: ... +def constant_time_bytes_eq(a: AnyStr, b: AnyStr) -> bool: ... + +class ClosingContextManager: + def __enter__(self: _TC) -> _TC: ... + def __exit__( + self: _TC, type: Optional[Type[BaseException]], value: Optional[BaseException], traceback: Optional[TracebackType] + ) -> None: ... + +def clamp_value(minimum: int, val: int, maximum: int) -> int: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/win_pageant.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/win_pageant.pyi new file mode 100644 index 00000000..70750912 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/paramiko/win_pageant.pyi @@ -0,0 +1,16 @@ +import ctypes.wintypes +import sys + +assert sys.platform == "win32" + +win32con_WM_COPYDATA: int + +def can_talk_to_agent(): ... + +class COPYDATASTRUCT(ctypes.Structure): ... + +class PageantConnection: + def __init__(self) -> None: ... + def send(self, data: bytes) -> None: ... + def recv(self, n: int) -> bytes: ... + def close(self) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/polib.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/polib.pyi new file mode 100644 index 00000000..267e47e2 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/polib.pyi @@ -0,0 +1,156 @@ +import textwrap +from typing import IO, Any, Callable, Dict, Generic, List, Optional, Text, Tuple, Type, TypeVar, Union, overload + +_TB = TypeVar("_TB", bound="_BaseEntry") +_TP = TypeVar("_TP", bound="POFile") +_TM = TypeVar("_TM", bound="MOFile") + +default_encoding: str + +# wrapwidth: int +# encoding: str +# check_for_duplicates: bool +@overload +def pofile(pofile: Text, *, klass: Type[_TP], **kwargs: Any) -> _TP: ... +@overload +def pofile(pofile: Text, **kwargs: Any) -> POFile: ... +@overload +def mofile(mofile: Text, *, klass: Type[_TM], **kwargs: Any) -> _TM: ... +@overload +def mofile(mofile: Text, **kwargs: Any) -> MOFile: ... +def detect_encoding(file: Union[bytes, Text], binary_mode: bool = ...) -> str: ... +def escape(st: Text) -> Text: ... +def unescape(st: Text) -> Text: ... + +class _BaseFile(List[_TB]): + fpath: Text + wrapwidth: int + encoding: Text + check_for_duplicates: bool + header: Text + metadata: Dict[Text, Text] + metadata_is_fuzzy: bool + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + def __unicode__(self) -> Text: ... + def __contains__(self, entry: _TB) -> bool: ... # type: ignore # AttributeError otherwise + def __eq__(self, other: object) -> bool: ... + def append(self, entry: _TB) -> None: ... + def insert(self, index: int, entry: _TB) -> None: ... + def metadata_as_entry(self) -> POEntry: ... + def save(self, fpath: Optional[Text] = ..., repr_method: str = ...) -> None: ... + def find(self, st: Text, by: str = ..., include_obsolete_entries: bool = ..., msgctxt: bool = ...) -> Optional[_TB]: ... + def ordered_metadata(self) -> List[Text]: ... + def to_binary(self) -> bytes: ... + +class POFile(_BaseFile): + def __unicode__(self) -> Text: ... + def save_as_mofile(self, fpath: Text) -> None: ... + def percent_translated(self) -> int: ... + def translated_entries(self) -> List[POEntry]: ... + def untranslated_entries(self) -> List[POEntry]: ... + def fuzzy_entries(self) -> List[POEntry]: ... + def obsolete_entries(self) -> List[POEntry]: ... + def merge(self, refpot: POFile) -> None: ... + +class MOFile(_BaseFile): + MAGIC: int + MAGIC_SWAPPED: int + magic_number: Optional[int] + version: int + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + def save_as_pofile(self, fpath: str) -> None: ... + def save(self, fpath: Optional[Text] = ...) -> None: ... # type: ignore # binary file does not allow argument repr_method + def percent_translated(self) -> int: ... + def translated_entries(self) -> List[MOEntry]: ... + def untranslated_entries(self) -> List[MOEntry]: ... + def fuzzy_entries(self) -> List[MOEntry]: ... + def obsolete_entries(self) -> List[MOEntry]: ... + +class _BaseEntry(object): + msgid: Text + msgstr: Text + msgid_plural: List[Text] + msgstr_plural: List[Text] + msgctxt: Text + obsolete: bool + encoding: str + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + def __unicode__(self, wrapwidth: int = ...) -> Text: ... + def __eq__(self, other: object) -> bool: ... + +class POEntry(_BaseEntry): + comment: Text + tcomment: Text + occurrences: List[Tuple[str, int]] + flags: List[Text] + previous_msgctxt: Optional[Text] + previous_msgid: Optional[Text] + previous_msgid_plural: Optional[Text] + linenum: Optional[int] + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + def __unicode__(self, wrapwidth: int = ...) -> Text: ... + def __cmp__(self, other: POEntry) -> int: ... + def __gt__(self, other: POEntry) -> bool: ... + def __lt__(self, other: POEntry) -> bool: ... + def __ge__(self, other: POEntry) -> bool: ... + def __le__(self, other: POEntry) -> bool: ... + def __eq__(self, other: Any) -> bool: ... + def __ne__(self, other: Any) -> bool: ... + def translated(self) -> bool: ... + def merge(self, other: POEntry) -> None: ... + @property + def fuzzy(self) -> bool: ... + @property + def msgid_with_context(self) -> Text: ... + def __hash__(self) -> int: ... + +class MOEntry(_BaseEntry): + comment: Text + tcomment: Text + occurrences: List[Tuple[str, int]] + flags: List[Text] + previous_msgctxt: Optional[Text] + previous_msgid: Optional[Text] + previous_msgid_plural: Optional[Text] + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + def __hash__(self) -> int: ... + +class _POFileParser(Generic[_TP]): + fhandle: IO[Text] + instance: _TP + transitions: Dict[Tuple[str, str], Tuple[Callable[[], bool], str]] + current_line: int + current_entry: POEntry + current_state: str + current_token: Optional[str] + msgstr_index: int + entry_obsolete: int + def __init__(self, pofile: Text, *args: Any, **kwargs: Any) -> None: ... + def parse(self) -> _TP: ... + def add(self, symbol: str, states: List[str], next_state: str) -> None: ... + def process(self, symbol: str) -> None: ... + def handle_he(self) -> bool: ... + def handle_tc(self) -> bool: ... + def handle_gc(self) -> bool: ... + def handle_oc(self) -> bool: ... + def handle_fl(self) -> bool: ... + def handle_pp(self) -> bool: ... + def handle_pm(self) -> bool: ... + def handle_pc(self) -> bool: ... + def handle_ct(self) -> bool: ... + def handle_mi(self) -> bool: ... + def handle_mp(self) -> bool: ... + def handle_ms(self) -> bool: ... + def handle_mx(self) -> bool: ... + def handle_mc(self) -> bool: ... + +class _MOFileParser(Generic[_TM]): + fhandle: IO[bytes] + instance: _TM + def __init__(self, mofile: Text, *args: Any, **kwargs: Any) -> None: ... + def __del__(self) -> None: ... + def parse(self) -> _TM: ... + +class TextWrapper(textwrap.TextWrapper): + drop_whitespace: bool + def __init__(self, *args: Any, **kwargs: Any) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pyVmomi/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pyVmomi/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pyVmomi/vim/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pyVmomi/vim/__init__.pyi new file mode 100644 index 00000000..57083f91 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pyVmomi/vim/__init__.pyi @@ -0,0 +1,69 @@ +from datetime import datetime +from enum import Enum +from typing import Any, List + +from ..vmodl.query import PropertyCollector +from .event import EventManager +from .option import OptionManager +from .view import ViewManager + +def __getattr__(name: str) -> Any: ... # incomplete + +class ManagedObject: ... + +class ManagedEntity(ManagedObject): + _moId: str + obj: None + name: str + def __getattr__(self, name: str) -> Any: ... # incomplete + +class ServiceInstanceContent: + setting: OptionManager + propertyCollector: PropertyCollector + rootFolder: Folder + viewManager: ViewManager + perfManager: PerformanceManager + eventManager: EventManager + def __getattr__(self, name: str) -> Any: ... # incomplete + +class ServiceInstance: + content: ServiceInstanceContent + def CurrentTime(self) -> datetime: ... + def __getattr__(self, name: str) -> Any: ... # incomplete + +class PerformanceManager: + class MetricId: + counterId: int + instance: str + def __init__(self, counterId: int, instance: str): ... + class PerfCounterInfo: + key: int + groupInfo: Any + nameInfo: Any + rollupType: Any + def __getattr__(self, name: str) -> Any: ... # incomplete + class QuerySpec: + entity: ManagedEntity + metricId: List[PerformanceManager.MetricId] + intervalId: int + maxSample: int + startTime: datetime + def __getattr__(self, name: str) -> Any: ... # incomplete + class EntityMetricBase: + entity: ManagedEntity + def QueryPerfCounterByLevel(self, collection_level: int) -> List[PerformanceManager.PerfCounterInfo]: ... + def QueryPerf(self, querySpec: List[PerformanceManager.QuerySpec]) -> List[PerformanceManager.EntityMetricBase]: ... + def __getattr__(self, name: str) -> Any: ... # incomplete + +class ClusterComputeResource(ManagedEntity): ... +class ComputeResource(ManagedEntity): ... +class Datacenter(ManagedEntity): ... +class Datastore(ManagedEntity): ... +class Folder(ManagedEntity): ... +class HostSystem(ManagedEntity): ... +class VirtualMachine(ManagedEntity): ... + +class VirtualMachinePowerState(Enum): + poweredOff: int + poweredOn: int + suspended: int diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pyVmomi/vim/event.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pyVmomi/vim/event.pyi new file mode 100644 index 00000000..b8d320ab --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pyVmomi/vim/event.pyi @@ -0,0 +1,16 @@ +from datetime import datetime +from typing import Any, List + +def __getattr__(name: str) -> Any: ... # incomplete + +class Event: + createdTime: datetime + +class EventFilterSpec: + class ByTime: + def __init__(self, beginTime: datetime): ... + time: EventFilterSpec.ByTime + +class EventManager: + latestEvent: Event + def QueryEvents(self, filer: EventFilterSpec) -> List[Event]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pyVmomi/vim/fault.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pyVmomi/vim/fault.pyi new file mode 100644 index 00000000..80a1dac0 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pyVmomi/vim/fault.pyi @@ -0,0 +1,7 @@ +from typing import Any + +def __getattr__(name: str) -> Any: ... # incomplete + +class InvalidName(Exception): ... +class RestrictedByAdministrator(Exception): ... +class NoPermission(Exception): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pyVmomi/vim/option.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pyVmomi/vim/option.pyi new file mode 100644 index 00000000..164cf3c8 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pyVmomi/vim/option.pyi @@ -0,0 +1,9 @@ +from typing import Any, List + +def __getattr__(name: str) -> Any: ... # incomplete + +class OptionManager: + def QueryOptions(self, name: str) -> List[OptionValue]: ... + +class OptionValue: + value: Any diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pyVmomi/vim/view.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pyVmomi/vim/view.pyi new file mode 100644 index 00000000..c5bc840f --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pyVmomi/vim/view.pyi @@ -0,0 +1,15 @@ +from typing import Any, List, Type + +from pyVmomi.vim import ManagedEntity + +def __getattr__(name: str) -> Any: ... # incomplete + +class ContainerView: + def Destroy(self) -> None: ... + +class ViewManager: + # Doc says the `type` parameter of CreateContainerView is a `List[str]`, + # but in practice it seems to be `List[Type[ManagedEntity]]` + # Source: https://pubs.vmware.com/vi-sdk/visdk250/ReferenceGuide/vim.view.ViewManager.html + @staticmethod + def CreateContainerView(container: ManagedEntity, type: List[Type[ManagedEntity]], recursive: bool) -> ContainerView: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pyVmomi/vmodl/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pyVmomi/vmodl/__init__.pyi new file mode 100644 index 00000000..1287d9ed --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pyVmomi/vmodl/__init__.pyi @@ -0,0 +1,5 @@ +from typing import Any + +class DynamicProperty: + name: str + val: Any diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pyVmomi/vmodl/fault.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pyVmomi/vmodl/fault.pyi new file mode 100644 index 00000000..3876a513 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pyVmomi/vmodl/fault.pyi @@ -0,0 +1,5 @@ +from typing import Any + +def __getattr__(name: str) -> Any: ... # incomplete + +class InvalidArgument(Exception): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pyVmomi/vmodl/query.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pyVmomi/vmodl/query.pyi new file mode 100644 index 00000000..87728d19 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pyVmomi/vmodl/query.pyi @@ -0,0 +1,38 @@ +from typing import Any, List, Optional, Type + +from pyVmomi.vim import ManagedEntity +from pyVmomi.vim.view import ContainerView +from pyVmomi.vmodl import DynamicProperty + +class PropertyCollector: + class PropertySpec: + all: bool + type: Type[ManagedEntity] + pathSet: List[str] + class TraversalSpec: + path: str + skip: bool + type: Type[ContainerView] + def __getattr__(self, name: str) -> Any: ... # incomplete + class RetrieveOptions: + maxObjects: int + class ObjectSpec: + skip: bool + selectSet: List[PropertyCollector.TraversalSpec] + obj: Any + class FilterSpec: + propSet: List[PropertyCollector.PropertySpec] + objectSet: List[PropertyCollector.ObjectSpec] + def __getattr__(self, name: str) -> Any: ... # incomplete + class ObjectContent: + obj: ManagedEntity + propSet: List[DynamicProperty] + def __getattr__(self, name: str) -> Any: ... # incomplete + class RetrieveResult: + objects: List[PropertyCollector.ObjectContent] + token: Optional[str] + def RetrievePropertiesEx( + self, specSet: List[PropertyCollector.FilterSpec], options: PropertyCollector.RetrieveOptions + ) -> PropertyCollector.RetrieveResult: ... + def ContinueRetrievePropertiesEx(self, token: str) -> PropertyCollector.RetrieveResult: ... + def __getattr__(self, name: str) -> Any: ... # incomplete diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pycurl.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pycurl.pyi old mode 100755 new mode 100644 index ec70d764..ca6538d3 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pycurl.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pycurl.pyi @@ -1,6 +1,6 @@ # TODO(MichalPokorny): more precise types -from typing import Any, List, Tuple +from typing import Any, List, Text, Tuple GLOBAL_ACK_EINTR: int GLOBAL_ALL: int @@ -21,13 +21,16 @@ class error(Exception): ... class Curl(object): def close(self) -> None: ... def setopt(self, option: int, value: Any) -> None: ... + def setopt_string(self, option: int, value: str) -> None: ... def perform(self) -> None: ... + def perform_rb(self) -> bytes: ... + def perform_rs(self) -> Text: ... def getinfo(self, info: Any) -> Any: ... + def getinfo_raw(self, info: Any) -> Any: ... def reset(self) -> None: ... def unsetopt(self, option: int) -> Any: ... def pause(self, bitmask: Any) -> Any: ... def errstr(self) -> str: ... - # TODO(MichalPokorny): wat? USERPWD: int @@ -39,6 +42,7 @@ class CurlMulti(object): def fdset(self) -> Tuple[List[Any], List[Any], List[Any]]: ... def select(self, timeout: float = ...) -> int: ... def info_read(self, max_objects: int = ...) -> Tuple[int, List[Any], List[Any]]: ... + def socket_action(self, sockfd: int, ev_bitmask: int) -> Tuple[int, int]: ... class CurlShare(object): def close(self) -> None: ... @@ -54,7 +58,6 @@ BUFFERSIZE: int CAINFO: int CAPATH: int CLOSESOCKETFUNCTION: int -COMPILE_DATE: str COMPILE_LIBCURL_VERSION_NUM: int COMPILE_PY_VERSION_HEX: int CONDITION_UNMET: int @@ -62,6 +65,7 @@ CONNECTTIMEOUT: int CONNECTTIMEOUT_MS: int CONNECT_ONLY: int CONNECT_TIME: int +CONNECT_TO: int CONTENT_LENGTH_DOWNLOAD: int CONTENT_LENGTH_UPLOAD: int CONTENT_TYPE: int @@ -84,6 +88,7 @@ CURL_HTTP_VERSION_LAST: int CURL_HTTP_VERSION_NONE: int CUSTOMREQUEST: int DEBUGFUNCTION: int +DEFAULT_PROTOCOL: int DIRLISTONLY: int DNS_CACHE_TIMEOUT: int DNS_SERVERS: int @@ -177,6 +182,7 @@ INFOTYPE_TEXT: int INFO_CERTINFO: int INFO_COOKIELIST: int INFO_FILETIME: int +INFO_HTTP_VERSION: int INFO_RTSP_CLIENT_CSEQ: int INFO_RTSP_CSEQ_RECV: int INFO_RTSP_SERVER_CSEQ: int @@ -184,7 +190,6 @@ INFO_RTSP_SESSION_ID: int INTERFACE: int IOCMD_NOP: int IOCMD_RESTARTREAD: int -IOCTLDATA: int IOCTLFUNCTION: int IOE_FAILRESTART: int IOE_OK: int @@ -254,7 +259,14 @@ NOSIGNAL: int NUM_CONNECTS: int OPENSOCKETFUNCTION: int OPT_CERTINFO: int +OPT_COOKIELIST: int OPT_FILETIME: int +OPT_RTSP_CLIENT_CSEQ: int +OPT_RTSP_REQUEST: int +OPT_RTSP_SERVER_CSEQ: int +OPT_RTSP_SESSION_ID: int +OPT_RTSP_STREAM_URI: int +OPT_RTSP_TRANSPORT: int OS_ERRNO: int PASSWORD: int PATH_AS_IS: int @@ -264,7 +276,6 @@ PAUSE_RECV: int PAUSE_SEND: int PINNEDPUBLICKEY: int PIPEWAIT: int -PIPE_HTTP1: int PIPE_MULTIPLEX: int PIPE_NOTHING: int POLL_IN: int @@ -282,6 +293,7 @@ POSTQUOTE: int POSTREDIR: int PREQUOTE: int PRETRANSFER_TIME: int +PRE_PROXY: int PRIMARY_IP: int PRIMARY_PORT: int PROGRESSFUNCTION: int @@ -330,7 +342,15 @@ PROXYTYPE_SOCKS5: int PROXYTYPE_SOCKS5_HOSTNAME: int PROXYUSERNAME: int PROXYUSERPWD: int +PROXY_CAINFO: int +PROXY_CAPATH: int PROXY_SERVICE_NAME: int +PROXY_SSLCERT: int +PROXY_SSLCERTTYPE: int +PROXY_SSLKEY: int +PROXY_SSLKEYTYPE: int +PROXY_SSL_VERIFYHOST: int +PROXY_SSL_VERIFYPEER: int PROXY_TRANSFER_MODE: int PUT: int QUOTE: int @@ -354,6 +374,19 @@ RESOLVE: int RESPONSE_CODE: int RESUME_FROM: int RESUME_FROM_LARGE: int +RTSPREQ_ANNOUNCE: int +RTSPREQ_DESCRIBE: int +RTSPREQ_GET_PARAMETER: int +RTSPREQ_LAST: int +RTSPREQ_NONE: int +RTSPREQ_OPTIONS: int +RTSPREQ_PAUSE: int +RTSPREQ_PLAY: int +RTSPREQ_RECEIVE: int +RTSPREQ_RECORD: int +RTSPREQ_SETUP: int +RTSPREQ_SET_PARAMETER: int +RTSPREQ_TEARDOWN: int SASL_IR: int SEEKFUNCTION: int SEEKFUNC_CANTSEEK: int @@ -365,6 +398,7 @@ SH_SHARE: int SH_UNSHARE: int SIZE_DOWNLOAD: int SIZE_UPLOAD: int +SOCKET_BAD: int SOCKET_TIMEOUT: int SOCKOPTFUNCTION: int SOCKOPT_ALREADY_CONNECTED: int @@ -376,6 +410,7 @@ SOCKTYPE_ACCEPT: int SOCKTYPE_IPCXN: int SPEED_DOWNLOAD: int SPEED_UPLOAD: int +SSH_AUTH_AGENT: int SSH_AUTH_ANY: int SSH_AUTH_DEFAULT: int SSH_AUTH_HOST: int @@ -398,6 +433,7 @@ SSLKEY: int SSLKEYPASSWD: int SSLKEYTYPE: int SSLOPT_ALLOW_BEAST: int +SSLOPT_NO_REVOKE: int SSLVERSION: int SSLVERSION_DEFAULT: int SSLVERSION_SSLv2: int @@ -406,6 +442,7 @@ SSLVERSION_TLSv1: int SSLVERSION_TLSv1_0: int SSLVERSION_TLSv1_1: int SSLVERSION_TLSv1_2: int +SSLVERSION_MAX_DEFAULT: int SSL_CIPHER_LIST: int SSL_ENABLE_ALPN: int SSL_ENABLE_NPN: int @@ -419,6 +456,7 @@ SSL_VERIFYRESULT: int SSL_VERIFYSTATUS: int STARTTRANSFER_TIME: int STDERR: int +TCP_FASTOPEN: int TCP_KEEPALIVE: int TCP_KEEPIDLE: int TCP_KEEPINTVL: int @@ -456,6 +494,7 @@ VERSION_ASYNCHDNS: int VERSION_CONV: int VERSION_CURLDEBUG: int VERSION_DEBUG: int +VERSION_FIRST: int VERSION_GSSAPI: int VERSION_GSSNEGOTIATE: int VERSION_HTTP2: int @@ -467,6 +506,7 @@ VERSION_LARGEFILE: int VERSION_LIBZ: int VERSION_NTLM: int VERSION_NTLM_WB: int +VERSION_PSL: int VERSION_SPNEGO: int VERSION_SSL: int VERSION_SSPI: int diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pymysql/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pymysql/__init__.pyi old mode 100755 new mode 100644 index 523c6014..35532caa --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pymysql/__init__.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pymysql/__init__.pyi @@ -1,28 +1,28 @@ import sys -from typing import Union, Tuple, Callable, FrozenSet +from typing import Callable, FrozenSet, Tuple from .connections import Connection as _Connection from .constants import FIELD_TYPE as FIELD_TYPE from .converters import escape_dict as escape_dict, escape_sequence as escape_sequence, escape_string as escape_string from .err import ( - Warning as Warning, - Error as Error, - InterfaceError as InterfaceError, - DataError as DataError, DatabaseError as DatabaseError, - OperationalError as OperationalError, + DataError as DataError, + Error as Error, IntegrityError as IntegrityError, + InterfaceError as InterfaceError, InternalError as InternalError, + MySQLError as MySQLError, NotSupportedError as NotSupportedError, + OperationalError as OperationalError, ProgrammingError as ProgrammingError, - MySQLError as MySQLError, + Warning as Warning, ) from .times import ( Date as Date, - Time as Time, - Timestamp as Timestamp, DateFromTicks as DateFromTicks, + Time as Time, TimeFromTicks as TimeFromTicks, + Timestamp as Timestamp, TimestampFromTicks as TimestampFromTicks, ) @@ -46,8 +46,10 @@ ROWID: DBAPISet if sys.version_info >= (3, 0): def Binary(x) -> bytes: ... + else: def Binary(x) -> bytearray: ... + def Connect(*args, **kwargs) -> _Connection: ... def get_client_info() -> str: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pymysql/charset.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pymysql/charset.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pymysql/connections.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pymysql/connections.pyi old mode 100755 new mode 100644 index 47e00a47..bd04adc3 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pymysql/connections.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pymysql/connections.pyi @@ -1,74 +1,55 @@ -from typing import Any, Optional, Type -from .charset import MBLENGTH as MBLENGTH, charset_by_name as charset_by_name, charset_by_id as charset_by_id -from .cursors import Cursor as Cursor -from .constants import FIELD_TYPE as FIELD_TYPE, FLAG as FLAG -from .constants import SERVER_STATUS as SERVER_STATUS -from .constants import CLIENT as CLIENT -from .constants import COMMAND as COMMAND -from .util import join_bytes as join_bytes, byte2int as byte2int, int2byte as int2byte -from .converters import escape_item as escape_item, encoders as encoders, decoders as decoders -from .err import raise_mysql_exception as raise_mysql_exception, Warning as Warning, Error as Error, InterfaceError as InterfaceError, DataError as DataError, DatabaseError as DatabaseError, OperationalError as OperationalError, IntegrityError as IntegrityError, InternalError as InternalError, NotSupportedError as NotSupportedError, ProgrammingError as ProgrammingError +from socket import SocketType +from typing import Any, AnyStr, Mapping, Optional, Tuple, Type + +from .charset import charset_by_id as charset_by_id, charset_by_name as charset_by_name +from .constants import CLIENT as CLIENT, COMMAND as COMMAND, FIELD_TYPE as FIELD_TYPE, SERVER_STATUS as SERVER_STATUS +from .cursors import Cursor +from .util import byte2int as byte2int, int2byte as int2byte -sha_new: Any SSL_ENABLED: Any DEFAULT_USER: Any DEBUG: Any -NULL_COLUMN: Any -UNSIGNED_CHAR_COLUMN: Any -UNSIGNED_SHORT_COLUMN: Any -UNSIGNED_INT24_COLUMN: Any -UNSIGNED_INT64_COLUMN: Any -UNSIGNED_CHAR_LENGTH: Any -UNSIGNED_SHORT_LENGTH: Any -UNSIGNED_INT24_LENGTH: Any -UNSIGNED_INT64_LENGTH: Any DEFAULT_CHARSET: Any def dump_packet(data): ... - -SCRAMBLE_LENGTH_323: Any - -class RandStruct_323: - max_value: Any - seed1: Any - seed2: Any - def __init__(self, seed1, seed2): ... - def my_rnd(self): ... - def pack_int24(n): ... -def unpack_uint16(n): ... -def unpack_int24(n): ... -def unpack_int32(n): ... -def unpack_int64(n): ... -def defaulterrorhandler(connection, cursor, errorclass, errorvalue): ... +def lenenc_int(i: int) -> bytes: ... class MysqlPacket: connection: Any - def __init__(self, connection): ... - def packet_number(self): ... + def __init__(self, data, encoding): ... def get_all_data(self): ... def read(self, size): ... def read_all(self): ... def advance(self, length): ... def rewind(self, position: int = ...): ... - def peek(self, size): ... def get_bytes(self, position, length: int = ...): ... - def read_length_coded_binary(self): ... - def read_length_coded_string(self): ... - def is_ok_packet(self): ... - def is_eof_packet(self): ... - def is_resultset_packet(self): ... - def is_error_packet(self): ... + def read_string(self) -> bytes: ... + def read_uint8(self) -> Any: ... + def read_uint16(self) -> Any: ... + def read_uint24(self) -> Any: ... + def read_uint32(self) -> Any: ... + def read_uint64(self) -> Any: ... + def read_length_encoded_integer(self) -> int: ... + def read_length_coded_string(self) -> bytes: ... + def read_struct(self, fmt: str) -> Tuple[Any, ...]: ... + def is_ok_packet(self) -> bool: ... + def is_eof_packet(self) -> bool: ... + def is_auth_switch_request(self) -> bool: ... + def is_extra_auth_data(self) -> bool: ... + def is_resultset_packet(self) -> bool: ... + def is_load_local_packet(self) -> bool: ... + def is_error_packet(self) -> bool: ... def check_error(self): ... + def raise_for_error(self) -> None: ... def dump(self): ... class FieldDescriptorPacket(MysqlPacket): - def __init__(self, *args): ... + def __init__(self, data, encoding): ... def description(self): ... def get_column_length(self): ... class Connection: - errorhandler: Any ssl: Any host: Any port: Any @@ -76,6 +57,7 @@ class Connection: password: Any db: Any unix_socket: Any + bind_address: Any charset: Any use_unicode: Any client_flag: Any @@ -85,32 +67,70 @@ class Connection: encoders: Any decoders: Any host_info: Any - def __init__(self, host: str = ..., user: Optional[Any] = ..., passwd: str = ..., db: Optional[Any] = ..., - port: int = ..., unix_socket: Optional[Any] = ..., charset: str = ..., sql_mode: Optional[Any] = ..., - read_default_file: Optional[Any] = ..., conv=..., use_unicode: Optional[Any] = ..., client_flag: int = ..., - cursorclass=..., init_command: Optional[Any] = ..., connect_timeout: Optional[Any] = ..., - ssl: Optional[Any] = ..., read_default_group: Optional[Any] = ..., compress: Optional[Any] = ..., - named_pipe: Optional[Any] = ...): ... + sql_mode: Any + init_command: Any + max_allowed_packet: int + server_public_key: bytes + def __init__( + self, + host: Optional[str] = ..., + user: Optional[Any] = ..., + password: str = ..., + database: Optional[Any] = ..., + port: int = ..., + unix_socket: Optional[Any] = ..., + charset: str = ..., + sql_mode: Optional[Any] = ..., + read_default_file: Optional[Any] = ..., + conv=..., + use_unicode: Optional[bool] = ..., + client_flag: int = ..., + cursorclass: Optional[Type[Cursor]] = ..., + init_command: Optional[Any] = ..., + connect_timeout: Optional[int] = ..., + ssl: Optional[Mapping] = ..., + read_default_group: Optional[Any] = ..., + compress: Optional[Any] = ..., + named_pipe: Optional[Any] = ..., + autocommit: Optional[bool] = ..., + db: Optional[Any] = ..., + passwd: Optional[Any] = ..., + local_infile: Optional[Any] = ..., + max_allowed_packet: int = ..., + defer_connect: Optional[bool] = ..., + auth_plugin_map: Optional[Mapping] = ..., + read_timeout: Optional[float] = ..., + write_timeout: Optional[float] = ..., + bind_address: Optional[Any] = ..., + binary_prefix: Optional[bool] = ..., + program_name: Optional[Any] = ..., + server_public_key: Optional[bytes] = ..., + ): ... socket: Any rfile: Any wfile: Any def close(self) -> None: ... - def autocommit(self, value): ... - def commit(self): ... + @property + def open(self) -> bool: ... + def autocommit(self, value) -> None: ... + def get_autocommit(self) -> bool: ... + def commit(self) -> None: ... def begin(self) -> None: ... - def rollback(self): ... - def escape(self, obj): ... + def rollback(self) -> None: ... + def select_db(self, db) -> None: ... + def escape(self, obj, mapping: Optional[Mapping] = ...): ... def literal(self, obj): ... + def escape_string(self, s: AnyStr) -> AnyStr: ... def cursor(self, cursor: Optional[Type[Cursor]] = ...) -> Cursor: ... - def __enter__(self): ... - def __exit__(self, exc, value, traceback): ... - def query(self, sql): ... - def next_result(self, unbuffered: bool = ...): ... + def query(self, sql, unbuffered: bool = ...) -> int: ... + def next_result(self, unbuffered: bool = ...) -> int: ... def affected_rows(self): ... def kill(self, thread_id): ... - def ping(self, reconnect: bool = ...): ... - def set_charset(self, charset): ... - def read_packet(self, packet_type=...): ... + def ping(self, reconnect: bool = ...) -> None: ... + def set_charset(self, charset) -> None: ... + def connect(self, sock: Optional[SocketType] = ...) -> None: ... + def write_packet(self, payload) -> None: ... + def _read_packet(self, packet_type=...): ... def insert_id(self): ... def thread_id(self): ... def character_set_name(self): ... @@ -140,6 +160,13 @@ class MySQLResult: description: Any rows: Any has_next: Any - def __init__(self, connection): ... + def __init__(self, connection: Connection) -> None: ... first_packet: Any - def read(self): ... + def read(self) -> None: ... + def init_unbuffered_query(self) -> None: ... + +class LoadLocalFile: + filename: Any + connection: Connection + def __init__(self, filename: Any, connection: Connection) -> None: ... + def send_data(self) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/CLIENT.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/CLIENT.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/COMMAND.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/COMMAND.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/ER.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/ER.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/FIELD_TYPE.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/FIELD_TYPE.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/FLAG.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/FLAG.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/SERVER_STATUS.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/SERVER_STATUS.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/__init__.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pymysql/converters.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pymysql/converters.pyi old mode 100755 new mode 100644 index fdd76022..01a25615 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pymysql/converters.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pymysql/converters.pyi @@ -1,6 +1,7 @@ from typing import Any -from .constants import FIELD_TYPE as FIELD_TYPE, FLAG as FLAG + from .charset import charset_by_id as charset_by_id +from .constants import FIELD_TYPE as FIELD_TYPE, FLAG as FLAG PYTHON3: Any ESCAPE_REGEX: Any diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pymysql/cursors.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pymysql/cursors.pyi old mode 100755 new mode 100644 index 48119ccd..b4990195 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pymysql/cursors.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pymysql/cursors.pyi @@ -1,8 +1,9 @@ -from typing import Any, Dict, Iterator, List, Optional, Text, Tuple, TypeVar, Union +from typing import Any, Dict, Iterable, Iterator, List, Optional, Text, Tuple, TypeVar, Union from .connections import Connection -Gen = Union[Tuple[Any, ...], Dict[str, Any]] +_Gen = Union[Tuple[Any, ...], Dict[Text, Any]] +_QueryArgs = Union[Tuple[Any, ...], List[Any], Dict[Text, Any], None] _SelfT = TypeVar("_SelfT") class Cursor: @@ -17,34 +18,35 @@ class Cursor: def __init__(self, connection: Connection) -> None: ... def __del__(self) -> None: ... def close(self) -> None: ... - def setinputsizes(self, *args): ... - def setoutputsizes(self, *args): ... - def nextset(self): ... - def execute(self, query: str, args: Optional[Any] = ...) -> int: ... - def executemany(self, query: str, args) -> int: ... - def callproc(self, procname, args=...): ... - def fetchone(self) -> Optional[Gen]: ... - def fetchmany(self, size: Optional[int] = ...) -> Union[Optional[Gen], List[Gen]]: ... - def fetchall(self) -> Optional[Tuple[Gen, ...]]: ... - def scroll(self, value: int, mode: str = ...): ... - def __iter__(self): ... + def setinputsizes(self, *args) -> None: ... + def setoutputsizes(self, *args) -> None: ... + def nextset(self) -> Optional[bool]: ... + def mogrify(self, query: Text, args: _QueryArgs = ...) -> str: ... + def execute(self, query: Text, args: _QueryArgs = ...) -> int: ... + def executemany(self, query: Text, args: Iterable[_QueryArgs]) -> Optional[int]: ... + def callproc(self, procname: Text, args: Iterable[Any] = ...) -> Any: ... + def fetchone(self) -> Optional[_Gen]: ... + def fetchmany(self, size: Optional[int] = ...) -> Union[Optional[_Gen], List[_Gen]]: ... + def fetchall(self) -> Optional[Tuple[_Gen, ...]]: ... + def scroll(self, value: int, mode: Text = ...) -> None: ... + def __iter__(self) -> Iterator[_Gen]: ... def __enter__(self: _SelfT) -> _SelfT: ... def __exit__(self, *exc_info: Any) -> None: ... class DictCursor(Cursor): - def fetchone(self) -> Optional[Dict[str, Any]]: ... - def fetchmany(self, size: Optional[int] = ...) -> Optional[Tuple[Dict[str, Any], ...]]: ... - def fetchall(self) -> Optional[Tuple[Dict[str, Any], ...]]: ... + def fetchone(self) -> Optional[Dict[Text, Any]]: ... + def fetchmany(self, size: Optional[int] = ...) -> Optional[Tuple[Dict[Text, Any], ...]]: ... + def fetchall(self) -> Optional[Tuple[Dict[Text, Any], ...]]: ... class DictCursorMixin: dict_type: Any class SSCursor(Cursor): # fetchall return type is incompatible with the supertype. - def fetchall(self) -> List[Gen]: ... # type: ignore - def fetchall_unbuffered(self) -> Iterator[Tuple[Gen, ...]]: ... - def __iter__(self) -> Iterator[Tuple[Gen, ...]]: ... - def fetchmany(self, size: Optional[int] = ...) -> List[Gen]: ... - def scroll(self, value: int, mode: str = ...) -> None: ... + def fetchall(self) -> List[_Gen]: ... # type: ignore + def fetchall_unbuffered(self) -> Iterator[_Gen]: ... + def __iter__(self) -> Iterator[_Gen]: ... + def fetchmany(self, size: Optional[int] = ...) -> List[_Gen]: ... + def scroll(self, value: int, mode: Text = ...) -> None: ... class SSDictCursor(DictCursorMixin, SSCursor): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pymysql/err.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pymysql/err.pyi old mode 100755 new mode 100644 index b237af9a..1ef62636 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pymysql/err.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pymysql/err.pyi @@ -1,8 +1,10 @@ +import builtins from typing import Dict, NoReturn, Type + from .constants import ER as ER class MySQLError(Exception): ... -class Warning(MySQLError): ... +class Warning(builtins.Warning, MySQLError): ... class Error(MySQLError): ... class InterfaceError(Error): ... class DatabaseError(Error): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pymysql/times.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pymysql/times.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pymysql/util.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pymysql/util.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/__init__.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/attributes.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/attributes.pyi old mode 100755 new mode 100644 index a2e5088c..2dea1601 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/attributes.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/attributes.pyi @@ -1,11 +1,10 @@ -from typing import Any, Callable, Dict, Generic, Iterable, List, Mapping, Optional, Text, Type, TypeVar, Union, Set - from datetime import datetime +from typing import Any, Callable, Dict, Generic, Iterable, List, Mapping, Optional, Set, Text, Type, TypeVar, Union -_T = TypeVar('_T') -_KT = TypeVar('_KT') -_VT = TypeVar('_VT') -_MT = TypeVar('_MT', bound=MapAttribute[Any, Any]) +_T = TypeVar("_T") +_KT = TypeVar("_KT") +_VT = TypeVar("_VT") +_MT = TypeVar("_MT", bound=MapAttribute[Any, Any]) class Attribute(Generic[_T]): attr_name: Optional[Text] @@ -14,7 +13,14 @@ class Attribute(Generic[_T]): default: Any is_hash_key: bool is_range_key: bool - def __init__(self, hash_key: bool = ..., range_key: bool = ..., null: Optional[bool] = ..., default: Optional[Union[_T, Callable[..., _T]]] = ..., attr_name: Optional[Text] = ...) -> None: ... + def __init__( + self, + hash_key: bool = ..., + range_key: bool = ..., + null: Optional[bool] = ..., + default: Optional[Union[_T, Callable[..., _T]]] = ..., + attr_name: Optional[Text] = ..., + ) -> None: ... def __set__(self, instance: Any, value: Optional[_T]) -> None: ... def serialize(self, value: Any) -> Any: ... def deserialize(self, value: Any) -> Any: ... @@ -75,9 +81,17 @@ class NullAttribute(Attribute[None]): class MapAttributeMeta(type): def __init__(self, name, bases, attrs) -> None: ... -class MapAttribute(Generic[_KT, _VT], Attribute[Mapping[_KT, _VT]], metaclass=MapAttributeMeta): +class MapAttribute(Attribute[Mapping[_KT, _VT]], metaclass=MapAttributeMeta): attribute_values: Any - def __init__(self, hash_key: bool = ..., range_key: bool = ..., null: Optional[bool] = ..., default: Optional[Union[Any, Callable[..., Any]]] = ..., attr_name: Optional[Text] = ..., **attrs) -> None: ... + def __init__( + self, + hash_key: bool = ..., + range_key: bool = ..., + null: Optional[bool] = ..., + default: Optional[Union[Any, Callable[..., Any]]] = ..., + attr_name: Optional[Text] = ..., + **attrs, + ) -> None: ... def __iter__(self) -> Iterable[_VT]: ... def __getattr__(self, attr: str) -> _VT: ... def __getitem__(self, item: _KT) -> _VT: ... @@ -86,9 +100,17 @@ class MapAttribute(Generic[_KT, _VT], Attribute[Mapping[_KT, _VT]], metaclass=Ma def is_type_safe(self, key: Any, value: Any) -> bool: ... def validate(self) -> bool: ... -class ListAttribute(Generic[_T], Attribute[List[_T]]): +class ListAttribute(Attribute[List[_T]]): element_type: Any - def __init__(self, hash_key: bool = ..., range_key: bool = ..., null: Optional[bool] = ..., default: Optional[Union[Any, Callable[..., Any]]] = ..., attr_name: Optional[Text] = ..., of: Optional[Type[_T]] = ...) -> None: ... + def __init__( + self, + hash_key: bool = ..., + range_key: bool = ..., + null: Optional[bool] = ..., + default: Optional[Union[Any, Callable[..., Any]]] = ..., + attr_name: Optional[Text] = ..., + of: Optional[Type[_T]] = ..., + ) -> None: ... def __get__(self, instance: Any, owner: Any) -> List[_T]: ... DESERIALIZE_CLASS_MAP: Dict[Text, Attribute[Any]] diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/connection/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/connection/__init__.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/connection/base.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/connection/base.pyi old mode 100755 new mode 100644 index 71c9d74f..05e6b2eb --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/connection/base.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/connection/base.pyi @@ -20,9 +20,15 @@ class Connection: host: Any region: Any session_cls: Any - def __init__(self, region: Optional[Any] = ..., host: Optional[Any] = ..., session_cls: Optional[Any] = ..., - request_timeout_seconds: Optional[Any] = ..., max_retry_attempts: Optional[Any] = ..., - base_backoff_ms: Optional[Any] = ...) -> None: ... + def __init__( + self, + region: Optional[Any] = ..., + host: Optional[Any] = ..., + session_cls: Optional[Any] = ..., + request_timeout_seconds: Optional[Any] = ..., + max_retry_attempts: Optional[Any] = ..., + base_backoff_ms: Optional[Any] = ..., + ) -> None: ... def dispatch(self, operation_name, operation_kwargs): ... @property def session(self): ... @@ -31,13 +37,25 @@ class Connection: @property def client(self): ... def get_meta_table(self, table_name: Text, refresh: bool = ...): ... - def create_table(self, table_name: Text, attribute_definitions: Optional[Any] = ..., key_schema: Optional[Any] = ..., - read_capacity_units: Optional[Any] = ..., write_capacity_units: Optional[Any] = ..., - global_secondary_indexes: Optional[Any] = ..., local_secondary_indexes: Optional[Any] = ..., - stream_specification: Optional[Any] = ...): ... + def create_table( + self, + table_name: Text, + attribute_definitions: Optional[Any] = ..., + key_schema: Optional[Any] = ..., + read_capacity_units: Optional[Any] = ..., + write_capacity_units: Optional[Any] = ..., + global_secondary_indexes: Optional[Any] = ..., + local_secondary_indexes: Optional[Any] = ..., + stream_specification: Optional[Any] = ..., + ): ... def delete_table(self, table_name: Text): ... - def update_table(self, table_name: Text, read_capacity_units: Optional[Any] = ..., write_capacity_units: Optional[Any] = ..., - global_secondary_index_updates: Optional[Any] = ...): ... + def update_table( + self, + table_name: Text, + read_capacity_units: Optional[Any] = ..., + write_capacity_units: Optional[Any] = ..., + global_secondary_index_updates: Optional[Any] = ..., + ): ... def list_tables(self, exclusive_start_table_name: Optional[Any] = ..., limit: Optional[Any] = ...): ... def describe_table(self, table_name: Text): ... def get_conditional_operator(self, operator): ... @@ -51,28 +69,90 @@ class Connection: def get_return_values_map(self, return_values): ... def get_item_collection_map(self, return_item_collection_metrics): ... def get_exclusive_start_key_map(self, table_name: Text, exclusive_start_key): ... - def delete_item(self, table_name: Text, hash_key, range_key: Optional[Any] = ..., expected: Optional[Any] = ..., - conditional_operator: Optional[Any] = ..., return_values: Optional[Any] = ..., - return_consumed_capacity: Optional[Any] = ..., return_item_collection_metrics: Optional[Any] = ...): ... - def update_item(self, table_name: Text, hash_key, range_key: Optional[Any] = ..., attribute_updates: Optional[Any] = ..., - expected: Optional[Any] = ..., return_consumed_capacity: Optional[Any] = ..., - conditional_operator: Optional[Any] = ..., return_item_collection_metrics: Optional[Any] = ..., - return_values: Optional[Any] = ...): ... - def put_item(self, table_name: Text, hash_key, range_key: Optional[Any] = ..., attributes: Optional[Any] = ..., - expected: Optional[Any] = ..., conditional_operator: Optional[Any] = ..., return_values: Optional[Any] = ..., - return_consumed_capacity: Optional[Any] = ..., return_item_collection_metrics: Optional[Any] = ...): ... - def batch_write_item(self, table_name: Text, put_items: Optional[Any] = ..., delete_items: Optional[Any] = ..., - return_consumed_capacity: Optional[Any] = ..., return_item_collection_metrics: Optional[Any] = ...): ... - def batch_get_item(self, table_name: Text, keys, consistent_read: Optional[Any] = ..., - return_consumed_capacity: Optional[Any] = ..., attributes_to_get: Optional[Any] = ...): ... - def get_item(self, table_name: Text, hash_key, range_key: Optional[Any] = ..., consistent_read: bool = ..., - attributes_to_get: Optional[Any] = ...): ... - def scan(self, table_name: Text, attributes_to_get: Optional[Any] = ..., limit: Optional[Any] = ..., - conditional_operator: Optional[Any] = ..., scan_filter: Optional[Any] = ..., - return_consumed_capacity: Optional[Any] = ..., exclusive_start_key: Optional[Any] = ..., - segment: Optional[Any] = ..., total_segments: Optional[Any] = ...): ... - def query(self, table_name: Text, hash_key, attributes_to_get: Optional[Any] = ..., consistent_read: bool = ..., - exclusive_start_key: Optional[Any] = ..., index_name: Optional[Any] = ..., key_conditions: Optional[Any] = ..., - query_filters: Optional[Any] = ..., conditional_operator: Optional[Any] = ..., limit: Optional[Any] = ..., - return_consumed_capacity: Optional[Any] = ..., scan_index_forward: Optional[Any] = ..., - select: Optional[Any] = ...): ... + def delete_item( + self, + table_name: Text, + hash_key, + range_key: Optional[Any] = ..., + expected: Optional[Any] = ..., + conditional_operator: Optional[Any] = ..., + return_values: Optional[Any] = ..., + return_consumed_capacity: Optional[Any] = ..., + return_item_collection_metrics: Optional[Any] = ..., + ): ... + def update_item( + self, + table_name: Text, + hash_key, + range_key: Optional[Any] = ..., + attribute_updates: Optional[Any] = ..., + expected: Optional[Any] = ..., + return_consumed_capacity: Optional[Any] = ..., + conditional_operator: Optional[Any] = ..., + return_item_collection_metrics: Optional[Any] = ..., + return_values: Optional[Any] = ..., + ): ... + def put_item( + self, + table_name: Text, + hash_key, + range_key: Optional[Any] = ..., + attributes: Optional[Any] = ..., + expected: Optional[Any] = ..., + conditional_operator: Optional[Any] = ..., + return_values: Optional[Any] = ..., + return_consumed_capacity: Optional[Any] = ..., + return_item_collection_metrics: Optional[Any] = ..., + ): ... + def batch_write_item( + self, + table_name: Text, + put_items: Optional[Any] = ..., + delete_items: Optional[Any] = ..., + return_consumed_capacity: Optional[Any] = ..., + return_item_collection_metrics: Optional[Any] = ..., + ): ... + def batch_get_item( + self, + table_name: Text, + keys, + consistent_read: Optional[Any] = ..., + return_consumed_capacity: Optional[Any] = ..., + attributes_to_get: Optional[Any] = ..., + ): ... + def get_item( + self, + table_name: Text, + hash_key, + range_key: Optional[Any] = ..., + consistent_read: bool = ..., + attributes_to_get: Optional[Any] = ..., + ): ... + def scan( + self, + table_name: Text, + attributes_to_get: Optional[Any] = ..., + limit: Optional[Any] = ..., + conditional_operator: Optional[Any] = ..., + scan_filter: Optional[Any] = ..., + return_consumed_capacity: Optional[Any] = ..., + exclusive_start_key: Optional[Any] = ..., + segment: Optional[Any] = ..., + total_segments: Optional[Any] = ..., + ): ... + def query( + self, + table_name: Text, + hash_key, + attributes_to_get: Optional[Any] = ..., + consistent_read: bool = ..., + exclusive_start_key: Optional[Any] = ..., + index_name: Optional[Any] = ..., + key_conditions: Optional[Any] = ..., + query_filters: Optional[Any] = ..., + conditional_operator: Optional[Any] = ..., + limit: Optional[Any] = ..., + return_consumed_capacity: Optional[Any] = ..., + scan_index_forward: Optional[Any] = ..., + select: Optional[Any] = ..., + ): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/connection/table.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/connection/table.pyi old mode 100755 new mode 100644 index 0f820af9..2d67c9d4 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/connection/table.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/connection/table.pyi @@ -3,16 +3,106 @@ from typing import Any, Optional class TableConnection: table_name: Any connection: Any - def __init__(self, table_name, region: Optional[Any] = ..., host: Optional[Any] = ..., session_cls: Optional[Any] = ..., request_timeout_seconds: Optional[Any] = ..., max_retry_attempts: Optional[Any] = ..., base_backoff_ms: Optional[Any] = ...) -> None: ... - def delete_item(self, hash_key, range_key: Optional[Any] = ..., expected: Optional[Any] = ..., conditional_operator: Optional[Any] = ..., return_values: Optional[Any] = ..., return_consumed_capacity: Optional[Any] = ..., return_item_collection_metrics: Optional[Any] = ...): ... - def update_item(self, hash_key, range_key: Optional[Any] = ..., attribute_updates: Optional[Any] = ..., expected: Optional[Any] = ..., conditional_operator: Optional[Any] = ..., return_consumed_capacity: Optional[Any] = ..., return_item_collection_metrics: Optional[Any] = ..., return_values: Optional[Any] = ...): ... - def put_item(self, hash_key, range_key: Optional[Any] = ..., attributes: Optional[Any] = ..., expected: Optional[Any] = ..., conditional_operator: Optional[Any] = ..., return_values: Optional[Any] = ..., return_consumed_capacity: Optional[Any] = ..., return_item_collection_metrics: Optional[Any] = ...): ... - def batch_write_item(self, put_items: Optional[Any] = ..., delete_items: Optional[Any] = ..., return_consumed_capacity: Optional[Any] = ..., return_item_collection_metrics: Optional[Any] = ...): ... - def batch_get_item(self, keys, consistent_read: Optional[Any] = ..., return_consumed_capacity: Optional[Any] = ..., attributes_to_get: Optional[Any] = ...): ... - def get_item(self, hash_key, range_key: Optional[Any] = ..., consistent_read: bool = ..., attributes_to_get: Optional[Any] = ...): ... - def scan(self, attributes_to_get: Optional[Any] = ..., limit: Optional[Any] = ..., conditional_operator: Optional[Any] = ..., scan_filter: Optional[Any] = ..., return_consumed_capacity: Optional[Any] = ..., segment: Optional[Any] = ..., total_segments: Optional[Any] = ..., exclusive_start_key: Optional[Any] = ...): ... - def query(self, hash_key, attributes_to_get: Optional[Any] = ..., consistent_read: bool = ..., exclusive_start_key: Optional[Any] = ..., index_name: Optional[Any] = ..., key_conditions: Optional[Any] = ..., query_filters: Optional[Any] = ..., limit: Optional[Any] = ..., return_consumed_capacity: Optional[Any] = ..., scan_index_forward: Optional[Any] = ..., conditional_operator: Optional[Any] = ..., select: Optional[Any] = ...): ... + def __init__( + self, + table_name, + region: Optional[Any] = ..., + host: Optional[Any] = ..., + session_cls: Optional[Any] = ..., + request_timeout_seconds: Optional[Any] = ..., + max_retry_attempts: Optional[Any] = ..., + base_backoff_ms: Optional[Any] = ..., + ) -> None: ... + def delete_item( + self, + hash_key, + range_key: Optional[Any] = ..., + expected: Optional[Any] = ..., + conditional_operator: Optional[Any] = ..., + return_values: Optional[Any] = ..., + return_consumed_capacity: Optional[Any] = ..., + return_item_collection_metrics: Optional[Any] = ..., + ): ... + def update_item( + self, + hash_key, + range_key: Optional[Any] = ..., + attribute_updates: Optional[Any] = ..., + expected: Optional[Any] = ..., + conditional_operator: Optional[Any] = ..., + return_consumed_capacity: Optional[Any] = ..., + return_item_collection_metrics: Optional[Any] = ..., + return_values: Optional[Any] = ..., + ): ... + def put_item( + self, + hash_key, + range_key: Optional[Any] = ..., + attributes: Optional[Any] = ..., + expected: Optional[Any] = ..., + conditional_operator: Optional[Any] = ..., + return_values: Optional[Any] = ..., + return_consumed_capacity: Optional[Any] = ..., + return_item_collection_metrics: Optional[Any] = ..., + ): ... + def batch_write_item( + self, + put_items: Optional[Any] = ..., + delete_items: Optional[Any] = ..., + return_consumed_capacity: Optional[Any] = ..., + return_item_collection_metrics: Optional[Any] = ..., + ): ... + def batch_get_item( + self, + keys, + consistent_read: Optional[Any] = ..., + return_consumed_capacity: Optional[Any] = ..., + attributes_to_get: Optional[Any] = ..., + ): ... + def get_item( + self, hash_key, range_key: Optional[Any] = ..., consistent_read: bool = ..., attributes_to_get: Optional[Any] = ... + ): ... + def scan( + self, + attributes_to_get: Optional[Any] = ..., + limit: Optional[Any] = ..., + conditional_operator: Optional[Any] = ..., + scan_filter: Optional[Any] = ..., + return_consumed_capacity: Optional[Any] = ..., + segment: Optional[Any] = ..., + total_segments: Optional[Any] = ..., + exclusive_start_key: Optional[Any] = ..., + ): ... + def query( + self, + hash_key, + attributes_to_get: Optional[Any] = ..., + consistent_read: bool = ..., + exclusive_start_key: Optional[Any] = ..., + index_name: Optional[Any] = ..., + key_conditions: Optional[Any] = ..., + query_filters: Optional[Any] = ..., + limit: Optional[Any] = ..., + return_consumed_capacity: Optional[Any] = ..., + scan_index_forward: Optional[Any] = ..., + conditional_operator: Optional[Any] = ..., + select: Optional[Any] = ..., + ): ... def describe_table(self): ... def delete_table(self): ... - def update_table(self, read_capacity_units: Optional[Any] = ..., write_capacity_units: Optional[Any] = ..., global_secondary_index_updates: Optional[Any] = ...): ... - def create_table(self, attribute_definitions: Optional[Any] = ..., key_schema: Optional[Any] = ..., read_capacity_units: Optional[Any] = ..., write_capacity_units: Optional[Any] = ..., global_secondary_indexes: Optional[Any] = ..., local_secondary_indexes: Optional[Any] = ..., stream_specification: Optional[Any] = ...): ... + def update_table( + self, + read_capacity_units: Optional[Any] = ..., + write_capacity_units: Optional[Any] = ..., + global_secondary_index_updates: Optional[Any] = ..., + ): ... + def create_table( + self, + attribute_definitions: Optional[Any] = ..., + key_schema: Optional[Any] = ..., + read_capacity_units: Optional[Any] = ..., + write_capacity_units: Optional[Any] = ..., + global_secondary_indexes: Optional[Any] = ..., + local_secondary_indexes: Optional[Any] = ..., + stream_specification: Optional[Any] = ..., + ): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/connection/util.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/connection/util.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/constants.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/constants.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/exceptions.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/exceptions.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/indexes.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/indexes.pyi old mode 100755 new mode 100644 index 66e8ae77..99db1146 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/indexes.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/indexes.pyi @@ -9,7 +9,16 @@ class Index(metaclass=IndexMeta): @classmethod def count(cls, hash_key, consistent_read: bool = ..., **filters) -> int: ... @classmethod - def query(self, hash_key, scan_index_forward: Optional[Any] = ..., consistent_read: bool = ..., limit: Optional[Any] = ..., last_evaluated_key: Optional[Any] = ..., attributes_to_get: Optional[Any] = ..., **filters): ... + def query( + cls, + hash_key, + scan_index_forward: Optional[Any] = ..., + consistent_read: bool = ..., + limit: Optional[Any] = ..., + last_evaluated_key: Optional[Any] = ..., + attributes_to_get: Optional[Any] = ..., + **filters, + ): ... class GlobalSecondaryIndex(Index): ... class LocalSecondaryIndex(Index): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/models.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/models.pyi old mode 100755 new mode 100644 index cf181395..023a2eef --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/models.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/models.pyi @@ -1,6 +1,7 @@ +from typing import Any, Dict, Generic, Iterable, Iterator, List, Optional, Sequence, Text, Tuple, Type, TypeVar, Union + from .attributes import Attribute from .exceptions import DoesNotExist as DoesNotExist -from typing import Any, Dict, Generic, Iterable, Iterator, List, Optional, Sequence, Tuple, Type, TypeVar, Text, Union log: Any @@ -16,7 +17,7 @@ class ResultSet(object): class MetaModel(type): def __init__(self, name: Text, bases: Tuple[type, ...], attrs: Dict[Any, Any]) -> None: ... -_T = TypeVar('_T', bound='Model') +_T = TypeVar("_T", bound="Model") KeyType = Union[Text, bytes, float, int, Tuple[Any, ...]] class Model(metaclass=MetaModel): @@ -26,22 +27,62 @@ class Model(metaclass=MetaModel): @classmethod def has_map_or_list_attributes(cls: Type[_T]) -> bool: ... @classmethod - def batch_get(cls: Type[_T], items: Iterable[Union[KeyType, Iterable[KeyType]]], consistent_read: Optional[bool] = ..., attributes_to_get: Optional[Sequence[Text]] = ...) -> Iterator[_T]: ... + def batch_get( + cls: Type[_T], + items: Iterable[Union[KeyType, Iterable[KeyType]]], + consistent_read: Optional[bool] = ..., + attributes_to_get: Optional[Sequence[Text]] = ..., + ) -> Iterator[_T]: ... @classmethod def batch_write(cls: Type[_T], auto_commit: bool = ...) -> BatchWrite[_T]: ... def delete(self, condition: Optional[Any] = ..., conditional_operator: Optional[Text] = ..., **expected_values) -> Any: ... - def update(self, attributes: Optional[Dict[Text, Dict[Text, Any]]] = ..., actions: Optional[List[Any]] = ..., condition: Optional[Any] = ..., conditional_operator: Optional[Text] = ..., **expected_values) -> Any: ... - def update_item(self, attribute: Text, value: Optional[Any] = ..., action: Optional[Text] = ..., conditional_operator: Optional[Text] = ..., **expected_values): ... - def save(self, condition: Optional[Any] = ..., conditional_operator: Optional[Text] = ..., **expected_values) -> Dict[str, Any]: ... + def update( + self, + attributes: Optional[Dict[Text, Dict[Text, Any]]] = ..., + actions: Optional[List[Any]] = ..., + condition: Optional[Any] = ..., + conditional_operator: Optional[Text] = ..., + **expected_values, + ) -> Any: ... + def update_item( + self, + attribute: Text, + value: Optional[Any] = ..., + action: Optional[Text] = ..., + conditional_operator: Optional[Text] = ..., + **expected_values, + ): ... + def save( + self, condition: Optional[Any] = ..., conditional_operator: Optional[Text] = ..., **expected_values + ) -> Dict[str, Any]: ... def refresh(self, consistent_read: bool = ...): ... @classmethod def get(cls: Type[_T], hash_key: KeyType, range_key: Optional[KeyType] = ..., consistent_read: bool = ...) -> _T: ... @classmethod def from_raw_data(cls: Type[_T], data) -> _T: ... @classmethod - def count(cls: Type[_T], hash_key: Optional[KeyType] = ..., consistent_read: bool = ..., index_name: Optional[Text] = ..., limit: Optional[int] = ..., **filters) -> int: ... + def count( + cls: Type[_T], + hash_key: Optional[KeyType] = ..., + consistent_read: bool = ..., + index_name: Optional[Text] = ..., + limit: Optional[int] = ..., + **filters, + ) -> int: ... @classmethod - def query(cls: Type[_T], hash_key: KeyType, consistent_read: bool = ..., index_name: Optional[Text] = ..., scan_index_forward: Optional[Any] = ..., conditional_operator: Optional[Text] = ..., limit: Optional[int] = ..., last_evaluated_key: Optional[Any] = ..., attributes_to_get: Optional[Iterable[Text]] = ..., page_size: Optional[int] = ..., **filters) -> Iterator[_T]: ... + def query( + cls: Type[_T], + hash_key: KeyType, + consistent_read: bool = ..., + index_name: Optional[Text] = ..., + scan_index_forward: Optional[Any] = ..., + conditional_operator: Optional[Text] = ..., + limit: Optional[int] = ..., + last_evaluated_key: Optional[Any] = ..., + attributes_to_get: Optional[Iterable[Text]] = ..., + page_size: Optional[int] = ..., + **filters, + ) -> Iterator[_T]: ... @classmethod def rate_limited_scan( cls: Type[_T], @@ -61,10 +102,19 @@ class Model(metaclass=MetaModel): max_consecutive_exceptions: int = ..., consistent_read: Optional[bool] = ..., index_name: Optional[str] = ..., - **filters: Any + **filters: Any, ) -> Iterator[_T]: ... @classmethod - def scan(cls: Type[_T], segment: Optional[int] = ..., total_segments: Optional[int] = ..., limit: Optional[int] = ..., conditional_operator: Optional[Text] = ..., last_evaluated_key: Optional[Any] = ..., page_size: Optional[int] = ..., **filters) -> Iterator[_T]: ... + def scan( + cls: Type[_T], + segment: Optional[int] = ..., + total_segments: Optional[int] = ..., + limit: Optional[int] = ..., + conditional_operator: Optional[Text] = ..., + last_evaluated_key: Optional[Any] = ..., + page_size: Optional[int] = ..., + **filters, + ) -> Iterator[_T]: ... @classmethod def exists(cls: Type[_T]) -> bool: ... @classmethod @@ -72,7 +122,9 @@ class Model(metaclass=MetaModel): @classmethod def describe_table(cls): ... @classmethod - def create_table(cls: Type[_T], wait: bool = ..., read_capacity_units: Optional[Any] = ..., write_capacity_units: Optional[Any] = ...): ... + def create_table( + cls: Type[_T], wait: bool = ..., read_capacity_units: Optional[Any] = ..., write_capacity_units: Optional[Any] = ... + ): ... @classmethod def dumps(cls): ... @classmethod @@ -98,7 +150,7 @@ class ModelContextManager(Generic[_T]): def __init__(self, model: Type[_T], auto_commit: bool = ...) -> None: ... def __enter__(self) -> ModelContextManager[_T]: ... -class BatchWrite(Generic[_T], ModelContextManager[_T]): +class BatchWrite(ModelContextManager[_T]): def save(self, put_item: _T) -> None: ... def delete(self, del_item: _T) -> None: ... def __enter__(self) -> BatchWrite[_T]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/settings.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/settings.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/throttle.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/throttle.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/types.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pynamodb/types.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pyre_extensions.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pyre_extensions.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pytz/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pytz/__init__.pyi old mode 100755 new mode 100644 index 2fa91d20..10423da4 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pytz/__init__.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/pytz/__init__.pyi @@ -1,5 +1,5 @@ -from typing import Optional, List, Set, Mapping, Union import datetime +from typing import List, Mapping, Optional, Set, Union class BaseTzInfo(datetime.tzinfo): zone: str = ... @@ -28,6 +28,7 @@ class NonExistentTimeError(InvalidTimeError): ... utc: _UTCclass UTC: _UTCclass + def timezone(zone: str) -> Union[_UTCclass, _StaticTzInfo, _DstTzInfo]: ... def FixedOffset(offset: int) -> Union[_UTCclass, datetime.tzinfo]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/redis/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/redis/__init__.pyi old mode 100755 new mode 100644 index 333de49b..07191af8 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/redis/__init__.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/redis/__init__.pyi @@ -1,7 +1,4 @@ -from . import client -from . import connection -from . import utils -from . import exceptions +from . import client, connection, exceptions, utils Redis = client.Redis StrictRedis = client.StrictRedis diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/redis/client.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/redis/client.pyi old mode 100755 new mode 100644 index 6875ccf8..39599a94 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/redis/client.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/redis/client.pyi @@ -1,5 +1,23 @@ from datetime import timedelta -from typing import Any, Iterable, Text, Optional, Mapping, Tuple, Union, Callable, List, Dict +from typing import ( + Any, + Callable, + Dict, + Generic, + Iterable, + Iterator, + List, + Mapping, + Optional, + Sequence, + Set, + Text, + Tuple, + TypeVar, + Union, + overload, +) +from typing_extensions import Literal from .connection import ConnectionPool @@ -34,16 +52,146 @@ def parse_hscan(response, **options): ... def parse_zscan(response, **options): ... def parse_slowlog_get(response, **options): ... -_Str = Union[bytes, float, int, Text] +_Value = Union[bytes, float, int, Text] +_Key = Union[Text, bytes] -class Redis(object): +# Lib returns str or bytes depending on Python version and value of decode_responses +_StrType = TypeVar("_StrType", bound=Union[Text, bytes]) + +class Redis(Generic[_StrType]): RESPONSE_CALLBACKS: Any + @overload + @classmethod + def from_url( + cls, + url: Text, + host: Optional[Text] = ..., + port: Optional[int] = ..., + db: Optional[int] = ..., + password: Optional[Text] = ..., + socket_timeout: Optional[float] = ..., + socket_connect_timeout: Optional[float] = ..., + socket_keepalive: Optional[bool] = ..., + socket_keepalive_options: Optional[Mapping[str, Union[int, str]]] = ..., + connection_pool: Optional[ConnectionPool] = ..., + unix_socket_path: Optional[Text] = ..., + encoding: Text = ..., + encoding_errors: Text = ..., + charset: Optional[Text] = ..., + errors: Optional[Text] = ..., + decode_responses: Optional[bool] = ..., + retry_on_timeout: bool = ..., + ssl: bool = ..., + ssl_keyfile: Optional[Text] = ..., + ssl_certfile: Optional[Text] = ..., + ssl_cert_reqs: Optional[Union[str, int]] = ..., + ssl_ca_certs: Optional[Text] = ..., + ssl_check_hostname: bool = ..., + max_connections: Optional[int] = ..., + single_connection_client: bool = ..., + health_check_interval: float = ..., + client_name: Optional[Text] = ..., + username: Optional[Text] = ..., + ) -> Redis[bytes]: ... + @overload @classmethod - def from_url(cls, url: Text, db: Optional[int] = ..., **kwargs) -> Redis: ... + def from_url( + cls, + url: Text, + host: Optional[Text] = ..., + port: Optional[int] = ..., + db: Optional[int] = ..., + password: Optional[Text] = ..., + socket_timeout: Optional[float] = ..., + socket_connect_timeout: Optional[float] = ..., + socket_keepalive: Optional[bool] = ..., + socket_keepalive_options: Optional[Mapping[str, Union[int, str]]] = ..., + connection_pool: Optional[ConnectionPool] = ..., + unix_socket_path: Optional[Text] = ..., + encoding: Text = ..., + encoding_errors: Text = ..., + charset: Optional[Text] = ..., + decode_responses: Literal[True] = ..., + errors: Optional[Text] = ..., + retry_on_timeout: bool = ..., + ssl: bool = ..., + ssl_keyfile: Optional[Text] = ..., + ssl_certfile: Optional[Text] = ..., + ssl_cert_reqs: Optional[Union[str, int]] = ..., + ssl_ca_certs: Optional[Text] = ..., + ssl_check_hostname: bool = ..., + max_connections: Optional[int] = ..., + single_connection_client: bool = ..., + health_check_interval: float = ..., + client_name: Optional[Text] = ..., + username: Optional[Text] = ..., + ) -> Redis[str]: ... connection_pool: Any response_callbacks: Any + @overload + def __new__( + cls, + host: Text = ..., + port: int = ..., + db: int = ..., + password: Optional[Text] = ..., + socket_timeout: Optional[float] = ..., + socket_connect_timeout: Optional[float] = ..., + socket_keepalive: Optional[bool] = ..., + socket_keepalive_options: Optional[Mapping[str, Union[int, str]]] = ..., + connection_pool: Optional[ConnectionPool] = ..., + unix_socket_path: Optional[Text] = ..., + encoding: Text = ..., + encoding_errors: Text = ..., + charset: Optional[Text] = ..., + errors: Optional[Text] = ..., + retry_on_timeout: bool = ..., + ssl: bool = ..., + ssl_keyfile: Optional[Text] = ..., + ssl_certfile: Optional[Text] = ..., + ssl_cert_reqs: Optional[Union[str, int]] = ..., + ssl_ca_certs: Optional[Text] = ..., + ssl_check_hostname: bool = ..., + max_connections: Optional[int] = ..., + single_connection_client: bool = ..., + health_check_interval: float = ..., + client_name: Optional[Text] = ..., + username: Optional[Text] = ..., + ) -> Redis[bytes]: ... + @overload + def __new__( + cls, + host: Text = ..., + port: int = ..., + db: int = ..., + password: Optional[Text] = ..., + socket_timeout: Optional[float] = ..., + socket_connect_timeout: Optional[float] = ..., + socket_keepalive: Optional[bool] = ..., + socket_keepalive_options: Optional[Mapping[str, Union[int, str]]] = ..., + connection_pool: Optional[ConnectionPool] = ..., + unix_socket_path: Optional[Text] = ..., + encoding: Text = ..., + encoding_errors: Text = ..., + charset: Optional[Text] = ..., + errors: Optional[Text] = ..., + decode_responses: Literal[True] = ..., + retry_on_timeout: bool = ..., + ssl: bool = ..., + ssl_keyfile: Optional[Text] = ..., + ssl_certfile: Optional[Text] = ..., + ssl_cert_reqs: Optional[Union[str, int]] = ..., + ssl_ca_certs: Optional[Text] = ..., + ssl_check_hostname: bool = ..., + max_connections: Optional[int] = ..., + single_connection_client: bool = ..., + health_check_interval: float = ..., + client_name: Optional[Text] = ..., + username: Optional[Text] = ..., + ) -> Redis[str]: ... + @overload def __init__( - self, + self: Redis[str], host: Text = ..., port: int = ..., db: int = ..., @@ -58,28 +206,89 @@ class Redis(object): encoding_errors: Text = ..., charset: Optional[Text] = ..., errors: Optional[Text] = ..., - decode_responses: bool = ..., + decode_responses: Literal[True] = ..., retry_on_timeout: bool = ..., ssl: bool = ..., ssl_keyfile: Optional[Text] = ..., ssl_certfile: Optional[Text] = ..., ssl_cert_reqs: Optional[Union[str, int]] = ..., ssl_ca_certs: Optional[Text] = ..., + ssl_check_hostname: bool = ..., max_connections: Optional[int] = ..., + single_connection_client: bool = ..., + health_check_interval: float = ..., + client_name: Optional[Text] = ..., + username: Optional[Text] = ..., + ) -> None: ... + @overload + def __init__( + self: Redis[bytes], + host: Text = ..., + port: int = ..., + db: int = ..., + password: Optional[Text] = ..., + socket_timeout: Optional[float] = ..., + socket_connect_timeout: Optional[float] = ..., + socket_keepalive: Optional[bool] = ..., + socket_keepalive_options: Optional[Mapping[str, Union[int, str]]] = ..., + connection_pool: Optional[ConnectionPool] = ..., + unix_socket_path: Optional[Text] = ..., + encoding: Text = ..., + encoding_errors: Text = ..., + charset: Optional[Text] = ..., + errors: Optional[Text] = ..., + decode_responses: Optional[bool] = ..., + retry_on_timeout: bool = ..., + ssl: bool = ..., + ssl_keyfile: Optional[Text] = ..., + ssl_certfile: Optional[Text] = ..., + ssl_cert_reqs: Optional[Union[str, int]] = ..., + ssl_ca_certs: Optional[Text] = ..., + ssl_check_hostname: bool = ..., + max_connections: Optional[int] = ..., + single_connection_client: bool = ..., + health_check_interval: float = ..., + client_name: Optional[Text] = ..., + username: Optional[Text] = ..., ) -> None: ... def set_response_callback(self, command, callback): ... - def pipeline(self, transaction=..., shard_hint=...): ... + def pipeline(self, transaction: bool = ..., shard_hint: Any = ...) -> Pipeline: ... def transaction(self, func, *watches, **kwargs): ... def lock(self, name, timeout=..., sleep=..., blocking_timeout=..., lock_class=..., thread_local=...): ... def pubsub(self, shard_hint: Any = ..., ignore_subscribe_messages: bool = ...) -> PubSub: ... def execute_command(self, *args, **options): ... def parse_response(self, connection, command_name, **options): ... + def acl_cat(self, category: Optional[Text] = ...) -> List[str]: ... + def acl_deluser(self, username: Text) -> int: ... + def acl_genpass(self) -> Text: ... + def acl_getuser(self, username: Text) -> Optional[Any]: ... + def acl_list(self) -> List[Text]: ... + def acl_load(self) -> bool: ... + def acl_setuser( + self, + username: Text = ..., + enabled: bool = ..., + nopass: bool = ..., + passwords: Optional[Sequence[Text]] = ..., + hashed_passwords: Optional[Sequence[Text]] = ..., + categories: Optional[Sequence[Text]] = ..., + commands: Optional[Sequence[Text]] = ..., + keys: Optional[Sequence[Text]] = ..., + reset: bool = ..., + reset_keys: bool = ..., + reset_passwords: bool = ..., + ) -> bool: ... + def acl_users(self) -> List[Text]: ... + def acl_whoami(self) -> Text: ... def bgrewriteaof(self): ... def bgsave(self): ... - def client_kill(self, address): ... - def client_list(self): ... - def client_getname(self): ... - def client_setname(self, name): ... + def client_id(self) -> int: ... + def client_kill(self, address: Text) -> bool: ... + def client_list(self) -> List[Dict[str, str]]: ... + def client_getname(self) -> Optional[str]: ... + def client_setname(self, name: Text) -> bool: ... + def readwrite(self) -> bool: ... + def readonly(self) -> bool: ... def config_get(self, pattern=...): ... def config_set(self, name, value): ... def config_resetstat(self): ... @@ -89,7 +298,7 @@ class Redis(object): def echo(self, value): ... def flushall(self) -> bool: ... def flushdb(self) -> bool: ... - def info(self, section: Optional[Text] = ...) -> Mapping[str, Any]: ... + def info(self, section: Optional[_Key] = ...) -> Mapping[str, Any]: ... def lastsave(self): ... def object(self, infotype, key): ... def ping(self) -> bool: ... @@ -110,22 +319,22 @@ class Redis(object): def slowlog_reset(self): ... def time(self): ... def append(self, key, value): ... - def bitcount(self, key, start=..., end=...): ... + def bitcount(self, key: _Key, start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... def bitop(self, operation, dest, *keys): ... def bitpos(self, key, bit, start=..., end=...): ... def decr(self, name, amount=...): ... - def delete(self, *names: Text): ... - def __delitem__(self, name): ... + def delete(self, *names: _Key) -> int: ... + def __delitem__(self, _Key): ... def dump(self, name): ... - def exists(self, *names: Text) -> int: ... + def exists(self, *names: _Key) -> int: ... __contains__: Any - def expire(self, name: Union[Text, bytes], time: Union[int, timedelta]) -> bool: ... + def expire(self, name: _Key, time: Union[int, timedelta]) -> bool: ... def expireat(self, name, when): ... - def get(self, name: Union[Text, bytes]) -> Optional[bytes]: ... + def get(self, name: _Key) -> Optional[_StrType]: ... def __getitem__(self, name): ... - def getbit(self, name, offset): ... + def getbit(self, name: _Key, offset: int) -> int: ... def getrange(self, key, start, end): ... - def getset(self, name, value): ... + def getset(self, name, value) -> Optional[_StrType]: ... def incr(self, name, amount=...): ... def incrby(self, name, amount=...): ... def incrbyfloat(self, name, amount=...): ... @@ -145,62 +354,110 @@ class Redis(object): def restore(self, name, ttl, value): ... def set( self, - name: Union[Text, bytes], - value: _Str, + name: _Key, + value: _Value, ex: Union[None, int, timedelta] = ..., px: Union[None, int, timedelta] = ..., nx: bool = ..., xx: bool = ..., + keepttl: bool = ..., ) -> Optional[bool]: ... def __setitem__(self, name, value): ... - def setbit(self, name, offset, value): ... - def setex(self, name, time, value): ... + def setbit(self, name: _Key, offset: int, value: int) -> int: ... + def setex(self, name: _Key, time: Union[int, timedelta], value: _Value) -> bool: ... def setnx(self, name, value): ... def setrange(self, name, offset, value): ... def strlen(self, name): ... def substr(self, name, start, end=...): ... - def ttl(self, name): ... + def ttl(self, name: _Key) -> int: ... def type(self, name): ... def watch(self, *names): ... + def unlink(self, *names: _Key) -> int: ... def unwatch(self): ... - def blpop(self, keys: Union[_Str, Iterable[_Str]], timeout: int = ...) -> Optional[Tuple[bytes, bytes]]: ... - def brpop(self, keys: Union[_Str, Iterable[_Str]], timeout: int = ...) -> Optional[Tuple[bytes, bytes]]: ... + def blpop(self, keys: Union[_Value, Iterable[_Value]], timeout: int = ...) -> Optional[Tuple[_StrType, _StrType]]: ... + def brpop(self, keys: Union[_Value, Iterable[_Value]], timeout: int = ...) -> Optional[Tuple[_StrType, _StrType]]: ... def brpoplpush(self, src, dst, timeout=...): ... - def lindex(self, name, index): ... - def linsert(self, name, where, refvalue, value): ... - def llen(self, name): ... + def lindex(self, name: _Key, index: int) -> Optional[_StrType]: ... + def linsert( + self, name: _Key, where: Literal["BEFORE", "AFTER", "before", "after"], refvalue: _Value, value: _Value + ) -> int: ... + def llen(self, name: _Key) -> int: ... def lpop(self, name): ... - def lpush(self, name: _Str, *values: _Str) -> int: ... + def lpush(self, name: _Value, *values: _Value) -> int: ... def lpushx(self, name, value): ... - def lrange(self, name, start, end): ... - def lrem(self, name, count, value): ... - def lset(self, name, index, value): ... - def ltrim(self, name, start, end): ... + def lrange(self, name: _Key, start: int, end: int) -> List[_StrType]: ... + def lrem(self, name: _Key, count: int, value: _Value) -> int: ... + def lset(self, name: _Key, index: int, value: _Value) -> bool: ... + def ltrim(self, name: _Key, start: int, end: int) -> bool: ... def rpop(self, name): ... def rpoplpush(self, src, dst): ... - def rpush(self, name: _Str, *values: _Str) -> int: ... + def rpush(self, name: _Value, *values: _Value) -> int: ... def rpushx(self, name, value): ... - def sort(self, name, start=..., num=..., by=..., get=..., desc=..., alpha=..., store=..., groups=...): ... - def scan(self, cursor: int = ..., match: Optional[Text] = ..., count: Optional[int] = ...) -> List[Text]: ... - def scan_iter(self, match: Optional[Text] = ..., count: Optional[int] = ...) -> List[Text]: ... - def sscan(self, name, cursor=..., match=..., count=...): ... + @overload + def sort( + self, + name: _Key, + start: Optional[int] = ..., + num: Optional[int] = ..., + by: Optional[_Key] = ..., + get: Optional[Union[_Key, Sequence[_Key]]] = ..., + desc: bool = ..., + alpha: bool = ..., + store: None = ..., + groups: bool = ..., + ) -> List[_StrType]: ... + @overload + def sort( + self, + name: _Key, + start: Optional[int] = ..., + num: Optional[int] = ..., + by: Optional[_Key] = ..., + get: Optional[Union[_Key, Sequence[_Key]]] = ..., + desc: bool = ..., + alpha: bool = ..., + *, + store: _Key, + groups: bool = ..., + ) -> int: ... + @overload + def sort( + self, + name: _Key, + start: Optional[int], + num: Optional[int], + by: Optional[_Key], + get: Optional[Union[_Key, Sequence[_Key]]], + desc: bool, + alpha: bool, + store: _Key, + groups: bool = ..., + ) -> int: ... + def scan(self, cursor: int = ..., match: Optional[_Key] = ..., count: Optional[int] = ...) -> Tuple[int, List[_StrType]]: ... + def scan_iter(self, match: Optional[Text] = ..., count: Optional[int] = ...) -> Iterator[_StrType]: ... + def sscan(self, name: _Key, cursor: int = ..., match: Text = ..., count: int = ...) -> Tuple[int, List[_StrType]]: ... def sscan_iter(self, name, match=..., count=...): ... - def hscan(self, name, cursor=..., match=..., count=...): ... + def hscan( + self, name: _Key, cursor: int = ..., match: Text = ..., count: int = ... + ) -> Tuple[int, Dict[_StrType, _StrType]]: ... def hscan_iter(self, name, match=..., count=...): ... def zscan(self, name, cursor=..., match=..., count=..., score_cast_func=...): ... def zscan_iter(self, name, match=..., count=..., score_cast_func=...): ... - def sadd(self, name, *values): ... - def scard(self, name): ... + def sadd(self, name: _Key, *values: _Value) -> int: ... + def scard(self, name: _Key) -> int: ... def sdiff(self, keys, *args): ... def sdiffstore(self, dest, keys, *args): ... - def sinter(self, keys, *args): ... + def sinter(self, keys: _Key, *args: _Key) -> Set[_Value]: ... def sinterstore(self, dest, keys, *args): ... - def sismember(self, name, value): ... - def smembers(self, name): ... + def sismember(self, name: _Key, value: _Value) -> bool: ... + def smembers(self, name: _Key) -> Set[_Value]: ... def smove(self, src, dst, value): ... - def spop(self, name): ... - def srandmember(self, name, number=...): ... - def srem(self, name, *values): ... + def spop(self, name, count: Optional[int] = ...): ... + @overload + def srandmember(self, name: _Key, number: None = ...) -> Optional[_Value]: ... + @overload + def srandmember(self, name: _Key, number: int) -> List[_Value]: ... + def srem(self, name: _Key, *values: _Value) -> int: ... def sunion(self, keys, *args): ... def sunionstore(self, dest, keys, *args): ... def xack(self, name, groupname, *ids): ... @@ -226,7 +483,7 @@ class Redis(object): def xinfo_consumers(self, name, groupname): ... def xinfo_groups(self, name): ... def xinfo_stream(self, name): ... - def xlen(self, name): ... + def xlen(self, name: _Key) -> int: ... def xpending(self, name, groupname): ... def xpending_range(self, name, groupname, min, max, count, consumername=...): ... def xrange(self, name, min=..., max=..., count=...): ... @@ -234,53 +491,65 @@ class Redis(object): def xreadgroup(self, groupname, consumername, streams, count=..., block=..., noack=...): ... def xrevrange(self, name, max=..., min=..., count=...): ... def xtrim(self, name, maxlen, approximate=...): ... - def zadd(self, name, mapping, nx: bool = ..., xx: bool = ..., ch: bool = ..., incr: bool = ...): ... + def zadd( + self, name: _Key, mapping: Mapping[_Key, _Value], nx: bool = ..., xx: bool = ..., ch: bool = ..., incr: bool = ... + ) -> int: ... def zcard(self, name): ... - def zcount(self, name, min, max): ... + def zcount(self, name: _Key, min: _Value, max: _Value) -> int: ... def zincrby(self, name, value, amount=...): ... def zinterstore(self, dest, keys, aggregate=...): ... def zlexcount(self, name, min, max): ... + def zpopmax(self, name, count=...): ... + def zpopmin(self, name, count=...): ... + def bzpopmax(self, keys, timeout=...): ... + def bzpopmin(self, keys, timeout=...): ... def zrange(self, name, start, end, desc=..., withscores=..., score_cast_func=...): ... def zrangebylex(self, name, min, max, start=..., num=...): ... def zrangebyscore(self, name, min, max, start=..., num=..., withscores=..., score_cast_func=...): ... - def zrank(self, name, value): ... + def zrank(self, name: _Key, value: _Key) -> Optional[int]: ... def zrem(self, name, *values): ... def zremrangebylex(self, name, min, max): ... def zremrangebyrank(self, name, min, max): ... - def zremrangebyscore(self, name, min, max): ... + def zremrangebyscore(self, name: _Key, min: _Value, max: _Value) -> int: ... def zrevrange(self, name, start, end, withscores=..., score_cast_func=...): ... def zrevrangebyscore(self, name, max, min, start=..., num=..., withscores=..., score_cast_func=...): ... def zrevrank(self, name, value): ... def zscore(self, name, value): ... def zunionstore(self, dest, keys, aggregate=...): ... - def pfadd(self, name, *values): ... - def pfcount(self, name): ... - def pfmerge(self, dest, *sources): ... - def hdel(self, name, *keys): ... - def hexists(self, name, key): ... - def hget(self, name, key): ... - def hgetall(self, name): ... - def hincrby(self, name, key, amount=...): ... - def hincrbyfloat(self, name, key, amount=...): ... - def hkeys(self, name): ... - def hlen(self, name): ... - def hset(self, name, key, value): ... - def hsetnx(self, name, key, value): ... - def hmset(self, name, mapping): ... - def hmget(self, name, keys, *args): ... - def hvals(self, name): ... - def publish(self, channel: Text, message: _Str) -> int: ... + def pfadd(self, name: _Key, *values: _Value) -> int: ... + def pfcount(self, name: _Key) -> int: ... + def pfmerge(self, dest: _Key, *sources: _Key) -> bool: ... + def hdel(self, name: _Key, *keys: _Key) -> int: ... + def hexists(self, name: _Key, key: _Key) -> bool: ... + def hget(self, name: _Key, key: _Key) -> Optional[_StrType]: ... + def hgetall(self, name: _Key) -> Dict[_StrType, _StrType]: ... + def hincrby(self, name: _Key, key: _Key, amount: int = ...) -> int: ... + def hincrbyfloat(self, name: _Key, key: _Key, amount: float = ...) -> float: ... + def hkeys(self, name: _Key) -> List[_StrType]: ... + def hlen(self, name: _Key) -> int: ... + def hset( + self, name: _Key, key: Optional[_Key], value: Optional[_Value], mapping: Optional[Mapping[_Value, _Value]] = ... + ) -> int: ... + def hsetnx(self, name: _Key, key: _Key, value: _Value) -> int: ... + def hmset(self, name: _Key, mapping: Mapping[_Value, _Value]) -> bool: ... + def hmget(self, name: _Key, keys: Union[_Key, Iterable[_Key]], *args: _Key) -> List[Optional[_StrType]]: ... + def hvals(self, name: _Key) -> List[_StrType]: ... + def publish(self, channel: _Key, message: _Key) -> int: ... def eval(self, script, numkeys, *keys_and_args): ... def evalsha(self, sha, numkeys, *keys_and_args): ... def script_exists(self, *args): ... def script_flush(self): ... def script_kill(self): ... def script_load(self, script): ... - def register_script(self, script): ... - def pubsub_channels(self, pattern: Text = ...) -> List[Text]: ... - def pubsub_numsub(self, *args: Text) -> List[Tuple[Text, int]]: ... + def register_script(self, script: Union[Text, _StrType]) -> Script: ... + def pubsub_channels(self, pattern: _Key = ...) -> List[Text]: ... + def pubsub_numsub(self, *args: _Key) -> List[Tuple[Text, int]]: ... def pubsub_numpat(self) -> int: ... def monitor(self) -> Monitor: ... + def cluster(self, cluster_arg: str, *args: Any) -> Any: ... + def __enter__(self) -> Redis: ... + def __exit__(self, exc_type, exc_value, traceback): ... + def client(self) -> Redis: ... StrictRedis = Redis @@ -306,14 +575,15 @@ class PubSub: def subscribed(self): ... def execute_command(self, *args, **kwargs): ... def parse_response(self, block=...): ... - def psubscribe(self, *args: Text, **kwargs: Callable[[Any], None]): ... - def punsubscribe(self, *args: Text) -> None: ... - def subscribe(self, *args: Text, **kwargs: Callable[[Any], None]) -> None: ... - def unsubscribe(self, *args: Text) -> None: ... + def psubscribe(self, *args: _Key, **kwargs: Callable[[Any], None]): ... + def punsubscribe(self, *args: _Key) -> None: ... + def subscribe(self, *args: _Key, **kwargs: Callable[[Any], None]) -> None: ... + def unsubscribe(self, *args: _Key) -> None: ... def listen(self): ... def get_message(self, ignore_subscribe_messages: bool = ..., timeout: float = ...) -> Optional[Dict[str, Any]]: ... def handle_message(self, response, ignore_subscribe_messages: bool = ...) -> Optional[Dict[str, Any]]: ... def run_in_thread(self, sleep_time=...): ... + def ping(self, message: Optional[_Value] = ...) -> None: ... class BasePipeline: UNWATCH_COMMANDS: Any @@ -332,7 +602,7 @@ class BasePipeline: scripts: Any explicit_transaction: Any def reset(self): ... - def multi(self): ... + def multi(self) -> None: ... def execute_command(self, *args, **kwargs): ... def immediate_execute_command(self, *args, **options): ... def pipeline_execute_command(self, *args, **options): ... @@ -340,8 +610,8 @@ class BasePipeline: def annotate_exception(self, exception, number, command): ... def parse_response(self, connection, command_name, **options): ... def load_scripts(self): ... - def execute(self, raise_on_error=...): ... - def watch(self, *names): ... + def execute(self, raise_on_error: bool = ...) -> List[Any]: ... + def watch(self, *names: _Key) -> bool: ... def unwatch(self): ... def script_load_for_pipeline(self, script): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/redis/connection.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/redis/connection.pyi old mode 100755 new mode 100644 index 4086b6d9..db30d289 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/redis/connection.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/redis/connection.pyi @@ -1,4 +1,4 @@ -from typing import Any, Text, Optional +from typing import Any, List, Mapping, Optional, Text, Tuple, Type, Union ssl_available: Any hiredis_version: Any @@ -12,10 +12,6 @@ SYM_CRLF: Any SYM_EMPTY: Any SERVER_CLOSED_CONNECTION_ERROR: Any -class Token: - value: Any - def __init__(self, value) -> None: ... - class BaseParser: EXCEPTION_CLASSES: Any def parse_error(self, response): ... @@ -24,13 +20,14 @@ class SocketBuffer: socket_read_size: Any bytes_written: Any bytes_read: Any - def __init__(self, socket, socket_read_size) -> None: ... + def __init__(self, socket, socket_read_size, socket_timeout) -> None: ... @property def length(self): ... def read(self, length): ... def readline(self): ... def purge(self): ... def close(self): ... + def can_read(self, timeout): ... class PythonParser(BaseParser): encoding: Any @@ -39,7 +36,7 @@ class PythonParser(BaseParser): def __del__(self): ... def on_connect(self, connection): ... def on_disconnect(self): ... - def can_read(self): ... + def can_read(self, timeout): ... def read_response(self): ... class HiredisParser(BaseParser): @@ -48,11 +45,17 @@ class HiredisParser(BaseParser): def __del__(self): ... def on_connect(self, connection): ... def on_disconnect(self): ... - def can_read(self): ... + def can_read(self, timeout): ... + def read_from_socket(self, timeout=..., raise_on_timeout: bool = ...) -> bool: ... def read_response(self): ... DefaultParser: Any +class Encoder: + def __init__(self, encoding, encoding_errors, decode_responses: bool) -> None: ... + def encode(self, value: Union[Text, bytes, memoryview, bool, float]) -> bytes: ... + def decode(self, value: Union[Text, bytes, memoryview], force: bool = ...) -> Text: ... + class Connection: description_format: Any pid: Any @@ -68,22 +71,41 @@ class Connection: encoding: Any encoding_errors: Any decode_responses: Any - def __init__(self, host=..., port=..., db=..., password=..., socket_timeout=..., socket_connect_timeout=..., - socket_keepalive=..., socket_keepalive_options=..., retry_on_timeout=..., encoding=..., encoding_errors=..., - decode_responses=..., parser_class=..., socket_read_size=...) -> None: ... + def __init__( + self, + host: Text = ..., + port: int = ..., + db: int = ..., + password: Optional[Text] = ..., + socket_timeout: Optional[float] = ..., + socket_connect_timeout: Optional[float] = ..., + socket_keepalive: bool = ..., + socket_keepalive_options: Optional[Mapping[str, Union[int, str]]] = ..., + socket_type: int = ..., + retry_on_timeout: bool = ..., + encoding: Text = ..., + encoding_errors: Text = ..., + decode_responses: bool = ..., + parser_class: Type[BaseParser] = ..., + socket_read_size: int = ..., + health_check_interval: int = ..., + client_name: Optional[Text] = ..., + username: Optional[Text] = ..., + ) -> None: ... def __del__(self): ... def register_connect_callback(self, callback): ... def clear_connect_callbacks(self): ... def connect(self): ... def on_connect(self): ... def disconnect(self): ... - def send_packed_command(self, command): ... + def check_health(self) -> None: ... + def send_packed_command(self, command, check_health: bool = ...): ... def send_command(self, *args): ... - def can_read(self): ... + def can_read(self, timeout=...): ... def read_response(self): ... - def encode(self, value): ... def pack_command(self, *args): ... def pack_commands(self, commands): ... + def repr_pieces(self) -> List[Tuple[Text, Text]]: ... class SSLConnection(Connection): description_format: Any @@ -91,7 +113,9 @@ class SSLConnection(Connection): certfile: Any cert_reqs: Any ca_certs: Any - def __init__(self, ssl_keyfile=..., ssl_certfile=..., ssl_cert_reqs=..., ssl_ca_certs=..., **kwargs) -> None: ... + def __init__( + self, ssl_keyfile=..., ssl_certfile=..., ssl_cert_reqs=..., ssl_ca_certs=..., ssl_check_hostname: bool = ..., **kwargs + ) -> None: ... class UnixDomainSocketConnection(Connection): description_format: Any @@ -104,12 +128,29 @@ class UnixDomainSocketConnection(Connection): encoding: Any encoding_errors: Any decode_responses: Any - def __init__(self, path=..., db=..., password=..., socket_timeout=..., encoding=..., encoding_errors=..., - decode_responses=..., retry_on_timeout=..., parser_class=..., socket_read_size=...) -> None: ... + def __init__( + self, + path=..., + db: int = ..., + username=..., + password=..., + socket_timeout=..., + encoding=..., + encoding_errors=..., + decode_responses=..., + retry_on_timeout=..., + parser_class=..., + socket_read_size: int = ..., + health_check_interval: int = ..., + client_name=..., + ) -> None: ... + def repr_pieces(self) -> List[Tuple[Text, Text]]: ... + +def to_bool(value: object) -> bool: ... class ConnectionPool: @classmethod - def from_url(cls, url: Text, db: Optional[int] = ..., **kwargs) -> ConnectionPool: ... + def from_url(cls, url: Text, db: Optional[int] = ..., decode_components: bool = ..., **kwargs) -> ConnectionPool: ... connection_class: Any connection_kwargs: Any max_connections: Any @@ -119,7 +160,9 @@ class ConnectionPool: def get_connection(self, command_name, *keys, **options): ... def make_connection(self): ... def release(self, connection): ... - def disconnect(self): ... + def disconnect(self, inuse_connections: bool = ...): ... + def get_encoder(self) -> Encoder: ... + def owns_connection(self, connection: Connection) -> bool: ... class BlockingConnectionPool(ConnectionPool): queue_class: Any diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/redis/exceptions.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/redis/exceptions.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/redis/utils.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/redis/utils.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/__init__.pyi old mode 100755 new mode 100644 index 7705d78b..f9eb4ee1 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/__init__.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/__init__.pyi @@ -1,13 +1,28 @@ -# Stubs for requests (based on version 2.6.0, Python 3) - -from typing import Any -from . import models -from . import api -from . import sessions -from . import status_codes -from . import exceptions -from . import packages import logging +from typing import Any, Text + +from .api import ( + delete as delete, + get as get, + head as head, + options as options, + patch as patch, + post as post, + put as put, + request as request, +) +from .exceptions import ( + ConnectionError as ConnectionError, + HTTPError as HTTPError, + ReadTimeout as ReadTimeout, + RequestException as RequestException, + Timeout as Timeout, + TooManyRedirects as TooManyRedirects, + URLRequired as URLRequired, +) +from .models import PreparedRequest as PreparedRequest, Request as Request, Response as Response +from .sessions import Session as Session, session as session +from .status_codes import codes as codes __title__: Any __build__: Any @@ -15,26 +30,7 @@ __license__: Any __copyright__: Any __version__: Any -Request = models.Request -Response = models.Response -PreparedRequest = models.PreparedRequest -request = api.request -get = api.get -head = api.head -post = api.post -patch = api.patch -put = api.put -delete = api.delete -options = api.options -session = sessions.session -Session = sessions.Session -codes = status_codes.codes -RequestException = exceptions.RequestException -Timeout = exceptions.Timeout -URLRequired = exceptions.URLRequired -TooManyRedirects = exceptions.TooManyRedirects -HTTPError = exceptions.HTTPError -ConnectionError = exceptions.ConnectionError - class NullHandler(logging.Handler): def emit(self, record): ... + +def check_compatibility(urllib3_version: Text, chardet_version: Text) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/adapters.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/adapters.pyi old mode 100755 new mode 100644 index 19005675..d544ca1a --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/adapters.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/adapters.pyi @@ -1,17 +1,8 @@ -# Stubs for requests.adapters (Python 3) +from typing import Any, Container, Mapping, Optional, Text, Tuple, Union -from typing import Any, Container, Union, Text, Tuple, Optional, Mapping -from . import models -from .packages.urllib3 import poolmanager -from .packages.urllib3 import response +from . import cookies, exceptions, models, structures, utils +from .packages.urllib3 import exceptions as urllib3_exceptions, poolmanager, response from .packages.urllib3.util import retry -from . import compat -from . import utils -from . import structures -from .packages.urllib3 import exceptions as urllib3_exceptions -from . import cookies -from . import exceptions -from . import auth PreparedRequest = models.PreparedRequest Response = models.Response @@ -44,13 +35,15 @@ DEFAULT_RETRIES: Any class BaseAdapter: def __init__(self) -> None: ... - def send(self, - request: PreparedRequest, - stream: bool = ..., - timeout: Union[None, float, Tuple[float, float]] = ..., - verify: Union[bool, str] = ..., - cert: Union[None, Union[bytes, Text], Container[Union[bytes, Text]]] = ..., - proxies: Optional[Mapping[str, str]] = ...) -> Response: ... + def send( + self, + request: PreparedRequest, + stream: bool = ..., + timeout: Union[None, float, Tuple[float, float], Tuple[float, None]] = ..., + verify: Union[bool, str] = ..., + cert: Union[None, Union[bytes, Text], Container[Union[bytes, Text]]] = ..., + proxies: Optional[Mapping[str, str]] = ..., + ) -> Response: ... def close(self) -> None: ... class HTTPAdapter(BaseAdapter): @@ -58,8 +51,7 @@ class HTTPAdapter(BaseAdapter): max_retries: Any config: Any proxy_manager: Any - def __init__(self, pool_connections=..., pool_maxsize=..., max_retries=..., - pool_block=...) -> None: ... + def __init__(self, pool_connections=..., pool_maxsize=..., max_retries=..., pool_block=...) -> None: ... poolmanager: Any def init_poolmanager(self, connections, maxsize, block=..., **pool_kwargs): ... def proxy_manager_for(self, proxy, **proxy_kwargs): ... @@ -70,10 +62,12 @@ class HTTPAdapter(BaseAdapter): def request_url(self, request, proxies): ... def add_headers(self, request, **kwargs): ... def proxy_headers(self, proxy): ... - def send(self, - request: PreparedRequest, - stream: bool = ..., - timeout: Union[None, float, Tuple[float, float]] = ..., - verify: Union[bool, str] = ..., - cert: Union[None, Union[bytes, Text], Container[Union[bytes, Text]]] = ..., - proxies: Optional[Mapping[str, str]] = ...) -> Response: ... + def send( + self, + request: PreparedRequest, + stream: bool = ..., + timeout: Union[None, float, Tuple[float, float], Tuple[float, None]] = ..., + verify: Union[bool, str] = ..., + cert: Union[None, Union[bytes, Text], Container[Union[bytes, Text]]] = ..., + proxies: Optional[Mapping[str, str]] = ..., + ) -> Response: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/api.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/api.pyi old mode 100755 new mode 100644 index 1f994aa9..85d46fc2 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/api.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/api.pyi @@ -1,25 +1,21 @@ -# Stubs for requests.api (Python 3) - -import sys -from typing import Optional, Union, Any, Iterable, Mapping, MutableMapping, Tuple, IO, Text +from _typeshed import SupportsItems +from typing import Iterable, Optional, Text, Tuple, Union from .models import Response from .sessions import _Data -_ParamsMappingValueType = Union[Text, bytes, int, float, Iterable[Union[Text, bytes, int, float]]] +_ParamsMappingKeyType = Union[Text, bytes, int, float] +_ParamsMappingValueType = Union[Text, bytes, int, float, Iterable[Union[Text, bytes, int, float]], None] def request(method: str, url: str, **kwargs) -> Response: ... def get( url: Union[Text, bytes], params: Optional[ Union[ - Mapping[Union[Text, bytes, int, float], _ParamsMappingValueType], + SupportsItems[_ParamsMappingKeyType, _ParamsMappingValueType], + Tuple[_ParamsMappingKeyType, _ParamsMappingValueType], + Iterable[Tuple[_ParamsMappingKeyType, _ParamsMappingValueType]], Union[Text, bytes], - Tuple[Union[Text, bytes, int, float], _ParamsMappingValueType], - Mapping[Text, _ParamsMappingValueType], - Mapping[bytes, _ParamsMappingValueType], - Mapping[int, _ParamsMappingValueType], - Mapping[float, _ParamsMappingValueType], ] ] = ..., **kwargs, diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/auth.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/auth.pyi old mode 100755 new mode 100644 index 48d4b08c..7a9def07 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/auth.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/auth.pyi @@ -1,16 +1,10 @@ -# Stubs for requests.auth (Python 3) - from typing import Any, Text, Union -from . import compat -from . import cookies -from . import models -from . import utils -from . import status_codes + +from . import cookies, models, status_codes, utils extract_cookies_to_jar = cookies.extract_cookies_to_jar parse_dict_header = utils.parse_dict_header to_native_string = utils.to_native_string -codes = status_codes.codes CONTENT_TYPE_FORM_URLENCODED: Any CONTENT_TYPE_MULTI_PART: Any @@ -42,3 +36,4 @@ class HTTPDigestAuth(AuthBase): def handle_redirect(self, r, **kwargs): ... def handle_401(self, r, **kwargs): ... def __call__(self, r): ... + def init_per_thread_state(self) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/compat.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/compat.pyi old mode 100755 new mode 100644 index 63b92f6f..3e798351 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/compat.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/compat.pyi @@ -1,6 +1,3 @@ -# Stubs for requests.compat (Python 3.4) - -from typing import Any import collections OrderedDict = collections.OrderedDict diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/cookies.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/cookies.pyi old mode 100755 new mode 100644 index cf25c255..c53d3f61 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/cookies.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/cookies.pyi @@ -1,9 +1,5 @@ -# Stubs for requests.cookies (Python 3) - import sys from typing import Any, MutableMapping -import collections -from . import compat if sys.version_info < (3, 0): from cookielib import CookieJar @@ -60,6 +56,7 @@ class RequestsCookieJar(CookieJar, MutableMapping[Any, Any]): def set_cookie(self, cookie, *args, **kwargs): ... def update(self, other): ... def copy(self): ... + def get_policy(self): ... def create_cookie(name, value, **kwargs): ... def morsel_to_cookie(morsel): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/exceptions.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/exceptions.pyi old mode 100755 new mode 100644 index 36696928..6ad059a3 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/exceptions.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/exceptions.pyi @@ -1,6 +1,5 @@ -# Stubs for requests.exceptions (Python 3) - from typing import Any + from .packages.urllib3.exceptions import HTTPError as BaseHTTPError class RequestException(IOError): @@ -20,7 +19,13 @@ class TooManyRedirects(RequestException): ... class MissingSchema(RequestException, ValueError): ... class InvalidSchema(RequestException, ValueError): ... class InvalidURL(RequestException, ValueError): ... +class InvalidHeader(RequestException, ValueError): ... +class InvalidProxyURL(InvalidURL): ... class ChunkedEncodingError(RequestException): ... class ContentDecodingError(RequestException, BaseHTTPError): ... class StreamConsumedError(RequestException, TypeError): ... class RetryError(RequestException): ... +class UnrewindableBodyError(RequestException): ... +class RequestsWarning(Warning): ... +class FileModeWarning(RequestsWarning, DeprecationWarning): ... +class RequestsDependencyWarning(RequestsWarning): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/hooks.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/hooks.pyi old mode 100755 new mode 100644 index 278076ad..f706016c --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/hooks.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/hooks.pyi @@ -1,5 +1,3 @@ -# Stubs for requests.hooks (Python 3) - from typing import Any HOOKS: Any diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/models.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/models.pyi old mode 100755 new mode 100644 index ee98344c..c47fa0fc --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/models.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/models.pyi @@ -1,24 +1,9 @@ -# Stubs for requests.models (Python 3) - -from typing import (Any, Dict, Iterator, List, MutableMapping, Optional, Text, - Union) import datetime -import types +from typing import Any, Dict, Iterator, List, Optional, Text, Union -from . import hooks -from . import structures -from . import auth -from . import cookies +from . import auth, cookies, exceptions, hooks, status_codes, structures, utils from .cookies import RequestsCookieJar -from .packages.urllib3 import fields -from .packages.urllib3 import filepost -from .packages.urllib3 import util -from .packages.urllib3 import exceptions as urllib3_exceptions -from . import exceptions -from . import utils -from . import compat -from . import status_codes - +from .packages.urllib3 import exceptions as urllib3_exceptions, fields, filepost, util default_hooks = hooks.default_hooks CaseInsensitiveDict = structures.CaseInsensitiveDict @@ -55,7 +40,6 @@ REDIRECT_STATI: Any DEFAULT_REDIRECT_LIMIT: Any CONTENT_CHUNK_SIZE: Any ITER_CHUNK_SIZE: Any -json_dumps: Any class RequestEncodingMixin: @property @@ -76,9 +60,10 @@ class Request(RequestHooksMixin): params: Any auth: Any cookies: Any - def __init__(self, method=..., url=..., headers=..., files=..., data=..., params=..., - auth=..., cookies=..., hooks=..., json=...) -> None: ... - def prepare(self): ... + def __init__( + self, method=..., url=..., headers=..., files=..., data=..., params=..., auth=..., cookies=..., hooks=..., json=... + ) -> None: ... + def prepare(self) -> PreparedRequest: ... class PreparedRequest(RequestEncodingMixin, RequestHooksMixin): method: Optional[Union[str, Text]] @@ -87,22 +72,24 @@ class PreparedRequest(RequestEncodingMixin, RequestHooksMixin): body: Optional[Union[bytes, Text]] hooks: Any def __init__(self) -> None: ... - def prepare(self, method=..., url=..., headers=..., files=..., data=..., params=..., - auth=..., cookies=..., hooks=..., json=...): ... - def copy(self): ... - def prepare_method(self, method): ... - def prepare_url(self, url, params): ... - def prepare_headers(self, headers): ... - def prepare_body(self, data, files, json=...): ... - def prepare_content_length(self, body): ... - def prepare_auth(self, auth, url=...): ... - def prepare_cookies(self, cookies): ... - def prepare_hooks(self, hooks): ... + def prepare( + self, method=..., url=..., headers=..., files=..., data=..., params=..., auth=..., cookies=..., hooks=..., json=... + ) -> None: ... + def copy(self) -> PreparedRequest: ... + def prepare_method(self, method) -> None: ... + def prepare_url(self, url, params) -> None: ... + def prepare_headers(self, headers) -> None: ... + def prepare_body(self, data, files, json=...) -> None: ... + def prepare_content_length(self, body) -> None: ... + def prepare_auth(self, auth, url=...) -> None: ... + def prepare_cookies(self, cookies) -> None: ... + def prepare_hooks(self, hooks) -> None: ... class Response: __attrs__: Any + _content: Optional[bytes] # undocumented status_code: int - headers: MutableMapping[str, str] + headers: CaseInsensitiveDict[str] raw: Any url: str encoding: str @@ -127,12 +114,10 @@ class Response: def is_permanent_redirect(self) -> bool: ... @property def apparent_encoding(self) -> str: ... - def iter_content(self, chunk_size: Optional[int] = ..., - decode_unicode: bool = ...) -> Iterator[Any]: ... - def iter_lines(self, - chunk_size: Optional[int] = ..., - decode_unicode: bool = ..., - delimiter: Union[Text, bytes] = ...) -> Iterator[Any]: ... + def iter_content(self, chunk_size: Optional[int] = ..., decode_unicode: bool = ...) -> Iterator[Any]: ... + def iter_lines( + self, chunk_size: Optional[int] = ..., decode_unicode: bool = ..., delimiter: Optional[Union[Text, bytes]] = ... + ) -> Iterator[Any]: ... @property def content(self) -> bytes: ... @property diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/__init__.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/__init__.pyi old mode 100755 new mode 100644 index f575800c..f63b8fa1 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/__init__.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/__init__.pyi @@ -1,13 +1,8 @@ -from typing import Any -from . import connectionpool -from . import filepost -from . import poolmanager -from . import response -from .util import request as _request -from .util import url -from .util import timeout -from .util import retry import logging +from typing import Any + +from . import connectionpool, filepost, poolmanager, response +from .util import request as _request, retry, timeout, url __license__: Any diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/_collections.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/_collections.pyi old mode 100755 new mode 100644 index b9f1f443..08fa0948 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/_collections.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/_collections.pyi @@ -1,5 +1,5 @@ -from typing import Any, NoReturn, TypeVar from collections import MutableMapping +from typing import Any, NoReturn, TypeVar _KT = TypeVar("_KT") _VT = TypeVar("_VT") diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/connection.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/connection.pyi old mode 100755 new mode 100644 index 99af0278..4ba5ed58 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/connection.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/connection.pyi @@ -1,24 +1,18 @@ -# Stubs for requests.packages.urllib3.connection (Python 3.4) - +import ssl import sys from typing import Any -from . import packages -import ssl -from . import exceptions + +from . import exceptions, util from .packages import ssl_match_hostname from .util import ssl_ -from . import util if sys.version_info < (3, 0): - from httplib import HTTPConnection as _HTTPConnection - from httplib import HTTPException as HTTPException - + from httplib import HTTPConnection as _HTTPConnection, HTTPException as HTTPException class ConnectionError(Exception): ... + else: - from http.client import HTTPConnection as _HTTPConnection - from http.client import HTTPException as HTTPException from builtins import ConnectionError as ConnectionError - + from http.client import HTTPConnection as _HTTPConnection, HTTPException as HTTPException class DummyConnection: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/connectionpool.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/connectionpool.pyi old mode 100755 new mode 100644 index a4e8ac1f..90832482 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/connectionpool.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/connectionpool.pyi @@ -1,19 +1,9 @@ from typing import Any -from . import exceptions + +from . import connection, exceptions, request, response +from .connection import BaseSSLError as BaseSSLError, ConnectionError as ConnectionError, HTTPException as HTTPException from .packages import ssl_match_hostname -from . import packages -from .connection import ( - HTTPException as HTTPException, - BaseSSLError as BaseSSLError, - ConnectionError as ConnectionError, -) -from . import request -from . import response -from . import connection -from .util import connection as _connection -from .util import retry -from .util import timeout -from .util import url +from .util import connection as _connection, retry, timeout, url ClosedPoolError = exceptions.ClosedPoolError ProtocolError = exceptions.ProtocolError @@ -65,10 +55,36 @@ class HTTPConnectionPool(ConnectionPool, RequestMethods): num_connections: Any num_requests: Any conn_kw: Any - def __init__(self, host, port=..., strict=..., timeout=..., maxsize=..., block=..., headers=..., retries=..., _proxy=..., _proxy_headers=..., **conn_kw) -> None: ... + def __init__( + self, + host, + port=..., + strict=..., + timeout=..., + maxsize=..., + block=..., + headers=..., + retries=..., + _proxy=..., + _proxy_headers=..., + **conn_kw, + ) -> None: ... def close(self): ... def is_same_host(self, url): ... - def urlopen(self, method, url, body=..., headers=..., retries=..., redirect=..., assert_same_host=..., timeout=..., pool_timeout=..., release_conn=..., **response_kw): ... + def urlopen( + self, + method, + url, + body=..., + headers=..., + retries=..., + redirect=..., + assert_same_host=..., + timeout=..., + pool_timeout=..., + release_conn=..., + **response_kw, + ): ... class HTTPSConnectionPool(HTTPConnectionPool): scheme: Any @@ -80,6 +96,26 @@ class HTTPSConnectionPool(HTTPConnectionPool): ssl_version: Any assert_hostname: Any assert_fingerprint: Any - def __init__(self, host, port=..., strict=..., timeout=..., maxsize=..., block=..., headers=..., retries=..., _proxy=..., _proxy_headers=..., key_file=..., cert_file=..., cert_reqs=..., ca_certs=..., ssl_version=..., assert_hostname=..., assert_fingerprint=..., **conn_kw) -> None: ... + def __init__( + self, + host, + port=..., + strict=..., + timeout=..., + maxsize=..., + block=..., + headers=..., + retries=..., + _proxy=..., + _proxy_headers=..., + key_file=..., + cert_file=..., + cert_reqs=..., + ca_certs=..., + ssl_version=..., + assert_hostname=..., + assert_fingerprint=..., + **conn_kw, + ) -> None: ... def connection_from_url(url, **kw): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/contrib/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/contrib/__init__.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/exceptions.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/exceptions.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/fields.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/fields.pyi old mode 100755 new mode 100644 index 9d691dcf..df18769b --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/fields.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/fields.pyi @@ -1,7 +1,4 @@ -# Stubs for requests.packages.urllib3.fields (Python 3.4) - from typing import Any -from . import packages def guess_content_type(filename, default=...): ... def format_header_param(name, value): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/filepost.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/filepost.pyi old mode 100755 new mode 100644 index afcc837b..49bd7e04 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/filepost.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/filepost.pyi @@ -1,10 +1,7 @@ from typing import Any -from . import packages -# from .packages import six + from . import fields -# six = packages.six -# b = six.b RequestField = fields.RequestField writer: Any diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/packages/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/packages/__init__.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/packages/ssl_match_hostname/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/packages/ssl_match_hostname/__init__.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/poolmanager.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/poolmanager.pyi old mode 100755 new mode 100644 index 9568488f..68ad6962 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/poolmanager.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/poolmanager.pyi @@ -1,4 +1,5 @@ from typing import Any + from .request import RequestMethods class PoolManager(RequestMethods): diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/request.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/request.pyi old mode 100755 new mode 100644 index fd79126d..b95ab295 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/request.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/request.pyi @@ -6,4 +6,6 @@ class RequestMethods: def urlopen(self, method, url, body=..., headers=..., encode_multipart=..., multipart_boundary=..., **kw): ... def request(self, method, url, fields=..., headers=..., **urlopen_kw): ... def request_encode_url(self, method, url, fields=..., **urlopen_kw): ... - def request_encode_body(self, method, url, fields=..., headers=..., encode_multipart=..., multipart_boundary=..., **urlopen_kw): ... + def request_encode_body( + self, method, url, fields=..., headers=..., encode_multipart=..., multipart_boundary=..., **urlopen_kw + ): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/response.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/response.pyi old mode 100755 new mode 100644 index de0aa330..1c78b48a --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/response.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/response.pyi @@ -1,8 +1,8 @@ -from typing import Any import io -from . import _collections -from . import exceptions -from .connection import HTTPException as HTTPException, BaseSSLError as BaseSSLError +from typing import Any + +from . import _collections, exceptions +from .connection import BaseSSLError as BaseSSLError, HTTPException as HTTPException from .util import response HTTPHeaderDict = _collections.HTTPHeaderDict @@ -32,7 +32,20 @@ class HTTPResponse(io.IOBase): reason: Any strict: Any decode_content: Any - def __init__(self, body=..., headers=..., status=..., version=..., reason=..., strict=..., preload_content=..., decode_content=..., original_response=..., pool=..., connection=...) -> None: ... + def __init__( + self, + body=..., + headers=..., + status=..., + version=..., + reason=..., + strict=..., + preload_content=..., + decode_content=..., + original_response=..., + pool=..., + connection=..., + ) -> None: ... def get_redirect_location(self): ... def release_conn(self): ... @property diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/__init__.pyi old mode 100755 new mode 100644 index 53bdac9b..2d0d66dc --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/__init__.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/__init__.pyi @@ -1,12 +1,7 @@ -from . import connection -from . import request -from . import response -from . import ssl_ -from . import timeout -from . import retry -from . import url import ssl +from . import connection, request, response, retry, ssl_, timeout, url + is_connection_dropped = connection.is_connection_dropped make_headers = request.make_headers is_fp_closed = response.is_fp_closed diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/connection.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/connection.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/request.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/request.pyi old mode 100755 new mode 100644 index a7e112f1..f770cd9f --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/request.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/request.pyi @@ -1,8 +1,11 @@ from typing import Any + # from ..packages import six # b = six.b ACCEPT_ENCODING: Any -def make_headers(keep_alive=..., accept_encoding=..., user_agent=..., basic_auth=..., proxy_basic_auth=..., disable_cache=...): ... +def make_headers( + keep_alive=..., accept_encoding=..., user_agent=..., basic_auth=..., proxy_basic_auth=..., disable_cache=... +): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/response.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/response.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/retry.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/retry.pyi old mode 100755 new mode 100644 index c7c21786..cc4196b1 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/retry.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/retry.pyi @@ -1,6 +1,6 @@ from typing import Any + from .. import exceptions -from .. import packages ConnectTimeoutError = exceptions.ConnectTimeoutError MaxRetryError = exceptions.MaxRetryError @@ -21,7 +21,18 @@ class Retry: method_whitelist: Any backoff_factor: Any raise_on_redirect: Any - def __init__(self, total=..., connect=..., read=..., redirect=..., method_whitelist=..., status_forcelist=..., backoff_factor=..., raise_on_redirect=..., _observed_errors=...) -> None: ... + def __init__( + self, + total=..., + connect=..., + read=..., + redirect=..., + method_whitelist=..., + status_forcelist=..., + backoff_factor=..., + raise_on_redirect=..., + _observed_errors=..., + ) -> None: ... def new(self, **kw): ... @classmethod def from_int(cls, retries, redirect=..., default=...): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/ssl_.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/ssl_.pyi old mode 100755 new mode 100644 index fe1a3a0d..1542e91d --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/ssl_.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/ssl_.pyi @@ -1,6 +1,7 @@ +import ssl from typing import Any + from .. import exceptions -import ssl SSLError = exceptions.SSLError InsecurePlatformWarning = exceptions.InsecurePlatformWarning @@ -16,5 +17,14 @@ def assert_fingerprint(cert, fingerprint): ... def resolve_cert_reqs(candidate): ... def resolve_ssl_version(candidate): ... def create_urllib3_context(ssl_version=..., cert_reqs=..., options=..., ciphers=...): ... -def ssl_wrap_socket(sock, keyfile=..., certfile=..., cert_reqs=..., ca_certs=..., - server_hostname=..., ssl_version=..., ciphers=..., ssl_context=...): ... +def ssl_wrap_socket( + sock, + keyfile=..., + certfile=..., + cert_reqs=..., + ca_certs=..., + server_hostname=..., + ssl_version=..., + ciphers=..., + ssl_context=..., +): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/timeout.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/timeout.pyi old mode 100755 new mode 100644 index 0f3c97ca..25879d68 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/timeout.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/timeout.pyi @@ -1,4 +1,5 @@ from typing import Any + from .. import exceptions TimeoutStateError = exceptions.TimeoutStateError diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/url.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/url.pyi old mode 100755 new mode 100644 index 0e40ba5a..2d43e2d2 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/url.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/url.pyi @@ -1,4 +1,5 @@ from typing import Any + from .. import exceptions LocationParseError = exceptions.LocationParseError diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/sessions.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/sessions.pyi old mode 100755 new mode 100644 index f09dbec2..700b711e --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/sessions.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/sessions.pyi @@ -1,18 +1,8 @@ -# Stubs for requests.sessions (Python 3) +from typing import IO, Any, Callable, Iterable, List, Mapping, MutableMapping, Optional, Text, Tuple, Union -from typing import Any, Union, List, MutableMapping, Text, Optional, IO, Tuple, Callable, Iterable -from . import adapters -from . import auth as _auth -from . import compat -from . import cookies -from . import models +from . import adapters, auth as _auth, compat, cookies, exceptions, hooks, models, status_codes, structures, utils from .models import Response -from . import hooks -from . import utils -from . import exceptions from .packages.urllib3 import _collections -from . import structures -from . import status_codes BaseAdapter = adapters.BaseAdapter OrderedDict = compat.OrderedDict @@ -43,18 +33,15 @@ get_auth_from_url = utils.get_auth_from_url codes = status_codes.codes REDIRECT_STATI = models.REDIRECT_STATI -REDIRECT_CACHE_SIZE: Any - def merge_setting(request_setting, session_setting, dict_class=...): ... def merge_hooks(request_hooks, session_hooks, dict_class=...): ... class SessionRedirectMixin: - def resolve_redirects(self, resp, req, stream=..., timeout=..., verify=..., cert=..., - proxies=...): ... + def resolve_redirects(self, resp, req, stream=..., timeout=..., verify=..., cert=..., proxies=...): ... def rebuild_auth(self, prepared_request, response): ... def rebuild_proxies(self, prepared_request, proxies): ... -_Data = Union[None, Text, bytes, MutableMapping[str, Any], MutableMapping[Text, Any], Iterable[Tuple[Text, Optional[Text]]], IO] +_Data = Union[None, Text, bytes, Mapping[str, Any], Mapping[Text, Any], Iterable[Tuple[Text, Optional[Text]]], IO] _Hook = Callable[[Response], Any] _Hooks = MutableMapping[Text, List[_Hook]] @@ -79,22 +66,25 @@ class Session(SessionRedirectMixin): def __enter__(self) -> Session: ... def __exit__(self, *args) -> None: ... def prepare_request(self, request): ... - def request(self, method: str, url: Union[str, bytes, Text], - params: Union[None, bytes, MutableMapping[Text, Text]] = ..., - data: _Data = ..., - headers: Optional[MutableMapping[Text, Text]] = ..., - cookies: Union[None, RequestsCookieJar, MutableMapping[Text, Text]] = ..., - files: Optional[MutableMapping[Text, IO[Any]]] = ..., - auth: Union[None, Tuple[Text, Text], _auth.AuthBase, Callable[[Request], Request]] = ..., - timeout: Union[None, float, Tuple[float, float]] = ..., - allow_redirects: Optional[bool] = ..., - proxies: Optional[MutableMapping[Text, Text]] = ..., - hooks: Optional[_HooksInput] = ..., - stream: Optional[bool] = ..., - verify: Union[None, bool, Text] = ..., - cert: Union[Text, Tuple[Text, Text], None] = ..., - json: Optional[Any] = ..., - ) -> Response: ... + def request( + self, + method: str, + url: Union[str, bytes, Text], + params: Union[None, bytes, MutableMapping[Text, Text]] = ..., + data: _Data = ..., + headers: Optional[MutableMapping[Text, Text]] = ..., + cookies: Union[None, RequestsCookieJar, MutableMapping[Text, Text]] = ..., + files: Optional[MutableMapping[Text, IO[Any]]] = ..., + auth: Union[None, Tuple[Text, Text], _auth.AuthBase, Callable[[Request], Request]] = ..., + timeout: Union[None, float, Tuple[float, float], Tuple[float, None]] = ..., + allow_redirects: Optional[bool] = ..., + proxies: Optional[MutableMapping[Text, Text]] = ..., + hooks: Optional[_HooksInput] = ..., + stream: Optional[bool] = ..., + verify: Union[None, bool, Text] = ..., + cert: Union[Text, Tuple[Text, Text], None] = ..., + json: Optional[Any] = ..., + ) -> Response: ... def get(self, url: Union[Text, bytes], **kwargs) -> Response: ... def options(self, url: Union[Text, bytes], **kwargs) -> Response: ... def head(self, url: Union[Text, bytes], **kwargs) -> Response: ... @@ -102,12 +92,10 @@ class Session(SessionRedirectMixin): def put(self, url: Union[Text, bytes], data: _Data = ..., **kwargs) -> Response: ... def patch(self, url: Union[Text, bytes], data: _Data = ..., **kwargs) -> Response: ... def delete(self, url: Union[Text, bytes], **kwargs) -> Response: ... - def send(self, request, **kwargs): ... + def send(self, request: PreparedRequest, **kwargs) -> Response: ... def merge_environment_settings(self, url, proxies, stream, verify, cert): ... def get_adapter(self, url): ... def close(self) -> None: ... - def mount(self, prefix: - Union[Text, bytes], - adapter: BaseAdapter) -> None: ... + def mount(self, prefix: Union[Text, bytes], adapter: BaseAdapter) -> None: ... def session() -> Session: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/status_codes.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/status_codes.pyi old mode 100755 new mode 100644 index f9bf820a..4660b476 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/status_codes.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/status_codes.pyi @@ -1,4 +1,3 @@ from typing import Any -from .structures import LookupDict codes: Any diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/structures.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/structures.pyi old mode 100755 new mode 100644 index 0ef19936..ffc45979 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/structures.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/structures.pyi @@ -1,6 +1,6 @@ -from typing import Any, Dict, Iterable, Iterator, Mapping, MutableMapping, Optional, Tuple, TypeVar, Union, Generic +from typing import Any, Dict, Generic, Iterable, Iterator, Mapping, MutableMapping, Optional, Tuple, TypeVar, Union -_VT = TypeVar('_VT') +_VT = TypeVar("_VT") class CaseInsensitiveDict(MutableMapping[str, _VT], Generic[_VT]): def __init__(self, data: Optional[Union[Mapping[str, _VT], Iterable[Tuple[str, _VT]]]] = ..., **kwargs: _VT) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/utils.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/utils.pyi old mode 100755 new mode 100644 index 396a3740..3a84c625 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/utils.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/requests/utils.pyi @@ -1,10 +1,6 @@ -# Stubs for requests.utils (Python 3) +from typing import Any, AnyStr, Dict, Iterable, Mapping, Optional, Text, Tuple -from typing import Any -from . import compat -from . import cookies -from . import structures -from . import exceptions +from . import compat, cookies, exceptions, structures OrderedDict = compat.OrderedDict RequestsCookieJar = cookies.RequestsCookieJar @@ -14,11 +10,13 @@ InvalidURL = exceptions.InvalidURL NETRC_FILES: Any DEFAULT_CA_BUNDLE_PATH: Any +DEFAULT_PORTS: Any def dict_to_sequence(d): ... def super_len(o): ... -def get_netrc_auth(url): ... +def get_netrc_auth(url, raise_errors: bool = ...): ... def guess_filename(obj): ... +def extract_zipped_paths(path): ... def from_key_val_list(value): ... def to_key_val_list(value): ... def parse_list_header(value): ... @@ -41,8 +39,9 @@ def dotted_netmask(mask): ... def is_ipv4_address(string_ip): ... def is_valid_cidr(string_network): ... def set_environ(env_name, value): ... -def should_bypass_proxies(url): ... -def get_environ_proxies(url): ... +def should_bypass_proxies(url, no_proxy: Optional[Iterable[AnyStr]]) -> bool: ... +def get_environ_proxies(url, no_proxy: Optional[Iterable[AnyStr]] = ...) -> Dict[Any, Any]: ... +def select_proxy(url: Text, proxies: Optional[Mapping[Any, Any]]): ... def default_user_agent(name=...): ... def default_headers(): ... def parse_header_links(value): ... @@ -51,3 +50,5 @@ def prepend_scheme_if_needed(url, new_scheme): ... def get_auth_from_url(url): ... def to_native_string(string, encoding=...): ... def urldefragauth(url): ... +def rewind_body(prepared_request): ... +def check_header_validity(header: Tuple[AnyStr, AnyStr]) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/retry/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/retry/__init__.pyi new file mode 100644 index 00000000..0cf7651b --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/retry/__init__.pyi @@ -0,0 +1 @@ +from .api import retry as retry diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/retry/api.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/retry/api.pyi new file mode 100644 index 00000000..37fa2009 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/retry/api.pyi @@ -0,0 +1,28 @@ +from logging import Logger +from typing import Any, Callable, Dict, Optional, Sequence, Tuple, Type, TypeVar, Union + +_T = TypeVar("_T", bound=Callable[..., Any]) +_Decorator = Callable[[_T], _T] +_R = TypeVar("_R") + +def retry_call( + f: Callable[..., _R], + fargs: Optional[Sequence[Any]] = ..., + fkwargs: Optional[Dict[str, Any]] = ..., + exceptions: Union[Type[Exception], Tuple[Type[Exception], ...]] = ..., + tries: int = ..., + delay: float = ..., + max_delay: Optional[float] = ..., + backoff: float = ..., + jitter: Union[Tuple[float, float], float] = ..., + logger: Optional[Logger] = ..., +) -> _R: ... +def retry( + exceptions: Union[Type[Exception], Tuple[Type[Exception], ...]] = ..., + tries: int = ..., + delay: float = ..., + max_delay: Optional[float] = ..., + backoff: float = ..., + jitter: Union[Tuple[float, float], float] = ..., + logger: Optional[Logger] = ..., +) -> _Decorator: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/simplejson/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/simplejson/__init__.pyi old mode 100755 new mode 100644 index 6221b4ef..19ba570f --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/simplejson/__init__.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/simplejson/__init__.pyi @@ -1,12 +1,11 @@ -from typing import Any, IO, Text, Union +from typing import IO, Any, Text, Union -from simplejson.scanner import JSONDecodeError as JSONDecodeError from simplejson.decoder import JSONDecoder as JSONDecoder from simplejson.encoder import JSONEncoder as JSONEncoder, JSONEncoderForHTML as JSONEncoderForHTML +from simplejson.scanner import JSONDecodeError as JSONDecodeError _LoadsString = Union[Text, bytes, bytearray] - def dumps(obj: Any, *args: Any, **kwds: Any) -> str: ... def dump(obj: Any, fp: IO[str], *args: Any, **kwds: Any) -> None: ... def loads(s: _LoadsString, **kwds: Any) -> Any: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/simplejson/decoder.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/simplejson/decoder.pyi old mode 100755 new mode 100644 index 59111ce6..a0631945 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/simplejson/decoder.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/simplejson/decoder.pyi @@ -1,4 +1,4 @@ -from typing import Any, Match +from typing import Match class JSONDecoder(object): def __init__(self, **kwargs): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/simplejson/encoder.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/simplejson/encoder.pyi old mode 100755 new mode 100644 index 0e318066..ab6f40f1 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/simplejson/encoder.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/simplejson/encoder.pyi @@ -1,4 +1,4 @@ -from typing import Any, IO +from typing import Any class JSONEncoder(object): def __init__(self, *args, **kwargs): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/simplejson/scanner.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/simplejson/scanner.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/singledispatch.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/singledispatch.pyi old mode 100755 new mode 100644 index e89ac121..f264047a --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/singledispatch.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/singledispatch.pyi @@ -1,9 +1,7 @@ -from typing import Any, Callable, Generic, Mapping, Optional, TypeVar, overload - +from typing import Any, Callable, Generic, Mapping, TypeVar, overload _T = TypeVar("_T") - class _SingleDispatchCallable(Generic[_T]): registry: Mapping[Any, Callable[..., _T]] def dispatch(self, cls: Any) -> Callable[..., _T]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/slugify/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/slugify/__init__.pyi new file mode 100644 index 00000000..1a784737 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/slugify/__init__.pyi @@ -0,0 +1,2 @@ +from .slugify import * +from .special import * diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/slugify/slugify.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/slugify/slugify.pyi new file mode 100644 index 00000000..a51c7873 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/slugify/slugify.pyi @@ -0,0 +1,19 @@ +from typing import Iterable, Optional + +def smart_truncate( + string: str, max_length: int = ..., word_boundary: bool = ..., separator: str = ..., save_order: bool = ... +) -> str: ... +def slugify( + text: str, + entities: bool = ..., + decimal: bool = ..., + hexadecimal: bool = ..., + max_length: int = ..., + word_boundary: bool = ..., + separator: str = ..., + save_order: bool = ..., + stopwords: Iterable[str] = ..., + regex_pattern: Optional[str] = ..., + lowercase: bool = ..., + replacements: Iterable[str] = ..., +) -> str: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/slugify/special.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/slugify/special.pyi new file mode 100644 index 00000000..05e07617 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/slugify/special.pyi @@ -0,0 +1,8 @@ +from typing import Sequence, Tuple + +def add_uppercase_char(char_list: Sequence[Tuple[str, str]]) -> Sequence[Tuple[str, str]]: ... + +CYRILLIC: Sequence[Tuple[str, str]] +GERMAN: Sequence[Tuple[str, str]] +GREEK: Sequence[Tuple[str, str]] +PRE_TRANSLATIONS: Sequence[Tuple[str, str]] diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/tabulate.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/tabulate.pyi old mode 100755 new mode 100644 index c3abb2f1..dc935400 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/tabulate.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/tabulate.pyi @@ -1,5 +1,4 @@ -# Stub for tabulate: https://github.com/astanin/python-tabulate -from typing import Any, Callable, Container, Iterable, List, Mapping, NamedTuple, Optional, Sequence, Union +from typing import Any, Callable, Container, Dict, Iterable, List, Mapping, NamedTuple, Optional, Sequence, Union PRESERVE_WHITESPACE: bool WIDE_CHARS_MODE: bool @@ -32,7 +31,7 @@ class TableFormat(NamedTuple): def simple_separated_format(separator: str) -> TableFormat: ... def tabulate( tabular_data: Union[Mapping[str, Iterable[Any]], Iterable[Iterable[Any]]], - headers: Union[str, Sequence[str]] = ..., + headers: Union[str, Dict[str, str], Sequence[str]] = ..., tablefmt: Union[str, TableFormat] = ..., floatfmt: Union[str, Iterable[str]] = ..., numalign: Optional[str] = ..., diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/termcolor.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/termcolor.pyi old mode 100755 new mode 100644 index e1ad18b8..b890dcd1 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/termcolor.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/termcolor.pyi @@ -1,21 +1,8 @@ -# Stub for termcolor: https://pypi.python.org/pypi/termcolor from typing import Any, Iterable, Optional, Text - def colored( - text: Text, - color: Optional[Text] = ..., - on_color: Optional[Text] = ..., - attrs: Optional[Iterable[Text]] = ..., -) -> Text: - ... - - + text: Text, color: Optional[Text] = ..., on_color: Optional[Text] = ..., attrs: Optional[Iterable[Text]] = ... +) -> Text: ... def cprint( - text: Text, - color: Optional[Text] = ..., - on_color: Optional[Text] = ..., - attrs: Optional[Iterable[Text]] = ..., - **kwargs: Any, -) -> None: - ... + text: Text, color: Optional[Text] = ..., on_color: Optional[Text] = ..., attrs: Optional[Iterable[Text]] = ..., **kwargs: Any +) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/toml.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/toml.pyi old mode 100755 new mode 100644 index 2639178e..e19bc775 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/toml.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/toml.pyi @@ -1,24 +1,19 @@ -from typing import Any, IO, List, Mapping, MutableMapping, Optional, Protocol, Text, Type, Union -import datetime import sys +from _typeshed import StrPath, SupportsWrite +from typing import IO, Any, List, Mapping, MutableMapping, Text, Type, Union -if sys.version_info >= (3, 4): +if sys.version_info >= (3, 6): + _PathLike = StrPath +elif sys.version_info >= (3, 4): import pathlib - if sys.version_info >= (3, 6): - import os - _PathLike = Union[Text, pathlib.PurePath, os.PathLike] - else: - _PathLike = Union[Text, pathlib.PurePath] -else: - _PathLike = Text -class _Writable(Protocol): - def write(self, obj: str) -> Any: ... + _PathLike = Union[StrPath, pathlib.PurePath] +else: + _PathLike = StrPath class TomlDecodeError(Exception): ... def load(f: Union[_PathLike, List[Text], IO[str]], _dict: Type[MutableMapping[str, Any]] = ...) -> MutableMapping[str, Any]: ... def loads(s: Text, _dict: Type[MutableMapping[str, Any]] = ...) -> MutableMapping[str, Any]: ... - -def dump(o: Mapping[str, Any], f: _Writable) -> str: ... +def dump(o: Mapping[str, Any], f: SupportsWrite[str]) -> str: ... def dumps(o: Mapping[str, Any]) -> str: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/typing_extensions.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/typing_extensions.pyi old mode 100755 new mode 100644 index edf40d67..aec0f944 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/typing_extensions.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/typing_extensions.pyi @@ -1,31 +1,47 @@ import abc import sys -from typing import Callable -from typing import ClassVar as ClassVar -from typing import ContextManager as ContextManager -from typing import Counter as Counter -from typing import DefaultDict as DefaultDict -from typing import Deque as Deque -from typing import NewType as NewType -from typing import NoReturn as NoReturn -from typing import overload as overload -from typing import Text as Text -from typing import Type as Type -from typing import TYPE_CHECKING as TYPE_CHECKING -from typing import TypeVar, Any, Mapping, ItemsView, KeysView, Optional, ValuesView, Dict, Type - -_T = TypeVar('_T') -_F = TypeVar('_F', bound=Callable[..., Any]) -_TC = TypeVar('_TC', bound=Type[object]) +from typing import ( + TYPE_CHECKING as TYPE_CHECKING, + Any, + Callable, + ClassVar as ClassVar, + ContextManager as ContextManager, + Counter as Counter, + DefaultDict as DefaultDict, + Deque as Deque, + Dict, + ItemsView, + KeysView, + Mapping, + NewType as NewType, + NoReturn as NoReturn, + Optional, + Text as Text, + Tuple, + Type as Type, + TypeVar, + ValuesView, + overload as overload, +) + +_T = TypeVar("_T") +_F = TypeVar("_F", bound=Callable[..., Any]) +_TC = TypeVar("_TC", bound=Type[object]) + class _SpecialForm: def __getitem__(self, typeargs: Any) -> Any: ... + def runtime_checkable(cls: _TC) -> _TC: ... + # This alias for above is kept here for backwards compatibility. runtime = runtime_checkable Protocol: _SpecialForm = ... Final: _SpecialForm = ... + def final(f: _F) -> _F: ... + Literal: _SpecialForm = ... + def IntVar(__name: str) -> Any: ... # returns a new TypeVar # Internal mypy fallback type for all typed dicts (does not exist at runtime) @@ -42,6 +58,10 @@ class _TypedDict(Mapping[str, object], metaclass=abc.ABCMeta): def viewitems(self) -> ItemsView[str, object]: ... def viewkeys(self) -> KeysView[str]: ... def viewvalues(self) -> ValuesView[object]: ... + else: + def items(self) -> ItemsView[str, object]: ... + def keys(self) -> KeysView[str]: ... + def values(self) -> ValuesView[object]: ... def __delitem__(self, k: NoReturn) -> None: ... # TypedDict is a (non-subscriptable) special form. @@ -51,19 +71,44 @@ if sys.version_info >= (3, 3): from typing import ChainMap as ChainMap if sys.version_info >= (3, 5): - from typing import AsyncIterable as AsyncIterable - from typing import AsyncIterator as AsyncIterator - from typing import AsyncContextManager as AsyncContextManager - from typing import Awaitable as Awaitable - from typing import Coroutine as Coroutine + from typing import ( + AsyncContextManager as AsyncContextManager, + AsyncIterable as AsyncIterable, + AsyncIterator as AsyncIterator, + Awaitable as Awaitable, + Coroutine as Coroutine, + ) if sys.version_info >= (3, 6): from typing import AsyncGenerator as AsyncGenerator def get_type_hints( - obj: Callable[..., Any], globalns: Optional[Dict[str, Any]] = ..., localns: Optional[Dict[str, Any]] = ..., - include_extras: bool = ... + obj: Callable[..., Any], + globalns: Optional[Dict[str, Any]] = ..., + localns: Optional[Dict[str, Any]] = ..., + include_extras: bool = ..., ) -> Dict[str, Any]: ... +if sys.version_info >= (3, 7): + def get_args(tp: Any) -> Tuple[Any, ...]: ... + def get_origin(tp: Any) -> Optional[Any]: ... + Annotated: _SpecialForm = ... _AnnotatedAlias: Any = ... # undocumented + +# TypeAlias is a (non-subscriptable) special form. +class TypeAlias: ... + +@runtime_checkable +class SupportsIndex(Protocol, metaclass=abc.ABCMeta): + @abc.abstractmethod + def __index__(self) -> int: ... + +# PEP 612 support for Python < 3.9 +if sys.version_info >= (3, 10): + from typing import Concatenate as Concatenate, ParamSpec as ParamSpec +else: + class ParamSpec: + __name__: str + def __init__(self, name: str) -> None: ... + Concatenate: _SpecialForm = ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/tzlocal/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/tzlocal/__init__.pyi new file mode 100644 index 00000000..7df53ad0 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/tzlocal/__init__.pyi @@ -0,0 +1,4 @@ +from pytz import BaseTzInfo + +def reload_localzone() -> None: ... +def get_localzone() -> BaseTzInfo: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/ujson.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/ujson.pyi old mode 100755 new mode 100644 index 7e006592..f96d4754 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/ujson.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/ujson.pyi @@ -1,6 +1,4 @@ -# Stubs for ujson -# See: https://pypi.python.org/pypi/ujson -from typing import Any, AnyStr, IO, Optional +from typing import IO, Any, AnyStr __version__: str @@ -13,7 +11,6 @@ def encode( sort_keys: bool = ..., indent: int = ..., ) -> str: ... - def dumps( obj: Any, ensure_ascii: bool = ..., @@ -23,7 +20,6 @@ def dumps( sort_keys: bool = ..., indent: int = ..., ) -> str: ... - def dump( obj: Any, fp: IO[str], @@ -34,18 +30,6 @@ def dump( sort_keys: bool = ..., indent: int = ..., ) -> None: ... - -def decode( - s: AnyStr, - precise_float: bool = ..., -) -> Any: ... - -def loads( - s: AnyStr, - precise_float: bool = ..., -) -> Any: ... - -def load( - fp: IO[AnyStr], - precise_float: bool = ..., -) -> Any: ... +def decode(s: AnyStr, precise_float: bool = ...) -> Any: ... +def loads(s: AnyStr, precise_float: bool = ...) -> Any: ... +def load(fp: IO[AnyStr], precise_float: bool = ...) -> Any: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/__init__.pyi old mode 100755 new mode 100644 index 2de398a8..8c351ab4 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/__init__.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/__init__.pyi @@ -1,28 +1,29 @@ from types import ModuleType from typing import Any -from werkzeug import _internal -from werkzeug import datastructures -from werkzeug import debug -from werkzeug import exceptions -from werkzeug import formparser -from werkzeug import http -from werkzeug import local -from werkzeug import security -from werkzeug import serving -from werkzeug import test -from werkzeug import testapp -from werkzeug import urls -from werkzeug import useragents -from werkzeug import utils -from werkzeug import wrappers -from werkzeug import wsgi +from werkzeug import ( + _internal, + datastructures, + debug, + exceptions, + formparser, + http, + local, + security, + serving, + test, + testapp, + urls, + useragents, + utils, + wrappers, + wsgi, +) class module(ModuleType): def __getattr__(self, name): ... def __dir__(self): ... - __version__: Any run_simple = serving.run_simple diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/_compat.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/_compat.pyi old mode 100755 new mode 100644 index bc4340dc..f8a13f77 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/_compat.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/_compat.pyi @@ -1,10 +1,16 @@ import sys from typing import Any, Optional, Text -if sys.version_info < (3,): - import StringIO as BytesIO +if sys.version_info >= (3,): + from io import BytesIO as BytesIO, StringIO as StringIO + + NativeStringIO = StringIO else: - from io import StringIO as BytesIO + import cStringIO + from StringIO import StringIO as StringIO + + BytesIO = cStringIO.StringIO + NativeStringIO = BytesIO PY2: Any WIN: Any @@ -27,7 +33,6 @@ def native_string_result(func): ... def implements_bool(cls): ... range_type: Any -NativeStringIO: Any def make_literal_wrapper(reference): ... def normalize_string_tuple(tup): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/_internal.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/_internal.pyi old mode 100755 new mode 100644 index 64f63a1d..ed23d7e1 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/_internal.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/_internal.pyi @@ -10,8 +10,15 @@ class _DictAccessorProperty: load_func: Any dump_func: Any __doc__: Any - def __init__(self, name, default: Optional[Any] = ..., load_func: Optional[Any] = ..., dump_func: Optional[Any] = ..., - read_only: Optional[Any] = ..., doc: Optional[Any] = ...): ... + def __init__( + self, + name, + default: Optional[Any] = ..., + load_func: Optional[Any] = ..., + dump_func: Optional[Any] = ..., + read_only: Optional[Any] = ..., + doc: Optional[Any] = ..., + ): ... def __get__(self, obj, type: Optional[Any] = ...): ... def __set__(self, obj, value): ... def __delete__(self, obj): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/_reloader.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/_reloader.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/__init__.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/atom.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/atom.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/cache.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/cache.pyi old mode 100755 new mode 100644 index 9ef76dae..a53bcea6 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/cache.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/cache.pyi @@ -48,8 +48,16 @@ GAEMemcachedCache: Any class RedisCache(BaseCache): key_prefix: Any - def __init__(self, host: str = ..., port: int = ..., password: Optional[Any] = ..., db: int = ..., - default_timeout: float = ..., key_prefix: Optional[Any] = ..., **kwargs): ... + def __init__( + self, + host: str = ..., + port: int = ..., + password: Optional[Any] = ..., + db: int = ..., + default_timeout: float = ..., + key_prefix: Optional[Any] = ..., + **kwargs, + ): ... def dump_object(self, value): ... def load_object(self, value): ... def get(self, key): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/fixers.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/fixers.pyi old mode 100755 new mode 100644 index 0593d9d8..f7605a70 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/fixers.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/fixers.pyi @@ -1,5 +1,5 @@ -from typing import Any, Iterable, List, Mapping, Optional, Sequence, Set, Text -from wsgiref.types import WSGIApplication, WSGIEnvironment, StartResponse +from _typeshed.wsgi import StartResponse, WSGIApplication, WSGIEnvironment +from typing import Any, Iterable, List, Mapping, Optional, Set, Text from ..middleware.proxy_fix import ProxyFix as ProxyFix @@ -21,7 +21,7 @@ class HeaderRewriterFix(object): remove_headers: Set[Text] add_headers: List[Text] def __init__( - self, app: WSGIApplication, remove_headers: Optional[Iterable[Text]] = ..., add_headers: Optional[Iterable[Text]] = ..., + self, app: WSGIApplication, remove_headers: Optional[Iterable[Text]] = ..., add_headers: Optional[Iterable[Text]] = ... ) -> None: ... def __call__(self, environ: WSGIEnvironment, start_response: StartResponse) -> Iterable[bytes]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/iterio.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/iterio.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/jsrouting.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/jsrouting.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/limiter.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/limiter.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/lint.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/lint.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/profiler.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/profiler.pyi old mode 100755 new mode 100644 index 61608db9..eb32ea46 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/profiler.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/profiler.pyi @@ -1,14 +1,9 @@ -from typing import Any, AnyStr, Generic, Optional, Protocol, Tuple, TypeVar +from _typeshed import SupportsWrite +from typing import AnyStr, Generic, Tuple from ..middleware.profiler import * -_T = TypeVar("_T") -_T_contra = TypeVar("_T_contra", contravariant=True) - -class _Writable(Protocol[_T_contra]): - def write(self, __s: _T_contra) -> Any: ... - -class MergeStream(Generic[_T]): - streams: Tuple[_Writable[_T], ...] - def __init__(self, *streams: _Writable[_T]) -> None: ... - def write(self, data: _T) -> None: ... +class MergeStream(Generic[AnyStr]): + streams: Tuple[SupportsWrite[AnyStr], ...] + def __init__(self, *streams: SupportsWrite[AnyStr]) -> None: ... + def write(self, data: AnyStr) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/securecookie.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/securecookie.pyi old mode 100755 new mode 100644 index 667d4558..48309b44 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/securecookie.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/securecookie.pyi @@ -1,6 +1,7 @@ -from typing import Any, Optional -from hmac import new as hmac from hashlib import sha1 as _default_hash +from hmac import new as hmac +from typing import Any, Optional + from werkzeug.contrib.sessions import ModificationTrackingDict class UnquoteError(Exception): ... @@ -23,6 +24,16 @@ class SecureCookie(ModificationTrackingDict[Any, Any]): def unserialize(cls, string, secret_key): ... @classmethod def load_cookie(cls, request, key: str = ..., secret_key: Optional[Any] = ...): ... - def save_cookie(self, response, key: str = ..., expires: Optional[Any] = ..., session_expires: Optional[Any] = ..., - max_age: Optional[Any] = ..., path: str = ..., domain: Optional[Any] = ..., secure: Optional[Any] = ..., - httponly: bool = ..., force: bool = ...): ... + def save_cookie( + self, + response, + key: str = ..., + expires: Optional[Any] = ..., + session_expires: Optional[Any] = ..., + max_age: Optional[Any] = ..., + path: str = ..., + domain: Optional[Any] = ..., + secure: Optional[Any] = ..., + httponly: bool = ..., + force: bool = ..., + ): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/sessions.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/sessions.pyi old mode 100755 new mode 100644 index ab09b979..bee23007 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/sessions.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/sessions.pyi @@ -1,4 +1,5 @@ from typing import Any, Optional, Text, TypeVar + from werkzeug.datastructures import CallbackDict _K = TypeVar("_K") @@ -35,8 +36,14 @@ class FilesystemSessionStore(SessionStore): filename_template: str renew_missing: Any mode: Any - def __init__(self, path: Optional[Any] = ..., filename_template: Text = ..., session_class: Optional[Any] = ..., - renew_missing: bool = ..., mode: int = ...): ... + def __init__( + self, + path: Optional[Any] = ..., + filename_template: Text = ..., + session_class: Optional[Any] = ..., + renew_missing: bool = ..., + mode: int = ..., + ): ... def get_session_filename(self, sid): ... def save(self, session): ... def delete(self, session): ... @@ -54,7 +61,17 @@ class SessionMiddleware: cookie_secure: Any cookie_httponly: Any environ_key: Any - def __init__(self, app, store, cookie_name: str = ..., cookie_age: Optional[Any] = ..., cookie_expires: Optional[Any] = ..., - cookie_path: str = ..., cookie_domain: Optional[Any] = ..., cookie_secure: Optional[Any] = ..., - cookie_httponly: bool = ..., environ_key: str = ...): ... + def __init__( + self, + app, + store, + cookie_name: str = ..., + cookie_age: Optional[Any] = ..., + cookie_expires: Optional[Any] = ..., + cookie_path: str = ..., + cookie_domain: Optional[Any] = ..., + cookie_secure: Optional[Any] = ..., + cookie_httponly: bool = ..., + environ_key: str = ..., + ): ... def __call__(self, environ, start_response): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/testtools.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/testtools.pyi old mode 100755 new mode 100644 index 860ebb7a..da0f92d1 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/testtools.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/testtools.pyi @@ -1,4 +1,3 @@ -from typing import Any from werkzeug.wrappers import Response class ContentAccessors: diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/wrappers.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/wrappers.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/datastructures.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/datastructures.pyi old mode 100755 new mode 100644 index a727df6b..d04de7ce --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/datastructures.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/datastructures.pyi @@ -1,11 +1,11 @@ -import collections +from _typeshed import SupportsWrite from typing import ( + IO, Any, Callable, Container, Dict, Generic, - IO, Iterable, Iterator, List, @@ -13,7 +13,6 @@ from typing import ( MutableSet, NoReturn, Optional, - Protocol, Text, Tuple, Type, @@ -31,7 +30,7 @@ def is_immutable(self) -> NoReturn: ... def iter_multi_items(mapping): ... def native_itermethods(names): ... -class ImmutableListMixin(object, Generic[_V]): +class ImmutableListMixin(Generic[_V]): def __hash__(self) -> int: ... def __reduce_ex__(self: _D, protocol) -> Tuple[Type[_D], List[_V]]: ... def __delitem__(self, key: _V) -> NoReturn: ... @@ -414,8 +413,9 @@ class WWWAuthenticate(UpdateDictMixin, Dict[str, Any]): on_update: Any def __init__(self, auth_type: Optional[Any] = ..., values: Optional[Any] = ..., on_update: Optional[Any] = ...): ... def set_basic(self, realm: str = ...): ... - def set_digest(self, realm, nonce, qop=..., opaque: Optional[Any] = ..., algorithm: Optional[Any] = ..., - stale: bool = ...): ... + def set_digest( + self, realm, nonce, qop=..., opaque: Optional[Any] = ..., algorithm: Optional[Any] = ..., stale: bool = ... + ): ... def to_header(self): ... @staticmethod def auth_property(name, doc: Optional[Any] = ...): ... @@ -428,9 +428,6 @@ class WWWAuthenticate(UpdateDictMixin, Dict[str, Any]): qop: Any stale: Any -class _Writer(Protocol): - def write(self, data: bytes) -> Any: ... - class FileStorage(object): name: Optional[Text] stream: IO[bytes] @@ -453,7 +450,7 @@ class FileStorage(object): def mimetype(self) -> str: ... @property def mimetype_params(self) -> Dict[str, str]: ... - def save(self, dst: Union[Text, _Writer], buffer_size: int = ...): ... + def save(self, dst: Union[Text, SupportsWrite[bytes]], buffer_size: int = ...): ... def close(self) -> None: ... def __nonzero__(self) -> bool: ... def __bool__(self) -> bool: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/debug/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/debug/__init__.pyi old mode 100755 new mode 100644 index d920ed0d..82664dc4 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/debug/__init__.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/debug/__init__.pyi @@ -1,4 +1,5 @@ from typing import Any, Optional + from werkzeug.wrappers import BaseRequest as Request, BaseResponse as Response PIN_TIME: Any @@ -25,9 +26,18 @@ class DebuggedApplication: secret: Any pin_logging: Any pin: Any - def __init__(self, app, evalex: bool = ..., request_key: str = ..., console_path: str = ..., - console_init_func: Optional[Any] = ..., show_hidden_frames: bool = ..., lodgeit_url: Optional[Any] = ..., - pin_security: bool = ..., pin_logging: bool = ...): ... + def __init__( + self, + app, + evalex: bool = ..., + request_key: str = ..., + console_path: str = ..., + console_init_func: Optional[Any] = ..., + show_hidden_frames: bool = ..., + lodgeit_url: Optional[Any] = ..., + pin_security: bool = ..., + pin_logging: bool = ..., + ): ... @property def pin_cookie_name(self): ... def debug_application(self, environ, start_response): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/debug/console.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/debug/console.pyi old mode 100755 new mode 100644 index 0323377b..d2fc1d36 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/debug/console.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/debug/console.pyi @@ -1,5 +1,5 @@ -from typing import Any, Optional import code +from typing import Any, Optional class HTMLStringO: def __init__(self): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/debug/repr.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/debug/repr.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/debug/tbtools.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/debug/tbtools.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/exceptions.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/exceptions.pyi old mode 100755 new mode 100644 index 36b14ee8..0a0cf3c6 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/exceptions.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/exceptions.pyi @@ -1,6 +1,7 @@ -from typing import Any, Dict, Tuple, List, Text, NoReturn, Optional, Protocol, Type, Union, Iterable +import datetime +from _typeshed.wsgi import StartResponse, WSGIEnvironment +from typing import Any, Dict, Iterable, List, NoReturn, Optional, Protocol, Text, Tuple, Type, Union -from wsgiref.types import WSGIEnvironment, StartResponse from werkzeug.wrappers import Response class _EnvironContainer(Protocol): @@ -124,7 +125,16 @@ class PreconditionRequired(HTTPException): code: int description: Text -class TooManyRequests(HTTPException): +class _RetryAfter(HTTPException): + retry_after: Union[None, int, datetime.datetime] + def __init__( + self, + description: Optional[Text] = ..., + response: Optional[Response] = ..., + retry_after: Union[None, int, datetime.datetime] = ..., + ) -> None: ... + +class TooManyRequests(_RetryAfter): code: int description: Text @@ -137,6 +147,9 @@ class UnavailableForLegalReasons(HTTPException): description: Text class InternalServerError(HTTPException): + def __init__( + self, description: Optional[Text] = ..., response: Optional[Response] = ..., original_exception: Optional[Exception] = ... + ) -> None: ... code: int description: Text @@ -148,7 +161,7 @@ class BadGateway(HTTPException): code: int description: Text -class ServiceUnavailable(HTTPException): +class ServiceUnavailable(_RetryAfter): code: int description: Text diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/filesystem.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/filesystem.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/formparser.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/formparser.pyi old mode 100755 new mode 100644 index 8f0b5525..8cc951fa --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/formparser.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/formparser.pyi @@ -1,5 +1,20 @@ -from typing import Any, Optional, Text, Tuple, Callable, Iterable, TypeVar, NoReturn, Protocol, IO, Generator, Dict, Mapping, Union -from wsgiref.types import WSGIEnvironment +from _typeshed.wsgi import WSGIEnvironment +from typing import ( + IO, + Any, + Callable, + Dict, + Generator, + Iterable, + Mapping, + NoReturn, + Optional, + Protocol, + Text, + Tuple, + TypeVar, + Union, +) from .datastructures import Headers @@ -10,11 +25,11 @@ _F = TypeVar("_F", bound=Callable[..., Any]) class _StreamFactory(Protocol): def __call__( - self, total_content_length: Optional[int], filename: str, content_type: str, content_length: Optional[int] = ..., + self, total_content_length: Optional[int], filename: str, content_type: str, content_length: Optional[int] = ... ) -> IO[bytes]: ... def default_stream_factory( - total_content_length: Optional[int], filename: str, content_type: str, content_length: Optional[int] = ..., + total_content_length: Optional[int], filename: str, content_type: str, content_length: Optional[int] = ... ) -> IO[bytes]: ... def parse_form_data( environ: WSGIEnvironment, @@ -49,7 +64,7 @@ class FormDataParser(object): def get_parse_func(self, mimetype: str, options: Any) -> Optional[_ParseFunc]: ... def parse_from_environ(self, environ: WSGIEnvironment) -> Tuple[IO[bytes], _Dict, _Dict]: ... def parse( - self, stream: IO[bytes], mimetype: Text, content_length: Optional[int], options: Optional[Mapping[str, str]] = ..., + self, stream: IO[bytes], mimetype: Text, content_length: Optional[int], options: Optional[Mapping[str, str]] = ... ) -> Tuple[IO[bytes], _Dict, _Dict]: ... parse_functions: Dict[Text, _ParseFunc] @@ -76,12 +91,12 @@ class MultiPartParser(object): def get_part_encoding(self, headers: Mapping[str, str]) -> Optional[str]: ... def get_part_charset(self, headers: Mapping[str, str]) -> Text: ... def start_file_streaming( - self, filename: Union[Text, bytes], headers: Mapping[str, str], total_content_length: Optional[int], + self, filename: Union[Text, bytes], headers: Mapping[str, str], total_content_length: Optional[int] ) -> Tuple[Text, IO[bytes]]: ... def in_memory_threshold_reached(self, bytes: Any) -> NoReturn: ... def validate_boundary(self, boundary: Optional[str]) -> None: ... def parse_lines( - self, file: Any, boundary: bytes, content_length: int, cap_at_buffer: bool = ..., + self, file: Any, boundary: bytes, content_length: int, cap_at_buffer: bool = ... ) -> Generator[Tuple[str, Any], None, None]: ... def parse_parts(self, file: Any, boundary: bytes, content_length: int) -> Generator[Tuple[str, Any], None, None]: ... def parse(self, file: Any, boundary: bytes, content_length: int) -> Tuple[_Dict, _Dict]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/http.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/http.pyi old mode 100755 new mode 100644 index bdda6d2c..e124c3bf --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/http.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/http.pyi @@ -1,18 +1,39 @@ import sys +from _typeshed.wsgi import WSGIEnvironment from datetime import datetime, timedelta from typing import ( - Dict, Text, Union, Tuple, Any, Optional, Mapping, Iterable, Callable, List, Type, - TypeVar, Protocol, overload, SupportsInt, + Any, + Callable, + Dict, + Iterable, + List, + Mapping, + Optional, + SupportsInt, + Text, + Tuple, + Type, + TypeVar, + Union, + overload, ) -from wsgiref.types import WSGIEnvironment from .datastructures import ( - Headers, Accept, RequestCacheControl, HeaderSet, Authorization, WWWAuthenticate, - IfRange, Range, ContentRange, ETags, TypeConversionDict, + Accept, + Authorization, + ContentRange, + ETags, + Headers, + HeaderSet, + IfRange, + Range, + RequestCacheControl, + TypeConversionDict, + WWWAuthenticate, ) if sys.version_info < (3,): - _Str = TypeVar('_Str', str, unicode) + _Str = TypeVar("_Str", str, unicode) _ToBytes = Union[bytes, bytearray, buffer, unicode] _ETagData = Union[str, unicode, bytearray, buffer, memoryview] else: @@ -40,6 +61,7 @@ def parse_dict_header(value: Union[bytes, Text], cls: Type[_T]) -> _T: ... def parse_options_header(value: None, multiple: bool = ...) -> Tuple[str, Dict[str, Optional[str]]]: ... @overload def parse_options_header(value: _Str) -> Tuple[_Str, Dict[_Str, Optional[_Str]]]: ... + # actually returns Tuple[_Str, Dict[_Str, Optional[_Str]], ...] @overload def parse_options_header(value: _Str, multiple: bool = ...) -> Tuple[Any, ...]: ... @@ -48,22 +70,27 @@ def parse_accept_header(value: Optional[Text]) -> Accept: ... @overload def parse_accept_header(value: Optional[_Str], cls: Callable[[Optional[List[Tuple[str, float]]]], _T]) -> _T: ... @overload -def parse_cache_control_header(value: Union[None, bytes, Text], - on_update: Optional[Callable[[RequestCacheControl], Any]] = ...) -> RequestCacheControl: ... +def parse_cache_control_header( + value: Union[None, bytes, Text], on_update: Optional[Callable[[RequestCacheControl], Any]] = ... +) -> RequestCacheControl: ... @overload -def parse_cache_control_header(value: Union[None, bytes, Text], on_update: _T, - cls: Callable[[Dict[Text, Optional[Text]], _T], _U]) -> _U: ... +def parse_cache_control_header( + value: Union[None, bytes, Text], on_update: _T, cls: Callable[[Dict[Text, Optional[Text]], _T], _U] +) -> _U: ... @overload -def parse_cache_control_header(value: Union[None, bytes, Text], *, - cls: Callable[[Dict[Text, Optional[Text]], None], _U]) -> _U: ... +def parse_cache_control_header( + value: Union[None, bytes, Text], *, cls: Callable[[Dict[Text, Optional[Text]], None], _U] +) -> _U: ... def parse_set_header(value: Text, on_update: Optional[Callable[[HeaderSet], Any]] = ...) -> HeaderSet: ... def parse_authorization_header(value: Union[None, bytes, Text]) -> Optional[Authorization]: ... -def parse_www_authenticate_header(value: Union[None, bytes, Text], - on_update: Optional[Callable[[WWWAuthenticate], Any]] = ...) -> WWWAuthenticate: ... +def parse_www_authenticate_header( + value: Union[None, bytes, Text], on_update: Optional[Callable[[WWWAuthenticate], Any]] = ... +) -> WWWAuthenticate: ... def parse_if_range_header(value: Optional[Text]) -> IfRange: ... def parse_range_header(value: Optional[Text], make_inclusive: bool = ...) -> Optional[Range]: ... -def parse_content_range_header(value: Optional[Text], - on_update: Optional[Callable[[ContentRange], Any]] = ...) -> Optional[ContentRange]: ... +def parse_content_range_header( + value: Optional[Text], on_update: Optional[Callable[[ContentRange], Any]] = ... +) -> Optional[ContentRange]: ... def quote_etag(etag: _Str, weak: bool = ...) -> _Str: ... def unquote_etag(etag: Optional[_Str]) -> Tuple[Optional[_Str], Optional[_Str]]: ... def parse_etags(value: Optional[Text]) -> ETags: ... @@ -73,20 +100,38 @@ def cookie_date(expires: Union[None, float, datetime] = ...) -> str: ... def http_date(timestamp: Union[None, float, datetime] = ...) -> str: ... def parse_age(value: Optional[SupportsInt] = ...) -> Optional[timedelta]: ... def dump_age(age: Union[None, timedelta, SupportsInt]) -> Optional[str]: ... -def is_resource_modified(environ: WSGIEnvironment, etag: Optional[Text] = ..., data: Optional[_ETagData] = ..., - last_modified: Union[None, Text, datetime] = ..., ignore_if_range: bool = ...) -> bool: ... +def is_resource_modified( + environ: WSGIEnvironment, + etag: Optional[Text] = ..., + data: Optional[_ETagData] = ..., + last_modified: Union[None, Text, datetime] = ..., + ignore_if_range: bool = ..., +) -> bool: ... def remove_entity_headers(headers: Union[List[Tuple[Text, Text]], Headers], allowed: Iterable[Text] = ...) -> None: ... def remove_hop_by_hop_headers(headers: Union[List[Tuple[Text, Text]], Headers]) -> None: ... def is_entity_header(header: Text) -> bool: ... def is_hop_by_hop_header(header: Text) -> bool: ... @overload -def parse_cookie(header: Union[None, WSGIEnvironment, Text, bytes], charset: Text = ..., - errors: Text = ...) -> TypeConversionDict[Any, Any]: ... +def parse_cookie( + header: Union[None, WSGIEnvironment, Text, bytes], charset: Text = ..., errors: Text = ... +) -> TypeConversionDict[Any, Any]: ... @overload -def parse_cookie(header: Union[None, WSGIEnvironment, Text, bytes], charset: Text = ..., - errors: Text = ..., cls: Optional[Callable[[Iterable[Tuple[Text, Text]]], _T]] = ...) -> _T: ... -def dump_cookie(key: _ToBytes, value: _ToBytes = ..., max_age: Union[None, float, timedelta] = ..., - expires: Union[None, Text, float, datetime] = ..., path: Union[None, Tuple[Any, ...], str, bytes] = ..., - domain: Union[None, str, bytes] = ..., secure: bool = ..., httponly: bool = ..., charset: Text = ..., - sync_expires: bool = ...) -> str: ... +def parse_cookie( + header: Union[None, WSGIEnvironment, Text, bytes], + charset: Text = ..., + errors: Text = ..., + cls: Optional[Callable[[Iterable[Tuple[Text, Text]]], _T]] = ..., +) -> _T: ... +def dump_cookie( + key: _ToBytes, + value: _ToBytes = ..., + max_age: Union[None, float, timedelta] = ..., + expires: Union[None, Text, float, datetime] = ..., + path: Union[None, Tuple[Any, ...], str, bytes] = ..., + domain: Union[None, str, bytes] = ..., + secure: bool = ..., + httponly: bool = ..., + charset: Text = ..., + sync_expires: bool = ..., +) -> str: ... def is_byte_range_valid(start: Optional[int], stop: Optional[int], length: Optional[int]) -> bool: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/local.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/local.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/middleware/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/middleware/__init__.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/middleware/dispatcher.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/middleware/dispatcher.pyi old mode 100755 new mode 100644 index f107c435..60ea30e0 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/middleware/dispatcher.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/middleware/dispatcher.pyi @@ -1,5 +1,5 @@ -from typing import Any, Iterable, Mapping, Optional, Text -from wsgiref.types import StartResponse, WSGIApplication, WSGIEnvironment +from _typeshed.wsgi import StartResponse, WSGIApplication, WSGIEnvironment +from typing import Iterable, Mapping, Optional, Text class DispatcherMiddleware(object): app: WSGIApplication diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/middleware/http_proxy.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/middleware/http_proxy.pyi old mode 100755 new mode 100644 index 4056cacc..6b4fd56e --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/middleware/http_proxy.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/middleware/http_proxy.pyi @@ -1,5 +1,5 @@ +from _typeshed.wsgi import StartResponse, WSGIApplication, WSGIEnvironment from typing import Any, Dict, Iterable, Mapping, MutableMapping, Text -from wsgiref.types import StartResponse, WSGIApplication, WSGIEnvironment _Opts = Mapping[Text, Any] _MutableOpts = MutableMapping[Text, Any] @@ -8,11 +8,7 @@ class ProxyMiddleware(object): app: WSGIApplication targets: Dict[Text, _MutableOpts] def __init__( - self, - app: WSGIApplication, - targets: Mapping[Text, _MutableOpts], - chunk_size: int = ..., - timeout: int = ..., + self, app: WSGIApplication, targets: Mapping[Text, _MutableOpts], chunk_size: int = ..., timeout: int = ... ) -> None: ... def proxy_to(self, opts: _Opts, path: Text, prefix: Text) -> WSGIApplication: ... def __call__(self, environ: WSGIEnvironment, start_response: StartResponse) -> Iterable[bytes]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/middleware/lint.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/middleware/lint.pyi old mode 100755 new mode 100644 index 95922cc4..82ab8699 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/middleware/lint.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/middleware/lint.pyi @@ -1,6 +1,7 @@ import sys +from _typeshed import SupportsWrite +from _typeshed.wsgi import StartResponse, WSGIApplication, WSGIEnvironment from typing import Any, Iterable, Iterator, List, Mapping, Optional, Protocol, Tuple -from wsgiref.types import StartResponse, WSGIApplication, WSGIEnvironment from ..datastructures import Headers @@ -9,36 +10,33 @@ class HTTPWarning(Warning): ... def check_string(context: str, obj: object, stacklevel: int = ...) -> None: ... -class _Readable(Protocol): +class _SupportsReadEtc(Protocol): def read(self, __size: int = ...) -> bytes: ... def readline(self, __size: int = ...) -> bytes: ... def __iter__(self) -> Iterator[bytes]: ... def close(self) -> Any: ... class InputStream(object): - def __init__(self, stream: _Readable) -> None: ... + def __init__(self, stream: _SupportsReadEtc) -> None: ... def read(self, __size: int = ...) -> bytes: ... def readline(self, __size: int = ...) -> bytes: ... def __iter__(self) -> Iterator[bytes]: ... def close(self) -> None: ... -class _FullyWritable(Protocol): +class _SupportsWriteEtc(Protocol): def write(self, __s: str) -> Any: ... def flush(self) -> Any: ... def close(self) -> Any: ... class ErrorStream(object): - def __init__(self, stream: _FullyWritable) -> None: ... + def __init__(self, stream: _SupportsWriteEtc) -> None: ... def write(self, s: str) -> None: ... def flush(self) -> None: ... def writelines(self, seq: Iterable[str]) -> None: ... def close(self) -> None: ... -class _Writable(Protocol): - def write(self, __s: str) -> Any: ... - class GuardedWrite(object): - def __init__(self, write: _Writable, chunks: List[int]) -> None: ... + def __init__(self, write: SupportsWrite[str], chunks: List[int]) -> None: ... def __call__(self, s: str) -> None: ... class GuardedIterator(object): @@ -57,10 +55,7 @@ class LintMiddleware(object): def __init__(self, app: WSGIApplication) -> None: ... def check_environ(self, environ: WSGIEnvironment) -> None: ... def check_start_response( - self, - status: str, - headers: List[Tuple[str, str]], - exc_info: Optional[Tuple[Any, ...]], + self, status: str, headers: List[Tuple[str, str]], exc_info: Optional[Tuple[Any, ...]] ) -> Tuple[int, Headers]: ... def check_headers(self, headers: Mapping[str, str]) -> None: ... def check_iterator(self, app_iter: Iterable[bytes]) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/middleware/profiler.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/middleware/profiler.pyi old mode 100755 new mode 100644 index 75051220..f309605b --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/middleware/profiler.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/middleware/profiler.pyi @@ -1,5 +1,5 @@ +from _typeshed.wsgi import StartResponse, WSGIApplication, WSGIEnvironment from typing import IO, Iterable, List, Optional, Text, Tuple, Union -from wsgiref.types import StartResponse, WSGIApplication, WSGIEnvironment class ProfilerMiddleware(object): def __init__( diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/middleware/proxy_fix.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/middleware/proxy_fix.pyi old mode 100755 new mode 100644 index 764fc6f0..0522e2be --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/middleware/proxy_fix.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/middleware/proxy_fix.pyi @@ -1,5 +1,5 @@ +from _typeshed.wsgi import StartResponse, WSGIApplication, WSGIEnvironment from typing import Iterable, Optional -from wsgiref.types import StartResponse, WSGIApplication, WSGIEnvironment class ProxyFix(object): app: WSGIApplication diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/middleware/shared_data.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/middleware/shared_data.pyi old mode 100755 new mode 100644 index d1284e83..af0842d6 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/middleware/shared_data.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/middleware/shared_data.pyi @@ -1,6 +1,6 @@ import datetime -from typing import Callable, IO, Iterable, List, Mapping, Optional, Text, Tuple, Union -from wsgiref.types import StartResponse, WSGIApplication, WSGIEnvironment +from _typeshed.wsgi import StartResponse, WSGIApplication, WSGIEnvironment +from typing import IO, Callable, Iterable, List, Mapping, Optional, Text, Tuple, Union _V = Union[Tuple[Text, Text], Text] diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/posixemulation.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/posixemulation.pyi old mode 100755 new mode 100644 index f6669294..334cb3d0 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/posixemulation.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/posixemulation.pyi @@ -1,4 +1,5 @@ from typing import Any + from ._compat import to_unicode as to_unicode from .filesystem import get_filesystem_encoding as get_filesystem_encoding diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/routing.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/routing.pyi old mode 100755 new mode 100644 index 347af55b..a1cfe8d9 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/routing.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/routing.pyi @@ -1,4 +1,5 @@ from typing import Any, Optional, Text + from werkzeug.exceptions import HTTPException def parse_converter_args(argstr): ... @@ -76,9 +77,19 @@ class Rule(RuleFactory): endpoint: Any redirect_to: Any arguments: Any - def __init__(self, string, defaults: Optional[Any] = ..., subdomain: Optional[Any] = ..., methods: Optional[Any] = ..., - build_only: bool = ..., endpoint: Optional[Any] = ..., strict_slashes: Optional[Any] = ..., - redirect_to: Optional[Any] = ..., alias: bool = ..., host: Optional[Any] = ...): ... + def __init__( + self, + string, + defaults: Optional[Any] = ..., + subdomain: Optional[Any] = ..., + methods: Optional[Any] = ..., + build_only: bool = ..., + endpoint: Optional[Any] = ..., + strict_slashes: Optional[Any] = ..., + redirect_to: Optional[Any] = ..., + alias: bool = ..., + host: Optional[Any] = ..., + ): ... def empty(self): ... def get_empty_kwargs(self): ... def get_rules(self, map): ... @@ -101,7 +112,7 @@ class BaseConverter: map: Any def __init__(self, map): ... def to_python(self, value): ... - def to_url(self, value): ... + def to_url(self, value) -> str: ... class UnicodeConverter(BaseConverter): regex: Any @@ -122,7 +133,7 @@ class NumberConverter(BaseConverter): max: Any def __init__(self, map, fixed_digits: int = ..., min: Optional[Any] = ..., max: Optional[Any] = ...): ... def to_python(self, value): ... - def to_url(self, value): ... + def to_url(self, value) -> str: ... class IntegerConverter(NumberConverter): regex: Any @@ -136,7 +147,7 @@ class FloatConverter(NumberConverter): class UUIDConverter(BaseConverter): regex: Any def to_python(self, value): ... - def to_url(self, value): ... + def to_url(self, value) -> str: ... DEFAULT_CONVERTERS: Any @@ -151,15 +162,32 @@ class Map: converters: Any sort_parameters: Any sort_key: Any - def __init__(self, rules: Optional[Any] = ..., default_subdomain: str = ..., charset: Text = ..., - strict_slashes: bool = ..., redirect_defaults: bool = ..., converters: Optional[Any] = ..., - sort_parameters: bool = ..., sort_key: Optional[Any] = ..., encoding_errors: Text = ..., - host_matching: bool = ...): ... + def __init__( + self, + rules: Optional[Any] = ..., + default_subdomain: str = ..., + charset: Text = ..., + strict_slashes: bool = ..., + redirect_defaults: bool = ..., + converters: Optional[Any] = ..., + sort_parameters: bool = ..., + sort_key: Optional[Any] = ..., + encoding_errors: Text = ..., + host_matching: bool = ..., + ): ... def is_endpoint_expecting(self, endpoint, *arguments): ... def iter_rules(self, endpoint: Optional[Any] = ...): ... def add(self, rulefactory): ... - def bind(self, server_name, script_name: Optional[Any] = ..., subdomain: Optional[Any] = ..., url_scheme: str = ..., - default_method: str = ..., path_info: Optional[Any] = ..., query_args: Optional[Any] = ...): ... + def bind( + self, + server_name, + script_name: Optional[Any] = ..., + subdomain: Optional[Any] = ..., + url_scheme: str = ..., + default_method: str = ..., + path_info: Optional[Any] = ..., + query_args: Optional[Any] = ..., + ): ... def bind_to_environ(self, environ, server_name: Optional[Any] = ..., subdomain: Optional[Any] = ...): ... def update(self): ... @@ -172,12 +200,19 @@ class MapAdapter: path_info: Any default_method: Any query_args: Any - def __init__(self, map, server_name, script_name, subdomain, url_scheme, path_info, default_method, - query_args: Optional[Any] = ...): ... - def dispatch(self, view_func, path_info: Optional[Any] = ..., method: Optional[Any] = ..., - catch_http_exceptions: bool = ...): ... - def match(self, path_info: Optional[Any] = ..., method: Optional[Any] = ..., return_rule: bool = ..., - query_args: Optional[Any] = ...): ... + def __init__( + self, map, server_name, script_name, subdomain, url_scheme, path_info, default_method, query_args: Optional[Any] = ... + ): ... + def dispatch( + self, view_func, path_info: Optional[Any] = ..., method: Optional[Any] = ..., catch_http_exceptions: bool = ... + ): ... + def match( + self, + path_info: Optional[Any] = ..., + method: Optional[Any] = ..., + return_rule: bool = ..., + query_args: Optional[Any] = ..., + ): ... def test(self, path_info: Optional[Any] = ..., method: Optional[Any] = ...): ... def allowed_methods(self, path_info: Optional[Any] = ...): ... def get_host(self, domain_part): ... @@ -185,5 +220,11 @@ class MapAdapter: def encode_query_args(self, query_args): ... def make_redirect_url(self, path_info, query_args: Optional[Any] = ..., domain_part: Optional[Any] = ...): ... def make_alias_redirect_url(self, path, endpoint, values, method, query_args): ... - def build(self, endpoint, values: Optional[Any] = ..., method: Optional[Any] = ..., force_external: bool = ..., - append_unknown: bool = ...): ... + def build( + self, + endpoint, + values: Optional[Any] = ..., + method: Optional[Any] = ..., + force_external: bool = ..., + append_unknown: bool = ..., + ): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/script.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/script.pyi old mode 100755 new mode 100644 index b9db97a0..a6420e23 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/script.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/script.pyi @@ -9,6 +9,16 @@ def find_actions(namespace, action_prefix): ... def print_usage(actions): ... def analyse_action(func): ... def make_shell(init_func: Optional[Any] = ..., banner: Optional[Any] = ..., use_ipython: bool = ...): ... -def make_runserver(app_factory, hostname: str = ..., port: int = ..., use_reloader: bool = ..., use_debugger: bool = ..., - use_evalex: bool = ..., threaded: bool = ..., processes: int = ..., static_files: Optional[Any] = ..., - extra_files: Optional[Any] = ..., ssl_context: Optional[Any] = ...): ... +def make_runserver( + app_factory, + hostname: str = ..., + port: int = ..., + use_reloader: bool = ..., + use_debugger: bool = ..., + use_evalex: bool = ..., + threaded: bool = ..., + processes: int = ..., + static_files: Optional[Any] = ..., + extra_files: Optional[Any] = ..., + ssl_context: Optional[Any] = ..., +): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/security.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/security.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/serving.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/serving.pyi old mode 100755 new mode 100644 index 54bce978..d75a3956 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/serving.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/serving.pyi @@ -2,11 +2,20 @@ import sys from typing import Any, Optional if sys.version_info < (3,): - from SocketServer import ThreadingMixIn, ForkingMixIn - from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler + from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer + from SocketServer import ThreadingMixIn else: - from socketserver import ThreadingMixIn, ForkingMixIn - from http.server import HTTPServer, BaseHTTPRequestHandler + from http.server import BaseHTTPRequestHandler, HTTPServer + from socketserver import ThreadingMixIn + +if sys.platform == "win32": + class ForkingMixIn(object): ... + +else: + if sys.version_info < (3,): + from SocketServer import ForkingMixIn as ForkingMixIn + else: + from socketserver import ForkingMixIn as ForkingMixIn class _SslDummy: def __getattr__(self, name): ... @@ -64,8 +73,16 @@ class BaseWSGIServer(HTTPServer): socket: Any server_address: Any ssl_context: Any - def __init__(self, host, port, app, handler: Optional[Any] = ..., passthrough_errors: bool = ..., - ssl_context: Optional[Any] = ..., fd: Optional[Any] = ...): ... + def __init__( + self, + host, + port, + app, + handler: Optional[Any] = ..., + passthrough_errors: bool = ..., + ssl_context: Optional[Any] = ..., + fd: Optional[Any] = ..., + ): ... def log(self, type, message, *args): ... def serve_forever(self): ... def handle_error(self, request, client_address): ... @@ -78,16 +95,46 @@ class ThreadedWSGIServer(ThreadingMixIn, BaseWSGIServer): class ForkingWSGIServer(ForkingMixIn, BaseWSGIServer): multiprocess: Any max_children: Any - def __init__(self, host, port, app, processes: int = ..., handler: Optional[Any] = ..., passthrough_errors: bool = ..., - ssl_context: Optional[Any] = ..., fd: Optional[Any] = ...): ... + def __init__( + self, + host, + port, + app, + processes: int = ..., + handler: Optional[Any] = ..., + passthrough_errors: bool = ..., + ssl_context: Optional[Any] = ..., + fd: Optional[Any] = ..., + ): ... -def make_server(host: Optional[Any] = ..., port: Optional[Any] = ..., app: Optional[Any] = ..., threaded: bool = ..., - processes: int = ..., request_handler: Optional[Any] = ..., passthrough_errors: bool = ..., - ssl_context: Optional[Any] = ..., fd: Optional[Any] = ...): ... +def make_server( + host: Optional[Any] = ..., + port: Optional[Any] = ..., + app: Optional[Any] = ..., + threaded: bool = ..., + processes: int = ..., + request_handler: Optional[Any] = ..., + passthrough_errors: bool = ..., + ssl_context: Optional[Any] = ..., + fd: Optional[Any] = ..., +): ... def is_running_from_reloader(): ... -def run_simple(hostname, port, application, use_reloader: bool = ..., use_debugger: bool = ..., use_evalex: bool = ..., - extra_files: Optional[Any] = ..., reloader_interval: int = ..., reloader_type: str = ..., threaded: bool = ..., - processes: int = ..., request_handler: Optional[Any] = ..., static_files: Optional[Any] = ..., - passthrough_errors: bool = ..., ssl_context: Optional[Any] = ...): ... +def run_simple( + hostname, + port, + application, + use_reloader: bool = ..., + use_debugger: bool = ..., + use_evalex: bool = ..., + extra_files: Optional[Any] = ..., + reloader_interval: int = ..., + reloader_type: str = ..., + threaded: bool = ..., + processes: int = ..., + request_handler: Optional[Any] = ..., + static_files: Optional[Any] = ..., + passthrough_errors: bool = ..., + ssl_context: Optional[Any] = ..., +): ... def run_with_reloader(*args, **kwargs): ... def main(): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/test.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/test.pyi old mode 100755 new mode 100644 index 764b76d8..7624869f --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/test.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/test.pyi @@ -1,17 +1,18 @@ import sys -from wsgiref.types import WSGIEnvironment +from _typeshed.wsgi import WSGIEnvironment from typing import Any, Generic, Optional, Text, Tuple, Type, TypeVar, overload from typing_extensions import Literal if sys.version_info < (3,): - from urllib2 import Request as U2Request from cookielib import CookieJar + from urllib2 import Request as U2Request else: - from urllib.request import Request as U2Request from http.cookiejar import CookieJar + from urllib.request import Request as U2Request -def stream_encode_multipart(values, use_tempfile: int = ..., threshold=..., boundary: Optional[Any] = ..., - charset: Text = ...): ... +def stream_encode_multipart( + values, use_tempfile: int = ..., threshold=..., boundary: Optional[Any] = ..., charset: Text = ... +): ... def encode_multipart(values, boundary: Optional[Any] = ..., charset: Text = ...): ... def File(fd, filename: Optional[Any] = ..., mimetype: Optional[Any] = ...): ... @@ -51,98 +52,118 @@ class EnvironBuilder: input_stream: Any content_length: Any closed: Any - def __init__(self, path: str = ..., base_url: Optional[Any] = ..., query_string: Optional[Any] = ..., - method: str = ..., input_stream: Optional[Any] = ..., content_type: Optional[Any] = ..., - content_length: Optional[Any] = ..., errors_stream: Optional[Any] = ..., multithread: bool = ..., - multiprocess: bool = ..., run_once: bool = ..., headers: Optional[Any] = ..., data: Optional[Any] = ..., - environ_base: Optional[Any] = ..., environ_overrides: Optional[Any] = ..., charset: Text = ...): ... + def __init__( + self, + path: str = ..., + base_url: Optional[Any] = ..., + query_string: Optional[Any] = ..., + method: str = ..., + input_stream: Optional[Any] = ..., + content_type: Optional[Any] = ..., + content_length: Optional[Any] = ..., + errors_stream: Optional[Any] = ..., + multithread: bool = ..., + multiprocess: bool = ..., + run_once: bool = ..., + headers: Optional[Any] = ..., + data: Optional[Any] = ..., + environ_base: Optional[Any] = ..., + environ_overrides: Optional[Any] = ..., + charset: Text = ..., + ): ... form: Any files: Any @property - def server_name(self): ... + def server_name(self) -> str: ... @property - def server_port(self): ... - def __del__(self): ... - def close(self): ... - def get_environ(self): ... + def server_port(self) -> int: ... + def __del__(self) -> None: ... + def close(self) -> None: ... + def get_environ(self) -> WSGIEnvironment: ... def get_request(self, cls: Optional[Any] = ...): ... class ClientRedirectError(Exception): ... # Response type for the client below. # By default _R is Tuple[Iterable[Any], Union[Text, int], datastructures.Headers] -_R = TypeVar('_R') +_R = TypeVar("_R") class Client(Generic[_R]): application: Any response_wrapper: Optional[Type[_R]] cookie_jar: Any allow_subdomain_redirects: Any - def __init__(self, application, response_wrapper: Optional[Type[_R]] = ..., use_cookies: bool = ..., - allow_subdomain_redirects: bool = ...): ... - def set_cookie(self, server_name, key, value: str = ..., max_age: Optional[Any] = ..., expires: Optional[Any] = ..., - path: str = ..., domain: Optional[Any] = ..., secure: Optional[Any] = ..., httponly: bool = ..., - charset: Text = ...): ... + def __init__( + self, + application, + response_wrapper: Optional[Type[_R]] = ..., + use_cookies: bool = ..., + allow_subdomain_redirects: bool = ..., + ): ... + def set_cookie( + self, + server_name, + key, + value: str = ..., + max_age: Optional[Any] = ..., + expires: Optional[Any] = ..., + path: str = ..., + domain: Optional[Any] = ..., + secure: Optional[Any] = ..., + httponly: bool = ..., + charset: Text = ..., + ): ... def delete_cookie(self, server_name, key, path: str = ..., domain: Optional[Any] = ...): ... def run_wsgi_app(self, environ, buffered: bool = ...): ... def resolve_redirect(self, response, new_location, environ, buffered: bool = ...): ... - @overload def open(self, *args, as_tuple: Literal[True], **kwargs) -> Tuple[WSGIEnvironment, _R]: ... @overload def open(self, *args, as_tuple: Literal[False] = ..., **kwargs) -> _R: ... @overload def open(self, *args, as_tuple: bool, **kwargs) -> Any: ... - @overload def get(self, *args, as_tuple: Literal[True], **kw) -> Tuple[WSGIEnvironment, _R]: ... @overload def get(self, *args, as_tuple: Literal[False] = ..., **kw) -> _R: ... @overload def get(self, *args, as_tuple: bool, **kw) -> Any: ... - @overload def patch(self, *args, as_tuple: Literal[True], **kw) -> Tuple[WSGIEnvironment, _R]: ... @overload def patch(self, *args, as_tuple: Literal[False] = ..., **kw) -> _R: ... @overload def patch(self, *args, as_tuple: bool, **kw) -> Any: ... - @overload def post(self, *args, as_tuple: Literal[True], **kw) -> Tuple[WSGIEnvironment, _R]: ... @overload def post(self, *args, as_tuple: Literal[False] = ..., **kw) -> _R: ... @overload def post(self, *args, as_tuple: bool, **kw) -> Any: ... - @overload def head(self, *args, as_tuple: Literal[True], **kw) -> Tuple[WSGIEnvironment, _R]: ... @overload def head(self, *args, as_tuple: Literal[False] = ..., **kw) -> _R: ... @overload def head(self, *args, as_tuple: bool, **kw) -> Any: ... - @overload def put(self, *args, as_tuple: Literal[True], **kw) -> Tuple[WSGIEnvironment, _R]: ... @overload def put(self, *args, as_tuple: Literal[False] = ..., **kw) -> _R: ... @overload def put(self, *args, as_tuple: bool, **kw) -> Any: ... - @overload def delete(self, *args, as_tuple: Literal[True], **kw) -> Tuple[WSGIEnvironment, _R]: ... @overload def delete(self, *args, as_tuple: Literal[False] = ..., **kw) -> _R: ... @overload def delete(self, *args, as_tuple: bool, **kw) -> Any: ... - @overload def options(self, *args, as_tuple: Literal[True], **kw) -> Tuple[WSGIEnvironment, _R]: ... @overload def options(self, *args, as_tuple: Literal[False] = ..., **kw) -> _R: ... @overload def options(self, *args, as_tuple: bool, **kw) -> Any: ... - @overload def trace(self, *args, as_tuple: Literal[True], **kw) -> Tuple[WSGIEnvironment, _R]: ... @overload diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/testapp.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/testapp.pyi old mode 100755 new mode 100644 index e45ea4a3..a074482b --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/testapp.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/testapp.pyi @@ -1,4 +1,5 @@ from typing import Any + from werkzeug.wrappers import BaseRequest as Request, BaseResponse as Response logo: Any diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/urls.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/urls.pyi old mode 100755 new mode 100644 index 2853e46e..6ca710a7 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/urls.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/urls.pyi @@ -50,15 +50,38 @@ def url_unquote_plus(s, charset: Text = ..., errors: Text = ...): ... def url_fix(s, charset: Text = ...): ... def uri_to_iri(uri, charset: Text = ..., errors: Text = ...): ... def iri_to_uri(iri, charset: Text = ..., errors: Text = ..., safe_conversion: bool = ...): ... -def url_decode(s, charset: Text = ..., decode_keys: bool = ..., include_empty: bool = ..., errors: Text = ..., - separator: str = ..., cls: Optional[Any] = ...): ... -def url_decode_stream(stream, charset: Text = ..., decode_keys: bool = ..., include_empty: bool = ..., errors: Text = ..., - separator: str = ..., cls: Optional[Any] = ..., limit: Optional[Any] = ..., - return_iterator: bool = ...): ... -def url_encode(obj, charset: Text = ..., encode_keys: bool = ..., sort: bool = ..., key: Optional[Any] = ..., - separator: bytes = ...): ... -def url_encode_stream(obj, stream: Optional[Any] = ..., charset: Text = ..., encode_keys: bool = ..., sort: bool = ..., - key: Optional[Any] = ..., separator: bytes = ...): ... +def url_decode( + s, + charset: Text = ..., + decode_keys: bool = ..., + include_empty: bool = ..., + errors: Text = ..., + separator: str = ..., + cls: Optional[Any] = ..., +): ... +def url_decode_stream( + stream, + charset: Text = ..., + decode_keys: bool = ..., + include_empty: bool = ..., + errors: Text = ..., + separator: str = ..., + cls: Optional[Any] = ..., + limit: Optional[Any] = ..., + return_iterator: bool = ..., +): ... +def url_encode( + obj, charset: Text = ..., encode_keys: bool = ..., sort: bool = ..., key: Optional[Any] = ..., separator: bytes = ... +): ... +def url_encode_stream( + obj, + stream: Optional[Any] = ..., + charset: Text = ..., + encode_keys: bool = ..., + sort: bool = ..., + key: Optional[Any] = ..., + separator: bytes = ..., +): ... def url_join(base, url, allow_fragments: bool = ...): ... class Href: diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/useragents.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/useragents.pyi old mode 100755 new mode 100644 index c7e8363d..5356e3ff --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/useragents.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/useragents.pyi @@ -1,4 +1,4 @@ -from typing import Any +from typing import Any, Optional class UserAgentParser: platforms: Any @@ -8,6 +8,10 @@ class UserAgentParser: class UserAgent: string: Any + platform: Optional[str] + browser: Optional[str] + version: Optional[str] + language: Optional[str] def __init__(self, environ_or_string): ... def to_header(self): ... def __nonzero__(self): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/utils.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/utils.pyi old mode 100755 new mode 100644 index 92465efd..1f84d83e --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/utils.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/utils.pyi @@ -1,4 +1,5 @@ -from typing import Any, Optional, overload, Type, TypeVar +from typing import Any, Optional, Text, Type, TypeVar, overload + from werkzeug._internal import _DictAccessorProperty from werkzeug.wrappers import Response @@ -28,7 +29,7 @@ xhtml: Any def get_content_type(mimetype, charset): ... def format_string(string, context): ... -def secure_filename(filename): ... +def secure_filename(filename: Text) -> Text: ... def escape(s, quote: Optional[Any] = ...): ... def unescape(s): ... @@ -39,7 +40,6 @@ _RC = TypeVar("_RC", bound=Response) def redirect(location, code: int = ..., Response: None = ...) -> Response: ... @overload def redirect(location, code: int = ..., Response: Type[_RC] = ...) -> _RC: ... - def append_slash_redirect(environ, code: int = ...): ... def import_string(import_name, silent: bool = ...): ... def find_modules(import_path, include_packages: bool = ..., recursive: bool = ...): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/wrappers.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/wrappers.pyi old mode 100755 new mode 100644 index c1635b9f..1806210b --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/wrappers.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/wrappers.pyi @@ -1,22 +1,39 @@ -import sys +from _typeshed.wsgi import InputStream, WSGIEnvironment from datetime import datetime from typing import ( - Any, Callable, Iterable, Iterator, Mapping, MutableMapping, Optional, Sequence, Text, Tuple, Type, TypeVar, Union, overload + Any, + Callable, + Iterable, + Iterator, + Mapping, + MutableMapping, + Optional, + Sequence, + Text, + Tuple, + Type, + TypeVar, + Union, + overload, ) -from wsgiref.types import WSGIEnvironment, InputStream +from typing_extensions import Literal from .datastructures import ( - Authorization, CombinedMultiDict, EnvironHeaders, Headers, ImmutableMultiDict, - MultiDict, ImmutableTypeConversionDict, HeaderSet, - Accept, MIMEAccept, CharsetAccept, LanguageAccept, + Accept, + Authorization, + CharsetAccept, + CombinedMultiDict, + EnvironHeaders, + Headers, + HeaderSet, + ImmutableMultiDict, + ImmutableTypeConversionDict, + LanguageAccept, + MIMEAccept, + MultiDict, ) from .useragents import UserAgent -if sys.version_info >= (3, 8): - from typing import Literal -else: - from typing_extensions import Literal - class BaseRequest: charset: str encoding_errors: str @@ -87,18 +104,13 @@ class BaseRequest: is_multiprocess: bool is_run_once: bool - # These are not preset at runtime but we add them since monkeypatching this - # class is quite common. - def __setattr__(self, name: str, value: Any): ... - def __getattr__(self, name: str): ... - -_OnCloseT = TypeVar('_OnCloseT', bound=Callable[[], Any]) -_SelfT = TypeVar('_SelfT', bound=BaseResponse) +_OnCloseT = TypeVar("_OnCloseT", bound=Callable[[], Any]) +_SelfT = TypeVar("_SelfT", bound=BaseResponse) class BaseResponse: charset: str default_status: int - default_mimetype: str + default_mimetype: Optional[str] implicit_sequence_conversion: bool autocorrect_location_header: bool automatically_set_content_length: bool @@ -107,14 +119,15 @@ class BaseResponse: status: str direct_passthrough: bool response: Iterable[bytes] - def __init__(self, response: Optional[Union[str, bytes, bytearray, Iterable[str], Iterable[bytes]]] = ..., - status: Optional[Union[Text, int]] = ..., - headers: Optional[Union[Headers, - Mapping[Text, Text], - Sequence[Tuple[Text, Text]]]] = ..., - mimetype: Optional[Text] = ..., - content_type: Optional[Text] = ..., - direct_passthrough: bool = ...) -> None: ... + def __init__( + self, + response: Optional[Union[str, bytes, bytearray, Iterable[str], Iterable[bytes]]] = ..., + status: Optional[Union[Text, int]] = ..., + headers: Optional[Union[Headers, Mapping[Text, Text], Sequence[Tuple[Text, Text]]]] = ..., + mimetype: Optional[Text] = ..., + content_type: Optional[Text] = ..., + direct_passthrough: bool = ..., + ) -> None: ... def call_on_close(self, func: _OnCloseT) -> _OnCloseT: ... @classmethod def force_type(cls: Type[_SelfT], response: object, environ: Optional[WSGIEnvironment] = ...) -> _SelfT: ... @@ -131,8 +144,18 @@ class BaseResponse: def calculate_content_length(self) -> Optional[int]: ... def make_sequence(self) -> None: ... def iter_encoded(self) -> Iterator[bytes]: ... - def set_cookie(self, key, value: str = ..., max_age: Optional[Any] = ..., expires: Optional[Any] = ..., - path: str = ..., domain: Optional[Any] = ..., secure: bool = ..., httponly: bool = ...): ... + def set_cookie( + self, + key: str, + value: Union[str, bytes] = ..., + max_age: Optional[int] = ..., + expires: Optional[int] = ..., + path: str = ..., + domain: Optional[str] = ..., + secure: bool = ..., + httponly: bool = ..., + samesite: Optional[str] = ..., + ) -> None: ... def delete_cookie(self, key, path: str = ..., domain: Optional[Any] = ...): ... @property def is_streamed(self) -> bool: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/wsgi.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/wsgi.pyi old mode 100755 new mode 100644 index c7863cdd..ea6bb85c --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/wsgi.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/werkzeug/wsgi.pyi @@ -1,13 +1,15 @@ -from typing import Any, Optional, Protocol, Iterable, Text -from wsgiref.types import WSGIEnvironment, InputStream +from _typeshed import SupportsRead +from _typeshed.wsgi import InputStream, WSGIEnvironment +from typing import Any, Iterable, Optional, Text from .middleware.dispatcher import DispatcherMiddleware as DispatcherMiddleware from .middleware.http_proxy import ProxyMiddleware as ProxyMiddleware from .middleware.shared_data import SharedDataMiddleware as SharedDataMiddleware def responder(f): ... -def get_current_url(environ, root_only: bool = ..., strip_querystring: bool = ..., host_only: bool = ..., - trusted_hosts: Optional[Any] = ...): ... +def get_current_url( + environ, root_only: bool = ..., strip_querystring: bool = ..., host_only: bool = ..., trusted_hosts: Optional[Any] = ... +): ... def host_is_trusted(hostname, trusted_list): ... def get_host(environ, trusted_hosts: Optional[Any] = ...): ... def get_content_length(environ: WSGIEnvironment) -> Optional[int]: ... @@ -17,8 +19,9 @@ def get_path_info(environ, charset: Text = ..., errors: Text = ...): ... def get_script_name(environ, charset: Text = ..., errors: Text = ...): ... def pop_path_info(environ, charset: Text = ..., errors: Text = ...): ... def peek_path_info(environ, charset: Text = ..., errors: Text = ...): ... -def extract_path_info(environ_or_baseurl, path_or_url, charset: Text = ..., errors: Text = ..., - collapse_http_schemes: bool = ...): ... +def extract_path_info( + environ_or_baseurl, path_or_url, charset: Text = ..., errors: Text = ..., collapse_http_schemes: bool = ... +): ... class ClosingIterator: def __init__(self, iterable, callbacks: Optional[Any] = ...): ... @@ -26,15 +29,12 @@ class ClosingIterator: def __next__(self): ... def close(self): ... -class _Readable(Protocol): - def read(self, size: int = ...) -> bytes: ... - -def wrap_file(environ: WSGIEnvironment, file: _Readable, buffer_size: int = ...) -> Iterable[bytes]: ... +def wrap_file(environ: WSGIEnvironment, file: SupportsRead[bytes], buffer_size: int = ...) -> Iterable[bytes]: ... class FileWrapper: - file: _Readable + file: SupportsRead[bytes] buffer_size: int - def __init__(self, file: _Readable, buffer_size: int = ...) -> None: ... + def __init__(self, file: SupportsRead[bytes], buffer_size: int = ...) -> None: ... def close(self) -> None: ... def seekable(self) -> bool: ... def seek(self, offset: int, whence: int = ...) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/__init__.pyi old mode 100755 new mode 100644 index 4a221883..ac8dd027 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/__init__.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/__init__.pyi @@ -1,12 +1,14 @@ -from typing import Any, IO, Iterator, Optional, overload, Sequence, Text, Union import sys +from typing import IO, Any, Iterator, Optional, Sequence, Text, Union, overload + +from yaml.dumper import * # noqa: F403 from yaml.error import * # noqa: F403 -from yaml.tokens import * # noqa: F403 from yaml.events import * # noqa: F403 -from yaml.nodes import * # noqa: F403 from yaml.loader import * # noqa: F403 -from yaml.dumper import * # noqa: F403 -from . import resolver # Help mypy a bit; this is implied by loader and dumper +from yaml.nodes import * # noqa: F403 +from yaml.tokens import * # noqa: F403 + +from . import resolver as resolver # Help mypy a bit; this is implied by loader and dumper from .cyaml import * if sys.version_info < (3,): @@ -23,44 +25,235 @@ def scan(stream, Loader=...): ... def parse(stream, Loader=...): ... def compose(stream, Loader=...): ... def compose_all(stream, Loader=...): ... -def load(stream: Union[bytes, IO[bytes], str, IO[str]], Loader=...) -> Any: ... -def load_all(stream: Union[bytes, IO[bytes], str, IO[str]], Loader=...) -> Iterator[Any]: ... -def full_load(stream: Union[bytes, IO[bytes], str, IO[str]]) -> Any: ... -def full_load_all(stream: Union[bytes, IO[bytes], str, IO[str]]) -> Iterator[Any]: ... -def safe_load(stream: Union[bytes, IO[bytes], str, IO[str]]) -> Any: ... -def safe_load_all(stream: Union[bytes, IO[bytes], str, IO[str]]) -> Iterator[Any]: ... +def load(stream: Union[bytes, IO[bytes], Text, IO[Text]], Loader=...) -> Any: ... +def load_all(stream: Union[bytes, IO[bytes], Text, IO[Text]], Loader=...) -> Iterator[Any]: ... +def full_load(stream: Union[bytes, IO[bytes], Text, IO[Text]]) -> Any: ... +def full_load_all(stream: Union[bytes, IO[bytes], Text, IO[Text]]) -> Iterator[Any]: ... +def safe_load(stream: Union[bytes, IO[bytes], Text, IO[Text]]) -> Any: ... +def safe_load_all(stream: Union[bytes, IO[bytes], Text, IO[Text]]) -> Iterator[Any]: ... +def unsafe_load(stream: Union[bytes, IO[bytes], Text, IO[Text]]) -> Any: ... +def unsafe_load_all(stream: Union[bytes, IO[bytes], Text, IO[Text]]) -> Iterator[Any]: ... def emit(events, stream=..., Dumper=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=...): ... - @overload -def serialize_all(nodes, stream: IO[str], Dumper=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=..., encoding=..., explicit_start=..., explicit_end=..., version=..., tags=...) -> None: ... +def serialize_all( + nodes, + stream: IO[str], + Dumper=..., + canonical=..., + indent=..., + width=..., + allow_unicode=..., + line_break=..., + encoding=..., + explicit_start=..., + explicit_end=..., + version=..., + tags=..., +) -> None: ... @overload -def serialize_all(nodes, stream: None = ..., Dumper=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=..., encoding: Optional[_Str] = ..., explicit_start=..., explicit_end=..., version=..., tags=...) -> _Yaml: ... - +def serialize_all( + nodes, + stream: None = ..., + Dumper=..., + canonical=..., + indent=..., + width=..., + allow_unicode=..., + line_break=..., + encoding: Optional[_Str] = ..., + explicit_start=..., + explicit_end=..., + version=..., + tags=..., +) -> _Yaml: ... @overload -def serialize(node, stream: IO[str], Dumper=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=..., encoding=..., explicit_start=..., explicit_end=..., version=..., tags=...) -> None: ... +def serialize( + node, + stream: IO[str], + Dumper=..., + *, + canonical=..., + indent=..., + width=..., + allow_unicode=..., + line_break=..., + encoding=..., + explicit_start=..., + explicit_end=..., + version=..., + tags=..., +) -> None: ... @overload -def serialize(node, stream: None = ..., Dumper=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=..., encoding: Optional[_Str] = ..., explicit_start=..., explicit_end=..., version=..., tags=...) -> _Yaml: ... - +def serialize( + node, + stream: None = ..., + Dumper=..., + *, + canonical=..., + indent=..., + width=..., + allow_unicode=..., + line_break=..., + encoding: Optional[_Str] = ..., + explicit_start=..., + explicit_end=..., + version=..., + tags=..., +) -> _Yaml: ... @overload -def dump_all(documents: Sequence[Any], stream: IO[str], Dumper=..., default_style=..., default_flow_style=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=..., encoding=..., explicit_start=..., explicit_end=..., version=..., tags=..., sort_keys: bool = ...) -> None: ... +def dump_all( + documents: Sequence[Any], + stream: IO[str], + Dumper=..., + default_style=..., + default_flow_style=..., + canonical=..., + indent=..., + width=..., + allow_unicode=..., + line_break=..., + encoding=..., + explicit_start=..., + explicit_end=..., + version=..., + tags=..., + sort_keys: bool = ..., +) -> None: ... @overload -def dump_all(documents: Sequence[Any], stream: None = ..., Dumper=..., default_style=..., default_flow_style=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=..., encoding: Optional[_Str] = ..., explicit_start=..., explicit_end=..., version=..., tags=..., sort_keys: bool = ...) -> _Yaml: ... - +def dump_all( + documents: Sequence[Any], + stream: None = ..., + Dumper=..., + default_style=..., + default_flow_style=..., + canonical=..., + indent=..., + width=..., + allow_unicode=..., + line_break=..., + encoding: Optional[_Str] = ..., + explicit_start=..., + explicit_end=..., + version=..., + tags=..., + sort_keys: bool = ..., +) -> _Yaml: ... @overload -def dump(data: Any, stream: IO[str], Dumper=..., default_style=..., default_flow_style=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=..., encoding=..., explicit_start=..., explicit_end=..., version=..., tags=..., sort_keys: bool = ...) -> None: ... +def dump( + data: Any, + stream: IO[str], + Dumper=..., + *, + default_style=..., + default_flow_style=..., + canonical=..., + indent=..., + width=..., + allow_unicode=..., + line_break=..., + encoding=..., + explicit_start=..., + explicit_end=..., + version=..., + tags=..., + sort_keys: bool = ..., +) -> None: ... @overload -def dump(data: Any, stream: None = ..., Dumper=..., default_style=..., default_flow_style=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=..., encoding: Optional[_Str] = ..., explicit_start=..., explicit_end=..., version=..., tags=..., sort_keys: bool = ...) -> _Yaml: ... - +def dump( + data: Any, + stream: None = ..., + Dumper=..., + *, + default_style=..., + default_flow_style=..., + canonical=..., + indent=..., + width=..., + allow_unicode=..., + line_break=..., + encoding: Optional[_Str] = ..., + explicit_start=..., + explicit_end=..., + version=..., + tags=..., + sort_keys: bool = ..., +) -> _Yaml: ... @overload -def safe_dump_all(documents: Sequence[Any], stream: IO[str], default_style=..., default_flow_style=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=..., encoding=..., explicit_start=..., explicit_end=..., version=..., tags=..., sort_keys: bool = ...) -> None: ... +def safe_dump_all( + documents: Sequence[Any], + stream: IO[str], + *, + default_style=..., + default_flow_style=..., + canonical=..., + indent=..., + width=..., + allow_unicode=..., + line_break=..., + encoding=..., + explicit_start=..., + explicit_end=..., + version=..., + tags=..., + sort_keys: bool = ..., +) -> None: ... @overload -def safe_dump_all(documents: Sequence[Any], stream: None = ..., default_style=..., default_flow_style=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=..., encoding: Optional[_Str] = ..., explicit_start=..., explicit_end=..., version=..., tags=..., sort_keys: bool = ...) -> _Yaml: ... - +def safe_dump_all( + documents: Sequence[Any], + stream: None = ..., + *, + default_style=..., + default_flow_style=..., + canonical=..., + indent=..., + width=..., + allow_unicode=..., + line_break=..., + encoding: Optional[_Str] = ..., + explicit_start=..., + explicit_end=..., + version=..., + tags=..., + sort_keys: bool = ..., +) -> _Yaml: ... @overload -def safe_dump(data: Any, stream: IO[str], default_style=..., default_flow_style=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=..., encoding=..., explicit_start=..., explicit_end=..., version=..., tags=..., sort_keys: bool = ...) -> None: ... +def safe_dump( + data: Any, + stream: IO[str], + *, + default_style=..., + default_flow_style=..., + canonical=..., + indent=..., + width=..., + allow_unicode=..., + line_break=..., + encoding=..., + explicit_start=..., + explicit_end=..., + version=..., + tags=..., + sort_keys: bool = ..., +) -> None: ... @overload -def safe_dump(data: Any, stream: None = ..., default_style=..., default_flow_style=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=..., encoding: Optional[_Str] = ..., explicit_start=..., explicit_end=..., version=..., tags=..., sort_keys: bool = ...) -> _Yaml: ... - +def safe_dump( + data: Any, + stream: None = ..., + *, + default_style=..., + default_flow_style=..., + canonical=..., + indent=..., + width=..., + allow_unicode=..., + line_break=..., + encoding: Optional[_Str] = ..., + explicit_start=..., + explicit_end=..., + version=..., + tags=..., + sort_keys: bool = ..., +) -> _Yaml: ... def add_implicit_resolver(tag, regexp, first=..., Loader=..., Dumper=...): ... def add_path_resolver(tag, path, kind=..., Loader=..., Dumper=...): ... def add_constructor(tag, constructor, Loader=...): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/composer.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/composer.pyi old mode 100755 new mode 100644 index f1e2c03a..c367f50b --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/composer.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/composer.pyi @@ -1,6 +1,6 @@ from typing import Any -from yaml.error import Mark, YAMLError, MarkedYAMLError -from yaml.nodes import Node, ScalarNode, CollectionNode, SequenceNode, MappingNode + +from yaml.error import MarkedYAMLError class ComposerError(MarkedYAMLError): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/constructor.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/constructor.pyi old mode 100755 new mode 100644 index 1c3d9986..8ea89c61 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/constructor.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/constructor.pyi @@ -1,8 +1,8 @@ -from yaml.error import Mark, YAMLError, MarkedYAMLError -from yaml.nodes import Node, ScalarNode, CollectionNode, SequenceNode, MappingNode - +import sys from typing import Any +from yaml.error import MarkedYAMLError + class ConstructorError(MarkedYAMLError): ... class BaseConstructor: @@ -77,7 +77,8 @@ class Constructor(SafeConstructor): def find_python_name(self, name, mark): ... def construct_python_name(self, suffix, node): ... def construct_python_module(self, suffix, node): ... - class classobj: ... + if sys.version_info < (3, 0): + class classobj: ... def make_python_instance(self, suffix, node, args=..., kwds=..., newobj=...): ... def set_python_instance_state(self, instance, state): ... def construct_python_object(self, suffix, node): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/cyaml.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/cyaml.pyi old mode 100755 new mode 100644 index 0eef8159..50f7af2f --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/cyaml.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/cyaml.pyi @@ -1,13 +1,12 @@ -from typing import Any, IO, Mapping, Optional, Sequence, Text, Union -from typing_extensions import Protocol +from _typeshed import SupportsRead +from typing import IO, Any, Mapping, Optional, Sequence, Text, Union from yaml.constructor import BaseConstructor, Constructor, SafeConstructor from yaml.representer import BaseRepresenter, Representer, SafeRepresenter from yaml.resolver import BaseResolver, Resolver from yaml.serializer import Serializer -class _Readable(Protocol): - def read(self, size: int) -> Union[Text, bytes]: ... +_Readable = SupportsRead[Union[Text, bytes]] class CParser: def __init__(self, stream: Union[str, bytes, _Readable]) -> None: ... @@ -24,21 +23,38 @@ class CSafeLoader(CParser, SafeConstructor, Resolver): class CDangerLoader(CParser, Constructor, Resolver): ... # undocumented class CEmitter(object): - def __init__(self, stream: IO[Any], canonical: Optional[Any] = ..., - indent: Optional[int] = ..., width: Optional[int] = ..., - allow_unicode: Optional[Any] = ..., line_break: Optional[str] = ..., - encoding: Optional[Text] = ..., explicit_start: Optional[Any] = ..., - explicit_end: Optional[Any] = ..., version: Optional[Sequence[int]] = ..., - tags: Optional[Mapping[Text, Text]] = ...) -> None: ... + def __init__( + self, + stream: IO[Any], + canonical: Optional[Any] = ..., + indent: Optional[int] = ..., + width: Optional[int] = ..., + allow_unicode: Optional[Any] = ..., + line_break: Optional[str] = ..., + encoding: Optional[Text] = ..., + explicit_start: Optional[Any] = ..., + explicit_end: Optional[Any] = ..., + version: Optional[Sequence[int]] = ..., + tags: Optional[Mapping[Text, Text]] = ..., + ) -> None: ... class CBaseDumper(CEmitter, BaseRepresenter, BaseResolver): - def __init__(self, stream: IO[Any], default_style: Optional[str] = ..., - default_flow_style: Optional[bool] = ..., canonical: Optional[Any] = ..., - indent: Optional[int] = ..., width: Optional[int] = ..., - allow_unicode: Optional[Any] = ..., line_break: Optional[str] = ..., - encoding: Optional[Text] = ..., explicit_start: Optional[Any] = ..., - explicit_end: Optional[Any] = ..., version: Optional[Sequence[int]] = ..., - tags: Optional[Mapping[Text, Text]] = ...) -> None: ... + def __init__( + self, + stream: IO[Any], + default_style: Optional[str] = ..., + default_flow_style: Optional[bool] = ..., + canonical: Optional[Any] = ..., + indent: Optional[int] = ..., + width: Optional[int] = ..., + allow_unicode: Optional[Any] = ..., + line_break: Optional[str] = ..., + encoding: Optional[Text] = ..., + explicit_start: Optional[Any] = ..., + explicit_end: Optional[Any] = ..., + version: Optional[Sequence[int]] = ..., + tags: Optional[Mapping[Text, Text]] = ..., + ) -> None: ... class CDumper(CEmitter, SafeRepresenter, Resolver): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/dumper.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/dumper.pyi old mode 100755 new mode 100644 index e2613ef5..b2ca83fc --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/dumper.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/dumper.pyi @@ -1,13 +1,61 @@ from yaml.emitter import Emitter -from yaml.serializer import Serializer from yaml.representer import BaseRepresenter, Representer, SafeRepresenter from yaml.resolver import BaseResolver, Resolver +from yaml.serializer import Serializer class BaseDumper(Emitter, Serializer, BaseRepresenter, BaseResolver): - def __init__(self, stream, default_style=..., default_flow_style=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=..., encoding=..., explicit_start=..., explicit_end=..., version=..., tags=..., sort_keys: bool = ...) -> None: ... + def __init__( + self, + stream, + default_style=..., + default_flow_style=..., + canonical=..., + indent=..., + width=..., + allow_unicode=..., + line_break=..., + encoding=..., + explicit_start=..., + explicit_end=..., + version=..., + tags=..., + sort_keys: bool = ..., + ) -> None: ... class SafeDumper(Emitter, Serializer, SafeRepresenter, Resolver): - def __init__(self, stream, default_style=..., default_flow_style=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=..., encoding=..., explicit_start=..., explicit_end=..., version=..., tags=..., sort_keys: bool = ...) -> None: ... + def __init__( + self, + stream, + default_style=..., + default_flow_style=..., + canonical=..., + indent=..., + width=..., + allow_unicode=..., + line_break=..., + encoding=..., + explicit_start=..., + explicit_end=..., + version=..., + tags=..., + sort_keys: bool = ..., + ) -> None: ... class Dumper(Emitter, Serializer, Representer, Resolver): - def __init__(self, stream, default_style=..., default_flow_style=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=..., encoding=..., explicit_start=..., explicit_end=..., version=..., tags=..., sort_keys: bool = ...) -> None: ... + def __init__( + self, + stream, + default_style=..., + default_flow_style=..., + canonical=..., + indent=..., + width=..., + allow_unicode=..., + line_break=..., + encoding=..., + explicit_start=..., + explicit_end=..., + version=..., + tags=..., + sort_keys: bool = ..., + ) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/emitter.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/emitter.pyi old mode 100755 new mode 100644 index 5ca9cbb6..9f44bd77 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/emitter.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/emitter.pyi @@ -1,4 +1,5 @@ from typing import Any + from yaml.error import YAMLError class EmitterError(YAMLError): ... @@ -12,7 +13,9 @@ class ScalarAnalysis: allow_single_quoted: Any allow_double_quoted: Any allow_block: Any - def __init__(self, scalar, empty, multiline, allow_flow_plain, allow_block_plain, allow_single_quoted, allow_double_quoted, allow_block) -> None: ... + def __init__( + self, scalar, empty, multiline, allow_flow_plain, allow_block_plain, allow_single_quoted, allow_double_quoted, allow_block + ) -> None: ... class Emitter: DEFAULT_TAG_PREFIXES: Any diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/error.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/error.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/events.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/events.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/loader.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/loader.pyi old mode 100755 new mode 100644 index 15c3a50d..67bf6798 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/loader.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/loader.pyi @@ -1,9 +1,9 @@ -from yaml.reader import Reader -from yaml.scanner import Scanner -from yaml.parser import Parser from yaml.composer import Composer -from yaml.constructor import BaseConstructor, FullConstructor, SafeConstructor, Constructor +from yaml.constructor import BaseConstructor, Constructor, FullConstructor, SafeConstructor +from yaml.parser import Parser +from yaml.reader import Reader from yaml.resolver import BaseResolver, Resolver +from yaml.scanner import Scanner class BaseLoader(Reader, Scanner, Parser, Composer, BaseConstructor, BaseResolver): def __init__(self, stream) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/nodes.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/nodes.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/parser.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/parser.pyi old mode 100755 new mode 100644 index 4253e117..9dc41d2a --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/parser.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/parser.pyi @@ -1,4 +1,5 @@ from typing import Any + from yaml.error import MarkedYAMLError class ParserError(MarkedYAMLError): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/reader.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/reader.pyi old mode 100755 new mode 100644 index 05adf0cd..18c3c7a9 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/reader.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/reader.pyi @@ -1,4 +1,5 @@ from typing import Any + from yaml.error import YAMLError class ReaderError(YAMLError): diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/representer.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/representer.pyi old mode 100755 new mode 100644 index eca81cf1..ff5240e2 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/representer.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/representer.pyi @@ -1,4 +1,6 @@ +import sys from typing import Any + from yaml.error import YAMLError class RepresenterError(YAMLError): ... @@ -14,7 +16,8 @@ class BaseRepresenter: alias_key: Any def __init__(self, default_style=..., default_flow_style=..., sort_keys: bool = ...) -> None: ... def represent(self, data): ... - def get_classobj_bases(self, cls): ... + if sys.version_info < (3, 0): + def get_classobj_bases(self, cls): ... def represent_data(self, data): ... @classmethod def add_representer(cls, data_type, representer): ... @@ -29,10 +32,11 @@ class SafeRepresenter(BaseRepresenter): def ignore_aliases(self, data): ... def represent_none(self, data): ... def represent_str(self, data): ... - def represent_unicode(self, data): ... + if sys.version_info < (3, 0): + def represent_unicode(self, data): ... + def represent_long(self, data): ... def represent_bool(self, data): ... def represent_int(self, data): ... - def represent_long(self, data): ... inf_value: Any def represent_float(self, data): ... def represent_list(self, data): ... @@ -45,11 +49,12 @@ class SafeRepresenter(BaseRepresenter): class Representer(SafeRepresenter): def represent_str(self, data): ... - def represent_unicode(self, data): ... - def represent_long(self, data): ... + if sys.version_info < (3, 0): + def represent_unicode(self, data): ... + def represent_long(self, data): ... + def represent_instance(self, data): ... def represent_complex(self, data): ... def represent_tuple(self, data): ... def represent_name(self, data): ... def represent_module(self, data): ... - def represent_instance(self, data): ... def represent_object(self, data): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/resolver.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/resolver.pyi old mode 100755 new mode 100644 index 72975609..f5f534de --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/resolver.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/resolver.pyi @@ -1,4 +1,5 @@ from typing import Any + from yaml.error import YAMLError class ResolverError(YAMLError): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/scanner.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/scanner.pyi old mode 100755 new mode 100644 index 33f45dac..64890a19 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/scanner.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/scanner.pyi @@ -1,4 +1,5 @@ from typing import Any + from yaml.error import MarkedYAMLError class ScannerError(MarkedYAMLError): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/serializer.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/serializer.pyi old mode 100755 new mode 100644 index 0c169e86..8b85e3e4 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/serializer.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/serializer.pyi @@ -1,4 +1,5 @@ from typing import Any + from yaml.error import YAMLError class SerializerError(YAMLError): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/tokens.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/2and3/yaml/tokens.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/aiofiles/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/aiofiles/__init__.pyi new file mode 100644 index 00000000..2bbbc29a --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/3/aiofiles/__init__.pyi @@ -0,0 +1 @@ +from .threadpool import open as open diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/aiofiles/base.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/aiofiles/base.pyi new file mode 100644 index 00000000..0f5f99a2 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/3/aiofiles/base.pyi @@ -0,0 +1,35 @@ +from types import CodeType, FrameType, TracebackType, coroutine +from typing import Any, Coroutine, Generator, Generic, Iterator, Optional, Type, TypeVar, Union + +_T = TypeVar("_T") +_T_co = TypeVar("_T_co", covariant=True) +_V_co = TypeVar("_V_co", covariant=True) +_T_contra = TypeVar("_T_contra", contravariant=True) + +class AsyncBase(Generic[_T]): + def __init__(self, file: str, loop: Any, executor: Any) -> None: ... + async def __aiter__(self) -> Iterator[_T]: ... + async def __anext__(self) -> _T: ... + +class AiofilesContextManager(Generic[_T_co, _T_contra, _V_co]): + def __init__(self, coro: Coroutine[_T_co, _T_contra, _V_co]) -> None: ... + def send(self, value: _T_contra) -> _T_co: ... + def throw( + self, typ: Type[BaseException], val: Union[BaseException, object] = ..., tb: Optional[TracebackType] = ... + ) -> _T_co: ... + def close(self) -> None: ... + @property + def gi_frame(self) -> FrameType: ... + @property + def gi_running(self) -> bool: ... + @property + def gi_code(self) -> CodeType: ... + def __next__(self) -> _T_co: ... + @coroutine + def __iter__(self) -> Iterator[Coroutine[_T_co, _T_contra, _V_co]]: ... + def __await__(self) -> Generator[Any, None, _V_co]: ... + async def __anext__(self) -> _V_co: ... + async def __aenter__(self) -> _V_co: ... + async def __aexit__( + self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType] + ) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/aiofiles/os.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/aiofiles/os.pyi new file mode 100644 index 00000000..5144abe9 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/3/aiofiles/os.pyi @@ -0,0 +1,26 @@ +import sys +from _typeshed import AnyPath +from os import stat_result +from typing import Optional, Sequence, Union, overload + +_FdOrAnyPath = Union[int, AnyPath] + +async def stat(path: _FdOrAnyPath, *, dir_fd: Optional[int] = ..., follow_symlinks: bool = ...) -> stat_result: ... +async def rename(src: AnyPath, dst: AnyPath, *, src_dir_fd: Optional[int] = ..., dst_dir_fd: Optional[int] = ...) -> None: ... +async def remove(path: AnyPath, *, dir_fd: Optional[int] = ...) -> None: ... +async def mkdir(path: AnyPath, mode: int = ..., *, dir_fd: Optional[int] = ...) -> None: ... +async def rmdir(path: AnyPath, *, dir_fd: Optional[int] = ...) -> None: ... + +if sys.platform != "win32": + @overload + async def sendfile(__out_fd: int, __in_fd: int, offset: Optional[int], count: int) -> int: ... + @overload + async def sendfile( + __out_fd: int, + __in_fd: int, + offset: int, + count: int, + headers: Sequence[bytes] = ..., + trailers: Sequence[bytes] = ..., + flags: int = ..., + ) -> int: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/aiofiles/threadpool/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/aiofiles/threadpool/__init__.pyi new file mode 100644 index 00000000..bde6ad8a --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/3/aiofiles/threadpool/__init__.pyi @@ -0,0 +1,91 @@ +from _typeshed import AnyPath, OpenBinaryMode, OpenBinaryModeReading, OpenBinaryModeUpdating, OpenBinaryModeWriting, OpenTextMode +from asyncio import AbstractEventLoop +from typing import Any, Callable, Optional, TypeVar, Union, overload +from typing_extensions import Literal + +from ..base import AiofilesContextManager +from .binary import AsyncBufferedIOBase, AsyncBufferedReader, AsyncFileIO, _UnknownAsyncBinaryIO +from .text import AsyncTextIOWrapper + +_OpenFile = TypeVar("_OpenFile", bound=Union[AnyPath, int]) +_Opener = Callable[[str, int], int] + +# Text mode: always returns AsyncTextIOWrapper +@overload +def open( + file: _OpenFile, + mode: OpenTextMode = ..., + buffering: int = ..., + encoding: Optional[str] = ..., + errors: Optional[str] = ..., + newline: Optional[str] = ..., + closefd: bool = ..., + opener: Optional[_Opener] = ..., + *, + loop: Optional[AbstractEventLoop] = ..., + executor: Optional[Any] = ..., +) -> AiofilesContextManager[None, None, AsyncTextIOWrapper]: ... + +# Unbuffered binary: returns a FileIO +@overload +def open( + file: _OpenFile, + mode: OpenBinaryMode, + buffering: Literal[0], + encoding: None = ..., + errors: None = ..., + newline: None = ..., + closefd: bool = ..., + opener: Optional[_Opener] = ..., + *, + loop: Optional[AbstractEventLoop] = ..., + executor: Optional[Any] = ..., +) -> AiofilesContextManager[None, None, AsyncFileIO]: ... + +# Buffered binary reading/updating: AsyncBufferedReader +@overload +def open( + file: _OpenFile, + mode: Union[OpenBinaryModeReading, OpenBinaryModeUpdating], + buffering: Literal[-1, 1] = ..., + encoding: None = ..., + errors: None = ..., + newline: None = ..., + closefd: bool = ..., + opener: Optional[_Opener] = ..., + *, + loop: Optional[AbstractEventLoop] = ..., + executor: Optional[Any] = ..., +) -> AiofilesContextManager[None, None, AsyncBufferedReader]: ... + +# Buffered binary writing: AsyncBufferedIOBase +@overload +def open( + file: _OpenFile, + mode: OpenBinaryModeWriting, + buffering: Literal[-1, 1] = ..., + encoding: None = ..., + errors: None = ..., + newline: None = ..., + closefd: bool = ..., + opener: Optional[_Opener] = ..., + *, + loop: Optional[AbstractEventLoop] = ..., + executor: Optional[Any] = ..., +) -> AiofilesContextManager[None, None, AsyncBufferedIOBase]: ... + +# Buffering cannot be determined: fall back to _UnknownAsyncBinaryIO +@overload +def open( + file: _OpenFile, + mode: OpenBinaryMode, + buffering: int, + encoding: None = ..., + errors: None = ..., + newline: None = ..., + closefd: bool = ..., + opener: Optional[_Opener] = ..., + *, + loop: Optional[AbstractEventLoop] = ..., + executor: Optional[Any] = ..., +) -> AiofilesContextManager[None, None, _UnknownAsyncBinaryIO]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/aiofiles/threadpool/binary.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/aiofiles/threadpool/binary.pyi new file mode 100644 index 00000000..ecfd4ed1 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/3/aiofiles/threadpool/binary.pyi @@ -0,0 +1,41 @@ +from _typeshed import AnyPath, ReadableBuffer, WriteableBuffer +from io import FileIO +from typing import Iterable, List, Optional, Union + +from ..base import AsyncBase + +class _UnknownAsyncBinaryIO(AsyncBase[bytes]): + async def close(self) -> None: ... + async def flush(self) -> None: ... + async def isatty(self) -> bool: ... + async def read(self, __size: int = ...) -> bytes: ... + async def readinto(self, __buffer: WriteableBuffer) -> Optional[int]: ... + async def readline(self, __size: Optional[int] = ...) -> bytes: ... + async def readlines(self, __hint: int = ...) -> List[bytes]: ... + async def seek(self, __offset: int, __whence: int = ...) -> int: ... + async def seekable(self) -> bool: ... + async def tell(self) -> int: ... + async def truncate(self, __size: Optional[int] = ...) -> int: ... + async def writable(self) -> bool: ... + async def write(self, __b: ReadableBuffer) -> int: ... + async def writelines(self, __lines: Iterable[ReadableBuffer]) -> None: ... + def fileno(self) -> int: ... + def readable(self) -> bool: ... + @property + def closed(self) -> bool: ... + @property + def mode(self) -> str: ... + @property + def name(self) -> Union[AnyPath, int]: ... + +class AsyncBufferedIOBase(_UnknownAsyncBinaryIO): + async def read1(self, __size: int = ...) -> bytes: ... + def detach(self) -> FileIO: ... + @property + def raw(self) -> FileIO: ... + +class AsyncBufferedReader(AsyncBufferedIOBase): + async def peek(self, __size: int = ...) -> bytes: ... + +class AsyncFileIO(_UnknownAsyncBinaryIO): + async def readall(self) -> bytes: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/aiofiles/threadpool/text.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/aiofiles/threadpool/text.pyi new file mode 100644 index 00000000..39588f8a --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/3/aiofiles/threadpool/text.pyi @@ -0,0 +1,38 @@ +from _typeshed import AnyPath +from typing import BinaryIO, Iterable, List, Optional, Tuple, Union + +from ..base import AsyncBase + +class AsyncTextIOWrapper(AsyncBase[str]): + async def close(self) -> None: ... + async def flush(self) -> None: ... + async def isatty(self) -> bool: ... + async def read(self, __size: Optional[int] = ...) -> str: ... + async def readline(self, __size: int = ...) -> str: ... + async def readlines(self, __hint: int = ...) -> List[str]: ... + async def seek(self, __offset: int, __whence: int = ...) -> int: ... + async def seekable(self) -> bool: ... + async def tell(self) -> int: ... + async def truncate(self, __size: Optional[int] = ...) -> int: ... + async def writable(self) -> bool: ... + async def write(self, __b: str) -> int: ... + async def writelines(self, __lines: Iterable[str]) -> None: ... + def detach(self) -> BinaryIO: ... + def fileno(self) -> int: ... + def readable(self) -> bool: ... + @property + def buffer(self) -> BinaryIO: ... + @property + def closed(self) -> bool: ... + @property + def encoding(self) -> str: ... + @property + def errors(self) -> Optional[str]: ... + @property + def line_buffering(self) -> bool: ... + @property + def newlines(self) -> Union[str, Tuple[str, ...], None]: ... + @property + def name(self) -> Union[AnyPath, int]: ... + @property + def mode(self) -> str: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/contextvars.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/contextvars.pyi old mode 100755 new mode 100644 index a90c2a8b..429d2037 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/3/contextvars.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/3/contextvars.pyi @@ -1,6 +1,10 @@ +import sys from typing import Any, Callable, ClassVar, Generic, Iterator, Mapping, TypeVar -_T = TypeVar('_T') +if sys.version_info >= (3, 9): + from types import GenericAlias + +_T = TypeVar("_T") class ContextVar(Generic[_T]): def __init__(self, name: str, *, default: _T = ...) -> None: ... @@ -9,6 +13,8 @@ class ContextVar(Generic[_T]): def get(self, default: _T = ...) -> _T: ... def set(self, value: _T) -> Token[_T]: ... def reset(self, token: Token[_T]) -> None: ... + if sys.version_info >= (3, 9): + def __class_getitem__(cls, item: Any) -> GenericAlias: ... class Token(Generic[_T]): @property @@ -16,6 +22,8 @@ class Token(Generic[_T]): @property def old_value(self) -> Any: ... # returns either _T or MISSING, but that's hard to express MISSING: ClassVar[object] + if sys.version_info >= (3, 9): + def __class_getitem__(cls, item: Any) -> GenericAlias: ... def copy_context() -> Context: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/dataclasses.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/dataclasses.pyi old mode 100755 new mode 100644 index e3bf1d13..1f5b6b4d --- a/anaconda_lib/jedi/third_party/typeshed/third_party/3/dataclasses.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/3/dataclasses.pyi @@ -1,29 +1,30 @@ -from typing import overload, Any, Callable, Dict, Generic, Iterable, List, Mapping, Optional, Tuple, Type, TypeVar, Union +import sys +from typing import Any, Callable, Dict, Generic, Iterable, List, Mapping, Optional, Tuple, Type, TypeVar, Union, overload +if sys.version_info >= (3, 9): + from types import GenericAlias -_T = TypeVar('_T') +_T = TypeVar("_T") class _MISSING_TYPE: ... -MISSING: _MISSING_TYPE +MISSING: _MISSING_TYPE @overload def asdict(obj: Any) -> Dict[str, Any]: ... @overload def asdict(obj: Any, *, dict_factory: Callable[[List[Tuple[str, Any]]], _T]) -> _T: ... - @overload def astuple(obj: Any) -> Tuple[Any, ...]: ... @overload def astuple(obj: Any, *, tuple_factory: Callable[[List[Any]], _T]) -> _T: ... - - @overload def dataclass(_cls: Type[_T]) -> Type[_T]: ... - @overload -def dataclass(*, init: bool = ..., repr: bool = ..., eq: bool = ..., order: bool = ..., - unsafe_hash: bool = ..., frozen: bool = ...) -> Callable[[Type[_T]], Type[_T]]: ... - +def dataclass(_cls: None) -> Callable[[Type[_T]], Type[_T]]: ... +@overload +def dataclass( + *, init: bool = ..., repr: bool = ..., eq: bool = ..., order: bool = ..., unsafe_hash: bool = ..., frozen: bool = ... +) -> Callable[[Type[_T]], Type[_T]]: ... class Field(Generic[_T]): name: str @@ -35,37 +36,60 @@ class Field(Generic[_T]): init: bool compare: bool metadata: Mapping[str, Any] - + if sys.version_info >= (3, 9): + def __class_getitem__(cls, item: Any) -> GenericAlias: ... # NOTE: Actual return type is 'Field[_T]', but we want to help type checkers # to understand the magic that happens at runtime. @overload # `default` and `default_factory` are optional and mutually exclusive. -def field(*, default: _T, - init: bool = ..., repr: bool = ..., hash: Optional[bool] = ..., compare: bool = ..., - metadata: Optional[Mapping[str, Any]] = ...) -> _T: ... - +def field( + *, + default: _T, + init: bool = ..., + repr: bool = ..., + hash: Optional[bool] = ..., + compare: bool = ..., + metadata: Optional[Mapping[str, Any]] = ..., +) -> _T: ... @overload -def field(*, default_factory: Callable[[], _T], - init: bool = ..., repr: bool = ..., hash: Optional[bool] = ..., compare: bool = ..., - metadata: Optional[Mapping[str, Any]] = ...) -> _T: ... - +def field( + *, + default_factory: Callable[[], _T], + init: bool = ..., + repr: bool = ..., + hash: Optional[bool] = ..., + compare: bool = ..., + metadata: Optional[Mapping[str, Any]] = ..., +) -> _T: ... @overload -def field(*, - init: bool = ..., repr: bool = ..., hash: Optional[bool] = ..., compare: bool = ..., - metadata: Optional[Mapping[str, Any]] = ...) -> Any: ... - - +def field( + *, + init: bool = ..., + repr: bool = ..., + hash: Optional[bool] = ..., + compare: bool = ..., + metadata: Optional[Mapping[str, Any]] = ..., +) -> Any: ... def fields(class_or_instance: Any) -> Tuple[Field[Any], ...]: ... - def is_dataclass(obj: Any) -> bool: ... class FrozenInstanceError(AttributeError): ... -class InitVar(Generic[_T]): ... - -def make_dataclass(cls_name: str, fields: Iterable[Union[str, Tuple[str, type], Tuple[str, type, Field[Any]]]], *, - bases: Tuple[type, ...] = ..., namespace: Optional[Dict[str, Any]] = ..., - init: bool = ..., repr: bool = ..., eq: bool = ..., order: bool = ..., hash: bool = ..., - frozen: bool = ...): ... - +class InitVar(Generic[_T]): + if sys.version_info >= (3, 9): + def __class_getitem__(cls, type: Any) -> GenericAlias: ... + +def make_dataclass( + cls_name: str, + fields: Iterable[Union[str, Tuple[str, type], Tuple[str, type, Field[Any]]]], + *, + bases: Tuple[type, ...] = ..., + namespace: Optional[Dict[str, Any]] = ..., + init: bool = ..., + repr: bool = ..., + eq: bool = ..., + order: bool = ..., + unsafe_hash: bool = ..., + frozen: bool = ..., +) -> type: ... def replace(obj: _T, **changes: Any) -> _T: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/docutils/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/docutils/__init__.pyi old mode 100755 new mode 100644 index 024e962b..e27843e5 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/3/docutils/__init__.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/3/docutils/__init__.pyi @@ -1,3 +1,3 @@ from typing import Any -def __getattr__(name) -> Any: ... +def __getattr__(name: str) -> Any: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/docutils/examples.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/docutils/examples.pyi old mode 100755 new mode 100644 index ec73a299..581ebba7 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/3/docutils/examples.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/3/docutils/examples.pyi @@ -2,4 +2,4 @@ from typing import Any html_parts: Any -def __getattr__(name) -> Any: ... +def __getattr__(name: str) -> Any: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/docutils/nodes.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/docutils/nodes.pyi old mode 100755 new mode 100644 index 382112bf..11773347 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/3/docutils/nodes.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/3/docutils/nodes.pyi @@ -1,10 +1,6 @@ from typing import Any, List class reference: - def __init__(self, - rawsource: str = ..., - text: str = ..., - *children: List[Any], - **attributes) -> None: ... + def __init__(self, rawsource: str = ..., text: str = ..., *children: List[Any], **attributes: Any) -> None: ... -def __getattr__(name) -> Any: ... +def __getattr__(name: str) -> Any: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/docutils/parsers/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/docutils/parsers/__init__.pyi old mode 100755 new mode 100644 index 024e962b..e27843e5 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/3/docutils/parsers/__init__.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/3/docutils/parsers/__init__.pyi @@ -1,3 +1,3 @@ from typing import Any -def __getattr__(name) -> Any: ... +def __getattr__(name: str) -> Any: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/docutils/parsers/rst/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/docutils/parsers/rst/__init__.pyi old mode 100755 new mode 100644 index 024e962b..e27843e5 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/3/docutils/parsers/rst/__init__.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/3/docutils/parsers/rst/__init__.pyi @@ -1,3 +1,3 @@ from typing import Any -def __getattr__(name) -> Any: ... +def __getattr__(name: str) -> Any: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/docutils/parsers/rst/nodes.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/docutils/parsers/rst/nodes.pyi old mode 100755 new mode 100644 index 024e962b..e27843e5 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/3/docutils/parsers/rst/nodes.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/3/docutils/parsers/rst/nodes.pyi @@ -1,3 +1,3 @@ from typing import Any -def __getattr__(name) -> Any: ... +def __getattr__(name: str) -> Any: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/docutils/parsers/rst/roles.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/docutils/parsers/rst/roles.pyi old mode 100755 new mode 100644 index 622db836..2c3d65b6 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/3/docutils/parsers/rst/roles.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/3/docutils/parsers/rst/roles.pyi @@ -1,13 +1,12 @@ +from typing import Any, Callable, Dict, List, Tuple + import docutils.nodes import docutils.parsers.rst.states -from typing import Callable, Any, List, Dict, Tuple - _RoleFn = Callable[ [str, str, str, int, docutils.parsers.rst.states.Inliner, Dict[str, Any], List[str]], Tuple[List[docutils.nodes.reference], List[docutils.nodes.reference]], ] def register_local_role(name: str, role_fn: _RoleFn) -> None: ... - def __getattr__(name: str) -> Any: ... # incomplete diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/docutils/parsers/rst/states.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/docutils/parsers/rst/states.pyi old mode 100755 new mode 100644 index ac00fe1b..ac087269 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/3/docutils/parsers/rst/states.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/3/docutils/parsers/rst/states.pyi @@ -1,8 +1,6 @@ -import typing from typing import Any class Inliner: - def __init__(self) -> None: - ... + def __init__(self) -> None: ... -def __getattr__(name) -> Any: ... +def __getattr__(name: str) -> Any: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/filelock/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/filelock/__init__.pyi new file mode 100644 index 00000000..84a648f4 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/3/filelock/__init__.pyi @@ -0,0 +1,54 @@ +import sys +from logging import Logger +from types import TracebackType +from typing import Optional, Type, Union + +def logger() -> Logger: ... + +class Timeout(TimeoutError): + def __init__(self, lock_file: str) -> None: ... + def __str__(self) -> str: ... + +class _Acquire_ReturnProxy: + def __init__(self, lock: str) -> None: ... + def __enter__(self) -> str: ... + def __exit__( + self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], traceback: Optional[TracebackType] + ) -> None: ... + +class BaseFileLock: + def __init__(self, lock_file: str, timeout: Union[float, int, str] = ...) -> None: ... + @property + def lock_file(self) -> str: ... + @property + def timeout(self) -> float: ... + @timeout.setter + def timeout(self, value: Union[int, str, float]) -> None: ... + @property + def is_locked(self) -> bool: ... + def acquire(self, timeout: Optional[float] = ..., poll_intervall: float = ...) -> _Acquire_ReturnProxy: ... + def release(self, force: bool = ...) -> None: ... + def __enter__(self) -> BaseFileLock: ... + def __exit__( + self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], traceback: Optional[TracebackType] + ) -> None: ... + def __del__(self) -> None: ... + +class WindowsFileLock(BaseFileLock): + def _acquire(self) -> None: ... + def _release(self) -> None: ... + +class UnixFileLock(BaseFileLock): + def _acquire(self) -> None: ... + def _release(self) -> None: ... + +class SoftFileLock(BaseFileLock): + def _acquire(self) -> None: ... + def _release(self) -> None: ... + +if sys.platform == "win32": + FileLock = WindowsFileLock +elif sys.platform == "linux" or sys.platform == "darwin": + FileLock = UnixFileLock +else: + FileLock = SoftFileLock diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/freezegun/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/freezegun/__init__.pyi new file mode 100644 index 00000000..1de0916f --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/3/freezegun/__init__.pyi @@ -0,0 +1 @@ +from .api import freeze_time as freeze_time diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/freezegun/api.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/freezegun/api.pyi new file mode 100644 index 00000000..a0d50ed7 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/3/freezegun/api.pyi @@ -0,0 +1,56 @@ +from datetime import date, datetime, timedelta +from numbers import Real +from typing import Any, Awaitable, Callable, Iterator, Optional, Sequence, Type, TypeVar, Union, overload + +_T = TypeVar("_T") +_Freezable = Union[str, datetime, date, timedelta] + +class TickingDateTimeFactory(object): + def __init__(self, time_to_freeze: datetime, start: datetime) -> None: ... + def __call__(self) -> datetime: ... + +class FrozenDateTimeFactory(object): + def __init__(self, time_to_freeze: datetime) -> None: ... + def __call__(self) -> datetime: ... + def tick(self, delta: Union[float, Real, timedelta] = ...) -> None: ... + def move_to(self, target_datetime: Optional[_Freezable]) -> None: ... + +class StepTickTimeFactory(object): + def __init__(self, time_to_freeze: datetime, step_width: float) -> None: ... + def __call__(self) -> datetime: ... + def tick(self, delta: Optional[timedelta] = ...) -> None: ... + def update_step_width(self, step_width: float) -> None: ... + def move_to(self, target_datetime: Optional[_Freezable]) -> None: ... + +class _freeze_time: + def __init__( + self, + time_to_freeze_str: Optional[_Freezable], + tz_offset: float, + ignore: Sequence[str], + tick: bool, + as_arg: bool, + auto_tick_seconds: float, + ) -> None: ... + @overload + def __call__(self, func: Type[_T]) -> Type[_T]: ... + @overload + def __call__(self, func: Callable[..., Awaitable[_T]]) -> Callable[..., Awaitable[_T]]: ... + @overload + def __call__(self, func: Callable[..., _T]) -> Callable[..., _T]: ... + def __enter__(self) -> Any: ... + def __exit__(self, *args: Any) -> None: ... + def start(self) -> Any: ... + def stop(self) -> None: ... + def decorate_class(self, klass: Type[_T]) -> _T: ... + def decorate_coroutine(self, coroutine: _T) -> _T: ... + def decorate_callable(self, func: Callable[..., _T]) -> Callable[..., _T]: ... + +def freeze_time( + time_to_freeze: Optional[Union[_Freezable, Callable[..., _Freezable], Iterator[_Freezable]]] = ..., + tz_offset: Optional[float] = ..., + ignore: Optional[Sequence[str]] = ..., + tick: Optional[bool] = ..., + as_arg: Optional[bool] = ..., + auto_tick_seconds: Optional[float] = ..., +) -> _freeze_time: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/frozendict.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/frozendict.pyi new file mode 100644 index 00000000..704a44c1 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/3/frozendict.pyi @@ -0,0 +1,27 @@ +import collections +from typing import Any, Dict, Generic, Iterable, Iterator, Mapping, Tuple, Type, TypeVar, overload + +_S = TypeVar("_S") +_KT = TypeVar("_KT") +_VT = TypeVar("_VT") + +class frozendict(Mapping[_KT, _VT], Generic[_KT, _VT]): + + dict_cls: Type[Dict] = ... + @overload + def __init__(self, **kwargs: _VT) -> None: ... + @overload + def __init__(self, mapping: Mapping[_KT, _VT]) -> None: ... + @overload + def __init__(self, iterable: Iterable[Tuple[_KT, _VT]]) -> None: ... + def __getitem__(self, key: _KT) -> _VT: ... + def __contains__(self, key: object) -> bool: ... + def copy(self: _S, **add_or_replace: _VT) -> _S: ... + def __iter__(self) -> Iterator[_KT]: ... + def __len__(self) -> int: ... + def __repr__(self) -> str: ... + def __hash__(self) -> int: ... + +class FrozenOrderedDict(frozendict): + + dict_cls: Type[collections.OrderedDict] = ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/jwt/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/jwt/__init__.pyi old mode 100755 new mode 100644 index c868ea09..d2b45a2d --- a/anaconda_lib/jedi/third_party/typeshed/third_party/3/jwt/__init__.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/3/jwt/__init__.pyi @@ -1,18 +1,24 @@ -from typing import Mapping, Any, Optional, Union, Dict +from typing import Any, Dict, Mapping, Optional, Union -from . import algorithms from cryptography.hazmat.primitives.asymmetric import rsa +from . import algorithms -def decode(jwt: Union[str, bytes], key: Union[str, bytes, rsa.RSAPublicKey, rsa.RSAPrivateKey] = ..., - verify: bool = ..., algorithms: Optional[Any] = ..., - options: Optional[Mapping[Any, Any]] = ..., - **kwargs: Any) -> Dict[str, Any]: ... - -def encode(payload: Mapping[str, Any], key: Union[str, bytes, rsa.RSAPublicKey, rsa.RSAPrivateKey], - algorithm: str = ..., headers: Optional[Mapping[str, Any]] = ..., - json_encoder: Optional[Any] = ...) -> bytes: ... - +def decode( + jwt: Union[str, bytes], + key: Union[str, bytes, rsa.RSAPublicKey, rsa.RSAPrivateKey] = ..., + verify: bool = ..., + algorithms: Optional[Any] = ..., + options: Optional[Mapping[Any, Any]] = ..., + **kwargs: Any, +) -> Dict[str, Any]: ... +def encode( + payload: Mapping[str, Any], + key: Union[str, bytes, rsa.RSAPublicKey, rsa.RSAPrivateKey], + algorithm: str = ..., + headers: Optional[Mapping[str, Any]] = ..., + json_encoder: Optional[Any] = ..., +) -> bytes: ... def register_algorithm(alg_id: str, alg_obj: algorithms.Algorithm[Any]) -> None: ... def unregister_algorithm(alg_id: str) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/jwt/algorithms.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/jwt/algorithms.pyi old mode 100755 new mode 100644 index a93f44f5..fe83e56b --- a/anaconda_lib/jedi/third_party/typeshed/third_party/3/jwt/algorithms.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/3/jwt/algorithms.pyi @@ -1,6 +1,27 @@ import sys from hashlib import _Hash -from typing import Any, Set, Dict, Optional, ClassVar, Union, Generic, TypeVar +from typing import Any, ClassVar, Dict, Generic, Optional, Set, TypeVar, Union + +from cryptography.hazmat.primitives import hashes +from cryptography.hazmat.primitives.asymmetric.ec import ( + EllipticCurvePrivateKey, + EllipticCurvePrivateKeyWithSerialization, + EllipticCurvePrivateNumbers, + EllipticCurvePublicKey, + EllipticCurvePublicKeyWithSerialization, + EllipticCurvePublicNumbers, +) +from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PrivateKey, Ed25519PublicKey +from cryptography.hazmat.primitives.asymmetric.rsa import ( + RSAPrivateKey, + RSAPrivateKeyWithSerialization, + RSAPrivateNumbers, + RSAPublicKey, + RSAPublicKeyWithSerialization, + RSAPublicNumbers, +) +from cryptography.hazmat.primitives.asymmetric.utils import Prehashed +from cryptography.hazmat.primitives.hashes import HashAlgorithm requires_cryptography = Set[str] @@ -23,56 +44,47 @@ class NoneAlgorithm(Algorithm[None]): class _HashAlg: def __call__(self, arg: Union[bytes, bytearray, memoryview] = ...) -> _Hash: ... -if sys.version_info >= (3, 6): - _LoadsString = Union[str, bytes, bytearray] -else: - _LoadsString = str - class HMACAlgorithm(Algorithm[bytes]): SHA256: ClassVar[_HashAlg] SHA384: ClassVar[_HashAlg] SHA512: ClassVar[_HashAlg] hash_alg: _HashAlg - def __init__(self, _HashAlg) -> None: ... + def __init__(self, hash_alg: _HashAlg) -> None: ... def prepare_key(self, key: Union[str, bytes]) -> bytes: ... @staticmethod def to_jwk(key_obj: Union[str, bytes]) -> str: ... @staticmethod - def from_jwk(jwk: _LoadsString) -> bytes: ... + def from_jwk(jwk: Union[str, bytes]) -> bytes: ... -# Only defined if cryptography is installed. Types should be tightened when -# cryptography gets type hints. -# See https://github.com/python/typeshed/issues/2542 +# Only defined if cryptography is installed. class RSAAlgorithm(Algorithm[Any]): - SHA256: ClassVar[Any] - SHA384: ClassVar[Any] - SHA512: ClassVar[Any] - hash_alg: Any - def __init__(self, hash_alg: Any) -> None: ... - def prepare_key(self, key: Any) -> Any: ... - @staticmethod - def to_jwk(key_obj: Any) -> str: ... + SHA256: ClassVar[hashes.SHA256] + SHA384: ClassVar[hashes.SHA384] + SHA512: ClassVar[hashes.SHA512] + hash_alg: Union[HashAlgorithm, Prehashed] + def __init__(self, hash_alg: Union[HashAlgorithm, Prehashed]) -> None: ... + def prepare_key(self, key: Union[bytes, str, RSAPrivateKey, RSAPublicKey]) -> Union[RSAPrivateKey, RSAPublicKey]: ... @staticmethod - def from_jwk(jwk: _LoadsString) -> Any: ... - def sign(self, msg: bytes, key: Any) -> bytes: ... - def verify(self, msg: bytes, key: Any, sig: bytes) -> bool: ... + def from_jwk(jwk: Union[str, bytes, Dict[str, Any]]) -> Union[RSAPrivateKey, RSAPublicKey]: ... + def sign(self, msg: bytes, key: RSAPrivateKey) -> bytes: ... + def verify(self, msg: bytes, key: RSAPublicKey, sig: bytes) -> bool: ... -# Only defined if cryptography is installed. Types should be tightened when -# cryptography gets type hints. -# See https://github.com/python/typeshed/issues/2542 +# Only defined if cryptography is installed. class ECAlgorithm(Algorithm[Any]): - SHA256: ClassVar[Any] - SHA384: ClassVar[Any] - SHA512: ClassVar[Any] - hash_alg: Any - def __init__(self, hash_alg: Any) -> None: ... - def prepare_key(self, key: Any) -> Any: ... + SHA256: ClassVar[hashes.SHA256] + SHA384: ClassVar[hashes.SHA384] + SHA512: ClassVar[hashes.SHA512] + hash_alg: Union[HashAlgorithm, Prehashed] + def __init__(self, hash_alg: Union[HashAlgorithm, Prehashed]) -> None: ... + def prepare_key( + self, key: Union[bytes, str, EllipticCurvePrivateKey, EllipticCurvePublicKey] + ) -> Union[EllipticCurvePrivateKey, EllipticCurvePublicKey]: ... @staticmethod - def to_jwk(key_obj: Any) -> str: ... + def to_jwk(key_obj: Union[EllipticCurvePrivateKeyWithSerialization, EllipticCurvePublicKeyWithSerialization]) -> str: ... @staticmethod - def from_jwk(jwk: _LoadsString) -> Any: ... - def sign(self, msg: bytes, key: Any) -> bytes: ... - def verify(self, msg: bytes, key: Any, sig: bytes) -> bool: ... + def from_jwk(jwk: Union[str, bytes]) -> Union[EllipticCurvePrivateKey, EllipticCurvePublicKey]: ... + def sign(self, msg: bytes, key: EllipticCurvePrivateKey) -> bytes: ... + def verify(self, msg: bytes, key: EllipticCurvePublicKey, sig: bytes) -> bool: ... # Only defined if cryptography is installed. Types should be tightened when # cryptography gets type hints. @@ -80,3 +92,10 @@ class ECAlgorithm(Algorithm[Any]): class RSAPSSAlgorithm(RSAAlgorithm): def sign(self, msg: bytes, key: Any) -> bytes: ... def verify(self, msg: bytes, key: Any, sig: bytes) -> bool: ... + +# Only defined if cryptography is installed. +class Ed25519Algorithm(Algorithm[Any]): + def __init__(self, **kwargs: Any) -> None: ... + def prepare_key(self, key: Union[str, bytes, Ed25519PrivateKey, Ed25519PublicKey]) -> Any: ... + def sign(self, msg: Union[str, bytes], key: Ed25519PrivateKey) -> bytes: ... + def verify(self, msg: Union[str, bytes], key: Ed25519PublicKey, sig: Union[str, bytes]) -> bool: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/jwt/contrib/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/jwt/contrib/__init__.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/jwt/contrib/algorithms/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/jwt/contrib/algorithms/__init__.pyi old mode 100755 new mode 100644 index b2bb1f64..e69de29b --- a/anaconda_lib/jedi/third_party/typeshed/third_party/3/jwt/contrib/algorithms/__init__.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/3/jwt/contrib/algorithms/__init__.pyi @@ -1 +0,0 @@ -from hashlib import _Hash as _HashAlg diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/jwt/contrib/algorithms/py_ecdsa.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/jwt/contrib/algorithms/py_ecdsa.pyi old mode 100755 new mode 100644 index 93f0e1a2..0f63de0a --- a/anaconda_lib/jedi/third_party/typeshed/third_party/3/jwt/contrib/algorithms/py_ecdsa.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/3/jwt/contrib/algorithms/py_ecdsa.pyi @@ -1,10 +1,10 @@ +import hashlib from typing import Any -from jwt.algorithms import Algorithm -from . import _HashAlg +from jwt.algorithms import Algorithm class ECAlgorithm(Algorithm[Any]): - SHA256: _HashAlg - SHA384: _HashAlg - SHA512: _HashAlg - def __init__(self, hash_alg: _HashAlg) -> None: ... + SHA256: hashlib._Hash + SHA384: hashlib._Hash + SHA512: hashlib._Hash + def __init__(self, hash_alg: hashlib._Hash) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/jwt/contrib/algorithms/pycrypto.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/jwt/contrib/algorithms/pycrypto.pyi old mode 100755 new mode 100644 index a86233fc..077684c6 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/3/jwt/contrib/algorithms/pycrypto.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/3/jwt/contrib/algorithms/pycrypto.pyi @@ -1,10 +1,10 @@ +import hashlib from typing import Any -from jwt.algorithms import Algorithm -from . import _HashAlg +from jwt.algorithms import Algorithm class RSAAlgorithm(Algorithm[Any]): - SHA256: _HashAlg - SHA384: _HashAlg - SHA512: _HashAlg - def __init__(self, hash_alg: _HashAlg) -> None: ... + SHA256: hashlib._Hash + SHA384: hashlib._Hash + SHA512: hashlib._Hash + def __init__(self, hash_alg: hashlib._Hash) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/orjson.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/orjson.pyi old mode 100755 new mode 100644 index b7187721..3fcbd7b6 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/3/orjson.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/3/orjson.pyi @@ -1,20 +1,24 @@ -# https://github.com/ijl/orjson/blob/master/orjson.pyi - from typing import Any, Callable, Optional, Union -__version__ = str +__version__: str -def dumps( - __obj: Any, - default: Optional[Callable[[Any], Any]] = ..., - option: Optional[int] = ..., -) -> bytes: ... +def dumps(__obj: Any, default: Optional[Callable[[Any], Any]] = ..., option: Optional[int] = ...) -> bytes: ... def loads(__obj: Union[bytes, bytearray, str]) -> Any: ... class JSONDecodeError(ValueError): ... class JSONEncodeError(TypeError): ... -OPT_SERIALIZE_DATACLASS: int +OPT_APPEND_NEWLINE: int +OPT_INDENT_2: int OPT_NAIVE_UTC: int +OPT_NON_STR_KEYS: int OPT_OMIT_MICROSECONDS: int +OPT_PASSTHROUGH_DATACLASS: int +OPT_PASSTHROUGH_DATETIME: int +OPT_PASSTHROUGH_SUBCLASS: int +OPT_SERIALIZE_DATACLASS: int +OPT_SERIALIZE_NUMPY: int +OPT_SERIALIZE_UUID: int +OPT_SORT_KEYS: int OPT_STRICT_INTEGER: int +OPT_UTC_Z: int diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/pkg_resources/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/pkg_resources/__init__.pyi old mode 100755 new mode 100644 index 0b6eb3af..7f827747 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/3/pkg_resources/__init__.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/3/pkg_resources/__init__.pyi @@ -1,10 +1,8 @@ -# Stubs for pkg_resources (Python 3.4) - -from typing import Any, Callable, Dict, IO, Iterable, Generator, Optional, Sequence, Tuple, List, Set, Union, TypeVar, overload -from abc import ABCMeta import importlib.abc import types import zipimport +from abc import ABCMeta +from typing import IO, Any, Callable, Dict, Generator, Iterable, List, Optional, Sequence, Set, Tuple, TypeVar, Union, overload _T = TypeVar("_T") _NestedStr = Union[str, Iterable[Union[str, Iterable[Any]]]] @@ -12,7 +10,7 @@ _InstallerType = Callable[[Requirement], Optional[Distribution]] _EPDistType = Union[Distribution, Requirement, str] _MetadataType = Optional[IResourceProvider] _PkgReqType = Union[str, Requirement] -_DistFinderType = Callable[[str, _Importer, bool], Generator[Distribution, None, None]] +_DistFinderType = Callable[[_Importer, str, bool], Generator[Distribution, None, None]] _NSHandlerType = Callable[[_Importer, str, str, types.ModuleType], str] def declare_namespace(name: str) -> None: ... @@ -29,7 +27,7 @@ class WorkingSet: def __iter__(self) -> Generator[Distribution, None, None]: ... def find(self, req: Requirement) -> Optional[Distribution]: ... def resolve( - self, requirements: Sequence[Requirement], env: Optional[Environment] = ..., installer: Optional[_InstallerType] = ... + self, requirements: Iterable[Requirement], env: Optional[Environment] = ..., installer: Optional[_InstallerType] = ... ) -> List[Distribution]: ... def add(self, dist: Distribution, entry: Optional[str] = ..., insert: bool = ..., replace: bool = ...) -> None: ... def subscribe(self, callback: Callable[[Distribution], None]) -> None: ... @@ -39,7 +37,7 @@ class WorkingSet: working_set: WorkingSet -def require(*requirements: Union[str, Sequence[str]]) -> Sequence[Distribution]: ... +def require(*requirements: _NestedStr) -> Sequence[Distribution]: ... def run_script(requires: str, script_name: str) -> None: ... def iter_entry_points(group: str, name: Optional[str] = ...) -> Generator[EntryPoint, None, None]: ... def add_activation_listener(callback: Callable[[Distribution], None]) -> None: ... @@ -81,7 +79,7 @@ class Requirement: def __contains__(self, item: Union[Distribution, str, Tuple[str, ...]]) -> bool: ... def __eq__(self, other_requirement: Any) -> bool: ... -def load_entry_point(dist: _EPDistType, group: str, name: str) -> None: ... +def load_entry_point(dist: _EPDistType, group: str, name: str) -> Any: ... def get_entry_info(dist: _EPDistType, group: str, name: str) -> Optional[EntryPoint]: ... @overload def get_entry_map(dist: _EPDistType) -> Dict[str, Dict[str, EntryPoint]]: ... @@ -133,7 +131,7 @@ class Distribution(IResourceProvider, IMetadataProvider): def __init__( self, location: Optional[str] = ..., - metadata: Optional[str] = ..., + metadata: _MetadataType = ..., project_name: Optional[str] = ..., version: Optional[str] = ..., py_version: str = ..., @@ -142,10 +140,10 @@ class Distribution(IResourceProvider, IMetadataProvider): ) -> None: ... @classmethod def from_location( - cls, location: str, basename: str, metadata: Optional[str] = ..., **kw: Union[str, None, int] + cls, location: str, basename: str, metadata: _MetadataType = ..., **kw: Union[str, None, int] ) -> Distribution: ... @classmethod - def from_filename(cls, filename: str, metadata: Optional[str] = ..., **kw: Union[str, None, int]) -> Distribution: ... + def from_filename(cls, filename: str, metadata: _MetadataType = ..., **kw: Union[str, None, int]) -> Distribution: ... def activate(self, path: Optional[List[str]] = ...) -> None: ... def as_requirement(self) -> Requirement: ... def requires(self, extras: Tuple[str, ...] = ...) -> List[Requirement]: ... @@ -157,7 +155,7 @@ class Distribution(IResourceProvider, IMetadataProvider): def get_entry_map(self) -> Dict[str, Dict[str, EntryPoint]]: ... @overload def get_entry_map(self, group: str) -> Dict[str, EntryPoint]: ... - def load_entry_point(self, group: str, name: str) -> None: ... + def load_entry_point(self, group: str, name: str) -> Any: ... EGG_DIST: int BINARY_DIST: int @@ -183,7 +181,7 @@ class IResourceManager: def resource_filename(self, package_or_requirement: _PkgReqType, resource_name: str) -> str: ... def set_extraction_path(self, path: str) -> None: ... def cleanup_resources(self, force: bool = ...) -> List[str]: ... - def get_cache_path(self, archive_name: str, names: Tuple[str, ...] = ...) -> str: ... + def get_cache_path(self, archive_name: str, names: Iterable[str] = ...) -> str: ... def extraction_error(self) -> None: ... def postprocess(self, tempname: str, filename: str) -> None: ... @@ -201,7 +199,15 @@ class IMetadataProvider: def run_script(self, script_name: str, namespace: Dict[str, Any]) -> None: ... class ResolutionError(Exception): ... -class DistributionNotFound(ResolutionError): ... + +class DistributionNotFound(ResolutionError): + @property + def req(self) -> Requirement: ... + @property + def requirers(self) -> Set[str]: ... + @property + def requirers_str(self) -> str: ... + def report(self) -> str: ... class VersionConflict(ResolutionError): @property @@ -209,11 +215,11 @@ class VersionConflict(ResolutionError): @property def req(self) -> Any: ... def report(self) -> str: ... - def with_context(self, required_by: Dict[str, Any]) -> VersionConflict: ... + def with_context(self, required_by: Set[Union[Distribution, str]]) -> VersionConflict: ... class ContextualVersionConflict(VersionConflict): @property - def required_by(self) -> Set[Any]: ... + def required_by(self) -> Set[Union[Distribution, str]]: ... class UnknownExtra(ResolutionError): ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/pkg_resources/py31compat.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/pkg_resources/py31compat.pyi old mode 100755 new mode 100644 index aefe1130..162da65e --- a/anaconda_lib/jedi/third_party/typeshed/third_party/3/pkg_resources/py31compat.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/3/pkg_resources/py31compat.pyi @@ -1,6 +1,4 @@ -from typing import Text import os -import sys needs_makedirs: bool diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/pyrfc3339/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/pyrfc3339/__init__.pyi new file mode 100644 index 00000000..d8c1ca5e --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/3/pyrfc3339/__init__.pyi @@ -0,0 +1,2 @@ +from .generator import generate as generate +from .parser import parse as parse diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/pyrfc3339/generator.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/pyrfc3339/generator.pyi new file mode 100644 index 00000000..9375b5b6 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/3/pyrfc3339/generator.pyi @@ -0,0 +1,3 @@ +from datetime import datetime + +def generate(dt: datetime, utc: bool = ..., accept_naive: bool = ..., microseconds: bool = ...) -> str: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/pyrfc3339/parser.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/pyrfc3339/parser.pyi new file mode 100644 index 00000000..445b542c --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/3/pyrfc3339/parser.pyi @@ -0,0 +1,3 @@ +from datetime import datetime + +def parse(timestamp: str, utc: bool = ..., produce_naive: bool = ...) -> datetime: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/pyrfc3339/utils.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/pyrfc3339/utils.pyi new file mode 100644 index 00000000..f49a8c06 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/3/pyrfc3339/utils.pyi @@ -0,0 +1,11 @@ +from datetime import datetime, timedelta, tzinfo +from typing import Optional + +class FixedOffset(tzinfo): + def __init__(self, hours: float, minutes: float) -> None: ... + def dst(self, dt: Optional[datetime]) -> timedelta: ... + def utcoffset(self, dt: Optional[datetime]) -> timedelta: ... + def tzname(self, dt: Optional[datetime]) -> str: ... + +def timedelta_seconds(td: timedelta) -> int: ... +def timezone(utcoffset: float) -> str: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/__init__.pyi old mode 100755 new mode 100644 index b785eaca..bd055bbc --- a/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/__init__.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/__init__.pyi @@ -1,7 +1,11 @@ -# Stubs for six (Python 3.5) - from __future__ import print_function +import types +import typing +import unittest +from builtins import next as next +from functools import wraps as wraps +from io import BytesIO as BytesIO, StringIO as StringIO from typing import ( Any, AnyStr, @@ -14,7 +18,6 @@ from typing import ( NoReturn, Optional, Pattern, - Text, Tuple, Type, TypeVar, @@ -22,19 +25,14 @@ from typing import ( ValuesView, overload, ) -import types -import typing -import unittest -# Exports -from io import StringIO as StringIO, BytesIO as BytesIO -from builtins import next as next -from functools import wraps as wraps -from . import moves +from . import moves as moves + +_T = TypeVar("_T") +_K = TypeVar("_K") +_V = TypeVar("_V") -_T = TypeVar('_T') -_K = TypeVar('_K') -_V = TypeVar('_V') +__version__: str # TODO make constant, then move this stub to 2and3 # https://github.com/python/typeshed/issues/17 @@ -42,19 +40,15 @@ PY2 = False PY3 = True PY34: bool -string_types = str, -integer_types = int, -class_types = type, +string_types = (str,) +integer_types = (int,) +class_types = (type,) text_type = str binary_type = bytes MAXSIZE: int -# def add_move -# def remove_move - def callable(obj: object) -> bool: ... - def get_unbound_function(unbound: types.FunctionType) -> types.FunctionType: ... def create_bound_method(func: types.FunctionType, obj: object) -> types.MethodType: ... def create_unbound_method(func: types.FunctionType, cls: type) -> types.FunctionType: ... @@ -67,42 +61,65 @@ def get_function_closure(fun: types.FunctionType) -> Optional[Tuple[types._Cell, def get_function_code(fun: types.FunctionType) -> types.CodeType: ... def get_function_defaults(fun: types.FunctionType) -> Optional[Tuple[Any, ...]]: ... def get_function_globals(fun: types.FunctionType) -> Dict[str, Any]: ... - def iterkeys(d: Mapping[_K, _V]) -> typing.Iterator[_K]: ... def itervalues(d: Mapping[_K, _V]) -> typing.Iterator[_V]: ... def iteritems(d: Mapping[_K, _V]) -> typing.Iterator[Tuple[_K, _V]]: ... + # def iterlists def viewkeys(d: Mapping[_K, _V]) -> KeysView[_K]: ... def viewvalues(d: Mapping[_K, _V]) -> ValuesView[_V]: ... def viewitems(d: Mapping[_K, _V]) -> ItemsView[_K, _V]: ... - def b(s: str) -> binary_type: ... def u(s: str) -> text_type: ... unichr = chr + def int2byte(i: int) -> bytes: ... def byte2int(bs: binary_type) -> int: ... def indexbytes(buf: binary_type, i: int) -> int: ... def iterbytes(buf: binary_type) -> typing.Iterator[int]: ... - def assertCountEqual(self: unittest.TestCase, first: Iterable[_T], second: Iterable[_T], msg: Optional[str] = ...) -> None: ... @overload def assertRaisesRegex(self: unittest.TestCase, msg: Optional[str] = ...) -> Any: ... @overload def assertRaisesRegex(self: unittest.TestCase, callable_obj: Callable[..., Any], *args: Any, **kwargs: Any) -> Any: ... -def assertRegex(self: unittest.TestCase, text: AnyStr, expected_regex: Union[AnyStr, Pattern[AnyStr]], msg: Optional[str] = ...) -> None: ... +def assertRegex( + self: unittest.TestCase, text: AnyStr, expected_regex: Union[AnyStr, Pattern[AnyStr]], msg: Optional[str] = ... +) -> None: ... exec_ = exec -def reraise(tp: Optional[Type[BaseException]], value: Optional[BaseException], tb: Optional[types.TracebackType] = ...) -> NoReturn: ... +def reraise( + tp: Optional[Type[BaseException]], value: Optional[BaseException], tb: Optional[types.TracebackType] = ... +) -> NoReturn: ... def raise_from(value: Union[BaseException, Type[BaseException]], from_value: Optional[BaseException]) -> NoReturn: ... print_ = print def with_metaclass(meta: type, *bases: type) -> type: ... def add_metaclass(metaclass: type) -> Callable[[_T], _T]: ... -def ensure_binary(s: Union[bytes, Text], encoding: str = ..., errors: str = ...) -> bytes: ... -def ensure_str(s: Union[bytes, Text], encoding: str = ..., errors: str = ...) -> str: ... -def ensure_text(s: Union[bytes, Text], encoding: str = ..., errors: str = ...) -> Text: ... +def ensure_binary(s: Union[bytes, str], encoding: str = ..., errors: str = ...) -> bytes: ... +def ensure_str(s: Union[bytes, str], encoding: str = ..., errors: str = ...) -> str: ... +def ensure_text(s: Union[bytes, str], encoding: str = ..., errors: str = ...) -> str: ... def python_2_unicode_compatible(klass: _T) -> _T: ... + +class _LazyDescriptor: + name: str + def __init__(self, name: str) -> None: ... + def __get__(self, obj: Optional[object], type: Optional[type] = ...) -> Any: ... + +class MovedModule(_LazyDescriptor): + mod: str + def __init__(self, name: str, old: str, new: Optional[str] = ...) -> None: ... + def __getattr__(self, attr: str) -> Any: ... + +class MovedAttribute(_LazyDescriptor): + mod: str + attr: str + def __init__( + self, name: str, old_mod: str, new_mod: str, old_attr: Optional[str] = ..., new_attr: Optional[str] = ... + ) -> None: ... + +def add_move(move: Union[MovedModule, MovedAttribute]) -> None: ... +def remove_move(name: str) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/BaseHTTPServer.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/BaseHTTPServer.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/CGIHTTPServer.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/CGIHTTPServer.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/SimpleHTTPServer.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/SimpleHTTPServer.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/__init__.pyi old mode 100755 new mode 100644 index 3d6efced..3455676d --- a/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/__init__.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/__init__.pyi @@ -2,68 +2,64 @@ # # Note: Commented out items means they weren't implemented at the time. # Uncomment them when the modules have been added to the typeshed. -import sys - -from io import StringIO as cStringIO -from builtins import filter as filter -from itertools import filterfalse as filterfalse -from builtins import input as input -from sys import intern as intern -from builtins import map as map -from os import getcwd as getcwd -from os import getcwdb as getcwdb -from builtins import range as range +import importlib +import shlex +from builtins import filter as filter, input as input, map as map, range as range, zip as zip +from collections import UserDict as UserDict, UserList as UserList, UserString as UserString from functools import reduce as reduce -from shlex import quote as shlex_quote from io import StringIO as StringIO -from collections import UserDict as UserDict -from collections import UserList as UserList -from collections import UserString as UserString -from builtins import range as xrange -from builtins import zip as zip -from itertools import zip_longest as zip_longest -from . import builtins -from . import configparser -# import copyreg as copyreg -# import dbm.gnu as dbm_gnu -from . import _dummy_thread -from . import http_cookiejar -from . import http_cookies -from . import html_entities -from . import html_parser -from . import http_client -from . import email_mime_multipart -from . import email_mime_nonmultipart -from . import email_mime_text -from . import email_mime_base -from . import BaseHTTPServer -from . import CGIHTTPServer -from . import SimpleHTTPServer -from . import cPickle -from . import queue -from . import reprlib -from . import socketserver -from . import _thread -from . import tkinter -from . import tkinter_dialog -from . import tkinter_filedialog -# import tkinter.scrolledtext as tkinter_scrolledtext -# import tkinter.simpledialog as tkinter_simpledialog -# import tkinter.tix as tkinter_tix -from . import tkinter_ttk -from . import tkinter_constants -# import tkinter.dnd as tkinter_dnd -# import tkinter.colorchooser as tkinter_colorchooser -from . import tkinter_commondialog -from . import tkinter_tkfiledialog +from itertools import filterfalse as filterfalse, zip_longest as zip_longest +from os import getcwd as getcwd, getcwdb as getcwdb +from sys import intern as intern + # import tkinter.font as tkinter_font # import tkinter.messagebox as tkinter_messagebox # import tkinter.simpledialog as tkinter_tksimpledialog -from . import urllib_parse -from . import urllib_error -from . import urllib -from . import urllib_robotparser +# import tkinter.dnd as tkinter_dnd +# import tkinter.colorchooser as tkinter_colorchooser +# import tkinter.scrolledtext as tkinter_scrolledtext +# import tkinter.simpledialog as tkinter_simpledialog +# import tkinter.tix as tkinter_tix +# import copyreg as copyreg +# import dbm.gnu as dbm_gnu +from . import ( + BaseHTTPServer as BaseHTTPServer, + CGIHTTPServer as CGIHTTPServer, + SimpleHTTPServer as SimpleHTTPServer, + _dummy_thread as _dummy_thread, + _thread as _thread, + builtins as builtins, + configparser as configparser, + cPickle as cPickle, + email_mime_base as email_mime_base, + email_mime_multipart as email_mime_multipart, + email_mime_nonmultipart as email_mime_nonmultipart, + email_mime_text as email_mime_text, + html_entities as html_entities, + html_parser as html_parser, + http_client as http_client, + http_cookiejar as http_cookiejar, + http_cookies as http_cookies, + queue as queue, + reprlib as reprlib, + socketserver as socketserver, + tkinter as tkinter, + tkinter_commondialog as tkinter_commondialog, + tkinter_constants as tkinter_constants, + tkinter_dialog as tkinter_dialog, + tkinter_filedialog as tkinter_filedialog, + tkinter_tkfiledialog as tkinter_tkfiledialog, + tkinter_ttk as tkinter_ttk, + urllib as urllib, + urllib_error as urllib_error, + urllib_parse as urllib_parse, + urllib_robotparser as urllib_robotparser, +) + # import xmlrpc.client as xmlrpc_client # import xmlrpc.server as xmlrpc_server -from importlib import reload as reload_module +xrange = range +reload_module = importlib.reload +cStringIO = StringIO +shlex_quote = shlex.quote diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/_dummy_thread.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/_dummy_thread.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/_thread.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/_thread.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/builtins.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/builtins.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/cPickle.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/cPickle.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/collections_abc.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/collections_abc.pyi new file mode 100644 index 00000000..dba0f153 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/collections_abc.pyi @@ -0,0 +1 @@ +from collections.abc import * diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/configparser.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/configparser.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/email_mime_base.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/email_mime_base.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/email_mime_multipart.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/email_mime_multipart.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/email_mime_nonmultipart.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/email_mime_nonmultipart.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/email_mime_text.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/email_mime_text.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/html_entities.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/html_entities.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/html_parser.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/html_parser.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/http_client.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/http_client.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/http_cookiejar.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/http_cookiejar.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/http_cookies.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/http_cookies.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/queue.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/queue.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/reprlib.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/reprlib.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/socketserver.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/socketserver.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/tkinter.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/tkinter.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_commondialog.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_commondialog.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_constants.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_constants.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_dialog.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_dialog.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_filedialog.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_filedialog.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_tkfiledialog.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_tkfiledialog.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_ttk.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_ttk.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib/__init__.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib/error.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib/error.pyi old mode 100755 new mode 100644 index 83f0d22d..4e10fe2f --- a/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib/error.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib/error.pyi @@ -1,3 +1 @@ -from urllib.error import URLError as URLError -from urllib.error import HTTPError as HTTPError -from urllib.error import ContentTooShortError as ContentTooShortError +from urllib.error import ContentTooShortError as ContentTooShortError, HTTPError as HTTPError, URLError as URLError diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib/parse.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib/parse.pyi old mode 100755 new mode 100644 index 265660d3..20adc639 --- a/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib/parse.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib/parse.pyi @@ -2,27 +2,29 @@ # # Note: Commented out items means they weren't implemented at the time. # Uncomment them when the modules have been added to the typeshed. -from urllib.parse import ParseResult as ParseResult -from urllib.parse import SplitResult as SplitResult -from urllib.parse import parse_qs as parse_qs -from urllib.parse import parse_qsl as parse_qsl -from urllib.parse import urldefrag as urldefrag -from urllib.parse import urljoin as urljoin -from urllib.parse import urlparse as urlparse -from urllib.parse import urlsplit as urlsplit -from urllib.parse import urlunparse as urlunparse -from urllib.parse import urlunsplit as urlunsplit -from urllib.parse import quote as quote -from urllib.parse import quote_plus as quote_plus -from urllib.parse import unquote as unquote -from urllib.parse import unquote_plus as unquote_plus -from urllib.parse import unquote_to_bytes as unquote_to_bytes -from urllib.parse import urlencode as urlencode # from urllib.parse import splitquery as splitquery # from urllib.parse import splittag as splittag # from urllib.parse import splituser as splituser -from urllib.parse import uses_fragment as uses_fragment -from urllib.parse import uses_netloc as uses_netloc -from urllib.parse import uses_params as uses_params -from urllib.parse import uses_query as uses_query -from urllib.parse import uses_relative as uses_relative +from urllib.parse import ( + ParseResult as ParseResult, + SplitResult as SplitResult, + parse_qs as parse_qs, + parse_qsl as parse_qsl, + quote as quote, + quote_plus as quote_plus, + unquote as unquote, + unquote_plus as unquote_plus, + unquote_to_bytes as unquote_to_bytes, + urldefrag as urldefrag, + urlencode as urlencode, + urljoin as urljoin, + urlparse as urlparse, + urlsplit as urlsplit, + urlunparse as urlunparse, + urlunsplit as urlunsplit, + uses_fragment as uses_fragment, + uses_netloc as uses_netloc, + uses_params as uses_params, + uses_query as uses_query, + uses_relative as uses_relative, +) diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib/request.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib/request.pyi old mode 100755 new mode 100644 index b01dea74..9b670b4d --- a/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib/request.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib/request.pyi @@ -2,38 +2,40 @@ # # Note: Commented out items means they weren't implemented at the time. # Uncomment them when the modules have been added to the typeshed. -from urllib.request import urlopen as urlopen -from urllib.request import install_opener as install_opener -from urllib.request import build_opener as build_opener -from urllib.request import pathname2url as pathname2url -from urllib.request import url2pathname as url2pathname -from urllib.request import getproxies as getproxies -from urllib.request import Request as Request -from urllib.request import OpenerDirector as OpenerDirector -from urllib.request import HTTPDefaultErrorHandler as HTTPDefaultErrorHandler -from urllib.request import HTTPRedirectHandler as HTTPRedirectHandler -from urllib.request import HTTPCookieProcessor as HTTPCookieProcessor -from urllib.request import ProxyHandler as ProxyHandler -from urllib.request import BaseHandler as BaseHandler -from urllib.request import HTTPPasswordMgr as HTTPPasswordMgr -from urllib.request import HTTPPasswordMgrWithDefaultRealm as HTTPPasswordMgrWithDefaultRealm -from urllib.request import AbstractBasicAuthHandler as AbstractBasicAuthHandler -from urllib.request import HTTPBasicAuthHandler as HTTPBasicAuthHandler -from urllib.request import ProxyBasicAuthHandler as ProxyBasicAuthHandler -from urllib.request import AbstractDigestAuthHandler as AbstractDigestAuthHandler -from urllib.request import HTTPDigestAuthHandler as HTTPDigestAuthHandler -from urllib.request import ProxyDigestAuthHandler as ProxyDigestAuthHandler -from urllib.request import HTTPHandler as HTTPHandler -from urllib.request import HTTPSHandler as HTTPSHandler -from urllib.request import FileHandler as FileHandler -from urllib.request import FTPHandler as FTPHandler -from urllib.request import CacheFTPHandler as CacheFTPHandler -from urllib.request import UnknownHandler as UnknownHandler -from urllib.request import HTTPErrorProcessor as HTTPErrorProcessor -from urllib.request import urlretrieve as urlretrieve -from urllib.request import urlcleanup as urlcleanup -from urllib.request import URLopener as URLopener -from urllib.request import FancyURLopener as FancyURLopener # from urllib.request import proxy_bypass as proxy_bypass -from urllib.request import parse_http_list as parse_http_list -from urllib.request import parse_keqv_list as parse_keqv_list +from urllib.request import ( + AbstractBasicAuthHandler as AbstractBasicAuthHandler, + AbstractDigestAuthHandler as AbstractDigestAuthHandler, + BaseHandler as BaseHandler, + CacheFTPHandler as CacheFTPHandler, + FancyURLopener as FancyURLopener, + FileHandler as FileHandler, + FTPHandler as FTPHandler, + HTTPBasicAuthHandler as HTTPBasicAuthHandler, + HTTPCookieProcessor as HTTPCookieProcessor, + HTTPDefaultErrorHandler as HTTPDefaultErrorHandler, + HTTPDigestAuthHandler as HTTPDigestAuthHandler, + HTTPErrorProcessor as HTTPErrorProcessor, + HTTPHandler as HTTPHandler, + HTTPPasswordMgr as HTTPPasswordMgr, + HTTPPasswordMgrWithDefaultRealm as HTTPPasswordMgrWithDefaultRealm, + HTTPRedirectHandler as HTTPRedirectHandler, + HTTPSHandler as HTTPSHandler, + OpenerDirector as OpenerDirector, + ProxyBasicAuthHandler as ProxyBasicAuthHandler, + ProxyDigestAuthHandler as ProxyDigestAuthHandler, + ProxyHandler as ProxyHandler, + Request as Request, + UnknownHandler as UnknownHandler, + URLopener as URLopener, + build_opener as build_opener, + getproxies as getproxies, + install_opener as install_opener, + parse_http_list as parse_http_list, + parse_keqv_list as parse_keqv_list, + pathname2url as pathname2url, + url2pathname as url2pathname, + urlcleanup as urlcleanup, + urlopen as urlopen, + urlretrieve as urlretrieve, +) diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib/response.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib/response.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib/robotparser.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib/robotparser.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib_error.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib_error.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib_parse.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib_parse.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib_request.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib_request.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib_response.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib_response.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib_robotparser.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/six/moves/urllib_robotparser.pyi old mode 100755 new mode 100644 diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/typed_ast/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/typed_ast/__init__.pyi old mode 100755 new mode 100644 index f260032d..e69de29b --- a/anaconda_lib/jedi/third_party/typeshed/third_party/3/typed_ast/__init__.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/3/typed_ast/__init__.pyi @@ -1,2 +0,0 @@ -# This module is a fork of the CPython 2 and 3 ast modules with PEP 484 support. -# See: https://github.com/python/typed_ast diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/typed_ast/ast27.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/typed_ast/ast27.pyi old mode 100755 new mode 100644 index c5643422..139e58aa --- a/anaconda_lib/jedi/third_party/typeshed/third_party/3/typed_ast/ast27.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/3/typed_ast/ast27.pyi @@ -1,7 +1,7 @@ import typing -from typing import Any, Optional, Union, Generic, Iterator +from typing import Any, Iterator, Optional, Union -class NodeVisitor(): +class NodeVisitor: def visit(self, node: AST) -> Any: ... def generic_visit(self, node: AST) -> None: ... @@ -28,10 +28,9 @@ identifier = str class AST: _attributes: typing.Tuple[str, ...] _fields: typing.Tuple[str, ...] - def __init__(self, *args, **kwargs) -> None: ... + def __init__(self, *args: Any, **kwargs: Any) -> None: ... -class mod(AST): - ... +class mod(AST): ... class Module(mod): body: typing.List[stmt] @@ -50,7 +49,6 @@ class FunctionType(mod): class Suite(mod): body: typing.List[stmt] - class stmt(AST): lineno: int col_offset: int @@ -152,10 +150,7 @@ class Expr(stmt): class Pass(stmt): ... class Break(stmt): ... class Continue(stmt): ... - - -class slice(AST): - ... +class slice(AST): ... _slice = slice # this lets us type the variable named 'slice' below @@ -172,7 +167,6 @@ class Index(slice): class Ellipsis(slice): ... - class expr(AST): lineno: int col_offset: int @@ -245,7 +239,7 @@ class Num(expr): n: Union[int, float, complex] class Str(expr): - s: bytes + s: Union[str, bytes] kind: str class Attribute(expr): @@ -270,27 +264,17 @@ class Tuple(expr): elts: typing.List[expr] ctx: expr_context - -class expr_context(AST): - ... - +class expr_context(AST): ... class AugLoad(expr_context): ... class AugStore(expr_context): ... class Del(expr_context): ... class Load(expr_context): ... class Param(expr_context): ... class Store(expr_context): ... - - -class boolop(AST): - ... - +class boolop(AST): ... class And(boolop): ... class Or(boolop): ... - -class operator(AST): - ... - +class operator(AST): ... class Add(operator): ... class BitAnd(operator): ... class BitOr(operator): ... @@ -303,18 +287,12 @@ class Mult(operator): ... class Pow(operator): ... class RShift(operator): ... class Sub(operator): ... - -class unaryop(AST): - ... - +class unaryop(AST): ... class Invert(unaryop): ... class Not(unaryop): ... class UAdd(unaryop): ... class USub(unaryop): ... - -class cmpop(AST): - ... - +class cmpop(AST): ... class Eq(cmpop): ... class Gt(cmpop): ... class GtE(cmpop): ... @@ -326,13 +304,11 @@ class LtE(cmpop): ... class NotEq(cmpop): ... class NotIn(cmpop): ... - class comprehension(AST): target: expr iter: expr ifs: typing.List[expr] - class ExceptHandler(AST): type: Optional[expr] name: Optional[expr] @@ -340,7 +316,6 @@ class ExceptHandler(AST): lineno: int col_offset: int - class arguments(AST): args: typing.List[expr] vararg: Optional[identifier] @@ -356,6 +331,5 @@ class alias(AST): name: identifier asname: Optional[identifier] - class TypeIgnore(AST): lineno: int diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/typed_ast/ast3.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/typed_ast/ast3.pyi old mode 100755 new mode 100644 index 1962b463..3dac9b2e --- a/anaconda_lib/jedi/third_party/typeshed/third_party/3/typed_ast/ast3.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/3/typed_ast/ast3.pyi @@ -1,21 +1,18 @@ import typing -from typing import Any, Optional, Union, Generic, Iterator +from typing import Any, Iterator, Optional, Union -class NodeVisitor(): +class NodeVisitor: def visit(self, node: AST) -> Any: ... def generic_visit(self, node: AST) -> None: ... class NodeTransformer(NodeVisitor): def generic_visit(self, node: AST) -> None: ... -def parse(source: Union[str, bytes], - filename: Union[str, bytes] = ..., - mode: str = ..., - feature_version: int = ...) -> AST: ... +def parse(source: Union[str, bytes], filename: Union[str, bytes] = ..., mode: str = ..., feature_version: int = ...) -> AST: ... def copy_location(new_node: AST, old_node: AST) -> AST: ... def dump(node: AST, annotate_fields: bool = ..., include_attributes: bool = ...) -> str: ... def fix_missing_locations(node: AST) -> AST: ... -def get_docstring(node: AST, clean: bool = ...) -> str: ... +def get_docstring(node: AST, clean: bool = ...) -> Optional[str]: ... def increment_lineno(node: AST, n: int = ...) -> AST: ... def iter_child_nodes(node: AST) -> Iterator[AST]: ... def iter_fields(node: AST) -> Iterator[typing.Tuple[str, Any]]: ... @@ -31,10 +28,9 @@ identifier = str class AST: _attributes: typing.Tuple[str, ...] _fields: typing.Tuple[str, ...] - def __init__(self, *args, **kwargs) -> None: ... + def __init__(self, *args: Any, **kwargs: Any) -> None: ... -class mod(AST): - ... +class mod(AST): ... class Module(mod): body: typing.List[stmt] @@ -53,7 +49,6 @@ class FunctionType(mod): class Suite(mod): body: typing.List[stmt] - class stmt(AST): lineno: int col_offset: int @@ -171,10 +166,7 @@ class Expr(stmt): class Pass(stmt): ... class Break(stmt): ... class Continue(stmt): ... - - -class slice(AST): - ... +class slice(AST): ... _slice = slice # this lets us type the variable named 'slice' below @@ -189,7 +181,6 @@ class ExtSlice(slice): class Index(slice): value: expr - class expr(AST): lineno: int col_offset: int @@ -308,27 +299,17 @@ class Tuple(expr): elts: typing.List[expr] ctx: expr_context - -class expr_context(AST): - ... - +class expr_context(AST): ... class AugLoad(expr_context): ... class AugStore(expr_context): ... class Del(expr_context): ... class Load(expr_context): ... class Param(expr_context): ... class Store(expr_context): ... - - -class boolop(AST): - ... - +class boolop(AST): ... class And(boolop): ... class Or(boolop): ... - -class operator(AST): - ... - +class operator(AST): ... class Add(operator): ... class BitAnd(operator): ... class BitOr(operator): ... @@ -342,18 +323,12 @@ class MatMult(operator): ... class Pow(operator): ... class RShift(operator): ... class Sub(operator): ... - -class unaryop(AST): - ... - +class unaryop(AST): ... class Invert(unaryop): ... class Not(unaryop): ... class UAdd(unaryop): ... class USub(unaryop): ... - -class cmpop(AST): - ... - +class cmpop(AST): ... class Eq(cmpop): ... class Gt(cmpop): ... class GtE(cmpop): ... @@ -365,14 +340,12 @@ class LtE(cmpop): ... class NotEq(cmpop): ... class NotIn(cmpop): ... - class comprehension(AST): target: expr iter: expr ifs: typing.List[expr] is_async: int - class ExceptHandler(AST): type: Optional[expr] name: Optional[identifier] @@ -380,7 +353,6 @@ class ExceptHandler(AST): lineno: int col_offset: int - class arguments(AST): args: typing.List[arg] vararg: Optional[arg] @@ -408,6 +380,5 @@ class withitem(AST): context_expr: expr optional_vars: Optional[expr] - class TypeIgnore(AST): lineno: int diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/typed_ast/conversions.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/typed_ast/conversions.pyi old mode 100755 new mode 100644 index d5f18299..c7088ecc --- a/anaconda_lib/jedi/third_party/typeshed/third_party/3/typed_ast/conversions.pyi +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/3/typed_ast/conversions.pyi @@ -1,4 +1,3 @@ -from . import ast27 -from . import ast3 +from . import ast3, ast27 def py2to3(ast: ast27.AST) -> ast3.AST: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/waitress/__init__.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/waitress/__init__.pyi new file mode 100644 index 00000000..2abd726d --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/3/waitress/__init__.pyi @@ -0,0 +1,7 @@ +from typing import Any, Tuple + +from waitress.server import create_server as create_server + +def serve(app: Any, **kw: Any) -> None: ... +def serve_paste(app: Any, global_conf: Any, **kw: Any) -> int: ... +def profile(cmd: Any, globals: Any, locals: Any, sort_order: Tuple[str, ...], callers: bool) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/waitress/adjustments.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/waitress/adjustments.pyi new file mode 100644 index 00000000..54b15ee2 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/3/waitress/adjustments.pyi @@ -0,0 +1,61 @@ +from socket import SocketType +from typing import Any, Dict, FrozenSet, Iterable, List, Optional, Sequence, Set, Tuple, Union + +from .compat import HAS_IPV6 as HAS_IPV6, PY2 as PY2, WIN as WIN, string_types as string_types +from .proxy_headers import PROXY_HEADERS as PROXY_HEADERS + +truthy: FrozenSet +KNOWN_PROXY_HEADERS: FrozenSet + +def asbool(s: Optional[Union[bool, str, int]]) -> bool: ... +def asoctal(s: str) -> int: ... +def aslist_cronly(value: str) -> List[str]: ... +def aslist(value: str) -> List[str]: ... +def asset(value: Optional[str]) -> Set[str]: ... +def slash_fixed_str(s: Optional[str]) -> str: ... +def str_iftruthy(s: Optional[str]) -> Optional[str]: ... +def as_socket_list(sockets: Sequence[object]) -> List[SocketType]: ... + +class _str_marker(str): ... +class _int_marker(int): ... +class _bool_marker: ... + +class Adjustments: + host: _str_marker = ... + port: _int_marker = ... + listen: List[str] = ... + threads: int = ... + trusted_proxy: Optional[str] = ... + trusted_proxy_count: Optional[int] = ... + trusted_proxy_headers: Set[str] = ... + log_untrusted_proxy_headers: bool = ... + clear_untrusted_proxy_headers: Union[_bool_marker, bool] = ... + url_scheme: str = ... + url_prefix: str = ... + ident: str = ... + backlog: int = ... + recv_bytes: int = ... + send_bytes: int = ... + outbuf_overflow: int = ... + outbuf_high_watermark: int = ... + inbuf_overflow: int = ... + connection_limit: int = ... + cleanup_interval: int = ... + channel_timeout: int = ... + log_socket_errors: bool = ... + max_request_header_size: int = ... + max_request_body_size: int = ... + expose_tracebacks: bool = ... + unix_socket: Optional[str] = ... + unix_socket_perms: int = ... + socket_options: List[Tuple[int, int, int]] = ... + asyncore_loop_timeout: int = ... + asyncore_use_poll: bool = ... + ipv4: bool = ... + ipv6: bool = ... + sockets: List[SocketType] = ... + def __init__(self, **kw: Any) -> None: ... + @classmethod + def parse_args(cls, argv: str) -> Tuple[Dict[str, Any], Any]: ... + @classmethod + def check_sockets(cls, sockets: Iterable[SocketType]) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/waitress/buffers.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/waitress/buffers.pyi new file mode 100644 index 00000000..fc5147e0 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/3/waitress/buffers.pyi @@ -0,0 +1,57 @@ +from io import BufferedIOBase, BufferedRandom, BytesIO +from typing import Any, Callable, Optional + +COPY_BYTES: int +STRBUF_LIMIT: int + +class FileBasedBuffer: + remain: int = ... + file: BytesIO = ... + def __init__(self, file: BytesIO, from_buffer: Optional[BytesIO] = ...) -> None: ... + def __len__(self) -> int: ... + def __nonzero__(self) -> bool: ... + __bool__: Callable[[], bool] = ... + def append(self, s: Any) -> None: ... + def get(self, numbytes: int = ..., skip: bool = ...) -> bytes: ... + def skip(self, numbytes: int, allow_prune: int = ...) -> None: ... + def newfile(self) -> Any: ... + def prune(self) -> None: ... + def getfile(self) -> Any: ... + def close(self) -> None: ... + +class TempfileBasedBuffer(FileBasedBuffer): + def __init__(self, from_buffer: Optional[BytesIO] = ...) -> None: ... + def newfile(self) -> BufferedRandom: ... + +class BytesIOBasedBuffer(FileBasedBuffer): + file: BytesIO = ... + def __init__(self, from_buffer: Optional[BytesIO] = ...) -> None: ... + def newfile(self) -> BytesIO: ... + +class ReadOnlyFileBasedBuffer(FileBasedBuffer): + file: BytesIO = ... + block_size: int = ... + def __init__(self, file: BytesIO, block_size: int = ...) -> None: ... + remain: int = ... + def prepare(self, size: Optional[int] = ...) -> int: ... + def get(self, numbytes: int = ..., skip: bool = ...) -> bytes: ... + def __iter__(self) -> ReadOnlyFileBasedBuffer: ... + def next(self) -> Optional[bytes]: ... + __next__: Callable[[], Optional[bytes]] = ... + def append(self, s: Any) -> None: ... + +class OverflowableBuffer: + overflowed: bool = ... + buf: Optional[BufferedIOBase] = ... + strbuf: bytes = ... + overflow: int = ... + def __init__(self, overflow: int) -> None: ... + def __len__(self) -> int: ... + def __nonzero__(self) -> bool: ... + __bool__: Callable[[], bool] = ... + def append(self, s: bytes) -> None: ... + def get(self, numbytes: int = ..., skip: bool = ...) -> bytes: ... + def skip(self, numbytes: int, allow_prune: bool = ...) -> None: ... + def prune(self) -> None: ... + def getfile(self) -> BytesIO: ... + def close(self) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/waitress/channel.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/waitress/channel.pyi new file mode 100644 index 00000000..43e0ad80 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/3/waitress/channel.pyi @@ -0,0 +1,49 @@ +from socket import SocketType +from threading import Condition, Lock +from typing import Mapping, Optional, Sequence, Tuple + +from waitress.adjustments import Adjustments +from waitress.buffers import OverflowableBuffer +from waitress.parser import HTTPRequestParser +from waitress.server import BaseWSGIServer +from waitress.task import ErrorTask, WSGITask + +from . import wasyncore as wasyncore + +class ClientDisconnected(Exception): ... + +class HTTPChannel(wasyncore.dispatcher): + task_class: WSGITask = ... + error_task_class: ErrorTask = ... + parser_class: HTTPRequestParser = ... + request: HTTPRequestParser = ... + last_activity: float = ... + will_close: bool = ... + close_when_flushed: bool = ... + requests: Sequence[HTTPRequestParser] = ... + sent_continue: bool = ... + total_outbufs_len: int = ... + current_outbuf_count: int = ... + server: BaseWSGIServer = ... + adj: Adjustments = ... + outbufs: Sequence[OverflowableBuffer] = ... + creation_time: float = ... + sendbuf_len: int = ... + task_lock: Lock = ... + outbuf_lock: Condition = ... + addr: Tuple[str, int] = ... + def __init__( + self, server: BaseWSGIServer, sock: SocketType, addr: str, adj: Adjustments, map: Optional[Mapping[int, SocketType]] = ... + ) -> None: ... + def writable(self) -> bool: ... + def handle_write(self) -> None: ... + def readable(self) -> bool: ... + def handle_read(self) -> None: ... + def received(self, data: bytes) -> bool: ... + connected: bool = ... + def handle_close(self) -> None: ... + def add_channel(self, map: Optional[Mapping[int, SocketType]] = ...) -> None: ... + def del_channel(self, map: Optional[Mapping[int, SocketType]] = ...) -> None: ... + def write_soon(self, data: bytes) -> int: ... + def service(self) -> None: ... + def cancel(self) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/waitress/compat.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/waitress/compat.pyi new file mode 100644 index 00000000..3e8fd859 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/3/waitress/compat.pyi @@ -0,0 +1,39 @@ +import sys +from io import TextIOWrapper +from typing import Any, Optional, Tuple + +PY2: bool +PY3: bool +WIN: bool +string_types: Tuple[ + str, +] +integer_types: Tuple[ + int, +] +class_types: Tuple[ + type, +] +text_type = str +binary_type = bytes +long = int + +def unquote_bytes_to_wsgi(bytestring: bytes) -> str: ... +def text_(s: str, encoding: str = ..., errors: str = ...) -> str: ... +def tostr(s: str) -> str: ... +def tobytes(s: str) -> bytes: ... + +exec_: Any + +def reraise(tp: Any, value: BaseException, tb: Optional[str] = ...) -> None: ... + +MAXINT: int +HAS_IPV6: bool +IPPROTO_IPV6: int +IPV6_V6ONLY: int + +def set_nonblocking(fd: TextIOWrapper) -> None: ... + +ResourceWarning: Warning + +def qualname(cls: Any) -> str: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/waitress/parser.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/waitress/parser.pyi new file mode 100644 index 00000000..551bad0a --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/3/waitress/parser.pyi @@ -0,0 +1,43 @@ +from io import BytesIO +from typing import Mapping, Optional, Pattern, Sequence, Tuple, Union + +from waitress.adjustments import Adjustments +from waitress.receiver import ChunkedReceiver, FixedStreamReceiver +from waitress.utilities import Error + +from .rfc7230 import HEADER_FIELD as HEADER_FIELD + +class ParsingError(Exception): ... +class TransferEncodingNotImplemented(Exception): ... + +class HTTPRequestParser: + completed: bool = ... + empty: bool = ... + expect_continue: bool = ... + headers_finished: bool = ... + header_plus: bytes = ... + chunked: bool = ... + content_length: int = ... + header_bytes_received: int = ... + body_bytes_received: int = ... + body_rcv: Optional[Union[ChunkedReceiver, FixedStreamReceiver]] = ... + version: str = ... + error: Optional[Error] = ... + connection_close: bool = ... + headers: Mapping[str, str] = ... + adj: Adjustments = ... + def __init__(self, adj: Adjustments) -> None: ... + def received(self, data: bytes) -> int: ... + first_line: str = ... + command: bytes = ... + url_scheme: str = ... + def parse_header(self, header_plus: bytes) -> None: ... + def get_body_stream(self) -> BytesIO: ... + def close(self) -> None: ... + +def split_uri(uri: bytes) -> Tuple[str, str, bytes, str, str]: ... +def get_header_lines(header: bytes) -> Sequence[bytes]: ... + +first_line_re: Pattern + +def crack_first_line(line: str) -> Tuple[bytes, bytes, bytes]: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/waitress/proxy_headers.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/waitress/proxy_headers.pyi new file mode 100644 index 00000000..5712b119 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/3/waitress/proxy_headers.pyi @@ -0,0 +1,32 @@ +from collections import namedtuple +from logging import Logger +from typing import Any, Callable, Mapping, Optional, Sequence, Set + +from .utilities import BadRequest as BadRequest + +PROXY_HEADERS: frozenset + +Forwarded = namedtuple("Forwarded", ["by", "for_", "host", "proto"]) + +class MalformedProxyHeader(Exception): + header: str = ... + reason: str = ... + value: str = ... + def __init__(self, header: str, reason: str, value: str) -> None: ... + +def proxy_headers_middleware( + app: Any, + trusted_proxy: Optional[str] = ..., + trusted_proxy_count: int = ..., + trusted_proxy_headers: Optional[Set[str]] = ..., + clear_untrusted: bool = ..., + log_untrusted: bool = ..., + logger: Logger = ..., +) -> Callable[..., Any]: ... +def parse_proxy_headers( + environ: Mapping[str, str], trusted_proxy_count: int, trusted_proxy_headers: Set[str], logger: Logger = ... +) -> Set[str]: ... +def strip_brackets(addr: str) -> str: ... +def clear_untrusted_headers( + environ: Mapping[str, str], untrusted_headers: Sequence[str], log_warning: bool = ..., logger: Logger = ... +) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/waitress/receiver.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/waitress/receiver.pyi new file mode 100644 index 00000000..2be77dc6 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/3/waitress/receiver.pyi @@ -0,0 +1,32 @@ +from io import BytesIO +from typing import Optional + +from waitress.buffers import OverflowableBuffer +from waitress.utilities import BadRequest + +class FixedStreamReceiver: + completed: bool = ... + error: None = ... + remain: int = ... + buf: OverflowableBuffer = ... + def __init__(self, cl: int, buf: OverflowableBuffer) -> None: ... + def __len__(self) -> int: ... + def received(self, data: bytes) -> int: ... + def getfile(self) -> BytesIO: ... + def getbuf(self) -> OverflowableBuffer: ... + +class ChunkedReceiver: + chunk_remainder: int = ... + validate_chunk_end: bool = ... + control_line: bytes = ... + chunk_end: bytes = ... + all_chunks_received: bool = ... + trailer: bytes = ... + completed: bool = ... + error: Optional[BadRequest] = ... + buf: OverflowableBuffer = ... + def __init__(self, buf: OverflowableBuffer) -> None: ... + def __len__(self) -> int: ... + def received(self, s: bytes) -> int: ... + def getfile(self) -> BytesIO: ... + def getbuf(self) -> OverflowableBuffer: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/waitress/rfc7230.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/waitress/rfc7230.pyi new file mode 100644 index 00000000..a4bf5489 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/3/waitress/rfc7230.pyi @@ -0,0 +1,16 @@ +from typing import Pattern + +from .compat import tobytes as tobytes + +WS: str +OWS: str +RWS: str +BWS = str +TCHAR: str +OBS_TEXT: str +TOKEN: str +VCHAR: str +FIELD_VCHAR: str +FIELD_CONTENT: str +FIELD_VALUE: str +HEADER_FIELD: Pattern diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/waitress/runner.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/waitress/runner.pyi new file mode 100644 index 00000000..a817771a --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/3/waitress/runner.pyi @@ -0,0 +1,11 @@ +from io import TextIOWrapper +from typing import Any, Callable, Optional, Pattern, Sequence, Tuple + +HELP: str +RUNNER_PATTERN: Pattern + +def match(obj_name: str) -> Tuple[str, str]: ... +def resolve(module_name: str, object_name: str) -> Any: ... +def show_help(stream: TextIOWrapper, name: str, error: Optional[str] = ...) -> None: ... +def show_exception(stream: TextIOWrapper) -> None: ... +def run(argv: Sequence[str] = ..., _serve: Callable[..., Any] = ...) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/waitress/server.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/waitress/server.pyi new file mode 100644 index 00000000..eb4faab2 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/3/waitress/server.pyi @@ -0,0 +1,103 @@ +from socket import SocketType +from typing import Any, Optional, Sequence, Tuple, Union + +from waitress.adjustments import Adjustments +from waitress.channel import HTTPChannel +from waitress.task import Task, ThreadedTaskDispatcher + +from . import wasyncore + +def create_server( + application: Any, + map: Optional[Any] = ..., + _start: bool = ..., + _sock: Optional[SocketType] = ..., + _dispatcher: Optional[ThreadedTaskDispatcher] = ..., + **kw: Any, +) -> Union[MultiSocketServer, BaseWSGIServer]: ... + +class MultiSocketServer: + asyncore: Any = ... + adj: Adjustments = ... + map: Any = ... + effective_listen: Sequence[Tuple[str, int]] = ... + task_dispatcher: ThreadedTaskDispatcher = ... + def __init__( + self, + map: Optional[Any] = ..., + adj: Optional[Adjustments] = ..., + effective_listen: Optional[Sequence[Tuple[str, int]]] = ..., + dispatcher: Optional[ThreadedTaskDispatcher] = ..., + ) -> None: ... + def print_listen(self, format_str: str) -> None: ... + def run(self) -> None: ... + def close(self) -> None: ... + +class BaseWSGIServer(wasyncore.dispatcher): + channel_class: HTTPChannel = ... + next_channel_cleanup: int = ... + socketmod: SocketType = ... + asyncore: Any = ... + sockinfo: Tuple[int, int, int, Tuple[str, int]] = ... + family: int = ... + socktype: int = ... + application: Any = ... + adj: Adjustments = ... + trigger: int = ... + task_dispatcher: ThreadedTaskDispatcher = ... + server_name: str = ... + active_channels: HTTPChannel = ... + def __init__( + self, + application: Any, + map: Optional[Any] = ..., + _start: bool = ..., + _sock: Optional[Any] = ..., + dispatcher: Optional[ThreadedTaskDispatcher] = ..., + adj: Optional[Adjustments] = ..., + sockinfo: Optional[Any] = ..., + bind_socket: bool = ..., + **kw: Any, + ) -> None: ... + def bind_server_socket(self) -> None: ... + def get_server_name(self, ip: str) -> str: ... + def getsockname(self) -> Any: ... + accepting: bool = ... + def accept_connections(self) -> None: ... + def add_task(self, task: Task) -> None: ... + def readable(self) -> bool: ... + def writable(self) -> bool: ... + def handle_read(self) -> None: ... + def handle_connect(self) -> None: ... + def handle_accept(self) -> None: ... + def run(self) -> None: ... + def pull_trigger(self) -> None: ... + def set_socket_options(self, conn: Any) -> None: ... + def fix_addr(self, addr: Any) -> Any: ... + def maintenance(self, now: int) -> None: ... + def print_listen(self, format_str: str) -> None: ... + def close(self) -> None: ... + +class TcpWSGIServer(BaseWSGIServer): + def bind_server_socket(self) -> None: ... + def getsockname(self) -> Tuple[str, Tuple[str, int]]: ... + def set_socket_options(self, conn: SocketType) -> None: ... + +class UnixWSGIServer(BaseWSGIServer): + def __init__( + self, + application: Any, + map: Optional[Any] = ..., + _start: bool = ..., + _sock: Optional[Any] = ..., + dispatcher: Optional[Any] = ..., + adj: Optional[Adjustments] = ..., + sockinfo: Optional[Any] = ..., + **kw: Any, + ) -> None: ... + def bind_server_socket(self) -> None: ... + def getsockname(self) -> Tuple[str, Tuple[str, int]]: ... + def fix_addr(self, addr: Any) -> Tuple[str, None]: ... + def get_server_name(self, ip: Any) -> str: ... + +WSGIServer: TcpWSGIServer diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/waitress/task.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/waitress/task.pyi new file mode 100644 index 00000000..11f25428 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/3/waitress/task.pyi @@ -0,0 +1,69 @@ +from logging import Logger +from threading import Condition, Lock +from typing import Any, Deque, Mapping, Optional, Sequence, Set, Tuple + +from .channel import HTTPChannel +from .utilities import Error + +rename_headers: Mapping[str, str] +hop_by_hop: frozenset + +class ThreadedTaskDispatcher: + stop_count: int = ... + active_count: int = ... + logger: Logger = ... + queue_logger: Logger = ... + threads: Set = ... + queue: Deque[Task] = ... + lock: Lock = ... + queue_cv: Condition = ... + thread_exit_cv: Condition = ... + def __init__(self) -> None: ... + def start_new_thread(self, target: Any, args: Any) -> None: ... + def handler_thread(self, thread_no: int) -> None: ... + def set_thread_count(self, count: int) -> None: ... + def add_task(self, task: Task) -> None: ... + def shutdown(self, cancel_pending: bool = ..., timeout: int = ...) -> bool: ... + +class Task: + close_on_finish: bool = ... + status: str = ... + wrote_header: bool = ... + start_time: int = ... + content_length: Optional[int] = ... + content_bytes_written: int = ... + logged_write_excess: bool = ... + logged_write_no_body: bool = ... + complete: bool = ... + chunked_response: bool = ... + logger: Logger = ... + channel: HTTPChannel = ... + request: Error = ... + response_headers: Sequence[Tuple[str, str]] = ... + version: str = ... + def __init__(self, channel: HTTPChannel, request: Error) -> None: ... + def service(self) -> None: ... + @property + def has_body(self) -> bool: ... + def build_response_header(self) -> bytes: ... + def remove_content_length_header(self) -> None: ... + def start(self) -> None: ... + def finish(self) -> None: ... + def write(self, data: bytes) -> None: ... + +class ErrorTask(Task): + complete: bool = ... + status: str = ... + close_on_finish: bool = ... + content_length: int = ... + def execute(self) -> None: ... + +class WSGITask(Task): + environ: Optional[Any] = ... + response_headers: Sequence[Tuple[str, str]] = ... + complete: bool = ... + status: str = ... + content_length: int = ... + close_on_finish: bool = ... + def execute(self) -> None: ... + def get_environment(self) -> Any: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/waitress/trigger.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/waitress/trigger.pyi new file mode 100644 index 00000000..1638972e --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/3/waitress/trigger.pyi @@ -0,0 +1,31 @@ +import sys +from socket import SocketType +from threading import Lock +from typing import Callable, Mapping, Optional +from typing_extensions import Literal + +from . import wasyncore as wasyncore + +class _triggerbase: + kind: Optional[str] = ... + lock: Lock = ... + thunks: Callable[[None], None] = ... + def __init__(self) -> None: ... + def readable(self) -> Literal[True]: ... + def writable(self) -> Literal[False]: ... + def handle_connect(self) -> None: ... + def handle_close(self) -> None: ... + def close(self) -> None: ... + def pull_trigger(self, thunk: Optional[Callable[[None], None]] = ...) -> None: ... + def handle_read(self) -> None: ... + +if sys.platform == "linux" or sys.platform == "darwin": + class trigger(_triggerbase, wasyncore.file_dispatcher): + kind: str = ... + def __init__(self, map: Mapping[str, _triggerbase]) -> None: ... + +else: + class trigger(_triggerbase, wasyncore.dispatcher): + kind: str = ... + trigger: SocketType = ... + def __init__(self, map: Mapping[str, _triggerbase]) -> None: ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/waitress/utilities.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/waitress/utilities.pyi new file mode 100644 index 00000000..41321e5b --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/3/waitress/utilities.pyi @@ -0,0 +1,76 @@ +from logging import Logger +from typing import Any, Callable, Mapping, Match, Pattern, Sequence, Tuple + +from .rfc7230 import OBS_TEXT as OBS_TEXT, VCHAR as VCHAR + +logger: Logger +queue_logger: Logger + +def find_double_newline(s: bytes) -> int: ... +def concat(*args: Any) -> str: ... +def join(seq: Any, field: str = ...) -> str: ... +def group(s: Any) -> str: ... + +short_days: Sequence[str] +long_days: Sequence[str] +short_day_reg: str +long_day_reg: str +daymap: Mapping[str, int] +hms_reg: str +months: Sequence[str] +monmap: Mapping[str, int] +months_reg: str +rfc822_date: str +rfc822_reg: Pattern + +def unpack_rfc822(m: Match) -> Tuple[int, int, int, int, int, int, int, int, int]: ... + +rfc850_date: str +rfc850_reg: Pattern + +def unpack_rfc850(m: Match) -> Tuple[int, int, int, int, int, int, int, int, int]: ... + +weekdayname: Sequence[str] +monthname: Sequence[str] + +def build_http_date(when: int) -> str: ... +def parse_http_date(d: str) -> int: ... + +vchar_re: str +obs_text_re: str +qdtext_re: str +quoted_pair_re: str +quoted_string_re: str +quoted_string: Pattern +quoted_pair: Pattern + +def undquote(value: str) -> str: ... +def cleanup_unix_socket(path: str) -> None: ... + +class Error: + code: int = ... + reason: str = ... + body: str = ... + def __init__(self, body: str) -> None: ... + def to_response(self) -> Tuple[str, Sequence[Tuple[str, str]], str]: ... + def wsgi_response(self, environ: Any, start_response: Callable[[str, Sequence[Tuple[str, str]]], None]) -> str: ... + +class BadRequest(Error): + code: int = ... + reason: str = ... + +class RequestHeaderFieldsTooLarge(BadRequest): + code: int = ... + reason: str = ... + +class RequestEntityTooLarge(BadRequest): + code: int = ... + reason: str = ... + +class InternalServerError(Error): + code: int = ... + reason: str = ... + +class ServerNotImplemented(Error): + code: int = ... + reason: str = ... diff --git a/anaconda_lib/jedi/third_party/typeshed/third_party/3/waitress/wasyncore.pyi b/anaconda_lib/jedi/third_party/typeshed/third_party/3/waitress/wasyncore.pyi new file mode 100644 index 00000000..99d2c6b8 --- /dev/null +++ b/anaconda_lib/jedi/third_party/typeshed/third_party/3/waitress/wasyncore.pyi @@ -0,0 +1,94 @@ +from io import BytesIO +from logging import Logger +from socket import SocketType +from typing import Any, Callable, Mapping, Optional, Tuple + +from . import compat as compat, utilities as utilities + +socket_map: Mapping[int, SocketType] +map: Mapping[int, SocketType] + +class ExitNow(Exception): ... + +def read(obj: dispatcher) -> None: ... +def write(obj: dispatcher) -> None: ... +def readwrite(obj: dispatcher, flags: int) -> None: ... +def poll(timeout: float = ..., map: Optional[Mapping[int, SocketType]] = ...) -> None: ... +def poll2(timeout: float = ..., map: Optional[Mapping[int, SocketType]] = ...) -> None: ... + +poll3 = poll2 + +def loop( + timeout: float = ..., use_poll: bool = ..., map: Optional[Mapping[int, SocketType]] = ..., count: Optional[int] = ... +) -> None: ... +def compact_traceback() -> Tuple[Tuple[str, str, str], BaseException, BaseException, str]: ... + +class dispatcher: + debug: bool = ... + connected: bool = ... + accepting: bool = ... + connecting: bool = ... + closing: bool = ... + addr: Optional[Tuple[str, int]] = ... + ignore_log_types: frozenset = ... + logger: Logger = ... + compact_traceback: Callable[[], Tuple[Tuple[str, str, str], BaseException, BaseException, str]] = ... + socket: Optional[SocketType] = ... + def __init__(self, sock: Optional[SocketType] = ..., map: Optional[Mapping[int, SocketType]] = ...) -> None: ... + def add_channel(self, map: Optional[Mapping[int, SocketType]] = ...) -> None: ... + def del_channel(self, map: Optional[Mapping[int, SocketType]] = ...) -> None: ... + family_and_type: Tuple[int, int] = ... + def create_socket(self, family: int = ..., type: int = ...) -> None: ... + def set_socket(self, sock: SocketType, map: Optional[Mapping[int, SocketType]] = ...) -> None: ... + def set_reuse_addr(self) -> None: ... + def readable(self) -> bool: ... + def writable(self) -> bool: ... + def listen(self, num: int) -> None: ... + def bind(self, addr: Tuple[str, int]) -> None: ... + def connect(self, address: Tuple[str, int]) -> None: ... + def accept(self) -> Optional[Tuple[SocketType, Tuple[str, int]]]: ... + def send(self, data: bytes) -> int: ... + def recv(self, buffer_size: int) -> bytes: ... + def close(self) -> None: ... + def log(self, message: str) -> None: ... + def log_info(self, message: str, type: str = ...) -> None: ... + def handle_read_event(self) -> None: ... + def handle_connect_event(self) -> None: ... + def handle_write_event(self) -> None: ... + def handle_expt_event(self) -> None: ... + def handle_error(self) -> None: ... + def handle_expt(self) -> None: ... + def handle_read(self) -> None: ... + def handle_write(self) -> None: ... + def handle_connect(self) -> None: ... + def handle_accept(self) -> None: ... + def handle_accepted(self, sock: SocketType, addr: Any) -> None: ... + def handle_close(self) -> None: ... + +class dispatcher_with_send(dispatcher): + out_buffer: bytes = ... + def __init__(self, sock: Optional[SocketType] = ..., map: Optional[Mapping[int, SocketType]] = ...) -> None: ... + def initiate_send(self) -> None: ... + handle_write: Callable[[], None] = ... + def writable(self) -> bool: ... + def send(self, data: bytes) -> None: ... # type: ignore + +def close_all(map: Optional[Mapping[int, SocketType]] = ..., ignore_all: bool = ...) -> None: ... + +class file_wrapper: + fd: BytesIO = ... + def __init__(self, fd: BytesIO) -> None: ... + def __del__(self) -> None: ... + def recv(self, *args: Any) -> bytes: ... + def send(self, *args: Any) -> bytes: ... + def getsockopt(self, level: int, optname: int, buflen: Optional[bool] = ...) -> int: ... + read: Callable[..., bytes] = ... + write: Callable[..., bytes] = ... + def close(self) -> None: ... + def fileno(self) -> BytesIO: ... + +class file_dispatcher(dispatcher): + connected: bool = ... + def __init__(self, fd: BytesIO, map: Optional[Mapping[int, SocketType]] = ...) -> None: ... + socket: SocketType = ... + def set_file(self, fd: BytesIO) -> None: ... diff --git a/anaconda_lib/jedi/utils.py b/anaconda_lib/jedi/utils.py old mode 100755 new mode 100644 index 9d675174..b7e1c1a8 --- a/anaconda_lib/jedi/utils.py +++ b/anaconda_lib/jedi/utils.py @@ -2,8 +2,7 @@ Utilities for end-users. """ -from __future__ import absolute_import -import __main__ +import __main__ # type: ignore[import] from collections import namedtuple import logging import traceback @@ -66,7 +65,7 @@ def setup_readline(namespace_module=__main__, fuzzy=False): level=logging.DEBUG ) - class JediRL(object): + class JediRL: def complete(self, text, state): """ This complete stuff is pretty weird, a generator would make diff --git a/anaconda_lib/linting/anaconda_pylint.py b/anaconda_lib/linting/anaconda_pylint.py index 4dad9e5b..8e8003a4 100644 --- a/anaconda_lib/linting/anaconda_pylint.py +++ b/anaconda_lib/linting/anaconda_pylint.py @@ -19,6 +19,7 @@ from cStringIO import StringIO except ImportError: from StringIO import StringIO + assert StringIO @@ -30,8 +31,7 @@ class PyLinter(object): - """PyLinter class for Anaconda - """ + """PyLinter class for Anaconda""" def __init__(self, filename, rcfile): self.filename = filename @@ -41,37 +41,49 @@ def __init__(self, filename, rcfile): self.execute() def execute(self): - """Execute the linting process - """ + """Execute the linting process""" if numversion < (1, 0, 0): args = '--include-ids=y -r n'.split(' ') else: args = '--msg-template={msg_id}:{line}:{column}:{msg} -r n'.split( - ' ') + ' ' + ) if self.rcfile: args.append('--rcfile={0}'.format(os.path.expanduser(self.rcfile))) args.append(self.filename) - args = [sys.executable, '-m', 'pylint.lint'] + args + pylint_exec = 'pylint.lint' if numversion > (2, 4, 4) else 'pylint' + args = [sys.executable, '-m', pylint_exec] + args proc = spawn(args, stdout=PIPE, stderr=PIPE, cwd=os.getcwd()) if proc is None: return {'E': [], 'W': [], 'V': []} - self.output, _ = proc.communicate() + self.output, err = proc.communicate() if sys.version_info >= (3, 0): self.output = self.output.decode('utf8') + err = err.decode('utf8') + + if err: + print('got an error from pylint: {0}'.format(err)) + return {'E': [], 'W': [], 'V': []} def parse_errors(self): - """Parse the output given by PyLint - """ + """Parse the output given by PyLint""" errors = {'E': [], 'W': [], 'V': []} data = self.output for error in data.splitlines(): + if ( + numversion > (2, 4, 4) + and not error.startswith('-') + or error.startswith('Your code has been rated at') + ): + continue + if '************* Module ' in error: _, module = error.split('************* Module ') if module not in self.filename: @@ -105,20 +117,21 @@ def parse_errors(self): # doesn't pass - errors[self._map_code(code)[0]].append({ - 'line': int(line), - 'offset': offset, - 'code': self._map_code(code)[1], - 'message': '[{0}] {1}'.format( - self._map_code(code)[1], message - ) - }) + errors[self._map_code(code)[0]].append( + { + 'line': int(line), + 'offset': offset, + 'code': self._map_code(code)[1], + 'message': '[{0}] {1}'.format( + self._map_code(code)[1], message + ), + } + ) return errors def _map_code(self, code): - """Map the given code to fit Anaconda codes - """ + """Map the given code to fit Anaconda codes""" mapping = {'C': 'V', 'E': 'E', 'F': 'E', 'I': 'V', 'R': 'W', 'W': 'W'} return (mapping[code[0]], code[1:]) diff --git a/anaconda_lib/linting/mccabe.py b/anaconda_lib/linting/mccabe.py index 4ea34be0..5746504c 100644 --- a/anaconda_lib/linting/mccabe.py +++ b/anaconda_lib/linting/mccabe.py @@ -7,6 +7,8 @@ import optparse import sys +import tokenize + from collections import defaultdict try: import ast @@ -14,7 +16,7 @@ except ImportError: # Python 2.5 from flake8.util import ast, iter_child_nodes -__version__ = '0.2.1' +__version__ = '0.7.0' class ASTVisitor(object): @@ -59,14 +61,17 @@ def dot_id(self): class PathGraph(object): - def __init__(self, name, entity, lineno): + def __init__(self, name, entity, lineno, column=0): self.name = name self.entity = entity self.lineno = lineno + self.column = column self.nodes = defaultdict(list) def connect(self, n1, n2): self.nodes[n1].append(n2) + # Ensure that the destination node is always counted. + self.nodes[n2] = [] def to_dot(self): print('subgraph {') @@ -112,7 +117,7 @@ def visitFunctionDef(self, node): else: entity = node.name - name = '%d:1: %r' % (node.lineno, entity) + name = '%d:%d: %r' % (node.lineno, node.col_offset, entity) if self.graph is not None: # closure @@ -124,13 +129,15 @@ def visitFunctionDef(self, node): self.graph.connect(pathnode, bottom) self.tail = bottom else: - self.graph = PathGraph(name, entity, node.lineno) + self.graph = PathGraph(name, entity, node.lineno, node.col_offset) pathnode = PathNode(name) self.tail = pathnode self.dispatch_list(node.body) self.graphs["%s%s" % (self.classname, node.name)] = self.graph self.reset() + visitAsyncFunctionDef = visitFunctionDef + def visitClassDef(self, node): old_classname = self.classname self.classname += node.name + "." @@ -153,41 +160,45 @@ def visitSimpleStatement(self, node): name = "Stmt %d" % lineno self.appendPathNode(name) - visitAssert = visitAssign = visitAugAssign = visitDelete = visitPrint = \ - visitRaise = visitYield = visitImport = visitCall = visitSubscript = \ - visitPass = visitContinue = visitBreak = visitGlobal = visitReturn = \ - visitSimpleStatement + def default(self, node, *args): + if isinstance(node, ast.stmt): + self.visitSimpleStatement(node) + else: + super(PathGraphingAstVisitor, self).default(node, *args) def visitLoop(self, node): name = "Loop %d" % node.lineno + self._subgraph(node, name) + + visitAsyncFor = visitFor = visitWhile = visitLoop + def visitIf(self, node): + name = "If %d" % node.lineno + self._subgraph(node, name) + + def _subgraph(self, node, name, extra_blocks=()): + """create the subgraphs representing any `if` and `for` statements""" if self.graph is None: # global loop - self.graph = PathGraph(name, name, node.lineno) + self.graph = PathGraph(name, name, node.lineno, node.col_offset) pathnode = PathNode(name) - self.tail = pathnode - self.dispatch_list(node.body) + self._subgraph_parse(node, pathnode, extra_blocks) self.graphs["%s%s" % (self.classname, name)] = self.graph self.reset() else: pathnode = self.appendPathNode(name) - self.tail = pathnode - self.dispatch_list(node.body) - bottom = PathNode("", look='point') - self.graph.connect(self.tail, bottom) - self.graph.connect(pathnode, bottom) - self.tail = bottom - - # TODO: else clause in node.orelse + self._subgraph_parse(node, pathnode, extra_blocks) - visitFor = visitWhile = visitLoop - - def visitIf(self, node): - name = "If %d" % node.lineno - pathnode = self.appendPathNode(name) + def _subgraph_parse(self, node, pathnode, extra_blocks): + """parse the body and any `else` block of `if` and `for` statements""" loose_ends = [] + self.tail = pathnode self.dispatch_list(node.body) loose_ends.append(self.tail) + for extra in extra_blocks: + self.tail = pathnode + self.dispatch_list(extra.body) + loose_ends.append(self.tail) if node.orelse: self.tail = pathnode self.dispatch_list(node.orelse) @@ -202,25 +213,17 @@ def visitIf(self, node): def visitTryExcept(self, node): name = "TryExcept %d" % node.lineno - pathnode = self.appendPathNode(name) - loose_ends = [] - self.dispatch_list(node.body) - loose_ends.append(self.tail) - for handler in node.handlers: - self.tail = pathnode - self.dispatch_list(handler.body) - loose_ends.append(self.tail) - if pathnode: - bottom = PathNode("", look='point') - for le in loose_ends: - self.graph.connect(le, bottom) - self.tail = bottom + self._subgraph(node, name, extra_blocks=node.handlers) + + visitTry = visitTryExcept def visitWith(self, node): name = "With %d" % node.lineno self.appendPathNode(name) self.dispatch_list(node.body) + visitAsyncWith = visitWith + class McCabeChecker(object): """McCabe cyclomatic complexity checker.""" @@ -228,20 +231,33 @@ class McCabeChecker(object): version = __version__ _code = 'C901' _error_tmpl = "C901 %r is too complex (%d)" - max_complexity = 0 + max_complexity = -1 def __init__(self, tree, filename): self.tree = tree @classmethod def add_options(cls, parser): - parser.add_option('--max-complexity', default=-1, action='store', - type='int', help="McCabe complexity threshold") - parser.config_options.append('max-complexity') + flag = '--max-complexity' + kwargs = { + 'default': -1, + 'action': 'store', + 'type': int, + 'help': 'McCabe complexity threshold', + 'parse_from_config': 'True', + } + config_opts = getattr(parser, 'config_options', None) + if isinstance(config_opts, list): + # Flake8 2.x + kwargs.pop('parse_from_config') + parser.add_option(flag, **kwargs) + parser.config_options.append('max-complexity') + else: + parser.add_option(flag, **kwargs) @classmethod def parse_options(cls, options): - cls.max_complexity = options.max_complexity + cls.max_complexity = int(options.max_complexity) def run(self): if self.max_complexity < 0: @@ -249,9 +265,9 @@ def run(self): visitor = PathGraphingAstVisitor() visitor.preorder(self.tree, visitor) for graph in visitor.graphs.values(): - if graph.complexity() >= self.max_complexity: + if graph.complexity() > self.max_complexity: text = self._error_tmpl % (graph.entity, graph.complexity()) - yield graph.lineno, 0, text, type(self) + yield graph.lineno, graph.column, text, type(self) def get_code_complexity(code, threshold=7, filename='stdin'): @@ -275,23 +291,40 @@ def get_code_complexity(code, threshold=7, filename='stdin'): def get_module_complexity(module_path, threshold=7): """Returns the complexity of a module""" - with open(module_path, "rU") as mod: - code = mod.read() + code = _read(module_path) return get_code_complexity(code, threshold, filename=module_path) -def main(argv): +def _read(filename): + if (2, 5) < sys.version_info < (3, 0): + with open(filename, 'rU') as f: + return f.read() + elif (3, 0) <= sys.version_info < (4, 0): + """Read the source code.""" + try: + with open(filename, 'rb') as f: + (encoding, _) = tokenize.detect_encoding(f.readline) + except (LookupError, SyntaxError, UnicodeError): + # Fall back if file encoding is improperly declared + with open(filename, encoding='latin-1') as f: + return f.read() + with open(filename, 'r', encoding=encoding) as f: + return f.read() + + +def main(argv=None): + if argv is None: + argv = sys.argv[1:] opar = optparse.OptionParser() opar.add_option("-d", "--dot", dest="dot", help="output a graphviz dot file", action="store_true") opar.add_option("-m", "--min", dest="threshold", help="minimum complexity for output", type="int", - default=2) + default=1) options, args = opar.parse_args(argv) - with open(args[0], "rU") as mod: - code = mod.read() + code = _read(args[0]) tree = compile(code, args[0], "exec", ast.PyCF_ONLY_AST) visitor = PathGraphingAstVisitor() visitor.preorder(tree, visitor) @@ -299,7 +332,8 @@ def main(argv): if options.dot: print('graph {') for graph in visitor.graphs.values(): - if graph.complexity() >= options.threshold: + if (not options.threshold or + graph.complexity() >= options.threshold): graph.to_dot() print('}') else: diff --git a/anaconda_lib/linting/pycodestyle.py b/anaconda_lib/linting/pycodestyle.py index 0ad37e23..2cbc2cd6 100644 --- a/anaconda_lib/linting/pycodestyle.py +++ b/anaconda_lib/linting/pycodestyle.py @@ -25,7 +25,6 @@ # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. - r""" Check Python source code formatting, according to PEP 8. @@ -47,8 +46,7 @@ 700 statements 900 syntax error """ -from __future__ import with_statement - +import bisect import inspect import keyword import os @@ -57,19 +55,8 @@ import time import tokenize import warnings -import bisect - -try: - from functools import lru_cache -except ImportError: - def lru_cache(maxsize=128): # noqa as it's a fake implementation. - """Does not really need a real a lru_cache, it's just - optimization, so let's just do nothing here. Python 3.2+ will - just get better performances, time to upgrade? - """ - return lambda function: function - from fnmatch import fnmatch +from functools import lru_cache from optparse import OptionParser try: @@ -78,7 +65,14 @@ def lru_cache(maxsize=128): # noqa as it's a fake implementation. except ImportError: from ConfigParser import RawConfigParser -__version__ = '2.6.0a1' +# this is a performance hack. see https://bugs.python.org/issue43014 +if ( + sys.version_info < (3, 10) and + callable(getattr(tokenize, '_compile', None)) +): # pragma: no cover (>', '**', '*', '+', '-']) ARITHMETIC_OP = frozenset(['**', '*', '/', '//', '+', '-', '@']) WS_OPTIONAL_OPERATORS = ARITHMETIC_OP.union(['^', '&', '|', '<<', '>>', '%']) -# Warn for -> function annotation operator in py3.5+ (issue 803) -FUNCTION_RETURN_ANNOTATION_OP = ['->'] if sys.version_info >= (3, 5) else [] ASSIGNMENT_EXPRESSION_OP = [':='] if sys.version_info >= (3, 8) else [] WS_NEEDED_OPERATORS = frozenset([ '**=', '*=', '/=', '//=', '+=', '-=', '!=', '<>', '<', '>', '%=', '^=', '&=', '|=', '==', '<=', '>=', '<<=', '>>=', '=', - 'and', 'in', 'is', 'or'] + - FUNCTION_RETURN_ANNOTATION_OP + + 'and', 'in', 'is', 'or', '->'] + ASSIGNMENT_EXPRESSION_OP) -WHITESPACE = frozenset(' \t') +WHITESPACE = frozenset(' \t\xa0') NEWLINE = frozenset([tokenize.NL, tokenize.NEWLINE]) SKIP_TOKENS = NEWLINE.union([tokenize.INDENT, tokenize.DEDENT]) # ERRORTOKEN is triggered by backticks in Python 3 @@ -136,21 +128,24 @@ def lru_cache(maxsize=128): # noqa as it's a fake implementation. RERAISE_COMMA_REGEX = re.compile(r'raise\s+\w+\s*,.*,\s*\w+\s*$') ERRORCODE_REGEX = re.compile(r'\b[A-Z]\d{3}\b') DOCSTRING_REGEX = re.compile(r'u?r?["\']') -EXTRANEOUS_WHITESPACE_REGEX = re.compile(r'[\[({] | [\]}),;]| :(?!=)') +EXTRANEOUS_WHITESPACE_REGEX = re.compile(r'[\[({][ \t]|[ \t][\]}),;:](?!=)') WHITESPACE_AFTER_COMMA_REGEX = re.compile(r'[,;:]\s*(?: |\t)') COMPARE_SINGLETON_REGEX = re.compile(r'(\bNone|\bFalse|\bTrue)?\s*([=!]=)' r'\s*(?(1)|(None|False|True))\b') -COMPARE_NEGATIVE_REGEX = re.compile(r'\b(not)\s+[^][)(}{ ]+\s+(in|is)\s') -COMPARE_TYPE_REGEX = re.compile(r'(?:[=!]=|is(?:\s+not)?)\s+type(?:s.\w+Type' - r'|\s*\(\s*([^)]*[^ )])\s*\))') +COMPARE_NEGATIVE_REGEX = re.compile(r'\b(?%&^]+)(\s*)') +OPERATOR_REGEX = re.compile(r'(?:[^,\s])(\s*)(?:[-+*/|!<=>%&^]+|:=)(\s*)') LAMBDA_REGEX = re.compile(r'\blambda\b') HUNK_REGEX = re.compile(r'^@@ -\d+(?:,\d+)? \+(\d+)(?:,(\d+))? @@.*$') STARTSWITH_DEF_REGEX = re.compile(r'^(async\s+def|def)\b') STARTSWITH_TOP_LEVEL_REGEX = re.compile(r'^(async\s+def\s+|def\s+|class\s+|@)') STARTSWITH_INDENT_STATEMENT_REGEX = re.compile( - r'^\s*({0})\b'.format('|'.join(s.replace(' ', r'\s+') for s in ( + r'^\s*({})\b'.format('|'.join(s.replace(' ', r'\s+') for s in ( 'def', 'async def', 'for', 'async for', 'if', 'elif', 'else', @@ -160,19 +155,17 @@ def lru_cache(maxsize=128): # noqa as it's a fake implementation. 'while', ))) ) -DUNDER_REGEX = re.compile(r'^__([^\s]+)__ = ') +DUNDER_REGEX = re.compile(r"^__([^\s]+)__(?::\s*[a-zA-Z.0-9_\[\]\"]+)? = ") +BLANK_EXCEPT_REGEX = re.compile(r"except\s*:") _checks = {'physical_line': {}, 'logical_line': {}, 'tree': {}} def _get_parameters(function): - if sys.version_info >= (3, 3): - return [parameter.name - for parameter - in inspect.signature(function).parameters.values() - if parameter.kind == parameter.POSITIONAL_OR_KEYWORD] - else: - return inspect.getargspec(function)[0] + return [parameter.name + for parameter + in inspect.signature(function).parameters.values() + if parameter.kind == parameter.POSITIONAL_OR_KEYWORD] def register_check(check, codes=None): @@ -263,7 +256,7 @@ def trailing_blank_lines(physical_line, lines, line_number, total_lines): However the last line should end with a new line (warning W292). """ if line_number == total_lines: - stripped_last_line = physical_line.rstrip() + stripped_last_line = physical_line.rstrip('\r\n') if physical_line and not stripped_last_line: return 0, "W391 blank line at end of file" if stripped_last_line == physical_line: @@ -298,12 +291,6 @@ def maximum_line_length(physical_line, max_line_length, multiline, (len(chunks) == 2 and chunks[0] == '#')) and \ len(line) - len(chunks[-1]) < max_line_length - 7: return - if hasattr(line, 'decode'): # Python 2 - # The line could contain multi-byte characters - try: - length = len(line.decode('utf-8')) - except UnicodeError: - pass if length > max_line_length: return (max_line_length, "E501 line too long " "(%d > %d characters)" % (length, max_line_length)) @@ -314,6 +301,41 @@ def maximum_line_length(physical_line, max_line_length, multiline, ######################################################################## +def _is_one_liner(logical_line, indent_level, lines, line_number): + if not STARTSWITH_TOP_LEVEL_REGEX.match(logical_line): + return False + + line_idx = line_number - 1 + + if line_idx < 1: + prev_indent = 0 + else: + prev_indent = expand_indent(lines[line_idx - 1]) + + if prev_indent > indent_level: + return False + + while line_idx < len(lines): + line = lines[line_idx].strip() + if not line.startswith('@') and STARTSWITH_TOP_LEVEL_REGEX.match(line): + break + else: + line_idx += 1 + else: + return False # invalid syntax: EOF while searching for def/class + + next_idx = line_idx + 1 + while next_idx < len(lines): + if lines[next_idx].strip(): + break + else: + next_idx += 1 + else: + return True # line is last in the file + + return expand_indent(lines[next_idx]) <= indent_level + + @register_check def blank_lines(logical_line, blank_lines, indent_level, line_number, blank_before, previous_logical, @@ -360,16 +382,11 @@ def blank_lines(logical_line, blank_lines, indent_level, line_number, ): yield 0, "E303 too many blank lines (%d)" % blank_lines elif STARTSWITH_TOP_LEVEL_REGEX.match(logical_line): - # If this is a one-liner (i.e. this is not a decorator and the - # next line is not more indented), and the previous line is also - # not deeper (it would be better to check if the previous line - # is part of another def/class at the same level), don't require - # blank lines around this. - prev_line = lines[line_number - 2] if line_number >= 2 else '' - next_line = lines[line_number] if line_number < len(lines) else '' - if (not logical_line.startswith("@") and - expand_indent(prev_line) <= indent_level and - expand_indent(next_line) <= indent_level): + # allow a group of one-liners + if ( + _is_one_liner(logical_line, indent_level, lines, line_number) and + blank_before == 0 + ): return if indent_level: if not (blank_before == method_lines or @@ -383,15 +400,15 @@ def blank_lines(logical_line, blank_lines, indent_level, line_number, for line in lines[line_number - top_level_lines::-1]: if line.strip() and expand_indent(line) < ancestor_level: ancestor_level = expand_indent(line) - nested = line.lstrip().startswith('def ') + nested = STARTSWITH_DEF_REGEX.match(line.lstrip()) if nested or ancestor_level == 0: break if nested: yield 0, "E306 expected %s blank line before a " \ "nested definition, found 0" % (method_lines,) else: - yield 0, "E301 expected %s blank line, found 0" % ( - method_lines,) + yield 0, "E301 expected {} blank line, found 0".format( + method_lines) elif blank_before != top_level_lines: yield 0, "E302 expected %s blank lines, found %d" % ( top_level_lines, blank_before) @@ -430,12 +447,12 @@ def extraneous_whitespace(logical_line): text = match.group() char = text.strip() found = match.start() - if text == char + ' ': + if text[-1].isspace(): # assert char in '([{' yield found + 1, "E201 whitespace after '%s'" % char elif line[found - 1] != ',': code = ('E202' if char in '}])' else 'E203') # if char in ',;:' - yield found, "%s whitespace before '%s'" % (code, char) + yield found, f"{code} whitespace before '{char}'" @register_check @@ -512,8 +529,9 @@ def missing_whitespace(logical_line): @register_check def indentation(logical_line, previous_logical, indent_char, - indent_level, previous_indent_level): - r"""Use 4 spaces per indentation level. + indent_level, previous_indent_level, + indent_size): + r"""Use indent_size (PEP8 says 4) spaces per indentation level. For really old code that you don't want to mess up, you can continue to use 8-space tabs. @@ -533,8 +551,11 @@ def indentation(logical_line, previous_logical, indent_char, """ c = 0 if logical_line else 3 tmpl = "E11%d %s" if logical_line else "E11%d %s (comment)" - if indent_level % 4: - yield 0, tmpl % (1 + c, "indentation is not a multiple of four") + if indent_level % indent_size: + yield 0, tmpl % ( + 1 + c, + "indentation is not a multiple of " + str(indent_size), + ) indent_expect = previous_logical.endswith(':') if indent_expect and indent_level <= previous_indent_level: yield 0, tmpl % (2 + c, "expected an indented block") @@ -550,7 +571,7 @@ def indentation(logical_line, previous_logical, indent_char, @register_check def continued_indentation(logical_line, tokens, indent_level, hang_closing, - indent_char, noqa, verbose): + indent_char, indent_size, noqa, verbose): r"""Continuation lines indentation. Continuation lines should align wrapped elements either vertically @@ -589,7 +610,8 @@ def continued_indentation(logical_line, tokens, indent_level, hang_closing, indent_next = logical_line.endswith(':') row = depth = 0 - valid_hangs = (4,) if indent_char != '\t' else (4, 8) + valid_hangs = (indent_size,) if indent_char != '\t' \ + else (indent_size, indent_size * 2) # remember how many brackets were opened on each line parens = [0] * nrows # relative indents of physical lines @@ -654,7 +676,8 @@ def continued_indentation(logical_line, tokens, indent_level, hang_closing, # visual indent is broken yield (start, "E128 continuation line " "under-indented for visual indent") - elif hanging_indent or (indent_next and rel_indent[row] == 8): + elif hanging_indent or (indent_next and + rel_indent[row] == 2 * indent_size): # hanging indent is verified if close_bracket and not hang_closing: yield (start, "E123 closing bracket does not match " @@ -677,7 +700,7 @@ def continued_indentation(logical_line, tokens, indent_level, hang_closing, error = "E131", "unaligned for hanging indent" else: hangs[depth] = hang - if hang > 4: + if hang > indent_size: error = "E126", "over-indented for hanging indent" else: error = "E121", "under-indented for hanging indent" @@ -690,7 +713,7 @@ def continued_indentation(logical_line, tokens, indent_level, hang_closing, indent[depth] = start[1] indent_chances[start[1]] = True if verbose >= 4: - print("bracket depth %s indent to %s" % (depth, start[1])) + print(f"bracket depth {depth} indent to {start[1]}") # deal with implicit string concatenation elif (token_type in (tokenize.STRING, tokenize.COMMENT) or text in ('u', 'ur', 'b', 'br')): @@ -744,8 +767,8 @@ def continued_indentation(logical_line, tokens, indent_level, hang_closing, if last_token_multiline: rel_indent[end[0] - first_row] = rel_indent[row] - if indent_next and expand_indent(line) == indent_level + 4: - pos = (start[0], indent[0] + 4) + if indent_next and expand_indent(line) == indent_level + indent_size: + pos = (start[0], indent[0] + indent_size) if visual_indent: code = "E129 visually indented line" else: @@ -772,14 +795,21 @@ def whitespace_before_parameters(logical_line, tokens): prev_type, prev_text, __, prev_end, __ = tokens[0] for index in range(1, len(tokens)): token_type, text, start, end, __ = tokens[index] - if (token_type == tokenize.OP and + if ( + token_type == tokenize.OP and text in '([' and start != prev_end and (prev_type == tokenize.NAME or prev_text in '}])') and # Syntax "class A (B):" is allowed, but avoid it (index < 2 or tokens[index - 2][1] != 'class') and - # Allow "return (a.foo for a in range(5))" - not keyword.iskeyword(prev_text)): + # Allow "return (a.foo for a in range(5))" + not keyword.iskeyword(prev_text) and + # 'match' and 'case' are only soft keywords + ( + sys.version_info < (3, 9) or + not keyword.issoftkeyword(prev_text) + ) + ): yield prev_end, "E211 whitespace before '%s'" % text prev_type = token_type prev_text = text @@ -868,7 +898,9 @@ def missing_whitespace_around_operator(logical_line, tokens): # ^ # def f(a, b, /): # ^ - prev_text == '/' and text in {',', ')'} or + # f = lambda a, /: + # ^ + prev_text == '/' and text in {',', ')', ':'} or # def f(a, b, /): # ^ prev_text == ')' and text == ':' @@ -899,8 +931,13 @@ def missing_whitespace_around_operator(logical_line, tokens): # Check if the operator is used as a binary operator # Allow unary operators: -123, -x, +1. # Allow argument unpacking: foo(*args, **kwargs). - if (prev_text in '}])' if prev_type == tokenize.OP - else prev_text not in KEYWORDS): + if prev_type == tokenize.OP and prev_text in '}])' or ( + prev_type != tokenize.OP and + prev_text not in KEYWORDS and ( + sys.version_info < (3, 9) or + not keyword.issoftkeyword(prev_text) + ) + ): need_space = None elif text in WS_OPTIONAL_OPERATORS: need_space = None @@ -1005,21 +1042,24 @@ def whitespace_around_named_parameter_equals(logical_line, tokens): @register_check def whitespace_before_comment(logical_line, tokens): - r"""Separate inline comments by at least two spaces. + """Separate inline comments by at least two spaces. An inline comment is a comment on the same line as a statement. Inline comments should be separated by at least two spaces from the statement. They should start with a # and a single space. - Each line of a block comment starts with a # and a single space - (unless it is indented text inside the comment). + Each line of a block comment starts with a # and one or multiple + spaces as there can be indented text inside the comment. Okay: x = x + 1 # Increment x Okay: x = x + 1 # Increment x - Okay: # Block comment + Okay: # Block comments: + Okay: # - Block comment list + Okay: # \xa0- Block comment list E261: x = x + 1 # Increment x E262: x = x + 1 #Increment x E262: x = x + 1 # Increment x + E262: x = x + 1 # \xa0Increment x E265: #Block comment E266: ### Block comment """ @@ -1169,7 +1209,7 @@ def compound_statements(logical_line): lambda_kw = LAMBDA_REGEX.search(line, 0, found) if lambda_kw: before = line[:lambda_kw.start()].rstrip() - if before[-1:] == '=' and isidentifier(before[:-1].strip()): + if before[-1:] == '=' and before[:-1].strip().isidentifier(): yield 0, ("E731 do not assign a lambda expression, use a " "def") break @@ -1229,20 +1269,19 @@ def explicit_line_join(logical_line, tokens): parens -= 1 +# The % character is strictly speaking a binary operator, but the +# common usage seems to be to put it next to the format parameters, +# after a line break. _SYMBOLIC_OPS = frozenset("()[]{},:.;@=%~") | frozenset(("...",)) def _is_binary_operator(token_type, text): - is_op_token = token_type == tokenize.OP - is_conjunction = text in ['and', 'or'] - # NOTE(sigmavirus24): Previously the not_a_symbol check was executed - # conditionally. Since it is now *always* executed, text may be - # None. In that case we get a TypeError for `text not in str`. - not_a_symbol = text and text not in _SYMBOLIC_OPS - # The % character is strictly speaking a binary operator, but the - # common usage seems to be to put it next to the format parameters, - # after a line break. - return ((is_op_token or is_conjunction) and not_a_symbol) + return ( + token_type == tokenize.OP or + text in {'and', 'or'} + ) and ( + text not in _SYMBOLIC_OPS + ) def _break_around_binary_operators(tokens): @@ -1354,8 +1393,10 @@ def comparison_to_singleton(logical_line, noqa): None was set to some other value. The other value might have a type (such as a container) that could be false in a boolean context! """ - match = not noqa and COMPARE_SINGLETON_REGEX.search(logical_line) - if match: + if noqa: + return + + for match in COMPARE_SINGLETON_REGEX.finditer(logical_line): singleton = match.group(1) or match.group(3) same = (match.group(2) == '==') @@ -1401,18 +1442,11 @@ def comparison_type(logical_line, noqa): Okay: if isinstance(obj, int): E721: if type(obj) is type(1): - - When checking if an object is a string, keep in mind that it might - be a unicode string too! In Python 2.3, str and unicode have a - common base class, basestring, so you can do: - - Okay: if isinstance(obj, basestring): - Okay: if type(a1) is type(b1): """ match = COMPARE_TYPE_REGEX.search(logical_line) if match and not noqa: inst = match.group(1) - if inst and isidentifier(inst) and inst not in SINGLETONS: + if inst and inst.isidentifier() and inst not in SINGLETONS: return # Allow comparison for types which are not obvious yield match.start(), "E721 do not compare types, use 'isinstance()'" @@ -1429,8 +1463,7 @@ def bare_except(logical_line, noqa): if noqa: return - regex = re.compile(r"except\s*:") - match = regex.match(logical_line) + match = BLANK_EXCEPT_REGEX.match(logical_line) if match: yield match.start(), "E722 do not use bare 'except'" @@ -1731,12 +1764,6 @@ def maximum_doc_length(logical_line, max_doc_length, noqa, tokens): if prev_token is None or prev_token in SKIP_TOKENS: lines = line.splitlines() for line_num, physical_line in enumerate(lines): - if hasattr(physical_line, 'decode'): # Python 2 - # The line could contain multi-byte characters - try: - physical_line = physical_line.decode('utf-8') - except UnicodeError: - pass if start[0] + line_num == 1 and line.startswith('#!'): return length = len(physical_line) @@ -1762,32 +1789,21 @@ def maximum_doc_length(logical_line, max_doc_length, noqa, tokens): ######################################################################## -if sys.version_info < (3,): - # Python 2: implicit encoding. - def readlines(filename): - """Read the source code.""" - with open(filename, 'rU') as f: +def readlines(filename): + """Read the source code.""" + try: + with tokenize.open(filename) as f: return f.readlines() - isidentifier = re.compile(r'[a-zA-Z_]\w*$').match - stdin_get_value = sys.stdin.read -else: - # Python 3 - def readlines(filename): - """Read the source code.""" - try: - with open(filename, 'rb') as f: - (coding, lines) = tokenize.detect_encoding(f.readline) - f = TextIOWrapper(f, coding, line_buffering=True) - return [line.decode(coding) for line in lines] + f.readlines() - except (LookupError, SyntaxError, UnicodeError): - # Fall back if file encoding is improperly declared - with open(filename, encoding='latin-1') as f: - return f.readlines() - isidentifier = str.isidentifier - - def stdin_get_value(): - """Read the value from stdin.""" - return TextIOWrapper(sys.stdin.buffer, errors='ignore').read() + except (LookupError, SyntaxError, UnicodeError): + # Fall back if file encoding is improperly declared + with open(filename, encoding='latin-1') as f: + return f.readlines() + + +def stdin_get_value(): + """Read the value from stdin.""" + return TextIOWrapper(sys.stdin.buffer, errors='ignore').read() + noqa = lru_cache(512)(re.compile(r'# no(?:qa|pep8)\b', re.I).search) @@ -1853,7 +1869,7 @@ def parse_udiff(diff, patterns=None, parent='.'): continue if line[:3] == '@@ ': hunk_match = HUNK_REGEX.match(line) - (row, nrows) = [int(g or '1') for g in hunk_match.groups()] + (row, nrows) = (int(g or '1') for g in hunk_match.groups()) rv[path].update(range(row, row + nrows)) elif line[:3] == '+++': path = line[4:].split('\t', 1)[0] @@ -1914,7 +1930,7 @@ def _is_eol_token(token): ######################################################################## -class Checker(object): +class Checker: """Load a Python source file, tokenize it, check coding style.""" def __init__(self, filename=None, lines=None, @@ -1929,8 +1945,10 @@ def __init__(self, filename=None, lines=None, self._ast_checks = options.ast_checks self.max_line_length = options.max_line_length self.max_doc_length = options.max_doc_length + self.indent_size = options.indent_size self.multiline = False # in a multiline string? self.hang_closing = options.hang_closing + self.indent_size = options.indent_size self.verbose = options.verbose self.filename = filename # Dictionary where a checker can store its custom state. @@ -1944,9 +1962,9 @@ def __init__(self, filename=None, lines=None, elif lines is None: try: self.lines = readlines(filename) - except IOError: + except OSError: (exc_type, exc) = sys.exc_info()[:2] - self._io_error = '%s: %s' % (exc_type.__name__, exc) + self._io_error = f'{exc_type.__name__}: {exc}' self.lines = [] else: self.lines = lines @@ -1971,7 +1989,7 @@ def report_invalid_syntax(self): else: offset = (1, 0) self.report_error(offset[0], offset[1] or 0, - 'E901 %s: %s' % (exc_type.__name__, exc.args[0]), + f'E901 {exc_type.__name__}: {exc.args[0]}', self.report_invalid_syntax) def readline(self): @@ -2094,21 +2112,30 @@ def generate_tokens(self): self.report_error(1, 0, 'E902 %s' % self._io_error, readlines) tokengen = tokenize.generate_tokens(self.readline) try: + prev_physical = '' for token in tokengen: if token[2][0] > self.total_lines: return self.noqa = token[4] and noqa(token[4]) - self.maybe_check_physical(token) + self.maybe_check_physical(token, prev_physical) yield token + prev_physical = token[4] except (SyntaxError, tokenize.TokenError): self.report_invalid_syntax() - def maybe_check_physical(self, token): + def maybe_check_physical(self, token, prev_physical): """If appropriate for token, check current physical line(s).""" # Called after every token, but act only on end of line. + + # a newline token ends a single physical line. if _is_eol_token(token): - # Obviously, a newline token ends a single physical line. - self.check_physical(token[4]) + # if the file does not end with a newline, the NEWLINE + # token is inserted by the parser, but it does not contain + # the previous physical line in `token[4]` + if token[4] == '': + self.check_physical(prev_physical) + else: + self.check_physical(token[4]) elif token[0] == tokenize.STRING and '\n' in token[1]: # Less obviously, a string that contains newlines is a # multiline string, either triple-quoted or with internal @@ -2155,7 +2182,7 @@ def check_all(self, expected=None, line_offset=0): token_type, text = token[0:2] if self.verbose >= 3: if token[2][0] == token[3][0]: - pos = '[%s:%s]' % (token[2][1] or '', token[3][1]) + pos = '[{}:{}]'.format(token[2][1] or '', token[3][1]) else: pos = 'l.%s' % token[3][0] print('l.%s\t%s\t%s\t%r' % @@ -2182,7 +2209,7 @@ def check_all(self, expected=None, line_offset=0): return self.report.get_file_results() -class BaseReport(object): +class BaseReport: """Collect the results of the checks.""" print_filename = False @@ -2264,7 +2291,7 @@ def print_statistics(self, prefix=''): def print_benchmark(self): """Print benchmark numbers.""" - print('%-7.2f %s' % (self.elapsed, 'seconds elapsed')) + print('{:<7.2f} {}'.format(self.elapsed, 'seconds elapsed')) if self.elapsed: for key in self._benchmark_keys: print('%-7d %s per second (%d total)' % @@ -2282,7 +2309,7 @@ class StandardReport(BaseReport): """Collect and print the results of the checks.""" def __init__(self, options): - super(StandardReport, self).__init__(options) + super().__init__(options) self._fmt = REPORT_FORMAT.get(options.format.lower(), options.format) self._repeat = options.repeat @@ -2292,13 +2319,12 @@ def __init__(self, options): def init_file(self, filename, lines, expected, line_offset): """Signal a new file.""" self._deferred_print = [] - return super(StandardReport, self).init_file( + return super().init_file( filename, lines, expected, line_offset) def error(self, line_number, offset, text, check): """Report an error, according to options.""" - code = super(StandardReport, self).error(line_number, offset, - text, check) + code = super().error(line_number, offset, text, check) if code and (self.counters[code] == 1 or self._repeat): self._deferred_print.append( (line_number, offset, code, text[5:], check.__doc__)) @@ -2337,16 +2363,16 @@ class DiffReport(StandardReport): """Collect and print the results for the changed lines only.""" def __init__(self, options): - super(DiffReport, self).__init__(options) + super().__init__(options) self._selected = options.selected_lines def error(self, line_number, offset, text, check): if line_number not in self._selected[self.filename]: return - return super(DiffReport, self).error(line_number, offset, text, check) + return super().error(line_number, offset, text, check) -class StyleGuide(object): +class StyleGuide: """Initialize a PEP-8 instance with few options.""" def __init__(self, *args, **kwargs): @@ -2436,8 +2462,10 @@ def input_dir(self, dirname): dirs.remove(subdir) for filename in sorted(files): # contain a pattern that matches? - if ((filename_match(filename, filepatterns) and - not self.excluded(filename, root))): + if ( + filename_match(filename, filepatterns) and + not self.excluded(filename, root) + ): runner(os.path.join(root, filename)) def excluded(self, filename, parent=None): @@ -2488,8 +2516,8 @@ def get_parser(prog='pycodestyle', version=__version__): usage="%prog [options] input ...") parser.config_options = [ 'exclude', 'filename', 'select', 'ignore', 'max-line-length', - 'max-doc-length', 'hang-closing', 'count', 'format', 'quiet', - 'show-pep8', 'show-source', 'statistics', 'verbose'] + 'max-doc-length', 'indent-size', 'hang-closing', 'count', 'format', + 'quiet', 'show-pep8', 'show-source', 'statistics', 'verbose'] parser.add_option('-v', '--verbose', default=0, action='count', help="print status messages, or debug with -vv") parser.add_option('-q', '--quiet', default=0, action='count', @@ -2529,6 +2557,10 @@ def get_parser(prog='pycodestyle', version=__version__): default=None, help="set maximum allowed doc line length and perform " "these checks (unchecked if not set)") + parser.add_option('--indent-size', type='int', metavar='n', + default=INDENT_SIZE, + help="set how many spaces make up an indent " + "(default: %default)") parser.add_option('--hang-closing', action='store_true', help="hang closing bracket instead of matching " "indentation of opening bracket's line") @@ -2603,8 +2635,8 @@ def read_config(options, args, arglist, parser): print(" unknown option '%s' ignored" % opt) continue if options.verbose > 1: - print(" %s = %s" % (opt, - config.get(pycodestyle_section, opt))) + print(" {} = {}".format(opt, + config.get(pycodestyle_section, opt))) normalized_opt = opt.replace('-', '_') opt_type = option_list[normalized_opt] if opt_type in ('int', 'count'): diff --git a/anaconda_lib/linting/pyflakes/__init__.py b/anaconda_lib/linting/pyflakes/__init__.py old mode 100755 new mode 100644 index 04188a16..ba9b9133 --- a/anaconda_lib/linting/pyflakes/__init__.py +++ b/anaconda_lib/linting/pyflakes/__init__.py @@ -1 +1 @@ -__version__ = '2.2.0' +__version__ = '2.4.0' diff --git a/anaconda_lib/linting/pyflakes/__main__.py b/anaconda_lib/linting/pyflakes/__main__.py new file mode 100644 index 00000000..68cd9efb --- /dev/null +++ b/anaconda_lib/linting/pyflakes/__main__.py @@ -0,0 +1,5 @@ +from pyflakes.api import main + +# python -m pyflakes +if __name__ == '__main__': + main(prog='pyflakes') diff --git a/anaconda_lib/linting/pyflakes/api.py b/anaconda_lib/linting/pyflakes/api.py new file mode 100644 index 00000000..14e33472 --- /dev/null +++ b/anaconda_lib/linting/pyflakes/api.py @@ -0,0 +1,211 @@ +""" +API for the command-line I{pyflakes} tool. +""" +import ast +import os +import platform +import re +import sys + +from pyflakes import checker, __version__ +from pyflakes import reporter as modReporter + +__all__ = ['check', 'checkPath', 'checkRecursive', 'iterSourceCode', 'main'] + +PYTHON_SHEBANG_REGEX = re.compile(br'^#!.*\bpython([23](\.\d+)?|w)?[dmu]?\s') + + +def check(codeString, filename, reporter=None): + """ + Check the Python source given by C{codeString} for flakes. + + @param codeString: The Python source to check. + @type codeString: C{str} + + @param filename: The name of the file the source came from, used to report + errors. + @type filename: C{str} + + @param reporter: A L{Reporter} instance, where errors and warnings will be + reported. + + @return: The number of warnings emitted. + @rtype: C{int} + """ + if reporter is None: + reporter = modReporter._makeDefaultReporter() + # First, compile into an AST and handle syntax errors. + try: + tree = ast.parse(codeString, filename=filename) + except SyntaxError: + value = sys.exc_info()[1] + msg = value.args[0] + + (lineno, offset, text) = value.lineno, value.offset, value.text + + if checker.PYPY: + if text is None: + lines = codeString.splitlines() + if len(lines) >= lineno: + text = lines[lineno - 1] + if sys.version_info >= (3, ) and isinstance(text, bytes): + try: + text = text.decode('ascii') + except UnicodeDecodeError: + text = None + offset -= 1 + + # If there's an encoding problem with the file, the text is None. + if text is None: + # Avoid using msg, since for the only known case, it contains a + # bogus message that claims the encoding the file declared was + # unknown. + reporter.unexpectedError(filename, 'problem decoding source') + else: + reporter.syntaxError(filename, msg, lineno, offset, text) + return 1 + except Exception: + reporter.unexpectedError(filename, 'problem decoding source') + return 1 + # Okay, it's syntactically valid. Now check it. + file_tokens = checker.make_tokens(codeString) + w = checker.Checker(tree, file_tokens=file_tokens, filename=filename) + w.messages.sort(key=lambda m: m.lineno) + for warning in w.messages: + reporter.flake(warning) + return len(w.messages) + + +def checkPath(filename, reporter=None): + """ + Check the given path, printing out any warnings detected. + + @param reporter: A L{Reporter} instance, where errors and warnings will be + reported. + + @return: the number of warnings printed + """ + if reporter is None: + reporter = modReporter._makeDefaultReporter() + try: + with open(filename, 'rb') as f: + codestr = f.read() + except IOError: + msg = sys.exc_info()[1] + reporter.unexpectedError(filename, msg.args[1]) + return 1 + return check(codestr, filename, reporter) + + +def isPythonFile(filename): + """Return True if filename points to a Python file.""" + if filename.endswith('.py'): + return True + + # Avoid obvious Emacs backup files + if filename.endswith("~"): + return False + + max_bytes = 128 + + try: + with open(filename, 'rb') as f: + text = f.read(max_bytes) + if not text: + return False + except IOError: + return False + + return PYTHON_SHEBANG_REGEX.match(text) + + +def iterSourceCode(paths): + """ + Iterate over all Python source files in C{paths}. + + @param paths: A list of paths. Directories will be recursed into and + any .py files found will be yielded. Any non-directories will be + yielded as-is. + """ + for path in paths: + if os.path.isdir(path): + for dirpath, dirnames, filenames in os.walk(path): + for filename in filenames: + full_path = os.path.join(dirpath, filename) + if isPythonFile(full_path): + yield full_path + else: + yield path + + +def checkRecursive(paths, reporter): + """ + Recursively check all source files in C{paths}. + + @param paths: A list of paths to Python source files and directories + containing Python source files. + @param reporter: A L{Reporter} where all of the warnings and errors + will be reported to. + @return: The number of warnings found. + """ + warnings = 0 + for sourcePath in iterSourceCode(paths): + warnings += checkPath(sourcePath, reporter) + return warnings + + +def _exitOnSignal(sigName, message): + """Handles a signal with sys.exit. + + Some of these signals (SIGPIPE, for example) don't exist or are invalid on + Windows. So, ignore errors that might arise. + """ + import signal + + try: + sigNumber = getattr(signal, sigName) + except AttributeError: + # the signal constants defined in the signal module are defined by + # whether the C library supports them or not. So, SIGPIPE might not + # even be defined. + return + + def handler(sig, f): + sys.exit(message) + + try: + signal.signal(sigNumber, handler) + except ValueError: + # It's also possible the signal is defined, but then it's invalid. In + # this case, signal.signal raises ValueError. + pass + + +def _get_version(): + """ + Retrieve and format package version along with python version & OS used + """ + return ('%s Python %s on %s' % + (__version__, platform.python_version(), platform.system())) + + +def main(prog=None, args=None): + """Entry point for the script "pyflakes".""" + import argparse + + # Handle "Keyboard Interrupt" and "Broken pipe" gracefully + _exitOnSignal('SIGINT', '... stopped') + _exitOnSignal('SIGPIPE', 1) + + parser = argparse.ArgumentParser(prog=prog, + description='Check Python source files for errors') + parser.add_argument('-V', '--version', action='version', version=_get_version()) + parser.add_argument('path', nargs='*', + help='Path(s) of Python file(s) to check. STDIN if not given.') + args = parser.parse_args(args=args).path + reporter = modReporter._makeDefaultReporter() + if args: + warnings = checkRecursive(args, reporter) + else: + warnings = check(sys.stdin.read(), '', reporter) + raise SystemExit(warnings > 0) diff --git a/anaconda_lib/linting/pyflakes/checker.py b/anaconda_lib/linting/pyflakes/checker.py old mode 100755 new mode 100644 index 5af956cc..45c7a4a4 --- a/anaconda_lib/linting/pyflakes/checker.py +++ b/anaconda_lib/linting/pyflakes/checker.py @@ -79,6 +79,10 @@ def getAlternatives(n): LOOP_TYPES = (ast.While, ast.For) FUNCTION_TYPES = (ast.FunctionDef,) +if PY36_PLUS: + ANNASSIGN_TYPES = (ast.AnnAssign,) +else: + ANNASSIGN_TYPES = () if PY38_PLUS: def _is_singleton(node): # type: (ast.AST) -> bool @@ -124,6 +128,13 @@ def _is_const_non_singleton(node): # type: (ast.AST) -> bool return _is_constant(node) and not _is_singleton(node) +def _is_name_or_attr(node, name): # type: (ast.Ast, str) -> bool + return ( + (isinstance(node, ast.Name) and node.id == name) or + (isinstance(node, ast.Attribute) and node.attr == name) + ) + + # https://github.com/python/typed_ast/blob/1.4.0/ast27/Parser/tokenizer.c#L102-L104 TYPE_COMMENT_RE = re.compile(r'^#\s*type:\s*') # https://github.com/python/typed_ast/blob/1.4.0/ast27/Parser/tokenizer.c#L1408-L1413 @@ -264,7 +275,8 @@ def iter_child_nodes(node, omit=None, _fields_order=_FieldsOrder()): yield field elif isinstance(field, list): for item in field: - yield item + if isinstance(item, ast.AST): + yield item def convert_to_value(item): @@ -528,6 +540,20 @@ class Assignment(Binding): """ +class Annotation(Binding): + """ + Represents binding a name to a type without an associated value. + + As long as this name is not assigned a value in another binding, it is considered + undefined for most purposes. One notable exception is using the name as a type + annotation. + """ + + def redefines(self, other): + """An Annotation doesn't define any name, so it cannot redefine one.""" + return False + + class FunctionDefinition(Definition): pass @@ -542,7 +568,7 @@ class ExportBinding(Binding): can be determined statically, they will be treated as names for export and additional checking applied to them. - The only recognized C{__all__} assignment via list concatenation is in the + The only recognized C{__all__} assignment via list/tuple concatenation is in the following format: __all__ = ['a'] + ['b'] + ['c'] @@ -564,10 +590,10 @@ def _add_to_names(container): if isinstance(source.value, (ast.List, ast.Tuple)): _add_to_names(source.value) - # If concatenating lists + # If concatenating lists or tuples elif isinstance(source.value, ast.BinOp): currentValue = source.value - while isinstance(currentValue.right, ast.List): + while isinstance(currentValue.right, (ast.List, ast.Tuple)): left = currentValue.left right = currentValue.right _add_to_names(right) @@ -575,7 +601,7 @@ def _add_to_names(container): if isinstance(left, ast.BinOp): currentValue = left # If just two lists are being added - elif isinstance(left, ast.List): + elif isinstance(left, (ast.List, ast.Tuple)): _add_to_names(left) # All lists accounted for - done break @@ -648,6 +674,10 @@ def __init__(self, lineno, col_offset): self.col_offset = col_offset +class DetectClassScopedMagic: + names = dir() + + # Globally defined names which are not attributes of the builtins module, or # are only present on some platforms. _MAGIC_GLOBALS = ['__file__', '__builtins__', 'WindowsError'] @@ -662,6 +692,8 @@ def getNodeName(node): return node.id if hasattr(node, 'name'): # an ExceptHandler node return node.name + if hasattr(node, 'rest'): # a MatchMapping node + return node.rest TYPING_MODULES = frozenset(('typing', 'typing_extensions')) @@ -688,6 +720,16 @@ def _bare_name_is_attr(name): return False + def _module_scope_is_typing(name): + for scope in reversed(scope_stack): + if name in scope: + return ( + isinstance(scope[name], Importation) and + scope[name].fullName in TYPING_MODULES + ) + + return False + return ( ( isinstance(node, ast.Name) and @@ -695,7 +737,7 @@ def _bare_name_is_attr(name): ) or ( isinstance(node, ast.Attribute) and isinstance(node.value, ast.Name) and - node.value.id in TYPING_MODULES and + _module_scope_is_typing(node.value.id) and is_name_match_fn(node.attr) ) ) @@ -732,6 +774,12 @@ def is_typing_overload(value, scope_stack): ) +class AnnotationState: + NONE = 0 + STRING = 1 + BARE = 2 + + def in_annotation(func): @functools.wraps(func) def in_annotation_func(self, *args, **kwargs): @@ -740,6 +788,14 @@ def in_annotation_func(self, *args, **kwargs): return in_annotation_func +def in_string_annotation(func): + @functools.wraps(func) + def in_annotation_func(self, *args, **kwargs): + with self._enter_annotation(AnnotationState.STRING): + return func(self, *args, **kwargs) + return in_annotation_func + + def make_tokens(code): # PY3: tokenize.tokenize requires readline of bytes if not isinstance(code, bytes): @@ -825,9 +881,7 @@ class Checker(object): nodeDepth = 0 offset = None - traceTree = False - _in_annotation = False - _in_typing_literal = False + _in_annotation = AnnotationState.NONE _in_deferred = False builtIns = set(builtin_vars).union(_MAGIC_GLOBALS) @@ -954,7 +1008,10 @@ def checkDeadScopes(self): if all_binding: all_names = set(all_binding.names) - undefined = all_names.difference(scope) + undefined = [ + name for name in all_binding.names + if name not in scope + ] else: all_names = undefined = [] @@ -1099,7 +1156,10 @@ def addBinding(self, node, value): # then assume the rebound name is used as a global or within a loop value.used = self.scope[value.name].used - self.scope[value.name] = value + # don't treat annotations as assignments if there is an existing value + # in scope + if value.name not in self.scope or not isinstance(value, Annotation): + self.scope[value.name] = value def _unknown_handler(self, node): # this environment variable configures whether to error on unknown @@ -1146,8 +1206,11 @@ def handleNodeLoad(self, node): # iteration continue - if (name == 'print' and - isinstance(scope.get(name, None), Builtin)): + binding = scope.get(name, None) + if isinstance(binding, Annotation) and not self._in_postponed_annotation: + continue + + if name == 'print' and isinstance(binding, Builtin): parent = self.getParent(node) if (isinstance(parent, ast.BinOp) and isinstance(parent.op, ast.RShift)): @@ -1194,7 +1257,7 @@ def handleNodeLoad(self, node): # the special name __path__ is valid only in packages return - if name == '__module__' and isinstance(self.scope, ClassScope): + if name in DetectClassScopedMagic.names and isinstance(self.scope, ClassScope): return # protected with a NameError handler? @@ -1222,7 +1285,9 @@ def handleNodeStore(self, node): break parent_stmt = self.getParent(node) - if isinstance(parent_stmt, (FOR_TYPES, ast.comprehension)) or ( + if isinstance(parent_stmt, ANNASSIGN_TYPES) and parent_stmt.value is None: + binding = Annotation(name, node) + elif isinstance(parent_stmt, (FOR_TYPES, ast.comprehension)) or ( parent_stmt != node._pyflakes_parent and not self.isLiteralTupleUnpacking(parent_stmt)): binding = Binding(name, node) @@ -1265,13 +1330,20 @@ def on_conditional_branch(): self.report(messages.UndefinedName, node, name) @contextlib.contextmanager - def _enter_annotation(self): - orig, self._in_annotation = self._in_annotation, True + def _enter_annotation(self, ann_type=AnnotationState.BARE): + orig, self._in_annotation = self._in_annotation, ann_type try: yield finally: self._in_annotation = orig + @property + def _in_postponed_annotation(self): + return ( + self._in_annotation == AnnotationState.STRING or + self.annotationsFutureEnabled + ) + def _handle_type_comments(self, node): for (lineno, col_offset), comment in self._type_comments.get(node, ()): comment = comment.split(':', 1)[1].strip() @@ -1333,8 +1405,6 @@ def handleNode(self, node, parent): if self.offset and getattr(node, 'lineno', None) is not None: node.lineno += self.offset[0] node.col_offset += self.offset[1] - if self.traceTree: - print(' ' * self.nodeDepth + node.__class__.__name__) if self.futuresAllowed and not (isinstance(node, ast.ImportFrom) or self.isDocstring(node)): self.futuresAllowed = False @@ -1346,8 +1416,6 @@ def handleNode(self, node, parent): handler(node) finally: self.nodeDepth -= 1 - if self.traceTree: - print(' ' * self.nodeDepth + 'end ' + node.__class__.__name__) _getDoctestExamples = doctest.DocTestParser().get_examples @@ -1399,7 +1467,7 @@ def handleDoctests(self, node): self.popScope() self.scopeStack = saved_stack - @in_annotation + @in_string_annotation def handleStringAnnotation(self, s, node, ref_lineno, ref_col_offset, err): try: tree = ast.parse(s) @@ -1457,20 +1525,36 @@ def ignore(self, node): STARRED = NAMECONSTANT = NAMEDEXPR = handleChildren def SUBSCRIPT(self, node): - if ( - ( - isinstance(node.value, ast.Name) and - node.value.id == 'Literal' - ) or ( - isinstance(node.value, ast.Attribute) and - node.value.attr == 'Literal' - ) - ): - orig, self._in_typing_literal = self._in_typing_literal, True - try: + if _is_name_or_attr(node.value, 'Literal'): + with self._enter_annotation(AnnotationState.NONE): self.handleChildren(node) - finally: - self._in_typing_literal = orig + elif _is_name_or_attr(node.value, 'Annotated'): + self.handleNode(node.value, node) + + # py39+ + if isinstance(node.slice, ast.Tuple): + slice_tuple = node.slice + # = 1 and - isinstance(node.args[0], ast.Str) + len(node.args) >= 1 ): with self._enter_annotation(): self.handleNode(node.args[0], node) - self.handleChildren(node) + elif _is_typing(node.func, 'TypeVar', self.scopeStack): + + # TypeVar("T", "int", "str") + omit += ["args"] + annotated += [arg for arg in node.args[1:]] + + # TypeVar("T", bound="str") + omit += ["keywords"] + annotated += [k.value for k in node.keywords if k.arg == "bound"] + not_annotated += [ + (k, ["value"] if k.arg == "bound" else None) + for k in node.keywords + ] + + elif _is_typing(node.func, "TypedDict", self.scopeStack): + # TypedDict("a", {"a": int}) + if len(node.args) > 1 and isinstance(node.args[1], ast.Dict): + omit += ["args"] + annotated += node.args[1].values + not_annotated += [ + (arg, ["values"] if i == 1 else None) + for i, arg in enumerate(node.args) + ] + + # TypedDict("a", a=int) + omit += ["keywords"] + annotated += [k.value for k in node.keywords] + not_annotated += [(k, ["value"]) for k in node.keywords] + + elif _is_typing(node.func, "NamedTuple", self.scopeStack): + # NamedTuple("a", [("a", int)]) + if ( + len(node.args) > 1 and + isinstance(node.args[1], (ast.Tuple, ast.List)) and + all(isinstance(x, (ast.Tuple, ast.List)) and + len(x.elts) == 2 for x in node.args[1].elts) + ): + omit += ["args"] + annotated += [elt.elts[1] for elt in node.args[1].elts] + not_annotated += [(elt.elts[0], None) for elt in node.args[1].elts] + not_annotated += [ + (arg, ["elts"] if i == 1 else None) + for i, arg in enumerate(node.args) + ] + not_annotated += [(elt, "elts") for elt in node.args[1].elts] + + # NamedTuple("a", a=int) + omit += ["keywords"] + annotated += [k.value for k in node.keywords] + not_annotated += [(k, ["value"]) for k in node.keywords] + + if omit: + with self._enter_annotation(AnnotationState.NONE): + for na_node, na_omit in not_annotated: + self.handleChildren(na_node, omit=na_omit) + self.handleChildren(node, omit=omit) + + with self._enter_annotation(): + for annotated_node in annotated: + self.handleNode(annotated_node, node) + else: + self.handleChildren(node) def _handle_percent_format(self, node): try: @@ -1728,7 +1876,7 @@ def BINOP(self, node): self.handleChildren(node) def STR(self, node): - if self._in_annotation and not self._in_typing_literal: + if self._in_annotation: fn = functools.partial( self.handleStringAnnotation, node.s, @@ -2224,11 +2372,7 @@ def EXCEPTHANDLER(self, node): self.scope[node.name] = prev_definition def ANNASSIGN(self, node): - if node.value: - # Only bind the *targets* if the assignment has a value. - # Otherwise it's not really ast.Store and shouldn't silence - # UndefinedLocal warnings. - self.handleNode(node.target, node) + self.handleNode(node.target, node) self.handleAnnotation(node.annotation, node) if node.value: # If the assignment has value, handle the *value* now. @@ -2247,3 +2391,12 @@ def COMPARE(self, node): left = right self.handleChildren(node) + + MATCH = MATCH_CASE = MATCHCLASS = MATCHOR = MATCHSEQUENCE = handleChildren + MATCHSINGLETON = MATCHVALUE = handleChildren + + def _match_target(self, node): + self.handleNodeStore(node) + self.handleChildren(node) + + MATCHAS = MATCHMAPPING = MATCHSTAR = _match_target diff --git a/anaconda_lib/linting/pyflakes/messages.py b/anaconda_lib/linting/pyflakes/messages.py old mode 100755 new mode 100644 diff --git a/anaconda_lib/linting/pyflakes/reporter.py b/anaconda_lib/linting/pyflakes/reporter.py new file mode 100644 index 00000000..0faef656 --- /dev/null +++ b/anaconda_lib/linting/pyflakes/reporter.py @@ -0,0 +1,82 @@ +""" +Provide the Reporter class. +""" + +import re +import sys + + +class Reporter(object): + """ + Formats the results of pyflakes checks to users. + """ + + def __init__(self, warningStream, errorStream): + """ + Construct a L{Reporter}. + + @param warningStream: A file-like object where warnings will be + written to. The stream's C{write} method must accept unicode. + C{sys.stdout} is a good value. + @param errorStream: A file-like object where error output will be + written to. The stream's C{write} method must accept unicode. + C{sys.stderr} is a good value. + """ + self._stdout = warningStream + self._stderr = errorStream + + def unexpectedError(self, filename, msg): + """ + An unexpected error occurred trying to process C{filename}. + + @param filename: The path to a file that we could not process. + @ptype filename: C{unicode} + @param msg: A message explaining the problem. + @ptype msg: C{unicode} + """ + self._stderr.write("%s: %s\n" % (filename, msg)) + + def syntaxError(self, filename, msg, lineno, offset, text): + """ + There was a syntax error in C{filename}. + + @param filename: The path to the file with the syntax error. + @ptype filename: C{unicode} + @param msg: An explanation of the syntax error. + @ptype msg: C{unicode} + @param lineno: The line number where the syntax error occurred. + @ptype lineno: C{int} + @param offset: The column on which the syntax error occurred, or None. + @ptype offset: C{int} + @param text: The source code containing the syntax error. + @ptype text: C{unicode} + """ + line = text.splitlines()[-1] + if offset is not None: + if sys.version_info < (3, 8): + offset = offset - (len(text) - len(line)) + 1 + self._stderr.write('%s:%d:%d: %s\n' % + (filename, lineno, offset, msg)) + else: + self._stderr.write('%s:%d: %s\n' % (filename, lineno, msg)) + self._stderr.write(line) + self._stderr.write('\n') + if offset is not None: + self._stderr.write(re.sub(r'\S', ' ', line[:offset - 1]) + + "^\n") + + def flake(self, message): + """ + pyflakes found something wrong with the code. + + @param: A L{pyflakes.messages.Message}. + """ + self._stdout.write(str(message)) + self._stdout.write('\n') + + +def _makeDefaultReporter(): + """ + Make a reporter that can be used when no reporter is specified. + """ + return Reporter(sys.stdout, sys.stderr) diff --git a/anaconda_lib/linting/pyflakes/scripts/__init__.py b/anaconda_lib/linting/pyflakes/scripts/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/anaconda_lib/linting/pyflakes/scripts/pyflakes.py b/anaconda_lib/linting/pyflakes/scripts/pyflakes.py new file mode 100644 index 00000000..4a18e796 --- /dev/null +++ b/anaconda_lib/linting/pyflakes/scripts/pyflakes.py @@ -0,0 +1,8 @@ +""" +Implementation of the command-line I{pyflakes} tool. +""" +from __future__ import absolute_import + +# For backward compatibility +__all__ = ['check', 'checkPath', 'checkRecursive', 'iterSourceCode', 'main'] +from pyflakes.api import check, checkPath, checkRecursive, iterSourceCode, main diff --git a/anaconda_lib/linting/pyflakes/test/__init__.py b/anaconda_lib/linting/pyflakes/test/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/anaconda_lib/linting/pyflakes/test/harness.py b/anaconda_lib/linting/pyflakes/test/harness.py new file mode 100644 index 00000000..b20ac79d --- /dev/null +++ b/anaconda_lib/linting/pyflakes/test/harness.py @@ -0,0 +1,72 @@ +import ast +import textwrap +import unittest + +from pyflakes import checker + +__all__ = ['TestCase', 'skip', 'skipIf'] + +skip = unittest.skip +skipIf = unittest.skipIf + + +class TestCase(unittest.TestCase): + + withDoctest = False + + def flakes(self, input, *expectedOutputs, **kw): + tree = ast.parse(textwrap.dedent(input)) + file_tokens = checker.make_tokens(textwrap.dedent(input)) + if kw.get('is_segment'): + tree = tree.body[0] + kw.pop('is_segment') + w = checker.Checker( + tree, file_tokens=file_tokens, withDoctest=self.withDoctest, **kw + ) + outputs = [type(o) for o in w.messages] + expectedOutputs = list(expectedOutputs) + outputs.sort(key=lambda t: t.__name__) + expectedOutputs.sort(key=lambda t: t.__name__) + self.assertEqual(outputs, expectedOutputs, '''\ +for input: +%s +expected outputs: +%r +but got: +%s''' % (input, expectedOutputs, '\n'.join([str(o) for o in w.messages]))) + return w + + if not hasattr(unittest.TestCase, 'assertIs'): + + def assertIs(self, expr1, expr2, msg=None): + if expr1 is not expr2: + self.fail(msg or '%r is not %r' % (expr1, expr2)) + + if not hasattr(unittest.TestCase, 'assertIsInstance'): + + def assertIsInstance(self, obj, cls, msg=None): + """Same as self.assertTrue(isinstance(obj, cls)).""" + if not isinstance(obj, cls): + self.fail(msg or '%r is not an instance of %r' % (obj, cls)) + + if not hasattr(unittest.TestCase, 'assertNotIsInstance'): + + def assertNotIsInstance(self, obj, cls, msg=None): + """Same as self.assertFalse(isinstance(obj, cls)).""" + if isinstance(obj, cls): + self.fail(msg or '%r is an instance of %r' % (obj, cls)) + + if not hasattr(unittest.TestCase, 'assertIn'): + + def assertIn(self, member, container, msg=None): + """Just like self.assertTrue(a in b).""" + if member not in container: + self.fail(msg or '%r not found in %r' % (member, container)) + + if not hasattr(unittest.TestCase, 'assertNotIn'): + + def assertNotIn(self, member, container, msg=None): + """Just like self.assertTrue(a not in b).""" + if member in container: + self.fail(msg or + '%r unexpectedly found in %r' % (member, container)) diff --git a/anaconda_lib/linting/pyflakes/test/test_api.py b/anaconda_lib/linting/pyflakes/test/test_api.py new file mode 100644 index 00000000..2c1cf19d --- /dev/null +++ b/anaconda_lib/linting/pyflakes/test/test_api.py @@ -0,0 +1,845 @@ +""" +Tests for L{pyflakes.scripts.pyflakes}. +""" + +import contextlib +import os +import sys +import shutil +import subprocess +import tempfile + +from pyflakes.messages import UnusedImport +from pyflakes.reporter import Reporter +from pyflakes.api import ( + main, + checkPath, + checkRecursive, + iterSourceCode, +) +from pyflakes.test.harness import TestCase, skipIf + +if sys.version_info < (3,): + from cStringIO import StringIO +else: + from io import StringIO + unichr = chr + +try: + sys.pypy_version_info + PYPY = True +except AttributeError: + PYPY = False + +try: + WindowsError + WIN = True +except NameError: + WIN = False + +ERROR_HAS_COL_NUM = ERROR_HAS_LAST_LINE = sys.version_info >= (3, 2) or PYPY + + +def withStderrTo(stderr, f, *args, **kwargs): + """ + Call C{f} with C{sys.stderr} redirected to C{stderr}. + """ + (outer, sys.stderr) = (sys.stderr, stderr) + try: + return f(*args, **kwargs) + finally: + sys.stderr = outer + + +class Node(object): + """ + Mock an AST node. + """ + def __init__(self, lineno, col_offset=0): + self.lineno = lineno + self.col_offset = col_offset + + +class SysStreamCapturing(object): + + """ + Context manager capturing sys.stdin, sys.stdout and sys.stderr. + + The file handles are replaced with a StringIO object. + On environments that support it, the StringIO object uses newlines + set to os.linesep. Otherwise newlines are converted from \\n to + os.linesep during __exit__. + """ + + def _create_StringIO(self, buffer=None): + # Python 3 has a newline argument + try: + return StringIO(buffer, newline=os.linesep) + except TypeError: + self._newline = True + # Python 2 creates an input only stream when buffer is not None + if buffer is None: + return StringIO() + else: + return StringIO(buffer) + + def __init__(self, stdin): + self._newline = False + self._stdin = self._create_StringIO(stdin or '') + + def __enter__(self): + self._orig_stdin = sys.stdin + self._orig_stdout = sys.stdout + self._orig_stderr = sys.stderr + + sys.stdin = self._stdin + sys.stdout = self._stdout_stringio = self._create_StringIO() + sys.stderr = self._stderr_stringio = self._create_StringIO() + + return self + + def __exit__(self, *args): + self.output = self._stdout_stringio.getvalue() + self.error = self._stderr_stringio.getvalue() + + if self._newline and os.linesep != '\n': + self.output = self.output.replace('\n', os.linesep) + self.error = self.error.replace('\n', os.linesep) + + sys.stdin = self._orig_stdin + sys.stdout = self._orig_stdout + sys.stderr = self._orig_stderr + + +class LoggingReporter(object): + """ + Implementation of Reporter that just appends any error to a list. + """ + + def __init__(self, log): + """ + Construct a C{LoggingReporter}. + + @param log: A list to append log messages to. + """ + self.log = log + + def flake(self, message): + self.log.append(('flake', str(message))) + + def unexpectedError(self, filename, message): + self.log.append(('unexpectedError', filename, message)) + + def syntaxError(self, filename, msg, lineno, offset, line): + self.log.append(('syntaxError', filename, msg, lineno, offset, line)) + + +class TestIterSourceCode(TestCase): + """ + Tests for L{iterSourceCode}. + """ + + def setUp(self): + self.tempdir = tempfile.mkdtemp() + + def tearDown(self): + shutil.rmtree(self.tempdir) + + def makeEmptyFile(self, *parts): + assert parts + fpath = os.path.join(self.tempdir, *parts) + open(fpath, 'a').close() + return fpath + + def test_emptyDirectory(self): + """ + There are no Python files in an empty directory. + """ + self.assertEqual(list(iterSourceCode([self.tempdir])), []) + + def test_singleFile(self): + """ + If the directory contains one Python file, C{iterSourceCode} will find + it. + """ + childpath = self.makeEmptyFile('foo.py') + self.assertEqual(list(iterSourceCode([self.tempdir])), [childpath]) + + def test_onlyPythonSource(self): + """ + Files that are not Python source files are not included. + """ + self.makeEmptyFile('foo.pyc') + self.assertEqual(list(iterSourceCode([self.tempdir])), []) + + def test_recurses(self): + """ + If the Python files are hidden deep down in child directories, we will + find them. + """ + os.mkdir(os.path.join(self.tempdir, 'foo')) + apath = self.makeEmptyFile('foo', 'a.py') + self.makeEmptyFile('foo', 'a.py~') + os.mkdir(os.path.join(self.tempdir, 'bar')) + bpath = self.makeEmptyFile('bar', 'b.py') + cpath = self.makeEmptyFile('c.py') + self.assertEqual( + sorted(iterSourceCode([self.tempdir])), + sorted([apath, bpath, cpath])) + + def test_shebang(self): + """ + Find Python files that don't end with `.py`, but contain a Python + shebang. + """ + python = os.path.join(self.tempdir, 'a') + with open(python, 'w') as fd: + fd.write('#!/usr/bin/env python\n') + + self.makeEmptyFile('b') + + with open(os.path.join(self.tempdir, 'c'), 'w') as fd: + fd.write('hello\nworld\n') + + python2 = os.path.join(self.tempdir, 'd') + with open(python2, 'w') as fd: + fd.write('#!/usr/bin/env python2\n') + + python3 = os.path.join(self.tempdir, 'e') + with open(python3, 'w') as fd: + fd.write('#!/usr/bin/env python3\n') + + pythonw = os.path.join(self.tempdir, 'f') + with open(pythonw, 'w') as fd: + fd.write('#!/usr/bin/env pythonw\n') + + python3args = os.path.join(self.tempdir, 'g') + with open(python3args, 'w') as fd: + fd.write('#!/usr/bin/python3 -u\n') + + python2u = os.path.join(self.tempdir, 'h') + with open(python2u, 'w') as fd: + fd.write('#!/usr/bin/python2u\n') + + python3d = os.path.join(self.tempdir, 'i') + with open(python3d, 'w') as fd: + fd.write('#!/usr/local/bin/python3d\n') + + python38m = os.path.join(self.tempdir, 'j') + with open(python38m, 'w') as fd: + fd.write('#! /usr/bin/env python3.8m\n') + + python27 = os.path.join(self.tempdir, 'k') + with open(python27, 'w') as fd: + fd.write('#!/usr/bin/python2.7 \n') + + # Should NOT be treated as Python source + notfirst = os.path.join(self.tempdir, 'l') + with open(notfirst, 'w') as fd: + fd.write('#!/bin/sh\n#!/usr/bin/python\n') + + self.assertEqual( + sorted(iterSourceCode([self.tempdir])), + sorted([python, python2, python3, pythonw, python3args, python2u, + python3d, python38m, python27])) + + def test_multipleDirectories(self): + """ + L{iterSourceCode} can be given multiple directories. It will recurse + into each of them. + """ + foopath = os.path.join(self.tempdir, 'foo') + barpath = os.path.join(self.tempdir, 'bar') + os.mkdir(foopath) + apath = self.makeEmptyFile('foo', 'a.py') + os.mkdir(barpath) + bpath = self.makeEmptyFile('bar', 'b.py') + self.assertEqual( + sorted(iterSourceCode([foopath, barpath])), + sorted([apath, bpath])) + + def test_explicitFiles(self): + """ + If one of the paths given to L{iterSourceCode} is not a directory but + a file, it will include that in its output. + """ + epath = self.makeEmptyFile('e.py') + self.assertEqual(list(iterSourceCode([epath])), + [epath]) + + +class TestReporter(TestCase): + """ + Tests for L{Reporter}. + """ + + def test_syntaxError(self): + """ + C{syntaxError} reports that there was a syntax error in the source + file. It reports to the error stream and includes the filename, line + number, error message, actual line of source and a caret pointing to + where the error is. + """ + err = StringIO() + reporter = Reporter(None, err) + reporter.syntaxError('foo.py', 'a problem', 3, + 8 if sys.version_info >= (3, 8) else 7, + 'bad line of source') + self.assertEqual( + ("foo.py:3:8: a problem\n" + "bad line of source\n" + " ^\n"), + err.getvalue()) + + def test_syntaxErrorNoOffset(self): + """ + C{syntaxError} doesn't include a caret pointing to the error if + C{offset} is passed as C{None}. + """ + err = StringIO() + reporter = Reporter(None, err) + reporter.syntaxError('foo.py', 'a problem', 3, None, + 'bad line of source') + self.assertEqual( + ("foo.py:3: a problem\n" + "bad line of source\n"), + err.getvalue()) + + def test_multiLineSyntaxError(self): + """ + If there's a multi-line syntax error, then we only report the last + line. The offset is adjusted so that it is relative to the start of + the last line. + """ + err = StringIO() + lines = [ + 'bad line of source', + 'more bad lines of source', + ] + reporter = Reporter(None, err) + reporter.syntaxError('foo.py', 'a problem', 3, len(lines[0]) + 7, + '\n'.join(lines)) + column = 25 if sys.version_info >= (3, 8) else 7 + self.assertEqual( + ("foo.py:3:%d: a problem\n" % column + + lines[-1] + "\n" + + " " * (column - 1) + "^\n"), + err.getvalue()) + + def test_unexpectedError(self): + """ + C{unexpectedError} reports an error processing a source file. + """ + err = StringIO() + reporter = Reporter(None, err) + reporter.unexpectedError('source.py', 'error message') + self.assertEqual('source.py: error message\n', err.getvalue()) + + def test_flake(self): + """ + C{flake} reports a code warning from Pyflakes. It is exactly the + str() of a L{pyflakes.messages.Message}. + """ + out = StringIO() + reporter = Reporter(out, None) + message = UnusedImport('foo.py', Node(42), 'bar') + reporter.flake(message) + self.assertEqual(out.getvalue(), "%s\n" % (message,)) + + +class CheckTests(TestCase): + """ + Tests for L{check} and L{checkPath} which check a file for flakes. + """ + + @contextlib.contextmanager + def makeTempFile(self, content): + """ + Make a temporary file containing C{content} and return a path to it. + """ + fd, name = tempfile.mkstemp() + try: + with os.fdopen(fd, 'wb') as f: + if not hasattr(content, 'decode'): + content = content.encode('ascii') + f.write(content) + yield name + finally: + os.remove(name) + + def assertHasErrors(self, path, errorList): + """ + Assert that C{path} causes errors. + + @param path: A path to a file to check. + @param errorList: A list of errors expected to be printed to stderr. + """ + err = StringIO() + count = withStderrTo(err, checkPath, path) + self.assertEqual( + (count, err.getvalue()), (len(errorList), ''.join(errorList))) + + def getErrors(self, path): + """ + Get any warnings or errors reported by pyflakes for the file at C{path}. + + @param path: The path to a Python file on disk that pyflakes will check. + @return: C{(count, log)}, where C{count} is the number of warnings or + errors generated, and log is a list of those warnings, presented + as structured data. See L{LoggingReporter} for more details. + """ + log = [] + reporter = LoggingReporter(log) + count = checkPath(path, reporter) + return count, log + + def test_legacyScript(self): + from pyflakes.scripts import pyflakes as script_pyflakes + self.assertIs(script_pyflakes.checkPath, checkPath) + + def test_missingTrailingNewline(self): + """ + Source which doesn't end with a newline shouldn't cause any + exception to be raised nor an error indicator to be returned by + L{check}. + """ + with self.makeTempFile("def foo():\n\tpass\n\t") as fName: + self.assertHasErrors(fName, []) + + def test_checkPathNonExisting(self): + """ + L{checkPath} handles non-existing files. + """ + count, errors = self.getErrors('extremo') + self.assertEqual(count, 1) + self.assertEqual( + errors, + [('unexpectedError', 'extremo', 'No such file or directory')]) + + def test_multilineSyntaxError(self): + """ + Source which includes a syntax error which results in the raised + L{SyntaxError.text} containing multiple lines of source are reported + with only the last line of that source. + """ + source = """\ +def foo(): + ''' + +def bar(): + pass + +def baz(): + '''quux''' +""" + + # Sanity check - SyntaxError.text should be multiple lines, if it + # isn't, something this test was unprepared for has happened. + def evaluate(source): + exec(source) + try: + evaluate(source) + except SyntaxError: + e = sys.exc_info()[1] + if not PYPY and sys.version_info < (3, 10): + self.assertTrue(e.text.count('\n') > 1) + else: + self.fail() + + with self.makeTempFile(source) as sourcePath: + if PYPY: + message = 'end of file (EOF) while scanning triple-quoted string literal' + elif sys.version_info >= (3, 10): + message = 'unterminated triple-quoted string literal (detected at line 8)' # noqa: E501 + else: + message = 'invalid syntax' + + if sys.version_info >= (3, 10): + column = 12 + elif sys.version_info >= (3, 8): + column = 8 + else: + column = 11 + self.assertHasErrors( + sourcePath, + ["""\ +%s:8:%d: %s + '''quux''' +%s^ +""" % (sourcePath, column, message, ' ' * (column - 1))]) + + def test_eofSyntaxError(self): + """ + The error reported for source files which end prematurely causing a + syntax error reflects the cause for the syntax error. + """ + with self.makeTempFile("def foo(") as sourcePath: + if PYPY: + msg = 'parenthesis is never closed' + elif sys.version_info >= (3, 10): + msg = "'(' was never closed" + else: + msg = 'unexpected EOF while parsing' + + if PYPY: + column = 7 + elif sys.version_info >= (3, 10): + column = 8 + else: + column = 9 + + spaces = ' ' * (column - 1) + expected = '{}:1:{}: {}\ndef foo(\n{}^\n'.format( + sourcePath, column, msg, spaces + ) + + self.assertHasErrors(sourcePath, [expected]) + + def test_eofSyntaxErrorWithTab(self): + """ + The error reported for source files which end prematurely causing a + syntax error reflects the cause for the syntax error. + """ + with self.makeTempFile("if True:\n\tfoo =") as sourcePath: + column = 6 if PYPY else 7 + last_line = '\t ^' if PYPY else '\t ^' + + self.assertHasErrors( + sourcePath, + ["""\ +%s:2:%s: invalid syntax +\tfoo = +%s +""" % (sourcePath, column, last_line)]) + + def test_nonDefaultFollowsDefaultSyntaxError(self): + """ + Source which has a non-default argument following a default argument + should include the line number of the syntax error. However these + exceptions do not include an offset. + """ + source = """\ +def foo(bar=baz, bax): + pass +""" + with self.makeTempFile(source) as sourcePath: + if ERROR_HAS_LAST_LINE: + if PYPY: + column = 7 + elif sys.version_info >= (3, 10): + column = 18 + elif sys.version_info >= (3, 9): + column = 21 + elif sys.version_info >= (3, 8): + column = 9 + else: + column = 8 + last_line = ' ' * (column - 1) + '^\n' + columnstr = '%d:' % column + else: + last_line = columnstr = '' + self.assertHasErrors( + sourcePath, + ["""\ +%s:1:%s non-default argument follows default argument +def foo(bar=baz, bax): +%s""" % (sourcePath, columnstr, last_line)]) + + def test_nonKeywordAfterKeywordSyntaxError(self): + """ + Source which has a non-keyword argument after a keyword argument should + include the line number of the syntax error. However these exceptions + do not include an offset. + """ + source = """\ +foo(bar=baz, bax) +""" + with self.makeTempFile(source) as sourcePath: + if ERROR_HAS_LAST_LINE: + if PYPY: + column = 12 + elif sys.version_info >= (3, 9): + column = 17 + elif sys.version_info >= (3, 8): + column = 14 + else: + column = 13 + last_line = ' ' * (column - 1) + '^\n' + columnstr = '%d:' % column + else: + last_line = columnstr = '' + + if sys.version_info >= (3, 5): + message = 'positional argument follows keyword argument' + else: + message = 'non-keyword arg after keyword arg' + + self.assertHasErrors( + sourcePath, + ["""\ +%s:1:%s %s +foo(bar=baz, bax) +%s""" % (sourcePath, columnstr, message, last_line)]) + + def test_invalidEscape(self): + """ + The invalid escape syntax raises ValueError in Python 2 + """ + ver = sys.version_info + # ValueError: invalid \x escape + with self.makeTempFile(r"foo = '\xyz'") as sourcePath: + if ver < (3,): + decoding_error = "%s: problem decoding source\n" % (sourcePath,) + else: + position_end = 1 + if PYPY: + column = 5 + elif ver >= (3, 9): + column = 13 + else: + column = 7 + # Column has been "fixed" since 3.2.4 and 3.3.1 + if ver < (3, 2, 4) or ver[:3] == (3, 3, 0): + position_end = 2 + + if ERROR_HAS_LAST_LINE: + last_line = '%s^\n' % (' ' * (column - 1)) + else: + last_line = '' + + decoding_error = """\ +%s:1:%d: (unicode error) 'unicodeescape' codec can't decode bytes \ +in position 0-%d: truncated \\xXX escape +foo = '\\xyz' +%s""" % (sourcePath, column, position_end, last_line) + + self.assertHasErrors( + sourcePath, [decoding_error]) + + @skipIf(sys.platform == 'win32', 'unsupported on Windows') + def test_permissionDenied(self): + """ + If the source file is not readable, this is reported on standard + error. + """ + if os.getuid() == 0: + self.skipTest('root user can access all files regardless of ' + 'permissions') + with self.makeTempFile('') as sourcePath: + os.chmod(sourcePath, 0) + count, errors = self.getErrors(sourcePath) + self.assertEqual(count, 1) + self.assertEqual( + errors, + [('unexpectedError', sourcePath, "Permission denied")]) + + def test_pyflakesWarning(self): + """ + If the source file has a pyflakes warning, this is reported as a + 'flake'. + """ + with self.makeTempFile("import foo") as sourcePath: + count, errors = self.getErrors(sourcePath) + self.assertEqual(count, 1) + self.assertEqual( + errors, [('flake', str(UnusedImport(sourcePath, Node(1), 'foo')))]) + + def test_encodedFileUTF8(self): + """ + If source file declares the correct encoding, no error is reported. + """ + SNOWMAN = unichr(0x2603) + source = ("""\ +# coding: utf-8 +x = "%s" +""" % SNOWMAN).encode('utf-8') + with self.makeTempFile(source) as sourcePath: + self.assertHasErrors(sourcePath, []) + + def test_CRLFLineEndings(self): + """ + Source files with Windows CR LF line endings are parsed successfully. + """ + with self.makeTempFile("x = 42\r\n") as sourcePath: + self.assertHasErrors(sourcePath, []) + + def test_misencodedFileUTF8(self): + """ + If a source file contains bytes which cannot be decoded, this is + reported on stderr. + """ + SNOWMAN = unichr(0x2603) + source = ("""\ +# coding: ascii +x = "%s" +""" % SNOWMAN).encode('utf-8') + with self.makeTempFile(source) as sourcePath: + if PYPY and sys.version_info < (3, ): + message = ('\'ascii\' codec can\'t decode byte 0xe2 ' + 'in position 21: ordinal not in range(128)') + result = """\ +%s:0:0: %s +x = "\xe2\x98\x83" + ^\n""" % (sourcePath, message) + + else: + message = 'problem decoding source' + result = "%s: problem decoding source\n" % (sourcePath,) + + self.assertHasErrors( + sourcePath, [result]) + + def test_misencodedFileUTF16(self): + """ + If a source file contains bytes which cannot be decoded, this is + reported on stderr. + """ + SNOWMAN = unichr(0x2603) + source = ("""\ +# coding: ascii +x = "%s" +""" % SNOWMAN).encode('utf-16') + with self.makeTempFile(source) as sourcePath: + self.assertHasErrors( + sourcePath, ["%s: problem decoding source\n" % (sourcePath,)]) + + def test_checkRecursive(self): + """ + L{checkRecursive} descends into each directory, finding Python files + and reporting problems. + """ + tempdir = tempfile.mkdtemp() + try: + os.mkdir(os.path.join(tempdir, 'foo')) + file1 = os.path.join(tempdir, 'foo', 'bar.py') + with open(file1, 'wb') as fd: + fd.write("import baz\n".encode('ascii')) + file2 = os.path.join(tempdir, 'baz.py') + with open(file2, 'wb') as fd: + fd.write("import contraband".encode('ascii')) + log = [] + reporter = LoggingReporter(log) + warnings = checkRecursive([tempdir], reporter) + self.assertEqual(warnings, 2) + self.assertEqual( + sorted(log), + sorted([('flake', str(UnusedImport(file1, Node(1), 'baz'))), + ('flake', + str(UnusedImport(file2, Node(1), 'contraband')))])) + finally: + shutil.rmtree(tempdir) + + +class IntegrationTests(TestCase): + """ + Tests of the pyflakes script that actually spawn the script. + """ + def setUp(self): + self.tempdir = tempfile.mkdtemp() + self.tempfilepath = os.path.join(self.tempdir, 'temp') + + def tearDown(self): + shutil.rmtree(self.tempdir) + + def getPyflakesBinary(self): + """ + Return the path to the pyflakes binary. + """ + import pyflakes + package_dir = os.path.dirname(pyflakes.__file__) + return os.path.join(package_dir, '..', 'bin', 'pyflakes') + + def runPyflakes(self, paths, stdin=None): + """ + Launch a subprocess running C{pyflakes}. + + @param paths: Command-line arguments to pass to pyflakes. + @param stdin: Text to use as stdin. + @return: C{(returncode, stdout, stderr)} of the completed pyflakes + process. + """ + env = dict(os.environ) + env['PYTHONPATH'] = os.pathsep.join(sys.path) + command = [sys.executable, self.getPyflakesBinary()] + command.extend(paths) + if stdin: + p = subprocess.Popen(command, env=env, stdin=subprocess.PIPE, + stdout=subprocess.PIPE, stderr=subprocess.PIPE) + (stdout, stderr) = p.communicate(stdin.encode('ascii')) + else: + p = subprocess.Popen(command, env=env, + stdout=subprocess.PIPE, stderr=subprocess.PIPE) + (stdout, stderr) = p.communicate() + rv = p.wait() + if sys.version_info >= (3,): + stdout = stdout.decode('utf-8') + stderr = stderr.decode('utf-8') + return (stdout, stderr, rv) + + def test_goodFile(self): + """ + When a Python source file is all good, the return code is zero and no + messages are printed to either stdout or stderr. + """ + open(self.tempfilepath, 'a').close() + d = self.runPyflakes([self.tempfilepath]) + self.assertEqual(d, ('', '', 0)) + + def test_fileWithFlakes(self): + """ + When a Python source file has warnings, the return code is non-zero + and the warnings are printed to stdout. + """ + with open(self.tempfilepath, 'wb') as fd: + fd.write("import contraband\n".encode('ascii')) + d = self.runPyflakes([self.tempfilepath]) + expected = UnusedImport(self.tempfilepath, Node(1), 'contraband') + self.assertEqual(d, ("%s%s" % (expected, os.linesep), '', 1)) + + def test_errors_io(self): + """ + When pyflakes finds errors with the files it's given, (if they don't + exist, say), then the return code is non-zero and the errors are + printed to stderr. + """ + d = self.runPyflakes([self.tempfilepath]) + error_msg = '%s: No such file or directory%s' % (self.tempfilepath, + os.linesep) + self.assertEqual(d, ('', error_msg, 1)) + + def test_errors_syntax(self): + """ + When pyflakes finds errors with the files it's given, (if they don't + exist, say), then the return code is non-zero and the errors are + printed to stderr. + """ + with open(self.tempfilepath, 'wb') as fd: + fd.write("import".encode('ascii')) + d = self.runPyflakes([self.tempfilepath]) + error_msg = '{0}:1:{2}: invalid syntax{1}import{1} {3}^{1}'.format( + self.tempfilepath, os.linesep, 6 if PYPY else 7, '' if PYPY else ' ') + self.assertEqual(d, ('', error_msg, 1)) + + def test_readFromStdin(self): + """ + If no arguments are passed to C{pyflakes} then it reads from stdin. + """ + d = self.runPyflakes([], stdin='import contraband') + expected = UnusedImport('', Node(1), 'contraband') + self.assertEqual(d, ("%s%s" % (expected, os.linesep), '', 1)) + + +class TestMain(IntegrationTests): + """ + Tests of the pyflakes main function. + """ + def runPyflakes(self, paths, stdin=None): + try: + with SysStreamCapturing(stdin) as capture: + main(args=paths) + except SystemExit as e: + self.assertIsInstance(e.code, bool) + rv = int(e.code) + return (capture.output, capture.error, rv) + else: + raise RuntimeError('SystemExit not raised') diff --git a/anaconda_lib/linting/pyflakes/test/test_builtin.py b/anaconda_lib/linting/pyflakes/test/test_builtin.py new file mode 100644 index 00000000..7150ddb1 --- /dev/null +++ b/anaconda_lib/linting/pyflakes/test/test_builtin.py @@ -0,0 +1,41 @@ +""" +Tests for detecting redefinition of builtins. +""" +from sys import version_info + +from pyflakes import messages as m +from pyflakes.test.harness import TestCase, skipIf + + +class TestBuiltins(TestCase): + + def test_builtin_unbound_local(self): + self.flakes(''' + def foo(): + a = range(1, 10) + range = a + return range + + foo() + + print(range) + ''', m.UndefinedLocal) + + def test_global_shadowing_builtin(self): + self.flakes(''' + def f(): + global range + range = None + print(range) + + f() + ''') + + @skipIf(version_info >= (3,), 'not an UnboundLocalError in Python 3') + def test_builtin_in_comprehension(self): + self.flakes(''' + def f(): + [range for range in range(1, 10)] + + f() + ''', m.UndefinedLocal) diff --git a/anaconda_lib/linting/pyflakes/test/test_checker.py b/anaconda_lib/linting/pyflakes/test/test_checker.py new file mode 100644 index 00000000..b5275726 --- /dev/null +++ b/anaconda_lib/linting/pyflakes/test/test_checker.py @@ -0,0 +1,186 @@ +import ast +import sys + +from pyflakes import checker +from pyflakes.test.harness import TestCase, skipIf + + +class TypeableVisitorTests(TestCase): + """ + Tests of L{_TypeableVisitor} + """ + + @staticmethod + def _run_visitor(s): + """ + Run L{_TypeableVisitor} on the parsed source and return the visitor. + """ + tree = ast.parse(s) + visitor = checker._TypeableVisitor() + visitor.visit(tree) + return visitor + + def test_node_types(self): + """ + Test that the typeable node types are collected + """ + visitor = self._run_visitor( + """\ +x = 1 # assignment +for x in range(1): pass # for loop +def f(): pass # function definition +with a as b: pass # with statement +""" + ) + self.assertEqual(visitor.typeable_lines, [1, 2, 3, 4]) + self.assertIsInstance(visitor.typeable_nodes[1], ast.Assign) + self.assertIsInstance(visitor.typeable_nodes[2], ast.For) + self.assertIsInstance(visitor.typeable_nodes[3], ast.FunctionDef) + self.assertIsInstance(visitor.typeable_nodes[4], ast.With) + + def test_visitor_recurses(self): + """ + Test the common pitfall of missing `generic_visit` in visitors by + ensuring that nested nodes are reported + """ + visitor = self._run_visitor( + """\ +def f(): + x = 1 +""" + ) + self.assertEqual(visitor.typeable_lines, [1, 2]) + self.assertIsInstance(visitor.typeable_nodes[1], ast.FunctionDef) + self.assertIsInstance(visitor.typeable_nodes[2], ast.Assign) + + @skipIf(sys.version_info < (3, 5), 'async syntax introduced in py35') + def test_py35_node_types(self): + """ + Test that the PEP 492 node types are collected + """ + visitor = self._run_visitor( + """\ +async def f(): # async def + async for x in y: pass # async for + async with a as b: pass # async with +""" + ) + self.assertEqual(visitor.typeable_lines, [1, 2, 3]) + self.assertIsInstance(visitor.typeable_nodes[1], ast.AsyncFunctionDef) + self.assertIsInstance(visitor.typeable_nodes[2], ast.AsyncFor) + self.assertIsInstance(visitor.typeable_nodes[3], ast.AsyncWith) + + def test_last_node_wins(self): + """ + Test that when two typeable nodes are present on a line, the last + typeable one wins. + """ + visitor = self._run_visitor('x = 1; y = 1') + # detected both assignable nodes + self.assertEqual(visitor.typeable_lines, [1, 1]) + # but the assignment to `y` wins + self.assertEqual(visitor.typeable_nodes[1].targets[0].id, 'y') + + +class CollectTypeCommentsTests(TestCase): + """ + Tests of L{_collect_type_comments} + """ + + @staticmethod + def _collect(s): + """ + Run L{_collect_type_comments} on the parsed source and return the + mapping from nodes to comments. The return value is converted to + a set: {(node_type, tuple of comments), ...} + """ + tree = ast.parse(s) + tokens = checker.make_tokens(s) + ret = checker._collect_type_comments(tree, tokens) + return {(type(k), tuple(s for _, s in v)) for k, v in ret.items()} + + def test_bytes(self): + """ + Test that the function works for binary source + """ + ret = self._collect(b'x = 1 # type: int') + self.assertSetEqual(ret, {(ast.Assign, ('# type: int',))}) + + def test_text(self): + """ + Test that the function works for text source + """ + ret = self._collect(u'x = 1 # type: int') + self.assertEqual(ret, {(ast.Assign, ('# type: int',))}) + + def test_non_type_comment_ignored(self): + """ + Test that a non-type comment is ignored + """ + ret = self._collect('x = 1 # noqa') + self.assertSetEqual(ret, set()) + + def test_type_comment_before_typeable(self): + """ + Test that a type comment before something typeable is ignored. + """ + ret = self._collect('# type: int\nx = 1') + self.assertSetEqual(ret, set()) + + def test_type_ignore_comment_ignored(self): + """ + Test that `# type: ignore` comments are not collected. + """ + ret = self._collect('x = 1 # type: ignore') + self.assertSetEqual(ret, set()) + + def test_type_ignore_with_other_things_ignored(self): + """ + Test that `# type: ignore` comments with more content are also not + collected. + """ + ret = self._collect('x = 1 # type: ignore # noqa') + self.assertSetEqual(ret, set()) + ret = self._collect('x = 1 #type:ignore#noqa') + self.assertSetEqual(ret, set()) + + def test_type_comment_with_extra_still_collected(self): + ret = self._collect('x = 1 # type: int # noqa') + self.assertSetEqual(ret, {(ast.Assign, ('# type: int # noqa',))}) + + def test_type_comment_without_whitespace(self): + ret = self._collect('x = 1 #type:int') + self.assertSetEqual(ret, {(ast.Assign, ('#type:int',))}) + + def test_type_comment_starts_with_word_ignore(self): + ret = self._collect('x = 1 # type: ignore[T]') + self.assertSetEqual(ret, set()) + + def test_last_node_wins(self): + """ + Test that when two typeable nodes are present on a line, the last + typeable one wins. + """ + ret = self._collect('def f(): x = 1 # type: int') + self.assertSetEqual(ret, {(ast.Assign, ('# type: int',))}) + + def test_function_def_assigned_comments(self): + """ + Test that type comments for function arguments are all attributed to + the function definition. + """ + ret = self._collect( + """\ +def f( + a, # type: int + b, # type: str +): + # type: (...) -> None + pass +""" + ) + expected = {( + ast.FunctionDef, + ('# type: int', '# type: str', '# type: (...) -> None'), + )} + self.assertSetEqual(ret, expected) diff --git a/anaconda_lib/linting/pyflakes/test/test_code_segment.py b/anaconda_lib/linting/pyflakes/test/test_code_segment.py new file mode 100644 index 00000000..131a74dc --- /dev/null +++ b/anaconda_lib/linting/pyflakes/test/test_code_segment.py @@ -0,0 +1,132 @@ +from sys import version_info + +from pyflakes import messages as m +from pyflakes.checker import (FunctionScope, ClassScope, ModuleScope, + Argument, FunctionDefinition, Assignment) +from pyflakes.test.harness import TestCase, skipIf + + +class TestCodeSegments(TestCase): + """ + Tests for segments of a module + """ + + def test_function_segment(self): + self.flakes(''' + def foo(): + def bar(): + pass + ''', is_segment=True) + + self.flakes(''' + def foo(): + def bar(): + x = 0 + ''', m.UnusedVariable, is_segment=True) + + def test_class_segment(self): + self.flakes(''' + class Foo: + class Bar: + pass + ''', is_segment=True) + + self.flakes(''' + class Foo: + def bar(): + x = 0 + ''', m.UnusedVariable, is_segment=True) + + def test_scope_class(self): + checker = self.flakes(''' + class Foo: + x = 0 + def bar(a, b=1, *d, **e): + pass + ''', is_segment=True) + + scopes = checker.deadScopes + module_scopes = [ + scope for scope in scopes if scope.__class__ is ModuleScope] + class_scopes = [ + scope for scope in scopes if scope.__class__ is ClassScope] + function_scopes = [ + scope for scope in scopes if scope.__class__ is FunctionScope] + + # Ensure module scope is not present because we are analysing + # the inner contents of Foo + self.assertEqual(len(module_scopes), 0) + self.assertEqual(len(class_scopes), 1) + self.assertEqual(len(function_scopes), 1) + + class_scope = class_scopes[0] + function_scope = function_scopes[0] + + self.assertIsInstance(class_scope, ClassScope) + self.assertIsInstance(function_scope, FunctionScope) + + self.assertIn('x', class_scope) + self.assertIn('bar', class_scope) + + self.assertIn('a', function_scope) + self.assertIn('b', function_scope) + self.assertIn('d', function_scope) + self.assertIn('e', function_scope) + + self.assertIsInstance(class_scope['bar'], FunctionDefinition) + self.assertIsInstance(class_scope['x'], Assignment) + + self.assertIsInstance(function_scope['a'], Argument) + self.assertIsInstance(function_scope['b'], Argument) + self.assertIsInstance(function_scope['d'], Argument) + self.assertIsInstance(function_scope['e'], Argument) + + def test_scope_function(self): + checker = self.flakes(''' + def foo(a, b=1, *d, **e): + def bar(f, g=1, *h, **i): + pass + ''', is_segment=True) + + scopes = checker.deadScopes + module_scopes = [ + scope for scope in scopes if scope.__class__ is ModuleScope] + function_scopes = [ + scope for scope in scopes if scope.__class__ is FunctionScope] + + # Ensure module scope is not present because we are analysing + # the inner contents of foo + self.assertEqual(len(module_scopes), 0) + self.assertEqual(len(function_scopes), 2) + + function_scope_foo = function_scopes[1] + function_scope_bar = function_scopes[0] + + self.assertIsInstance(function_scope_foo, FunctionScope) + self.assertIsInstance(function_scope_bar, FunctionScope) + + self.assertIn('a', function_scope_foo) + self.assertIn('b', function_scope_foo) + self.assertIn('d', function_scope_foo) + self.assertIn('e', function_scope_foo) + self.assertIn('bar', function_scope_foo) + + self.assertIn('f', function_scope_bar) + self.assertIn('g', function_scope_bar) + self.assertIn('h', function_scope_bar) + self.assertIn('i', function_scope_bar) + + self.assertIsInstance(function_scope_foo['bar'], FunctionDefinition) + self.assertIsInstance(function_scope_foo['a'], Argument) + self.assertIsInstance(function_scope_foo['b'], Argument) + self.assertIsInstance(function_scope_foo['d'], Argument) + self.assertIsInstance(function_scope_foo['e'], Argument) + + self.assertIsInstance(function_scope_bar['f'], Argument) + self.assertIsInstance(function_scope_bar['g'], Argument) + self.assertIsInstance(function_scope_bar['h'], Argument) + self.assertIsInstance(function_scope_bar['i'], Argument) + + @skipIf(version_info < (3, 5), 'new in Python 3.5') + def test_scope_async_function(self): + self.flakes('async def foo(): pass', is_segment=True) diff --git a/anaconda_lib/linting/pyflakes/test/test_dict.py b/anaconda_lib/linting/pyflakes/test/test_dict.py new file mode 100644 index 00000000..b9059c22 --- /dev/null +++ b/anaconda_lib/linting/pyflakes/test/test_dict.py @@ -0,0 +1,213 @@ +""" +Tests for dict duplicate keys Pyflakes behavior. +""" + +from sys import version_info + +from pyflakes import messages as m +from pyflakes.test.harness import TestCase, skipIf + + +class Test(TestCase): + + def test_duplicate_keys(self): + self.flakes( + "{'yes': 1, 'yes': 2}", + m.MultiValueRepeatedKeyLiteral, + m.MultiValueRepeatedKeyLiteral, + ) + + @skipIf(version_info < (3,), + "bytes and strings with same 'value' are not equal in python3") + def test_duplicate_keys_bytes_vs_unicode_py3(self): + self.flakes("{b'a': 1, u'a': 2}") + + @skipIf(version_info < (3,), + "bytes and strings with same 'value' are not equal in python3") + def test_duplicate_values_bytes_vs_unicode_py3(self): + self.flakes( + "{1: b'a', 1: u'a'}", + m.MultiValueRepeatedKeyLiteral, + m.MultiValueRepeatedKeyLiteral, + ) + + @skipIf(version_info >= (3,), + "bytes and strings with same 'value' are equal in python2") + def test_duplicate_keys_bytes_vs_unicode_py2(self): + self.flakes( + "{b'a': 1, u'a': 2}", + m.MultiValueRepeatedKeyLiteral, + m.MultiValueRepeatedKeyLiteral, + ) + + @skipIf(version_info >= (3,), + "bytes and strings with same 'value' are equal in python2") + def test_duplicate_values_bytes_vs_unicode_py2(self): + self.flakes("{1: b'a', 1: u'a'}") + + def test_multiple_duplicate_keys(self): + self.flakes( + "{'yes': 1, 'yes': 2, 'no': 2, 'no': 3}", + m.MultiValueRepeatedKeyLiteral, + m.MultiValueRepeatedKeyLiteral, + m.MultiValueRepeatedKeyLiteral, + m.MultiValueRepeatedKeyLiteral, + ) + + def test_duplicate_keys_in_function(self): + self.flakes( + ''' + def f(thing): + pass + f({'yes': 1, 'yes': 2}) + ''', + m.MultiValueRepeatedKeyLiteral, + m.MultiValueRepeatedKeyLiteral, + ) + + def test_duplicate_keys_in_lambda(self): + self.flakes( + "lambda x: {(0,1): 1, (0,1): 2}", + m.MultiValueRepeatedKeyLiteral, + m.MultiValueRepeatedKeyLiteral, + ) + + def test_duplicate_keys_tuples(self): + self.flakes( + "{(0,1): 1, (0,1): 2}", + m.MultiValueRepeatedKeyLiteral, + m.MultiValueRepeatedKeyLiteral, + ) + + def test_duplicate_keys_tuples_int_and_float(self): + self.flakes( + "{(0,1): 1, (0,1.0): 2}", + m.MultiValueRepeatedKeyLiteral, + m.MultiValueRepeatedKeyLiteral, + ) + + def test_duplicate_keys_ints(self): + self.flakes( + "{1: 1, 1: 2}", + m.MultiValueRepeatedKeyLiteral, + m.MultiValueRepeatedKeyLiteral, + ) + + def test_duplicate_keys_bools(self): + self.flakes( + "{True: 1, True: 2}", + m.MultiValueRepeatedKeyLiteral, + m.MultiValueRepeatedKeyLiteral, + ) + + def test_duplicate_keys_bools_false(self): + # Needed to ensure 2.x correctly coerces these from variables + self.flakes( + "{False: 1, False: 2}", + m.MultiValueRepeatedKeyLiteral, + m.MultiValueRepeatedKeyLiteral, + ) + + def test_duplicate_keys_none(self): + self.flakes( + "{None: 1, None: 2}", + m.MultiValueRepeatedKeyLiteral, + m.MultiValueRepeatedKeyLiteral, + ) + + def test_duplicate_variable_keys(self): + self.flakes( + ''' + a = 1 + {a: 1, a: 2} + ''', + m.MultiValueRepeatedKeyVariable, + m.MultiValueRepeatedKeyVariable, + ) + + def test_duplicate_variable_values(self): + self.flakes( + ''' + a = 1 + b = 2 + {1: a, 1: b} + ''', + m.MultiValueRepeatedKeyLiteral, + m.MultiValueRepeatedKeyLiteral, + ) + + def test_duplicate_variable_values_same_value(self): + # Current behaviour is not to look up variable values. This is to + # confirm that. + self.flakes( + ''' + a = 1 + b = 1 + {1: a, 1: b} + ''', + m.MultiValueRepeatedKeyLiteral, + m.MultiValueRepeatedKeyLiteral, + ) + + def test_duplicate_key_float_and_int(self): + """ + These do look like different values, but when it comes to their use as + keys, they compare as equal and so are actually duplicates. + The literal dict {1: 1, 1.0: 1} actually becomes {1.0: 1}. + """ + self.flakes( + ''' + {1: 1, 1.0: 2} + ''', + m.MultiValueRepeatedKeyLiteral, + m.MultiValueRepeatedKeyLiteral, + ) + + def test_no_duplicate_key_error_same_value(self): + self.flakes(''' + {'yes': 1, 'yes': 1} + ''') + + def test_no_duplicate_key_errors(self): + self.flakes(''' + {'yes': 1, 'no': 2} + ''') + + def test_no_duplicate_keys_tuples_same_first_element(self): + self.flakes("{(0,1): 1, (0,2): 1}") + + def test_no_duplicate_key_errors_func_call(self): + self.flakes(''' + def test(thing): + pass + test({True: 1, None: 2, False: 1}) + ''') + + def test_no_duplicate_key_errors_bool_or_none(self): + self.flakes("{True: 1, None: 2, False: 1}") + + def test_no_duplicate_key_errors_ints(self): + self.flakes(''' + {1: 1, 2: 1} + ''') + + def test_no_duplicate_key_errors_vars(self): + self.flakes(''' + test = 'yes' + rest = 'yes' + {test: 1, rest: 2} + ''') + + def test_no_duplicate_key_errors_tuples(self): + self.flakes(''' + {(0,1): 1, (0,2): 1} + ''') + + def test_no_duplicate_key_errors_instance_attributes(self): + self.flakes(''' + class Test(): + pass + f = Test() + f.a = 1 + {f.a: 1, f.a: 1} + ''') diff --git a/anaconda_lib/linting/pyflakes/test/test_doctests.py b/anaconda_lib/linting/pyflakes/test/test_doctests.py new file mode 100644 index 00000000..836b2489 --- /dev/null +++ b/anaconda_lib/linting/pyflakes/test/test_doctests.py @@ -0,0 +1,465 @@ +import sys +import textwrap + +from pyflakes import messages as m +from pyflakes.checker import ( + DoctestScope, + FunctionScope, + ModuleScope, +) +from pyflakes.test.test_other import Test as TestOther +from pyflakes.test.test_imports import Test as TestImports +from pyflakes.test.test_undefined_names import Test as TestUndefinedNames +from pyflakes.test.harness import TestCase, skip + +try: + sys.pypy_version_info + PYPY = True +except AttributeError: + PYPY = False + + +class _DoctestMixin(object): + + withDoctest = True + + def doctestify(self, input): + lines = [] + for line in textwrap.dedent(input).splitlines(): + if line.strip() == '': + pass + elif (line.startswith(' ') or + line.startswith('except:') or + line.startswith('except ') or + line.startswith('finally:') or + line.startswith('else:') or + line.startswith('elif ') or + (lines and lines[-1].startswith(('>>> @', '... @')))): + line = "... %s" % line + else: + line = ">>> %s" % line + lines.append(line) + doctestificator = textwrap.dedent('''\ + def doctest_something(): + """ + %s + """ + ''') + return doctestificator % "\n ".join(lines) + + def flakes(self, input, *args, **kw): + return super(_DoctestMixin, self).flakes(self.doctestify(input), *args, **kw) + + +class Test(TestCase): + + withDoctest = True + + def test_scope_class(self): + """Check that a doctest is given a DoctestScope.""" + checker = self.flakes(""" + m = None + + def doctest_stuff(): + ''' + >>> d = doctest_stuff() + ''' + f = m + return f + """) + + scopes = checker.deadScopes + module_scopes = [ + scope for scope in scopes if scope.__class__ is ModuleScope] + doctest_scopes = [ + scope for scope in scopes if scope.__class__ is DoctestScope] + function_scopes = [ + scope for scope in scopes if scope.__class__ is FunctionScope] + + self.assertEqual(len(module_scopes), 1) + self.assertEqual(len(doctest_scopes), 1) + + module_scope = module_scopes[0] + doctest_scope = doctest_scopes[0] + + self.assertIsInstance(doctest_scope, DoctestScope) + self.assertIsInstance(doctest_scope, ModuleScope) + self.assertNotIsInstance(doctest_scope, FunctionScope) + self.assertNotIsInstance(module_scope, DoctestScope) + + self.assertIn('m', module_scope) + self.assertIn('doctest_stuff', module_scope) + + self.assertIn('d', doctest_scope) + + self.assertEqual(len(function_scopes), 1) + self.assertIn('f', function_scopes[0]) + + def test_nested_doctest_ignored(self): + """Check that nested doctests are ignored.""" + checker = self.flakes(""" + m = None + + def doctest_stuff(): + ''' + >>> def function_in_doctest(): + ... \"\"\" + ... >>> ignored_undefined_name + ... \"\"\" + ... df = m + ... return df + ... + >>> function_in_doctest() + ''' + f = m + return f + """) + + scopes = checker.deadScopes + module_scopes = [ + scope for scope in scopes if scope.__class__ is ModuleScope] + doctest_scopes = [ + scope for scope in scopes if scope.__class__ is DoctestScope] + function_scopes = [ + scope for scope in scopes if scope.__class__ is FunctionScope] + + self.assertEqual(len(module_scopes), 1) + self.assertEqual(len(doctest_scopes), 1) + + module_scope = module_scopes[0] + doctest_scope = doctest_scopes[0] + + self.assertIn('m', module_scope) + self.assertIn('doctest_stuff', module_scope) + self.assertIn('function_in_doctest', doctest_scope) + + self.assertEqual(len(function_scopes), 2) + + self.assertIn('f', function_scopes[0]) + self.assertIn('df', function_scopes[1]) + + def test_global_module_scope_pollution(self): + """Check that global in doctest does not pollute module scope.""" + checker = self.flakes(""" + def doctest_stuff(): + ''' + >>> def function_in_doctest(): + ... global m + ... m = 50 + ... df = 10 + ... m = df + ... + >>> function_in_doctest() + ''' + f = 10 + return f + + """) + + scopes = checker.deadScopes + module_scopes = [ + scope for scope in scopes if scope.__class__ is ModuleScope] + doctest_scopes = [ + scope for scope in scopes if scope.__class__ is DoctestScope] + function_scopes = [ + scope for scope in scopes if scope.__class__ is FunctionScope] + + self.assertEqual(len(module_scopes), 1) + self.assertEqual(len(doctest_scopes), 1) + + module_scope = module_scopes[0] + doctest_scope = doctest_scopes[0] + + self.assertIn('doctest_stuff', module_scope) + self.assertIn('function_in_doctest', doctest_scope) + + self.assertEqual(len(function_scopes), 2) + + self.assertIn('f', function_scopes[0]) + self.assertIn('df', function_scopes[1]) + self.assertIn('m', function_scopes[1]) + + self.assertNotIn('m', module_scope) + + def test_global_undefined(self): + self.flakes(""" + global m + + def doctest_stuff(): + ''' + >>> m + ''' + """, m.UndefinedName) + + def test_nested_class(self): + """Doctest within nested class are processed.""" + self.flakes(""" + class C: + class D: + ''' + >>> m + ''' + def doctest_stuff(self): + ''' + >>> m + ''' + return 1 + """, m.UndefinedName, m.UndefinedName) + + def test_ignore_nested_function(self): + """Doctest module does not process doctest in nested functions.""" + # 'syntax error' would cause a SyntaxError if the doctest was processed. + # However doctest does not find doctest in nested functions + # (https://bugs.python.org/issue1650090). If nested functions were + # processed, this use of m should cause UndefinedName, and the + # name inner_function should probably exist in the doctest scope. + self.flakes(""" + def doctest_stuff(): + def inner_function(): + ''' + >>> syntax error + >>> inner_function() + 1 + >>> m + ''' + return 1 + m = inner_function() + return m + """) + + def test_inaccessible_scope_class(self): + """Doctest may not access class scope.""" + self.flakes(""" + class C: + def doctest_stuff(self): + ''' + >>> m + ''' + return 1 + m = 1 + """, m.UndefinedName) + + def test_importBeforeDoctest(self): + self.flakes(""" + import foo + + def doctest_stuff(): + ''' + >>> foo + ''' + """) + + @skip("todo") + def test_importBeforeAndInDoctest(self): + self.flakes(''' + import foo + + def doctest_stuff(): + """ + >>> import foo + >>> foo + """ + + foo + ''', m.RedefinedWhileUnused) + + def test_importInDoctestAndAfter(self): + self.flakes(''' + def doctest_stuff(): + """ + >>> import foo + >>> foo + """ + + import foo + foo() + ''') + + def test_offsetInDoctests(self): + exc = self.flakes(''' + + def doctest_stuff(): + """ + >>> x # line 5 + """ + + ''', m.UndefinedName).messages[0] + self.assertEqual(exc.lineno, 5) + self.assertEqual(exc.col, 12) + + def test_offsetInLambdasInDoctests(self): + exc = self.flakes(''' + + def doctest_stuff(): + """ + >>> lambda: x # line 5 + """ + + ''', m.UndefinedName).messages[0] + self.assertEqual(exc.lineno, 5) + self.assertEqual(exc.col, 20) + + def test_offsetAfterDoctests(self): + exc = self.flakes(''' + + def doctest_stuff(): + """ + >>> x = 5 + """ + + x + + ''', m.UndefinedName).messages[0] + self.assertEqual(exc.lineno, 8) + self.assertEqual(exc.col, 0) + + def test_syntaxErrorInDoctest(self): + exceptions = self.flakes( + ''' + def doctest_stuff(): + """ + >>> from # line 4 + >>> fortytwo = 42 + >>> except Exception: + """ + ''', + m.DoctestSyntaxError, + m.DoctestSyntaxError, + m.DoctestSyntaxError).messages + exc = exceptions[0] + self.assertEqual(exc.lineno, 4) + if PYPY: + self.assertEqual(exc.col, 27) + elif sys.version_info >= (3, 8): + self.assertEqual(exc.col, 18) + else: + self.assertEqual(exc.col, 26) + + # PyPy error column offset is 0, + # for the second and third line of the doctest + # i.e. at the beginning of the line + exc = exceptions[1] + self.assertEqual(exc.lineno, 5) + if PYPY: + self.assertEqual(exc.col, 14) + else: + self.assertEqual(exc.col, 16) + exc = exceptions[2] + self.assertEqual(exc.lineno, 6) + if PYPY: + self.assertEqual(exc.col, 14) + elif sys.version_info >= (3, 8): + self.assertEqual(exc.col, 13) + else: + self.assertEqual(exc.col, 18) + + def test_indentationErrorInDoctest(self): + exc = self.flakes(''' + def doctest_stuff(): + """ + >>> if True: + ... pass + """ + ''', m.DoctestSyntaxError).messages[0] + self.assertEqual(exc.lineno, 5) + if PYPY: + self.assertEqual(exc.col, 14) + elif sys.version_info >= (3, 8): + self.assertEqual(exc.col, 13) + else: + self.assertEqual(exc.col, 16) + + def test_offsetWithMultiLineArgs(self): + (exc1, exc2) = self.flakes( + ''' + def doctest_stuff(arg1, + arg2, + arg3): + """ + >>> assert + >>> this + """ + ''', + m.DoctestSyntaxError, + m.UndefinedName).messages + self.assertEqual(exc1.lineno, 6) + if PYPY: + self.assertEqual(exc1.col, 20) + else: + self.assertEqual(exc1.col, 19) + self.assertEqual(exc2.lineno, 7) + self.assertEqual(exc2.col, 12) + + def test_doctestCanReferToFunction(self): + self.flakes(""" + def foo(): + ''' + >>> foo + ''' + """) + + def test_doctestCanReferToClass(self): + self.flakes(""" + class Foo(): + ''' + >>> Foo + ''' + def bar(self): + ''' + >>> Foo + ''' + """) + + def test_noOffsetSyntaxErrorInDoctest(self): + exceptions = self.flakes( + ''' + def buildurl(base, *args, **kwargs): + """ + >>> buildurl('/blah.php', ('a', '&'), ('b', '=') + '/blah.php?a=%26&b=%3D' + >>> buildurl('/blah.php', a='&', 'b'='=') + '/blah.php?b=%3D&a=%26' + """ + pass + ''', + m.DoctestSyntaxError, + m.DoctestSyntaxError).messages + exc = exceptions[0] + self.assertEqual(exc.lineno, 4) + exc = exceptions[1] + self.assertEqual(exc.lineno, 6) + + def test_singleUnderscoreInDoctest(self): + self.flakes(''' + def func(): + """A docstring + + >>> func() + 1 + >>> _ + 1 + """ + return 1 + ''') + + def test_globalUnderscoreInDoctest(self): + self.flakes(""" + from gettext import ugettext as _ + + def doctest_stuff(): + ''' + >>> pass + ''' + """, m.UnusedImport) + + +class TestOther(_DoctestMixin, TestOther): + """Run TestOther with each test wrapped in a doctest.""" + + +class TestImports(_DoctestMixin, TestImports): + """Run TestImports with each test wrapped in a doctest.""" + + +class TestUndefinedNames(_DoctestMixin, TestUndefinedNames): + """Run TestUndefinedNames with each test wrapped in a doctest.""" diff --git a/anaconda_lib/linting/pyflakes/test/test_imports.py b/anaconda_lib/linting/pyflakes/test/test_imports.py new file mode 100644 index 00000000..d5be2693 --- /dev/null +++ b/anaconda_lib/linting/pyflakes/test/test_imports.py @@ -0,0 +1,1230 @@ +from sys import version_info + +from pyflakes import messages as m +from pyflakes.checker import ( + FutureImportation, + Importation, + ImportationFrom, + StarImportation, + SubmoduleImportation, +) +from pyflakes.test.harness import TestCase, skip, skipIf + + +class TestImportationObject(TestCase): + + def test_import_basic(self): + binding = Importation('a', None, 'a') + assert binding.source_statement == 'import a' + assert str(binding) == 'a' + + def test_import_as(self): + binding = Importation('c', None, 'a') + assert binding.source_statement == 'import a as c' + assert str(binding) == 'a as c' + + def test_import_submodule(self): + binding = SubmoduleImportation('a.b', None) + assert binding.source_statement == 'import a.b' + assert str(binding) == 'a.b' + + def test_import_submodule_as(self): + # A submodule import with an as clause is not a SubmoduleImportation + binding = Importation('c', None, 'a.b') + assert binding.source_statement == 'import a.b as c' + assert str(binding) == 'a.b as c' + + def test_import_submodule_as_source_name(self): + binding = Importation('a', None, 'a.b') + assert binding.source_statement == 'import a.b as a' + assert str(binding) == 'a.b as a' + + def test_importfrom_relative(self): + binding = ImportationFrom('a', None, '.', 'a') + assert binding.source_statement == 'from . import a' + assert str(binding) == '.a' + + def test_importfrom_relative_parent(self): + binding = ImportationFrom('a', None, '..', 'a') + assert binding.source_statement == 'from .. import a' + assert str(binding) == '..a' + + def test_importfrom_relative_with_module(self): + binding = ImportationFrom('b', None, '..a', 'b') + assert binding.source_statement == 'from ..a import b' + assert str(binding) == '..a.b' + + def test_importfrom_relative_with_module_as(self): + binding = ImportationFrom('c', None, '..a', 'b') + assert binding.source_statement == 'from ..a import b as c' + assert str(binding) == '..a.b as c' + + def test_importfrom_member(self): + binding = ImportationFrom('b', None, 'a', 'b') + assert binding.source_statement == 'from a import b' + assert str(binding) == 'a.b' + + def test_importfrom_submodule_member(self): + binding = ImportationFrom('c', None, 'a.b', 'c') + assert binding.source_statement == 'from a.b import c' + assert str(binding) == 'a.b.c' + + def test_importfrom_member_as(self): + binding = ImportationFrom('c', None, 'a', 'b') + assert binding.source_statement == 'from a import b as c' + assert str(binding) == 'a.b as c' + + def test_importfrom_submodule_member_as(self): + binding = ImportationFrom('d', None, 'a.b', 'c') + assert binding.source_statement == 'from a.b import c as d' + assert str(binding) == 'a.b.c as d' + + def test_importfrom_star(self): + binding = StarImportation('a.b', None) + assert binding.source_statement == 'from a.b import *' + assert str(binding) == 'a.b.*' + + def test_importfrom_star_relative(self): + binding = StarImportation('.b', None) + assert binding.source_statement == 'from .b import *' + assert str(binding) == '.b.*' + + def test_importfrom_future(self): + binding = FutureImportation('print_function', None, None) + assert binding.source_statement == 'from __future__ import print_function' + assert str(binding) == '__future__.print_function' + + def test_unusedImport_underscore(self): + """ + The magic underscore var should be reported as unused when used as an + import alias. + """ + self.flakes('import fu as _', m.UnusedImport) + + +class Test(TestCase): + + def test_unusedImport(self): + self.flakes('import fu, bar', m.UnusedImport, m.UnusedImport) + self.flakes('from baz import fu, bar', m.UnusedImport, m.UnusedImport) + + def test_unusedImport_relative(self): + self.flakes('from . import fu', m.UnusedImport) + self.flakes('from . import fu as baz', m.UnusedImport) + self.flakes('from .. import fu', m.UnusedImport) + self.flakes('from ... import fu', m.UnusedImport) + self.flakes('from .. import fu as baz', m.UnusedImport) + self.flakes('from .bar import fu', m.UnusedImport) + self.flakes('from ..bar import fu', m.UnusedImport) + self.flakes('from ...bar import fu', m.UnusedImport) + self.flakes('from ...bar import fu as baz', m.UnusedImport) + + checker = self.flakes('from . import fu', m.UnusedImport) + + error = checker.messages[0] + assert error.message == '%r imported but unused' + assert error.message_args == ('.fu', ) + + checker = self.flakes('from . import fu as baz', m.UnusedImport) + + error = checker.messages[0] + assert error.message == '%r imported but unused' + assert error.message_args == ('.fu as baz', ) + + def test_aliasedImport(self): + self.flakes('import fu as FU, bar as FU', + m.RedefinedWhileUnused, m.UnusedImport) + self.flakes('from moo import fu as FU, bar as FU', + m.RedefinedWhileUnused, m.UnusedImport) + + def test_aliasedImportShadowModule(self): + """Imported aliases can shadow the source of the import.""" + self.flakes('from moo import fu as moo; moo') + self.flakes('import fu as fu; fu') + self.flakes('import fu.bar as fu; fu') + + def test_usedImport(self): + self.flakes('import fu; print(fu)') + self.flakes('from baz import fu; print(fu)') + self.flakes('import fu; del fu') + + def test_usedImport_relative(self): + self.flakes('from . import fu; assert fu') + self.flakes('from .bar import fu; assert fu') + self.flakes('from .. import fu; assert fu') + self.flakes('from ..bar import fu as baz; assert baz') + + def test_redefinedWhileUnused(self): + self.flakes('import fu; fu = 3', m.RedefinedWhileUnused) + self.flakes('import fu; fu, bar = 3', m.RedefinedWhileUnused) + self.flakes('import fu; [fu, bar] = 3', m.RedefinedWhileUnused) + + def test_redefinedIf(self): + """ + Test that importing a module twice within an if + block does raise a warning. + """ + self.flakes(''' + i = 2 + if i==1: + import os + import os + os.path''', m.RedefinedWhileUnused) + + def test_redefinedIfElse(self): + """ + Test that importing a module twice in if + and else blocks does not raise a warning. + """ + self.flakes(''' + i = 2 + if i==1: + import os + else: + import os + os.path''') + + def test_redefinedTry(self): + """ + Test that importing a module twice in a try block + does raise a warning. + """ + self.flakes(''' + try: + import os + import os + except: + pass + os.path''', m.RedefinedWhileUnused) + + def test_redefinedTryExcept(self): + """ + Test that importing a module twice in a try + and except block does not raise a warning. + """ + self.flakes(''' + try: + import os + except: + import os + os.path''') + + def test_redefinedTryNested(self): + """ + Test that importing a module twice using a nested + try/except and if blocks does not issue a warning. + """ + self.flakes(''' + try: + if True: + if True: + import os + except: + import os + os.path''') + + def test_redefinedTryExceptMulti(self): + self.flakes(""" + try: + from aa import mixer + except AttributeError: + from bb import mixer + except RuntimeError: + from cc import mixer + except: + from dd import mixer + mixer(123) + """) + + def test_redefinedTryElse(self): + self.flakes(""" + try: + from aa import mixer + except ImportError: + pass + else: + from bb import mixer + mixer(123) + """, m.RedefinedWhileUnused) + + def test_redefinedTryExceptElse(self): + self.flakes(""" + try: + import funca + except ImportError: + from bb import funca + from bb import funcb + else: + from bbb import funcb + print(funca, funcb) + """) + + def test_redefinedTryExceptFinally(self): + self.flakes(""" + try: + from aa import a + except ImportError: + from bb import a + finally: + a = 42 + print(a) + """) + + def test_redefinedTryExceptElseFinally(self): + self.flakes(""" + try: + import b + except ImportError: + b = Ellipsis + from bb import a + else: + from aa import a + finally: + a = 42 + print(a, b) + """) + + def test_redefinedByFunction(self): + self.flakes(''' + import fu + def fu(): + pass + ''', m.RedefinedWhileUnused) + + def test_redefinedInNestedFunction(self): + """ + Test that shadowing a global name with a nested function definition + generates a warning. + """ + self.flakes(''' + import fu + def bar(): + def baz(): + def fu(): + pass + ''', m.RedefinedWhileUnused, m.UnusedImport) + + def test_redefinedInNestedFunctionTwice(self): + """ + Test that shadowing a global name with a nested function definition + generates a warning. + """ + self.flakes(''' + import fu + def bar(): + import fu + def baz(): + def fu(): + pass + ''', + m.RedefinedWhileUnused, m.RedefinedWhileUnused, + m.UnusedImport, m.UnusedImport) + + def test_redefinedButUsedLater(self): + """ + Test that a global import which is redefined locally, + but used later in another scope does not generate a warning. + """ + self.flakes(''' + import unittest, transport + + class GetTransportTestCase(unittest.TestCase): + def test_get_transport(self): + transport = 'transport' + self.assertIsNotNone(transport) + + class TestTransportMethodArgs(unittest.TestCase): + def test_send_defaults(self): + transport.Transport() + ''') + + def test_redefinedByClass(self): + self.flakes(''' + import fu + class fu: + pass + ''', m.RedefinedWhileUnused) + + def test_redefinedBySubclass(self): + """ + If an imported name is redefined by a class statement which also uses + that name in the bases list, no warning is emitted. + """ + self.flakes(''' + from fu import bar + class bar(bar): + pass + ''') + + def test_redefinedInClass(self): + """ + Test that shadowing a global with a class attribute does not produce a + warning. + """ + self.flakes(''' + import fu + class bar: + fu = 1 + print(fu) + ''') + + def test_importInClass(self): + """ + Test that import within class is a locally scoped attribute. + """ + self.flakes(''' + class bar: + import fu + ''') + + self.flakes(''' + class bar: + import fu + + fu + ''', m.UndefinedName) + + def test_usedInFunction(self): + self.flakes(''' + import fu + def fun(): + print(fu) + ''') + + def test_shadowedByParameter(self): + self.flakes(''' + import fu + def fun(fu): + print(fu) + ''', m.UnusedImport, m.RedefinedWhileUnused) + + self.flakes(''' + import fu + def fun(fu): + print(fu) + print(fu) + ''') + + def test_newAssignment(self): + self.flakes('fu = None') + + def test_usedInGetattr(self): + self.flakes('import fu; fu.bar.baz') + self.flakes('import fu; "bar".fu.baz', m.UnusedImport) + + def test_usedInSlice(self): + self.flakes('import fu; print(fu.bar[1:])') + + def test_usedInIfBody(self): + self.flakes(''' + import fu + if True: print(fu) + ''') + + def test_usedInIfConditional(self): + self.flakes(''' + import fu + if fu: pass + ''') + + def test_usedInElifConditional(self): + self.flakes(''' + import fu + if False: pass + elif fu: pass + ''') + + def test_usedInElse(self): + self.flakes(''' + import fu + if False: pass + else: print(fu) + ''') + + def test_usedInCall(self): + self.flakes('import fu; fu.bar()') + + def test_usedInClass(self): + self.flakes(''' + import fu + class bar: + bar = fu + ''') + + def test_usedInClassBase(self): + self.flakes(''' + import fu + class bar(object, fu.baz): + pass + ''') + + def test_notUsedInNestedScope(self): + self.flakes(''' + import fu + def bleh(): + pass + print(fu) + ''') + + def test_usedInFor(self): + self.flakes(''' + import fu + for bar in range(9): + print(fu) + ''') + + def test_usedInForElse(self): + self.flakes(''' + import fu + for bar in range(10): + pass + else: + print(fu) + ''') + + def test_redefinedByFor(self): + self.flakes(''' + import fu + for fu in range(2): + pass + ''', m.ImportShadowedByLoopVar) + + def test_shadowedByFor(self): + """ + Test that shadowing a global name with a for loop variable generates a + warning. + """ + self.flakes(''' + import fu + fu.bar() + for fu in (): + pass + ''', m.ImportShadowedByLoopVar) + + def test_shadowedByForDeep(self): + """ + Test that shadowing a global name with a for loop variable nested in a + tuple unpack generates a warning. + """ + self.flakes(''' + import fu + fu.bar() + for (x, y, z, (a, b, c, (fu,))) in (): + pass + ''', m.ImportShadowedByLoopVar) + # Same with a list instead of a tuple + self.flakes(''' + import fu + fu.bar() + for [x, y, z, (a, b, c, (fu,))] in (): + pass + ''', m.ImportShadowedByLoopVar) + + def test_usedInReturn(self): + self.flakes(''' + import fu + def fun(): + return fu + ''') + + def test_usedInOperators(self): + self.flakes('import fu; 3 + fu.bar') + self.flakes('import fu; 3 % fu.bar') + self.flakes('import fu; 3 - fu.bar') + self.flakes('import fu; 3 * fu.bar') + self.flakes('import fu; 3 ** fu.bar') + self.flakes('import fu; 3 / fu.bar') + self.flakes('import fu; 3 // fu.bar') + self.flakes('import fu; -fu.bar') + self.flakes('import fu; ~fu.bar') + self.flakes('import fu; 1 == fu.bar') + self.flakes('import fu; 1 | fu.bar') + self.flakes('import fu; 1 & fu.bar') + self.flakes('import fu; 1 ^ fu.bar') + self.flakes('import fu; 1 >> fu.bar') + self.flakes('import fu; 1 << fu.bar') + + def test_usedInAssert(self): + self.flakes('import fu; assert fu.bar') + + def test_usedInSubscript(self): + self.flakes('import fu; fu.bar[1]') + + def test_usedInLogic(self): + self.flakes('import fu; fu and False') + self.flakes('import fu; fu or False') + self.flakes('import fu; not fu.bar') + + def test_usedInList(self): + self.flakes('import fu; [fu]') + + def test_usedInTuple(self): + self.flakes('import fu; (fu,)') + + def test_usedInTry(self): + self.flakes(''' + import fu + try: fu + except: pass + ''') + + def test_usedInExcept(self): + self.flakes(''' + import fu + try: fu + except: pass + ''') + + def test_redefinedByExcept(self): + expected = [m.RedefinedWhileUnused] + if version_info >= (3,): + # The exc variable is unused inside the exception handler. + expected.append(m.UnusedVariable) + self.flakes(''' + import fu + try: pass + except Exception as fu: pass + ''', *expected) + + def test_usedInRaise(self): + self.flakes(''' + import fu + raise fu.bar + ''') + + def test_usedInYield(self): + self.flakes(''' + import fu + def gen(): + yield fu + ''') + + def test_usedInDict(self): + self.flakes('import fu; {fu:None}') + self.flakes('import fu; {1:fu}') + + def test_usedInParameterDefault(self): + self.flakes(''' + import fu + def f(bar=fu): + pass + ''') + + def test_usedInAttributeAssign(self): + self.flakes('import fu; fu.bar = 1') + + def test_usedInKeywordArg(self): + self.flakes('import fu; fu.bar(stuff=fu)') + + def test_usedInAssignment(self): + self.flakes('import fu; bar=fu') + self.flakes('import fu; n=0; n+=fu') + + def test_usedInListComp(self): + self.flakes('import fu; [fu for _ in range(1)]') + self.flakes('import fu; [1 for _ in range(1) if fu]') + + @skipIf(version_info >= (3,), + 'in Python 3 list comprehensions execute in a separate scope') + def test_redefinedByListComp(self): + self.flakes('import fu; [1 for fu in range(1)]', + m.RedefinedInListComp) + + def test_usedInTryFinally(self): + self.flakes(''' + import fu + try: pass + finally: fu + ''') + + self.flakes(''' + import fu + try: fu + finally: pass + ''') + + def test_usedInWhile(self): + self.flakes(''' + import fu + while 0: + fu + ''') + + self.flakes(''' + import fu + while fu: pass + ''') + + def test_usedInGlobal(self): + """ + A 'global' statement shadowing an unused import should not prevent it + from being reported. + """ + self.flakes(''' + import fu + def f(): global fu + ''', m.UnusedImport) + + def test_usedAndGlobal(self): + """ + A 'global' statement shadowing a used import should not cause it to be + reported as unused. + """ + self.flakes(''' + import foo + def f(): global foo + def g(): foo.is_used() + ''') + + def test_assignedToGlobal(self): + """ + Binding an import to a declared global should not cause it to be + reported as unused. + """ + self.flakes(''' + def f(): global foo; import foo + def g(): foo.is_used() + ''') + + @skipIf(version_info >= (3,), 'deprecated syntax') + def test_usedInBackquote(self): + self.flakes('import fu; `fu`') + + def test_usedInExec(self): + if version_info < (3,): + exec_stmt = 'exec "print 1" in fu.bar' + else: + exec_stmt = 'exec("print(1)", fu.bar)' + self.flakes('import fu; %s' % exec_stmt) + + def test_usedInLambda(self): + self.flakes('import fu; lambda: fu') + + def test_shadowedByLambda(self): + self.flakes('import fu; lambda fu: fu', + m.UnusedImport, m.RedefinedWhileUnused) + self.flakes('import fu; lambda fu: fu\nfu()') + + def test_usedInSliceObj(self): + self.flakes('import fu; "meow"[::fu]') + + def test_unusedInNestedScope(self): + self.flakes(''' + def bar(): + import fu + fu + ''', m.UnusedImport, m.UndefinedName) + + def test_methodsDontUseClassScope(self): + self.flakes(''' + class bar: + import fu + def fun(self): + fu + ''', m.UndefinedName) + + def test_nestedFunctionsNestScope(self): + self.flakes(''' + def a(): + def b(): + fu + import fu + ''') + + def test_nestedClassAndFunctionScope(self): + self.flakes(''' + def a(): + import fu + class b: + def c(self): + print(fu) + ''') + + def test_importStar(self): + """Use of import * at module level is reported.""" + self.flakes('from fu import *', m.ImportStarUsed, m.UnusedImport) + self.flakes(''' + try: + from fu import * + except: + pass + ''', m.ImportStarUsed, m.UnusedImport) + + checker = self.flakes('from fu import *', + m.ImportStarUsed, m.UnusedImport) + + error = checker.messages[0] + assert error.message.startswith("'from %s import *' used; unable ") + assert error.message_args == ('fu', ) + + error = checker.messages[1] + assert error.message == '%r imported but unused' + assert error.message_args == ('fu.*', ) + + def test_importStar_relative(self): + """Use of import * from a relative import is reported.""" + self.flakes('from .fu import *', m.ImportStarUsed, m.UnusedImport) + self.flakes(''' + try: + from .fu import * + except: + pass + ''', m.ImportStarUsed, m.UnusedImport) + + checker = self.flakes('from .fu import *', + m.ImportStarUsed, m.UnusedImport) + + error = checker.messages[0] + assert error.message.startswith("'from %s import *' used; unable ") + assert error.message_args == ('.fu', ) + + error = checker.messages[1] + assert error.message == '%r imported but unused' + assert error.message_args == ('.fu.*', ) + + checker = self.flakes('from .. import *', + m.ImportStarUsed, m.UnusedImport) + + error = checker.messages[0] + assert error.message.startswith("'from %s import *' used; unable ") + assert error.message_args == ('..', ) + + error = checker.messages[1] + assert error.message == '%r imported but unused' + assert error.message_args == ('from .. import *', ) + + @skipIf(version_info < (3,), + 'import * below module level is a warning on Python 2') + def test_localImportStar(self): + """import * is only allowed at module level.""" + self.flakes(''' + def a(): + from fu import * + ''', m.ImportStarNotPermitted) + self.flakes(''' + class a: + from fu import * + ''', m.ImportStarNotPermitted) + + checker = self.flakes(''' + class a: + from .. import * + ''', m.ImportStarNotPermitted) + error = checker.messages[0] + assert error.message == "'from %s import *' only allowed at module level" + assert error.message_args == ('..', ) + + @skipIf(version_info > (3,), + 'import * below module level is an error on Python 3') + def test_importStarNested(self): + """All star imports are marked as used by an undefined variable.""" + self.flakes(''' + from fu import * + def f(): + from bar import * + x + ''', m.ImportStarUsed, m.ImportStarUsed, m.ImportStarUsage) + + def test_packageImport(self): + """ + If a dotted name is imported and used, no warning is reported. + """ + self.flakes(''' + import fu.bar + fu.bar + ''') + + def test_unusedPackageImport(self): + """ + If a dotted name is imported and not used, an unused import warning is + reported. + """ + self.flakes('import fu.bar', m.UnusedImport) + + def test_duplicateSubmoduleImport(self): + """ + If a submodule of a package is imported twice, an unused import warning + and a redefined while unused warning are reported. + """ + self.flakes(''' + import fu.bar, fu.bar + fu.bar + ''', m.RedefinedWhileUnused) + self.flakes(''' + import fu.bar + import fu.bar + fu.bar + ''', m.RedefinedWhileUnused) + + def test_differentSubmoduleImport(self): + """ + If two different submodules of a package are imported, no duplicate + import warning is reported for the package. + """ + self.flakes(''' + import fu.bar, fu.baz + fu.bar, fu.baz + ''') + self.flakes(''' + import fu.bar + import fu.baz + fu.bar, fu.baz + ''') + + def test_used_package_with_submodule_import(self): + """ + Usage of package marks submodule imports as used. + """ + self.flakes(''' + import fu + import fu.bar + fu.x + ''') + + self.flakes(''' + import fu.bar + import fu + fu.x + ''') + + def test_used_package_with_submodule_import_of_alias(self): + """ + Usage of package by alias marks submodule imports as used. + """ + self.flakes(''' + import foo as f + import foo.bar + f.bar.do_something() + ''') + + self.flakes(''' + import foo as f + import foo.bar.blah + f.bar.blah.do_something() + ''') + + def test_unused_package_with_submodule_import(self): + """ + When a package and its submodule are imported, only report once. + """ + checker = self.flakes(''' + import fu + import fu.bar + ''', m.UnusedImport) + error = checker.messages[0] + assert error.message == '%r imported but unused' + assert error.message_args == ('fu.bar', ) + assert error.lineno == 5 if self.withDoctest else 3 + + def test_assignRHSFirst(self): + self.flakes('import fu; fu = fu') + self.flakes('import fu; fu, bar = fu') + self.flakes('import fu; [fu, bar] = fu') + self.flakes('import fu; fu += fu') + + def test_tryingMultipleImports(self): + self.flakes(''' + try: + import fu + except ImportError: + import bar as fu + fu + ''') + + def test_nonGlobalDoesNotRedefine(self): + self.flakes(''' + import fu + def a(): + fu = 3 + return fu + fu + ''') + + def test_functionsRunLater(self): + self.flakes(''' + def a(): + fu + import fu + ''') + + def test_functionNamesAreBoundNow(self): + self.flakes(''' + import fu + def fu(): + fu + fu + ''', m.RedefinedWhileUnused) + + def test_ignoreNonImportRedefinitions(self): + self.flakes('a = 1; a = 2') + + @skip("todo") + def test_importingForImportError(self): + self.flakes(''' + try: + import fu + except ImportError: + pass + ''') + + def test_importedInClass(self): + """Imports in class scope can be used through self.""" + self.flakes(''' + class c: + import i + def __init__(self): + self.i + ''') + + def test_importUsedInMethodDefinition(self): + """ + Method named 'foo' with default args referring to module named 'foo'. + """ + self.flakes(''' + import foo + + class Thing(object): + def foo(self, parser=foo.parse_foo): + pass + ''') + + def test_futureImport(self): + """__future__ is special.""" + self.flakes('from __future__ import division') + self.flakes(''' + "docstring is allowed before future import" + from __future__ import division + ''') + + def test_futureImportFirst(self): + """ + __future__ imports must come before anything else. + """ + self.flakes(''' + x = 5 + from __future__ import division + ''', m.LateFutureImport) + self.flakes(''' + from foo import bar + from __future__ import division + bar + ''', m.LateFutureImport) + + def test_futureImportUsed(self): + """__future__ is special, but names are injected in the namespace.""" + self.flakes(''' + from __future__ import division + from __future__ import print_function + + assert print_function is not division + ''') + + def test_futureImportUndefined(self): + """Importing undefined names from __future__ fails.""" + self.flakes(''' + from __future__ import print_statement + ''', m.FutureFeatureNotDefined) + + def test_futureImportStar(self): + """Importing '*' from __future__ fails.""" + self.flakes(''' + from __future__ import * + ''', m.FutureFeatureNotDefined) + + +class TestSpecialAll(TestCase): + """ + Tests for suppression of unused import warnings by C{__all__}. + """ + def test_ignoredInFunction(self): + """ + An C{__all__} definition does not suppress unused import warnings in a + function scope. + """ + self.flakes(''' + def foo(): + import bar + __all__ = ["bar"] + ''', m.UnusedImport, m.UnusedVariable) + + def test_ignoredInClass(self): + """ + An C{__all__} definition in a class does not suppress unused import warnings. + """ + self.flakes(''' + import bar + class foo: + __all__ = ["bar"] + ''', m.UnusedImport) + + def test_warningSuppressed(self): + """ + If a name is imported and unused but is named in C{__all__}, no warning + is reported. + """ + self.flakes(''' + import foo + __all__ = ["foo"] + ''') + self.flakes(''' + import foo + __all__ = ("foo",) + ''') + + def test_augmentedAssignment(self): + """ + The C{__all__} variable is defined incrementally. + """ + self.flakes(''' + import a + import c + __all__ = ['a'] + __all__ += ['b'] + if 1 < 3: + __all__ += ['c', 'd'] + ''', m.UndefinedExport, m.UndefinedExport) + + def test_list_concatenation_assignment(self): + """ + The C{__all__} variable is defined through list concatenation. + """ + self.flakes(''' + import sys + __all__ = ['a'] + ['b'] + ['c'] + ''', m.UndefinedExport, m.UndefinedExport, m.UndefinedExport, m.UnusedImport) + + def test_tuple_concatenation_assignment(self): + """ + The C{__all__} variable is defined through tuple concatenation. + """ + self.flakes(''' + import sys + __all__ = ('a',) + ('b',) + ('c',) + ''', m.UndefinedExport, m.UndefinedExport, m.UndefinedExport, m.UnusedImport) + + def test_all_with_attributes(self): + self.flakes(''' + from foo import bar + __all__ = [bar.__name__] + ''') + + def test_all_with_names(self): + # not actually valid, but shouldn't produce a crash + self.flakes(''' + from foo import bar + __all__ = [bar] + ''') + + def test_all_with_attributes_added(self): + self.flakes(''' + from foo import bar + from bar import baz + __all__ = [bar.__name__] + [baz.__name__] + ''') + + def test_all_mixed_attributes_and_strings(self): + self.flakes(''' + from foo import bar + from foo import baz + __all__ = ['bar', baz.__name__] + ''') + + def test_unboundExported(self): + """ + If C{__all__} includes a name which is not bound, a warning is emitted. + """ + self.flakes(''' + __all__ = ["foo"] + ''', m.UndefinedExport) + + # Skip this in __init__.py though, since the rules there are a little + # different. + for filename in ["foo/__init__.py", "__init__.py"]: + self.flakes(''' + __all__ = ["foo"] + ''', filename=filename) + + def test_importStarExported(self): + """ + Report undefined if import * is used + """ + self.flakes(''' + from math import * + __all__ = ['sin', 'cos'] + csc(1) + ''', m.ImportStarUsed, m.ImportStarUsage, m.ImportStarUsage, m.ImportStarUsage) + + def test_importStarNotExported(self): + """Report unused import when not needed to satisfy __all__.""" + self.flakes(''' + from foolib import * + a = 1 + __all__ = ['a'] + ''', m.ImportStarUsed, m.UnusedImport) + + def test_usedInGenExp(self): + """ + Using a global in a generator expression results in no warnings. + """ + self.flakes('import fu; (fu for _ in range(1))') + self.flakes('import fu; (1 for _ in range(1) if fu)') + + def test_redefinedByGenExp(self): + """ + Re-using a global name as the loop variable for a generator + expression results in a redefinition warning. + """ + self.flakes('import fu; (1 for fu in range(1))', + m.RedefinedWhileUnused, m.UnusedImport) + + def test_usedAsDecorator(self): + """ + Using a global name in a decorator statement results in no warnings, + but using an undefined name in a decorator statement results in an + undefined name warning. + """ + self.flakes(''' + from interior import decorate + @decorate + def f(): + return "hello" + ''') + + self.flakes(''' + from interior import decorate + @decorate('value') + def f(): + return "hello" + ''') + + self.flakes(''' + @decorate + def f(): + return "hello" + ''', m.UndefinedName) + + def test_usedAsClassDecorator(self): + """ + Using an imported name as a class decorator results in no warnings, + but using an undefined name as a class decorator results in an + undefined name warning. + """ + self.flakes(''' + from interior import decorate + @decorate + class foo: + pass + ''') + + self.flakes(''' + from interior import decorate + @decorate("foo") + class bar: + pass + ''') + + self.flakes(''' + @decorate + class foo: + pass + ''', m.UndefinedName) diff --git a/anaconda_lib/linting/pyflakes/test/test_is_literal.py b/anaconda_lib/linting/pyflakes/test/test_is_literal.py new file mode 100644 index 00000000..fbbb2053 --- /dev/null +++ b/anaconda_lib/linting/pyflakes/test/test_is_literal.py @@ -0,0 +1,222 @@ +from pyflakes.messages import IsLiteral +from pyflakes.test.harness import TestCase + + +class Test(TestCase): + def test_is_str(self): + self.flakes(""" + x = 'foo' + if x is 'foo': + pass + """, IsLiteral) + + def test_is_bytes(self): + self.flakes(""" + x = b'foo' + if x is b'foo': + pass + """, IsLiteral) + + def test_is_unicode(self): + self.flakes(""" + x = u'foo' + if x is u'foo': + pass + """, IsLiteral) + + def test_is_int(self): + self.flakes(""" + x = 10 + if x is 10: + pass + """, IsLiteral) + + def test_is_true(self): + self.flakes(""" + x = True + if x is True: + pass + """) + + def test_is_false(self): + self.flakes(""" + x = False + if x is False: + pass + """) + + def test_is_not_str(self): + self.flakes(""" + x = 'foo' + if x is not 'foo': + pass + """, IsLiteral) + + def test_is_not_bytes(self): + self.flakes(""" + x = b'foo' + if x is not b'foo': + pass + """, IsLiteral) + + def test_is_not_unicode(self): + self.flakes(""" + x = u'foo' + if x is not u'foo': + pass + """, IsLiteral) + + def test_is_not_int(self): + self.flakes(""" + x = 10 + if x is not 10: + pass + """, IsLiteral) + + def test_is_not_true(self): + self.flakes(""" + x = True + if x is not True: + pass + """) + + def test_is_not_false(self): + self.flakes(""" + x = False + if x is not False: + pass + """) + + def test_left_is_str(self): + self.flakes(""" + x = 'foo' + if 'foo' is x: + pass + """, IsLiteral) + + def test_left_is_bytes(self): + self.flakes(""" + x = b'foo' + if b'foo' is x: + pass + """, IsLiteral) + + def test_left_is_unicode(self): + self.flakes(""" + x = u'foo' + if u'foo' is x: + pass + """, IsLiteral) + + def test_left_is_int(self): + self.flakes(""" + x = 10 + if 10 is x: + pass + """, IsLiteral) + + def test_left_is_true(self): + self.flakes(""" + x = True + if True is x: + pass + """) + + def test_left_is_false(self): + self.flakes(""" + x = False + if False is x: + pass + """) + + def test_left_is_not_str(self): + self.flakes(""" + x = 'foo' + if 'foo' is not x: + pass + """, IsLiteral) + + def test_left_is_not_bytes(self): + self.flakes(""" + x = b'foo' + if b'foo' is not x: + pass + """, IsLiteral) + + def test_left_is_not_unicode(self): + self.flakes(""" + x = u'foo' + if u'foo' is not x: + pass + """, IsLiteral) + + def test_left_is_not_int(self): + self.flakes(""" + x = 10 + if 10 is not x: + pass + """, IsLiteral) + + def test_left_is_not_true(self): + self.flakes(""" + x = True + if True is not x: + pass + """) + + def test_left_is_not_false(self): + self.flakes(""" + x = False + if False is not x: + pass + """) + + def test_chained_operators_is_true(self): + self.flakes(""" + x = 5 + if x is True < 4: + pass + """) + + def test_chained_operators_is_str(self): + self.flakes(""" + x = 5 + if x is 'foo' < 4: + pass + """, IsLiteral) + + def test_chained_operators_is_true_end(self): + self.flakes(""" + x = 5 + if 4 < x is True: + pass + """) + + def test_chained_operators_is_str_end(self): + self.flakes(""" + x = 5 + if 4 < x is 'foo': + pass + """, IsLiteral) + + def test_is_tuple_constant(self): + self.flakes('''\ + x = 5 + if x is (): + pass + ''', IsLiteral) + + def test_is_tuple_constant_containing_constants(self): + self.flakes('''\ + x = 5 + if x is (1, '2', True, (1.5, ())): + pass + ''', IsLiteral) + + def test_is_tuple_containing_variables_ok(self): + # a bit nonsensical, but does not trigger a SyntaxWarning + self.flakes('''\ + x = 5 + if x is (x,): + pass + ''') diff --git a/anaconda_lib/linting/pyflakes/test/test_match.py b/anaconda_lib/linting/pyflakes/test/test_match.py new file mode 100644 index 00000000..89826e31 --- /dev/null +++ b/anaconda_lib/linting/pyflakes/test/test_match.py @@ -0,0 +1,83 @@ +from sys import version_info + +from pyflakes.test.harness import TestCase, skipIf + + +@skipIf(version_info < (3, 10), "Python >= 3.10 only") +class TestMatch(TestCase): + def test_match_bindings(self): + self.flakes(''' + def f(): + x = 1 + match x: + case 1 as y: + print(f'matched as {y}') + ''') + self.flakes(''' + def f(): + x = [1, 2, 3] + match x: + case [1, y, 3]: + print(f'matched {y}') + ''') + self.flakes(''' + def f(): + x = {'foo': 1} + match x: + case {'foo': y}: + print(f'matched {y}') + ''') + + def test_match_pattern_matched_class(self): + self.flakes(''' + from a import B + + match 1: + case B(x=1) as y: + print(f'matched {y}') + ''') + self.flakes(''' + from a import B + + match 1: + case B(a, x=z) as y: + print(f'matched {y} {a} {z}') + ''') + + def test_match_placeholder(self): + self.flakes(''' + def f(): + match 1: + case _: + print('catchall!') + ''') + + def test_match_singleton(self): + self.flakes(''' + match 1: + case True: + print('true') + ''') + + def test_match_or_pattern(self): + self.flakes(''' + match 1: + case 1 | 2: + print('one or two') + ''') + + def test_match_star(self): + self.flakes(''' + x = [1, 2, 3] + match x: + case [1, *y]: + print(f'captured: {y}') + ''') + + def test_match_double_star(self): + self.flakes(''' + x = {'foo': 'bar', 'baz': 'womp'} + match x: + case {'foo': k1, **rest}: + print(f'{k1=} {rest=}') + ''') diff --git a/anaconda_lib/linting/pyflakes/test/test_other.py b/anaconda_lib/linting/pyflakes/test/test_other.py new file mode 100644 index 00000000..68813bd4 --- /dev/null +++ b/anaconda_lib/linting/pyflakes/test/test_other.py @@ -0,0 +1,2126 @@ +""" +Tests for various Pyflakes behavior. +""" + +from sys import version_info + +from pyflakes import messages as m +from pyflakes.test.harness import TestCase, skip, skipIf + + +class Test(TestCase): + + def test_duplicateArgs(self): + self.flakes('def fu(bar, bar): pass', m.DuplicateArgument) + + def test_localReferencedBeforeAssignment(self): + self.flakes(''' + a = 1 + def f(): + a; a=1 + f() + ''', m.UndefinedLocal, m.UnusedVariable) + + @skipIf(version_info >= (3,), + 'in Python 3 list comprehensions execute in a separate scope') + def test_redefinedInListComp(self): + """ + Test that shadowing a variable in a list comprehension raises + a warning. + """ + self.flakes(''' + a = 1 + [1 for a, b in [(1, 2)]] + ''', m.RedefinedInListComp) + self.flakes(''' + class A: + a = 1 + [1 for a, b in [(1, 2)]] + ''', m.RedefinedInListComp) + self.flakes(''' + def f(): + a = 1 + [1 for a, b in [(1, 2)]] + ''', m.RedefinedInListComp) + self.flakes(''' + [1 for a, b in [(1, 2)]] + [1 for a, b in [(1, 2)]] + ''') + self.flakes(''' + for a, b in [(1, 2)]: + pass + [1 for a, b in [(1, 2)]] + ''') + + def test_redefinedInGenerator(self): + """ + Test that reusing a variable in a generator does not raise + a warning. + """ + self.flakes(''' + a = 1 + (1 for a, b in [(1, 2)]) + ''') + self.flakes(''' + class A: + a = 1 + list(1 for a, b in [(1, 2)]) + ''') + self.flakes(''' + def f(): + a = 1 + (1 for a, b in [(1, 2)]) + ''', m.UnusedVariable) + self.flakes(''' + (1 for a, b in [(1, 2)]) + (1 for a, b in [(1, 2)]) + ''') + self.flakes(''' + for a, b in [(1, 2)]: + pass + (1 for a, b in [(1, 2)]) + ''') + + def test_redefinedInSetComprehension(self): + """ + Test that reusing a variable in a set comprehension does not raise + a warning. + """ + self.flakes(''' + a = 1 + {1 for a, b in [(1, 2)]} + ''') + self.flakes(''' + class A: + a = 1 + {1 for a, b in [(1, 2)]} + ''') + self.flakes(''' + def f(): + a = 1 + {1 for a, b in [(1, 2)]} + ''', m.UnusedVariable) + self.flakes(''' + {1 for a, b in [(1, 2)]} + {1 for a, b in [(1, 2)]} + ''') + self.flakes(''' + for a, b in [(1, 2)]: + pass + {1 for a, b in [(1, 2)]} + ''') + + def test_redefinedInDictComprehension(self): + """ + Test that reusing a variable in a dict comprehension does not raise + a warning. + """ + self.flakes(''' + a = 1 + {1: 42 for a, b in [(1, 2)]} + ''') + self.flakes(''' + class A: + a = 1 + {1: 42 for a, b in [(1, 2)]} + ''') + self.flakes(''' + def f(): + a = 1 + {1: 42 for a, b in [(1, 2)]} + ''', m.UnusedVariable) + self.flakes(''' + {1: 42 for a, b in [(1, 2)]} + {1: 42 for a, b in [(1, 2)]} + ''') + self.flakes(''' + for a, b in [(1, 2)]: + pass + {1: 42 for a, b in [(1, 2)]} + ''') + + def test_redefinedFunction(self): + """ + Test that shadowing a function definition with another one raises a + warning. + """ + self.flakes(''' + def a(): pass + def a(): pass + ''', m.RedefinedWhileUnused) + + def test_redefinedUnderscoreFunction(self): + """ + Test that shadowing a function definition named with underscore doesn't + raise anything. + """ + self.flakes(''' + def _(): pass + def _(): pass + ''') + + def test_redefinedUnderscoreImportation(self): + """ + Test that shadowing an underscore importation raises a warning. + """ + self.flakes(''' + from .i18n import _ + def _(): pass + ''', m.RedefinedWhileUnused) + + def test_redefinedClassFunction(self): + """ + Test that shadowing a function definition in a class suite with another + one raises a warning. + """ + self.flakes(''' + class A: + def a(): pass + def a(): pass + ''', m.RedefinedWhileUnused) + + def test_redefinedIfElseFunction(self): + """ + Test that shadowing a function definition twice in an if + and else block does not raise a warning. + """ + self.flakes(''' + if True: + def a(): pass + else: + def a(): pass + ''') + + def test_redefinedIfFunction(self): + """ + Test that shadowing a function definition within an if block + raises a warning. + """ + self.flakes(''' + if True: + def a(): pass + def a(): pass + ''', m.RedefinedWhileUnused) + + def test_redefinedTryExceptFunction(self): + """ + Test that shadowing a function definition twice in try + and except block does not raise a warning. + """ + self.flakes(''' + try: + def a(): pass + except: + def a(): pass + ''') + + def test_redefinedTryFunction(self): + """ + Test that shadowing a function definition within a try block + raises a warning. + """ + self.flakes(''' + try: + def a(): pass + def a(): pass + except: + pass + ''', m.RedefinedWhileUnused) + + def test_redefinedIfElseInListComp(self): + """ + Test that shadowing a variable in a list comprehension in + an if and else block does not raise a warning. + """ + self.flakes(''' + if False: + a = 1 + else: + [a for a in '12'] + ''') + + @skipIf(version_info >= (3,), + 'in Python 3 list comprehensions execute in a separate scope') + def test_redefinedElseInListComp(self): + """ + Test that shadowing a variable in a list comprehension in + an else (or if) block raises a warning. + """ + self.flakes(''' + if False: + pass + else: + a = 1 + [a for a in '12'] + ''', m.RedefinedInListComp) + + def test_functionDecorator(self): + """ + Test that shadowing a function definition with a decorated version of + that function does not raise a warning. + """ + self.flakes(''' + from somewhere import somedecorator + + def a(): pass + a = somedecorator(a) + ''') + + def test_classFunctionDecorator(self): + """ + Test that shadowing a function definition in a class suite with a + decorated version of that function does not raise a warning. + """ + self.flakes(''' + class A: + def a(): pass + a = classmethod(a) + ''') + + def test_modernProperty(self): + self.flakes(""" + class A: + @property + def t(self): + pass + @t.setter + def t(self, value): + pass + @t.deleter + def t(self): + pass + """) + + def test_unaryPlus(self): + """Don't die on unary +.""" + self.flakes('+1') + + def test_undefinedBaseClass(self): + """ + If a name in the base list of a class definition is undefined, a + warning is emitted. + """ + self.flakes(''' + class foo(foo): + pass + ''', m.UndefinedName) + + def test_classNameUndefinedInClassBody(self): + """ + If a class name is used in the body of that class's definition and + the name is not already defined, a warning is emitted. + """ + self.flakes(''' + class foo: + foo + ''', m.UndefinedName) + + def test_classNameDefinedPreviously(self): + """ + If a class name is used in the body of that class's definition and + the name was previously defined in some other way, no warning is + emitted. + """ + self.flakes(''' + foo = None + class foo: + foo + ''') + + def test_classRedefinition(self): + """ + If a class is defined twice in the same module, a warning is emitted. + """ + self.flakes(''' + class Foo: + pass + class Foo: + pass + ''', m.RedefinedWhileUnused) + + def test_functionRedefinedAsClass(self): + """ + If a function is redefined as a class, a warning is emitted. + """ + self.flakes(''' + def Foo(): + pass + class Foo: + pass + ''', m.RedefinedWhileUnused) + + def test_classRedefinedAsFunction(self): + """ + If a class is redefined as a function, a warning is emitted. + """ + self.flakes(''' + class Foo: + pass + def Foo(): + pass + ''', m.RedefinedWhileUnused) + + def test_classWithReturn(self): + """ + If a return is used inside a class, a warning is emitted. + """ + self.flakes(''' + class Foo(object): + return + ''', m.ReturnOutsideFunction) + + def test_moduleWithReturn(self): + """ + If a return is used at the module level, a warning is emitted. + """ + self.flakes(''' + return + ''', m.ReturnOutsideFunction) + + def test_classWithYield(self): + """ + If a yield is used inside a class, a warning is emitted. + """ + self.flakes(''' + class Foo(object): + yield + ''', m.YieldOutsideFunction) + + def test_moduleWithYield(self): + """ + If a yield is used at the module level, a warning is emitted. + """ + self.flakes(''' + yield + ''', m.YieldOutsideFunction) + + @skipIf(version_info < (3, 3), "Python >= 3.3 only") + def test_classWithYieldFrom(self): + """ + If a yield from is used inside a class, a warning is emitted. + """ + self.flakes(''' + class Foo(object): + yield from range(10) + ''', m.YieldOutsideFunction) + + @skipIf(version_info < (3, 3), "Python >= 3.3 only") + def test_moduleWithYieldFrom(self): + """ + If a yield from is used at the module level, a warning is emitted. + """ + self.flakes(''' + yield from range(10) + ''', m.YieldOutsideFunction) + + def test_continueOutsideLoop(self): + self.flakes(''' + continue + ''', m.ContinueOutsideLoop) + + self.flakes(''' + def f(): + continue + ''', m.ContinueOutsideLoop) + + self.flakes(''' + while True: + pass + else: + continue + ''', m.ContinueOutsideLoop) + + self.flakes(''' + while True: + pass + else: + if 1: + if 2: + continue + ''', m.ContinueOutsideLoop) + + self.flakes(''' + while True: + def f(): + continue + ''', m.ContinueOutsideLoop) + + self.flakes(''' + while True: + class A: + continue + ''', m.ContinueOutsideLoop) + + def test_continueInsideLoop(self): + self.flakes(''' + while True: + continue + ''') + + self.flakes(''' + for i in range(10): + continue + ''') + + self.flakes(''' + while True: + if 1: + continue + ''') + + self.flakes(''' + for i in range(10): + if 1: + continue + ''') + + self.flakes(''' + while True: + while True: + pass + else: + continue + else: + pass + ''') + + self.flakes(''' + while True: + try: + pass + finally: + while True: + continue + ''') + + @skipIf(version_info > (3, 8), "Python <= 3.8 only") + def test_continueInFinally(self): + # 'continue' inside 'finally' is a special syntax error + # that is removed in 3.8 + self.flakes(''' + while True: + try: + pass + finally: + continue + ''', m.ContinueInFinally) + + self.flakes(''' + while True: + try: + pass + finally: + if 1: + if 2: + continue + ''', m.ContinueInFinally) + + # Even when not in a loop, this is the error Python gives + self.flakes(''' + try: + pass + finally: + continue + ''', m.ContinueInFinally) + + def test_breakOutsideLoop(self): + self.flakes(''' + break + ''', m.BreakOutsideLoop) + + self.flakes(''' + def f(): + break + ''', m.BreakOutsideLoop) + + self.flakes(''' + while True: + pass + else: + break + ''', m.BreakOutsideLoop) + + self.flakes(''' + while True: + pass + else: + if 1: + if 2: + break + ''', m.BreakOutsideLoop) + + self.flakes(''' + while True: + def f(): + break + ''', m.BreakOutsideLoop) + + self.flakes(''' + while True: + class A: + break + ''', m.BreakOutsideLoop) + + self.flakes(''' + try: + pass + finally: + break + ''', m.BreakOutsideLoop) + + def test_breakInsideLoop(self): + self.flakes(''' + while True: + break + ''') + + self.flakes(''' + for i in range(10): + break + ''') + + self.flakes(''' + while True: + if 1: + break + ''') + + self.flakes(''' + for i in range(10): + if 1: + break + ''') + + self.flakes(''' + while True: + while True: + pass + else: + break + else: + pass + ''') + + self.flakes(''' + while True: + try: + pass + finally: + while True: + break + ''') + + self.flakes(''' + while True: + try: + pass + finally: + break + ''') + + self.flakes(''' + while True: + try: + pass + finally: + if 1: + if 2: + break + ''') + + def test_defaultExceptLast(self): + """ + A default except block should be last. + + YES: + + try: + ... + except Exception: + ... + except: + ... + + NO: + + try: + ... + except: + ... + except Exception: + ... + """ + self.flakes(''' + try: + pass + except ValueError: + pass + ''') + + self.flakes(''' + try: + pass + except ValueError: + pass + except: + pass + ''') + + self.flakes(''' + try: + pass + except: + pass + ''') + + self.flakes(''' + try: + pass + except ValueError: + pass + else: + pass + ''') + + self.flakes(''' + try: + pass + except: + pass + else: + pass + ''') + + self.flakes(''' + try: + pass + except ValueError: + pass + except: + pass + else: + pass + ''') + + def test_defaultExceptNotLast(self): + self.flakes(''' + try: + pass + except: + pass + except ValueError: + pass + ''', m.DefaultExceptNotLast) + + self.flakes(''' + try: + pass + except: + pass + except: + pass + ''', m.DefaultExceptNotLast) + + self.flakes(''' + try: + pass + except: + pass + except ValueError: + pass + except: + pass + ''', m.DefaultExceptNotLast) + + self.flakes(''' + try: + pass + except: + pass + except ValueError: + pass + except: + pass + except ValueError: + pass + ''', m.DefaultExceptNotLast, m.DefaultExceptNotLast) + + self.flakes(''' + try: + pass + except: + pass + except ValueError: + pass + else: + pass + ''', m.DefaultExceptNotLast) + + self.flakes(''' + try: + pass + except: + pass + except: + pass + else: + pass + ''', m.DefaultExceptNotLast) + + self.flakes(''' + try: + pass + except: + pass + except ValueError: + pass + except: + pass + else: + pass + ''', m.DefaultExceptNotLast) + + self.flakes(''' + try: + pass + except: + pass + except ValueError: + pass + except: + pass + except ValueError: + pass + else: + pass + ''', m.DefaultExceptNotLast, m.DefaultExceptNotLast) + + self.flakes(''' + try: + pass + except: + pass + except ValueError: + pass + finally: + pass + ''', m.DefaultExceptNotLast) + + self.flakes(''' + try: + pass + except: + pass + except: + pass + finally: + pass + ''', m.DefaultExceptNotLast) + + self.flakes(''' + try: + pass + except: + pass + except ValueError: + pass + except: + pass + finally: + pass + ''', m.DefaultExceptNotLast) + + self.flakes(''' + try: + pass + except: + pass + except ValueError: + pass + except: + pass + except ValueError: + pass + finally: + pass + ''', m.DefaultExceptNotLast, m.DefaultExceptNotLast) + + self.flakes(''' + try: + pass + except: + pass + except ValueError: + pass + else: + pass + finally: + pass + ''', m.DefaultExceptNotLast) + + self.flakes(''' + try: + pass + except: + pass + except: + pass + else: + pass + finally: + pass + ''', m.DefaultExceptNotLast) + + self.flakes(''' + try: + pass + except: + pass + except ValueError: + pass + except: + pass + else: + pass + finally: + pass + ''', m.DefaultExceptNotLast) + + self.flakes(''' + try: + pass + except: + pass + except ValueError: + pass + except: + pass + except ValueError: + pass + else: + pass + finally: + pass + ''', m.DefaultExceptNotLast, m.DefaultExceptNotLast) + + @skipIf(version_info < (3,), "Python 3 only") + def test_starredAssignmentNoError(self): + """ + Python 3 extended iterable unpacking + """ + self.flakes(''' + a, *b = range(10) + ''') + + self.flakes(''' + *a, b = range(10) + ''') + + self.flakes(''' + a, *b, c = range(10) + ''') + + self.flakes(''' + (a, *b) = range(10) + ''') + + self.flakes(''' + (*a, b) = range(10) + ''') + + self.flakes(''' + (a, *b, c) = range(10) + ''') + + self.flakes(''' + [a, *b] = range(10) + ''') + + self.flakes(''' + [*a, b] = range(10) + ''') + + self.flakes(''' + [a, *b, c] = range(10) + ''') + + # Taken from test_unpack_ex.py in the cPython source + s = ", ".join("a%d" % i for i in range(1 << 8 - 1)) + \ + ", *rest = range(1<<8)" + self.flakes(s) + + s = "(" + ", ".join("a%d" % i for i in range(1 << 8 - 1)) + \ + ", *rest) = range(1<<8)" + self.flakes(s) + + s = "[" + ", ".join("a%d" % i for i in range(1 << 8 - 1)) + \ + ", *rest] = range(1<<8)" + self.flakes(s) + + @skipIf(version_info < (3, ), "Python 3 only") + def test_starredAssignmentErrors(self): + """ + SyntaxErrors (not encoded in the ast) surrounding Python 3 extended + iterable unpacking + """ + # Taken from test_unpack_ex.py in the cPython source + s = ", ".join("a%d" % i for i in range(1 << 8)) + \ + ", *rest = range(1<<8 + 1)" + self.flakes(s, m.TooManyExpressionsInStarredAssignment) + + s = "(" + ", ".join("a%d" % i for i in range(1 << 8)) + \ + ", *rest) = range(1<<8 + 1)" + self.flakes(s, m.TooManyExpressionsInStarredAssignment) + + s = "[" + ", ".join("a%d" % i for i in range(1 << 8)) + \ + ", *rest] = range(1<<8 + 1)" + self.flakes(s, m.TooManyExpressionsInStarredAssignment) + + s = ", ".join("a%d" % i for i in range(1 << 8 + 1)) + \ + ", *rest = range(1<<8 + 2)" + self.flakes(s, m.TooManyExpressionsInStarredAssignment) + + s = "(" + ", ".join("a%d" % i for i in range(1 << 8 + 1)) + \ + ", *rest) = range(1<<8 + 2)" + self.flakes(s, m.TooManyExpressionsInStarredAssignment) + + s = "[" + ", ".join("a%d" % i for i in range(1 << 8 + 1)) + \ + ", *rest] = range(1<<8 + 2)" + self.flakes(s, m.TooManyExpressionsInStarredAssignment) + + # No way we can actually test this! + # s = "*rest, " + ", ".join("a%d" % i for i in range(1<<24)) + \ + # ", *rest = range(1<<24 + 1)" + # self.flakes(s, m.TooManyExpressionsInStarredAssignment) + + self.flakes(''' + a, *b, *c = range(10) + ''', m.TwoStarredExpressions) + + self.flakes(''' + a, *b, c, *d = range(10) + ''', m.TwoStarredExpressions) + + self.flakes(''' + *a, *b, *c = range(10) + ''', m.TwoStarredExpressions) + + self.flakes(''' + (a, *b, *c) = range(10) + ''', m.TwoStarredExpressions) + + self.flakes(''' + (a, *b, c, *d) = range(10) + ''', m.TwoStarredExpressions) + + self.flakes(''' + (*a, *b, *c) = range(10) + ''', m.TwoStarredExpressions) + + self.flakes(''' + [a, *b, *c] = range(10) + ''', m.TwoStarredExpressions) + + self.flakes(''' + [a, *b, c, *d] = range(10) + ''', m.TwoStarredExpressions) + + self.flakes(''' + [*a, *b, *c] = range(10) + ''', m.TwoStarredExpressions) + + @skip("todo: Too hard to make this warn but other cases stay silent") + def test_doubleAssignment(self): + """ + If a variable is re-assigned to without being used, no warning is + emitted. + """ + self.flakes(''' + x = 10 + x = 20 + ''', m.RedefinedWhileUnused) + + def test_doubleAssignmentConditionally(self): + """ + If a variable is re-assigned within a conditional, no warning is + emitted. + """ + self.flakes(''' + x = 10 + if True: + x = 20 + ''') + + def test_doubleAssignmentWithUse(self): + """ + If a variable is re-assigned to after being used, no warning is + emitted. + """ + self.flakes(''' + x = 10 + y = x * 2 + x = 20 + ''') + + def test_comparison(self): + """ + If a defined name is used on either side of any of the six comparison + operators, no warning is emitted. + """ + self.flakes(''' + x = 10 + y = 20 + x < y + x <= y + x == y + x != y + x >= y + x > y + ''') + + def test_identity(self): + """ + If a defined name is used on either side of an identity test, no + warning is emitted. + """ + self.flakes(''' + x = 10 + y = 20 + x is y + x is not y + ''') + + def test_containment(self): + """ + If a defined name is used on either side of a containment test, no + warning is emitted. + """ + self.flakes(''' + x = 10 + y = 20 + x in y + x not in y + ''') + + def test_loopControl(self): + """ + break and continue statements are supported. + """ + self.flakes(''' + for x in [1, 2]: + break + ''') + self.flakes(''' + for x in [1, 2]: + continue + ''') + + def test_ellipsis(self): + """ + Ellipsis in a slice is supported. + """ + self.flakes(''' + [1, 2][...] + ''') + + def test_extendedSlice(self): + """ + Extended slices are supported. + """ + self.flakes(''' + x = 3 + [1, 2][x,:] + ''') + + def test_varAugmentedAssignment(self): + """ + Augmented assignment of a variable is supported. + We don't care about var refs. + """ + self.flakes(''' + foo = 0 + foo += 1 + ''') + + def test_attrAugmentedAssignment(self): + """ + Augmented assignment of attributes is supported. + We don't care about attr refs. + """ + self.flakes(''' + foo = None + foo.bar += foo.baz + ''') + + def test_globalDeclaredInDifferentScope(self): + """ + A 'global' can be declared in one scope and reused in another. + """ + self.flakes(''' + def f(): global foo + def g(): foo = 'anything'; foo.is_used() + ''') + + def test_function_arguments(self): + """ + Test to traverse ARG and ARGUMENT handler + """ + self.flakes(''' + def foo(a, b): + pass + ''') + + self.flakes(''' + def foo(a, b, c=0): + pass + ''') + + self.flakes(''' + def foo(a, b, c=0, *args): + pass + ''') + + self.flakes(''' + def foo(a, b, c=0, *args, **kwargs): + pass + ''') + + @skipIf(version_info < (3, 3), "Python >= 3.3 only") + def test_function_arguments_python3(self): + self.flakes(''' + def foo(a, b, c=0, *args, d=0, **kwargs): + pass + ''') + + +class TestUnusedAssignment(TestCase): + """ + Tests for warning about unused assignments. + """ + + def test_unusedVariable(self): + """ + Warn when a variable in a function is assigned a value that's never + used. + """ + self.flakes(''' + def a(): + b = 1 + ''', m.UnusedVariable) + + def test_unusedUnderscoreVariable(self): + """ + Don't warn when the magic "_" (underscore) variable is unused. + See issue #202. + """ + self.flakes(''' + def a(unused_param): + _ = unused_param + ''') + + def test_unusedVariableAsLocals(self): + """ + Using locals() it is perfectly valid to have unused variables + """ + self.flakes(''' + def a(): + b = 1 + return locals() + ''') + + def test_unusedVariableNoLocals(self): + """ + Using locals() in wrong scope should not matter + """ + self.flakes(''' + def a(): + locals() + def a(): + b = 1 + return + ''', m.UnusedVariable) + + @skip("todo: Difficult because it doesn't apply in the context of a loop") + def test_unusedReassignedVariable(self): + """ + Shadowing a used variable can still raise an UnusedVariable warning. + """ + self.flakes(''' + def a(): + b = 1 + b.foo() + b = 2 + ''', m.UnusedVariable) + + def test_variableUsedInLoop(self): + """ + Shadowing a used variable cannot raise an UnusedVariable warning in the + context of a loop. + """ + self.flakes(''' + def a(): + b = True + while b: + b = False + ''') + + def test_assignToGlobal(self): + """ + Assigning to a global and then not using that global is perfectly + acceptable. Do not mistake it for an unused local variable. + """ + self.flakes(''' + b = 0 + def a(): + global b + b = 1 + ''') + + @skipIf(version_info < (3,), 'new in Python 3') + def test_assignToNonlocal(self): + """ + Assigning to a nonlocal and then not using that binding is perfectly + acceptable. Do not mistake it for an unused local variable. + """ + self.flakes(''' + b = b'0' + def a(): + nonlocal b + b = b'1' + ''') + + def test_assignToMember(self): + """ + Assigning to a member of another object and then not using that member + variable is perfectly acceptable. Do not mistake it for an unused + local variable. + """ + # XXX: Adding this test didn't generate a failure. Maybe not + # necessary? + self.flakes(''' + class b: + pass + def a(): + b.foo = 1 + ''') + + def test_assignInForLoop(self): + """ + Don't warn when a variable in a for loop is assigned to but not used. + """ + self.flakes(''' + def f(): + for i in range(10): + pass + ''') + + def test_assignInListComprehension(self): + """ + Don't warn when a variable in a list comprehension is + assigned to but not used. + """ + self.flakes(''' + def f(): + [None for i in range(10)] + ''') + + def test_generatorExpression(self): + """ + Don't warn when a variable in a generator expression is + assigned to but not used. + """ + self.flakes(''' + def f(): + (None for i in range(10)) + ''') + + def test_assignmentInsideLoop(self): + """ + Don't warn when a variable assignment occurs lexically after its use. + """ + self.flakes(''' + def f(): + x = None + for i in range(10): + if i > 2: + return x + x = i * 2 + ''') + + def test_tupleUnpacking(self): + """ + Don't warn when a variable included in tuple unpacking is unused. It's + very common for variables in a tuple unpacking assignment to be unused + in good Python code, so warning will only create false positives. + """ + self.flakes(''' + def f(tup): + (x, y) = tup + ''') + self.flakes(''' + def f(): + (x, y) = 1, 2 + ''', m.UnusedVariable, m.UnusedVariable) + self.flakes(''' + def f(): + (x, y) = coords = 1, 2 + if x > 1: + print(coords) + ''') + self.flakes(''' + def f(): + (x, y) = coords = 1, 2 + ''', m.UnusedVariable) + self.flakes(''' + def f(): + coords = (x, y) = 1, 2 + ''', m.UnusedVariable) + + def test_listUnpacking(self): + """ + Don't warn when a variable included in list unpacking is unused. + """ + self.flakes(''' + def f(tup): + [x, y] = tup + ''') + self.flakes(''' + def f(): + [x, y] = [1, 2] + ''', m.UnusedVariable, m.UnusedVariable) + + def test_closedOver(self): + """ + Don't warn when the assignment is used in an inner function. + """ + self.flakes(''' + def barMaker(): + foo = 5 + def bar(): + return foo + return bar + ''') + + def test_doubleClosedOver(self): + """ + Don't warn when the assignment is used in an inner function, even if + that inner function itself is in an inner function. + """ + self.flakes(''' + def barMaker(): + foo = 5 + def bar(): + def baz(): + return foo + return bar + ''') + + def test_tracebackhideSpecialVariable(self): + """ + Do not warn about unused local variable __tracebackhide__, which is + a special variable for py.test. + """ + self.flakes(""" + def helper(): + __tracebackhide__ = True + """) + + def test_ifexp(self): + """ + Test C{foo if bar else baz} statements. + """ + self.flakes("a = 'moo' if True else 'oink'") + self.flakes("a = foo if True else 'oink'", m.UndefinedName) + self.flakes("a = 'moo' if True else bar", m.UndefinedName) + + def test_if_tuple(self): + """ + Test C{if (foo,)} conditions. + """ + self.flakes("""if (): pass""") + self.flakes(""" + if ( + True + ): + pass + """) + self.flakes(""" + if ( + True, + ): + pass + """, m.IfTuple) + self.flakes(""" + x = 1 if ( + True, + ) else 2 + """, m.IfTuple) + + def test_withStatementNoNames(self): + """ + No warnings are emitted for using inside or after a nameless C{with} + statement a name defined beforehand. + """ + self.flakes(''' + bar = None + with open("foo"): + bar + bar + ''') + + def test_withStatementSingleName(self): + """ + No warnings are emitted for using a name defined by a C{with} statement + within the suite or afterwards. + """ + self.flakes(''' + with open('foo') as bar: + bar + bar + ''') + + def test_withStatementAttributeName(self): + """ + No warnings are emitted for using an attribute as the target of a + C{with} statement. + """ + self.flakes(''' + import foo + with open('foo') as foo.bar: + pass + ''') + + def test_withStatementSubscript(self): + """ + No warnings are emitted for using a subscript as the target of a + C{with} statement. + """ + self.flakes(''' + import foo + with open('foo') as foo[0]: + pass + ''') + + def test_withStatementSubscriptUndefined(self): + """ + An undefined name warning is emitted if the subscript used as the + target of a C{with} statement is not defined. + """ + self.flakes(''' + import foo + with open('foo') as foo[bar]: + pass + ''', m.UndefinedName) + + def test_withStatementTupleNames(self): + """ + No warnings are emitted for using any of the tuple of names defined by + a C{with} statement within the suite or afterwards. + """ + self.flakes(''' + with open('foo') as (bar, baz): + bar, baz + bar, baz + ''') + + def test_withStatementListNames(self): + """ + No warnings are emitted for using any of the list of names defined by a + C{with} statement within the suite or afterwards. + """ + self.flakes(''' + with open('foo') as [bar, baz]: + bar, baz + bar, baz + ''') + + def test_withStatementComplicatedTarget(self): + """ + If the target of a C{with} statement uses any or all of the valid forms + for that part of the grammar (See + U{http://docs.python.org/reference/compound_stmts.html#the-with-statement}), + the names involved are checked both for definedness and any bindings + created are respected in the suite of the statement and afterwards. + """ + self.flakes(''' + c = d = e = g = h = i = None + with open('foo') as [(a, b), c[d], e.f, g[h:i]]: + a, b, c, d, e, g, h, i + a, b, c, d, e, g, h, i + ''') + + def test_withStatementSingleNameUndefined(self): + """ + An undefined name warning is emitted if the name first defined by a + C{with} statement is used before the C{with} statement. + """ + self.flakes(''' + bar + with open('foo') as bar: + pass + ''', m.UndefinedName) + + def test_withStatementTupleNamesUndefined(self): + """ + An undefined name warning is emitted if a name first defined by the + tuple-unpacking form of the C{with} statement is used before the + C{with} statement. + """ + self.flakes(''' + baz + with open('foo') as (bar, baz): + pass + ''', m.UndefinedName) + + def test_withStatementSingleNameRedefined(self): + """ + A redefined name warning is emitted if a name bound by an import is + rebound by the name defined by a C{with} statement. + """ + self.flakes(''' + import bar + with open('foo') as bar: + pass + ''', m.RedefinedWhileUnused) + + def test_withStatementTupleNamesRedefined(self): + """ + A redefined name warning is emitted if a name bound by an import is + rebound by one of the names defined by the tuple-unpacking form of a + C{with} statement. + """ + self.flakes(''' + import bar + with open('foo') as (bar, baz): + pass + ''', m.RedefinedWhileUnused) + + def test_withStatementUndefinedInside(self): + """ + An undefined name warning is emitted if a name is used inside the + body of a C{with} statement without first being bound. + """ + self.flakes(''' + with open('foo') as bar: + baz + ''', m.UndefinedName) + + def test_withStatementNameDefinedInBody(self): + """ + A name defined in the body of a C{with} statement can be used after + the body ends without warning. + """ + self.flakes(''' + with open('foo') as bar: + baz = 10 + baz + ''') + + def test_withStatementUndefinedInExpression(self): + """ + An undefined name warning is emitted if a name in the I{test} + expression of a C{with} statement is undefined. + """ + self.flakes(''' + with bar as baz: + pass + ''', m.UndefinedName) + + self.flakes(''' + with bar as bar: + pass + ''', m.UndefinedName) + + def test_dictComprehension(self): + """ + Dict comprehensions are properly handled. + """ + self.flakes(''' + a = {1: x for x in range(10)} + ''') + + def test_setComprehensionAndLiteral(self): + """ + Set comprehensions are properly handled. + """ + self.flakes(''' + a = {1, 2, 3} + b = {x for x in range(10)} + ''') + + def test_exceptionUsedInExcept(self): + self.flakes(''' + try: pass + except Exception as e: e + ''') + + self.flakes(''' + def download_review(): + try: pass + except Exception as e: e + ''') + + @skipIf(version_info < (3,), + "In Python 2 exception names stay bound after the exception handler") + def test_exceptionUnusedInExcept(self): + self.flakes(''' + try: pass + except Exception as e: pass + ''', m.UnusedVariable) + + def test_exceptionUnusedInExceptInFunction(self): + self.flakes(''' + def download_review(): + try: pass + except Exception as e: pass + ''', m.UnusedVariable) + + def test_exceptWithoutNameInFunction(self): + """ + Don't issue false warning when an unnamed exception is used. + Previously, there would be a false warning, but only when the + try..except was in a function + """ + self.flakes(''' + import tokenize + def foo(): + try: pass + except tokenize.TokenError: pass + ''') + + def test_exceptWithoutNameInFunctionTuple(self): + """ + Don't issue false warning when an unnamed exception is used. + This example catches a tuple of exception types. + """ + self.flakes(''' + import tokenize + def foo(): + try: pass + except (tokenize.TokenError, IndentationError): pass + ''') + + def test_augmentedAssignmentImportedFunctionCall(self): + """ + Consider a function that is called on the right part of an + augassign operation to be used. + """ + self.flakes(''' + from foo import bar + baz = 0 + baz += bar() + ''') + + def test_assert_without_message(self): + """An assert without a message is not an error.""" + self.flakes(''' + a = 1 + assert a + ''') + + def test_assert_with_message(self): + """An assert with a message is not an error.""" + self.flakes(''' + a = 1 + assert a, 'x' + ''') + + def test_assert_tuple(self): + """An assert of a non-empty tuple is always True.""" + self.flakes(''' + assert (False, 'x') + assert (False, ) + ''', m.AssertTuple, m.AssertTuple) + + def test_assert_tuple_empty(self): + """An assert of an empty tuple is always False.""" + self.flakes(''' + assert () + ''') + + def test_assert_static(self): + """An assert of a static value is not an error.""" + self.flakes(''' + assert True + assert 1 + ''') + + @skipIf(version_info < (3, 3), 'new in Python 3.3') + def test_yieldFromUndefined(self): + """ + Test C{yield from} statement + """ + self.flakes(''' + def bar(): + yield from foo() + ''', m.UndefinedName) + + @skipIf(version_info < (3, 6), 'new in Python 3.6') + def test_f_string(self): + """Test PEP 498 f-strings are treated as a usage.""" + self.flakes(''' + baz = 0 + print(f'\x7b4*baz\N{RIGHT CURLY BRACKET}') + ''') + + @skipIf(version_info < (3, 8), 'new in Python 3.8') + def test_assign_expr(self): + """Test PEP 572 assignment expressions are treated as usage / write.""" + self.flakes(''' + from foo import y + print(x := y) + print(x) + ''') + + +class TestStringFormatting(TestCase): + + @skipIf(version_info < (3, 6), 'new in Python 3.6') + def test_f_string_without_placeholders(self): + self.flakes("f'foo'", m.FStringMissingPlaceholders) + self.flakes(''' + f"""foo + bar + """ + ''', m.FStringMissingPlaceholders) + self.flakes(''' + print( + f'foo' + f'bar' + ) + ''', m.FStringMissingPlaceholders) + # this is an "escaped placeholder" but not a placeholder + self.flakes("f'{{}}'", m.FStringMissingPlaceholders) + # ok: f-string with placeholders + self.flakes(''' + x = 5 + print(f'{x}') + ''') + # ok: f-string with format specifiers + self.flakes(''' + x = 'a' * 90 + print(f'{x:.8}') + ''') + # ok: f-string with multiple format specifiers + self.flakes(''' + x = y = 5 + print(f'{x:>2} {y:>2}') + ''') + + def test_invalid_dot_format_calls(self): + self.flakes(''' + '{'.format(1) + ''', m.StringDotFormatInvalidFormat) + self.flakes(''' + '{} {1}'.format(1, 2) + ''', m.StringDotFormatMixingAutomatic) + self.flakes(''' + '{0} {}'.format(1, 2) + ''', m.StringDotFormatMixingAutomatic) + self.flakes(''' + '{}'.format(1, 2) + ''', m.StringDotFormatExtraPositionalArguments) + self.flakes(''' + '{}'.format(1, bar=2) + ''', m.StringDotFormatExtraNamedArguments) + self.flakes(''' + '{} {}'.format(1) + ''', m.StringDotFormatMissingArgument) + self.flakes(''' + '{2}'.format() + ''', m.StringDotFormatMissingArgument) + self.flakes(''' + '{bar}'.format() + ''', m.StringDotFormatMissingArgument) + # too much string recursion (placeholder-in-placeholder) + self.flakes(''' + '{:{:{}}}'.format(1, 2, 3) + ''', m.StringDotFormatInvalidFormat) + # ok: dotted / bracketed names need to handle the param differently + self.flakes("'{.__class__}'.format('')") + self.flakes("'{foo[bar]}'.format(foo={'bar': 'barv'})") + # ok: placeholder-placeholders + self.flakes(''' + print('{:{}} {}'.format(1, 15, 2)) + ''') + # ok: not a placeholder-placeholder + self.flakes(''' + print('{:2}'.format(1)) + ''') + # ok: not mixed automatic + self.flakes(''' + '{foo}-{}'.format(1, foo=2) + ''') + # ok: we can't determine statically the format args + self.flakes(''' + a = () + "{}".format(*a) + ''') + self.flakes(''' + k = {} + "{foo}".format(**k) + ''') + + def test_invalid_percent_format_calls(self): + self.flakes(''' + '%(foo)' % {'foo': 'bar'} + ''', m.PercentFormatInvalidFormat) + self.flakes(''' + '%s %(foo)s' % {'foo': 'bar'} + ''', m.PercentFormatMixedPositionalAndNamed) + self.flakes(''' + '%(foo)s %s' % {'foo': 'bar'} + ''', m.PercentFormatMixedPositionalAndNamed) + self.flakes(''' + '%j' % (1,) + ''', m.PercentFormatUnsupportedFormatCharacter) + self.flakes(''' + '%s %s' % (1,) + ''', m.PercentFormatPositionalCountMismatch) + self.flakes(''' + '%s %s' % (1, 2, 3) + ''', m.PercentFormatPositionalCountMismatch) + self.flakes(''' + '%(bar)s' % {} + ''', m.PercentFormatMissingArgument,) + self.flakes(''' + '%(bar)s' % {'bar': 1, 'baz': 2} + ''', m.PercentFormatExtraNamedArguments) + self.flakes(''' + '%(bar)s' % (1, 2, 3) + ''', m.PercentFormatExpectedMapping) + self.flakes(''' + '%s %s' % {'k': 'v'} + ''', m.PercentFormatExpectedSequence) + self.flakes(''' + '%(bar)*s' % {'bar': 'baz'} + ''', m.PercentFormatStarRequiresSequence) + # ok: single %s with mapping + self.flakes(''' + '%s' % {'foo': 'bar', 'baz': 'womp'} + ''') + # ok: does not cause a MemoryError (the strings aren't evaluated) + self.flakes(''' + "%1000000000000f" % 1 + ''') + # ok: %% should not count towards placeholder count + self.flakes(''' + '%% %s %% %s' % (1, 2) + ''') + # ok: * consumes one positional argument + self.flakes(''' + '%.*f' % (2, 1.1234) + '%*.*f' % (5, 2, 3.1234) + ''') + + @skipIf(version_info < (3, 5), 'new in Python 3.5') + def test_ok_percent_format_cannot_determine_element_count(self): + self.flakes(''' + a = [] + '%s %s' % [*a] + '%s %s' % (*a,) + ''') + self.flakes(''' + k = {} + '%(k)s' % {**k} + ''') + + +class TestAsyncStatements(TestCase): + + @skipIf(version_info < (3, 5), 'new in Python 3.5') + def test_asyncDef(self): + self.flakes(''' + async def bar(): + return 42 + ''') + + @skipIf(version_info < (3, 5), 'new in Python 3.5') + def test_asyncDefAwait(self): + self.flakes(''' + async def read_data(db): + await db.fetch('SELECT ...') + ''') + + @skipIf(version_info < (3, 5), 'new in Python 3.5') + def test_asyncDefUndefined(self): + self.flakes(''' + async def bar(): + return foo() + ''', m.UndefinedName) + + @skipIf(version_info < (3, 5), 'new in Python 3.5') + def test_asyncFor(self): + self.flakes(''' + async def read_data(db): + output = [] + async for row in db.cursor(): + output.append(row) + return output + ''') + + @skipIf(version_info < (3, 5), 'new in Python 3.5') + def test_asyncForUnderscoreLoopVar(self): + self.flakes(''' + async def coro(it): + async for _ in it: + pass + ''') + + @skipIf(version_info < (3, 5), 'new in Python 3.5') + def test_loopControlInAsyncFor(self): + self.flakes(''' + async def read_data(db): + output = [] + async for row in db.cursor(): + if row[0] == 'skip': + continue + output.append(row) + return output + ''') + + self.flakes(''' + async def read_data(db): + output = [] + async for row in db.cursor(): + if row[0] == 'stop': + break + output.append(row) + return output + ''') + + @skipIf(version_info < (3, 5), 'new in Python 3.5') + def test_loopControlInAsyncForElse(self): + self.flakes(''' + async def read_data(db): + output = [] + async for row in db.cursor(): + output.append(row) + else: + continue + return output + ''', m.ContinueOutsideLoop) + + self.flakes(''' + async def read_data(db): + output = [] + async for row in db.cursor(): + output.append(row) + else: + break + return output + ''', m.BreakOutsideLoop) + + @skipIf(version_info < (3, 5), 'new in Python 3.5') + @skipIf(version_info > (3, 8), "Python <= 3.8 only") + def test_continueInAsyncForFinally(self): + self.flakes(''' + async def read_data(db): + output = [] + async for row in db.cursor(): + try: + output.append(row) + finally: + continue + return output + ''', m.ContinueInFinally) + + @skipIf(version_info < (3, 5), 'new in Python 3.5') + def test_asyncWith(self): + self.flakes(''' + async def commit(session, data): + async with session.transaction(): + await session.update(data) + ''') + + @skipIf(version_info < (3, 5), 'new in Python 3.5') + def test_asyncWithItem(self): + self.flakes(''' + async def commit(session, data): + async with session.transaction() as trans: + await trans.begin() + ... + await trans.end() + ''') + + @skipIf(version_info < (3, 5), 'new in Python 3.5') + def test_matmul(self): + self.flakes(''' + def foo(a, b): + return a @ b + ''') + + @skipIf(version_info < (3, 6), 'new in Python 3.6') + def test_formatstring(self): + self.flakes(''' + hi = 'hi' + mom = 'mom' + f'{hi} {mom}' + ''') + + def test_raise_notimplemented(self): + self.flakes(''' + raise NotImplementedError("This is fine") + ''') + + self.flakes(''' + raise NotImplementedError + ''') + + self.flakes(''' + raise NotImplemented("This isn't gonna work") + ''', m.RaiseNotImplemented) + + self.flakes(''' + raise NotImplemented + ''', m.RaiseNotImplemented) + + +class TestIncompatiblePrintOperator(TestCase): + """ + Tests for warning about invalid use of print function. + """ + + def test_valid_print(self): + self.flakes(''' + print("Hello") + ''') + + def test_invalid_print_when_imported_from_future(self): + exc = self.flakes(''' + from __future__ import print_function + import sys + print >>sys.stderr, "Hello" + ''', m.InvalidPrintSyntax).messages[0] + + self.assertEqual(exc.lineno, 4) + self.assertEqual(exc.col, 0) + + def test_print_function_assignment(self): + """ + A valid assignment, tested for catching false positives. + """ + self.flakes(''' + from __future__ import print_function + log = print + log("Hello") + ''') + + def test_print_in_lambda(self): + self.flakes(''' + from __future__ import print_function + a = lambda: print + ''') + + def test_print_returned_in_function(self): + self.flakes(''' + from __future__ import print_function + def a(): + return print + ''') + + def test_print_as_condition_test(self): + self.flakes(''' + from __future__ import print_function + if print: pass + ''') diff --git a/anaconda_lib/linting/pyflakes/test/test_return_with_arguments_inside_generator.py b/anaconda_lib/linting/pyflakes/test/test_return_with_arguments_inside_generator.py new file mode 100644 index 00000000..fc1272a9 --- /dev/null +++ b/anaconda_lib/linting/pyflakes/test/test_return_with_arguments_inside_generator.py @@ -0,0 +1,34 @@ + +from sys import version_info + +from pyflakes import messages as m +from pyflakes.test.harness import TestCase, skipIf + + +class Test(TestCase): + @skipIf(version_info >= (3, 3), 'new in Python 3.3') + def test_return(self): + self.flakes(''' + class a: + def b(): + for x in a.c: + if x: + yield x + return a + ''', m.ReturnWithArgsInsideGenerator) + + @skipIf(version_info >= (3, 3), 'new in Python 3.3') + def test_returnNone(self): + self.flakes(''' + def a(): + yield 12 + return None + ''', m.ReturnWithArgsInsideGenerator) + + @skipIf(version_info >= (3, 3), 'new in Python 3.3') + def test_returnYieldExpression(self): + self.flakes(''' + def a(): + b = yield a + return b + ''', m.ReturnWithArgsInsideGenerator) diff --git a/anaconda_lib/linting/pyflakes/test/test_type_annotations.py b/anaconda_lib/linting/pyflakes/test/test_type_annotations.py new file mode 100644 index 00000000..f3b6c247 --- /dev/null +++ b/anaconda_lib/linting/pyflakes/test/test_type_annotations.py @@ -0,0 +1,763 @@ +""" +Tests for behaviour related to type annotations. +""" + +from sys import version_info + +from pyflakes import messages as m +from pyflakes.test.harness import TestCase, skipIf + + +class TestTypeAnnotations(TestCase): + + def test_typingOverload(self): + """Allow intentional redefinitions via @typing.overload""" + self.flakes(""" + import typing + from typing import overload + + @overload + def f(s): # type: (None) -> None + pass + + @overload + def f(s): # type: (int) -> int + pass + + def f(s): + return s + + @typing.overload + def g(s): # type: (None) -> None + pass + + @typing.overload + def g(s): # type: (int) -> int + pass + + def g(s): + return s + """) + + def test_typingExtensionsOverload(self): + """Allow intentional redefinitions via @typing_extensions.overload""" + self.flakes(""" + import typing_extensions + from typing_extensions import overload + + @overload + def f(s): # type: (None) -> None + pass + + @overload + def f(s): # type: (int) -> int + pass + + def f(s): + return s + + @typing_extensions.overload + def g(s): # type: (None) -> None + pass + + @typing_extensions.overload + def g(s): # type: (int) -> int + pass + + def g(s): + return s + """) + + @skipIf(version_info < (3, 5), 'new in Python 3.5') + def test_typingOverloadAsync(self): + """Allow intentional redefinitions via @typing.overload (async)""" + self.flakes(""" + from typing import overload + + @overload + async def f(s): # type: (None) -> None + pass + + @overload + async def f(s): # type: (int) -> int + pass + + async def f(s): + return s + """) + + def test_overload_with_multiple_decorators(self): + self.flakes(""" + from typing import overload + dec = lambda f: f + + @dec + @overload + def f(x): # type: (int) -> int + pass + + @dec + @overload + def f(x): # type: (str) -> str + pass + + @dec + def f(x): return x + """) + + def test_overload_in_class(self): + self.flakes(""" + from typing import overload + + class C: + @overload + def f(self, x): # type: (int) -> int + pass + + @overload + def f(self, x): # type: (str) -> str + pass + + def f(self, x): return x + """) + + def test_aliased_import(self): + """Detect when typing is imported as another name""" + self.flakes(""" + import typing as t + + @t.overload + def f(s): # type: (None) -> None + pass + + @t.overload + def f(s): # type: (int) -> int + pass + + def f(s): + return s + """) + + def test_not_a_typing_overload(self): + """regression test for @typing.overload detection bug in 2.1.0""" + self.flakes(""" + def foo(x): + return x + + @foo + def bar(): + pass + + def bar(): + pass + """, m.RedefinedWhileUnused) + + @skipIf(version_info < (3, 6), 'new in Python 3.6') + def test_variable_annotations(self): + self.flakes(''' + name: str + age: int + ''') + self.flakes(''' + name: str = 'Bob' + age: int = 18 + ''') + self.flakes(''' + class C: + name: str + age: int + ''') + self.flakes(''' + class C: + name: str = 'Bob' + age: int = 18 + ''') + self.flakes(''' + def f(): + name: str + age: int + ''') + self.flakes(''' + def f(): + name: str = 'Bob' + age: int = 18 + foo: not_a_real_type = None + ''', m.UnusedVariable, m.UnusedVariable, m.UnusedVariable, m.UndefinedName) + self.flakes(''' + def f(): + name: str + print(name) + ''', m.UndefinedName) + self.flakes(''' + from typing import Any + def f(): + a: Any + ''') + self.flakes(''' + foo: not_a_real_type + ''', m.UndefinedName) + self.flakes(''' + foo: not_a_real_type = None + ''', m.UndefinedName) + self.flakes(''' + class C: + foo: not_a_real_type + ''', m.UndefinedName) + self.flakes(''' + class C: + foo: not_a_real_type = None + ''', m.UndefinedName) + self.flakes(''' + def f(): + class C: + foo: not_a_real_type + ''', m.UndefinedName) + self.flakes(''' + def f(): + class C: + foo: not_a_real_type = None + ''', m.UndefinedName) + self.flakes(''' + from foo import Bar + bar: Bar + ''') + self.flakes(''' + from foo import Bar + bar: 'Bar' + ''') + self.flakes(''' + import foo + bar: foo.Bar + ''') + self.flakes(''' + import foo + bar: 'foo.Bar' + ''') + self.flakes(''' + from foo import Bar + def f(bar: Bar): pass + ''') + self.flakes(''' + from foo import Bar + def f(bar: 'Bar'): pass + ''') + self.flakes(''' + from foo import Bar + def f(bar) -> Bar: return bar + ''') + self.flakes(''' + from foo import Bar + def f(bar) -> 'Bar': return bar + ''') + self.flakes(''' + bar: 'Bar' + ''', m.UndefinedName) + self.flakes(''' + bar: 'foo.Bar' + ''', m.UndefinedName) + self.flakes(''' + from foo import Bar + bar: str + ''', m.UnusedImport) + self.flakes(''' + from foo import Bar + def f(bar: str): pass + ''', m.UnusedImport) + self.flakes(''' + def f(a: A) -> A: pass + class A: pass + ''', m.UndefinedName, m.UndefinedName) + self.flakes(''' + def f(a: 'A') -> 'A': return a + class A: pass + ''') + self.flakes(''' + a: A + class A: pass + ''', m.UndefinedName) + self.flakes(''' + a: 'A' + class A: pass + ''') + self.flakes(''' + T: object + def f(t: T): pass + ''', m.UndefinedName) + self.flakes(''' + T: object + def g(t: 'T'): pass + ''') + self.flakes(''' + a: 'A B' + ''', m.ForwardAnnotationSyntaxError) + self.flakes(''' + a: 'A; B' + ''', m.ForwardAnnotationSyntaxError) + self.flakes(''' + a: '1 + 2' + ''') + self.flakes(''' + a: 'a: "A"' + ''', m.ForwardAnnotationSyntaxError) + + @skipIf(version_info < (3, 6), 'new in Python 3.6') + def test_annotating_an_import(self): + self.flakes(''' + from a import b, c + b: c + print(b) + ''') + + @skipIf(version_info < (3, 6), 'new in Python 3.6') + def test_unused_annotation(self): + # Unused annotations are fine in module and class scope + self.flakes(''' + x: int + class Cls: + y: int + ''') + # TODO: this should print a UnusedVariable message + self.flakes(''' + def f(): + x: int + ''') + # This should only print one UnusedVariable message + self.flakes(''' + def f(): + x: int + x = 3 + ''', m.UnusedVariable) + + @skipIf(version_info < (3, 5), 'new in Python 3.5') + def test_annotated_async_def(self): + self.flakes(''' + class c: pass + async def func(c: c) -> None: pass + ''') + + @skipIf(version_info < (3, 7), 'new in Python 3.7') + def test_postponed_annotations(self): + self.flakes(''' + from __future__ import annotations + def f(a: A) -> A: pass + class A: + b: B + class B: pass + ''') + + self.flakes(''' + from __future__ import annotations + def f(a: A) -> A: pass + class A: + b: Undefined + class B: pass + ''', m.UndefinedName) + + self.flakes(''' + from __future__ import annotations + T: object + def f(t: T): pass + def g(t: 'T'): pass + ''') + + @skipIf(version_info < (3, 6), 'new in Python 3.6') + def test_type_annotation_clobbers_all(self): + self.flakes('''\ + from typing import TYPE_CHECKING, List + + from y import z + + if not TYPE_CHECKING: + __all__ = ("z",) + else: + __all__: List[str] + ''') + + def test_typeCommentsMarkImportsAsUsed(self): + self.flakes(""" + from mod import A, B, C, D, E, F, G + + + def f( + a, # type: A + ): + # type: (...) -> B + for b in a: # type: C + with b as c: # type: D + d = c.x # type: E + return d + + + def g(x): # type: (F) -> G + return x.y + """) + + def test_typeCommentsFullSignature(self): + self.flakes(""" + from mod import A, B, C, D + def f(a, b): + # type: (A, B[C]) -> D + return a + b + """) + + def test_typeCommentsStarArgs(self): + self.flakes(""" + from mod import A, B, C, D + def f(a, *b, **c): + # type: (A, *B, **C) -> D + return a + b + """) + + def test_typeCommentsFullSignatureWithDocstring(self): + self.flakes(''' + from mod import A, B, C, D + def f(a, b): + # type: (A, B[C]) -> D + """do the thing!""" + return a + b + ''') + + def test_typeCommentsAdditionalComment(self): + self.flakes(""" + from mod import F + + x = 1 # type: F # noqa + """) + + def test_typeCommentsNoWhitespaceAnnotation(self): + self.flakes(""" + from mod import F + + x = 1 #type:F + """) + + def test_typeCommentsInvalidDoesNotMarkAsUsed(self): + self.flakes(""" + from mod import F + + # type: F + """, m.UnusedImport) + + def test_typeCommentsSyntaxError(self): + self.flakes(""" + def f(x): # type: (F[) -> None + pass + """, m.CommentAnnotationSyntaxError) + + def test_typeCommentsSyntaxErrorCorrectLine(self): + checker = self.flakes("""\ + x = 1 + # type: definitely not a PEP 484 comment + """, m.CommentAnnotationSyntaxError) + self.assertEqual(checker.messages[0].lineno, 2) + + def test_typeCommentsAssignedToPreviousNode(self): + # This test demonstrates an issue in the implementation which + # associates the type comment with a node above it, however the type + # comment isn't valid according to mypy. If an improved approach + # which can detect these "invalid" type comments is implemented, this + # test should be removed / improved to assert that new check. + self.flakes(""" + from mod import F + x = 1 + # type: F + """) + + def test_typeIgnore(self): + self.flakes(""" + a = 0 # type: ignore + b = 0 # type: ignore[excuse] + c = 0 # type: ignore=excuse + d = 0 # type: ignore [excuse] + e = 0 # type: ignore whatever + """) + + def test_typeIgnoreBogus(self): + self.flakes(""" + x = 1 # type: ignored + """, m.UndefinedName) + + def test_typeIgnoreBogusUnicode(self): + error = (m.CommentAnnotationSyntaxError if version_info < (3,) + else m.UndefinedName) + self.flakes(""" + x = 2 # type: ignore\xc3 + """, error) + + @skipIf(version_info < (3,), 'new in Python 3') + def test_return_annotation_is_class_scope_variable(self): + self.flakes(""" + from typing import TypeVar + class Test: + Y = TypeVar('Y') + + def t(self, x: Y) -> Y: + return x + """) + + @skipIf(version_info < (3,), 'new in Python 3') + def test_return_annotation_is_function_body_variable(self): + self.flakes(""" + class Test: + def t(self) -> Y: + Y = 2 + return Y + """, m.UndefinedName) + + @skipIf(version_info < (3, 8), 'new in Python 3.8') + def test_positional_only_argument_annotations(self): + self.flakes(""" + from x import C + + def f(c: C, /): ... + """) + + @skipIf(version_info < (3,), 'new in Python 3') + def test_partially_quoted_type_annotation(self): + self.flakes(""" + from queue import Queue + from typing import Optional + + def f() -> Optional['Queue[str]']: + return None + """) + + def test_partially_quoted_type_assignment(self): + self.flakes(""" + from queue import Queue + from typing import Optional + + MaybeQueue = Optional['Queue[str]'] + """) + + def test_nested_partially_quoted_type_assignment(self): + self.flakes(""" + from queue import Queue + from typing import Callable + + Func = Callable[['Queue[str]'], None] + """) + + def test_quoted_type_cast(self): + self.flakes(""" + from typing import cast, Optional + + maybe_int = cast('Optional[int]', 42) + """) + + def test_type_cast_literal_str_to_str(self): + # Checks that our handling of quoted type annotations in the first + # argument to `cast` doesn't cause issues when (only) the _second_ + # argument is a literal str which looks a bit like a type annotation. + self.flakes(""" + from typing import cast + + a_string = cast(str, 'Optional[int]') + """) + + def test_quoted_type_cast_renamed_import(self): + self.flakes(""" + from typing import cast as tsac, Optional as Maybe + + maybe_int = tsac('Maybe[int]', 42) + """) + + def test_quoted_TypeVar_constraints(self): + self.flakes(""" + from typing import TypeVar, Optional + + T = TypeVar('T', 'str', 'Optional[int]', bytes) + """) + + def test_quoted_TypeVar_bound(self): + self.flakes(""" + from typing import TypeVar, Optional, List + + T = TypeVar('T', bound='Optional[int]') + S = TypeVar('S', int, bound='List[int]') + """) + + @skipIf(version_info < (3,), 'new in Python 3') + def test_literal_type_typing(self): + self.flakes(""" + from typing import Literal + + def f(x: Literal['some string']) -> None: + return None + """) + + @skipIf(version_info < (3,), 'new in Python 3') + def test_literal_type_typing_extensions(self): + self.flakes(""" + from typing_extensions import Literal + + def f(x: Literal['some string']) -> None: + return None + """) + + @skipIf(version_info < (3,), 'new in Python 3') + def test_annotated_type_typing_missing_forward_type(self): + self.flakes(""" + from typing import Annotated + + def f(x: Annotated['integer']) -> None: + return None + """, m.UndefinedName) + + @skipIf(version_info < (3,), 'new in Python 3') + def test_annotated_type_typing_missing_forward_type_multiple_args(self): + self.flakes(""" + from typing import Annotated + + def f(x: Annotated['integer', 1]) -> None: + return None + """, m.UndefinedName) + + @skipIf(version_info < (3,), 'new in Python 3') + def test_annotated_type_typing_with_string_args(self): + self.flakes(""" + from typing import Annotated + + def f(x: Annotated[int, '> 0']) -> None: + return None + """) + + @skipIf(version_info < (3,), 'new in Python 3') + def test_annotated_type_typing_with_string_args_in_union(self): + self.flakes(""" + from typing import Annotated, Union + + def f(x: Union[Annotated['int', '>0'], 'integer']) -> None: + return None + """, m.UndefinedName) + + @skipIf(version_info < (3,), 'new in Python 3') + def test_literal_type_some_other_module(self): + """err on the side of false-negatives for types named Literal""" + self.flakes(""" + from my_module import compat + from my_module.compat import Literal + + def f(x: compat.Literal['some string']) -> None: + return None + def g(x: Literal['some string']) -> None: + return None + """) + + @skipIf(version_info < (3,), 'new in Python 3') + def test_literal_union_type_typing(self): + self.flakes(""" + from typing import Literal + + def f(x: Literal['some string', 'foo bar']) -> None: + return None + """) + + @skipIf(version_info < (3,), 'new in Python 3') + def test_deferred_twice_annotation(self): + self.flakes(""" + from queue import Queue + from typing import Optional + + + def f() -> "Optional['Queue[str]']": + return None + """) + + @skipIf(version_info < (3, 7), 'new in Python 3.7') + def test_partial_string_annotations_with_future_annotations(self): + self.flakes(""" + from __future__ import annotations + + from queue import Queue + from typing import Optional + + + def f() -> Optional['Queue[str]']: + return None + """) + + def test_idomiatic_typing_guards(self): + # typing.TYPE_CHECKING: python3.5.3+ + self.flakes(""" + from typing import TYPE_CHECKING + + if TYPE_CHECKING: + from t import T + + def f(): # type: () -> T + pass + """) + # False: the old, more-compatible approach + self.flakes(""" + if False: + from t import T + + def f(): # type: () -> T + pass + """) + # some choose to assign a constant and do it that way + self.flakes(""" + MYPY = False + + if MYPY: + from t import T + + def f(): # type: () -> T + pass + """) + + def test_typing_guard_for_protocol(self): + self.flakes(""" + from typing import TYPE_CHECKING + + if TYPE_CHECKING: + from typing import Protocol + else: + Protocol = object + + class C(Protocol): + def f(): # type: () -> int + pass + """) + + def test_typednames_correct_forward_ref(self): + self.flakes(""" + from typing import TypedDict, List, NamedTuple + + List[TypedDict("x", {})] + List[TypedDict("x", x=int)] + List[NamedTuple("a", a=int)] + List[NamedTuple("a", [("a", int)])] + """) + self.flakes(""" + from typing import TypedDict, List, NamedTuple, TypeVar + + List[TypedDict("x", {"x": "Y"})] + List[TypedDict("x", x="Y")] + List[NamedTuple("a", [("a", "Y")])] + List[NamedTuple("a", a="Y")] + List[TypedDict("x", {"x": List["a"]})] + List[TypeVar("A", bound="C")] + List[TypeVar("A", List["C"])] + """, *[m.UndefinedName]*7) + self.flakes(""" + from typing import NamedTuple, TypeVar, cast + from t import A, B, C, D, E + + NamedTuple("A", [("a", A["C"])]) + TypeVar("A", bound=A["B"]) + TypeVar("A", A["D"]) + cast(A["E"], []) + """) + + @skipIf(version_info < (3, 6), 'new in Python 3.6') + def test_namedtypes_classes(self): + self.flakes(""" + from typing import TypedDict, NamedTuple + class X(TypedDict): + y: TypedDict("z", {"zz":int}) + + class Y(NamedTuple): + y: NamedTuple("v", [("vv", int)]) + """) diff --git a/anaconda_lib/linting/pyflakes/test/test_undefined_names.py b/anaconda_lib/linting/pyflakes/test/test_undefined_names.py new file mode 100644 index 00000000..e0e628dc --- /dev/null +++ b/anaconda_lib/linting/pyflakes/test/test_undefined_names.py @@ -0,0 +1,871 @@ +import ast +from sys import version_info + +from pyflakes import messages as m, checker +from pyflakes.test.harness import TestCase, skipIf, skip + + +class Test(TestCase): + def test_undefined(self): + self.flakes('bar', m.UndefinedName) + + def test_definedInListComp(self): + self.flakes('[a for a in range(10) if a]') + + @skipIf(version_info < (3,), + 'in Python 2 list comprehensions execute in the same scope') + def test_undefinedInListComp(self): + self.flakes(''' + [a for a in range(10)] + a + ''', + m.UndefinedName) + + @skipIf(version_info < (3,), + 'in Python 2 exception names stay bound after the except: block') + def test_undefinedExceptionName(self): + """Exception names can't be used after the except: block. + + The exc variable is unused inside the exception handler.""" + self.flakes(''' + try: + raise ValueError('ve') + except ValueError as exc: + pass + exc + ''', m.UndefinedName, m.UnusedVariable) + + def test_namesDeclaredInExceptBlocks(self): + """Locals declared in except: blocks can be used after the block. + + This shows the example in test_undefinedExceptionName is + different.""" + self.flakes(''' + try: + raise ValueError('ve') + except ValueError as exc: + e = exc + e + ''') + + @skip('error reporting disabled due to false positives below') + def test_undefinedExceptionNameObscuringLocalVariable(self): + """Exception names obscure locals, can't be used after. + + Last line will raise UnboundLocalError on Python 3 after exiting + the except: block. Note next two examples for false positives to + watch out for.""" + self.flakes(''' + exc = 'Original value' + try: + raise ValueError('ve') + except ValueError as exc: + pass + exc + ''', + m.UndefinedName) + + @skipIf(version_info < (3,), + 'in Python 2 exception names stay bound after the except: block') + def test_undefinedExceptionNameObscuringLocalVariable2(self): + """Exception names are unbound after the `except:` block. + + Last line will raise UnboundLocalError on Python 3 but would print out + 've' on Python 2. The exc variable is unused inside the exception + handler.""" + self.flakes(''' + try: + raise ValueError('ve') + except ValueError as exc: + pass + print(exc) + exc = 'Original value' + ''', m.UndefinedName, m.UnusedVariable) + + def test_undefinedExceptionNameObscuringLocalVariableFalsePositive1(self): + """Exception names obscure locals, can't be used after. Unless. + + Last line will never raise UnboundLocalError because it's only + entered if no exception was raised.""" + # The exc variable is unused inside the exception handler. + expected = [] if version_info < (3,) else [m.UnusedVariable] + self.flakes(''' + exc = 'Original value' + try: + raise ValueError('ve') + except ValueError as exc: + print('exception logged') + raise + exc + ''', *expected) + + def test_delExceptionInExcept(self): + """The exception name can be deleted in the except: block.""" + self.flakes(''' + try: + pass + except Exception as exc: + del exc + ''') + + def test_undefinedExceptionNameObscuringLocalVariableFalsePositive2(self): + """Exception names obscure locals, can't be used after. Unless. + + Last line will never raise UnboundLocalError because `error` is + only falsy if the `except:` block has not been entered.""" + # The exc variable is unused inside the exception handler. + expected = [] if version_info < (3,) else [m.UnusedVariable] + self.flakes(''' + exc = 'Original value' + error = None + try: + raise ValueError('ve') + except ValueError as exc: + error = 'exception logged' + if error: + print(error) + else: + exc + ''', *expected) + + @skip('error reporting disabled due to false positives below') + def test_undefinedExceptionNameObscuringGlobalVariable(self): + """Exception names obscure globals, can't be used after. + + Last line will raise UnboundLocalError on both Python 2 and + Python 3 because the existence of that exception name creates + a local scope placeholder for it, obscuring any globals, etc.""" + self.flakes(''' + exc = 'Original value' + def func(): + try: + pass # nothing is raised + except ValueError as exc: + pass # block never entered, exc stays unbound + exc + ''', + m.UndefinedLocal) + + @skip('error reporting disabled due to false positives below') + def test_undefinedExceptionNameObscuringGlobalVariable2(self): + """Exception names obscure globals, can't be used after. + + Last line will raise NameError on Python 3 because the name is + locally unbound after the `except:` block, even if it's + nonlocal. We should issue an error in this case because code + only working correctly if an exception isn't raised, is invalid. + Unless it's explicitly silenced, see false positives below.""" + self.flakes(''' + exc = 'Original value' + def func(): + global exc + try: + raise ValueError('ve') + except ValueError as exc: + pass # block never entered, exc stays unbound + exc + ''', + m.UndefinedLocal) + + def test_undefinedExceptionNameObscuringGlobalVariableFalsePositive1(self): + """Exception names obscure globals, can't be used after. Unless. + + Last line will never raise NameError because it's only entered + if no exception was raised.""" + # The exc variable is unused inside the exception handler. + expected = [] if version_info < (3,) else [m.UnusedVariable] + self.flakes(''' + exc = 'Original value' + def func(): + global exc + try: + raise ValueError('ve') + except ValueError as exc: + print('exception logged') + raise + exc + ''', *expected) + + def test_undefinedExceptionNameObscuringGlobalVariableFalsePositive2(self): + """Exception names obscure globals, can't be used after. Unless. + + Last line will never raise NameError because `error` is only + falsy if the `except:` block has not been entered.""" + # The exc variable is unused inside the exception handler. + expected = [] if version_info < (3,) else [m.UnusedVariable] + self.flakes(''' + exc = 'Original value' + def func(): + global exc + error = None + try: + raise ValueError('ve') + except ValueError as exc: + error = 'exception logged' + if error: + print(error) + else: + exc + ''', *expected) + + def test_functionsNeedGlobalScope(self): + self.flakes(''' + class a: + def b(): + fu + fu = 1 + ''') + + def test_builtins(self): + self.flakes('range(10)') + + def test_builtinWindowsError(self): + """ + C{WindowsError} is sometimes a builtin name, so no warning is emitted + for using it. + """ + self.flakes('WindowsError') + + @skipIf(version_info < (3, 6), 'new feature in 3.6') + def test_moduleAnnotations(self): + """ + Use of the C{__annotations__} in module scope should not emit + an undefined name warning when version is greater than or equal to 3.6. + """ + self.flakes('__annotations__') + + def test_magicGlobalsFile(self): + """ + Use of the C{__file__} magic global should not emit an undefined name + warning. + """ + self.flakes('__file__') + + def test_magicGlobalsBuiltins(self): + """ + Use of the C{__builtins__} magic global should not emit an undefined + name warning. + """ + self.flakes('__builtins__') + + def test_magicGlobalsName(self): + """ + Use of the C{__name__} magic global should not emit an undefined name + warning. + """ + self.flakes('__name__') + + def test_magicGlobalsPath(self): + """ + Use of the C{__path__} magic global should not emit an undefined name + warning, if you refer to it from a file called __init__.py. + """ + self.flakes('__path__', m.UndefinedName) + self.flakes('__path__', filename='package/__init__.py') + + def test_magicModuleInClassScope(self): + """ + Use of the C{__module__} magic builtin should not emit an undefined + name warning if used in class scope. + """ + self.flakes('__module__', m.UndefinedName) + self.flakes(''' + class Foo: + __module__ + ''') + self.flakes(''' + class Foo: + def bar(self): + __module__ + ''', m.UndefinedName) + + @skipIf(version_info < (3, 3), "Python >= 3.3 only") + def test_magicQualnameInClassScope(self): + """ + Use of the C{__qualname__} magic builtin should not emit an undefined + name warning if used in class scope. + """ + self.flakes('__qualname__', m.UndefinedName) + self.flakes(''' + class Foo: + __qualname__ + ''') + self.flakes(''' + class Foo: + def bar(self): + __qualname__ + ''', m.UndefinedName) + + def test_globalImportStar(self): + """Can't find undefined names with import *.""" + self.flakes('from fu import *; bar', + m.ImportStarUsed, m.ImportStarUsage) + + @skipIf(version_info >= (3,), 'obsolete syntax') + def test_localImportStar(self): + """ + A local import * still allows undefined names to be found + in upper scopes. + """ + self.flakes(''' + def a(): + from fu import * + bar + ''', m.ImportStarUsed, m.UndefinedName, m.UnusedImport) + + @skipIf(version_info >= (3,), 'obsolete syntax') + def test_unpackedParameter(self): + """Unpacked function parameters create bindings.""" + self.flakes(''' + def a((bar, baz)): + bar; baz + ''') + + def test_definedByGlobal(self): + """ + "global" can make an otherwise undefined name in another function + defined. + """ + self.flakes(''' + def a(): global fu; fu = 1 + def b(): fu + ''') + self.flakes(''' + def c(): bar + def b(): global bar; bar = 1 + ''') + + def test_definedByGlobalMultipleNames(self): + """ + "global" can accept multiple names. + """ + self.flakes(''' + def a(): global fu, bar; fu = 1; bar = 2 + def b(): fu; bar + ''') + + def test_globalInGlobalScope(self): + """ + A global statement in the global scope is ignored. + """ + self.flakes(''' + global x + def foo(): + print(x) + ''', m.UndefinedName) + + def test_global_reset_name_only(self): + """A global statement does not prevent other names being undefined.""" + # Only different undefined names are reported. + # See following test that fails where the same name is used. + self.flakes(''' + def f1(): + s + + def f2(): + global m + ''', m.UndefinedName) + + @skip("todo") + def test_unused_global(self): + """An unused global statement does not define the name.""" + self.flakes(''' + def f1(): + m + + def f2(): + global m + ''', m.UndefinedName) + + def test_del(self): + """Del deletes bindings.""" + self.flakes('a = 1; del a; a', m.UndefinedName) + + def test_delGlobal(self): + """Del a global binding from a function.""" + self.flakes(''' + a = 1 + def f(): + global a + del a + a + ''') + + def test_delUndefined(self): + """Del an undefined name.""" + self.flakes('del a', m.UndefinedName) + + def test_delConditional(self): + """ + Ignores conditional bindings deletion. + """ + self.flakes(''' + context = None + test = True + if False: + del(test) + assert(test) + ''') + + def test_delConditionalNested(self): + """ + Ignored conditional bindings deletion even if they are nested in other + blocks. + """ + self.flakes(''' + context = None + test = True + if False: + with context(): + del(test) + assert(test) + ''') + + def test_delWhile(self): + """ + Ignore bindings deletion if called inside the body of a while + statement. + """ + self.flakes(''' + def test(): + foo = 'bar' + while False: + del foo + assert(foo) + ''') + + def test_delWhileTestUsage(self): + """ + Ignore bindings deletion if called inside the body of a while + statement and name is used inside while's test part. + """ + self.flakes(''' + def _worker(): + o = True + while o is not True: + del o + o = False + ''') + + def test_delWhileNested(self): + """ + Ignore bindings deletions if node is part of while's test, even when + del is in a nested block. + """ + self.flakes(''' + context = None + def _worker(): + o = True + while o is not True: + while True: + with context(): + del o + o = False + ''') + + def test_globalFromNestedScope(self): + """Global names are available from nested scopes.""" + self.flakes(''' + a = 1 + def b(): + def c(): + a + ''') + + def test_laterRedefinedGlobalFromNestedScope(self): + """ + Test that referencing a local name that shadows a global, before it is + defined, generates a warning. + """ + self.flakes(''' + a = 1 + def fun(): + a + a = 2 + return a + ''', m.UndefinedLocal) + + def test_laterRedefinedGlobalFromNestedScope2(self): + """ + Test that referencing a local name in a nested scope that shadows a + global declared in an enclosing scope, before it is defined, generates + a warning. + """ + self.flakes(''' + a = 1 + def fun(): + global a + def fun2(): + a + a = 2 + return a + ''', m.UndefinedLocal) + + def test_intermediateClassScopeIgnored(self): + """ + If a name defined in an enclosing scope is shadowed by a local variable + and the name is used locally before it is bound, an unbound local + warning is emitted, even if there is a class scope between the enclosing + scope and the local scope. + """ + self.flakes(''' + def f(): + x = 1 + class g: + def h(self): + a = x + x = None + print(x, a) + print(x) + ''', m.UndefinedLocal) + + def test_doubleNestingReportsClosestName(self): + """ + Test that referencing a local name in a nested scope that shadows a + variable declared in two different outer scopes before it is defined + in the innermost scope generates an UnboundLocal warning which + refers to the nearest shadowed name. + """ + exc = self.flakes(''' + def a(): + x = 1 + def b(): + x = 2 # line 5 + def c(): + x + x = 3 + return x + return x + return x + ''', m.UndefinedLocal).messages[0] + + # _DoctestMixin.flakes adds two lines preceding the code above. + expected_line_num = 7 if self.withDoctest else 5 + + self.assertEqual(exc.message_args, ('x', expected_line_num)) + + def test_laterRedefinedGlobalFromNestedScope3(self): + """ + Test that referencing a local name in a nested scope that shadows a + global, before it is defined, generates a warning. + """ + self.flakes(''' + def fun(): + a = 1 + def fun2(): + a + a = 1 + return a + return a + ''', m.UndefinedLocal) + + def test_undefinedAugmentedAssignment(self): + self.flakes( + ''' + def f(seq): + a = 0 + seq[a] += 1 + seq[b] /= 2 + c[0] *= 2 + a -= 3 + d += 4 + e[any] = 5 + ''', + m.UndefinedName, # b + m.UndefinedName, # c + m.UndefinedName, m.UnusedVariable, # d + m.UndefinedName, # e + ) + + def test_nestedClass(self): + """Nested classes can access enclosing scope.""" + self.flakes(''' + def f(foo): + class C: + bar = foo + def f(self): + return foo + return C() + + f(123).f() + ''') + + def test_badNestedClass(self): + """Free variables in nested classes must bind at class creation.""" + self.flakes(''' + def f(): + class C: + bar = foo + foo = 456 + return foo + f() + ''', m.UndefinedName) + + def test_definedAsStarArgs(self): + """Star and double-star arg names are defined.""" + self.flakes(''' + def f(a, *b, **c): + print(a, b, c) + ''') + + @skipIf(version_info < (3,), 'new in Python 3') + def test_definedAsStarUnpack(self): + """Star names in unpack are defined.""" + self.flakes(''' + a, *b = range(10) + print(a, b) + ''') + self.flakes(''' + *a, b = range(10) + print(a, b) + ''') + self.flakes(''' + a, *b, c = range(10) + print(a, b, c) + ''') + + @skipIf(version_info < (3,), 'new in Python 3') + def test_usedAsStarUnpack(self): + """ + Star names in unpack are used if RHS is not a tuple/list literal. + """ + self.flakes(''' + def f(): + a, *b = range(10) + ''') + self.flakes(''' + def f(): + (*a, b) = range(10) + ''') + self.flakes(''' + def f(): + [a, *b, c] = range(10) + ''') + + @skipIf(version_info < (3,), 'new in Python 3') + def test_unusedAsStarUnpack(self): + """ + Star names in unpack are unused if RHS is a tuple/list literal. + """ + self.flakes(''' + def f(): + a, *b = any, all, 4, 2, 'un' + ''', m.UnusedVariable, m.UnusedVariable) + self.flakes(''' + def f(): + (*a, b) = [bool, int, float, complex] + ''', m.UnusedVariable, m.UnusedVariable) + self.flakes(''' + def f(): + [a, *b, c] = 9, 8, 7, 6, 5, 4 + ''', m.UnusedVariable, m.UnusedVariable, m.UnusedVariable) + + @skipIf(version_info < (3,), 'new in Python 3') + def test_keywordOnlyArgs(self): + """Keyword-only arg names are defined.""" + self.flakes(''' + def f(*, a, b=None): + print(a, b) + ''') + + self.flakes(''' + import default_b + def f(*, a, b=default_b): + print(a, b) + ''') + + @skipIf(version_info < (3,), 'new in Python 3') + def test_keywordOnlyArgsUndefined(self): + """Typo in kwonly name.""" + self.flakes(''' + def f(*, a, b=default_c): + print(a, b) + ''', m.UndefinedName) + + @skipIf(version_info < (3,), 'new in Python 3') + def test_annotationUndefined(self): + """Undefined annotations.""" + self.flakes(''' + from abc import note1, note2, note3, note4, note5 + def func(a: note1, *args: note2, + b: note3=12, **kw: note4) -> note5: pass + ''') + + self.flakes(''' + def func(): + d = e = 42 + def func(a: {1, d}) -> (lambda c: e): pass + ''') + + @skipIf(version_info < (3,), 'new in Python 3') + def test_metaClassUndefined(self): + self.flakes(''' + from abc import ABCMeta + class A(metaclass=ABCMeta): pass + ''') + + def test_definedInGenExp(self): + """ + Using the loop variable of a generator expression results in no + warnings. + """ + self.flakes('(a for a in [1, 2, 3] if a)') + + self.flakes('(b for b in (a for a in [1, 2, 3] if a) if b)') + + def test_undefinedInGenExpNested(self): + """ + The loop variables of generator expressions nested together are + not defined in the other generator. + """ + self.flakes('(b for b in (a for a in [1, 2, 3] if b) if b)', + m.UndefinedName) + + self.flakes('(b for b in (a for a in [1, 2, 3] if a) if a)', + m.UndefinedName) + + def test_undefinedWithErrorHandler(self): + """ + Some compatibility code checks explicitly for NameError. + It should not trigger warnings. + """ + self.flakes(''' + try: + socket_map + except NameError: + socket_map = {} + ''') + self.flakes(''' + try: + _memoryview.contiguous + except (NameError, AttributeError): + raise RuntimeError("Python >= 3.3 is required") + ''') + # If NameError is not explicitly handled, generate a warning + self.flakes(''' + try: + socket_map + except: + socket_map = {} + ''', m.UndefinedName) + self.flakes(''' + try: + socket_map + except Exception: + socket_map = {} + ''', m.UndefinedName) + + def test_definedInClass(self): + """ + Defined name for generator expressions and dict/set comprehension. + """ + self.flakes(''' + class A: + T = range(10) + + Z = (x for x in T) + L = [x for x in T] + B = dict((i, str(i)) for i in T) + ''') + + self.flakes(''' + class A: + T = range(10) + + X = {x for x in T} + Y = {x:x for x in T} + ''') + + def test_definedInClassNested(self): + """Defined name for nested generator expressions in a class.""" + self.flakes(''' + class A: + T = range(10) + + Z = (x for x in (a for a in T)) + ''') + + def test_undefinedInLoop(self): + """ + The loop variable is defined after the expression is computed. + """ + self.flakes(''' + for i in range(i): + print(i) + ''', m.UndefinedName) + self.flakes(''' + [42 for i in range(i)] + ''', m.UndefinedName) + self.flakes(''' + (42 for i in range(i)) + ''', m.UndefinedName) + + def test_definedFromLambdaInDictionaryComprehension(self): + """ + Defined name referenced from a lambda function within a dict/set + comprehension. + """ + self.flakes(''' + {lambda: id(x) for x in range(10)} + ''') + + def test_definedFromLambdaInGenerator(self): + """ + Defined name referenced from a lambda function within a generator + expression. + """ + self.flakes(''' + any(lambda: id(x) for x in range(10)) + ''') + + def test_undefinedFromLambdaInDictionaryComprehension(self): + """ + Undefined name referenced from a lambda function within a dict/set + comprehension. + """ + self.flakes(''' + {lambda: id(y) for x in range(10)} + ''', m.UndefinedName) + + def test_undefinedFromLambdaInComprehension(self): + """ + Undefined name referenced from a lambda function within a generator + expression. + """ + self.flakes(''' + any(lambda: id(y) for x in range(10)) + ''', m.UndefinedName) + + def test_dunderClass(self): + """ + `__class__` is defined in class scope under Python 3, but is not + in Python 2. + """ + code = ''' + class Test(object): + def __init__(self): + print(__class__.__name__) + self.x = 1 + + t = Test() + ''' + if version_info < (3,): + self.flakes(code, m.UndefinedName) + else: + self.flakes(code) + + +class NameTests(TestCase): + """ + Tests for some extra cases of name handling. + """ + def test_impossibleContext(self): + """ + A Name node with an unrecognized context results in a RuntimeError being + raised. + """ + tree = ast.parse("x = 10") + file_tokens = checker.make_tokens("x = 10") + # Make it into something unrecognizable. + tree.body[0].targets[0].ctx = object() + self.assertRaises(RuntimeError, checker.Checker, tree, file_tokens=file_tokens) diff --git a/anaconda_lib/parso/__init__.py b/anaconda_lib/parso/__init__.py index 4b479135..0cceabed 100644 --- a/anaconda_lib/parso/__init__.py +++ b/anaconda_lib/parso/__init__.py @@ -13,7 +13,7 @@ A simple example: >>> import parso ->>> module = parso.parse('hello + 1', version="3.6") +>>> module = parso.parse('hello + 1', version="3.9") >>> expr = module.children[0] >>> expr PythonNode(arith_expr, [, , ]) @@ -43,7 +43,7 @@ from parso.utils import split_lines, python_bytes_to_unicode -__version__ = '0.7.0' +__version__ = '0.8.3' def parse(code=None, **kwargs): diff --git a/anaconda_lib/parso/_compatibility.py b/anaconda_lib/parso/_compatibility.py index a7f8ca8e..58b186fc 100644 --- a/anaconda_lib/parso/_compatibility.py +++ b/anaconda_lib/parso/_compatibility.py @@ -1,69 +1,3 @@ -""" -To ensure compatibility from Python ``2.7`` - ``3.3``, a module has been -created. Clearly there is huge need to use conforming syntax. -""" -import sys import platform -# unicode function -try: - unicode = unicode -except NameError: - unicode = str - is_pypy = platform.python_implementation() == 'PyPy' - - -def use_metaclass(meta, *bases): - """ Create a class with a metaclass. """ - if not bases: - bases = (object,) - return meta("HackClass", bases, {}) - - -try: - encoding = sys.stdout.encoding - if encoding is None: - encoding = 'utf-8' -except AttributeError: - encoding = 'ascii' - - -def u(string): - """Cast to unicode DAMMIT! - Written because Python2 repr always implicitly casts to a string, so we - have to cast back to a unicode (and we know that we always deal with valid - unicode, because we check that in the beginning). - """ - if sys.version_info.major >= 3: - return str(string) - - if not isinstance(string, unicode): - return unicode(str(string), 'UTF-8') - return string - - -try: - # Python 2.7 - FileNotFoundError = FileNotFoundError -except NameError: - # Python 3.3+ - FileNotFoundError = IOError - - -def utf8_repr(func): - """ - ``__repr__`` methods in Python 2 don't allow unicode objects to be - returned. Therefore cast them to utf-8 bytes in this decorator. - """ - def wrapper(self): - result = func(self) - if isinstance(result, unicode): - return result.encode('utf-8') - else: - return result - - if sys.version_info.major >= 3: - return func - else: - return wrapper diff --git a/anaconda_lib/parso/cache.py b/anaconda_lib/parso/cache.py index d81a46e8..5592a9fd 100644 --- a/anaconda_lib/parso/cache.py +++ b/anaconda_lib/parso/cache.py @@ -5,15 +5,11 @@ import gc import shutil import platform -import errno import logging - -try: - import cPickle as pickle -except: - import pickle - -from parso._compatibility import FileNotFoundError +import warnings +import pickle +from pathlib import Path +from typing import Dict, Any LOG = logging.getLogger(__name__) @@ -21,6 +17,13 @@ """ Cached files should survive at least a few minutes. """ + +_CACHED_FILE_MAXIMUM_SURVIVAL = 60 * 60 * 24 * 30 +""" +Maximum time for a cached file to survive if it is not +accessed within. +""" + _CACHED_SIZE_TRIGGER = 600 """ This setting limits the amount of cached files. It's basically a way to start @@ -55,20 +58,19 @@ """ Short name for distinguish Python implementations and versions. -It's like `sys.implementation.cache_tag` but for Python2 -we generate something similar. See: -http://docs.python.org/3/library/sys.html#sys.implementation +It's a bit similar to `sys.implementation.cache_tag`. +See: http://docs.python.org/3/library/sys.html#sys.implementation """ def _get_default_cache_path(): if platform.system().lower() == 'windows': - dir_ = os.path.join(os.getenv('LOCALAPPDATA') or '~', 'Parso', 'Parso') + dir_ = Path(os.getenv('LOCALAPPDATA') or '~', 'Parso', 'Parso') elif platform.system().lower() == 'darwin': - dir_ = os.path.join('~', 'Library', 'Caches', 'Parso') + dir_ = Path('~', 'Library', 'Caches', 'Parso') else: - dir_ = os.path.join(os.getenv('XDG_CACHE_HOME') or '~/.cache', 'parso') - return os.path.expanduser(dir_) + dir_ = Path(os.getenv('XDG_CACHE_HOME') or '~/.cache', 'parso') + return dir_.expanduser() _default_cache_path = _get_default_cache_path() @@ -81,10 +83,24 @@ def _get_default_cache_path(): ``$XDG_CACHE_HOME/parso`` is used instead of the default one. """ -parser_cache = {} +_CACHE_CLEAR_THRESHOLD = 60 * 60 * 24 -class _NodeCacheItem(object): +def _get_cache_clear_lock_path(cache_path=None): + """ + The path where the cache lock is stored. + + Cache lock will prevent continous cache clearing and only allow garbage + collection once a day (can be configured in _CACHE_CLEAR_THRESHOLD). + """ + cache_path = cache_path or _default_cache_path + return cache_path.joinpath("PARSO-CACHE-LOCK") + + +parser_cache: Dict[str, Any] = {} + + +class _NodeCacheItem: def __init__(self, node, lines, change_time=None): self.node = node self.lines = lines @@ -119,16 +135,9 @@ def load_module(hashed_grammar, file_io, cache_path=None): def _load_from_file_system(hashed_grammar, path, p_time, cache_path=None): cache_path = _get_hashed_path(hashed_grammar, path, cache_path=cache_path) try: - try: - if p_time > os.path.getmtime(cache_path): - # Cache is outdated - return None - except OSError as e: - if e.errno == errno.ENOENT: - # In Python 2 instead of an IOError here we get an OSError. - raise FileNotFoundError - else: - raise + if p_time > os.path.getmtime(cache_path): + # Cache is outdated + return None with open(cache_path, 'rb') as f: gc.disable() @@ -160,7 +169,7 @@ def _set_cache_item(hashed_grammar, path, module_cache_item): parser_cache.setdefault(hashed_grammar, {})[path] = module_cache_item -def save_module(hashed_grammar, file_io, module, lines, pickling=True, cache_path=None): +def try_to_save_module(hashed_grammar, file_io, module, lines, pickling=True, cache_path=None): path = file_io.path try: p_time = None if path is None else file_io.get_last_modified() @@ -171,7 +180,18 @@ def save_module(hashed_grammar, file_io, module, lines, pickling=True, cache_pat item = _NodeCacheItem(module, lines, p_time) _set_cache_item(hashed_grammar, path, item) if pickling and path is not None: - _save_to_file_system(hashed_grammar, path, item, cache_path=cache_path) + try: + _save_to_file_system(hashed_grammar, path, item, cache_path=cache_path) + except PermissionError: + # It's not really a big issue if the cache cannot be saved to the + # file system. It's still in RAM in that case. However we should + # still warn the user that this is happening. + warnings.warn( + 'Tried to save a file to %s, but got permission denied.' % path, + Warning + ) + else: + _remove_cache_and_update_lock(cache_path=cache_path) def _save_to_file_system(hashed_grammar, path, item, cache_path=None): @@ -186,17 +206,70 @@ def clear_cache(cache_path=None): parser_cache.clear() +def clear_inactive_cache( + cache_path=None, + inactivity_threshold=_CACHED_FILE_MAXIMUM_SURVIVAL, +): + if cache_path is None: + cache_path = _default_cache_path + if not cache_path.exists(): + return False + for dirname in os.listdir(cache_path): + version_path = cache_path.joinpath(dirname) + if not version_path.is_dir(): + continue + for file in os.scandir(version_path): + if file.stat().st_atime + _CACHED_FILE_MAXIMUM_SURVIVAL <= time.time(): + try: + os.remove(file.path) + except OSError: # silently ignore all failures + continue + else: + return True + + +def _touch(path): + try: + os.utime(path, None) + except FileNotFoundError: + try: + file = open(path, 'a') + file.close() + except (OSError, IOError): # TODO Maybe log this? + return False + return True + + +def _remove_cache_and_update_lock(cache_path=None): + lock_path = _get_cache_clear_lock_path(cache_path=cache_path) + try: + clear_lock_time = os.path.getmtime(lock_path) + except FileNotFoundError: + clear_lock_time = None + if ( + clear_lock_time is None # first time + or clear_lock_time + _CACHE_CLEAR_THRESHOLD <= time.time() + ): + if not _touch(lock_path): + # First make sure that as few as possible other cleanup jobs also + # get started. There is still a race condition but it's probably + # not a big problem. + return False + + clear_inactive_cache(cache_path=cache_path) + + def _get_hashed_path(hashed_grammar, path, cache_path=None): directory = _get_cache_directory_path(cache_path=cache_path) - file_hash = hashlib.sha256(path.encode("utf-8")).hexdigest() + file_hash = hashlib.sha256(str(path).encode("utf-8")).hexdigest() return os.path.join(directory, '%s-%s.pkl' % (hashed_grammar, file_hash)) def _get_cache_directory_path(cache_path=None): if cache_path is None: cache_path = _default_cache_path - directory = os.path.join(cache_path, _VERSION_TAG) - if not os.path.exists(directory): + directory = cache_path.joinpath(_VERSION_TAG) + if not directory.exists(): os.makedirs(directory) return directory diff --git a/anaconda_lib/parso/file_io.py b/anaconda_lib/parso/file_io.py index 94fe08e6..568ce9d4 100644 --- a/anaconda_lib/parso/file_io.py +++ b/anaconda_lib/parso/file_io.py @@ -1,8 +1,12 @@ import os +from pathlib import Path +from typing import Union -class FileIO(object): - def __init__(self, path): +class FileIO: + def __init__(self, path: Union[os.PathLike, str]): + if isinstance(path, str): + path = Path(path) self.path = path def read(self): # Returns bytes/str @@ -18,8 +22,7 @@ def get_last_modified(self): """ try: return os.path.getmtime(self.path) - except OSError: - # Might raise FileNotFoundError, OSError for Python 2 + except FileNotFoundError: return None def __repr__(self): @@ -28,7 +31,7 @@ def __repr__(self): class KnownContentFileIO(FileIO): def __init__(self, path, content): - super(KnownContentFileIO, self).__init__(path) + super().__init__(path) self._content = content def read(self): diff --git a/anaconda_lib/parso/grammar.py b/anaconda_lib/parso/grammar.py index f5d0475e..43b7be94 100644 --- a/anaconda_lib/parso/grammar.py +++ b/anaconda_lib/parso/grammar.py @@ -1,35 +1,42 @@ import hashlib import os +from typing import Generic, TypeVar, Union, Dict, Optional, Any +from pathlib import Path -from parso._compatibility import FileNotFoundError, is_pypy +from parso._compatibility import is_pypy from parso.pgen2 import generate_grammar -from parso.utils import split_lines, python_bytes_to_unicode, parse_version_string +from parso.utils import split_lines, python_bytes_to_unicode, \ + PythonVersionInfo, parse_version_string from parso.python.diff import DiffParser from parso.python.tokenize import tokenize_lines, tokenize from parso.python.token import PythonTokenTypes -from parso.cache import parser_cache, load_module, save_module +from parso.cache import parser_cache, load_module, try_to_save_module from parso.parser import BaseParser from parso.python.parser import Parser as PythonParser from parso.python.errors import ErrorFinderConfig from parso.python import pep8 from parso.file_io import FileIO, KnownContentFileIO -from parso.normalizer import RefactoringNormalizer +from parso.normalizer import RefactoringNormalizer, NormalizerConfig -_loaded_grammars = {} +_loaded_grammars: Dict[str, 'Grammar'] = {} +_NodeT = TypeVar("_NodeT") -class Grammar(object): + +class Grammar(Generic[_NodeT]): """ :py:func:`parso.load_grammar` returns instances of this class. Creating custom none-python grammars by calling this is not supported, yet. + + :param text: A BNF representation of your grammar. """ - #:param text: A BNF representation of your grammar. - _error_normalizer_config = None - _token_namespace = None - _default_normalizer_config = pep8.PEP8NormalizerConfig() + _start_nonterminal: str + _error_normalizer_config: Optional[ErrorFinderConfig] = None + _token_namespace: Any = None + _default_normalizer_config: NormalizerConfig = pep8.PEP8NormalizerConfig() - def __init__(self, text, tokenizer, parser=BaseParser, diff_parser=None): + def __init__(self, text: str, *, tokenizer, parser=BaseParser, diff_parser=None): self._pgen_grammar = generate_grammar( text, token_namespace=self._get_token_namespace() @@ -39,7 +46,16 @@ def __init__(self, text, tokenizer, parser=BaseParser, diff_parser=None): self._diff_parser = diff_parser self._hashed = hashlib.sha256(text.encode("utf-8")).hexdigest() - def parse(self, code=None, **kwargs): + def parse(self, + code: Union[str, bytes] = None, + *, + error_recovery=True, + path: Union[os.PathLike, str] = None, + start_symbol: str = None, + cache=False, + diff_cache=False, + cache_path: Union[os.PathLike, str] = None, + file_io: FileIO = None) -> _NodeT: """ If you want to parse a Python file you want to start here, most likely. @@ -74,22 +90,14 @@ def parse(self, code=None, **kwargs): :return: A subclass of :py:class:`parso.tree.NodeOrLeaf`. Typically a :py:class:`parso.python.tree.Module`. """ - if 'start_pos' in kwargs: - raise TypeError("parse() got an unexpected keyword argument.") - return self._parse(code=code, **kwargs) - - def _parse(self, code=None, error_recovery=True, path=None, - start_symbol=None, cache=False, diff_cache=False, - cache_path=None, file_io=None, start_pos=(1, 0)): - """ - Wanted python3.5 * operator and keyword only arguments. Therefore just - wrap it all. - start_pos here is just a parameter internally used. Might be public - sometime in the future. - """ if code is None and path is None and file_io is None: raise TypeError("Please provide either code or a path.") + if isinstance(path, str): + path = Path(path) + if isinstance(cache_path, str): + cache_path = Path(cache_path) + if start_symbol is None: start_symbol = self._start_nonterminal @@ -98,14 +106,14 @@ def _parse(self, code=None, error_recovery=True, path=None, if file_io is None: if code is None: - file_io = FileIO(path) + file_io = FileIO(path) # type: ignore else: file_io = KnownContentFileIO(path, code) if cache and file_io.path is not None: module_node = load_module(self._hashed, file_io, cache_path=cache_path) if module_node is not None: - return module_node + return module_node # type: ignore if code is None: code = file_io.read() @@ -124,7 +132,7 @@ def _parse(self, code=None, error_recovery=True, path=None, module_node = module_cache_item.node old_lines = module_cache_item.lines if old_lines == lines: - return module_node + return module_node # type: ignore new_node = self._diff_parser( self._pgen_grammar, self._tokenizer, module_node @@ -132,13 +140,13 @@ def _parse(self, code=None, error_recovery=True, path=None, old_lines=old_lines, new_lines=lines ) - save_module(self._hashed, file_io, new_node, lines, - # Never pickle in pypy, it's slow as hell. - pickling=cache and not is_pypy, - cache_path=cache_path) - return new_node + try_to_save_module(self._hashed, file_io, new_node, lines, + # Never pickle in pypy, it's slow as hell. + pickling=cache and not is_pypy, + cache_path=cache_path) + return new_node # type: ignore - tokens = self._tokenizer(lines, start_pos=start_pos) + tokens = self._tokenizer(lines) p = self._parser( self._pgen_grammar, @@ -148,11 +156,11 @@ def _parse(self, code=None, error_recovery=True, path=None, root_node = p.parse(tokens=tokens) if cache or diff_cache: - save_module(self._hashed, file_io, root_node, lines, - # Never pickle in pypy, it's slow as hell. - pickling=cache and not is_pypy, - cache_path=cache_path) - return root_node + try_to_save_module(self._hashed, file_io, root_node, lines, + # Never pickle in pypy, it's slow as hell. + pickling=cache and not is_pypy, + cache_path=cache_path) + return root_node # type: ignore def _get_token_namespace(self): ns = self._token_namespace @@ -206,8 +214,8 @@ class PythonGrammar(Grammar): _token_namespace = PythonTokenTypes _start_nonterminal = 'file_input' - def __init__(self, version_info, bnf_text): - super(PythonGrammar, self).__init__( + def __init__(self, version_info: PythonVersionInfo, bnf_text: str): + super().__init__( bnf_text, tokenizer=self._tokenize_lines, parser=PythonParser, @@ -216,14 +224,14 @@ def __init__(self, version_info, bnf_text): self.version_info = version_info def _tokenize_lines(self, lines, **kwargs): - return tokenize_lines(lines, self.version_info, **kwargs) + return tokenize_lines(lines, version_info=self.version_info, **kwargs) def _tokenize(self, code): # Used by Jedi. - return tokenize(code, self.version_info) + return tokenize(code, version_info=self.version_info) -def load_grammar(**kwargs): +def load_grammar(*, version: str = None, path: str = None): """ Loads a :py:class:`parso.Grammar`. The default version is the current Python version. @@ -231,30 +239,26 @@ def load_grammar(**kwargs): :param str version: A python version string, e.g. ``version='3.8'``. :param str path: A path to a grammar file """ - def load_grammar(language='python', version=None, path=None): - if language == 'python': - version_info = parse_version_string(version) - - file = path or os.path.join( - 'python', - 'grammar%s%s.txt' % (version_info.major, version_info.minor) + version_info = parse_version_string(version) + + file = path or os.path.join( + 'python', + 'grammar%s%s.txt' % (version_info.major, version_info.minor) + ) + + global _loaded_grammars + path = os.path.join(os.path.dirname(__file__), file) + try: + return _loaded_grammars[path] + except KeyError: + try: + with open(path) as f: + bnf_text = f.read() + + grammar = PythonGrammar(version_info, bnf_text) + return _loaded_grammars.setdefault(path, grammar) + except FileNotFoundError: + message = "Python version %s.%s is currently not supported." % ( + version_info.major, version_info.minor ) - - global _loaded_grammars - path = os.path.join(os.path.dirname(__file__), file) - try: - return _loaded_grammars[path] - except KeyError: - try: - with open(path) as f: - bnf_text = f.read() - - grammar = PythonGrammar(version_info, bnf_text) - return _loaded_grammars.setdefault(path, grammar) - except FileNotFoundError: - message = "Python version %s is currently not supported." % version - raise NotImplementedError(message) - else: - raise NotImplementedError("No support for language %s." % language) - - return load_grammar(**kwargs) + raise NotImplementedError(message) diff --git a/anaconda_lib/parso/normalizer.py b/anaconda_lib/parso/normalizer.py index 53193c81..a95f029e 100644 --- a/anaconda_lib/parso/normalizer.py +++ b/anaconda_lib/parso/normalizer.py @@ -1,6 +1,5 @@ from contextlib import contextmanager - -from parso._compatibility import use_metaclass +from typing import Dict, List class _NormalizerMeta(type): @@ -11,9 +10,9 @@ def __new__(cls, name, bases, dct): return new_cls -class Normalizer(use_metaclass(_NormalizerMeta)): - _rule_type_instances = {} - _rule_value_instances = {} +class Normalizer(metaclass=_NormalizerMeta): + _rule_type_instances: Dict[str, List[type]] = {} + _rule_value_instances: Dict[str, List[type]] = {} def __init__(self, grammar, config): self.grammar = grammar @@ -77,7 +76,7 @@ def add_issue(self, node, code, message): return True @classmethod - def register_rule(cls, **kwargs): + def register_rule(cls, *, value=None, values=(), type=None, types=()): """ Use it as a class decorator:: @@ -86,10 +85,6 @@ def register_rule(cls, **kwargs): class MyRule(Rule): error_code = 42 """ - return cls._register_rule(**kwargs) - - @classmethod - def _register_rule(cls, value=None, values=(), type=None, types=()): values = list(values) types = list(types) if value is not None: @@ -110,7 +105,7 @@ def decorator(rule_cls): return decorator -class NormalizerConfig(object): +class NormalizerConfig: normalizer_class = Normalizer def create_normalizer(self, grammar): @@ -120,7 +115,7 @@ def create_normalizer(self, grammar): return self.normalizer_class(grammar, self) -class Issue(object): +class Issue: def __init__(self, node, code, message): self.code = code """ @@ -150,9 +145,9 @@ def __repr__(self): return '<%s: %s>' % (self.__class__.__name__, self.code) -class Rule(object): - code = None - message = None +class Rule: + code: int + message: str def __init__(self, normalizer): self._normalizer = normalizer @@ -163,7 +158,7 @@ def is_issue(self, node): def get_node(self, node): return node - def _get_message(self, message): + def _get_message(self, message, node): if message is None: message = self.message if message is None: @@ -176,7 +171,7 @@ def add_issue(self, node, code=None, message=None): if code is None: raise ValueError("The error code on the class is not set.") - message = self._get_message(message) + message = self._get_message(message, node) self._normalizer.add_issue(node, code, message) @@ -194,10 +189,10 @@ def visit(self, node): try: return self._node_to_str_map[node] except KeyError: - return super(RefactoringNormalizer, self).visit(node) + return super().visit(node) def visit_leaf(self, leaf): try: return self._node_to_str_map[leaf] except KeyError: - return super(RefactoringNormalizer, self).visit_leaf(leaf) + return super().visit_leaf(leaf) diff --git a/anaconda_lib/parso/parser.py b/anaconda_lib/parso/parser.py index 66f5443b..37466435 100644 --- a/anaconda_lib/parso/parser.py +++ b/anaconda_lib/parso/parser.py @@ -23,6 +23,8 @@ complexity of the ``Parser`` (there's another parser sitting inside ``Statement``, which produces ``Array`` and ``Call``). """ +from typing import Dict, Type + from parso import tree from parso.pgen2.generator import ReservedString @@ -71,7 +73,7 @@ def iterate(): return list(iterate()) -class StackNode(object): +class StackNode: def __init__(self, dfa): self.dfa = dfa self.nodes = [] @@ -86,7 +88,7 @@ def __repr__(self): def _token_to_transition(grammar, type_, value): # Map from token to label - if type_.contains_syntax: + if type_.value.contains_syntax: # Check for reserved words (keywords) try: return grammar.reserved_syntax_strings[value] @@ -96,7 +98,7 @@ def _token_to_transition(grammar, type_, value): return type_ -class BaseParser(object): +class BaseParser: """Parser engine. A Parser instance contains state pertaining to the current token @@ -108,11 +110,10 @@ class BaseParser(object): When a syntax error occurs, error_recovery() is called. """ - node_map = {} + node_map: Dict[str, Type[tree.BaseNode]] = {} default_node = tree.Node - leaf_map = { - } + leaf_map: Dict[str, Type[tree.Leaf]] = {} default_leaf = tree.Leaf def __init__(self, pgen_grammar, start_nonterminal='file_input', error_recovery=False): @@ -155,8 +156,6 @@ def convert_node(self, nonterminal, children): node = self.node_map[nonterminal](children) except KeyError: node = self.default_node(nonterminal, children) - for c in children: - c.parent = node return node def convert_leaf(self, type_, value, prefix, start_pos): diff --git a/anaconda_lib/parso/pgen2/generator.py b/anaconda_lib/parso/pgen2/generator.py index 359a94f9..db6e1cb3 100644 --- a/anaconda_lib/parso/pgen2/generator.py +++ b/anaconda_lib/parso/pgen2/generator.py @@ -27,11 +27,14 @@ """ from ast import literal_eval +from typing import TypeVar, Generic, Mapping, Sequence, Set, Union from parso.pgen2.grammar_parser import GrammarParser, NFAState +_TokenTypeT = TypeVar("_TokenTypeT") -class Grammar(object): + +class Grammar(Generic[_TokenTypeT]): """ Once initialized, this class supplies the grammar tables for the parsing engine implemented by parse.py. The parsing engine @@ -41,18 +44,21 @@ class Grammar(object): dfas. """ - def __init__(self, start_nonterminal, rule_to_dfas, reserved_syntax_strings): - self.nonterminal_to_dfas = rule_to_dfas # Dict[str, List[DFAState]] + def __init__(self, + start_nonterminal: str, + rule_to_dfas: Mapping[str, Sequence['DFAState[_TokenTypeT]']], + reserved_syntax_strings: Mapping[str, 'ReservedString']): + self.nonterminal_to_dfas = rule_to_dfas self.reserved_syntax_strings = reserved_syntax_strings self.start_nonterminal = start_nonterminal -class DFAPlan(object): +class DFAPlan: """ Plans are used for the parser to create stack nodes and do the proper DFA state transitions. """ - def __init__(self, next_dfa, dfa_pushes=[]): + def __init__(self, next_dfa: 'DFAState', dfa_pushes: Sequence['DFAState'] = []): self.next_dfa = next_dfa self.dfa_pushes = dfa_pushes @@ -60,7 +66,7 @@ def __repr__(self): return '%s(%s, %s)' % (self.__class__.__name__, self.next_dfa, self.dfa_pushes) -class DFAState(object): +class DFAState(Generic[_TokenTypeT]): """ The DFAState object is the core class for pretty much anything. DFAState are the vertices of an ordered graph while arcs and transitions are the @@ -70,20 +76,21 @@ class DFAState(object): transitions are then calculated to connect the DFA state machines that have different nonterminals. """ - def __init__(self, from_rule, nfa_set, final): + def __init__(self, from_rule: str, nfa_set: Set[NFAState], final: NFAState): assert isinstance(nfa_set, set) assert isinstance(next(iter(nfa_set)), NFAState) assert isinstance(final, NFAState) self.from_rule = from_rule self.nfa_set = nfa_set - self.arcs = {} # map from terminals/nonterminals to DFAState + # map from terminals/nonterminals to DFAState + self.arcs: Mapping[str, DFAState] = {} # In an intermediary step we set these nonterminal arcs (which has the # same structure as arcs). These don't contain terminals anymore. - self.nonterminal_arcs = {} + self.nonterminal_arcs: Mapping[str, DFAState] = {} # Transitions are basically the only thing that the parser is using # with is_final. Everyting else is purely here to create a parser. - self.transitions = {} #: Dict[Union[TokenType, ReservedString], DFAPlan] + self.transitions: Mapping[Union[_TokenTypeT, ReservedString], DFAPlan] = {} self.is_final = final in nfa_set def add_arc(self, next_, label): @@ -111,22 +118,20 @@ def __eq__(self, other): return False return True - __hash__ = None # For Py3 compatibility. - def __repr__(self): return '<%s: %s is_final=%s>' % ( self.__class__.__name__, self.from_rule, self.is_final ) -class ReservedString(object): +class ReservedString: """ Most grammars will have certain keywords and operators that are mentioned in the grammar as strings (e.g. "if") and not token types (e.g. NUMBER). This class basically is the former. """ - def __init__(self, value): + def __init__(self, value: str): self.value = value def __repr__(self): @@ -149,7 +154,6 @@ def _simplify_dfas(dfas): for j in range(i + 1, len(dfas)): state_j = dfas[j] if state_i == state_j: - #print " unify", i, j del dfas[j] for state in dfas: state.unifystate(state_j, state_i) @@ -212,7 +216,8 @@ def _dump_nfa(start, finish): todo = [start] for i, state in enumerate(todo): print(" State", i, state is finish and "(final)" or "") - for label, next_ in state.arcs: + for arc in state.arcs: + label, next_ = arc.nonterminal_or_string, arc.next if next_ in todo: j = todo.index(next_) else: @@ -232,7 +237,7 @@ def _dump_dfas(dfas): print(" %s -> %d" % (nonterminal, dfas.index(next_))) -def generate_grammar(bnf_grammar, token_namespace): +def generate_grammar(bnf_grammar: str, token_namespace) -> Grammar: """ ``bnf_text`` is a grammar in extended BNF (using * for repetition, + for at-least-once repetition, [] for optional parts, | for alternatives and () @@ -244,19 +249,19 @@ def generate_grammar(bnf_grammar, token_namespace): rule_to_dfas = {} start_nonterminal = None for nfa_a, nfa_z in GrammarParser(bnf_grammar).parse(): - #_dump_nfa(a, z) + # _dump_nfa(nfa_a, nfa_z) dfas = _make_dfas(nfa_a, nfa_z) - #_dump_dfas(dfas) + # _dump_dfas(dfas) # oldlen = len(dfas) _simplify_dfas(dfas) # newlen = len(dfas) rule_to_dfas[nfa_a.from_rule] = dfas - #print(nfa_a.from_rule, oldlen, newlen) + # print(nfa_a.from_rule, oldlen, newlen) if start_nonterminal is None: start_nonterminal = nfa_a.from_rule - reserved_strings = {} + reserved_strings: Mapping[str, ReservedString] = {} for nonterminal, dfas in rule_to_dfas.items(): for dfa_state in dfas: for terminal_or_nonterminal, next_dfa in dfa_state.arcs.items(): @@ -271,7 +276,7 @@ def generate_grammar(bnf_grammar, token_namespace): dfa_state.transitions[transition] = DFAPlan(next_dfa) _calculate_tree_traversal(rule_to_dfas) - return Grammar(start_nonterminal, rule_to_dfas, reserved_strings) + return Grammar(start_nonterminal, rule_to_dfas, reserved_strings) # type: ignore def _make_transition(token_namespace, reserved_syntax_strings, label): diff --git a/anaconda_lib/parso/pgen2/grammar_parser.py b/anaconda_lib/parso/pgen2/grammar_parser.py index 0be72096..582efb43 100644 --- a/anaconda_lib/parso/pgen2/grammar_parser.py +++ b/anaconda_lib/parso/pgen2/grammar_parser.py @@ -4,25 +4,49 @@ # Modifications: # Copyright David Halter and Contributors # Modifications are dual-licensed: MIT and PSF. +from typing import Optional, Iterator, Tuple, List from parso.python.tokenize import tokenize from parso.utils import parse_version_string from parso.python.token import PythonTokenTypes -class GrammarParser(): +class NFAArc: + def __init__(self, next_: 'NFAState', nonterminal_or_string: Optional[str]): + self.next: NFAState = next_ + self.nonterminal_or_string: Optional[str] = nonterminal_or_string + + def __repr__(self): + return '<%s: %s>' % (self.__class__.__name__, self.nonterminal_or_string) + + +class NFAState: + def __init__(self, from_rule: str): + self.from_rule: str = from_rule + self.arcs: List[NFAArc] = [] + + def add_arc(self, next_, nonterminal_or_string=None): + assert nonterminal_or_string is None or isinstance(nonterminal_or_string, str) + assert isinstance(next_, NFAState) + self.arcs.append(NFAArc(next_, nonterminal_or_string)) + + def __repr__(self): + return '<%s: from %s>' % (self.__class__.__name__, self.from_rule) + + +class GrammarParser: """ The parser for Python grammar files. """ - def __init__(self, bnf_grammar): + def __init__(self, bnf_grammar: str): self._bnf_grammar = bnf_grammar self.generator = tokenize( bnf_grammar, - version_info=parse_version_string('3.6') + version_info=parse_version_string('3.9') ) self._gettoken() # Initialize lookahead - def parse(self): + def parse(self) -> Iterator[Tuple[NFAState, NFAState]]: # grammar: (NEWLINE | rule)* ENDMARKER while self.type != PythonTokenTypes.ENDMARKER: while self.type == PythonTokenTypes.NEWLINE: @@ -134,26 +158,3 @@ def _raise_error(self, msg, *args): line = self._bnf_grammar.splitlines()[self.begin[0] - 1] raise SyntaxError(msg, ('', self.begin[0], self.begin[1], line)) - - -class NFAArc(object): - def __init__(self, next_, nonterminal_or_string): - self.next = next_ - self.nonterminal_or_string = nonterminal_or_string - - def __repr__(self): - return '<%s: %s>' % (self.__class__.__name__, self.nonterminal_or_string) - - -class NFAState(object): - def __init__(self, from_rule): - self.from_rule = from_rule - self.arcs = [] # List[nonterminal (str), NFAState] - - def add_arc(self, next_, nonterminal_or_string=None): - assert nonterminal_or_string is None or isinstance(nonterminal_or_string, str) - assert isinstance(next_, NFAState) - self.arcs.append(NFAArc(next_, nonterminal_or_string)) - - def __repr__(self): - return '<%s: from %s>' % (self.__class__.__name__, self.from_rule) diff --git a/anaconda_lib/parso/py.typed b/anaconda_lib/parso/py.typed new file mode 100644 index 00000000..e69de29b diff --git a/anaconda_lib/parso/python/diff.py b/anaconda_lib/parso/python/diff.py index 18634136..ba999fa4 100644 --- a/anaconda_lib/parso/python/diff.py +++ b/anaconda_lib/parso/python/diff.py @@ -247,7 +247,7 @@ def _update_positions(nodes, line_offset, last_leaf): _update_positions(children, line_offset, last_leaf) -class DiffParser(object): +class DiffParser: """ An advanced form of parsing a file faster. Unfortunately comes with huge side effects. It changes the given module. @@ -514,7 +514,7 @@ def _diff_tokenize(self, lines, until_line, line_offset=0): yield token -class _NodesTreeNode(object): +class _NodesTreeNode: _ChildrenGroup = namedtuple( '_ChildrenGroup', 'prefix children line_offset last_line_offset_leaf') @@ -589,7 +589,7 @@ def __repr__(self): return '<%s: %s>' % (self.__class__.__name__, self.tree_node) -class _NodesTree(object): +class _NodesTree: def __init__(self, module): self._base_node = _NodesTreeNode(module) self._working_stack = [self._base_node] diff --git a/anaconda_lib/parso/python/errors.py b/anaconda_lib/parso/python/errors.py index eba41819..5da046ab 100644 --- a/anaconda_lib/parso/python/errors.py +++ b/anaconda_lib/parso/python/errors.py @@ -5,7 +5,7 @@ from contextlib import contextmanager from parso.normalizer import Normalizer, NormalizerConfig, Issue, Rule -from parso.python.tree import search_ancestor +from parso.python.tokenize import _get_token_collection _BLOCK_STMTS = ('if_stmt', 'while_stmt', 'for_stmt', 'try_stmt', 'with_stmt') _STAR_EXPR_PARENTS = ('testlist_star_expr', 'testlist_comp', 'exprlist') @@ -13,12 +13,86 @@ _MAX_BLOCK_SIZE = 20 _MAX_INDENT_COUNT = 100 ALLOWED_FUTURES = ( - 'all_feature_names', 'nested_scopes', 'generators', 'division', - 'absolute_import', 'with_statement', 'print_function', 'unicode_literals', + 'nested_scopes', 'generators', 'division', 'absolute_import', + 'with_statement', 'print_function', 'unicode_literals', 'generator_stop', ) _COMP_FOR_TYPES = ('comp_for', 'sync_comp_for') +def _get_rhs_name(node, version): + type_ = node.type + if type_ == "lambdef": + return "lambda" + elif type_ == "atom": + comprehension = _get_comprehension_type(node) + first, second = node.children[:2] + if comprehension is not None: + return comprehension + elif second.type == "dictorsetmaker": + if version < (3, 8): + return "literal" + else: + if second.children[1] == ":" or second.children[0] == "**": + return "dict display" + else: + return "set display" + elif ( + first == "(" + and (second == ")" + or (len(node.children) == 3 and node.children[1].type == "testlist_comp")) + ): + return "tuple" + elif first == "(": + return _get_rhs_name(_remove_parens(node), version=version) + elif first == "[": + return "list" + elif first == "{" and second == "}": + return "dict display" + elif first == "{" and len(node.children) > 2: + return "set display" + elif type_ == "keyword": + if "yield" in node.value: + return "yield expression" + if version < (3, 8): + return "keyword" + else: + return str(node.value) + elif type_ == "operator" and node.value == "...": + return "Ellipsis" + elif type_ == "comparison": + return "comparison" + elif type_ in ("string", "number", "strings"): + return "literal" + elif type_ == "yield_expr": + return "yield expression" + elif type_ == "test": + return "conditional expression" + elif type_ in ("atom_expr", "power"): + if node.children[0] == "await": + return "await expression" + elif node.children[-1].type == "trailer": + trailer = node.children[-1] + if trailer.children[0] == "(": + return "function call" + elif trailer.children[0] == "[": + return "subscript" + elif trailer.children[0] == ".": + return "attribute" + elif ( + ("expr" in type_ and "star_expr" not in type_) # is a substring + or "_test" in type_ + or type_ in ("term", "factor") + ): + return "operator" + elif type_ == "star_expr": + return "starred" + elif type_ == "testlist_star_expr": + return "tuple" + elif type_ == "fstring": + return "f-string expression" + return type_ # shouldn't reach here + + def _iter_stmts(scope): """ Iterates over all statements and splits up simple_stmt. @@ -72,8 +146,20 @@ def _remove_parens(atom): return atom +def _skip_parens_bottom_up(node): + """ + Returns an ancestor node of an expression, skipping all levels of parens + bottom-up. + """ + while node.parent is not None: + node = node.parent + if node.type != 'atom' or node.children[0] != '(': + return node + return None + + def _iter_params(parent_node): - return (n for n in parent_node.children if n.type == 'param') + return (n for n in parent_node.children if n.type == 'param' or n.type == 'operator') def _is_future_import_first(import_from): @@ -99,13 +185,11 @@ def check_expr(child): if child.children[0] == '(': testlist_comp = child.children[1] if testlist_comp.type == 'testlist_comp': - for expr in _iter_definition_exprs_from_lists(testlist_comp): - yield expr + yield from _iter_definition_exprs_from_lists(testlist_comp) return else: # It's a paren that doesn't do anything, like 1 + (1) - for c in check_expr(testlist_comp): - yield c + yield from check_expr(testlist_comp) return elif child.children[0] == '[': yield testlist_comp @@ -114,11 +198,9 @@ def check_expr(child): if exprlist.type in _STAR_EXPR_PARENTS: for child in exprlist.children[::2]: - for c in check_expr(child): # Python 2 sucks - yield c + yield from check_expr(child) else: - for c in check_expr(exprlist): # Python 2 sucks - yield c + yield from check_expr(exprlist) def _get_expr_stmt_definition_exprs(expr_stmt): @@ -136,13 +218,29 @@ def _get_for_stmt_definition_exprs(for_stmt): return list(_iter_definition_exprs_from_lists(exprlist)) -class _Context(object): +def _is_argument_comprehension(argument): + return argument.children[1].type in _COMP_FOR_TYPES + + +def _any_fstring_error(version, node): + if version < (3, 9) or node is None: + return False + if node.type == "error_node": + return any(child.type == "fstring_start" for child in node.children) + elif node.type == "fstring": + return True + else: + return node.search_ancestor("fstring") + + +class _Context: def __init__(self, node, add_syntax_error, parent_context=None): self.node = node self.blocks = [] self.parent_context = parent_context self._used_name_dict = {} self._global_names = [] + self._local_params_names = [] self._nonlocal_names = [] self._nonlocal_names_in_subscopes = [] self._add_syntax_error = add_syntax_error @@ -166,6 +264,10 @@ def add_name(self, name): self._global_names.append(name) elif parent_type == 'nonlocal_stmt': self._nonlocal_names.append(name) + elif parent_type == 'funcdef': + self._local_params_names.extend( + [param.name.value for param in name.parent.get_params()] + ) else: self._used_name_dict.setdefault(name.value, []).append(name) @@ -193,6 +295,8 @@ def finalize(self): nonlocals_not_handled = [] for nonlocal_name in self._nonlocal_names_in_subscopes: search = nonlocal_name.value + if search in self._local_params_names: + continue if search in global_name_strs or self.parent_context is None: message = "no binding for nonlocal '%s' found" % nonlocal_name.value self._add_syntax_error(nonlocal_name, message) @@ -264,7 +368,7 @@ class ErrorFinder(Normalizer): Searches for errors in the syntax tree. """ def __init__(self, *args, **kwargs): - super(ErrorFinder, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) self._error_dict = {} self.version = self.grammar.version_info @@ -288,7 +392,7 @@ def visit(self, node): # might find errors in there that should be ignored, because # the error node itself already shows that there's an issue. return '' - return super(ErrorFinder, self).visit(node) + return super().visit(node) @contextmanager def visit_node(self, node): @@ -333,6 +437,13 @@ def visit_leaf(self, leaf): match = re.match('\\w{,2}("{1,3}|\'{1,3})', leaf.value) if match is None: message = 'invalid syntax' + if ( + self.version >= (3, 9) + and leaf.value in _get_token_collection( + self.version + ).always_break_tokens + ): + message = "f-string: " + message else: if len(match.group(1)) == 1: message = 'EOL while scanning string literal' @@ -346,7 +457,7 @@ def visit_leaf(self, leaf): self.context = self.context.add_context(parent) # The rest is rule based. - return super(ErrorFinder, self).visit_leaf(leaf) + return super().visit_leaf(leaf) def _add_indentation_error(self, spacing, message): self.add_issue(spacing, 903, "IndentationError: " + message) @@ -371,8 +482,8 @@ def finalize(self): class IndentationRule(Rule): code = 903 - def _get_message(self, message): - message = super(IndentationRule, self)._get_message(message) + def _get_message(self, message, node): + message = super()._get_message(message, node) return "IndentationError: " + message @@ -396,21 +507,34 @@ class ErrorFinderConfig(NormalizerConfig): class SyntaxRule(Rule): code = 901 - def _get_message(self, message): - message = super(SyntaxRule, self)._get_message(message) + def _get_message(self, message, node): + message = super()._get_message(message, node) + if ( + "f-string" not in message + and _any_fstring_error(self._normalizer.version, node) + ): + message = "f-string: " + message return "SyntaxError: " + message @ErrorFinder.register_rule(type='error_node') class _InvalidSyntaxRule(SyntaxRule): message = "invalid syntax" + fstring_message = "f-string: invalid syntax" def get_node(self, node): return node.get_next_leaf() def is_issue(self, node): - # Error leafs will be added later as an error. - return node.get_next_leaf().type != 'error_leaf' + error = node.get_next_leaf().type != 'error_leaf' + if ( + error + and _any_fstring_error(self._normalizer.version, node) + ): + self.add_issue(node, message=self.fstring_message) + else: + # Error leafs will be added later as an error. + return error @ErrorFinder.register_rule(value='await') @@ -449,7 +573,11 @@ def is_issue(self, leaf): in_loop = True if block.type == 'try_stmt': last_block = block.children[-3] - if last_block == 'finally' and leaf.start_pos > last_block.start_pos: + if ( + last_block == "finally" + and leaf.start_pos > last_block.start_pos + and self._normalizer.version < (3, 8) + ): self.add_issue(leaf, message=self.message_in_finally) return False # Error already added if not in_loop: @@ -478,9 +606,6 @@ def is_issue(self, leaf): if leaf.value == '__debug__' and leaf.is_definition(): return True - if leaf.value == 'None' and self._normalizer.version < (3, 0) \ - and leaf.is_definition(): - self.add_issue(leaf, message=self.message_none) @ErrorFinder.register_rule(type='string') @@ -490,7 +615,6 @@ class _StringChecks(SyntaxRule): def is_issue(self, leaf): string_prefix = leaf.string_prefix.lower() if 'b' in string_prefix \ - and self._normalizer.version >= (3, 0) \ and any(c for c in leaf.value if ord(c) > 127): # b'ä' return True @@ -498,14 +622,9 @@ def is_issue(self, leaf): if 'r' not in string_prefix: # Raw strings don't need to be checked if they have proper # escaping. - is_bytes = self._normalizer.version < (3, 0) - if 'b' in string_prefix: - is_bytes = True - if 'u' in string_prefix: - is_bytes = False payload = leaf._get_payload() - if is_bytes: + if 'b' in string_prefix: payload = payload.encode('utf-8') func = codecs.escape_decode else: @@ -564,10 +683,6 @@ def is_issue(self, leaf): and any(self._normalizer.context.node.iter_yield_exprs()): if leaf.value == 'return' and leaf.parent.type == 'return_stmt': return True - elif leaf.value == 'yield' \ - and leaf.get_next_leaf() != 'from' \ - and self._normalizer.version == (3, 5): - self.add_issue(self.get_node(leaf), message=self.message_async_yield) @ErrorFinder.register_rule(type='strings') @@ -582,12 +697,10 @@ def _is_bytes_literal(self, string): def is_issue(self, node): first = node.children[0] - # In Python 2 it's allowed to mix bytes and unicode. - if self._normalizer.version >= (3, 0): - first_is_bytes = self._is_bytes_literal(first) - for string in node.children[1:]: - if first_is_bytes != self._is_bytes_literal(string): - return True + first_is_bytes = self._is_bytes_literal(first) + for string in node.children[1:]: + if first_is_bytes != self._is_bytes_literal(string): + return True @ErrorFinder.register_rule(type='import_as_names') @@ -620,77 +733,85 @@ def is_issue(self, node): for from_name, future_name in node.get_paths(): name = future_name.value allowed_futures = list(ALLOWED_FUTURES) - if self._normalizer.version >= (3, 5): - allowed_futures.append('generator_stop') - + if self._normalizer.version >= (3, 7): + allowed_futures.append('annotations') if name == 'braces': self.add_issue(node, message="not a chance") elif name == 'barry_as_FLUFL': m = "Seriously I'm not implementing this :) ~ Dave" self.add_issue(node, message=m) - elif name not in ALLOWED_FUTURES: + elif name not in allowed_futures: message = "future feature %s is not defined" % name self.add_issue(node, message=message) @ErrorFinder.register_rule(type='star_expr') class _StarExprRule(SyntaxRule): - message = "starred assignment target must be in a list or tuple" message_iterable_unpacking = "iterable unpacking cannot be used in comprehension" - message_assignment = "can use starred expression only as assignment target" def is_issue(self, node): - if node.parent.type not in _STAR_EXPR_PARENTS: - return True + def check_delete_starred(node): + while node.parent is not None: + node = node.parent + if node.type == 'del_stmt': + return True + if node.type not in (*_STAR_EXPR_PARENTS, 'atom'): + return False + return False + + if self._normalizer.version >= (3, 9): + ancestor = node.parent + else: + ancestor = _skip_parens_bottom_up(node) + # starred expression not in tuple/list/set + if ancestor.type not in (*_STAR_EXPR_PARENTS, 'dictorsetmaker') \ + and not (ancestor.type == 'atom' and ancestor.children[0] != '('): + self.add_issue(node, message="can't use starred expression here") + return + + if check_delete_starred(node): + if self._normalizer.version >= (3, 9): + self.add_issue(node, message="cannot delete starred") + else: + self.add_issue(node, message="can't use starred expression here") + return + if node.parent.type == 'testlist_comp': # [*[] for a in [1]] if node.parent.children[1].type in _COMP_FOR_TYPES: self.add_issue(node, message=self.message_iterable_unpacking) - if self._normalizer.version <= (3, 4): - n = search_ancestor(node, 'for_stmt', 'expr_stmt') - found_definition = False - if n is not None: - if n.type == 'expr_stmt': - exprs = _get_expr_stmt_definition_exprs(n) - else: - exprs = _get_for_stmt_definition_exprs(n) - if node in exprs: - found_definition = True - - if not found_definition: - self.add_issue(node, message=self.message_assignment) @ErrorFinder.register_rule(types=_STAR_EXPR_PARENTS) class _StarExprParentRule(SyntaxRule): def is_issue(self, node): - if node.parent.type == 'del_stmt': - self.add_issue(node.parent, message="can't use starred expression here") - else: - def is_definition(node, ancestor): - if ancestor is None: - return False + def is_definition(node, ancestor): + if ancestor is None: + return False - type_ = ancestor.type - if type_ == 'trailer': - return False + type_ = ancestor.type + if type_ == 'trailer': + return False - if type_ == 'expr_stmt': - return node.start_pos < ancestor.children[-1].start_pos + if type_ == 'expr_stmt': + return node.start_pos < ancestor.children[-1].start_pos - return is_definition(node, ancestor.parent) + return is_definition(node, ancestor.parent) - if is_definition(node, node.parent): - args = [c for c in node.children if c != ','] - starred = [c for c in args if c.type == 'star_expr'] - if len(starred) > 1: + if is_definition(node, node.parent): + args = [c for c in node.children if c != ','] + starred = [c for c in args if c.type == 'star_expr'] + if len(starred) > 1: + if self._normalizer.version < (3, 9): message = "two starred expressions in assignment" - self.add_issue(starred[1], message=message) - elif starred: - count = args.index(starred[0]) - if count >= 256: - message = "too many expressions in star-unpacking assignment" - self.add_issue(starred[0], message=message) + else: + message = "multiple starred expressions in assignment" + self.add_issue(starred[1], message=message) + elif starred: + count = args.index(starred[0]) + if count >= 256: + message = "too many expressions in star-unpacking assignment" + self.add_issue(starred[0], message=message) @ErrorFinder.register_rule(type='annassign') @@ -734,6 +855,9 @@ def is_issue(self, node): class _ArgumentRule(SyntaxRule): def is_issue(self, node): first = node.children[0] + if self._normalizer.version < (3, 8): + # a((b)=c) is valid in <3.8 + first = _remove_parens(first) if node.children[1] == '=' and first.type != 'name': if first.type == 'lambdef': # f(lambda: 1=1) @@ -749,6 +873,9 @@ def is_issue(self, node): message = 'expression cannot contain assignment, perhaps you meant "=="?' self.add_issue(first, message=message) + if _is_argument_comprehension(node) and node.parent.type == 'classdef': + self.add_issue(node, message='invalid syntax') + @ErrorFinder.register_rule(type='nonlocal_stmt') class _NonlocalModuleLevelRule(SyntaxRule): @@ -768,59 +895,48 @@ def message(self): return "Generator expression must be parenthesized" def is_issue(self, node): - first_arg = node.children[0] - if first_arg.type == 'argument' \ - and first_arg.children[1].type in _COMP_FOR_TYPES: - # e.g. foo(x for x in [], b) - return len(node.children) >= 2 - else: - arg_set = set() - kw_only = False - kw_unpacking_only = False - is_old_starred = False - # In python 3 this would be a bit easier (stars are part of - # argument), but we have to understand both. - for argument in node.children: - if argument == ',': - continue + arg_set = set() + kw_only = False + kw_unpacking_only = False + for argument in node.children: + if argument == ',': + continue - if argument in ('*', '**'): - # Python < 3.5 has the order engraved in the grammar - # file. No need to do anything here. - is_old_starred = True - continue - if is_old_starred: - is_old_starred = False - continue + if argument.type == 'argument': + first = argument.children[0] + if _is_argument_comprehension(argument) and len(node.children) >= 2: + # a(a, b for b in c) + return True - if argument.type == 'argument': - first = argument.children[0] - if first in ('*', '**'): - if first == '*': - if kw_unpacking_only: - # foo(**kwargs, *args) - message = "iterable argument unpacking " \ - "follows keyword argument unpacking" - self.add_issue(argument, message=message) + if first in ('*', '**'): + if first == '*': + if kw_unpacking_only: + # foo(**kwargs, *args) + message = "iterable argument unpacking " \ + "follows keyword argument unpacking" + self.add_issue(argument, message=message) + else: + kw_unpacking_only = True + else: # Is a keyword argument. + kw_only = True + if first.type == 'name': + if first.value in arg_set: + # f(x=1, x=2) + message = "keyword argument repeated" + if self._normalizer.version >= (3, 9): + message += ": {}".format(first.value) + self.add_issue(first, message=message) else: - kw_unpacking_only = True - else: # Is a keyword argument. - kw_only = True - if first.type == 'name': - if first.value in arg_set: - # f(x=1, x=2) - self.add_issue(first, message="keyword argument repeated") - else: - arg_set.add(first.value) - else: - if kw_unpacking_only: - # f(**x, y) - message = "positional argument follows keyword argument unpacking" - self.add_issue(argument, message=message) - elif kw_only: - # f(x=2, y) - message = "positional argument follows keyword argument" - self.add_issue(argument, message=message) + arg_set.add(first.value) + else: + if kw_unpacking_only: + # f(**x, y) + message = "positional argument follows keyword argument unpacking" + self.add_issue(argument, message=message) + elif kw_only: + # f(x=2, y) + message = "positional argument follows keyword argument" + self.add_issue(argument, message=message) @ErrorFinder.register_rule(type='parameters') @@ -832,17 +948,28 @@ class _ParameterRule(SyntaxRule): def is_issue(self, node): param_names = set() default_only = False + star_seen = False for p in _iter_params(node): + if p.type == 'operator': + if p.value == '*': + star_seen = True + default_only = False + continue + if p.name.value in param_names: message = "duplicate argument '%s' in function definition" self.add_issue(p.name, message=message % p.name.value) param_names.add(p.name.value) - if p.default is None and not p.star_count: - if default_only: - return True - else: - default_only = True + if not star_seen: + if p.default is None and not p.star_count: + if default_only: + return True + elif p.star_count: + star_seen = True + default_only = False + else: + default_only = True @ErrorFinder.register_rule(type='try_stmt') @@ -878,7 +1005,11 @@ def _check_fstring_expr(self, fstring_expr, depth): if '\\' in expr.get_code(): self.add_issue(expr, message=self.message_expr) - conversion = fstring_expr.children[2] + children_2 = fstring_expr.children[2] + if children_2.type == 'operator' and children_2.value == '=': + conversion = fstring_expr.children[3] + else: + conversion = children_2 if conversion.type == 'fstring_conversion': name = conversion.children[1] if name.value not in ('s', 'r', 'a'): @@ -898,7 +1029,7 @@ def _check_fstring_contents(self, children, depth=0): class _CheckAssignmentRule(SyntaxRule): - def _check_assignment(self, node, is_deletion=False, is_namedexpr=False): + def _check_assignment(self, node, is_deletion=False, is_namedexpr=False, is_aug_assign=False): error = None type_ = node.type if type_ == 'lambdef': @@ -915,6 +1046,16 @@ def _check_assignment(self, node, is_deletion=False, is_namedexpr=False): error = 'dict display' else: error = 'set display' + elif first == "{" and second == "}": + if self._normalizer.version < (3, 8): + error = 'literal' + else: + error = "dict display" + elif first == "{" and len(node.children) > 2: + if self._normalizer.version < (3, 8): + error = 'literal' + else: + error = "set display" elif first in ('(', '['): if second.type == 'yield_expr': error = 'yield expression' @@ -930,11 +1071,13 @@ def _check_assignment(self, node, is_deletion=False, is_namedexpr=False): # This is not a comprehension, they were handled # further above. for child in second.children[::2]: - self._check_assignment(child, is_deletion, is_namedexpr) + self._check_assignment(child, is_deletion, is_namedexpr, is_aug_assign) else: # Everything handled, must be useless brackets. - self._check_assignment(second, is_deletion, is_namedexpr) + self._check_assignment(second, is_deletion, is_namedexpr, is_aug_assign) elif type_ == 'keyword': - if self._normalizer.version < (3, 8): + if node.value == "yield": + error = "yield expression" + elif self._normalizer.version < (3, 8): error = 'keyword' else: error = str(node.value) @@ -966,13 +1109,35 @@ def _check_assignment(self, node, is_deletion=False, is_namedexpr=False): error = 'subscript' elif is_namedexpr and trailer.children[0] == '.': error = 'attribute' + elif type_ == "fstring": + if self._normalizer.version < (3, 8): + error = 'literal' + else: + error = "f-string expression" elif type_ in ('testlist_star_expr', 'exprlist', 'testlist'): for child in node.children[::2]: - self._check_assignment(child, is_deletion, is_namedexpr) + self._check_assignment(child, is_deletion, is_namedexpr, is_aug_assign) elif ('expr' in type_ and type_ != 'star_expr' # is a substring or '_test' in type_ or type_ in ('term', 'factor')): error = 'operator' + elif type_ == "star_expr": + if is_deletion: + if self._normalizer.version >= (3, 9): + error = "starred" + else: + self.add_issue(node, message="can't use starred expression here") + else: + if self._normalizer.version >= (3, 9): + ancestor = node.parent + else: + ancestor = _skip_parens_bottom_up(node) + if ancestor.type not in _STAR_EXPR_PARENTS and not is_aug_assign \ + and not (ancestor.type == 'atom' and ancestor.children[0] == '['): + message = "starred assignment target must be in a list or tuple" + self.add_issue(node, message=message) + + self._check_assignment(node.children[1]) if error is not None: if is_namedexpr: @@ -999,14 +1164,36 @@ def is_issue(self, node): @ErrorFinder.register_rule(type='expr_stmt') class _ExprStmtRule(_CheckAssignmentRule): message = "illegal expression for augmented assignment" + extended_message = "'{target}' is an " + message def is_issue(self, node): - for before_equal in node.children[:-2:2]: - self._check_assignment(before_equal) - augassign = node.children[1] - if augassign != '=' and augassign.type != 'annassign': # Is augassign. - return node.children[0].type in ('testlist_star_expr', 'atom', 'testlist') + is_aug_assign = augassign != '=' and augassign.type != 'annassign' + + if self._normalizer.version <= (3, 8) or not is_aug_assign: + for before_equal in node.children[:-2:2]: + self._check_assignment(before_equal, is_aug_assign=is_aug_assign) + + if is_aug_assign: + target = _remove_parens(node.children[0]) + # a, a[b], a.b + + if target.type == "name" or ( + target.type in ("atom_expr", "power") + and target.children[1].type == "trailer" + and target.children[-1].children[0] != "(" + ): + return False + + if self._normalizer.version <= (3, 8): + return True + else: + self.add_issue( + node, + message=self.extended_message.format( + target=_get_rhs_name(node.children[0], self._normalizer.version) + ), + ) @ErrorFinder.register_rule(type='with_item') @@ -1077,7 +1264,7 @@ def process_comp_for(comp_for): def search_all_comp_ancestors(node): has_ancestors = False while True: - node = search_ancestor(node, 'testlist_comp', 'dictorsetmaker') + node = node.search_ancestor('testlist_comp', 'dictorsetmaker') if node is None: break for child in node.children: diff --git a/anaconda_lib/parso/python/grammar27.txt b/anaconda_lib/parso/python/grammar27.txt deleted file mode 100644 index 29f1b827..00000000 --- a/anaconda_lib/parso/python/grammar27.txt +++ /dev/null @@ -1,143 +0,0 @@ -# Grammar for Python - -# Note: Changing the grammar specified in this file will most likely -# require corresponding changes in the parser module -# (../Modules/parsermodule.c). If you can't make the changes to -# that module yourself, please co-ordinate the required changes -# with someone who can; ask around on python-dev for help. Fred -# Drake will probably be listening there. - -# NOTE WELL: You should also follow all the steps listed in PEP 306, -# "How to Change Python's Grammar" - -# Start symbols for the grammar: -# single_input is a single interactive statement; -# file_input is a module or sequence of commands read from an input file; -# eval_input is the input for the eval() and input() functions. -# NB: compound_stmt in single_input is followed by extra NEWLINE! -single_input: NEWLINE | simple_stmt | compound_stmt NEWLINE -file_input: stmt* ENDMARKER -eval_input: testlist NEWLINE* ENDMARKER - -decorator: '@' dotted_name [ '(' [arglist] ')' ] NEWLINE -decorators: decorator+ -decorated: decorators (classdef | funcdef) -funcdef: 'def' NAME parameters ':' suite -parameters: '(' [varargslist] ')' -varargslist: ((fpdef ['=' test] ',')* - ('*' NAME [',' '**' NAME] | '**' NAME) | - fpdef ['=' test] (',' fpdef ['=' test])* [',']) -fpdef: NAME | '(' fplist ')' -fplist: fpdef (',' fpdef)* [','] - -stmt: simple_stmt | compound_stmt | NEWLINE -simple_stmt: small_stmt (';' small_stmt)* [';'] NEWLINE -small_stmt: (expr_stmt | print_stmt | del_stmt | pass_stmt | flow_stmt | - import_stmt | global_stmt | exec_stmt | assert_stmt) -expr_stmt: testlist (augassign (yield_expr|testlist) | - ('=' (yield_expr|testlist))*) -augassign: ('+=' | '-=' | '*=' | '/=' | '%=' | '&=' | '|=' | '^=' | - '<<=' | '>>=' | '**=' | '//=') -# For normal assignments, additional restrictions enforced by the interpreter -print_stmt: 'print' ( [ test (',' test)* [','] ] | - '>>' test [ (',' test)+ [','] ] ) -del_stmt: 'del' exprlist -pass_stmt: 'pass' -flow_stmt: break_stmt | continue_stmt | return_stmt | raise_stmt | yield_stmt -break_stmt: 'break' -continue_stmt: 'continue' -return_stmt: 'return' [testlist] -yield_stmt: yield_expr -raise_stmt: 'raise' [test [',' test [',' test]]] -import_stmt: import_name | import_from -import_name: 'import' dotted_as_names -import_from: ('from' ('.'* dotted_name | '.'+) - 'import' ('*' | '(' import_as_names ')' | import_as_names)) -import_as_name: NAME ['as' NAME] -dotted_as_name: dotted_name ['as' NAME] -import_as_names: import_as_name (',' import_as_name)* [','] -dotted_as_names: dotted_as_name (',' dotted_as_name)* -dotted_name: NAME ('.' NAME)* -global_stmt: 'global' NAME (',' NAME)* -exec_stmt: 'exec' expr ['in' test [',' test]] -assert_stmt: 'assert' test [',' test] - -compound_stmt: if_stmt | while_stmt | for_stmt | try_stmt | with_stmt | funcdef | classdef | decorated -if_stmt: 'if' test ':' suite ('elif' test ':' suite)* ['else' ':' suite] -while_stmt: 'while' test ':' suite ['else' ':' suite] -for_stmt: 'for' exprlist 'in' testlist ':' suite ['else' ':' suite] -try_stmt: ('try' ':' suite - ((except_clause ':' suite)+ - ['else' ':' suite] - ['finally' ':' suite] | - 'finally' ':' suite)) -with_stmt: 'with' with_item (',' with_item)* ':' suite -with_item: test ['as' expr] -# NB compile.c makes sure that the default except clause is last -except_clause: 'except' [test [('as' | ',') test]] -suite: simple_stmt | NEWLINE INDENT stmt+ DEDENT - -# Backward compatibility cruft to support: -# [ x for x in lambda: True, lambda: False if x() ] -# even while also allowing: -# lambda x: 5 if x else 2 -# (But not a mix of the two) -testlist_safe: old_test [(',' old_test)+ [',']] -old_test: or_test | old_lambdef -old_lambdef: 'lambda' [varargslist] ':' old_test - -test: or_test ['if' or_test 'else' test] | lambdef -or_test: and_test ('or' and_test)* -and_test: not_test ('and' not_test)* -not_test: 'not' not_test | comparison -comparison: expr (comp_op expr)* -comp_op: '<'|'>'|'=='|'>='|'<='|'<>'|'!='|'in'|'not' 'in'|'is'|'is' 'not' -expr: xor_expr ('|' xor_expr)* -xor_expr: and_expr ('^' and_expr)* -and_expr: shift_expr ('&' shift_expr)* -shift_expr: arith_expr (('<<'|'>>') arith_expr)* -arith_expr: term (('+'|'-') term)* -term: factor (('*'|'/'|'%'|'//') factor)* -factor: ('+'|'-'|'~') factor | power -power: atom trailer* ['**' factor] -atom: ('(' [yield_expr|testlist_comp] ')' | - '[' [listmaker] ']' | - '{' [dictorsetmaker] '}' | - '`' testlist1 '`' | - NAME | NUMBER | strings) -strings: STRING+ -listmaker: test ( list_for | (',' test)* [','] ) -testlist_comp: test ( sync_comp_for | (',' test)* [','] ) -lambdef: 'lambda' [varargslist] ':' test -trailer: '(' [arglist] ')' | '[' subscriptlist ']' | '.' NAME -subscriptlist: subscript (',' subscript)* [','] -subscript: '.' '.' '.' | test | [test] ':' [test] [sliceop] -sliceop: ':' [test] -exprlist: expr (',' expr)* [','] -testlist: test (',' test)* [','] -dictorsetmaker: ( (test ':' test (sync_comp_for | (',' test ':' test)* [','])) | - (test (sync_comp_for | (',' test)* [','])) ) - -classdef: 'class' NAME ['(' [testlist] ')'] ':' suite - -arglist: (argument ',')* (argument [','] - |'*' test (',' argument)* [',' '**' test] - |'**' test) -# The reason that keywords are test nodes instead of NAME is that using NAME -# results in an ambiguity. ast.c makes sure it's a NAME. -argument: test [sync_comp_for] | test '=' test - -list_iter: list_for | list_if -list_for: 'for' exprlist 'in' testlist_safe [list_iter] -list_if: 'if' old_test [list_iter] - -comp_iter: sync_comp_for | comp_if -sync_comp_for: 'for' exprlist 'in' or_test [comp_iter] -comp_if: 'if' old_test [comp_iter] - -testlist1: test (',' test)* - -# not used in grammar, but may appear in "node" passed from Parser to Compiler -encoding_decl: NAME - -yield_expr: 'yield' [testlist] diff --git a/anaconda_lib/parso/python/grammar35.txt b/anaconda_lib/parso/python/grammar310.txt similarity index 66% rename from anaconda_lib/parso/python/grammar35.txt rename to anaconda_lib/parso/python/grammar310.txt index 29f49e4f..f092050d 100644 --- a/anaconda_lib/parso/python/grammar35.txt +++ b/anaconda_lib/parso/python/grammar310.txt @@ -1,14 +1,7 @@ # Grammar for Python -# Note: Changing the grammar specified in this file will most likely -# require corresponding changes in the parser module -# (../Modules/parsermodule.c). If you can't make the changes to -# that module yourself, please co-ordinate the required changes -# with someone who can; ask around on python-dev for help. Fred -# Drake will probably be listening there. - # NOTE WELL: You should also follow all the steps listed at -# https://docs.python.org/devguide/grammar.html +# https://devguide.python.org/grammar/ # Start symbols for the grammar: # single_input is a single interactive statement; @@ -19,41 +12,57 @@ single_input: NEWLINE | simple_stmt | compound_stmt NEWLINE file_input: stmt* ENDMARKER eval_input: testlist NEWLINE* ENDMARKER -decorator: '@' dotted_name [ '(' [arglist] ')' ] NEWLINE +decorator: '@' namedexpr_test NEWLINE decorators: decorator+ decorated: decorators (classdef | funcdef | async_funcdef) -# NOTE: Reinoud Elhorst, using ASYNC/AWAIT keywords instead of tokens -# skipping python3.5 compatibility, in favour of 3.7 solution async_funcdef: 'async' funcdef funcdef: 'def' NAME parameters ['->' test] ':' suite parameters: '(' [typedargslist] ')' -typedargslist: (tfpdef ['=' test] (',' tfpdef ['=' test])* [',' - ['*' [tfpdef] (',' tfpdef ['=' test])* [',' '**' tfpdef] | '**' tfpdef]] - | '*' [tfpdef] (',' tfpdef ['=' test])* [',' '**' tfpdef] | '**' tfpdef) +typedargslist: ( + (tfpdef ['=' test] (',' tfpdef ['=' test])* ',' '/' [',' [ tfpdef ['=' test] ( + ',' tfpdef ['=' test])* ([',' [ + '*' [tfpdef] (',' tfpdef ['=' test])* [',' ['**' tfpdef [',']]] + | '**' tfpdef [',']]]) + | '*' [tfpdef] (',' tfpdef ['=' test])* ([',' ['**' tfpdef [',']]]) + | '**' tfpdef [',']]] ) +| (tfpdef ['=' test] (',' tfpdef ['=' test])* [',' [ + '*' [tfpdef] (',' tfpdef ['=' test])* [',' ['**' tfpdef [',']]] + | '**' tfpdef [',']]] + | '*' [tfpdef] (',' tfpdef ['=' test])* [',' ['**' tfpdef [',']]] + | '**' tfpdef [',']) +) tfpdef: NAME [':' test] -varargslist: (vfpdef ['=' test] (',' vfpdef ['=' test])* [',' - ['*' [vfpdef] (',' vfpdef ['=' test])* [',' '**' vfpdef] | '**' vfpdef]] - | '*' [vfpdef] (',' vfpdef ['=' test])* [',' '**' vfpdef] | '**' vfpdef) +varargslist: vfpdef ['=' test ](',' vfpdef ['=' test])* ',' '/' [',' [ (vfpdef ['=' test] (',' vfpdef ['=' test])* [',' [ + '*' [vfpdef] (',' vfpdef ['=' test])* [',' ['**' vfpdef [',']]] + | '**' vfpdef [',']]] + | '*' [vfpdef] (',' vfpdef ['=' test])* [',' ['**' vfpdef [',']]] + | '**' vfpdef [',']) ]] | (vfpdef ['=' test] (',' vfpdef ['=' test])* [',' [ + '*' [vfpdef] (',' vfpdef ['=' test])* [',' ['**' vfpdef [',']]] + | '**' vfpdef [',']]] + | '*' [vfpdef] (',' vfpdef ['=' test])* [',' ['**' vfpdef [',']]] + | '**' vfpdef [','] +) vfpdef: NAME stmt: simple_stmt | compound_stmt | NEWLINE simple_stmt: small_stmt (';' small_stmt)* [';'] NEWLINE small_stmt: (expr_stmt | del_stmt | pass_stmt | flow_stmt | import_stmt | global_stmt | nonlocal_stmt | assert_stmt) -expr_stmt: testlist_star_expr (augassign (yield_expr|testlist) | +expr_stmt: testlist_star_expr (annassign | augassign (yield_expr|testlist) | ('=' (yield_expr|testlist_star_expr))*) +annassign: ':' test ['=' (yield_expr|testlist_star_expr)] testlist_star_expr: (test|star_expr) (',' (test|star_expr))* [','] augassign: ('+=' | '-=' | '*=' | '@=' | '/=' | '%=' | '&=' | '|=' | '^=' | '<<=' | '>>=' | '**=' | '//=') -# For normal assignments, additional restrictions enforced by the interpreter +# For normal and annotated assignments, additional restrictions enforced by the interpreter del_stmt: 'del' exprlist pass_stmt: 'pass' flow_stmt: break_stmt | continue_stmt | return_stmt | raise_stmt | yield_stmt break_stmt: 'break' continue_stmt: 'continue' -return_stmt: 'return' [testlist] +return_stmt: 'return' [testlist_star_expr] yield_stmt: yield_expr raise_stmt: 'raise' [test ['from' test]] import_stmt: import_name | import_from @@ -72,8 +81,8 @@ assert_stmt: 'assert' test [',' test] compound_stmt: if_stmt | while_stmt | for_stmt | try_stmt | with_stmt | funcdef | classdef | decorated | async_stmt async_stmt: 'async' (funcdef | with_stmt | for_stmt) -if_stmt: 'if' test ':' suite ('elif' test ':' suite)* ['else' ':' suite] -while_stmt: 'while' test ':' suite ['else' ':' suite] +if_stmt: 'if' namedexpr_test ':' suite ('elif' namedexpr_test ':' suite)* ['else' ':' suite] +while_stmt: 'while' namedexpr_test ':' suite ['else' ':' suite] for_stmt: 'for' exprlist 'in' testlist ':' suite ['else' ':' suite] try_stmt: ('try' ':' suite ((except_clause ':' suite)+ @@ -86,10 +95,9 @@ with_item: test ['as' expr] except_clause: 'except' [test ['as' NAME]] suite: simple_stmt | NEWLINE INDENT stmt+ DEDENT +namedexpr_test: test [':=' test] test: or_test ['if' or_test 'else' test] | lambdef -test_nocond: or_test | lambdef_nocond lambdef: 'lambda' [varargslist] ':' test -lambdef_nocond: 'lambda' [varargslist] ':' test_nocond or_test: and_test ('or' and_test)* and_test: not_test ('and' not_test)* not_test: 'not' not_test | comparison @@ -111,18 +119,17 @@ atom: ('(' [yield_expr|testlist_comp] ')' | '[' [testlist_comp] ']' | '{' [dictorsetmaker] '}' | NAME | NUMBER | strings | '...' | 'None' | 'True' | 'False') -strings: STRING+ -testlist_comp: (test|star_expr) ( sync_comp_for | (',' (test|star_expr))* [','] ) +testlist_comp: (namedexpr_test|star_expr) ( comp_for | (',' (namedexpr_test|star_expr))* [','] ) trailer: '(' [arglist] ')' | '[' subscriptlist ']' | '.' NAME subscriptlist: subscript (',' subscript)* [','] -subscript: test | [test] ':' [test] [sliceop] +subscript: test [':=' test] | [test] ':' [test] [sliceop] sliceop: ':' [test] exprlist: (expr|star_expr) (',' (expr|star_expr))* [','] testlist: test (',' test)* [','] dictorsetmaker: ( ((test ':' test | '**' expr) - (sync_comp_for | (',' (test ':' test | '**' expr))* [','])) | - ((test | star_expr) - (sync_comp_for | (',' (test | star_expr))* [','])) ) + (comp_for | (',' (test ':' test | '**' expr))* [','])) | + ((test [':=' test] | star_expr) + (comp_for | (',' (test [':=' test] | star_expr))* [','])) ) classdef: 'class' NAME ['(' [arglist] ')'] ':' suite @@ -137,17 +144,26 @@ arglist: argument (',' argument)* [','] # Illegal combinations and orderings are blocked in ast.c: # multiple (test comp_for) arguments are blocked; keyword unpackings # that precede iterable unpackings are blocked; etc. -argument: ( test [sync_comp_for] | +argument: ( test [comp_for] | + test ':=' test | test '=' test | '**' test | '*' test ) -comp_iter: sync_comp_for | comp_if +comp_iter: comp_for | comp_if sync_comp_for: 'for' exprlist 'in' or_test [comp_iter] -comp_if: 'if' test_nocond [comp_iter] +comp_for: ['async'] sync_comp_for +comp_if: 'if' or_test [comp_iter] # not used in grammar, but may appear in "node" passed from Parser to Compiler encoding_decl: NAME yield_expr: 'yield' [yield_arg] -yield_arg: 'from' test | testlist +yield_arg: 'from' test | testlist_star_expr + +strings: (STRING | fstring)+ +fstring: FSTRING_START fstring_content* FSTRING_END +fstring_content: FSTRING_STRING | fstring_expr +fstring_conversion: '!' NAME +fstring_expr: '{' (testlist_comp | yield_expr) ['='] [ fstring_conversion ] [ fstring_format_spec ] '}' +fstring_format_spec: ':' fstring_content* diff --git a/anaconda_lib/parso/python/grammar34.txt b/anaconda_lib/parso/python/grammar311.txt similarity index 51% rename from anaconda_lib/parso/python/grammar34.txt rename to anaconda_lib/parso/python/grammar311.txt index 999f4cd1..f092050d 100644 --- a/anaconda_lib/parso/python/grammar34.txt +++ b/anaconda_lib/parso/python/grammar311.txt @@ -1,14 +1,7 @@ # Grammar for Python -# Note: Changing the grammar specified in this file will most likely -# require corresponding changes in the parser module -# (../Modules/parsermodule.c). If you can't make the changes to -# that module yourself, please co-ordinate the required changes -# with someone who can; ask around on python-dev for help. Fred -# Drake will probably be listening there. - # NOTE WELL: You should also follow all the steps listed at -# https://docs.python.org/devguide/grammar.html +# https://devguide.python.org/grammar/ # Start symbols for the grammar: # single_input is a single interactive statement; @@ -19,36 +12,57 @@ single_input: NEWLINE | simple_stmt | compound_stmt NEWLINE file_input: stmt* ENDMARKER eval_input: testlist NEWLINE* ENDMARKER -decorator: '@' dotted_name [ '(' [arglist] ')' ] NEWLINE +decorator: '@' namedexpr_test NEWLINE decorators: decorator+ -decorated: decorators (classdef | funcdef) +decorated: decorators (classdef | funcdef | async_funcdef) + +async_funcdef: 'async' funcdef funcdef: 'def' NAME parameters ['->' test] ':' suite + parameters: '(' [typedargslist] ')' -typedargslist: (tfpdef ['=' test] (',' tfpdef ['=' test])* [',' - ['*' [tfpdef] (',' tfpdef ['=' test])* [',' '**' tfpdef] | '**' tfpdef]] - | '*' [tfpdef] (',' tfpdef ['=' test])* [',' '**' tfpdef] | '**' tfpdef) +typedargslist: ( + (tfpdef ['=' test] (',' tfpdef ['=' test])* ',' '/' [',' [ tfpdef ['=' test] ( + ',' tfpdef ['=' test])* ([',' [ + '*' [tfpdef] (',' tfpdef ['=' test])* [',' ['**' tfpdef [',']]] + | '**' tfpdef [',']]]) + | '*' [tfpdef] (',' tfpdef ['=' test])* ([',' ['**' tfpdef [',']]]) + | '**' tfpdef [',']]] ) +| (tfpdef ['=' test] (',' tfpdef ['=' test])* [',' [ + '*' [tfpdef] (',' tfpdef ['=' test])* [',' ['**' tfpdef [',']]] + | '**' tfpdef [',']]] + | '*' [tfpdef] (',' tfpdef ['=' test])* [',' ['**' tfpdef [',']]] + | '**' tfpdef [',']) +) tfpdef: NAME [':' test] -varargslist: (vfpdef ['=' test] (',' vfpdef ['=' test])* [',' - ['*' [vfpdef] (',' vfpdef ['=' test])* [',' '**' vfpdef] | '**' vfpdef]] - | '*' [vfpdef] (',' vfpdef ['=' test])* [',' '**' vfpdef] | '**' vfpdef) +varargslist: vfpdef ['=' test ](',' vfpdef ['=' test])* ',' '/' [',' [ (vfpdef ['=' test] (',' vfpdef ['=' test])* [',' [ + '*' [vfpdef] (',' vfpdef ['=' test])* [',' ['**' vfpdef [',']]] + | '**' vfpdef [',']]] + | '*' [vfpdef] (',' vfpdef ['=' test])* [',' ['**' vfpdef [',']]] + | '**' vfpdef [',']) ]] | (vfpdef ['=' test] (',' vfpdef ['=' test])* [',' [ + '*' [vfpdef] (',' vfpdef ['=' test])* [',' ['**' vfpdef [',']]] + | '**' vfpdef [',']]] + | '*' [vfpdef] (',' vfpdef ['=' test])* [',' ['**' vfpdef [',']]] + | '**' vfpdef [','] +) vfpdef: NAME stmt: simple_stmt | compound_stmt | NEWLINE simple_stmt: small_stmt (';' small_stmt)* [';'] NEWLINE small_stmt: (expr_stmt | del_stmt | pass_stmt | flow_stmt | import_stmt | global_stmt | nonlocal_stmt | assert_stmt) -expr_stmt: testlist_star_expr (augassign (yield_expr|testlist) | +expr_stmt: testlist_star_expr (annassign | augassign (yield_expr|testlist) | ('=' (yield_expr|testlist_star_expr))*) +annassign: ':' test ['=' (yield_expr|testlist_star_expr)] testlist_star_expr: (test|star_expr) (',' (test|star_expr))* [','] -augassign: ('+=' | '-=' | '*=' | '/=' | '%=' | '&=' | '|=' | '^=' | +augassign: ('+=' | '-=' | '*=' | '@=' | '/=' | '%=' | '&=' | '|=' | '^=' | '<<=' | '>>=' | '**=' | '//=') -# For normal assignments, additional restrictions enforced by the interpreter +# For normal and annotated assignments, additional restrictions enforced by the interpreter del_stmt: 'del' exprlist pass_stmt: 'pass' flow_stmt: break_stmt | continue_stmt | return_stmt | raise_stmt | yield_stmt break_stmt: 'break' continue_stmt: 'continue' -return_stmt: 'return' [testlist] +return_stmt: 'return' [testlist_star_expr] yield_stmt: yield_expr raise_stmt: 'raise' [test ['from' test]] import_stmt: import_name | import_from @@ -65,9 +79,10 @@ global_stmt: 'global' NAME (',' NAME)* nonlocal_stmt: 'nonlocal' NAME (',' NAME)* assert_stmt: 'assert' test [',' test] -compound_stmt: if_stmt | while_stmt | for_stmt | try_stmt | with_stmt | funcdef | classdef | decorated -if_stmt: 'if' test ':' suite ('elif' test ':' suite)* ['else' ':' suite] -while_stmt: 'while' test ':' suite ['else' ':' suite] +compound_stmt: if_stmt | while_stmt | for_stmt | try_stmt | with_stmt | funcdef | classdef | decorated | async_stmt +async_stmt: 'async' (funcdef | with_stmt | for_stmt) +if_stmt: 'if' namedexpr_test ':' suite ('elif' namedexpr_test ':' suite)* ['else' ':' suite] +while_stmt: 'while' namedexpr_test ':' suite ['else' ':' suite] for_stmt: 'for' exprlist 'in' testlist ':' suite ['else' ':' suite] try_stmt: ('try' ':' suite ((except_clause ':' suite)+ @@ -80,16 +95,15 @@ with_item: test ['as' expr] except_clause: 'except' [test ['as' NAME]] suite: simple_stmt | NEWLINE INDENT stmt+ DEDENT +namedexpr_test: test [':=' test] test: or_test ['if' or_test 'else' test] | lambdef -test_nocond: or_test | lambdef_nocond lambdef: 'lambda' [varargslist] ':' test -lambdef_nocond: 'lambda' [varargslist] ':' test_nocond or_test: and_test ('or' and_test)* and_test: not_test ('and' not_test)* not_test: 'not' not_test | comparison comparison: expr (comp_op expr)* # <> isn't actually a valid comparison operator in Python. It's here for the -# sake of a __future__ import described in PEP 401 +# sake of a __future__ import described in PEP 401 (which really works :-) comp_op: '<'|'>'|'=='|'>='|'<='|'<>'|'!='|'in'|'not' 'in'|'is'|'is' 'not' star_expr: '*' expr expr: xor_expr ('|' xor_expr)* @@ -97,38 +111,59 @@ xor_expr: and_expr ('^' and_expr)* and_expr: shift_expr ('&' shift_expr)* shift_expr: arith_expr (('<<'|'>>') arith_expr)* arith_expr: term (('+'|'-') term)* -term: factor (('*'|'/'|'%'|'//') factor)* +term: factor (('*'|'@'|'/'|'%'|'//') factor)* factor: ('+'|'-'|'~') factor | power -power: atom trailer* ['**' factor] +power: atom_expr ['**' factor] +atom_expr: ['await'] atom trailer* atom: ('(' [yield_expr|testlist_comp] ')' | '[' [testlist_comp] ']' | '{' [dictorsetmaker] '}' | NAME | NUMBER | strings | '...' | 'None' | 'True' | 'False') -strings: STRING+ -testlist_comp: (test|star_expr) ( sync_comp_for | (',' (test|star_expr))* [','] ) +testlist_comp: (namedexpr_test|star_expr) ( comp_for | (',' (namedexpr_test|star_expr))* [','] ) trailer: '(' [arglist] ')' | '[' subscriptlist ']' | '.' NAME subscriptlist: subscript (',' subscript)* [','] -subscript: test | [test] ':' [test] [sliceop] +subscript: test [':=' test] | [test] ':' [test] [sliceop] sliceop: ':' [test] exprlist: (expr|star_expr) (',' (expr|star_expr))* [','] testlist: test (',' test)* [','] -dictorsetmaker: ( (test ':' test (sync_comp_for | (',' test ':' test)* [','])) | - (test (sync_comp_for | (',' test)* [','])) ) +dictorsetmaker: ( ((test ':' test | '**' expr) + (comp_for | (',' (test ':' test | '**' expr))* [','])) | + ((test [':=' test] | star_expr) + (comp_for | (',' (test [':=' test] | star_expr))* [','])) ) classdef: 'class' NAME ['(' [arglist] ')'] ':' suite -arglist: (argument ',')* (argument [','] - |'*' test (',' argument)* [',' '**' test] - |'**' test) +arglist: argument (',' argument)* [','] + # The reason that keywords are test nodes instead of NAME is that using NAME # results in an ambiguity. ast.c makes sure it's a NAME. -argument: test [sync_comp_for] | test '=' test # Really [keyword '='] test -comp_iter: sync_comp_for | comp_if +# "test '=' test" is really "keyword '=' test", but we have no such token. +# These need to be in a single rule to avoid grammar that is ambiguous +# to our LL(1) parser. Even though 'test' includes '*expr' in star_expr, +# we explicitly match '*' here, too, to give it proper precedence. +# Illegal combinations and orderings are blocked in ast.c: +# multiple (test comp_for) arguments are blocked; keyword unpackings +# that precede iterable unpackings are blocked; etc. +argument: ( test [comp_for] | + test ':=' test | + test '=' test | + '**' test | + '*' test ) + +comp_iter: comp_for | comp_if sync_comp_for: 'for' exprlist 'in' or_test [comp_iter] -comp_if: 'if' test_nocond [comp_iter] +comp_for: ['async'] sync_comp_for +comp_if: 'if' or_test [comp_iter] # not used in grammar, but may appear in "node" passed from Parser to Compiler encoding_decl: NAME yield_expr: 'yield' [yield_arg] -yield_arg: 'from' test | testlist +yield_arg: 'from' test | testlist_star_expr + +strings: (STRING | fstring)+ +fstring: FSTRING_START fstring_content* FSTRING_END +fstring_content: FSTRING_STRING | fstring_expr +fstring_conversion: '!' NAME +fstring_expr: '{' (testlist_comp | yield_expr) ['='] [ fstring_conversion ] [ fstring_format_spec ] '}' +fstring_format_spec: ':' fstring_content* diff --git a/anaconda_lib/parso/python/grammar33.txt b/anaconda_lib/parso/python/grammar312.txt similarity index 50% rename from anaconda_lib/parso/python/grammar33.txt rename to anaconda_lib/parso/python/grammar312.txt index dd93d8b5..f092050d 100644 --- a/anaconda_lib/parso/python/grammar33.txt +++ b/anaconda_lib/parso/python/grammar312.txt @@ -1,14 +1,7 @@ # Grammar for Python -# Note: Changing the grammar specified in this file will most likely -# require corresponding changes in the parser module -# (../Modules/parsermodule.c). If you can't make the changes to -# that module yourself, please co-ordinate the required changes -# with someone who can; ask around on python-dev for help. Fred -# Drake will probably be listening there. - -# NOTE WELL: You should also follow all the steps listed in PEP 306, -# "How to Change Python's Grammar" +# NOTE WELL: You should also follow all the steps listed at +# https://devguide.python.org/grammar/ # Start symbols for the grammar: # single_input is a single interactive statement; @@ -19,36 +12,57 @@ single_input: NEWLINE | simple_stmt | compound_stmt NEWLINE file_input: stmt* ENDMARKER eval_input: testlist NEWLINE* ENDMARKER -decorator: '@' dotted_name [ '(' [arglist] ')' ] NEWLINE +decorator: '@' namedexpr_test NEWLINE decorators: decorator+ -decorated: decorators (classdef | funcdef) +decorated: decorators (classdef | funcdef | async_funcdef) + +async_funcdef: 'async' funcdef funcdef: 'def' NAME parameters ['->' test] ':' suite + parameters: '(' [typedargslist] ')' -typedargslist: (tfpdef ['=' test] (',' tfpdef ['=' test])* [',' - ['*' [tfpdef] (',' tfpdef ['=' test])* [',' '**' tfpdef] | '**' tfpdef]] - | '*' [tfpdef] (',' tfpdef ['=' test])* [',' '**' tfpdef] | '**' tfpdef) +typedargslist: ( + (tfpdef ['=' test] (',' tfpdef ['=' test])* ',' '/' [',' [ tfpdef ['=' test] ( + ',' tfpdef ['=' test])* ([',' [ + '*' [tfpdef] (',' tfpdef ['=' test])* [',' ['**' tfpdef [',']]] + | '**' tfpdef [',']]]) + | '*' [tfpdef] (',' tfpdef ['=' test])* ([',' ['**' tfpdef [',']]]) + | '**' tfpdef [',']]] ) +| (tfpdef ['=' test] (',' tfpdef ['=' test])* [',' [ + '*' [tfpdef] (',' tfpdef ['=' test])* [',' ['**' tfpdef [',']]] + | '**' tfpdef [',']]] + | '*' [tfpdef] (',' tfpdef ['=' test])* [',' ['**' tfpdef [',']]] + | '**' tfpdef [',']) +) tfpdef: NAME [':' test] -varargslist: (vfpdef ['=' test] (',' vfpdef ['=' test])* [',' - ['*' [vfpdef] (',' vfpdef ['=' test])* [',' '**' vfpdef] | '**' vfpdef]] - | '*' [vfpdef] (',' vfpdef ['=' test])* [',' '**' vfpdef] | '**' vfpdef) +varargslist: vfpdef ['=' test ](',' vfpdef ['=' test])* ',' '/' [',' [ (vfpdef ['=' test] (',' vfpdef ['=' test])* [',' [ + '*' [vfpdef] (',' vfpdef ['=' test])* [',' ['**' vfpdef [',']]] + | '**' vfpdef [',']]] + | '*' [vfpdef] (',' vfpdef ['=' test])* [',' ['**' vfpdef [',']]] + | '**' vfpdef [',']) ]] | (vfpdef ['=' test] (',' vfpdef ['=' test])* [',' [ + '*' [vfpdef] (',' vfpdef ['=' test])* [',' ['**' vfpdef [',']]] + | '**' vfpdef [',']]] + | '*' [vfpdef] (',' vfpdef ['=' test])* [',' ['**' vfpdef [',']]] + | '**' vfpdef [','] +) vfpdef: NAME stmt: simple_stmt | compound_stmt | NEWLINE simple_stmt: small_stmt (';' small_stmt)* [';'] NEWLINE small_stmt: (expr_stmt | del_stmt | pass_stmt | flow_stmt | import_stmt | global_stmt | nonlocal_stmt | assert_stmt) -expr_stmt: testlist_star_expr (augassign (yield_expr|testlist) | +expr_stmt: testlist_star_expr (annassign | augassign (yield_expr|testlist) | ('=' (yield_expr|testlist_star_expr))*) +annassign: ':' test ['=' (yield_expr|testlist_star_expr)] testlist_star_expr: (test|star_expr) (',' (test|star_expr))* [','] -augassign: ('+=' | '-=' | '*=' | '/=' | '%=' | '&=' | '|=' | '^=' | +augassign: ('+=' | '-=' | '*=' | '@=' | '/=' | '%=' | '&=' | '|=' | '^=' | '<<=' | '>>=' | '**=' | '//=') -# For normal assignments, additional restrictions enforced by the interpreter +# For normal and annotated assignments, additional restrictions enforced by the interpreter del_stmt: 'del' exprlist pass_stmt: 'pass' flow_stmt: break_stmt | continue_stmt | return_stmt | raise_stmt | yield_stmt break_stmt: 'break' continue_stmt: 'continue' -return_stmt: 'return' [testlist] +return_stmt: 'return' [testlist_star_expr] yield_stmt: yield_expr raise_stmt: 'raise' [test ['from' test]] import_stmt: import_name | import_from @@ -65,9 +79,10 @@ global_stmt: 'global' NAME (',' NAME)* nonlocal_stmt: 'nonlocal' NAME (',' NAME)* assert_stmt: 'assert' test [',' test] -compound_stmt: if_stmt | while_stmt | for_stmt | try_stmt | with_stmt | funcdef | classdef | decorated -if_stmt: 'if' test ':' suite ('elif' test ':' suite)* ['else' ':' suite] -while_stmt: 'while' test ':' suite ['else' ':' suite] +compound_stmt: if_stmt | while_stmt | for_stmt | try_stmt | with_stmt | funcdef | classdef | decorated | async_stmt +async_stmt: 'async' (funcdef | with_stmt | for_stmt) +if_stmt: 'if' namedexpr_test ':' suite ('elif' namedexpr_test ':' suite)* ['else' ':' suite] +while_stmt: 'while' namedexpr_test ':' suite ['else' ':' suite] for_stmt: 'for' exprlist 'in' testlist ':' suite ['else' ':' suite] try_stmt: ('try' ':' suite ((except_clause ':' suite)+ @@ -80,16 +95,15 @@ with_item: test ['as' expr] except_clause: 'except' [test ['as' NAME]] suite: simple_stmt | NEWLINE INDENT stmt+ DEDENT +namedexpr_test: test [':=' test] test: or_test ['if' or_test 'else' test] | lambdef -test_nocond: or_test | lambdef_nocond lambdef: 'lambda' [varargslist] ':' test -lambdef_nocond: 'lambda' [varargslist] ':' test_nocond or_test: and_test ('or' and_test)* and_test: not_test ('and' not_test)* not_test: 'not' not_test | comparison comparison: expr (comp_op expr)* # <> isn't actually a valid comparison operator in Python. It's here for the -# sake of a __future__ import described in PEP 401 +# sake of a __future__ import described in PEP 401 (which really works :-) comp_op: '<'|'>'|'=='|'>='|'<='|'<>'|'!='|'in'|'not' 'in'|'is'|'is' 'not' star_expr: '*' expr expr: xor_expr ('|' xor_expr)* @@ -97,38 +111,59 @@ xor_expr: and_expr ('^' and_expr)* and_expr: shift_expr ('&' shift_expr)* shift_expr: arith_expr (('<<'|'>>') arith_expr)* arith_expr: term (('+'|'-') term)* -term: factor (('*'|'/'|'%'|'//') factor)* +term: factor (('*'|'@'|'/'|'%'|'//') factor)* factor: ('+'|'-'|'~') factor | power -power: atom trailer* ['**' factor] +power: atom_expr ['**' factor] +atom_expr: ['await'] atom trailer* atom: ('(' [yield_expr|testlist_comp] ')' | '[' [testlist_comp] ']' | '{' [dictorsetmaker] '}' | NAME | NUMBER | strings | '...' | 'None' | 'True' | 'False') -strings: STRING+ -testlist_comp: (test|star_expr) ( sync_comp_for | (',' (test|star_expr))* [','] ) +testlist_comp: (namedexpr_test|star_expr) ( comp_for | (',' (namedexpr_test|star_expr))* [','] ) trailer: '(' [arglist] ')' | '[' subscriptlist ']' | '.' NAME subscriptlist: subscript (',' subscript)* [','] -subscript: test | [test] ':' [test] [sliceop] +subscript: test [':=' test] | [test] ':' [test] [sliceop] sliceop: ':' [test] exprlist: (expr|star_expr) (',' (expr|star_expr))* [','] testlist: test (',' test)* [','] -dictorsetmaker: ( (test ':' test (sync_comp_for | (',' test ':' test)* [','])) | - (test (sync_comp_for | (',' test)* [','])) ) +dictorsetmaker: ( ((test ':' test | '**' expr) + (comp_for | (',' (test ':' test | '**' expr))* [','])) | + ((test [':=' test] | star_expr) + (comp_for | (',' (test [':=' test] | star_expr))* [','])) ) classdef: 'class' NAME ['(' [arglist] ')'] ':' suite -arglist: (argument ',')* (argument [','] - |'*' test (',' argument)* [',' '**' test] - |'**' test) +arglist: argument (',' argument)* [','] + # The reason that keywords are test nodes instead of NAME is that using NAME # results in an ambiguity. ast.c makes sure it's a NAME. -argument: test [sync_comp_for] | test '=' test # Really [keyword '='] test -comp_iter: sync_comp_for | comp_if +# "test '=' test" is really "keyword '=' test", but we have no such token. +# These need to be in a single rule to avoid grammar that is ambiguous +# to our LL(1) parser. Even though 'test' includes '*expr' in star_expr, +# we explicitly match '*' here, too, to give it proper precedence. +# Illegal combinations and orderings are blocked in ast.c: +# multiple (test comp_for) arguments are blocked; keyword unpackings +# that precede iterable unpackings are blocked; etc. +argument: ( test [comp_for] | + test ':=' test | + test '=' test | + '**' test | + '*' test ) + +comp_iter: comp_for | comp_if sync_comp_for: 'for' exprlist 'in' or_test [comp_iter] -comp_if: 'if' test_nocond [comp_iter] +comp_for: ['async'] sync_comp_for +comp_if: 'if' or_test [comp_iter] # not used in grammar, but may appear in "node" passed from Parser to Compiler encoding_decl: NAME yield_expr: 'yield' [yield_arg] -yield_arg: 'from' test | testlist +yield_arg: 'from' test | testlist_star_expr + +strings: (STRING | fstring)+ +fstring: FSTRING_START fstring_content* FSTRING_END +fstring_content: FSTRING_STRING | fstring_expr +fstring_conversion: '!' NAME +fstring_expr: '{' (testlist_comp | yield_expr) ['='] [ fstring_conversion ] [ fstring_format_spec ] '}' +fstring_format_spec: ':' fstring_content* diff --git a/anaconda_lib/parso/python/grammar36.txt b/anaconda_lib/parso/python/grammar36.txt index 2fec1f99..e7962066 100644 --- a/anaconda_lib/parso/python/grammar36.txt +++ b/anaconda_lib/parso/python/grammar36.txt @@ -154,5 +154,5 @@ strings: (STRING | fstring)+ fstring: FSTRING_START fstring_content* FSTRING_END fstring_content: FSTRING_STRING | fstring_expr fstring_conversion: '!' NAME -fstring_expr: '{' testlist_comp [ fstring_conversion ] [ fstring_format_spec ] '}' +fstring_expr: '{' (testlist_comp | yield_expr) [ fstring_conversion ] [ fstring_format_spec ] '}' fstring_format_spec: ':' fstring_content* diff --git a/anaconda_lib/parso/python/grammar37.txt b/anaconda_lib/parso/python/grammar37.txt index 8799b843..f4a929fe 100644 --- a/anaconda_lib/parso/python/grammar37.txt +++ b/anaconda_lib/parso/python/grammar37.txt @@ -152,5 +152,5 @@ strings: (STRING | fstring)+ fstring: FSTRING_START fstring_content* FSTRING_END fstring_content: FSTRING_STRING | fstring_expr fstring_conversion: '!' NAME -fstring_expr: '{' testlist [ fstring_conversion ] [ fstring_format_spec ] '}' +fstring_expr: '{' (testlist_comp | yield_expr) [ fstring_conversion ] [ fstring_format_spec ] '}' fstring_format_spec: ':' fstring_content* diff --git a/anaconda_lib/parso/python/grammar38.txt b/anaconda_lib/parso/python/grammar38.txt index 40908ed6..7288d556 100644 --- a/anaconda_lib/parso/python/grammar38.txt +++ b/anaconda_lib/parso/python/grammar38.txt @@ -52,7 +52,7 @@ small_stmt: (expr_stmt | del_stmt | pass_stmt | flow_stmt | import_stmt | global_stmt | nonlocal_stmt | assert_stmt) expr_stmt: testlist_star_expr (annassign | augassign (yield_expr|testlist) | ('=' (yield_expr|testlist_star_expr))*) -annassign: ':' test ['=' test] +annassign: ':' test ['=' (yield_expr|testlist_star_expr)] testlist_star_expr: (test|star_expr) (',' (test|star_expr))* [','] augassign: ('+=' | '-=' | '*=' | '@=' | '/=' | '%=' | '&=' | '|=' | '^=' | '<<=' | '>>=' | '**=' | '//=') @@ -167,5 +167,5 @@ strings: (STRING | fstring)+ fstring: FSTRING_START fstring_content* FSTRING_END fstring_content: FSTRING_STRING | fstring_expr fstring_conversion: '!' NAME -fstring_expr: '{' testlist ['='] [ fstring_conversion ] [ fstring_format_spec ] '}' +fstring_expr: '{' (testlist_comp | yield_expr) ['='] [ fstring_conversion ] [ fstring_format_spec ] '}' fstring_format_spec: ':' fstring_content* diff --git a/anaconda_lib/parso/python/grammar39.txt b/anaconda_lib/parso/python/grammar39.txt index 40908ed6..ae46033c 100644 --- a/anaconda_lib/parso/python/grammar39.txt +++ b/anaconda_lib/parso/python/grammar39.txt @@ -12,7 +12,7 @@ single_input: NEWLINE | simple_stmt | compound_stmt NEWLINE file_input: stmt* ENDMARKER eval_input: testlist NEWLINE* ENDMARKER -decorator: '@' dotted_name [ '(' [arglist] ')' ] NEWLINE +decorator: '@' namedexpr_test NEWLINE decorators: decorator+ decorated: decorators (classdef | funcdef | async_funcdef) @@ -52,7 +52,7 @@ small_stmt: (expr_stmt | del_stmt | pass_stmt | flow_stmt | import_stmt | global_stmt | nonlocal_stmt | assert_stmt) expr_stmt: testlist_star_expr (annassign | augassign (yield_expr|testlist) | ('=' (yield_expr|testlist_star_expr))*) -annassign: ':' test ['=' test] +annassign: ':' test ['=' (yield_expr|testlist_star_expr)] testlist_star_expr: (test|star_expr) (',' (test|star_expr))* [','] augassign: ('+=' | '-=' | '*=' | '@=' | '/=' | '%=' | '&=' | '|=' | '^=' | '<<=' | '>>=' | '**=' | '//=') @@ -97,9 +97,7 @@ suite: simple_stmt | NEWLINE INDENT stmt+ DEDENT namedexpr_test: test [':=' test] test: or_test ['if' or_test 'else' test] | lambdef -test_nocond: or_test | lambdef_nocond lambdef: 'lambda' [varargslist] ':' test -lambdef_nocond: 'lambda' [varargslist] ':' test_nocond or_test: and_test ('or' and_test)* and_test: not_test ('and' not_test)* not_test: 'not' not_test | comparison @@ -130,8 +128,8 @@ exprlist: (expr|star_expr) (',' (expr|star_expr))* [','] testlist: test (',' test)* [','] dictorsetmaker: ( ((test ':' test | '**' expr) (comp_for | (',' (test ':' test | '**' expr))* [','])) | - ((test | star_expr) - (comp_for | (',' (test | star_expr))* [','])) ) + ((test [':=' test] | star_expr) + (comp_for | (',' (test [':=' test] | star_expr))* [','])) ) classdef: 'class' NAME ['(' [arglist] ')'] ':' suite @@ -155,7 +153,7 @@ argument: ( test [comp_for] | comp_iter: comp_for | comp_if sync_comp_for: 'for' exprlist 'in' or_test [comp_iter] comp_for: ['async'] sync_comp_for -comp_if: 'if' test_nocond [comp_iter] +comp_if: 'if' or_test [comp_iter] # not used in grammar, but may appear in "node" passed from Parser to Compiler encoding_decl: NAME @@ -167,5 +165,5 @@ strings: (STRING | fstring)+ fstring: FSTRING_START fstring_content* FSTRING_END fstring_content: FSTRING_STRING | fstring_expr fstring_conversion: '!' NAME -fstring_expr: '{' testlist ['='] [ fstring_conversion ] [ fstring_format_spec ] '}' +fstring_expr: '{' (testlist_comp | yield_expr) ['='] [ fstring_conversion ] [ fstring_format_spec ] '}' fstring_format_spec: ':' fstring_content* diff --git a/anaconda_lib/parso/python/issue_list.txt b/anaconda_lib/parso/python/issue_list.txt new file mode 100644 index 00000000..4cd9ebfd --- /dev/null +++ b/anaconda_lib/parso/python/issue_list.txt @@ -0,0 +1,168 @@ +A list of syntax/indentation errors I've encountered in CPython. + +# Python/compile.c + "'continue' not properly in loop" + "'continue' not supported inside 'finally' clause" # Until loop + "default 'except:' must be last" + "from __future__ imports must occur at the beginning of the file" + "'return' outside function" + "'return' with value in async generator" + "'break' outside loop" + "two starred expressions in assignment" + "asynchronous comprehension outside of an asynchronous function" + "'yield' outside function" # For both yield and yield from + "'yield from' inside async function" + "'await' outside function" + "'await' outside async function" + "starred assignment target must be in a list or tuple" + "can't use starred expression here" + "too many statically nested blocks" # Max. 20 + # This is one of the few places in the cpython code base that I really + # don't understand. It feels a bit hacky if you look at the implementation + # of UNPACK_EX. + "too many expressions in star-unpacking assignment" + + # Just ignore this one, newer versions will not be affected anymore and + # it's a limit of 2^16 - 1. + +# Python/ast.c + # used with_item exprlist expr_stmt + "can't %s %s" % ("assign to" or "delete", + "lambda" + "function call" # foo() + "generator expression" + "list comprehension" + "set comprehension" + "dict comprehension" + "keyword" + "Ellipsis" + "comparison" + Dict: Set: Num: Str: Bytes: JoinedStr: FormattedValue: + "literal" + BoolOp: BinOp: UnaryOp: + "operator" + Yield: YieldFrom: + "yield expression" + Await: + "await expression" + IfExp: + "conditional expression" + "assignment to keyword" # (keywords + __debug__) # None = 2 + "named arguments must follow bare *" # def foo(*): pass + "non-default argument follows default argument" # def f(x=3, y): pass + "iterable unpacking cannot be used in comprehension" # [*[] for a in [1]] + "dict unpacking cannot be used in dict comprehension" # {**{} for a in [1]} + "Generator expression must be parenthesized if not sole argument" # foo(x for x in [], b) + "positional argument follows keyword argument unpacking" # f(**x, y) + "positional argument follows keyword argument" # f(x=2, y) + "iterable argument unpacking follows keyword argument unpacking" # foo(**kwargs, *args) + "lambda cannot contain assignment" # f(lambda: 1=1) + "keyword can't be an expression" # f(+x=1) + "keyword argument repeated" # f(x=1, x=2) + "illegal expression for augmented assignment" # x, y += 1 + "only single target (not list) can be annotated" # [x, y]: int + "only single target (not tuple) can be annotated" # x, y: str + "illegal target for annotation" # True: 1` + "trailing comma not allowed without surrounding parentheses" # from foo import a, + "bytes can only contain ASCII literal characters." # b'ä' # prob. only python 3 + "cannot mix bytes and nonbytes literals" # 's' b'' + "assignment to yield expression not possible" # x = yield 1 = 3 + + "f-string: empty expression not allowed" # f'{}' + "f-string: single '}' is not allowed" # f'}' + "f-string: expressions nested too deeply" # f'{1:{5:{3}}}' + "f-string expression part cannot include a backslash" # f'{"\"}' or f'{"\\"}' + "f-string expression part cannot include '#'" # f'{#}' + "f-string: unterminated string" # f'{"}' + "f-string: mismatched '(', '{', or '['" + "f-string: invalid conversion character: expected 's', 'r', or 'a'" # f'{1!b}' + "f-string: unexpected end of string" # Doesn't really happen?! + "f-string: expecting '}'" # f'{' + "(unicode error) unknown error + "(value error) unknown error + "(unicode error) MESSAGE + MESSAGES = { + "\\ at end of string" + "truncated \\xXX escape" + "truncated \\uXXXX escape" + "truncated \\UXXXXXXXX escape" + "illegal Unicode character" # '\Uffffffff' + "malformed \\N character escape" # '\N{}' + "unknown Unicode character name" # '\N{foo}' + } + "(value error) MESSAGE # bytes + MESSAGES = { + "Trailing \\ in string" + "invalid \\x escape at position %d" + } + + "invalid escape sequence \\%c" # Only happens when used in `python -W error` + "unexpected node" # Probably irrelevant + "Unexpected node-type in from-import" # Irrelevant, doesn't happen. + "malformed 'try' statement" # Irrelevant, doesn't happen. + +# Python/symtable.c + "duplicate argument '%U' in function definition" + "name '%U' is assigned to before global declaration" + "name '%U' is assigned to before nonlocal declaration" + "name '%U' is used prior to global declaration" + "name '%U' is used prior to nonlocal declaration" + "annotated name '%U' can't be global" + "annotated name '%U' can't be nonlocal" + "import * only allowed at module level" + + "name '%U' is parameter and global", + "name '%U' is nonlocal and global", + "name '%U' is parameter and nonlocal", + + "nonlocal declaration not allowed at module level"); + "no binding for nonlocal '%U' found", + # RecursionError. Not handled. For all human written code, this is probably + # not an issue. eval("()"*x) with x>=2998 for example fails, but that's + # more than 2000 executions on one line. + "maximum recursion depth exceeded during compilation"); + +# Python/future.c + "not a chance" + "future feature %.100s is not defined" + "from __future__ imports must occur at the beginning of the file" # Also in compile.c + +# Parser/tokenizer.c + # All the following issues seem to be irrelevant for parso, because the + # encoding stuff is done before it reaches the tokenizer. It's already + # unicode at that point. + "encoding problem: %s" + "encoding problem: %s with BOM" + "Non-UTF-8 code starting with '\\x%.2x' in file %U on line %i, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details" + +# Parser/pythonrun.c + E_SYNTAX: "invalid syntax" + E_LINECONT: "unexpected character after line continuation character" + E_IDENTIFIER: "invalid character in identifier" + # Also just use 'invalid syntax'. Happens mostly with stuff like `(`. This + # message doesn't really help the user, because it only appears very + # randomly, e.g. `(or` wouldn't yield this error. + E_EOF: "unexpected EOF while parsing" + # Even in 3.6 this is implemented kind of shaky. Not implemented, I think + # cPython needs to fix this one first. + # e.g. `ast.parse('def x():\n\t if 1:\n \t \tpass')` works :/ + E_TABSPACE: "inconsistent use of tabs and spaces in indentation" + # Ignored, just shown as "invalid syntax". The error has mostly to do with + # numbers like 0b2 everywhere or 1.6_ in Python3.6. + E_TOKEN: "invalid token" + E_EOFS: "EOF while scanning triple-quoted string literal" + E_EOLS: "EOL while scanning string literal" + + # IndentationError + E_DEDENT: "unindent does not match any outer indentation level" + E_TOODEEP: "too many levels of indentation" # 100 levels + E_SYNTAX: "expected an indented block" + "unexpected indent" + # I don't think this actually ever happens. + "unexpected unindent" + + + # Irrelevant for parso for now. + E_OVERFLOW: "expression too long" + E_DECODE: "unknown decode error" + E_BADSINGLE: "multiple statements found while compiling a single statement" diff --git a/anaconda_lib/parso/python/parser.py b/anaconda_lib/parso/python/parser.py index ada60fbb..fa45e8b1 100644 --- a/anaconda_lib/parso/python/parser.py +++ b/anaconda_lib/parso/python/parser.py @@ -43,11 +43,10 @@ class structure of different scopes. # Not sure if this is the best idea, but IMO it's the easiest way to # avoid extreme amounts of work around the subtle difference of 2/3 # grammar in list comoprehensions. - 'list_for': tree.SyncCompFor, 'decorator': tree.Decorator, 'lambdef': tree.Lambda, - 'old_lambdef': tree.Lambda, 'lambdef_nocond': tree.Lambda, + 'namedexpr_test': tree.NamedExpr, } default_node = tree.PythonNode @@ -63,8 +62,8 @@ class structure of different scopes. } def __init__(self, pgen_grammar, error_recovery=True, start_nonterminal='file_input'): - super(Parser, self).__init__(pgen_grammar, start_nonterminal, - error_recovery=error_recovery) + super().__init__(pgen_grammar, start_nonterminal, + error_recovery=error_recovery) self.syntax_errors = [] self._omit_dedent_list = [] @@ -77,7 +76,7 @@ def parse(self, tokens): tokens = self._recovery_tokenize(tokens) - return super(Parser, self).parse(tokens) + return super().parse(tokens) def convert_node(self, nonterminal, children): """ @@ -96,15 +95,7 @@ def convert_node(self, nonterminal, children): # ones and therefore have pseudo start/end positions and no # prefixes. Just ignore them. children = [children[0]] + children[2:-1] - elif nonterminal == 'list_if': - # Make transitioning from 2 to 3 easier. - nonterminal = 'comp_if' - elif nonterminal == 'listmaker': - # Same as list_if above. - nonterminal = 'testlist_comp' node = self.default_node(nonterminal, children) - for c in children: - c.parent = node return node def convert_leaf(self, type, value, prefix, start_pos): @@ -146,7 +137,7 @@ def error_recovery(self, token): return if not self._error_recovery: - return super(Parser, self).error_recovery(token) + return super().error_recovery(token) def current_suite(stack): # For now just discard everything that is not a suite or @@ -192,8 +183,6 @@ def _stack_removal(self, start_index): if all_nodes: node = tree.PythonErrorNode(all_nodes) - for n in all_nodes: - n.parent = node self.stack[start_index - 1].nodes.append(node) self.stack[start_index:] = [] diff --git a/anaconda_lib/parso/python/pep8.py b/anaconda_lib/parso/python/pep8.py index 2a037f9c..c492dae6 100644 --- a/anaconda_lib/parso/python/pep8.py +++ b/anaconda_lib/parso/python/pep8.py @@ -1,9 +1,10 @@ import re from contextlib import contextmanager +from typing import Tuple from parso.python.errors import ErrorFinder, ErrorFinderConfig from parso.normalizer import Rule -from parso.python.tree import search_ancestor, Flow, Scope +from parso.python.tree import Flow, Scope _IMPORT_TYPES = ('import_name', 'import_from') @@ -15,16 +16,17 @@ _FACTOR = '+', '-', '~' _ALLOW_SPACE = '*', '+', '-', '**', '/', '//', '@' _BITWISE_OPERATOR = '<<', '>>', '|', '&', '^' -_NEEDS_SPACE = ('=', '%', '->', - '<', '>', '==', '>=', '<=', '<>', '!=', - '+=', '-=', '*=', '@=', '/=', '%=', '&=', '|=', '^=', '<<=', - '>>=', '**=', '//=') +_NEEDS_SPACE: Tuple[str, ...] = ( + '=', '%', '->', + '<', '>', '==', '>=', '<=', '<>', '!=', + '+=', '-=', '*=', '@=', '/=', '%=', '&=', '|=', '^=', '<<=', + '>>=', '**=', '//=') _NEEDS_SPACE += _BITWISE_OPERATOR _IMPLICIT_INDENTATION_TYPES = ('dictorsetmaker', 'argument') _POSSIBLE_SLICE_PARENTS = ('subscript', 'subscriptlist', 'sliceop') -class IndentationTypes(object): +class IndentationTypes: VERTICAL_BRACKET = object() HANGING_BRACKET = object() BACKSLASH = object() @@ -71,9 +73,8 @@ def __init__(self, config, leaf, parent, in_suite_introducer=False): n = n.parent parent_indentation = n.indentation - next_leaf = leaf.get_next_leaf() - if '\n' in next_leaf.prefix: + if '\n' in next_leaf.prefix or '\r' in next_leaf.prefix: # This implies code like: # foobarbaz( # a, @@ -93,7 +94,7 @@ def __init__(self, config, leaf, parent, in_suite_introducer=False): if '\t' in config.indentation: self.indentation = None else: - self.indentation = ' ' * expected_end_indent + self.indentation = ' ' * expected_end_indent self.bracket_indentation = self.indentation self.type = IndentationTypes.VERTICAL_BRACKET @@ -111,11 +112,11 @@ class ImplicitNode(BracketNode): annotations and dict values. """ def __init__(self, config, leaf, parent): - super(ImplicitNode, self).__init__(config, leaf, parent) + super().__init__(config, leaf, parent) self.type = IndentationTypes.IMPLICIT next_leaf = leaf.get_next_leaf() - if leaf == ':' and '\n' not in next_leaf.prefix: + if leaf == ':' and '\n' not in next_leaf.prefix and '\r' not in next_leaf.prefix: self.indentation += ' ' @@ -123,7 +124,7 @@ class BackslashNode(IndentationNode): type = IndentationTypes.BACKSLASH def __init__(self, config, parent_indentation, containing_leaf, spacing, parent=None): - expr_stmt = search_ancestor(containing_leaf, 'expr_stmt') + expr_stmt = containing_leaf.search_ancestor('expr_stmt') if expr_stmt is not None: equals = expr_stmt.children[-2] @@ -137,7 +138,7 @@ def __init__(self, config, parent_indentation, containing_leaf, spacing, parent= self.indentation = parent_indentation + config.indentation else: # +1 because there is a space. - self.indentation = ' ' * (equals.end_pos[1] + 1) + self.indentation = ' ' * (equals.end_pos[1] + 1) else: self.indentation = parent_indentation + config.indentation self.bracket_indentation = self.indentation @@ -150,7 +151,7 @@ def _is_magic_name(name): class PEP8Normalizer(ErrorFinder): def __init__(self, *args, **kwargs): - super(PEP8Normalizer, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) self._previous_part = None self._previous_leaf = None self._on_newline = True @@ -173,7 +174,7 @@ def __init__(self, *args, **kwargs): @contextmanager def visit_node(self, node): - with super(PEP8Normalizer, self).visit_node(node): + with super().visit_node(node): with self._visit_node(node): yield @@ -190,7 +191,8 @@ def _visit_node(self, node): expr_stmt = node.parent # Check if it's simply defining a single name, not something like # foo.bar or x[1], where using a lambda could make more sense. - if expr_stmt.type == 'expr_stmt' and any(n.type == 'name' for n in expr_stmt.children[:-2:2]): + if expr_stmt.type == 'expr_stmt' and any(n.type == 'name' + for n in expr_stmt.children[:-2:2]): self.add_issue(node, 731, 'Do not assign a lambda expression, use a def') elif typ == 'try_stmt': for child in node.children: @@ -214,14 +216,13 @@ def _visit_node(self, node): endmarker = node.children[-1] prev = endmarker.get_previous_leaf() prefix = endmarker.prefix - if (not prefix.endswith('\n') and ( - prefix or prev is None or prev.value != '\n')): + if (not prefix.endswith('\n') and not prefix.endswith('\r') and ( + prefix or prev is None or prev.value not in {'\n', '\r\n', '\r'})): self.add_issue(endmarker, 292, "No newline at end of file") if typ in _IMPORT_TYPES: simple_stmt = node.parent module = simple_stmt.parent - #if module.type == 'simple_stmt': if module.type == 'file_input': index = module.children.index(simple_stmt) for child in module.children[:index]: @@ -341,7 +342,7 @@ def _reset_newlines(self, spacing, leaf, is_comment=False): self._newline_count = 0 def visit_leaf(self, leaf): - super(PEP8Normalizer, self).visit_leaf(leaf) + super().visit_leaf(leaf) for part in leaf._split_prefix(): if part.type == 'spacing': # This part is used for the part call after for. @@ -406,7 +407,6 @@ def _visit_part(self, part, spacing, leaf): and leaf.parent.parent.type == 'decorated': self.add_issue(part, 304, "Blank lines found after function decorator") - self._newline_count += 1 if type_ == 'backslash': @@ -461,33 +461,63 @@ def _visit_part(self, part, spacing, leaf): else: should_be_indentation = node.indentation if self._in_suite_introducer and indentation == \ - node.get_latest_suite_node().indentation \ - + self._config.indentation: - self.add_issue(part, 129, "Line with same indent as next logical block") + node.get_latest_suite_node().indentation \ + + self._config.indentation: + self.add_issue(part, 129, "Line with same indent as next logical block") elif indentation != should_be_indentation: - if not self._check_tabs_spaces(spacing) and part.value != '\n': + if not self._check_tabs_spaces(spacing) and part.value not in \ + {'\n', '\r\n', '\r'}: if value in '])}': if node.type == IndentationTypes.VERTICAL_BRACKET: - self.add_issue(part, 124, "Closing bracket does not match visual indentation") + self.add_issue( + part, + 124, + "Closing bracket does not match visual indentation" + ) else: - self.add_issue(part, 123, "Losing bracket does not match indentation of opening bracket's line") + self.add_issue( + part, + 123, + "Losing bracket does not match " + "indentation of opening bracket's line" + ) else: if len(indentation) < len(should_be_indentation): if node.type == IndentationTypes.VERTICAL_BRACKET: - self.add_issue(part, 128, 'Continuation line under-indented for visual indent') + self.add_issue( + part, + 128, + 'Continuation line under-indented for visual indent' + ) elif node.type == IndentationTypes.BACKSLASH: - self.add_issue(part, 122, 'Continuation line missing indentation or outdented') + self.add_issue( + part, + 122, + 'Continuation line missing indentation or outdented' + ) elif node.type == IndentationTypes.IMPLICIT: self.add_issue(part, 135, 'xxx') else: - self.add_issue(part, 121, 'Continuation line under-indented for hanging indent') + self.add_issue( + part, + 121, + 'Continuation line under-indented for hanging indent' + ) else: if node.type == IndentationTypes.VERTICAL_BRACKET: - self.add_issue(part, 127, 'Continuation line over-indented for visual indent') + self.add_issue( + part, + 127, + 'Continuation line over-indented for visual indent' + ) elif node.type == IndentationTypes.IMPLICIT: self.add_issue(part, 136, 'xxx') else: - self.add_issue(part, 126, 'Continuation line over-indented for hanging indent') + self.add_issue( + part, + 126, + 'Continuation line over-indented for hanging indent' + ) else: self._check_spacing(part, spacing) @@ -524,7 +554,7 @@ def _check_line_length(self, part, spacing): else: last_column = part.end_pos[1] if last_column > self._config.max_characters \ - and spacing.start_pos[1] <= self._config.max_characters : + and spacing.start_pos[1] <= self._config.max_characters: # Special case for long URLs in multi-line docstrings or comments, # but still report the error when the 72 first chars are whitespaces. report = True @@ -538,7 +568,7 @@ def _check_line_length(self, part, spacing): part, 501, 'Line too long (%s > %s characters)' % - (last_column, self._config.max_characters), + (last_column, self._config.max_characters), ) def _check_spacing(self, part, spacing): @@ -573,11 +603,11 @@ def add_not_spaces(*args): message = "Whitespace before '%s'" % part.value add_if_spaces(spacing, 202, message) elif part in (',', ';') or part == ':' \ - and part.parent.type not in _POSSIBLE_SLICE_PARENTS: + and part.parent.type not in _POSSIBLE_SLICE_PARENTS: message = "Whitespace before '%s'" % part.value add_if_spaces(spacing, 203, message) elif prev == ':' and prev.parent.type in _POSSIBLE_SLICE_PARENTS: - pass # TODO + pass # TODO elif prev in (',', ';', ':'): add_not_spaces(spacing, 231, "missing whitespace after '%s'") elif part == ':': # Is a subscript @@ -602,9 +632,17 @@ def add_not_spaces(*args): if param.type == 'param' and param.annotation: add_not_spaces(spacing, 252, 'Expected spaces around annotation equals') else: - add_if_spaces(spacing, 251, 'Unexpected spaces around keyword / parameter equals') + add_if_spaces( + spacing, + 251, + 'Unexpected spaces around keyword / parameter equals' + ) elif part in _BITWISE_OPERATOR or prev in _BITWISE_OPERATOR: - add_not_spaces(spacing, 227, 'Missing whitespace around bitwise or shift operator') + add_not_spaces( + spacing, + 227, + 'Missing whitespace around bitwise or shift operator' + ) elif part == '%' or prev == '%': add_not_spaces(spacing, 228, 'Missing whitespace around modulo operator') else: @@ -615,14 +653,14 @@ def add_not_spaces(*args): else: prev_spacing = self._previous_spacing if prev in _ALLOW_SPACE and spaces != prev_spacing.value \ - and '\n' not in self._previous_leaf.prefix: + and '\n' not in self._previous_leaf.prefix \ + and '\r' not in self._previous_leaf.prefix: message = "Whitespace before operator doesn't match with whitespace after" self.add_issue(spacing, 229, message) if spaces and part not in _ALLOW_SPACE and prev not in _ALLOW_SPACE: message_225 = 'Missing whitespace between tokens' - #print('xy', spacing) - #self.add_issue(spacing, 225, message_225) + # self.add_issue(spacing, 225, message_225) # TODO why only brackets? if part in _OPENING_BRACKETS: message = "Whitespace before '%s'" % part.value @@ -664,7 +702,8 @@ def _analyse_non_prefix(self, leaf): self.add_issue(leaf, 711, message) break elif node.value in ('True', 'False'): - message = "comparison to False/True should be 'if cond is True:' or 'if cond:'" + message = "comparison to False/True should be " \ + "'if cond is True:' or 'if cond:'" self.add_issue(leaf, 712, message) break elif leaf.value in ('in', 'is'): @@ -680,21 +719,22 @@ def _analyse_non_prefix(self, leaf): indentation = re.match(r'[ \t]*', line).group(0) start_pos = leaf.line + i, len(indentation) # TODO check multiline indentation. + start_pos elif typ == 'endmarker': if self._newline_count >= 2: self.add_issue(leaf, 391, 'Blank line at end of file') def add_issue(self, node, code, message): if self._previous_leaf is not None: - if search_ancestor(self._previous_leaf, 'error_node') is not None: + if self._previous_leaf.search_ancestor('error_node') is not None: return if self._previous_leaf.type == 'error_leaf': return - if search_ancestor(node, 'error_node') is not None: + if node.search_ancestor('error_node') is not None: return if code in (901, 903): # 901 and 903 are raised by the ErrorFinder. - super(PEP8Normalizer, self).add_issue(node, code, message) + super().add_issue(node, code, message) else: # Skip ErrorFinder here, because it has custom behavior. super(ErrorFinder, self).add_issue(node, code, message) @@ -718,7 +758,7 @@ def __init__(self, indentation=' ' * 4, hanging_indentation=None, # TODO this is not yet ready. -#@PEP8Normalizer.register_rule(type='endmarker') +# @PEP8Normalizer.register_rule(type='endmarker') class BlankLineAtEnd(Rule): code = 392 message = 'Blank line at end of file' diff --git a/anaconda_lib/parso/python/prefix.py b/anaconda_lib/parso/python/prefix.py index b7f1e1bc..6b8d59e6 100644 --- a/anaconda_lib/parso/python/prefix.py +++ b/anaconda_lib/parso/python/prefix.py @@ -1,23 +1,24 @@ import re from codecs import BOM_UTF8 +from typing import Tuple from parso.python.tokenize import group unicode_bom = BOM_UTF8.decode('utf-8') -class PrefixPart(object): +class PrefixPart: def __init__(self, leaf, typ, value, spacing='', start_pos=None): assert start_pos is not None self.parent = leaf self.type = typ self.value = value self.spacing = spacing - self.start_pos = start_pos + self.start_pos: Tuple[int, int] = start_pos @property - def end_pos(self): - if self.value.endswith('\n'): + def end_pos(self) -> Tuple[int, int]: + if self.value.endswith('\n') or self.value.endswith('\r'): return self.start_pos[0] + 1, 0 if self.value == unicode_bom: # The bom doesn't have a length at the start of a Python file. @@ -39,10 +40,18 @@ def __repr__(self): self.start_pos ) + def search_ancestor(self, *node_types): + node = self.parent + while node is not None: + if node.type in node_types: + return node + node = node.parent + return None + _comment = r'#[^\n\r\f]*' -_backslash = r'\\\r?\n' -_newline = r'\r?\n' +_backslash = r'\\\r?\n|\\\r' +_newline = r'\r?\n|\r' _form_feed = r'\f' _only_spacing = '$' _spacing = r'[ \t]*' @@ -71,7 +80,7 @@ def split_prefix(leaf, start_pos): value = spacing = '' bom = False while start != len(leaf.prefix): - match =_regex.match(leaf.prefix, start) + match = _regex.match(leaf.prefix, start) spacing = match.group(1) value = match.group(2) if not value: @@ -85,7 +94,7 @@ def split_prefix(leaf, start_pos): bom = True start = match.end(0) - if value.endswith('\n'): + if value.endswith('\n') or value.endswith('\r'): line += 1 column = -start diff --git a/anaconda_lib/parso/python/token.py b/anaconda_lib/parso/python/token.py index bb86ec97..9b6f4c7c 100644 --- a/anaconda_lib/parso/python/token.py +++ b/anaconda_lib/parso/python/token.py @@ -1,8 +1,13 @@ from __future__ import absolute_import +from enum import Enum -class TokenType(object): - def __init__(self, name, contains_syntax=False): + +class TokenType: + name: str + contains_syntax: bool + + def __init__(self, name: str, contains_syntax: bool = False): self.name = name self.contains_syntax = contains_syntax @@ -10,18 +15,17 @@ def __repr__(self): return '%s(%s)' % (self.__class__.__name__, self.name) -class TokenTypes(object): - """ - Basically an enum, but Python 2 doesn't have enums in the standard library. - """ - def __init__(self, names, contains_syntax): - for name in names: - setattr(self, name, TokenType(name, contains_syntax=name in contains_syntax)) - - -PythonTokenTypes = TokenTypes(( - 'STRING', 'NUMBER', 'NAME', 'ERRORTOKEN', 'NEWLINE', 'INDENT', 'DEDENT', - 'ERROR_DEDENT', 'FSTRING_STRING', 'FSTRING_START', 'FSTRING_END', 'OP', - 'ENDMARKER'), - contains_syntax=('NAME', 'OP'), -) +class PythonTokenTypes(Enum): + STRING = TokenType('STRING') + NUMBER = TokenType('NUMBER') + NAME = TokenType('NAME', contains_syntax=True) + ERRORTOKEN = TokenType('ERRORTOKEN') + NEWLINE = TokenType('NEWLINE') + INDENT = TokenType('INDENT') + DEDENT = TokenType('DEDENT') + ERROR_DEDENT = TokenType('ERROR_DEDENT') + FSTRING_STRING = TokenType('FSTRING_STRING') + FSTRING_START = TokenType('FSTRING_START') + FSTRING_END = TokenType('FSTRING_END') + OP = TokenType('OP', contains_syntax=True) + ENDMARKER = TokenType('ENDMARKER') diff --git a/anaconda_lib/parso/python/tokenize.py b/anaconda_lib/parso/python/tokenize.py index f8ce09a1..e3ffe440 100644 --- a/anaconda_lib/parso/python/tokenize.py +++ b/anaconda_lib/parso/python/tokenize.py @@ -13,12 +13,13 @@ import sys import re -from collections import namedtuple import itertools as _itertools from codecs import BOM_UTF8 +from typing import NamedTuple, Tuple, Iterator, Iterable, List, Dict, \ + Pattern, Set from parso.python.token import PythonTokenTypes -from parso.utils import split_lines +from parso.utils import split_lines, PythonVersionInfo, parse_version_string # Maximum code point of Unicode 6.0: 0x10ffff (1,114,111) @@ -38,31 +39,23 @@ FSTRING_STRING = PythonTokenTypes.FSTRING_STRING FSTRING_END = PythonTokenTypes.FSTRING_END -TokenCollection = namedtuple( - 'TokenCollection', - 'pseudo_token single_quoted triple_quoted endpats whitespace ' - 'fstring_pattern_map always_break_tokens', -) -BOM_UTF8_STRING = BOM_UTF8.decode('utf-8') +class TokenCollection(NamedTuple): + pseudo_token: Pattern + single_quoted: Set[str] + triple_quoted: Set[str] + endpats: Dict[str, Pattern] + whitespace: Pattern + fstring_pattern_map: Dict[str, str] + always_break_tokens: Tuple[str] -_token_collection_cache = {} -if sys.version_info.major >= 3: - # Python 3 has str.isidentifier() to check if a char is a valid identifier - is_identifier = str.isidentifier -else: - # Python 2 doesn't, but it's not that important anymore and if you tokenize - # Python 2 code with this, it's still ok. It's just that parsing Python 3 - # code with this function is not 100% correct. - # This just means that Python 2 code matches a few identifiers too much, - # but that doesn't really matter. - def is_identifier(s): - return True +BOM_UTF8_STRING = BOM_UTF8.decode('utf-8') + +_token_collection_cache: Dict[PythonVersionInfo, TokenCollection] = {} -def group(*choices, **kwargs): - capture = kwargs.pop('capture', False) # Python 2, arrghhhhh :( +def group(*choices, capture=False, **kwargs): assert not kwargs start = '(' @@ -76,19 +69,17 @@ def maybe(*choices): # Return the empty string, plus all of the valid string prefixes. -def _all_string_prefixes(version_info, include_fstring=False, only_fstring=False): +def _all_string_prefixes(*, include_fstring=False, only_fstring=False): def different_case_versions(prefix): for s in _itertools.product(*[(c, c.upper()) for c in prefix]): yield ''.join(s) # The valid string prefixes. Only contain the lower case versions, # and don't contain any permuations (include 'fr', but not # 'rf'). The various permutations will be generated. - valid_string_prefixes = ['b', 'r', 'u'] - if version_info.major >= 3: - valid_string_prefixes.append('br') + valid_string_prefixes = ['b', 'r', 'u', 'br'] - result = set(['']) - if version_info >= (3, 6) and include_fstring: + result = {''} + if include_fstring: f = ['f', 'fr'] if only_fstring: valid_string_prefixes = f @@ -104,10 +95,6 @@ def different_case_versions(prefix): # create a list with upper and lower versions of each # character result.update(different_case_versions(t)) - if version_info.major == 2: - # In Python 2 the order cannot just be random. - result.update(different_case_versions('ur')) - result.update(different_case_versions('br')) return result @@ -124,8 +111,14 @@ def _get_token_collection(version_info): return result -fstring_string_single_line = _compile(r'(?:\{\{|\}\}|\\(?:\r\n?|\n)|[^{}\r\n])+') -fstring_string_multi_line = _compile(r'(?:[^{}]+|\{\{|\}\})+') +unicode_character_name = r'[A-Za-z0-9\-]+(?: [A-Za-z0-9\-]+)*' +fstring_string_single_line = _compile( + r'(?:\{\{|\}\}|\\N\{' + unicode_character_name + + r'\}|\\(?:\r\n?|\n)|\\[^\r\nN]|[^{}\r\n\\])+' +) +fstring_string_multi_line = _compile( + r'(?:\{\{|\}\}|\\N\{' + unicode_character_name + r'\}|\\[^N]|[^{}\\])+' +) fstring_format_spec_single_line = _compile(r'(?:\\(?:\r\n?|\n)|[^{}\r\n])+') fstring_format_spec_multi_line = _compile(r'[^{}]+') @@ -136,53 +129,27 @@ def _create_token_collection(version_info): Whitespace = r'[ \f\t]*' whitespace = _compile(Whitespace) Comment = r'#[^\r\n]*' - # Python 2 is pretty much not working properly anymore, we just ignore - # parsing unicode properly, which is fine, I guess. - if version_info[0] == 2: - Name = r'([A-Za-z_0-9]+)' - elif sys.version_info[0] == 2: - # Unfortunately the regex engine cannot deal with the regex below, so - # just use this one. - Name = r'(\w+)' - else: - Name = u'([A-Za-z_0-9\u0080-' + MAX_UNICODE + ']+)' - - if version_info >= (3, 6): - Hexnumber = r'0[xX](?:_?[0-9a-fA-F])+' - Binnumber = r'0[bB](?:_?[01])+' - Octnumber = r'0[oO](?:_?[0-7])+' - Decnumber = r'(?:0(?:_?0)*|[1-9](?:_?[0-9])*)' - Intnumber = group(Hexnumber, Binnumber, Octnumber, Decnumber) - Exponent = r'[eE][-+]?[0-9](?:_?[0-9])*' - Pointfloat = group(r'[0-9](?:_?[0-9])*\.(?:[0-9](?:_?[0-9])*)?', - r'\.[0-9](?:_?[0-9])*') + maybe(Exponent) - Expfloat = r'[0-9](?:_?[0-9])*' + Exponent - Floatnumber = group(Pointfloat, Expfloat) - Imagnumber = group(r'[0-9](?:_?[0-9])*[jJ]', Floatnumber + r'[jJ]') - else: - Hexnumber = r'0[xX][0-9a-fA-F]+' - Binnumber = r'0[bB][01]+' - if version_info.major >= 3: - Octnumber = r'0[oO][0-7]+' - else: - Octnumber = '0[oO]?[0-7]+' - Decnumber = r'(?:0+|[1-9][0-9]*)' - Intnumber = group(Hexnumber, Binnumber, Octnumber, Decnumber) - if version_info[0] < 3: - Intnumber += '[lL]?' - Exponent = r'[eE][-+]?[0-9]+' - Pointfloat = group(r'[0-9]+\.[0-9]*', r'\.[0-9]+') + maybe(Exponent) - Expfloat = r'[0-9]+' + Exponent - Floatnumber = group(Pointfloat, Expfloat) - Imagnumber = group(r'[0-9]+[jJ]', Floatnumber + r'[jJ]') + Name = '([A-Za-z_0-9\u0080-' + MAX_UNICODE + ']+)' + + Hexnumber = r'0[xX](?:_?[0-9a-fA-F])+' + Binnumber = r'0[bB](?:_?[01])+' + Octnumber = r'0[oO](?:_?[0-7])+' + Decnumber = r'(?:0(?:_?0)*|[1-9](?:_?[0-9])*)' + Intnumber = group(Hexnumber, Binnumber, Octnumber, Decnumber) + Exponent = r'[eE][-+]?[0-9](?:_?[0-9])*' + Pointfloat = group(r'[0-9](?:_?[0-9])*\.(?:[0-9](?:_?[0-9])*)?', + r'\.[0-9](?:_?[0-9])*') + maybe(Exponent) + Expfloat = r'[0-9](?:_?[0-9])*' + Exponent + Floatnumber = group(Pointfloat, Expfloat) + Imagnumber = group(r'[0-9](?:_?[0-9])*[jJ]', Floatnumber + r'[jJ]') Number = group(Imagnumber, Floatnumber, Intnumber) # Note that since _all_string_prefixes includes the empty string, # StringPrefix can be the empty string (making it optional). - possible_prefixes = _all_string_prefixes(version_info) + possible_prefixes = _all_string_prefixes() StringPrefix = group(*possible_prefixes) - StringPrefixWithF = group(*_all_string_prefixes(version_info, include_fstring=True)) - fstring_prefixes = _all_string_prefixes(version_info, include_fstring=True, only_fstring=True) + StringPrefixWithF = group(*_all_string_prefixes(include_fstring=True)) + fstring_prefixes = _all_string_prefixes(include_fstring=True, only_fstring=True) FStringStart = group(*fstring_prefixes) # Tail end of ' string. @@ -205,9 +172,7 @@ def _create_token_collection(version_info): Bracket = '[][(){}]' - special_args = [r'\r\n?', r'\n', r'[;.,@]'] - if version_info >= (3, 0): - special_args.insert(0, r'\.\.\.') + special_args = [r'\.\.\.', r'\r\n?', r'\n', r'[;.,@]'] if version_info >= (3, 8): special_args.insert(0, ":=?") else: @@ -258,9 +223,7 @@ def _create_token_collection(version_info): ALWAYS_BREAK_TOKENS = (';', 'import', 'class', 'def', 'try', 'except', 'finally', 'while', 'with', 'return', 'continue', - 'break', 'del', 'pass', 'global', 'assert') - if version_info >= (3, 5): - ALWAYS_BREAK_TOKENS += ('async', 'nonlocal') + 'break', 'del', 'pass', 'global', 'assert', 'nonlocal') pseudo_token_compiled = _compile(PseudoToken) return TokenCollection( pseudo_token_compiled, single_quoted, triple_quoted, endpats, @@ -268,9 +231,14 @@ def _create_token_collection(version_info): ) -class Token(namedtuple('Token', ['type', 'string', 'start_pos', 'prefix'])): +class Token(NamedTuple): + type: PythonTokenTypes + string: str + start_pos: Tuple[int, int] + prefix: str + @property - def end_pos(self): + def end_pos(self) -> Tuple[int, int]: lines = split_lines(self.string) if len(lines) > 1: return self.start_pos[0] + len(lines) - 1, 0 @@ -284,7 +252,7 @@ def __repr__(self): self._replace(type=self.type.name)) -class FStringNode(object): +class FStringNode: def __init__(self, quote): self.quote = quote self.parentheses_count = 0 @@ -371,10 +339,12 @@ def _find_fstring_string(endpats, fstring_stack, line, lnum, pos): return string, new_pos -def tokenize(code, version_info, start_pos=(1, 0)): +def tokenize( + code: str, *, version_info: PythonVersionInfo, start_pos: Tuple[int, int] = (1, 0) +) -> Iterator[PythonToken]: """Generate tokens from a the source code (string).""" lines = split_lines(code, keepends=True) - return tokenize_lines(lines, version_info, start_pos=start_pos) + return tokenize_lines(lines, version_info=version_info, start_pos=start_pos) def _print_tokens(func): @@ -390,7 +360,14 @@ def wrapper(*args, **kwargs): # @_print_tokens -def tokenize_lines(lines, version_info, start_pos=(1, 0), indents=None, is_first_token=True): +def tokenize_lines( + lines: Iterable[str], + *, + version_info: PythonVersionInfo, + indents: List[int] = None, + start_pos: Tuple[int, int] = (1, 0), + is_first_token=True, +) -> Iterator[PythonToken]: """ A heavily modified Python standard library tokenizer. @@ -416,7 +393,9 @@ def dedent_if_necessary(start): max_ = 0 numchars = '0123456789' contstr = '' - contline = None + contline: str + contstr_start: Tuple[int, int] + endprog: Pattern # We start with a newline. This makes indent at the first position # possible. It's not valid Python, but still better than an INDENT in the # second line (and not in the first). This makes quite a few things in @@ -425,7 +404,7 @@ def dedent_if_necessary(start): prefix = '' # Should never be required, but here for safety additional_prefix = '' lnum = start_pos[0] - 1 - fstring_stack = [] + fstring_stack: List[FStringNode] = [] for line in lines: # loop over lines in stream lnum += 1 pos = 0 @@ -444,14 +423,14 @@ def dedent_if_necessary(start): is_first_token = False if contstr: # continued string - endmatch = endprog.match(line) + endmatch = endprog.match(line) # noqa: F821 if endmatch: pos = endmatch.end(0) yield PythonToken( STRING, contstr + line[:pos], - contstr_start, prefix) + contstr_start, prefix) # noqa: F821 contstr = '' - contline = None + contline = '' else: contstr = contstr + line contline = contline + line @@ -528,14 +507,12 @@ def dedent_if_necessary(start): if indent_start > indents[-1]: yield PythonToken(INDENT, '', spos, '') indents.append(indent_start) - for t in dedent_if_necessary(indent_start): - yield t + yield from dedent_if_necessary(indent_start) if not pseudomatch: # scan for tokens match = whitespace.match(line, pos) if new_line and paren_level == 0 and not fstring_stack: - for t in dedent_if_necessary(match.end()): - yield t + yield from dedent_if_necessary(match.end()) pos = match.end() new_line = False yield PythonToken( @@ -556,18 +533,14 @@ def dedent_if_necessary(start): # We only want to dedent if the token is on a new line. m = re.match(r'[ \f\t]*$', line[:start]) if m is not None: - for t in dedent_if_necessary(m.end()): - yield t - if is_identifier(token): + yield from dedent_if_necessary(m.end()) + if token.isidentifier(): yield PythonToken(NAME, token, spos, prefix) else: - for t in _split_illegal_unicode_name(token, spos, prefix): - yield t # yield from Python 2 + yield from _split_illegal_unicode_name(token, spos, prefix) elif initial in '\r\n': if any(not f.allow_multiline() for f in fstring_stack): - # Would use fstring_stack.clear, but that's not available - # in Python 2. - fstring_stack[:] = [] + fstring_stack.clear() if not new_line and paren_level == 0 and not fstring_stack: yield PythonToken(NEWLINE, token, spos, prefix) @@ -575,7 +548,7 @@ def dedent_if_necessary(start): additional_prefix = prefix + token new_line = True elif initial == '#': # Comments - assert not token.endswith("\n") + assert not token.endswith("\n") and not token.endswith("\r") if fstring_stack and fstring_stack[-1].is_in_expr(): # `#` is not allowed in f-string expressions yield PythonToken(ERRORTOKEN, initial, spos, prefix) @@ -681,7 +654,7 @@ def create_token(): pos = start_pos for i, char in enumerate(token): if is_illegal: - if is_identifier(char): + if char.isidentifier(): yield create_token() found = char is_illegal = False @@ -691,7 +664,7 @@ def create_token(): found += char else: new_found = found + char - if is_identifier(new_found): + if new_found.isidentifier(): found = new_found else: if found: @@ -706,17 +679,9 @@ def create_token(): if __name__ == "__main__": - if len(sys.argv) >= 2: - path = sys.argv[1] - with open(path) as f: - code = f.read() - else: - code = sys.stdin.read() - - from parso.utils import python_bytes_to_unicode, parse_version_string - - if isinstance(code, bytes): - code = python_bytes_to_unicode(code) + path = sys.argv[1] + with open(path) as f: + code = f.read() - for token in tokenize(code, parse_version_string()): + for token in tokenize(code, version_info=parse_version_string('3.10')): print(token) diff --git a/anaconda_lib/parso/python/tree.py b/anaconda_lib/parso/python/tree.py index 42fb9be6..ebb40870 100644 --- a/anaconda_lib/parso/python/tree.py +++ b/anaconda_lib/parso/python/tree.py @@ -1,5 +1,5 @@ """ -This is the syntax tree for Python syntaxes (2 & 3). The classes represent +This is the syntax tree for Python 3 syntaxes. The classes represent syntax elements like functions and imports. All of the nodes can be traced back to the `Python grammar file @@ -47,10 +47,9 @@ from collections.abc import Mapping except ImportError: from collections import Mapping +from typing import Tuple -from parso._compatibility import utf8_repr, unicode -from parso.tree import Node, BaseNode, Leaf, ErrorNode, ErrorLeaf, \ - search_ancestor +from parso.tree import Node, BaseNode, Leaf, ErrorNode, ErrorLeaf, search_ancestor # noqa from parso.python.prefix import split_prefix from parso.utils import split_lines @@ -64,12 +63,12 @@ _GET_DEFINITION_TYPES = set([ 'expr_stmt', 'sync_comp_for', 'with_stmt', 'for_stmt', 'import_name', - 'import_from', 'param', 'del_stmt', + 'import_from', 'param', 'del_stmt', 'namedexpr_test', ]) _IMPORTS = set(['import_name', 'import_from']) -class DocstringMixin(object): +class DocstringMixin: __slots__ = () def get_doc_node(self): @@ -97,7 +96,7 @@ def get_doc_node(self): return None -class PythonMixin(object): +class PythonMixin: """ Some Python specific utilities. """ @@ -150,7 +149,7 @@ class _LeafWithoutNewlines(PythonLeaf): __slots__ = () @property - def end_pos(self): + def end_pos(self) -> Tuple[int, int]: return self.line, self.column + len(self.value) @@ -175,7 +174,6 @@ class EndMarker(_LeafWithoutNewlines): __slots__ = () type = 'endmarker' - @utf8_repr def __repr__(self): return "<%s: prefix=%s end_pos=%s>" % ( type(self).__name__, repr(self.prefix), self.end_pos @@ -187,7 +185,6 @@ class Newline(PythonLeaf): __slots__ = () type = 'newline' - @utf8_repr def __repr__(self): return "<%s: %s>" % (type(self).__name__, repr(self.value)) @@ -227,9 +224,6 @@ def get_definition(self, import_name_always=False, include_setitem=False): return None if type_ == 'except_clause': - # TODO in Python 2 this doesn't work correctly. See grammar file. - # I think we'll just let it be. Python 2 will be gone in a few - # years. if self.get_previous_sibling() == 'as': return node.parent # The try_stmt. return None @@ -237,8 +231,6 @@ def get_definition(self, import_name_always=False, include_setitem=False): while node is not None: if node.type == 'suite': return None - if node.type == 'namedexpr_test': - return node.children[0] if node.type in _GET_DEFINITION_TYPES: if self in node.get_defined_names(include_setitem): return node @@ -302,21 +294,17 @@ class FStringEnd(PythonLeaf): __slots__ = () -class _StringComparisonMixin(object): +class _StringComparisonMixin: def __eq__(self, other): """ Make comparisons with strings easy. Improves the readability of the parser. """ - if isinstance(other, (str, unicode)): + if isinstance(other, str): return self.value == other return self is other - def __ne__(self, other): - """Python 2 compatibility.""" - return not self.__eq__(other) - def __hash__(self): return hash(self.value) @@ -340,7 +328,7 @@ class Scope(PythonBaseNode, DocstringMixin): __slots__ = () def __init__(self, children): - super(Scope, self).__init__(children) + super().__init__(children) def iter_funcdefs(self): """ @@ -366,8 +354,7 @@ def scan(children): if element.type in names: yield element if element.type in _FUNC_CONTAINERS: - for e in scan(element.children): - yield e + yield from scan(element.children) return scan(self.children) @@ -397,7 +384,7 @@ class Module(Scope): type = 'file_input' def __init__(self, children): - super(Module, self).__init__(children) + super().__init__(children) self._used_names = None def _iter_future_import_names(self): @@ -416,18 +403,6 @@ def _iter_future_import_names(self): if len(names) == 2 and names[0] == '__future__': yield names[1] - def _has_explicit_absolute_import(self): - """ - Checks if imports in this module are explicitly absolute, i.e. there - is a ``__future__`` import. - Currently not public, might be in the future. - :return bool: - """ - for name in self._iter_future_import_names(): - if name == 'absolute_import': - return True - return False - def get_used_names(self): """ Returns all the :class:`Name` leafs that exist in this module. This @@ -493,7 +468,7 @@ class Class(ClassOrFunc): __slots__ = () def __init__(self, children): - super(Class, self).__init__(children) + super().__init__(children) def get_super_arglist(self): """ @@ -520,24 +495,13 @@ def _create_params(parent, argslist_list): You could also say that this function replaces the argslist node with a list of Param objects. """ - def check_python2_nested_param(node): - """ - Python 2 allows params to look like ``def x(a, (b, c))``, which is - basically a way of unpacking tuples in params. Python 3 has ditched - this behavior. Jedi currently just ignores those constructs. - """ - return node.type == 'fpdef' and node.children[0] == '(' - try: first = argslist_list[0] except IndexError: return [] if first.type in ('name', 'fpdef'): - if check_python2_nested_param(first): - return [first] - else: - return [Param([first], parent)] + return [Param([first], parent)] elif first == '*': return [first] else: # argslist is a `typedargslist` or a `varargslist`. @@ -555,7 +519,6 @@ def check_python2_nested_param(node): if param_children[0] == '*' \ and (len(param_children) == 1 or param_children[1] == ',') \ - or check_python2_nested_param(param_children[0]) \ or param_children[0] == '/': for p in param_children: p.parent = parent @@ -583,9 +546,13 @@ class Function(ClassOrFunc): type = 'funcdef' def __init__(self, children): - super(Function, self).__init__(children) + super().__init__(children) parameters = self.children[2] # After `def foo` - parameters.children[1:-1] = _create_params(parameters, parameters.children[1:-1]) + parameters_children = parameters.children[1:-1] + # If input parameters list already has Param objects, keep it as is; + # otherwise, convert it to a list of Param objects. + if not any(isinstance(child, Param) for child in parameters_children): + parameters.children[1:-1] = _create_params(parameters, parameters_children) def _get_param_nodes(self): return self.children[2].children @@ -618,8 +585,7 @@ def scan(children): else: yield element else: - for result in scan(nested_children): - yield result + yield from scan(nested_children) return scan(self.children) @@ -633,8 +599,7 @@ def scan(children): or element.type == 'keyword' and element.value == 'return': yield element if element.type in _RETURN_STMT_CONTAINERS: - for e in scan(element.children): - yield e + yield from scan(element.children) return scan(self.children) @@ -648,8 +613,7 @@ def scan(children): or element.type == 'keyword' and element.value == 'raise': yield element if element.type in _RETURN_STMT_CONTAINERS: - for e in scan(element.children): - yield e + yield from scan(element.children) return scan(self.children) @@ -691,7 +655,11 @@ def __init__(self, children): # We don't want to call the Function constructor, call its parent. super(Function, self).__init__(children) # Everything between `lambda` and the `:` operator is a parameter. - self.children[1:-2] = _create_params(self, self.children[1:-2]) + parameters_children = self.children[1:-2] + # If input children list already has Param objects, keep it as is; + # otherwise, convert it to a list of Param objects. + if not any(isinstance(child, Param) for child in parameters_children): + self.children[1:-2] = _create_params(self, parameters_children) @property def name(self): @@ -815,8 +783,8 @@ def get_defined_names(self, include_setitem=False): return names def get_test_node_from_name(self, name): - node = name.parent - if node.type != 'with_item': + node = name.search_ancestor("with_item") + if node is None: raise ValueError('The name is not actually part of a with statement.') return node.children[0] @@ -1101,8 +1069,14 @@ def yield_operators(self): first = first.children[2] yield first - for operator in self.children[3::2]: - yield operator + yield from self.children[3::2] + + +class NamedExpr(PythonBaseNode): + type = 'namedexpr_test' + + def get_defined_names(self, include_setitem=False): + return _defined_names(self.children[0], include_setitem) class Param(PythonBaseNode): @@ -1113,11 +1087,9 @@ class Param(PythonBaseNode): """ type = 'param' - def __init__(self, children, parent): - super(Param, self).__init__(children) + def __init__(self, children, parent=None): + super().__init__(children) self.parent = parent - for child in children: - child.parent = self @property def star_count(self): @@ -1204,7 +1176,7 @@ def get_parent_function(self): """ Returns the function/lambda of a parameter. """ - return search_ancestor(self, 'funcdef', 'lambdef') + return self.search_ancestor('funcdef', 'lambdef') def get_code(self, include_prefix=True, include_comma=True): """ @@ -1214,7 +1186,7 @@ def get_code(self, include_prefix=True, include_comma=True): :param include_comma bool: If enabled includes the comma in the string output. """ if include_comma: - return super(Param, self).get_code(include_prefix) + return super().get_code(include_prefix) children = self.children if children[-1] == ',': diff --git a/anaconda_lib/parso/tree.py b/anaconda_lib/parso/tree.py index 5e668cf4..e5298711 100644 --- a/anaconda_lib/parso/tree.py +++ b/anaconda_lib/parso/tree.py @@ -1,34 +1,41 @@ -import sys from abc import abstractmethod, abstractproperty +from typing import List, Optional, Tuple, Union -from parso._compatibility import utf8_repr, encoding from parso.utils import split_lines -def search_ancestor(node, *node_types): +def search_ancestor(node: 'NodeOrLeaf', *node_types: str) -> 'Optional[BaseNode]': """ Recursively looks at the parents of a node and returns the first found node - that matches node_types. Returns ``None`` if no matching node is found. + that matches ``node_types``. Returns ``None`` if no matching node is found. + + This function is deprecated, use :meth:`NodeOrLeaf.search_ancestor` instead. :param node: The ancestors of this node will be checked. :param node_types: type names that are searched for. - :type node_types: tuple of str """ - while True: - node = node.parent - if node is None or node.type in node_types: - return node + n = node.parent + while n is not None: + if n.type in node_types: + return n + n = n.parent + return None -class NodeOrLeaf(object): +class NodeOrLeaf: """ The base class for nodes and leaves. """ - __slots__ = () - type = None + __slots__ = ('parent',) + type: str ''' The type is a string that typically matches the types of the grammar file. ''' + parent: 'Optional[BaseNode]' + ''' + The parent :class:`BaseNode` of this node or leaf. + None if this is the root node. + ''' def get_root_node(self): """ @@ -127,7 +134,7 @@ def get_next_leaf(self): return node @abstractproperty - def start_pos(self): + def start_pos(self) -> Tuple[int, int]: """ Returns the starting position of the prefix as a tuple, e.g. `(3, 4)`. @@ -135,7 +142,7 @@ def start_pos(self): """ @abstractproperty - def end_pos(self): + def end_pos(self) -> Tuple[int, int]: """ Returns the end position of the prefix as a tuple, e.g. `(3, 4)`. @@ -168,21 +175,125 @@ def get_last_leaf(self): @abstractmethod def get_code(self, include_prefix=True): """ - Returns the code that was input the input for the parser for this node. + Returns the code that was the input for the parser for this node. :param include_prefix: Removes the prefix (whitespace and comments) of e.g. a statement. """ + def search_ancestor(self, *node_types: str) -> 'Optional[BaseNode]': + """ + Recursively looks at the parents of this node or leaf and returns the + first found node that matches ``node_types``. Returns ``None`` if no + matching node is found. + + :param node_types: type names that are searched for. + """ + node = self.parent + while node is not None: + if node.type in node_types: + return node + node = node.parent + return None + + def dump(self, *, indent: Optional[Union[int, str]] = 4) -> str: + """ + Returns a formatted dump of the parser tree rooted at this node or leaf. This is + mainly useful for debugging purposes. + + The ``indent`` parameter is interpreted in a similar way as :py:func:`ast.dump`. + If ``indent`` is a non-negative integer or string, then the tree will be + pretty-printed with that indent level. An indent level of 0, negative, or ``""`` + will only insert newlines. ``None`` selects the single line representation. + Using a positive integer indent indents that many spaces per level. If + ``indent`` is a string (such as ``"\\t"``), that string is used to indent each + level. + + :param indent: Indentation style as described above. The default indentation is + 4 spaces, which yields a pretty-printed dump. + + >>> import parso + >>> print(parso.parse("lambda x, y: x + y").dump()) + Module([ + Lambda([ + Keyword('lambda', (1, 0)), + Param([ + Name('x', (1, 7), prefix=' '), + Operator(',', (1, 8)), + ]), + Param([ + Name('y', (1, 10), prefix=' '), + ]), + Operator(':', (1, 11)), + PythonNode('arith_expr', [ + Name('x', (1, 13), prefix=' '), + Operator('+', (1, 15), prefix=' '), + Name('y', (1, 17), prefix=' '), + ]), + ]), + EndMarker('', (1, 18)), + ]) + """ + if indent is None: + newline = False + indent_string = '' + elif isinstance(indent, int): + newline = True + indent_string = ' ' * indent + elif isinstance(indent, str): + newline = True + indent_string = indent + else: + raise TypeError(f"expect 'indent' to be int, str or None, got {indent!r}") + + def _format_dump(node: NodeOrLeaf, indent: str = '', top_level: bool = True) -> str: + result = '' + node_type = type(node).__name__ + if isinstance(node, Leaf): + result += f'{indent}{node_type}(' + if isinstance(node, ErrorLeaf): + result += f'{node.token_type!r}, ' + elif isinstance(node, TypedLeaf): + result += f'{node.type!r}, ' + result += f'{node.value!r}, {node.start_pos!r}' + if node.prefix: + result += f', prefix={node.prefix!r}' + result += ')' + elif isinstance(node, BaseNode): + result += f'{indent}{node_type}(' + if isinstance(node, Node): + result += f'{node.type!r}, ' + result += '[' + if newline: + result += '\n' + for child in node.children: + result += _format_dump(child, indent=indent + indent_string, top_level=False) + result += f'{indent}])' + else: # pragma: no cover + # We shouldn't ever reach here, unless: + # - `NodeOrLeaf` is incorrectly subclassed else where + # - or a node's children list contains invalid nodes or leafs + # Both are unexpected internal errors. + raise TypeError(f'unsupported node encountered: {node!r}') + if not top_level: + if newline: + result += ',\n' + else: + result += ', ' + return result + + return _format_dump(self) + class Leaf(NodeOrLeaf): ''' Leafs are basically tokens with a better API. Leafs exactly know where they were defined and what text preceeds them. ''' - __slots__ = ('value', 'parent', 'line', 'column', 'prefix') + __slots__ = ('value', 'line', 'column', 'prefix') + prefix: str - def __init__(self, value, start_pos, prefix=''): + def __init__(self, value: str, start_pos: Tuple[int, int], prefix: str = '') -> None: self.value = value ''' :py:func:`str` The value of the current token. @@ -193,17 +304,17 @@ def __init__(self, value, start_pos, prefix=''): :py:func:`str` Typically a mixture of whitespace and comments. Stuff that is syntactically irrelevant for the syntax tree. ''' - self.parent = None + self.parent: Optional[BaseNode] = None ''' The parent :class:`BaseNode` of this leaf. ''' @property - def start_pos(self): + def start_pos(self) -> Tuple[int, int]: return self.line, self.column @start_pos.setter - def start_pos(self, value): + def start_pos(self, value: Tuple[int, int]) -> None: self.line = value[0] self.column = value[1] @@ -228,7 +339,7 @@ def get_code(self, include_prefix=True): return self.value @property - def end_pos(self): + def end_pos(self) -> Tuple[int, int]: lines = split_lines(self.value) end_pos_line = self.line + len(lines) - 1 # Check for multiline token @@ -238,7 +349,6 @@ def end_pos(self): end_pos_column = len(lines[-1]) return end_pos_line, end_pos_column - @utf8_repr def __repr__(self): value = self.value if not value: @@ -250,7 +360,7 @@ class TypedLeaf(Leaf): __slots__ = ('type',) def __init__(self, type, value, start_pos, prefix=''): - super(TypedLeaf, self).__init__(value, start_pos, prefix) + super().__init__(value, start_pos, prefix) self.type = type @@ -259,29 +369,30 @@ class BaseNode(NodeOrLeaf): The super class for all nodes. A node has children, a type and possibly a parent node. """ - __slots__ = ('children', 'parent') - type = None + __slots__ = ('children',) - def __init__(self, children): + def __init__(self, children: List[NodeOrLeaf]) -> None: self.children = children """ A list of :class:`NodeOrLeaf` child nodes. """ - self.parent = None + self.parent: Optional[BaseNode] = None ''' - The parent :class:`BaseNode` of this leaf. + The parent :class:`BaseNode` of this node. None if this is the root node. ''' + for child in children: + child.parent = self @property - def start_pos(self): + def start_pos(self) -> Tuple[int, int]: return self.children[0].start_pos def get_start_pos_of_prefix(self): return self.children[0].get_start_pos_of_prefix() @property - def end_pos(self): + def end_pos(self) -> Tuple[int, int]: return self.children[-1].end_pos def _get_code_for_children(self, children, include_prefix): @@ -315,7 +426,6 @@ def binary_search(lower, upper): except AttributeError: return element - index = int((lower + upper) / 2) element = self.children[index] if position <= element.end_pos: @@ -333,11 +443,8 @@ def get_first_leaf(self): def get_last_leaf(self): return self.children[-1].get_last_leaf() - @utf8_repr def __repr__(self): code = self.get_code().replace('\n', ' ').replace('\r', ' ').strip() - if not sys.version_info.major >= 3: - code = code.encode(encoding, 'replace') return "<%s: %s@%s,%s>" % \ (type(self).__name__, code, self.start_pos[0], self.start_pos[1]) @@ -347,7 +454,7 @@ class Node(BaseNode): __slots__ = ('type',) def __init__(self, type, children): - super(Node, self).__init__(children) + super().__init__(children) self.type = type def __repr__(self): @@ -373,7 +480,7 @@ class ErrorLeaf(Leaf): type = 'error_leaf' def __init__(self, token_type, value, start_pos, prefix=''): - super(ErrorLeaf, self).__init__(value, start_pos, prefix) + super().__init__(value, start_pos, prefix) self.token_type = token_type def __repr__(self): diff --git a/anaconda_lib/parso/utils.py b/anaconda_lib/parso/utils.py index 5a49c32c..6ad1ea26 100644 --- a/anaconda_lib/parso/utils.py +++ b/anaconda_lib/parso/utils.py @@ -1,30 +1,32 @@ -from collections import namedtuple import re import sys from ast import literal_eval from functools import total_ordering - -from parso._compatibility import unicode +from typing import NamedTuple, Sequence, Union # The following is a list in Python that are line breaks in str.splitlines, but # not in Python. In Python only \r (Carriage Return, 0xD) and \n (Line Feed, # 0xA) are allowed to split lines. _NON_LINE_BREAKS = ( - u'\v', # Vertical Tabulation 0xB - u'\f', # Form Feed 0xC - u'\x1C', # File Separator - u'\x1D', # Group Separator - u'\x1E', # Record Separator - u'\x85', # Next Line (NEL - Equivalent to CR+LF. - # Used to mark end-of-line on some IBM mainframes.) - u'\u2028', # Line Separator - u'\u2029', # Paragraph Separator + '\v', # Vertical Tabulation 0xB + '\f', # Form Feed 0xC + '\x1C', # File Separator + '\x1D', # Group Separator + '\x1E', # Record Separator + '\x85', # Next Line (NEL - Equivalent to CR+LF. + # Used to mark end-of-line on some IBM mainframes.) + '\u2028', # Line Separator + '\u2029', # Paragraph Separator ) -Version = namedtuple('Version', 'major, minor, micro') + +class Version(NamedTuple): + major: int + minor: int + micro: int -def split_lines(string, keepends=False): +def split_lines(string: str, keepends: bool = False) -> Sequence[str]: r""" Intended for Python code. In contrast to Python's :py:meth:`str.splitlines`, looks at form feeds and other special characters as normal text. Just @@ -68,7 +70,9 @@ def split_lines(string, keepends=False): return re.split(r'\n|\r\n|\r', string) -def python_bytes_to_unicode(source, encoding='utf-8', errors='strict'): +def python_bytes_to_unicode( + source: Union[str, bytes], encoding: str = 'utf-8', errors: str = 'strict' +) -> str: """ Checks for unicode BOMs and PEP 263 encoding declarations. Then returns a unicode object like in :py:meth:`bytes.decode`. @@ -88,28 +92,37 @@ def detect_encoding(): # UTF-8 byte-order mark return 'utf-8' - first_two_lines = re.match(br'(?:[^\n]*\n){0,2}', source).group(0) + first_two_lines = re.match(br'(?:[^\r\n]*(?:\r\n|\r|\n)){0,2}', source).group(0) possible_encoding = re.search(br"coding[=:]\s*([-\w.]+)", first_two_lines) if possible_encoding: - return possible_encoding.group(1) + e = possible_encoding.group(1) + if not isinstance(e, str): + e = str(e, 'ascii', 'replace') + return e else: # the default if nothing else has been set -> PEP 263 return encoding - if isinstance(source, unicode): + if isinstance(source, str): # only cast str/bytes return source encoding = detect_encoding() - if not isinstance(encoding, unicode): - encoding = unicode(encoding, 'utf-8', 'replace') - - # Cast to unicode - return unicode(source, encoding, errors) - - -def version_info(): + try: + # Cast to unicode + return str(source, encoding, errors) + except LookupError: + if errors == 'replace': + # This is a weird case that can happen if the given encoding is not + # a valid encoding. This usually shouldn't happen with provided + # encodings, but can happen if somebody uses encoding declarations + # like `# coding: foo-8`. + return str(source, 'utf-8', errors) + raise + + +def version_info() -> Version: """ Returns a namedtuple of parso's version, similar to Python's ``sys.version_info``. @@ -119,35 +132,19 @@ def version_info(): return Version(*[x if i == 3 else int(x) for i, x in enumerate(tupl)]) -def _parse_version(version): - match = re.match(r'(\d+)(?:\.(\d)(?:\.\d+)?)?$', version) - if match is None: - raise ValueError('The given version is not in the right format. ' - 'Use something like "3.8" or "3".') - - major = int(match.group(1)) - minor = match.group(2) - if minor is None: - # Use the latest Python in case it's not exactly defined, because the - # grammars are typically backwards compatible? - if major == 2: - minor = "7" - elif major == 3: - minor = "6" - else: - raise NotImplementedError("Sorry, no support yet for those fancy new/old versions.") - minor = int(minor) - return PythonVersionInfo(major, minor) +class _PythonVersionInfo(NamedTuple): + major: int + minor: int @total_ordering -class PythonVersionInfo(namedtuple('Version', 'major, minor')): +class PythonVersionInfo(_PythonVersionInfo): def __gt__(self, other): if isinstance(other, tuple): if len(other) != 2: raise ValueError("Can only compare to tuples of length 2.") return (self.major, self.minor) > other - super(PythonVersionInfo, self).__gt__(other) + super().__gt__(other) return (self.major, self.minor) @@ -156,21 +153,42 @@ def __eq__(self, other): if len(other) != 2: raise ValueError("Can only compare to tuples of length 2.") return (self.major, self.minor) == other - super(PythonVersionInfo, self).__eq__(other) + super().__eq__(other) def __ne__(self, other): return not self.__eq__(other) -def parse_version_string(version=None): +def _parse_version(version) -> PythonVersionInfo: + match = re.match(r'(\d+)(?:\.(\d{1,2})(?:\.\d+)?)?((a|b|rc)\d)?$', version) + if match is None: + raise ValueError('The given version is not in the right format. ' + 'Use something like "3.8" or "3".') + + major = int(match.group(1)) + minor = match.group(2) + if minor is None: + # Use the latest Python in case it's not exactly defined, because the + # grammars are typically backwards compatible? + if major == 2: + minor = "7" + elif major == 3: + minor = "6" + else: + raise NotImplementedError("Sorry, no support yet for those fancy new/old versions.") + minor = int(minor) + return PythonVersionInfo(major, minor) + + +def parse_version_string(version: str = None) -> PythonVersionInfo: """ - Checks for a valid version number (e.g. `3.8` or `2.7.1` or `3`) and + Checks for a valid version number (e.g. `3.8` or `3.10.1` or `3`) and returns a corresponding version info that is always two characters long in decimal. """ if version is None: version = '%s.%s' % sys.version_info[:2] - if not isinstance(version, (unicode, str)): + if not isinstance(version, str): raise TypeError('version must be a string like "3.8"') return _parse_version(version) diff --git a/anaconda_server/commands/autocomplete.py b/anaconda_server/commands/autocomplete.py index 9aa8d597..ecef77af 100644 --- a/anaconda_server/commands/autocomplete.py +++ b/anaconda_server/commands/autocomplete.py @@ -1,4 +1,3 @@ - # Copyright (C) 2013 - Oscar Campos # This program is Free Software see LICENSE file for details @@ -11,28 +10,28 @@ class AutoComplete(Command): - """Return Jedi completions - """ + """Return Jedi completions""" - def __init__(self, callback, uid, script): + def __init__(self, callback, line, col, uid, script): self.script = script + self.line = line + self.col = col super(AutoComplete, self).__init__(callback, uid) def run(self): - """Run the command - """ + """Run the command""" try: - completions = self.script.completions() + completions = self.script.complete(line=self.line, column=self.col) if DEBUG_MODE is True: logging.info(completions) data = [ ('{0}\t{1}'.format(comp.name, comp.type), comp.name) for comp in completions ] - self.callback({ - 'success': True, 'completions': data, 'uid': self.uid - }) + self.callback( + {'success': True, 'completions': data, 'uid': self.uid} + ) except Exception as error: msg = 'The underlying Jedi library as raised an exception' logging.error(msg) @@ -41,6 +40,6 @@ def run(self): if DEBUG_MODE: logging.debug(traceback.format_exc()) - self.callback({ - 'success': False, 'error': str(error), 'uid': self.uid - }) + self.callback( + {'success': False, 'error': str(error), 'uid': self.uid} + ) diff --git a/anaconda_server/commands/complete_parameters.py b/anaconda_server/commands/complete_parameters.py index e12477a3..797bc686 100644 --- a/anaconda_server/commands/complete_parameters.py +++ b/anaconda_server/commands/complete_parameters.py @@ -1,4 +1,3 @@ - # Copyright (C) 2013 - Oscar Campos # This program is Free Software see LICENSE file for details @@ -7,23 +6,25 @@ class CompleteParameters(Command): - """Get back a python definition where to go - """ + """Get back a python definition where to go""" - def __init__(self, callback, uid, script, settings): + def __init__(self, callback, line, col, uid, script, settings): self.script = script + self.line = line + self.col = col self.settings = settings super(CompleteParameters, self).__init__(callback, uid) def run(self): - """Run the command - """ + """Run the command""" completions = [] complete_all = self.settings.get('complete_all_parameters', False) try: - signatures = self.script.call_signatures()[0] + signatures = self.script.get_signatures( + line=self.line, column=self.col + )[0] except IndexError: signatures = None @@ -42,8 +43,10 @@ def run(self): if complete_all is True: completions.append('%s=${%d:%s}' % (name, i + 1, value)) - self.callback({ - 'success': True, - 'template': ', '.join(completions), - 'uid': self.uid - }) + self.callback( + { + 'success': True, + 'template': ', '.join(completions), + 'uid': self.uid, + } + ) diff --git a/anaconda_server/commands/doc.py b/anaconda_server/commands/doc.py index 1d30c731..c27f5d32 100644 --- a/anaconda_server/commands/doc.py +++ b/anaconda_server/commands/doc.py @@ -1,4 +1,3 @@ - # Copyright (C) 2013 - Oscar Campos # This program is Free Software see LICENSE file for details @@ -14,7 +13,8 @@ # imported, this command just crashes and forces a JsonServer new instance if sys.version_info >= (3, 0): import html - if sys .version_info < (3, 4): + + if sys.version_info < (3, 4): import html as cgi from html.parser import HTMLParser else: @@ -24,21 +24,21 @@ class Doc(Command): - """Get back a python definition where to go - """ + """Get back a python definition where to go""" - def __init__(self, callback, uid, script, html): + def __init__(self, callback, line, col, uid, script, html): self.script = script self.html = html + self.line = line + self.col = col super(Doc, self).__init__(callback, uid) def run(self): - """Run the command - """ + """Run the command""" processed = [] try: - definitions = self.script.goto_definitions() + definitions = self.script.infer(line=self.line, column=self.col) except Exception as error: logging.debug(error) logging.debug(self.script) @@ -53,33 +53,36 @@ def run(self): for definition in definitions: if definition not in processed: docs.append( - self._plain(definition) if not self.html + self._plain(definition) + if not self.html else self._html(definition) ) processed.append(definition) - self.callback({ - 'success': success, - 'doc': ('

' if self.html - else '\n' + '-' * 79 + '\n').join(docs), - 'uid': self.uid - }) + self.callback( + { + 'success': success, + 'doc': ( + '

' if self.html else '\n' + '-' * 79 + '\n' + ).join(docs), + 'uid': self.uid, + } + ) def _plain(sef, definition): - """Generate a documentation string for use as plain text - """ + """Generate a documentation string for use as plain text""" return 'Docstring for {0}\n{1}\n{2}'.format( definition.full_name, '=' * 40, definition.docstring() ) def _html(self, definition): - """Generate documentation string in HTML format - """ + """Generate documentation string in HTML format""" if sys.version_info >= (3, 4): escaped_doc = html.escape( - html.unescape(definition.docstring()), quote=False) + html.unescape(definition.docstring()), quote=False + ) else: try: escaped_doc = cgi.escape( diff --git a/anaconda_server/commands/find_usages.py b/anaconda_server/commands/find_usages.py index 446a3c82..bf4dd9fe 100644 --- a/anaconda_server/commands/find_usages.py +++ b/anaconda_server/commands/find_usages.py @@ -1,4 +1,3 @@ - # Copyright (C) 2013 - Oscar Campos # This program is Free Software see LICENSE file for details @@ -6,39 +5,51 @@ class FindUsages(Command): - """Get back a python usages for the given object - """ + """Get back a python usages for the given object""" - def __init__(self, callback, uid, script): + def __init__(self, callback, line, col, uid, script): self.script = script + self.line = line + self.col = col super(FindUsages, self).__init__(callback, uid) def run(self): - """Run the command - """ + """Run the command""" try: - usages = self.script.usages() + usages = self.script.get_references( + line=self.line, column=self.col + ) success = True except: usages = None success = False try: - self.callback({ - 'success': success, - 'result': [ - (i.full_name, i.module_path, i.line, i.column) - for i in usages if not i.in_builtin_module() - ] if usages is not None else [], - 'uid': self.uid - }) + self.callback( + { + 'success': success, + 'result': [ + (i.full_name, i.module_path, i.line, i.column) + for i in usages + if not i.in_builtin_module() + ] + if usages is not None + else [], + 'uid': self.uid, + } + ) except ValueError: - self.callback({ - 'success': success, - 'result': [ - (i.name, i.module_path, i.line, i.column) - for i in usages if not i.in_builtin_module() - ] if usages is not None else [], - 'uid': self.uid - }) + self.callback( + { + 'success': success, + 'result': [ + (i.name, i.module_path, i.line, i.column) + for i in usages + if not i.in_builtin_module() + ] + if usages is not None + else [], + 'uid': self.uid, + } + ) diff --git a/anaconda_server/commands/goto.py b/anaconda_server/commands/goto.py index 4fb362f2..07fabb70 100644 --- a/anaconda_server/commands/goto.py +++ b/anaconda_server/commands/goto.py @@ -1,4 +1,3 @@ - # Copyright (C) 2013 - Oscar Campos # This program is Free Software see LICENSE file for details @@ -6,22 +5,24 @@ class Goto(Command): - """Get back a python definition where to go - """ + """Get back a python definition where to go""" - def __init__(self, callback, uid, script): + def __init__(self, callback, line, col, uid, script): self.script = script + self.line = line + self.col = col super(Goto, self).__init__(callback, uid) def _get_definitions(self): - definitions = self.script.goto_assignments() + definitions = self.script.goto( + line=self.line, column=self.col, follow_imports=True + ) if all(d.type == 'import' for d in definitions): definitions = self.script.goto_definitions() return definitions def run(self): - """Run the command - """ + """Run the command""" try: definitions = self._get_definitions() @@ -30,18 +31,23 @@ def run(self): success = False else: # we use a set here to avoid duplication - data = set([(i.full_name, i.module_path, i.line, i.column + 1) - for i in definitions if not i.in_builtin_module()]) + data = set( + [ + (i.full_name, i.module_path, i.line, i.column + 1) + for i in definitions + if not i.in_builtin_module() + ] + ) success = True self.callback( - {'success': success, 'result': list(data), 'uid': self.uid}) + {'success': success, 'result': list(data), 'uid': self.uid} + ) class GotoAssignment(Goto): - """Get back a python assignment where to go - """ + """Get back a python assignment where to go""" def _get_definitions(self): return self.script.goto_assignments() diff --git a/anaconda_server/handlers/jedi_handler.py b/anaconda_server/handlers/jedi_handler.py index 02f54c66..6ca7dd25 100644 --- a/anaconda_server/handlers/jedi_handler.py +++ b/anaconda_server/handlers/jedi_handler.py @@ -22,15 +22,13 @@ class JediHandler(AnacondaHandler): """ def run(self): - """Call the specific method (override base class) - """ + """Call the specific method (override base class)""" self.real_callback = self.callback self.callback = self.handle_result_and_purge_cache super(JediHandler, self).run() def handle_result_and_purge_cache(self, result): - """Handle the result from the call and purge in memory jedi cache - """ + """Handle the result from the call and purge in memory jedi cache""" try: jedi.cache.clear_time_caches() @@ -40,60 +38,93 @@ def handle_result_and_purge_cache(self, result): @property def script(self): - """Generates a new valid Jedi Script and return it back - """ + """Generates a new valid Jedi Script and return it back""" return self.jedi_script(**self.data) def jedi_script( - self, source, line, offset, filename='', encoding='utf8', **kw): - """Generate an usable Jedi Script - """ + self, source, line, offset, filename='', encoding='utf8', **kw + ): + """Generate an usable Jedi Script""" jedi_project = jedi.get_default_project(filename) - return jedi.Script( - source, int(line), int(offset), filename, encoding, project=jedi_project) + return jedi.Script(source, project=jedi_project) def rename(self, directories, new_word): - """Rename the object under the cursor by the given word - """ + """Rename the object under the cursor by the given word""" Rename( - self.callback, self.uid, self.script, - directories, new_word, jedi_refactor + self.callback, + self.uid, + self.script, + directories, + new_word, + jedi_refactor, ) def autocomplete(self): - """Call autocomplete - """ - - AutoComplete(self.callback, self.uid, self.script) + """Call autocomplete""" + + AutoComplete( + self.callback, + self.data.get("line", 1), + self.data.get("offset", 0), + self.uid, + self.script, + ) def parameters(self): - """Call complete parameter - """ - - CompleteParameters(self.callback, self.uid, self.script, self.settings) + """Call complete parameter""" + + CompleteParameters( + self.callback, + self.data.get("line", 1), + self.data.get("offset", 0), + self.uid, + self.script, + self.settings, + ) def usages(self): - """Call find usages - """ - - FindUsages(self.callback, self.uid, self.script) + """Call find usages""" + + FindUsages( + self.callback, + self.data.get("line", 1), + self.data.get("offset", 0), + self.uid, + self.script, + ) def goto(self): - """Call goto - """ - - Goto(self.callback, self.uid, self.script) + """Call goto""" + + Goto( + self.callback, + self.data.get("line", 1), + self.data.get("offset", 0), + self.uid, + self.script, + ) def goto_assignment(self): - """Call goto_assignment - """ - - GotoAssignment(self.callback, self.uid, self.script) + """Call goto_assignment""" + + GotoAssignment( + self.callback, + self.data.get("line", 1), + self.data.get("offset", 0), + self.uid, + self.script, + ) def doc(self, html=False): - """Call doc - """ - - Doc(self.callback, self.uid, self.script, html) + """Call doc""" + + Doc( + self.callback, + self.data.get("line", 1), + self.data.get("offset", 0), + self.uid, + self.script, + html, + ) diff --git a/anaconda_server/handlers/python_lint_handler.py b/anaconda_server/handlers/python_lint_handler.py index 90e9a3fa..5be32aa0 100644 --- a/anaconda_server/handlers/python_lint_handler.py +++ b/anaconda_server/handlers/python_lint_handler.py @@ -6,6 +6,7 @@ import os import sys from functools import partial + sys.path.append(os.path.join(os.path.dirname(__file__), '../../anaconda_lib')) sys.path.append(os.path.join(os.path.dirname(__file__), '../')) @@ -19,16 +20,19 @@ try: from linting.anaconda_pylint import PyLinter + from linting.anaconda_pylint import numversion + PYLINT_AVAILABLE = True except ImportError: PYLINT_AVAILABLE = False class PythonLintHandler(AnacondaHandler): - """Handle request to execute Python linting commands form the JsonServer - """ + """Handle request to execute Python linting commands form the JsonServer""" - def __init__(self, command, data, uid, vid, settings, callback, debug=False): + def __init__( + self, command, data, uid, vid, settings, callback, debug=False + ): self.uid = uid self.vid = vid self.data = data @@ -37,15 +41,17 @@ def __init__(self, command, data, uid, vid, settings, callback, debug=False): self.command = command self.settings = settings self._linters = { - 'pyflakes': False, 'pylint': False, 'pep8': False, 'pep257': False, - 'import_validator': False + 'pyflakes': False, + 'pylint': False, + 'pep8': False, + 'pep257': False, + 'import_validator': False, } self._errors = [] self._failures = [] def lint(self, code=None, filename=None): - """This is called from the JsonServer - """ + """This is called from the JsonServer""" self._configure_linters() for linter_name, expected in self._linters.items(): if expected is True: @@ -53,47 +59,62 @@ def lint(self, code=None, filename=None): func(code, filename) if len(self._errors) == 0 and len(self._failures) > 0: - self.callback({ - 'success': False, - 'errors': '. '.join([str(e) for e in self._failures]), - 'uid': self.uid, - 'vid': self.vid - }) + self.callback( + { + 'success': False, + 'errors': '. '.join([str(e) for e in self._failures]), + 'uid': self.uid, + 'vid': self.vid, + } + ) return - self.callback({ - 'success': True, - 'errors': self._errors, - 'uid': self.uid, - 'vid': self.vid - }) + self.callback( + { + 'success': True, + 'errors': self._errors, + 'uid': self.uid, + 'vid': self.vid, + } + ) def pyflakes(self, code=None, filename=None): - """Run the PyFlakes linter - """ + """Run the PyFlakes linter""" lint = PyFlakesLinter PyFlakes( - self._merge, self.uid, self.vid, lint, self.settings, code, filename) + self._merge, + self.uid, + self.vid, + lint, + self.settings, + code, + filename, + ) def pep8(self, code=None, filename=None): - """Run the pep8 linter - """ + """Run the pep8 linter""" lint = Pep8Linter - PEP8(self._merge, self.uid, self.vid, lint, self.settings, code, filename) + PEP8( + self._merge, + self.uid, + self.vid, + lint, + self.settings, + code, + filename, + ) def pep257(self, code=None, filename=None): - """Run the pep257 linter - """ + """Run the pep257 linter""" lint = AnacondaPep257 ignore = self.settings.get('pep257_ignore') PEP257(self._merge, self.uid, self.vid, lint, ignore, code, filename) def pylint(self, code=None, filename=None): - """Run the pyling linter - """ + """Run the pyling linter""" if not PYLINT_AVAILABLE: errors = 'Your configured python interpreter can\'t import pylint' @@ -101,32 +122,51 @@ def pylint(self, code=None, filename=None): return rcfile = self.settings.get('pylint_rcfile', False) - PyLint( - partial(self._normalize, self.settings), - self.uid, self.vid, PyLinter, rcfile, filename - ) + if numversion < (2, 4, 4): + PyLint( + partial(self._normalize, self.settings), + self.uid, + self.vid, + PyLinter, + rcfile, + filename, + ) + else: + PyLint( + self._normalize, self.uid, self.vid, PyLinter, rcfile, filename + ) def import_validator(self, code, filename=None): - """Run the import validator linter - """ + """Run the import validator linter""" lint = Validator ImportValidator( - self._merge, self.uid, self.vid, lint, code, filename, self.settings) + self._merge, + self.uid, + self.vid, + lint, + code, + filename, + self.settings, + ) def mypy(self, code=None, filename=None): - """Run the mypy linter - """ + """Run the mypy linter""" lint = AnacondaMyPy MyPy( - self._merge, self.uid, self.vid, lint, - code, filename, self.mypypath, self.settings + self._merge, + self.uid, + self.vid, + lint, + code, + filename, + self.mypypath, + self.settings, ) def _normalize(self, data): - """Normalize pylint data before to merge - """ + """Normalize pylint data before to merge""" normalized_errors = [] for error_level, error_data in data.get('errors', {}).items(): @@ -147,7 +187,7 @@ def _normalize(self, data): 'level': error_level, 'message': error['message'], 'offset': int(error.get('offset', 0)), - 'lineno': int(error['line']) + 'lineno': int(error['line']), } normalized_errors.append(normalized_error) @@ -157,8 +197,7 @@ def _normalize(self, data): self._merge(data) def _configure_linters(self): - """Enable or disable linters - """ + """Enable or disable linters""" self._linters['pyflakes'] = self.settings.get('use_pyflakes', True) self._linters['pylint'] = self.settings.get('use_pylint', False) @@ -166,7 +205,8 @@ def _configure_linters(self): self._linters['mypy'] = self.settings.get('use_mypy', False) self._linters['pep8'] = self.settings.get('pep8', True) self._linters['import_validator'] = self.settings.get( - 'validate_imports', False) + 'validate_imports', False + ) # disable pyflakes if pylint is in use if self._linters['pylint'] is True: @@ -176,8 +216,7 @@ def _configure_linters(self): self.mypypath = self.settings.get('mypypath') def _merge(self, lint_result): - """Merge the given linter results - """ + """Merge the given linter results""" if lint_result['success'] is True: self._errors += lint_result['errors'] diff --git a/anaconda_server/jsonserver.py b/anaconda_server/jsonserver.py index 9d4921a8..9b8f4dfa 100755 --- a/anaconda_server/jsonserver.py +++ b/anaconda_server/jsonserver.py @@ -93,7 +93,7 @@ def found_terminator(self): self.server.last_call = time.time() - if type(data) is dict: + if isinstance(data, dict): logging.info( 'client requests: {0}'.format(data['method']) ) @@ -109,7 +109,9 @@ def found_terminator(self): method, handler_type) ) try: - self.handle_command(handler_type, method, uid, vid, settings, data) + self.handle_command( + handler_type, method, uid, vid, settings, data, + ) except Exception as error: logging.error(error) log_traceback() @@ -137,7 +139,9 @@ def handle_command(self, handler_type, method, uid, vid, settings, data): if DEBUG_MODE is True: print('{0} handler retrieved from registry'.format(handler)) - handler(method, data, uid, vid, settings, self.return_back, DEBUG_MODE).run() + handler( + method, data, uid, vid, settings, self.return_back, DEBUG_MODE, + ).run() class JSONServer(asyncore.dispatcher): From d000788faa754dfd2a17510a29c97567dd92015c Mon Sep 17 00:00:00 2001 From: Oscar Campos Date: Fri, 11 Feb 2022 12:02:59 +0000 Subject: [PATCH 2/5] fix: add .python-version file --- .python-version | 1 + 1 file changed, 1 insertion(+) create mode 100644 .python-version diff --git a/.python-version b/.python-version new file mode 100644 index 00000000..cc1923a4 --- /dev/null +++ b/.python-version @@ -0,0 +1 @@ +3.8 From 8358a7088a0dc279f38fd86ed217f694a30bb64e Mon Sep 17 00:00:00 2001 From: Oscar Campos Date: Fri, 11 Feb 2022 12:59:51 +0000 Subject: [PATCH 3/5] docs: updated README to make clear new versions will not support Sublime Text 3 --- README.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5af09473..32cec6a6 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,27 @@ +# VERY IMPORTANT NOTICE, PLEASE, READ CAREFULLY + +**New versions of this plugin only works with Python >= 3.6 and requires Sublime Text 4 build >= 4107** + +This means versions higher than 2.2.3 **will not** work in Sublime Text 3 + +## For Sublime Text 3 Users + +If for whatever reason you can not - you do not want to upgrade to Sublime Text 4, remove Anaconda from your setup using Package Control, download [v2.2.3](https://github.com/DamnWidget/anaconda/releases/tag/v2.2.3), unpack it in your Users package directory and never ever try to install it through package control + [![Join the chat at https://gitter.im/DamnWidget/anaconda](https://img.shields.io/gitter/room/DamnWidget/anaconda.svg?maxAge=2592000)](https://gitter.im/DamnWidget/anaconda?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![GitHub release](https://img.shields.io/github/release/damnwidget/anaconda.svg)](https://github.com/DamnWidget/anaconda/releases/latest) [![Build Status](https://travis-ci.org/DamnWidget/anaconda.svg?branch=master)](https://travis-ci.org/DamnWidget/anaconda) [![Package Control](https://img.shields.io/packagecontrol/dt/Anaconda.svg)](https://packagecontrol.io/packages/Anaconda) + +# Anaconda + + | _` | __ \ _` | __| _ \ __ \ _` | _` | ( | | | ( | ( ( | | | ( | ( | \__,_| _| _| \__,_| \___| \___/ _| _| \__,_| \__,_| - The Sublime Text 3 Python IDE + The Sublime Text 4 Python IDE Anaconda turns your Sublime Text 3 into a full featured Python IDE. Read the plugin documentation on [http://damnwidget.github.io/anaconda](http://damnwidget.github.io/anaconda). From 8449e34e994b7c7cbcff86f16a2567f9d867fa51 Mon Sep 17 00:00:00 2001 From: Oscar Campos Date: Fri, 11 Feb 2022 20:47:28 +0000 Subject: [PATCH 4/5] chore: prepare release information --- messages.json | 3 ++- messages/2.3.0.txt | 44 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 messages/2.3.0.txt diff --git a/messages.json b/messages.json index f18e6a34..da68dd63 100644 --- a/messages.json +++ b/messages.json @@ -91,5 +91,6 @@ "2.2.0": "messages/2.2.0.txt", "2.2.1": "messages/2.2.1.txt", "2.2.2": "messages/2.2.2.txt", - "2.2.3": "messages/2.2.3.txt" + "2.2.3": "messages/2.2.3.txt", + "2.3.0": "messages/2.3.0.txt" } diff --git a/messages/2.3.0.txt b/messages/2.3.0.txt new file mode 100644 index 00000000..172823ca --- /dev/null +++ b/messages/2.3.0.txt @@ -0,0 +1,44 @@ + + | + _` | __ \ _` | __| _ \ __ \ _` | _` | + ( | | | ( | ( ( | | | ( | ( | + \__,_| _| _| \__,_| \___| \___/ _| _| \__,_| \__,_| + The Sublime Text 4 Python IDE + + +Anaconda v2.3.0 +================ + +Welcome to new anaconda v2.3.0, what can do you find in this release? + +## IMPORTANT + - Starting with this release v2.3.0 Anaconda will not work with Sublime Text 3 anymore + - It will also not work for older versions of Python (older than 3.6) + +## WARNING!!!! + If you want to continue using anaconda on ST3, uninstall this package from + package control, download version 2.2.3 from the Github repository and install + it in your User packages directory. Alternatively you can rollback to 2.2.3 and + instruct package control to do not update anaconda anymore + +## Fixes + - Autocompletion + - Goto Definition + - Goto Assignment + - Show Signatures + - Hover Documentation + - Show Documentation + - Python 3.10 features linting + +## Updates + - Update Parso to latest version + - Update Jedi to latest version + - Update PyFlakes to latest version + - Update PyCodestyle to latest version + - Update McCabe to latest version + - Added support for Pylint >= 2.5.0 + +## Other Changes + - Drop support for Python < 3.6 + - Drop support for Sublime Text 3 or Sublime Text 4 build < 4107 + From 5a545ed801a92a80cb9d7b0147d945b1e68bc9a8 Mon Sep 17 00:00:00 2001 From: Oscar Campos Date: Fri, 11 Feb 2022 21:55:30 +0000 Subject: [PATCH 5/5] chore: add alternatives to anaconda on the README.md file --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 32cec6a6..e8c7b6b5 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,16 @@ This means versions higher than 2.2.3 **will not** work in Sublime Text 3 If for whatever reason you can not - you do not want to upgrade to Sublime Text 4, remove Anaconda from your setup using Package Control, download [v2.2.3](https://github.com/DamnWidget/anaconda/releases/tag/v2.2.3), unpack it in your Users package directory and never ever try to install it through package control +## Alternatives + +The plugins ecosystem in Sublime Text have improved by a lot in the past few years, there are many alternatives to anaconda that might work better for you + +**Python**: Give a try to [LSP-pyright](https://github.com/sublimelsp/LSP-pyright) it works pretty well afaik +**Go**: More LSP plugins [LSP-gopls](https://github.com/sublimelsp/LSP-gopls) works well and uses the official gopls server +**Rust**: Same for Rust [LSP-rust-analyzer](https://github.com/sublimelsp/LSP-rust-analyzer) it is pretty ussable it needs a bit of tuning but it works well + +For all of these ^^ you need to install [LSP](https://github.com/sublimelsp/LSP) + [![Join the chat at https://gitter.im/DamnWidget/anaconda](https://img.shields.io/gitter/room/DamnWidget/anaconda.svg?maxAge=2592000)](https://gitter.im/DamnWidget/anaconda?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![GitHub release](https://img.shields.io/github/release/damnwidget/anaconda.svg)](https://github.com/DamnWidget/anaconda/releases/latest) [![Build Status](https://travis-ci.org/DamnWidget/anaconda.svg?branch=master)](https://travis-ci.org/DamnWidget/anaconda)