Skip to content
This repository was archived by the owner on Jul 15, 2025. It is now read-only.

Kotlin friendly names #1

Merged
merged 6 commits into from
May 18, 2021
Merged

Conversation

rnett
Copy link
Contributor

@rnett rnett commented May 15, 2021

Renames Shape.size to Shape.get and add a toListOrNull method. Was part of tensorflow/java#165.

Copy link
Contributor

@Craigacp Craigacp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you provide some rational for why the method is renamed? Does kotlin treat get methods specially, or is there some conflict with size?

@rnett
Copy link
Contributor Author

rnett commented May 17, 2021

Yeah, Kotlin will automatically treat get as an operator, and rather than adding an extension in the Kotlin API Karl suggested I just change it here. Avoids overloading the meaning of size, too.

Copy link
Contributor

@Craigacp Craigacp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'm fine with this, but I'll let @karllessard merge it in case he has comments.

@rnett rnett requested a review from karllessard May 18, 2021 20:43
@karllessard karllessard merged commit d2aed4a into tensorflow:main May 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants