@@ -1335,28 +1335,28 @@ def oct(__i: Union[int, _SupportsIndex]) -> str: ...
1335
1335
1336
1336
if sys .version_info >= (3 , 3 ):
1337
1337
# Changed in version 3.3: The 'x' mode was added.
1338
- _OPEN_TEXT_MODE = Literal [
1338
+ _OPEN_TEXT_MODE = Literal [
1339
1339
'r' , 'r+' , '+r' , 'rt' , 'tr' , 'rt+' , 'r+t' , '+rt' , 'tr+' , 't+r' , '+tr' ,
1340
1340
'w' , 'w+' , '+w' , 'wt' , 'tw' , 'wt+' , 'w+t' , '+wt' , 'tw+' , 't+w' , '+tw' ,
1341
1341
'a' , 'a+' , '+a' , 'at' , 'ta' , 'at+' , 'a+t' , '+at' , 'ta+' , 't+a' , '+ta' ,
1342
1342
'x' , 'x+' , '+x' , 'xt' , 'tx' , 'xt+' , 'x+t' , '+xt' , 'tx+' , 't+x' , '+tx' ,
1343
1343
'U' , 'rU' , 'Ur' , 'rtU' , 'rUt' , 'Urt' , 'trU' , 'tUr' , 'Utr' ,
1344
1344
]
1345
- _OPEN_BINARY_MODE = Literal [
1345
+ _OPEN_BINARY_MODE = Literal [
1346
1346
'rb' , 'br' , 'rb+' , 'r+b' , '+rb' , 'br+' , 'b+r' , '+br' ,
1347
1347
'wb' , 'bw' , 'wb+' , 'w+b' , '+wb' , 'bw+' , 'b+w' , '+bw' ,
1348
1348
'ab' , 'ba' , 'ab+' , 'a+b' , '+ab' , 'ba+' , 'b+a' , '+ba' ,
1349
1349
'xb' , 'bx' , 'xb+' , 'x+b' , '+xb' , 'bx+' , 'b+x' , '+bx' ,
1350
1350
'rbU' , 'rUb' , 'Urb' , 'brU' , 'bUr' , 'Ubr' ,
1351
1351
]
1352
1352
else :
1353
- _OPEN_TEXT_MODE = Literal [
1353
+ _OPEN_TEXT_MODE = Literal [
1354
1354
'r' , 'r+' , '+r' , 'rt' , 'tr' , 'rt+' , 'r+t' , '+rt' , 'tr+' , 't+r' , '+tr' ,
1355
1355
'w' , 'w+' , '+w' , 'wt' , 'tw' , 'wt+' , 'w+t' , '+wt' , 'tw+' , 't+w' , '+tw' ,
1356
1356
'a' , 'a+' , '+a' , 'at' , 'ta' , 'at+' , 'a+t' , '+at' , 'ta+' , 't+a' , '+ta' ,
1357
1357
'U' , 'rU' , 'Ur' , 'rtU' , 'rUt' , 'Urt' , 'trU' , 'tUr' , 'Utr' ,
1358
1358
]
1359
- _OPEN_BINARY_MODE = Literal [
1359
+ _OPEN_BINARY_MODE = Literal [
1360
1360
'rb' , 'br' , 'rb+' , 'r+b' , '+rb' , 'br+' , 'b+r' , '+br' ,
1361
1361
'wb' , 'bw' , 'wb+' , 'w+b' , '+wb' , 'bw+' , 'b+w' , '+bw' ,
1362
1362
'ab' , 'ba' , 'ab+' , 'a+b' , '+ab' , 'ba+' , 'b+a' , '+ba' ,
@@ -1374,26 +1374,71 @@ else:
1374
1374
if sys .version_info >= (3 , 3 ):
1375
1375
# Changed in version 3.3: The opener parameter was added.
1376
1376
@overload
1377
- def open (file : _OPEN_FILE , mode : _OPEN_TEXT_MODE = ..., buffering : int = ..., encoding : Optional [str ] = ...,
1378
- errors : Optional [str ] = ..., newline : Optional [str ] = ..., closefd : bool = ...,
1379
- opener : Optional [Callable [[str , int ], int ]] = ...) -> TextIO : ...
1380
- @overload
1381
- def open (file : _OPEN_FILE , mode : _OPEN_BINARY_MODE , buffering : int = ..., encoding : None = ..., errors : None = ...,
1382
- newline : None = ..., closefd : bool = ..., opener : Optional [Callable [[str , int ], int ]] = ...) -> BinaryIO : ...
1383
- @overload
1384
- def open (file : _OPEN_FILE , mode : str , buffering : int = ..., encoding : Optional [str ] = ..., errors : Optional [str ] = ...,
1385
- newline : Optional [str ] = ..., closefd : bool = ..., opener : Optional [Callable [[str , int ], int ]] = ...) \
1386
- -> IO [Any ]: ...
1377
+ def open (
1378
+ file : _OPEN_FILE ,
1379
+ mode : _OPEN_TEXT_MODE = ...,
1380
+ buffering : int = ...,
1381
+ encoding : Optional [str ] = ...,
1382
+ errors : Optional [str ] = ...,
1383
+ newline : Optional [str ] = ...,
1384
+ closefd : bool = ...,
1385
+ opener : Optional [Callable [[str , int ], int ]] = ...,
1386
+ ) -> TextIO : ...
1387
+ @overload
1388
+ def open (
1389
+ file : _OPEN_FILE ,
1390
+ mode : _OPEN_BINARY_MODE ,
1391
+ buffering : int = ...,
1392
+ encoding : None = ...,
1393
+ errors : None = ...,
1394
+ newline : None = ...,
1395
+ closefd : bool = ...,
1396
+ opener : Optional [Callable [[str , int ], int ]] = ...,
1397
+ ) -> BinaryIO : ...
1398
+ @overload
1399
+ def open (
1400
+ file : _OPEN_FILE ,
1401
+ mode : str ,
1402
+ buffering : int = ...,
1403
+ encoding : Optional [str ] = ...,
1404
+ errors : Optional [str ] = ...,
1405
+ newline : Optional [str ] = ...,
1406
+ closefd : bool = ...,
1407
+ opener : Optional [Callable [[str , int ], int ]] = ...,
1408
+ ) -> IO [Any ]: ...
1409
+
1387
1410
elif sys .version_info >= (3 ,):
1388
1411
@overload
1389
- def open (file : _OPEN_FILE , mode : _OPEN_TEXT_MODE = ..., buffering : int = ..., encoding : Optional [str ] = ...,
1390
- errors : Optional [str ] = ..., newline : Optional [str ] = ..., closefd : bool = ...) -> TextIO : ...
1391
- @overload
1392
- def open (file : _OPEN_FILE , mode : _OPEN_BINARY_MODE , buffering : int = ..., encoding : None = ..., errors : None = ...,
1393
- newline : None = ..., closefd : bool = ...) -> BinaryIO : ...
1394
- @overload
1395
- def open (file : _OPEN_FILE , mode : str , buffering : int = ..., encoding : Optional [str ] = ..., errors : Optional [str ] = ...,
1396
- newline : Optional [str ] = ..., closefd : bool = ...) -> IO [Any ]: ...
1412
+ def open (
1413
+ file : _OPEN_FILE ,
1414
+ mode : _OPEN_TEXT_MODE = ...,
1415
+ buffering : int = ...,
1416
+ encoding : Optional [str ] = ...,
1417
+ errors : Optional [str ] = ...,
1418
+ newline : Optional [str ] = ...,
1419
+ closefd : bool = ...,
1420
+ ) -> TextIO : ...
1421
+ @overload
1422
+ def open (
1423
+ file : _OPEN_FILE ,
1424
+ mode : _OPEN_BINARY_MODE ,
1425
+ buffering : int = ...,
1426
+ encoding : None = ...,
1427
+ errors : None = ...,
1428
+ newline : None = ...,
1429
+ closefd : bool = ...,
1430
+ ) -> BinaryIO : ...
1431
+ @overload
1432
+ def open (
1433
+ file : _OPEN_FILE ,
1434
+ mode : str ,
1435
+ buffering : int = ...,
1436
+ encoding : Optional [str ] = ...,
1437
+ errors : Optional [str ] = ...,
1438
+ newline : Optional [str ] = ...,
1439
+ closefd : bool = ...,
1440
+ ) -> IO [Any ]: ...
1441
+
1397
1442
else :
1398
1443
@overload
1399
1444
def open (file : _OPEN_FILE , mode : _OPEN_TEXT_MODE = ..., buffering : int = ...) -> TextIO : ...
0 commit comments