Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for syntax (0.29 sec)

  1. docs/pt/docs/tutorial/body-nested-models.md

    * Passe o(s) tipo(s) interno(s) como "parâmetros de tipo" usando colchetes: `[` e `]`
    
    ```Python
    from typing import List
    
    my_list: List[str]
    ```
    
    Essa é a sintaxe padrão do Python para declarações de tipo.
    
    Use a mesma sintaxe padrão para atributos de modelo com tipos internos.
    
    Portanto, em nosso exemplo, podemos fazer com que `tags` sejam especificamente uma "lista de strings":
    
    
    ```Python hl_lines="14"
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 7.4K bytes
    - Viewed (0)
  2. docs/en/docs/tutorial/body-nested-models.md

    ```Python
    my_list: list[str]
    ```
    
    In versions of Python before 3.9, it would be:
    
    ```Python
    from typing import List
    
    my_list: List[str]
    ```
    
    That's all standard Python syntax for type declarations.
    
    Use that same standard syntax for model attributes with internal types.
    
    So, in our example, we can make `tags` be specifically a "list of strings":
    
    === "Python 3.10+"
    
        ```Python hl_lines="12"
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 9.5K bytes
    - Viewed (0)
Back to top