Skip to content

Conversation

@KostaIlic2
Copy link

@KostaIlic2 KostaIlic2 commented Dec 16, 2025

What does this Pull Request accomplish?

This PR resolves issues #230 and #231.

Summary of changes:

  1. Improved documentation for comparison functions.
  2. Improved formal argument names for comparison functions. Previous name, "value", was confusing because objects of scalar class have a data member also called "value".
  3. Made all arguments for all comparison functions positional only, for consistency, and to prevent unintended reliance on formal argument names.
  4. Refactored duplicated string for an exception into a private function.

Why should this Pull Request be merged?

The changes increase value of the library.

What testing has been done?

I executed prescribed static code and automated test protocols. Since there were no functional changes, I did not introduce any new automated tests.

…'other' to reduce potential confusion between the data member 'value' and the formal argument with the same name. Made all arguments in comparison functions positional.
…minate duplicated string constants.

Signed-off-by: Kosta Ilic <[email protected]>
…cumentation based on failures I was when running 'poetry run python -m doctest src\nitypes\scalar.py -v'.

Signed-off-by: Kosta Ilic <[email protected]>
…utomated test failure, so I reverted those few changes.

Signed-off-by: Kosta Ilic <[email protected]>
@KostaIlic2 KostaIlic2 marked this pull request as draft December 16, 2025 23:01
@KostaIlic2 KostaIlic2 changed the title Users/kosta/improve scalar Minor improvements to Scalar class documentation and code Dec 16, 2025
@KostaIlic2 KostaIlic2 marked this pull request as ready for review December 17, 2025 00:59
…e it consistent with other similar sentences.

Signed-off-by: Kosta Ilic <[email protected]>
@KostaIlic2
Copy link
Author

KostaIlic2 commented Dec 18, 2025

Inspired by @bkeryan's statement that equality comparison operators are always supported I decided to split comparison section of the document between equality and order comparison operators. I like new organization better.

… by a comment from bkeryan. I like this organization better than what we had before.

Signed-off-by: Kosta Ilic <[email protected]>
@KostaIlic2
Copy link
Author

@bkeryan, I see we use of slightly different terminology and orthography within scalar.py. Some were there before this PR. Here is what I found with the version of the file in this PR:

  • Scalar Data Type - line 3 and later
  • Scalar - line 6 and later
  • scalar data object - line 6 and later
  • scalar data class - line 33 and later
  • scalar objects - line 61 and later
  • scalars - line 69 and later
  • Scalar objects - line 109 and later

Would you like me to address this inconsistency as part of this PR?

@KostaIlic2 KostaIlic2 requested a review from bkeryan December 18, 2025 18:10
…penetrate the arcane error message.

Signed-off-by: Kosta Ilic <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants