Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Extend deprecation warning period for bitwise inversion onbool type #122982

Closed
Assignees
Eclips4
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)type-featureA feature request or enhancement
@Eclips4

Description

@Eclips4

Feature or enhancement

Proposal:

Since Python 3.12, attempting to use bitwise inversion on a bool type is raises aDeprecationWarning:

Python3.12.4 (main,Jun62024,18:26:44) [Clang15.0.0 (clang-1500.3.9.4)]ondarwinType"help","copyright","credits"or"license"formoreinformation.>>>a=True>>>~a<stdin>:1:DeprecationWarning:Bitwiseinversion'~'onboolisdeprecated.Thisreturnsthebitwiseinversionoftheunderlyingintobjectandisusuallynotwhatyouexpectfromnegatingabool.Usethe'not'operatorforbooleannegationor~int(x)ifyoureallywantthebitwiseinversionoftheunderlyingint.-2>>>

I have a PR ready.

Has this already been discussed elsewhere?

No response given

Links to previous discussion of this feature:

No response

Linked PRs

Metadata

Metadata

Assignees

Labels

interpreter-core(Objects, Python, Grammar, and Parser dirs)type-featureA feature request or enhancement

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp