Make your Python classes subscritable so they can use slicing syntax🐍 #shorts #python

学習

Ever wanted to make your classes subscriptable? This means you can use the slicing syntax to grab items from a class. You have to add the __getitem__ to your class. There are 2 cases you have to handle: integers and slice objects. We cover both in the video.

コメント

  1. SP より:

    best way of learning modern python,
    on log form user input this can be used,….
    how to connect you? any discord server … however I let u know that last Feb participated in Flow-Blockchain Hackathon & submitted NFT app

  2. SP より:

    for more diversified args match statement with seq can be used …

タイトルとURLをコピーしました