tiflolinux.org - GNU Social
  • Login

Bienvenido

  • Public

    • Public
    • Network
    • Groups
    • Popular
    • People

>>> isinstance(42, int | str) True >>> isinstance("42", int | str) True >>> isinstance(42.0, int | str) False

Download link

https://files.mastodon.social/media_attachments/files/110/014/566/176/837/015/original/9c786b522bd559a0.png

Notices where this attachment appears

  1. Hynek Schlawack (hynek@mastodon.social)'s status on Monday, 13-Mar-2023 17:48:47 CET Hynek Schlawack Hynek Schlawack

    TIL I can use `|` instead of tuples in isinstance() checks since #Python 3.10.

    In conversation Monday, 13-Mar-2023 17:48:47 CET from mastodon.social permalink
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

tiflolinux.org - GNU Social is a social network, courtesy of tiflolinux.org. It runs on GNU social, version 2.0.1-beta0, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All tiflolinux.org - GNU Social content and data are available under the Creative Commons Attribution 3.0 license.