Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Trying to get this to work in Python 3, but it throws errors that I don't understand.
Made the following change to the lambda function, but I still get an error (see below):
def vertices(row, col):
""" order is the tuple to which the map will apply the lambda function.
The lambda function calculates a tuple of offsets based on cell sizes of 100.
The vertices are calculated results from applying map() to the iterable order.
The return statement joins together the tuples
"""
order = ((0, 0), (0, 1), (1, 1), (1, 0))
# the following code was from Python 2. It needs to be updated for Lambda functions in Python 3
# vertices = map(lambda (x,y) : ((row + x) * size, (col + y) * size), order)
vertices = map(lambda x,y : ((row + x) * size, (col + y) * size), order)
return ' '.join(["%s,%s" % vertex for vertex in vertices])
def vertices(row, col):
""" order is the tuple to which the map will apply the lambda function.
The lambda function calculates a tuple of offsets based on cell sizes of 100.
The vertices are calculated results from applying map() to the iterable order.
The return statement joins together the tuples
"""
order = ((0, 0), (0, 1), (1, 1), (1, 0))
# the following code was from Python 2. It needs to be updated for Lambda functions in Python 3
# vertices = map(lambda (x,y) : ((row + x) * size, (col + y) * size), order)
vertices = map(lambda x,y : ((row + x) * size, (col + y) * size), order)
return ' '.join(["%s,%s" % vertex for vertex in vertices])
I've tested it in Python 2 today and that doesn't work either.
Someone please help. I'd like to get this working.