Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pytools
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Andreas Klöckner
pytools
Commits
454228f7
Commit
454228f7
authored
4 years ago
by
Kaushik Kulkarni
Browse files
Options
Downloads
Patches
Plain Diff
adds reason for defining only HeapEntry.__lt__
parent
e1814a33
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pytools/graph.py
+7
-0
7 additions, 0 deletions
pytools/graph.py
with
7 additions
and
0 deletions
pytools/graph.py
+
7
−
0
View file @
454228f7
...
@@ -180,6 +180,13 @@ class CycleError(Exception):
...
@@ -180,6 +180,13 @@ class CycleError(Exception):
class
HeapEntry
:
class
HeapEntry
:
"""
Helper class to compare associated keys while comparing the elements in
heap operations.
Only needs to define :func:`pytools.graph.__lt__` according to
<https://github.com/python/cpython/blob/8d21aa21f2cbc6d50aab3f420bb23be1d081dac4/Lib/heapq.py#L135-L138>.
"""
def
__init__
(
self
,
node
,
key
):
def
__init__
(
self
,
node
,
key
):
self
.
node
=
node
self
.
node
=
node
self
.
key
=
key
self
.
key
=
key
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment