Skip to content

review for code use of str in methods and Type_Safe definitions #13

@DinisCruz

Description

@DinisCruz

In this project there are very few cases where raw strings should be used (Type_Safe and Safe_Str__* is what should be used)

for example: https://github.com/owasp-sbot/Memory-FS/blob/dev/memory_fs/path_handlers/Path__Handler__Versioned.py#L9

class Path__Handler__Versioned(Schema__Memory_FS__Path__Handler):    # Handler that stores files with version numbers (calculated from chain)
    name : Safe_Id = Safe_Id("versioned")

    # todo: file_id and file_ext should not be strings
    def generate_path(self, file_id: str, file_ext: str, is_metadata: bool = True, version: int = 1) -> Safe_Str__File__Path:
        ext = ".json" if is_metadata else f".{file_ext}"
        return Safe_Str__File__Path(f"v{version}/{file_id}{ext}")

task: create a file that maps all these usages, so that they can be reviewed and bugs/todos created for it

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions