Skip to content

Rename seek() to seek_relative()? #10

@mgeier

Description

@mgeier

This would seem more symmetrical, as there is also seek_absolute().

Using seek() without being explicit may have lead to bugs like these two:

https://github.com/bastibe/PySoundFile/blob/cd9fb6a287731288b43153cf243245943e88b54b/pysoundfile.py#L445

https://github.com/bastibe/PySoundFile/blob/cd9fb6a287731288b43153cf243245943e88b54b/pysoundfile.py#L471

In both cases there should be seek_absolute() instead of seek(), which is correctly used at the third place:

https://github.com/bastibe/PySoundFile/blob/cd9fb6a287731288b43153cf243245943e88b54b/pysoundfile.py#L423

BTW, this 3-fold repetition calls for refactoring, probably using a Context Manager ...?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions