Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for list (0.15 sec)

  1. docs/zh/docs/python-types.md

    ```
    
    ### 嵌套类型
    
    有些容器数据结构可以包含其他的值,比如 `dict`、`list`、`set` 和 `tuple`。它们内部的值也会拥有自己的类型。
    
    你可以使用 Python 的 `typing` 标准库来声明这些类型以及子类型。
    
    它专门用来支持这些类型提示。
    
    #### 列表
    
    例如,让我们来定义一个由 `str` 组成的 `list` 变量。
    
    从 `typing` 模块导入 `List`(注意是大写的 `L`):
    
    ```Python hl_lines="1"
    {!../../../docs_src/python_types/tutorial006.py!}
    ```
    
    同样以冒号(`:`)来声明这个变量。
    
    输入 `List` 作为类型。
    
    由于列表是带有"子类型"的类型,所以我们把子类型放在方括号中:
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 8.6K bytes
    - Viewed (0)
  2. docs/tr/docs/python-types.md

    "dict", "list", "set" ve "tuple" gibi diğer değerleri içerebilen bazı veri yapıları vardır. Ve dahili değerlerinin de tip belirtecleri olabilir.
    
    Bu tipleri ve dahili tpileri bildirmek için standart Python modülünü "typing" kullanabilirsiniz.
    
    Bu tür tip belirteçlerini desteklemek için özel olarak mevcuttur.
    
    #### `List`
    
    Örneğin `str` değerlerden oluşan bir `list` tanımlayalım.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 9.7K bytes
    - Viewed (0)
  3. docs/pt/docs/python-types.md

    Para declarar esses tipos e os tipos internos, você pode usar o módulo Python padrão `typing`.
    
    Ele existe especificamente para suportar esses type hints.
    
    #### `List`
    
    Por exemplo, vamos definir uma variável para ser uma `lista` de `str`.
    
    Em `typing`, importe `List` (com um `L` maiúsculo):
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 9.6K bytes
    - Viewed (0)
  4. docs/es/docs/python-types.md

    Declara la variable con la misma sintaxis de los dos puntos (`:`).
    
    Pon `List` como el tipo.
    
    Como la lista es un tipo que permite tener un "sub-tipo" pones el sub-tipo en corchetes `[]`:
    
    ```Python hl_lines="4"
    {!../../../docs_src/python_types/tutorial006.py!}
    ```
    
    Esto significa: la variable `items` es una `list` y cada uno de los ítems en esta lista es un `str`.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 9.2K bytes
    - Viewed (0)
Back to top