Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 10 of 61 for person (0.05 seconds)

  1. tests/test_jsonable_encoder.py

    from pydantic import BaseModel, Field, ValidationError
    
    
    class Person:
        def __init__(self, name: str):
            self.name = name
    
    
    class Pet:
        def __init__(self, owner: Person, name: str):
            self.owner = owner
            self.name = name
    
    
    @dataclass
    class Item:
        name: str
        count: int
    
    
    class DictablePerson(Person):
        def __iter__(self):
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Tue Feb 17 09:59:14 GMT 2026
    - 9.2K bytes
    - Click Count (0)
  2. tests/test_read_with_orm_mode.py

            full_name: str
    
            model_config = {"from_attributes": True}
    
        app = FastAPI()
    
        @app.post("/people/", response_model=PersonRead)
        def create_person(person: PersonCreate) -> Any:
            db_person = Person.model_validate(person)
            return db_person
    
        client = TestClient(app)
    
        person_data = {"name": "Dive", "lastname": "Wilson"}
        response = client.post("/people/", json=person_data)
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sat Dec 27 12:54:56 GMT 2025
    - 1.2K bytes
    - Click Count (0)
  3. docs_src/python_types/tutorial010_py310.py

    class Person:
        def __init__(self, name: str):
            self.name = name
    
    
    def get_person_name(one_person: Person):
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Feb 12 13:19:43 GMT 2026
    - 144 bytes
    - Click Count (0)
  4. docs/en/docs/python-types.md

    ### Classes as types { #classes-as-types }
    
    You can also declare a class as the type of a variable.
    
    Let's say you have a class `Person`, with a name:
    
    {* ../../docs_src/python_types/tutorial010_py310.py hl[1:3] *}
    
    Then you can declare a variable to be of type `Person`:
    
    {* ../../docs_src/python_types/tutorial010_py310.py hl[6] *}
    
    And then, again, you get all the editor support:
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 05 18:13:19 GMT 2026
    - 11K bytes
    - Click Count (0)
  5. docs/zh-hant/docs/python-types.md

    你也可以用類別來宣告變數的型別。
    
    假設你有一個 `Person` 類別,帶有名稱:
    
    {* ../../docs_src/python_types/tutorial010_py310.py hl[1:3] *}
    
    接著你可以宣告一個變數為 `Person` 型別:
    
    {* ../../docs_src/python_types/tutorial010_py310.py hl[6] *}
    
    然後,你一樣會得到完整的編輯器支援:
    
    <img src="/img/python-types/image06.png">
    
    請注意,這表示「`one_person` 是類別 `Person` 的『實例(instance)』」。
    
    並不是「`one_person` 就是名為 `Person` 的『類別(class)』」。
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:05:38 GMT 2026
    - 10.7K bytes
    - Click Count (0)
  6. docs/zh/docs/python-types.md

    你也可以把类声明为变量的类型。
    
    假设你有一个名为 `Person` 的类,带有 name:
    
    {* ../../docs_src/python_types/tutorial010_py310.py hl[1:3] *}
    
    然后你可以声明一个变量是 `Person` 类型:
    
    {* ../../docs_src/python_types/tutorial010_py310.py hl[6] *}
    
    接着,你会再次获得所有的编辑器支持:
    
    <img src="/img/python-types/image06.png">
    
    注意,这表示“`one_person` 是类 `Person` 的一个实例(instance)”。
    
    它并不表示“`one_person` 是名为 `Person` 的类本身(class)”。
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:06:37 GMT 2026
    - 10.6K bytes
    - Click Count (0)
  7. docs/en/docs/tutorial/metadata.md

    | `license_info`...
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 05 18:13:19 GMT 2026
    - 5.8K bytes
    - Click Count (0)
  8. docs/de/llm-prompt.md

    Example:
    
    Source (English):
    
    ```
    ## Another module with `APIRouter` { #another-module-with-apirouter }
    ```
    
    Translate with (German):
    
    ```
    ## Ein weiteres Modul mit `APIRouter` { #another-module-with-apirouter }
    ```
    
    Do NOT translate with (German) – notice the added period:
    
    ```
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Mon Dec 29 18:54:20 GMT 2025
    - 9.8K bytes
    - Click Count (0)
  9. docs/ja/docs/python-types.md

    変数の型としてクラスを宣言することもできます。
    
    名前を持つ `Person` クラスがあるとしましょう:
    
    {* ../../docs_src/python_types/tutorial010_py310.py hl[1:3] *}
    
    変数を `Person` 型として宣言できます:
    
    {* ../../docs_src/python_types/tutorial010_py310.py hl[6] *}
    
    そして、再び、すべてのエディタのサポートを得ることができます:
    
    <img src="/img/python-types/image06.png">
    
    これは「`one_person` はクラス `Person` の **インスタンス** である」ことを意味します。
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 14:07:17 GMT 2026
    - 14.3K bytes
    - Click Count (0)
  10. android/guava/src/com/google/common/reflect/Invokable.java

      }
    
      /**
       * Explicitly specifies the return type of this {@code Invokable}. For example:
       *
       * {@snippet :
       * Method factoryMethod = Person.class.getMethod("create");
       * Invokable<?, Person> factory = Invokable.of(getNameMethod).returning(Person.class);
       * }
       */
      public final <R1 extends R> Invokable<T, R1> returning(Class<R1> returnType) {
        return returning(TypeToken.of(returnType));
      }
    
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Mon Mar 23 21:06:42 GMT 2026
    - 18.5K bytes
    - Click Count (0)
Back to Top