- Sort Score
- Num 10 results
- Language All
Results 781 - 790 of 880 for def2 (0.05 seconds)
-
docs/zh/docs/advanced/settings.md
从磁盘读取文件通常是一个代价较高(缓慢)的操作,所以你可能希望只在第一次读取,然后复用同一个设置对象,而不是为每个请求都重新读取。 但是,每次我们执行: ```Python Settings() ``` 都会创建一个新的 `Settings` 对象,并且在创建时会再次读取 `.env` 文件。 如果依赖项函数是这样的: ```Python def get_settings(): return Settings() ``` 我们就会为每个请求创建该对象,并为每个请求读取 `.env` 文件。 ⚠️ 但由于我们在顶部使用了 `@lru_cache` 装饰器,`Settings` 对象只会在第一次调用时创建一次。 ✔️ {* ../../docs_src/settings/app03_an_py310/main.py hl[1,11] *}
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 17:06:37 GMT 2026 - 10.4K bytes - Click Count (0) -
build-tools-internal/src/main/groovy/elasticsearch.formatting.gradle
* * This is also carried out by the `precommit` task. * * For more about Spotless, see: * * https://github.com/diffplug/spotless/tree/master/plugin-gradle */ // Do not add new sub-projects here! def projectPathsToExclude = [ ':client:benchmark', ':client:client-benchmark-noop-api-plugin', ':client:rest', ':client:rest-high-level', ':client:sniffer', ':client:test', ':example-plugins:custom-settings',
Created: Wed Apr 08 16:19:15 GMT 2026 - Last Modified: Thu Sep 09 18:53:35 GMT 2021 - 9.1K bytes - Click Count (0) -
docs/ja/docs/advanced/settings.md
しかし、次のようにするたびに: ```Python Settings() ``` 新しい `Settings` オブジェクトが作成され、その作成時に `.env` ファイルが再度読み込まれます。 依存関数が次のようであれば: ```Python def get_settings(): return Settings() ``` 各リクエストごとにそのオブジェクトを作成し、各リクエストごとに `.env` ファイルを読み込むことになります。⚠️ しかし、上に `@lru_cache` デコレータを使っているので、`Settings` オブジェクトは最初に呼び出されたときに一度だけ作成されます。✔️
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 14:07:17 GMT 2026 - 12.7K bytes - Click Count (0) -
docs/de/docs/tutorial/stream-json-lines.md
/// ### Nicht-async *Pfadoperation-Funktionen* { #non-async-path-operation-functions } Sie können auch normale `def`-Funktionen (ohne `async`) verwenden und `yield` auf die gleiche Weise einsetzen. FastAPI stellt sicher, dass sie korrekt ausgeführt werden, sodass der Event Loop nicht blockiert wird.Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 19 17:48:21 GMT 2026 - 4.9K bytes - Click Count (0) -
docs/uk/docs/tutorial/first-steps.md
**FastAPI** викликатиме її щоразу, коли отримає запит до URL «`/`», використовуючи операцію `GET`. У цьому випадку це `async` функція. --- Ви також можете визначити її як звичайну функцію замість `async def`: {* ../../docs_src/first_steps/tutorial003_py310.py hl[7] *} /// note Якщо ви не знаєте різницю, подивіться [Асинхронність: *«Поспішаєте?»*](../async.md#in-a-hurry). ///Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 19 18:27:41 GMT 2026 - 18.7K bytes - Click Count (0) -
docs/en/docs/tutorial/request-files.md
For example, inside of an `async` *path operation function* you can get the contents with: ```Python contents = await myfile.read() ``` If you are inside of a normal `def` *path operation function*, you can access the `UploadFile.file` directly, for example: ```Python contents = myfile.file.read() ``` /// note | `async` Technical Details
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 05 18:13:19 GMT 2026 - 7K bytes - Click Count (0) -
docs/pt/docs/tutorial/request-files.md
Por exemplo, dentro de uma função de *operação de rota* `assíncrona`, você pode obter o conteúdo com: ```Python contents = await myfile.read() ``` Se você estiver dentro de uma função de *operação de rota* normal `def`, você pode acessar o `UploadFile.file` diretamente, por exemplo: ```Python contents = myfile.file.read() ``` /// note | Detalhes Técnicos do `async`
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 19 18:20:43 GMT 2026 - 7.8K bytes - Click Count (0) -
docs/de/docs/tutorial/request-files.md
Zum Beispiel können Sie innerhalb einer `async` *Pfadoperation-Funktion* den Inhalt wie folgt auslesen: ```Python contents = await myfile.read() ``` Wenn Sie sich innerhalb einer normalen `def`-*Pfadoperation-Funktion* befinden, können Sie direkt auf `UploadFile.file` zugreifen, zum Beispiel: ```Python contents = myfile.file.read() ``` /// note | Technische Details zu `async`
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 19 17:58:09 GMT 2026 - 8.3K bytes - Click Count (0) -
docs/zh-hant/docs/tutorial/dependencies/classes-as-dependencies.md
something(some_argument, some_keyword_argument="foo") ``` 那它就是一個「callable」。 ## 以類別作為相依性 { #classes-as-dependencies_1 } 你可能已經注意到,建立一個 Python 類別的實例時,你用的語法也是一樣的。 例如: ```Python class Cat: def __init__(self, name: str): self.name = name fluffy = Cat(name="Mr Fluffy") ``` 在這個例子中,`fluffy` 是 `Cat` 類別的一個實例。 而要建立 `fluffy`,你其實是在「呼叫」`Cat`。 所以,Python 類別本身也是一種 **callable**。
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sat Feb 14 08:15:26 GMT 2026 - 6.7K bytes - Click Count (0) -
docs/zh/docs/tutorial/first-steps.md
{* ../../docs_src/first_steps/tutorial001_py310.py hl[7] *} 这是一个 Python 函数。 每当 **FastAPI** 接收一个使用 `GET` 方法访问 URL「`/`」的请求时这个函数会被调用。 在这个例子中,它是一个 `async` 函数。 --- 你也可以将其定义为常规函数而不使用 `async def`: {* ../../docs_src/first_steps/tutorial003_py310.py hl[7] *} /// note 如果你不知道两者的区别,请查阅 [并发: *赶时间吗?*](../async.md#in-a-hurry)。 /// ### 步骤 5:返回内容 { #step-5-return-the-content }Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 17:06:37 GMT 2026 - 13.3K bytes - Click Count (0)