Commit Graph

9 Commits

Author SHA1 Message Date
Jelle Zijlstra
44a852dff5 Literal: always import from typing_extensions for simplicity (#4219) 2020-06-10 21:23:58 -07:00
Julian Andres Klode
009b269882 fcntl: make mutate_flag optional for ioctl w/ read-only buffer (#3882)
Fixes #3881
2020-03-24 15:54:59 +01:00
Shantanu
1b7eadce95 fcntl: various improvements (#3680)
* fcntl: mark positional-only args

* fcntl: use overload for fcntl.fcntl

The comment about depending on the type of arg seems incorrect
bf501353a0

I checked the docs and examples, CPython implementation and CPython tests, but
I might be missing something

* fcntl: use overload for fcntl.ioctl

Based off of docs and examples

* fcntl: type buffers better

Follows the approach in #2610
2020-02-21 21:31:58 -08:00
Daniel Farley
955e9c7da4 Unify file descriptor definitions (#3584)
The _types module can house any common type defintions used throughout
the rest of typeshed to keep defintions in sync.

First candidate is file descriptors where anything with `fileno()`
method is accepted. There were several different implementations in
various files that can be unified.
2020-01-08 17:25:36 -08:00
Michael Lee
efb67946f8 Use variable annotations everywhere (#2909) 2019-04-13 10:40:52 +02:00
Daniel Watkins
258b9fb821 Add IOBase to types fcntl will accept as files (#1556)
* Remove unused typing import from stdlib/3/fcntl.pyi

* Add IOBase to types fcntl will accept as files

Anything that implements a fileno() method is acceptable (per
https://github.com/python/cpython/blob/master/Objects/fileobject.c#L168-L173),
and IOBase fits the bill.

Fixes #1548.
2017-08-28 21:29:57 -07:00
Guido van Rossum
bf501353a0 Hopeful fix for fcntl stubs -- change return values back to Any. 2016-03-22 12:21:17 -07:00
Jakub Stasiak
7f9276c87c Improve Python 3 fcntl stub
This patch:

* Adds some constants that although undocumented are exposed by the
  module
* Modifies the signature of fcntl() to match reality
* Adds missing function stubs
* Modifies few existing constant declarations to match the repository
  conventions

I believe the stub is complete now (and if it's not there isn't much
missing).
2016-03-17 02:43:18 +01:00
Guido van Rossum
8c2118bace Move contents of builtins/* to stdlib/*. This simplifies finding stubs. 2016-01-12 12:53:18 -08:00