FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

implementation of __getitem__ in PriorityQueue · Issue #829 · aimacode/aima-python · GitHub

Repository navigation

implementation of __getitem__ in PriorityQueue #829

Description

It essentially returns the same key if it is present, else returns None (doesn't raise Exception).
Is this the intended use?

def __getitem__(self, key):
        for _, item in self.A:
            if item == key:
                return item

Also, the documentation of PriorityQueue says
It supports dict-like lookup.

What exactly is the method __getitem__ trying to do (and return)?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL