Merged
Conversation
* Update flake8-bugbear * Remove unnecessary comment * Add a comment about an upcoming fix
None values are accepted, and interpreted as empty (byte) strings by some urllib.parse functions.
) This is a continuation of #3291, which was the initial fix for #3201. The 2-arg version of iter() turns a callable into an iterator. The changes made in #3291 introduce an Any return type for both the callable's return type and the iterator's type, while in reality the return type of the function is always the same as the iterator's type.
Per the urllib.parse documentation, username, password, hostname, and port will be set to None if not set in the parsed URL. The same is true for urlparse in Python 2 according to its documentation.
Nothing prevents a decorator defined using `@decorator` from changing the signature of the decorated function. For example, this example changes the return type to `str`: ``` from decorator import decorator @decorator def stringify(f, *args, **kwargs) -> str: return str(f(*args, **kwargs)) ``` The old signature caused false positives in internal Dropbox code. I couldn't come up with a signature that would produce better types with mypy while not generating false positives.
From the Lib/csv.py source, 'f' is passed directly to _csv.reader, which expects Iterable[Text]
* Add as_integer_ratio() to a few types * Add dirs_exist_ok to copytree() * int, float, complex accept __index__ args Also fix complex.__init__ argument names * Add __reversed__ to dict et al. * Python 3.8 date(time) arithmetic fixes * Add CodeType.replace()
* Add assorted annotations * Fix type of Purpose items
This is important because mypy doesn't generally think functions are compatible with `FunctionType`, so `inspect.getsource` on arbitrary functions is rejected by the current annotations.
Remove unnecessary definitions in sub-classes.
datefmt can be None - that's what the default value is: https://docs.python.org/3/library/logging.html#logging.Formatter.formatTime
Improve a few other types
While it may eventually be useful to mark the exceptions that can be raised from a function or method, the semantics are currently undefined and unclear.
* macpath * time.clock() * Some cgi functions * XMLParser(html) and doctype() * unicode_internal * Two sqlite3 classes hidden * fileinput bufsize arg * Treeview.selection no longer takes arguments
* Add os.add_dll_directory() * Add memfd_create() and flags * Add type annotation to flags * Add stat_result.st_reparse_tag and flags * Add ncurses_version * Add Path.link_to() * Add Picker.reducer_override() * Add plistlib.UID * Add has_dualstack_ipv6() and create_server() * Add shlex.join() * Add SSL methods and fields * Add Python 3.8 statistics functions and classes * Remove obsolete sys.subversion * Add sys.unraisablehook * Add threading.excepthook * Add get_native_id() and Thread.native_id * Add Python 3.8 tkinter methods * Add CLOCK_UPTIME_RAW * Add SupportsIndex * Add typing.get_origin() and get_args() * Add unicodedata.is_normalized * Add unittest.mock.AsyncMock Currently this is just an alias for Any like Mock and MagicMock. All of these classes should probably be sub-classing Any and add their own methods. See also #3224. * Add unittest cleanup methods * Add IsolatedAsyncioTestCase * Add ElementTree.canonicalize() and C14NWriterTarget * cProfile.Profile can be used as a context manager * Add asyncio task name handling * mmap.flush() now always returns None * Add posonlyargcount to CodeType
* Make multiprocessing stubs match implementation * Add multiprocessing.process.BaseProcess * Use BaseProcess in multiprocessing.context where applicable * Remove non-existing BaseContext.Process() * Derive DefaultContext from BaseContext * Fix BaseContext/DefaultContext.set_start_method() signatures * Re-export multiprocessing.context.Process from multiprocessing, instead of using a custom definition * Re-export multiprocessing.active_from from multiprocessing.process instead of using a custom definition * Add parent_process() (Python 3.8) * Complete BaseManager; add Server * Add multiprocessing.shared_memory et al
* protobuf: Fix inadvertantly deleted annotations. * Run black on protobuf.
* Add public missing asyncio stubs for windows and proactor files, and any necessary private return/argument types. * Add methods to BaseProactorEventLoop that mypy is complaining about, with note about status at runtime * Add asyncio constants file
The value can be None here as well as in handle_starttag().
The code has been added to typing_extensions in python/typing#632 and python/typing#639.
From python/mypy#7582. This partially reverts back the change in 0ee7c3c to have `__import__` return `Any` instead of `ModuleType`.
shlex.shlex should match the Iterator protocol, for which it needs both `__iter__` and `__next__` (`next` in Python 2) defined.
Yesterday's release contains a number of pyi parser fixes, such as support for the syntax in #3321.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.