- Sort Score
- Num 10 results
- Language All
Results 11 - 20 of 814 for Optional (0.07 seconds)
The search processing time has exceeded the limit. The displayed results may be partial.
-
docs/zh-hant/docs/advanced/advanced-python-types.md
兩者等價且底層相同,但我會推薦用 `Union` 而不要用 `Optional`,因為「optional」這個詞看起來會讓人以為這個值是可選的,但實際上它的意思是「可以是 `None`」,即使它不是可選的、仍然是必填。 我認為 `Union[SomeType, None]` 更能清楚表達其含義。 這只是措辭與命名問題,但這些詞會影響你與團隊成員對程式碼的理解。 例如,看看下面這個函式: ```python from typing import Optional def say_hi(name: Optional[str]): print(f"Hey {name}!") ``` 參數 `name` 被標註為 `Optional[str]`,但它並不是可選的;你不能在沒有該參數的情況下呼叫這個函式: ```Python
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sat Feb 14 08:15:26 GMT 2026 - 1.9K bytes - Click Count (0) -
tests/test_request_params/test_query/test_optional_str.py
) @pytest.mark.parametrize( "path", ["/optional-str", "/model-optional-str"], ) def test_optional_str_missing(path: str): client = TestClient(app) response = client.get(path) assert response.status_code == 200 assert response.json() == {"p": None} @pytest.mark.parametrize( "path", ["/optional-str", "/model-optional-str"], ) def test_optional_str(path: str):
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Tue Feb 17 09:59:14 GMT 2026 - 8.4K bytes - Click Count (0) -
internal/config/identity/ldap/help.go
Optional: true, Type: "string", Sensitive: false, }, config.HelpKV{ Key: LookupBindDN, Description: `DN for LDAP read-only service account used to perform DN and group lookups` + defaultHelpPostfix(LookupBindDN), Optional: true, Type: "string", Sensitive: true, }, config.HelpKV{
Created: Sun Apr 05 19:28:12 GMT 2026 - Last Modified: Fri May 24 23:05:23 GMT 2024 - 3.8K bytes - Click Count (0) -
tests/test_request_params/test_body/test_optional_str.py
@pytest.mark.parametrize( "path", ["/optional-str", "/model-optional-str"], ) def test_optional_str_missing_empty_dict(path: str): client = TestClient(app) response = client.post(path, json={}) assert response.status_code == 200, response.text assert response.json() == {"p": None} @pytest.mark.parametrize( "path", ["/optional-str", "/model-optional-str"], ) def test_optional_str(path: str):
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Tue Feb 17 09:59:14 GMT 2026 - 11.5K bytes - Click Count (0) -
api/maven-api-cli/src/main/java/org/apache/maven/api/cli/mvn/MavenOptions.java
* @return an {@link Optional} containing the list of profile names to activate, or empty if not specified */ @Nonnull Optional<List<String>> activatedProfiles(); /** * Indicates whether Maven should suppress SNAPSHOT updates. * * @return an {@link Optional} containing true if SNAPSHOT updates should be suppressed, false if not, or empty if not specified */ @NonnullCreated: Sun Apr 05 03:35:12 GMT 2026 - Last Modified: Wed Jun 11 13:14:09 GMT 2025 - 8K bytes - Click Count (0) -
impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/LayeredOptions.java
Created: Sun Apr 05 03:35:12 GMT 2026 - Last Modified: Wed Feb 26 17:31:44 GMT 2025 - 5.7K bytes - Click Count (0) -
build-conventions/src/main/java/org/elasticsearch/gradle/internal/conventions/util/Util.java
/** * @param project The project to look for test Java resources. * @return An Optional that contains the Java test SourceSet if it exists. */ public static Optional<SourceSet> getJavaTestSourceSet(Project project) { return project.getExtensions().findByName("java") == null ? Optional.empty() : Optional.ofNullable(getJavaSourceSets(project).findByName(SourceSet.TEST_SOURCE_SET_NAME)); }Created: Wed Apr 08 16:19:15 GMT 2026 - Last Modified: Tue Jul 27 15:18:50 GMT 2021 - 5.1K bytes - Click Count (0) -
internal/config/identity/openid/help.go
Optional: true, Type: "string", }, config.HelpKV{ Key: ClaimName, Description: `JWT canned policy claim name` + defaultHelpPostfix(ClaimName), Optional: true, Type: "string", }, config.HelpKV{ Key: Scopes,
Created: Sun Apr 05 19:28:12 GMT 2026 - Last Modified: Fri Jun 23 14:45:27 GMT 2023 - 4.3K bytes - Click Count (0) -
api/maven-api-core/src/main/java/org/apache/maven/api/services/DependencyCoordinatesFactoryRequest.java
this.scope = scope; return this; } public DependencyCoordinatesFactoryRequestBuilder optional(boolean optional) { this.optional = optional; return this; } public DependencyCoordinatesFactoryRequestBuilder exclusions(Collection<Exclusion> exclusions) { if (exclusions != null) {Created: Sun Apr 05 03:35:12 GMT 2026 - Last Modified: Fri Jun 06 14:28:57 GMT 2025 - 12.1K bytes - Click Count (0) -
tests/test_request_params/test_form/test_optional_str.py
} @pytest.mark.parametrize( "path", ["/optional-str", "/model-optional-str"], ) def test_optional_str_missing(path: str): client = TestClient(app) response = client.post(path) assert response.status_code == 200 assert response.json() == {"p": None} @pytest.mark.parametrize( "path", ["/optional-str", "/model-optional-str"], ) def test_optional_str(path: str):
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Tue Feb 17 09:59:14 GMT 2026 - 8.9K bytes - Click Count (0)