-
Notifications
You must be signed in to change notification settings - Fork 997
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
Non-substantive typing clean-up #2036
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -281,9 +281,9 @@ def get_shard_transition_fields( | |
shard: Shard, | ||
shard_blocks: Sequence[SignedShardBlock], | ||
) -> Tuple[Sequence[uint64], Sequence[Root], Sequence[ShardState]]: | ||
shard_states = [] | ||
shard_data_roots = [] | ||
shard_block_lengths = [] | ||
shard_block_lengths = [] # type: PyList[uint64] | ||
shard_data_roots = [] # type: PyList[Root] | ||
shard_states = [] # type: PyList[ShardState] | ||
Comment on lines
+284
to
+286
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was hesitant too, and intentionally used type comments instead of A "PyList is okay" argument is that we already have Python Would renaming There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
shard_state = beacon_state.shard_states[shard] | ||
shard_block_slots = [shard_block.message.slot for shard_block in shard_blocks] | ||
|
@@ -301,7 +301,7 @@ def get_shard_transition_fields( | |
shard_state = shard_state.copy() | ||
process_shard_block(shard_state, shard_block.message) | ||
shard_states.append(shard_state) | ||
shard_block_lengths.append(len(shard_block.message.body)) | ||
shard_block_lengths.append(uint64(len(shard_block.message.body))) | ||
|
||
return shard_block_lengths, shard_data_roots, shard_states | ||
``` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought this wouldn't be necessary anymore with the changes to
remerkleable
?uint64 + int -> uint64
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error message (#1707) was
error: Need type annotation for 'end'
. I think mypy couldn't determine the type here with static checks.I can change it to
end: uint64 = (len(indices) * (index + 1)) // count
alternatively.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it works when you
uint64(len(indices))
instead? I find it weird to coerce the result, instead of the inputs.