Commit Graph

14 Commits

Author SHA1 Message Date
Eric Traut
f60074f3d2 Fixed symbol redefinition in cgi.pyi stub (#4394)
* PEP 484 says that type checkers should assume that all types used in a stub should use forward declarations even though they are not quoted. This stub is using the symbol "type" within the context of a class scope. The "type" symbol is declared within this scope, so pyright assumes that the forward declaration should be used. The solution is to define a symbol with a different name in the outer scope to avoid the name conflict.

* Fixed import sort order.

Co-authored-by: Eric Traut <erictr@microsoft.com>
2020-08-06 09:05:45 +02:00
Sebastian Rittau
9ad8ed3b75 Introduce Mapping-like protocols (#4325)
typing.Mapping is not a protocol, which has caused problems in the past.
(E.g. python/typeshed#3569, see also python/typeshed#3576.) This
introduces a few narrow protocols to _typeshed.pyi that can be used in
place of Mapping.

Not all uses of Mapping can be replaced. For example, cgi.FieldStorage
explictly checks whether the supplied headers argument is a Mapping
instance.
2020-07-11 17:11:08 -07:00
Jelle Zijlstra
5d553c9584 apply black and isort (#4287)
* apply black and isort

* move some type ignores
2020-06-28 13:31:00 -07:00
Phillip Huang
f4b23e4a80 Fix cgi.FieldStorage's __iter__ return type (#4209)
Co-authored-by: Phillip Huang <phillip@dropbox.com>
2020-06-08 20:40:14 -07:00
Shantanu
558d88ef92 cgi: various improvements (#3790)
- add max_num_fields to FieldStorage
- fix various types based on default values
2020-02-29 14:18:06 +01:00
Sebastian Rittau
6507875f28 Annotate Python 3.8 removals (#3359)
* 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
2019-10-14 09:51:39 +02:00
Guido van Rossum
b336182b69 Fix some errors with --disallow-any-generics (#3276)
See #3267. Covers all of stdlib/2and3.
2019-09-29 09:15:27 -07:00
Michael Lee
efb67946f8 Use variable annotations everywhere (#2909) 2019-04-13 10:40:52 +02:00
Adam Dangoor
45a11b974e Update parse_multipart return type to support Python 3.7 (#2474)
* Add encoding and errors parameters to cgi.parse_multipart stub.
2018-09-27 22:19:02 +02:00
Jelle Zijlstra
6f5c6b5078 add some missing constants (#1198)
Closes #2
2017-04-24 15:05:02 -07:00
Guido van Rossum
671d3870c2 Add 'file' attribute to cgi.[Mini]FieldStorage (#1104) 2017-03-27 14:27:38 -07:00
Guido van Rossum
16074c1e66 Make cgi.escape() polymorphic in Python 2 (#1098) 2017-03-25 13:53:36 -07:00
Jelle Zijlstra
a74c31270d fix version check in cgi (#1069) 2017-03-22 07:29:01 -07:00
Jelle Zijlstra
357f66db77 move cgi to 2and3 and add types (#1022)
* move cgi to 2and3 and add types

This is pretty stable between Python 2 and 3, and not very well documented.

* fix CI failures

* adjust comment

(want to force Travis to re-run)

* give up on overriding values
2017-03-21 05:56:52 -07:00