@@ -11,7 +11,7 @@ msgstr ""
11
11
"Project-Id-Version : Python 3.8\n "
12
12
"Report-Msgid-Bugs-To : \n "
13
13
"POT-Creation-Date : 2020-05-05 12:54+0200\n "
14
- "PO-Revision-Date : 2020-12-22 19:53 -0600\n "
14
+ "PO-Revision-Date : 2020-12-23 13:32 -0600\n "
15
15
"Language-Team : python-doc-es\n "
16
16
"MIME-Version : 1.0\n "
17
17
"Content-Type : text/plain; charset=UTF-8\n "
@@ -2455,6 +2455,11 @@ msgid ""
2455
2455
"``x.__hash__()`` returns an appropriate value such that ``x == y`` implies "
2456
2456
"both that ``x is y`` and ``hash(x) == hash(y)``."
2457
2457
msgstr ""
2458
+ "Clases definidas por usuario tienen los métodos :meth:`__eq__` y :meth:"
2459
+ "`__hash__` por defecto; con ellos, todos los objetos se comparan de manera "
2460
+ "desigual (excepto con ellos mismos) y ``x.__hash__()`` devuelve un valor "
2461
+ "apropiado tal que ``x == y`` implique que ``x es y`` y ``hash(x) == "
2462
+ "hash(y)``."
2458
2463
2459
2464
#: ../Doc/reference/datamodel.rst:1438
2460
2465
msgid ""
@@ -2465,13 +2470,22 @@ msgid ""
2465
2470
"hash value, and will also be correctly identified as unhashable when "
2466
2471
"checking ``isinstance(obj, collections.abc.Hashable)``."
2467
2472
msgstr ""
2473
+ "Una clase que anula :meth:`__eq__` y no define :meth:`__hash__` tendrá "
2474
+ "implícito su :meth:`__hash__` establecido a ``None``. Cuando el método :meth:"
2475
+ "`__hash__` de una clase es ``None``, instancias de la clase lanzarán un :exc:"
2476
+ "`TypeError` cuando el programa intente obtener el valor del hash, y también "
2477
+ "será correctamente identificado como de hash no calculable cuando se "
2478
+ "verifique ``isinstance(obj, collections.abc.Hashable)``."
2468
2479
2469
2480
#: ../Doc/reference/datamodel.rst:1445
2470
2481
msgid ""
2471
2482
"If a class that overrides :meth:`__eq__` needs to retain the implementation "
2472
2483
"of :meth:`__hash__` from a parent class, the interpreter must be told this "
2473
2484
"explicitly by setting ``__hash__ = <ParentClass>.__hash__``."
2474
2485
msgstr ""
2486
+ "Si una clase que anula :meth:`__eq__` necesita conservar la implementación "
2487
+ "de :meth:`__hash__` de una clase padre, al intérprete se le debe informar "
2488
+ "explícitamente estableciendo ``__hash__ = <ParentClass>.__hash__``."
2475
2489
2476
2490
#: ../Doc/reference/datamodel.rst:1449
2477
2491
msgid ""
@@ -2481,6 +2495,11 @@ msgid ""
2481
2495
"`TypeError` would be incorrectly identified as hashable by an "
2482
2496
"``isinstance(obj, collections.abc.Hashable)`` call."
2483
2497
msgstr ""
2498
+ "Si una clase que no anula :meth:`__eq__` desea eliminar el soporte de "
2499
+ "*hash*, debe incluir ``__hash__ = None`` en la definición de clase. Una "
2500
+ "clase que define su propio :meth:`__hash__` y que explícitamente lanza un :"
2501
+ "exc:`TypeError` será identificado de manera incorrecta como de hash "
2502
+ "calculable por una llamada ``isinstance(obj, collections.abc.Hashable)``."
2484
2503
2485
2504
#: ../Doc/reference/datamodel.rst:1458
2486
2505
msgid ""
@@ -2489,6 +2508,10 @@ msgid ""
2489
2508
"an individual Python process, they are not predictable between repeated "
2490
2509
"invocations of Python."
2491
2510
msgstr ""
2511
+ "Por defecto los valores de objetos str y bytes de :meth:`__hash__` son "
2512
+ "“salados” con un valor aleatorio impredecible. Aunque se mantienen "
2513
+ "constantes dentro de un proceso Python particular, no son predecibles entre "
2514
+ "invocaciones repetidas de Python."
2492
2515
2493
2516
#: ../Doc/reference/datamodel.rst:1463
2494
2517
msgid ""
@@ -2497,21 +2520,28 @@ msgid ""
2497
2520
"insertion, O(n^2) complexity. See http://www.ocert.org/advisories/"
2498
2521
"ocert-2011-003.html for details."
2499
2522
msgstr ""
2523
+ "Esto tiene la intención de proveer protección contra una negación de "
2524
+ "servicio causada por entradas cautelosamente elegidas y que explotan el peor "
2525
+ "caso de rendimiento en la inserción de un diccionario, complejidad O(n^2). "
2526
+ "Ver http://www.ocert.org/advisories/ocert-2011-003.html para más detalles."
2500
2527
2501
2528
#: ../Doc/reference/datamodel.rst:1468
2502
2529
msgid ""
2503
2530
"Changing hash values affects the iteration order of sets. Python has never "
2504
2531
"made guarantees about this ordering (and it typically varies between 32-bit "
2505
2532
"and 64-bit builds)."
2506
2533
msgstr ""
2534
+ "Cambiar los valores hash afectan el orden de la iteración de los sets. "
2535
+ "Python nunca ha dado garantías en relación a este orden (y típicamente varía "
2536
+ "entre estructuras de 32-bits y 64-bits)."
2507
2537
2508
2538
#: ../Doc/reference/datamodel.rst:1472
2509
2539
msgid "See also :envvar:`PYTHONHASHSEED`."
2510
- msgstr ""
2540
+ msgstr "Ver también :envvar:`PYTHONHASHSEED`. "
2511
2541
2512
2542
#: ../Doc/reference/datamodel.rst:1474
2513
2543
msgid "Hash randomization is enabled by default."
2514
- msgstr ""
2544
+ msgstr "La aleatorización de hash es habilitada por defecto. "
2515
2545
2516
2546
#: ../Doc/reference/datamodel.rst:1482
2517
2547
msgid ""
@@ -2521,17 +2551,26 @@ msgid ""
2521
2551
"considered true if its result is nonzero. If a class defines neither :meth:"
2522
2552
"`__len__` nor :meth:`__bool__`, all its instances are considered true."
2523
2553
msgstr ""
2554
+ "Es llamado para implementar pruebas de valores de verdad y la operación "
2555
+ "incorporada ``bool()``; debe retornar ``False`` o ``True``. Cuando este "
2556
+ "método no es definido, :meth:`__len__` es llamado, si es definido, y el "
2557
+ "objeto es considerado verdadero (*true*) si el resultado es diferente de "
2558
+ "zero. Si la clase no define :meth:`__len__` ni :meth:`__bool__`, todas sus "
2559
+ "instancias son consideradas verdaderas (*true*)."
2524
2560
2525
2561
#: ../Doc/reference/datamodel.rst:1493
2526
2562
msgid "Customizing attribute access"
2527
- msgstr ""
2563
+ msgstr "Personalizando acceso a atributos "
2528
2564
2529
2565
#: ../Doc/reference/datamodel.rst:1495
2530
2566
msgid ""
2531
2567
"The following methods can be defined to customize the meaning of attribute "
2532
2568
"access (use of, assignment to, or deletion of ``x.name``) for class "
2533
2569
"instances."
2534
2570
msgstr ""
2571
+ "Los siguientes métodos pueden ser definidos para personalizar el significado "
2572
+ "de acceso a atributos (uso de, asignación a, o borrado de ``x.name``) para "
2573
+ "instancias de clase."
2535
2574
2536
2575
#: ../Doc/reference/datamodel.rst:1503
2537
2576
msgid ""
@@ -2542,6 +2581,13 @@ msgid ""
2542
2581
"`AttributeError`). This method should either return the (computed) "
2543
2582
"attribute value or raise an :exc:`AttributeError` exception."
2544
2583
msgstr ""
2584
+ "Es llamado cuando el acceso a atributos por defecto falla con un :exc:"
2585
+ "`AttributeError` (ya sea que :meth:`__getattribute__` lanza una excepción :"
2586
+ "exc:`AttributeError` porque *name* no es un atributo de instancia o un "
2587
+ "atributo en el árbol de clase para ``self``; o el :meth:`__get__` de la "
2588
+ "propiedad de *name* lanza una excepción :exc:`AttributeError`). Este método "
2589
+ "debe retornar el valor de atributo (calculado) o lanzar una excepción :exc:"
2590
+ "`AttributeError`."
2545
2591
2546
2592
#: ../Doc/reference/datamodel.rst:1510
2547
2593
msgid ""
@@ -2555,6 +2601,16 @@ msgid ""
2555
2601
"object). See the :meth:`__getattribute__` method below for a way to "
2556
2602
"actually get total control over attribute access."
2557
2603
msgstr ""
2604
+ "Tome en cuenta que si el atributo es encontrado a través del mecanismo "
2605
+ "normal, :meth:`__getattr__` no es llamado. (Esto es una asimetría "
2606
+ "intencional entre :meth:`__getattr__` y :meth:`__setattr__`.) Esto es "
2607
+ "realizado tanto por motivos de eficiencia y porque de otra manera :meth:"
2608
+ "`__getattr__` no tendría manera de acceder a otros atributos de la "
2609
+ "instancia. Tome en cuenta que al menos para variables de instancia, se puede "
2610
+ "fingir control total al no insertar ningún valor en el diccionario de "
2611
+ "atributo de instancia (sino insertándolos en otro objeto). Ver el método :"
2612
+ "meth:`__getattribute__` a continuación para una forma de tener control total "
2613
+ "sobre el acceso de atributo."
2558
2614
2559
2615
#: ../Doc/reference/datamodel.rst:1523
2560
2616
msgid ""
@@ -2567,44 +2623,69 @@ msgid ""
2567
2623
"base class method with the same name to access any attributes it needs, for "
2568
2624
"example, ``object.__getattribute__(self, name)``."
2569
2625
msgstr ""
2626
+ "Es llamado incondicionalmente para implementar acceso de atributo por "
2627
+ "instancias de clase. Si la clase también define :meth:`__getattr__`, éste no "
2628
+ "será llamado a menos que :meth:`__getattribute__` lo llame de manera "
2629
+ "explícita o lance una excepción :exc:`AttributeError`. Este método deberá "
2630
+ "retornar el valor de atributo (calculado) o lanzar una excepción :exc:"
2631
+ "`AttributeError`. Para evitar la recursividad infinita en este método, su "
2632
+ "implementación deberá siempre llamar al método de la clase base con el mismo "
2633
+ "nombre para acceder cualquier atributo que necesite, por ejemplo, ``object."
2634
+ "__getattribute__(self, name)``."
2570
2635
2571
2636
#: ../Doc/reference/datamodel.rst:1534
2572
2637
msgid ""
2573
2638
"This method may still be bypassed when looking up special methods as the "
2574
2639
"result of implicit invocation via language syntax or built-in functions. "
2575
2640
"See :ref:`special-lookup`."
2576
2641
msgstr ""
2642
+ "Este método aún puede ser sobrepasado cuando se buscan métodos especiales "
2643
+ "como resultado de una invocación implícita a través de sintaxis de lenguaje "
2644
+ "o funciones implícitas. Ver :ref:`special-lookup`."
2577
2645
2578
2646
#: ../Doc/reference/datamodel.rst:1541
2579
2647
msgid ""
2580
2648
"Called when an attribute assignment is attempted. This is called instead of "
2581
2649
"the normal mechanism (i.e. store the value in the instance dictionary). "
2582
2650
"*name* is the attribute name, *value* is the value to be assigned to it."
2583
2651
msgstr ""
2652
+ "Es llamado cuando se intenta la asignación de atributos. Éste es llamado en "
2653
+ "lugar del mecanismo normal (p. ej. guardar el valor en el diccionario de "
2654
+ "instancias). *name* es el nombre de atributo, *value* es el valor que se le "
2655
+ "asigna."
2584
2656
2585
2657
#: ../Doc/reference/datamodel.rst:1545
2586
2658
msgid ""
2587
2659
"If :meth:`__setattr__` wants to assign to an instance attribute, it should "
2588
2660
"call the base class method with the same name, for example, ``object."
2589
2661
"__setattr__(self, name, value)``."
2590
2662
msgstr ""
2663
+ "Si :meth:`__setattr__` quiere asignar a un atributo de instancia, debe "
2664
+ "llamar al método de la clase base con el mismo nombre, por ejemplo, ``object."
2665
+ "__setattr__(self, name, value)``."
2591
2666
2592
2667
#: ../Doc/reference/datamodel.rst:1552
2593
2668
msgid ""
2594
2669
"Like :meth:`__setattr__` but for attribute deletion instead of assignment. "
2595
2670
"This should only be implemented if ``del obj.name`` is meaningful for the "
2596
2671
"object."
2597
2672
msgstr ""
2673
+ "Al igual que :meth:`__setattr__` pero para borrado de atributos en lugar de "
2674
+ "establecerlos. Esto solo de ser implementado si ``del obj.name`` es "
2675
+ "significativo para el objeto."
2598
2676
2599
2677
#: ../Doc/reference/datamodel.rst:1558
2600
2678
msgid ""
2601
2679
"Called when :func:`dir` is called on the object. A sequence must be "
2602
2680
"returned. :func:`dir` converts the returned sequence to a list and sorts it."
2603
2681
msgstr ""
2682
+ "Es llamado cuando :func:`dir` es llamado en el objeto. Una secuencia debe "
2683
+ "ser retornada. :func:`dir` convierte la secuencia retornada a una lista y la "
2684
+ "ordena."
2604
2685
2605
2686
#: ../Doc/reference/datamodel.rst:1563
2606
2687
msgid "Customizing module attribute access"
2607
- msgstr ""
2688
+ msgstr "Personalizando acceso a atributos de módulo "
2608
2689
2609
2690
#: ../Doc/reference/datamodel.rst:1570
2610
2691
msgid ""
@@ -2617,6 +2698,15 @@ msgid ""
2617
2698
"``__dict__`` before raising an :exc:`AttributeError`. If found, it is called "
2618
2699
"with the attribute name and the result is returned."
2619
2700
msgstr ""
2701
+ "Nombres especiales ``__getattr__`` y ``__dir__`` también pueden ser "
2702
+ "utilizados para personalizar acceso a atributos de módulo. La función "
2703
+ "``__getattr__`` a nivel del módulo debe aceptar un argumento que es el "
2704
+ "nombre del atributo y retornar el valor calculado o lanzar una excepción :"
2705
+ "exc:`AttributeError`. Si un atributo no es encontrado en el objeto de módulo "
2706
+ "a través de una búsqueda normal, p. ej. :meth:`object.__getattribute__`, "
2707
+ "entonces ``__getattr__`` es buscado en el módulo ``__dict__`` antes de "
2708
+ "lanzar una excepción :exc:`AttributeError`. Si es encontrado, es llamado con "
2709
+ "el nombre de atributo y el resultado es retornado."
2620
2710
2621
2711
#: ../Doc/reference/datamodel.rst:1579
2622
2712
msgid ""
0 commit comments