@@ -3338,19 +3338,33 @@ msgid ""
3338
3338
"str or bytes\n"
3339
3339
" ..."
3340
3340
msgstr ""
3341
+ "class StrSequence[S: str]: # S é a TypeVar com como limite superior em "
3342
+ "`str`;\n"
3343
+ " ... # podemos dizer que S é \" delimitada por "
3344
+ "`str`\" \n"
3345
+ "\n"
3346
+ "\n"
3347
+ "class StrOrBytesSequence[A: (str, bytes)]: # A é uma TypeVar restrita a str "
3348
+ "ou bytes\n"
3349
+ " ..."
3341
3350
3342
3351
#: ../../library/typing.rst:1608
3343
3352
msgid ""
3344
3353
"However, if desired, reusable type variables can also be constructed "
3345
3354
"manually, like so::"
3346
3355
msgstr ""
3356
+ "No entanto, se desejado, tipos variáveis reutilizáveis também podem ser "
3357
+ "construídas manualmente, como:"
3347
3358
3348
3359
#: ../../library/typing.rst:1610
3349
3360
msgid ""
3350
3361
"T = TypeVar('T') # Can be anything\n"
3351
3362
"S = TypeVar('S', bound=str) # Can be any subtype of str\n"
3352
3363
"A = TypeVar('A', str, bytes) # Must be exactly str or bytes"
3353
3364
msgstr ""
3365
+ "T = TypeVar('T') # Pode ser qualquer coisa\n"
3366
+ "S = TypeVar('S', bound=str) # Pode ser qualquer subtipo de str\n"
3367
+ "A = TypeVar('A', str, bytes) # Deve ser exatamente str ou bytes"
3354
3368
3355
3369
#: ../../library/typing.rst:1614
3356
3370
msgid ""
@@ -3359,6 +3373,11 @@ msgid ""
3359
3373
"function and type alias definitions. See :class:`Generic` for more "
3360
3374
"information on generic types. Generic functions work as follows::"
3361
3375
msgstr ""
3376
+ "Tipos variáveis existem principalmente para o benefício de verificadores de "
3377
+ "tipo estático. Eles servem como parâmetros para tipos genéricos, bem como "
3378
+ "para definições de função genérica e apelidos de tipo. Consulte :class:"
3379
+ "`Generic` para obter mais informações sobre genérico. Funções genéricas "
3380
+ "funcionam da seguinte forma::"
3362
3381
3363
3382
#: ../../library/typing.rst:1620
3364
3383
msgid ""
@@ -3397,6 +3416,8 @@ msgid ""
3397
3416
"Note that type variables can be *bounded*, *constrained*, or neither, but "
3398
3417
"cannot be both bounded *and* constrained."
3399
3418
msgstr ""
3419
+ "Observe que tipos variáveis podem ser *delimitados*, *restritos*, nenhum dos "
3420
+ "dois, mas não podem ser *ambos*."
3400
3421
3401
3422
#: ../../library/typing.rst:1638
3402
3423
msgid ""
@@ -3407,13 +3428,24 @@ msgid ""
3407
3428
"or ``contravariant=True``. By default, manually created type variables are "
3408
3429
"invariant. See :pep:`484` and :pep:`695` for more details."
3409
3430
msgstr ""
3431
+ "A variância de tipos variáveis é inferida pelos verificadores de tipo quando "
3432
+ "eles são criados por meio do :ref:`sintaxe de parâmetro de tipo <type-"
3433
+ "params>` ou quando ``infer_variance=True`` é passado. Os tipos variáveis "
3434
+ "criados manualmente podem ser explicitamente marcados como covariante ou "
3435
+ "contravariantes ao passar ``covariant=True`` ou ``contravariant=True``. Por "
3436
+ "padrão, os tipos variáveis criados manualmente são invariante. Consulte :pep:"
3437
+ "`484` e :pep:`695` para obter mais detalhes."
3410
3438
3411
3439
#: ../../library/typing.rst:1646
3412
3440
msgid ""
3413
3441
"Bounded type variables and constrained type variables have different "
3414
3442
"semantics in several important ways. Using a *bounded* type variable means "
3415
3443
"that the ``TypeVar`` will be solved using the most specific type possible::"
3416
3444
msgstr ""
3445
+ "Tipos variáveis delimitados e tipos variáveis restritos têm semânticas "
3446
+ "diferentes de várias formas importantes. Usar um tipo variável *delimitado* "
3447
+ "significa que a ``TypeVar`` será resolvido usando o tipo mais específico "
3448
+ "possível::"
3417
3449
3418
3450
#: ../../library/typing.rst:1650
3419
3451
msgid ""
@@ -3444,6 +3476,9 @@ msgid ""
3444
3476
"The upper bound of a type variable can be a concrete type, abstract type "
3445
3477
"(ABC or Protocol), or even a union of types::"
3446
3478
msgstr ""
3479
+ "O limite superior de um tipo variável pode ser um tipo concreto, um tipo "
3480
+ "abstrato (classe base abstrata ou protocolo) ou até mesmo uma união de "
3481
+ "tipos::"
3447
3482
3448
3483
#: ../../library/typing.rst:1664
3449
3484
msgid ""
@@ -3484,56 +3519,76 @@ msgid ""
3484
3519
"c = concatenate('one', b'two') # error: type variable 'A' can be either str "
3485
3520
"or bytes in a function call, but not both"
3486
3521
msgstr ""
3522
+ "a = concatenate('one', 'two')\n"
3523
+ "reveal_type(a) # o tipo revelado é str\n"
3524
+ "\n"
3525
+ "b = concatenate(StringSubclass('one'), StringSubclass('two'))\n"
3526
+ "reveal_type(b) # o tipo revelado é str, apesar de StringSubclass ter sido "
3527
+ "passado\n"
3528
+ "\n"
3529
+ "c = concatenate('one', b'two') # erro: tipo variável 'A' pode ser str ou "
3530
+ "bytes em uma chamada de função, mas não ambos"
3487
3531
3488
3532
#: ../../library/typing.rst:1684
3489
3533
msgid "At runtime, ``isinstance(x, T)`` will raise :exc:`TypeError`."
3490
3534
msgstr "Em tempo de execução, ``isinstance(x, T)`` levantará :exc:`TypeError`."
3491
3535
3492
3536
#: ../../library/typing.rst:1688
3493
3537
msgid "The name of the type variable."
3494
- msgstr ""
3538
+ msgstr "O nome do tipo variável. "
3495
3539
3496
3540
#: ../../library/typing.rst:1692
3497
3541
msgid "Whether the type var has been explicitly marked as covariant."
3498
- msgstr ""
3542
+ msgstr "Se o tipo variável foi explicitamente marcado como covariante. "
3499
3543
3500
3544
#: ../../library/typing.rst:1696
3501
3545
msgid "Whether the type var has been explicitly marked as contravariant."
3502
- msgstr ""
3546
+ msgstr "Se o tipo variável foi explicitamente marcado como contravariante. "
3503
3547
3504
3548
#: ../../library/typing.rst:1700
3505
3549
msgid ""
3506
3550
"Whether the type variable's variance should be inferred by type checkers."
3507
3551
msgstr ""
3552
+ "Se a variância de tipo variável deve ser inferida por verificadores de tipo."
3508
3553
3509
3554
#: ../../library/typing.rst:1706
3510
3555
msgid "The upper bound of the type variable, if any."
3511
- msgstr ""
3556
+ msgstr "A limite superior do tipo variável, se houver. "
3512
3557
3513
3558
#: ../../library/typing.rst:1710
3514
3559
msgid ""
3515
3560
"For type variables created through :ref:`type parameter syntax <type-"
3516
3561
"params>`, the bound is evaluated only when the attribute is accessed, not "
3517
3562
"when the type variable is created (see :ref:`lazy-evaluation`)."
3518
3563
msgstr ""
3564
+ "Para tipos variáveis criado por meio da :ref:`sintaxe de parâmetro de tipo "
3565
+ "<type-params>` , a limite é avaliado somente quando o atributo é acessado, "
3566
+ "não quando o tipo variável é criado (consulte :ref:`lazy-evaluation`)."
3519
3567
3520
3568
#: ../../library/typing.rst:1716
3521
3569
msgid "A tuple containing the constraints of the type variable, if any."
3522
- msgstr ""
3570
+ msgstr "Um tupla contendo as restrições do tipo variável, se houver. "
3523
3571
3524
3572
#: ../../library/typing.rst:1720
3525
3573
msgid ""
3526
3574
"For type variables created through :ref:`type parameter syntax <type-"
3527
3575
"params>`, the constraints are evaluated only when the attribute is accessed, "
3528
3576
"not when the type variable is created (see :ref:`lazy-evaluation`)."
3529
3577
msgstr ""
3578
+ "Para tipos variáveis criado por meio da :ref:`sintaxe de parâmetro de tipo "
3579
+ "<type-params>` , a restrição é avaliada somente quando o atributo é "
3580
+ "acessado, não quando o tipo variável é criado (consulte :ref:`lazy-"
3581
+ "evaluation`)."
3530
3582
3531
3583
#: ../../library/typing.rst:1726
3532
3584
msgid ""
3533
3585
"Type variables can now be declared using the :ref:`type parameter <type-"
3534
3586
"params>` syntax introduced by :pep:`695`. The ``infer_variance`` parameter "
3535
3587
"was added."
3536
3588
msgstr ""
3589
+ "tipos variáveis agora podem ser declarados usando a :ref:`sintaxe de "
3590
+ "parâmetro de tipo <type-params>` introduzida por :pep:`695`. O parâmetro "
3591
+ "``infer_variance`` foi adicionado."
3537
3592
3538
3593
#: ../../library/typing.rst:1734
3539
3594
msgid ""
0 commit comments