Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for syntax (0.03 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"
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 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":
    
    //// tab | Python 3.10+
    
    ```Python hl_lines="12"
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 9.4K bytes
    - Viewed (0)
Back to top