FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

SimpleSequenceGenerator accepts starting sequence when object is created by nikoladsp · Pull Request #121 · python-smpplib/python-smpplib · GitHub

SimpleSequenceGenerator accepts starting sequence when object is created - #121

Open
nikoladsp wants to merge 1 commit into
python-smpplib:masterfrom
nikoladsp:master
Open

SimpleSequenceGenerator accepts starting sequence when object is created#121
nikoladsp wants to merge 1 commit into
python-smpplib:masterfrom
nikoladsp:master

Conversation

Copy link
Copy Markdown

SimpleSequenceGenerator accepts starting sequence when object is created (default is MIN_SEQUENCE) .Test file also created

Signed-off-by: Nikola Radovanovic nikoladsp@gmail.com

…eated.Test file also created

Signed-off-by: Nikola Radovanovic <nikoladsp@gmail.com>

Copy link
Copy Markdown
Member

Don't you think this kind of behavior is actually somewhat misleading? I think It would be better to raise

Copy link
Copy Markdown
Author

It depends on usage. For example, I am storing sequence in the DB and want to continue where I left off, since using sequence to "mark" received messages and remove them from the DB. "Ring" kind of update is suitable for this usage, or at least I think so.

Kindest regards

Copy link
Copy Markdown
Member

Yes, probably you are right about the most common use case here, but the code allows for example ridiculously large or negative numbers to be slightly ignored and replaced with default value.
@eigenein what do you think?

Copy link
Copy Markdown
Collaborator

Hiya!

I'm not in favour of silently changing a parameter value, this is usually makes debugging harder.

I'd rather go for one of these:

  • raise ValueError, and then user is able to catch it and instantiate the generator with default minimum
  • Make a dedicated ring sequence generator, shouldn't be that much code

Copy link
Copy Markdown
Author

Hi,
thanks. Will do both.

Well be in touch.

Cheers

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

3 participants


Back | FazBrowse Home | New Git URL