Skip to content

Modern String Formatting in Code #292

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Mar 4, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Modern string formatting in search.py.
  • Loading branch information
sampadsaha5 committed Mar 1, 2017
commit 911f5c651c03c78351ff3156d6c248df652bbfa6
4 changes: 2 additions & 2 deletions search.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def __init__(self, state, parent=None, action=None, path_cost=0):
self.depth = parent.depth + 1

def __repr__(self):
return "<Node %s>" % (self.state,)
return "<Node {0!r}>".format(self.state)

def __lt__(self, node):
return self.state < node.state
Expand Down Expand Up @@ -1132,7 +1132,7 @@ def __getattr__(self, attr):
return getattr(self.problem, attr)

def __repr__(self):
return '<%4d/%4d/%4d/%s>' % (self.succs, self.goal_tests,
return '<{:4d}/{:4d}/{:4d}/{}>'.format(self.succs, self.goal_tests,
self.states, str(self.found)[:4])


Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy