Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
72913ac
Merge pull request #1 from python/master
jolaf Mar 11, 2019
7cdc4bf
Making vars argument Optional, as it defaults to None in the code and…
Mar 11, 2019
29037b9
Merge pull request #2 from python/master
jolaf Mar 11, 2019
3eed451
email.charset.SHORTEST, QP, BASE64 are not in the stub for Python 2
Mar 11, 2019
d065fdf
email.mime.application.MIMEApplication expects data to be bytes, whil…
Mar 11, 2019
73e625f
Adding #undocumented as requested by @srittau to fix #2830
Mar 11, 2019
9b26ce8
Merge branch 'master' of https://github.com/python/typeshed into pyth…
Mar 12, 2019
2b67cae
Merge pull request #4 from python/master
jolaf Mar 14, 2019
1ee2bef
Merge pull request #5 from python/master
jolaf Jul 18, 2019
603bf4b
NullTranslations._parse() stub added;
Jul 18, 2019
cb8c3e6
Merge pull request #6 from python/master
jolaf Jul 25, 2019
5dc4d4f
Update stdlib/3/gettext.pyi
jolaf Jul 25, 2019
1304aef
Update stdlib/3/gettext.pyi
jolaf Jul 25, 2019
a0fbaef
Suggestions from @srittau implemented
Jul 25, 2019
1206178
Merge branch 'master' of https://github.com/python/typeshed
Sep 19, 2019
1352f9c
Stubs for maxminddb added, approved by the developer, see https://git…
Sep 19, 2019
edf4dde
Fixed stubs for maxminddb
Sep 19, 2019
e3e3f4e
Fixes stubs for maxminddb
Sep 19, 2019
bf03a3f
Fixed stubs for maxminddb
Sep 19, 2019
5dfb034
Update third_party/3/maxminddb/extension.pyi
jolaf Sep 19, 2019
dfdb48f
Fixed according to suggestions from @srittau
Sep 19, 2019
982394c
Merge branch 'master' of github.com:jolaf/typeshed
Sep 19, 2019
7caba43
Merge pull request #8 from python/master
jolaf Sep 30, 2019
f87389f
Added ConfigParser.BOOLEAN_STATES # Undocumented
Sep 30, 2019
203bbc0
Whitespace fixed for flake8
Sep 30, 2019
fcd2edc
Added stub for urllib.request.proxy_bypass()
Sep 30, 2019
49449e0
Added stub for urllib.request.proxy_bypass()
Sep 30, 2019
25b7dd1
Merge branch 'proxy_bypass'
Sep 30, 2019
0dda34c
Added stub for asyncore.socket_map, undocumented but useful
Sep 30, 2019
8d0732c
Added stub for http.server.BaseHTTPRequestHandler.parse_request(), un…
Sep 30, 2019
dd375cc
Merge branch 'socket_map'
Sep 30, 2019
3d5666b
Merge branch 'parse_request'
Sep 30, 2019
047b17d
Also added stubs for BaseHTTPRequestHandler.weekdayname and monthname
Sep 30, 2019
d0df323
_maptype seems to be incorrect as the keys seem to be file descriptor…
Sep 30, 2019
236a6b4
Merge branch 'socket_map'
Sep 30, 2019
3aaf62b
Merge branch 'parse_request'
Sep 30, 2019
27fdd70
Merge pull request #9 from python/master
jolaf Sep 30, 2019
8b82e59
Merge pull request #10 from python/master
jolaf Oct 3, 2019
f00701f
Added stubs for geoip2
Oct 3, 2019
e4752a6
Fixed according to flake8
Oct 3, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file.
24 changes: 24 additions & 0 deletions third_party/3/geoip2/database.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Stubs for geoip2.database (Python 3)

from types import TracebackType
from typing import Optional, Sequence, Type

from maxminddb.reader import Metadata
from geoip2.models import AnonymousIP, ASN, City, ConnectionType, Country, Domain, Enterprise, ISP

_Locales = Optional[Sequence[str]]

class Reader:
def __init__(self, filename: str, 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 country(self, ip_address: str) -> Country: ...
def city(self, ip_address: str) -> City: ...
def anonymous_ip(self, ip_address: str) -> AnonymousIP: ...
def asn(self, ip_address: str) -> ASN: ...
def connection_type(self, ip_address: str) -> ConnectionType: ...
def domain(self, ip_address: str) -> Domain: ...
def enterprise(self, ip_address: str) -> Enterprise: ...
def isp(self, ip_address: str) -> ISP: ...
def metadata(self) -> Metadata: ...
def close(self) -> None: ...
20 changes: 20 additions & 0 deletions third_party/3/geoip2/errors.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Stubs for geoip2.errors (Python 3)

from typing import Optional

class GeoIP2Error(RuntimeError): ...

class AddressNotFoundError(GeoIP2Error): ...

class AuthenticationError(GeoIP2Error): ...

class HTTPError(GeoIP2Error):
http_status: int = ...
Comment thread
jolaf marked this conversation as resolved.
uri: str = ...
def __init__(self, message: str, http_status: Optional[int] = ..., uri: Optional[str] = ...) -> None: ...

class InvalidRequestError(GeoIP2Error): ...

class OutOfQueriesError(GeoIP2Error): ...

class PermissionRequiredError(GeoIP2Error): ...
8 changes: 8 additions & 0 deletions third_party/3/geoip2/mixins.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Stubs for geoip2.mixins (Python 3)

from typing import Any

class SimpleEquality:
__metaclass__: Any = ...
def __eq__(self, other: object) -> bool: ...
def __ne__(self, other: object) -> bool: ...
68 changes: 68 additions & 0 deletions third_party/3/geoip2/models.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Stubs for geoip2.models (Python 3)

from typing import Any, Mapping, Optional, Sequence

from geoip2 import records

from geoip2.mixins import SimpleEquality

_Locales = Optional[Sequence[str]]
_RawResonse = Mapping[str, Mapping[str, Any]]
Comment thread
jolaf marked this conversation as resolved.

class Country(SimpleEquality):
continent: records.Continent = ...
country: records.Country = ...
registered_country: records.Country = ...
represented_country: records.RepresentedCountry = ...
maxmind: records.MaxMind = ...
traits: records.Traits = ...
raw: Any = ...
def __init__(self, raw_response: _RawResonse, locales: _Locales = ...) -> None: ...

class City(Country):
city: records.City = ...
location: records.Location = ...
postal: records.Postal = ...
subdivisions: records.Subdivisions = ...
def __init__(self, raw_response: _RawResonse, locales: _Locales = ...) -> None: ...

class Insights(City): ...

class Enterprise(City): ...

class SimpleModel(SimpleEquality):
__metaclass__: Any = ...

class AnonymousIP(SimpleModel):
is_anonymous: bool = ...
is_anonymous_vpn: bool = ...
is_hosting_provider: bool = ...
is_public_proxy: bool = ...
is_tor_exit_node: bool = ...
ip_address: str = ...
Comment thread
jolaf marked this conversation as resolved.
raw: str = ...
Comment thread
jolaf marked this conversation as resolved.
def __init__(self, raw: str) -> None: ...

class ASN(SimpleModel):
autonomous_system_number: int = ...
Comment thread
jolaf marked this conversation as resolved.
autonomous_system_organization: str = ...
ip_address: str = ...
raw: str = ...
def __init__(self, raw: str) -> None: ...

class ConnectionType(SimpleModel):
connection_type: str = ...
ip_address: str = ...
raw: str = ...
def __init__(self, raw: str) -> None: ...

class Domain(SimpleModel):
domain: str = ...
ip_address: str = ...
raw: str = ...
def __init__(self, raw: str) -> None: ...

class ISP(ASN):
isp: str = ...
organization: str = ...
def __init__(self, raw: str) -> None: ...
87 changes: 87 additions & 0 deletions third_party/3/geoip2/records.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# Stubs for geoip2.records (Python 3)

from typing import Any, Mapping, Optional, Sequence, Tuple

from geoip2.mixins import SimpleEquality

_Locales = Optional[Sequence[str]]
_Names = Mapping[str, str]

class Record(SimpleEquality):
__metaclass__: Any = ...
def __init__(self, **kwargs: Any) -> None: ...
def __setattr__(self, name: str, value: Any) -> None: ...

class PlaceRecord(Record):
__metaclass__: Any = ...
def __init__(self, locales: _Locales = ..., **kwargs: Any) -> None: ...
@property
def name(self) -> str: ...

class City(PlaceRecord):
confidence: int = ...
geoname_id: int = ...
names: _Names = ...

class Continent(PlaceRecord):
code: str = ...
geoname_id: int = ...
names: _Names = ...

class Country(PlaceRecord):
confidence: int = ...
geoname_id: int = ...
is_in_european_union: bool = ...
iso_code: str = ...
names: _Names = ...
def __init__(self, locales: _Locales = ..., **kwargs: Any) -> None: ...

class RepresentedCountry(Country):
type: str = ...

class Location(Record):
average_income: int = ...
accuracy_radius: int = ...
latitude: float = ...
longitude: float = ...
metro_code: int = ...
population_density: int = ...
time_zone: str = ...

class MaxMind(Record):
queries_remaining: int = ...

class Postal(Record):
code: str = ...
confidence: int = ...

class Subdivision(PlaceRecord):
confidence: int = ...
geoname_id: int = ...
iso_code: str = ...
names: _Names = ...

class Subdivisions(Tuple[Subdivision]):
def __new__(cls, locales: _Locales, *subdivisions: Subdivision) -> Subdivisions: ...
def __init__(self, locales: _Locales, *subdivisions: Subdivision) -> None: ...
@property
def most_specific(self) -> Subdivision: ...

class Traits(Record):
autonomous_system_number: int = ...
autonomous_system_organization: int = ...
Comment thread
jolaf marked this conversation as resolved.
connection_type: str = ...
domain: str = ...
ip_address: str = ...
is_anonymous: bool = ...
is_anonymous_proxy: bool = ...
is_anonymous_vpn: bool = ...
is_hosting_provider: bool = ...
is_legitimate_proxy: bool = ...
is_public_proxy: bool = ...
is_satellite_provider: bool = ...
is_tor_exit_node: bool = ...
isp: str = ...
organization: str = ...
user_type: str = ...
def __init__(self, **kwargs: Any) -> None: ...