Skip to content

[Request] Do not use Base.tryparse to parse CLI args #285

Open
@jakobnissen

Description

@jakobnissen

The problem is that this encourages (forces?) users to implement methods like Base.tryparse(::Type{Vector{Float64}}, x::String), which is piracy.
Now, most likely, this will not cause issues, since users will only implement them if they find the methods to not exist in Base. However

  • It makes depdendents of Comonicon risky to use together, since different packages may define the same tryparse methods
  • These methods may be implemented in future versions of Julia

A straightforward solution would be to have a distinct function like Comonicon.try_parse_arg, which has a default definition try_parse_arg(x::Type{T}, s::AbstractString) where T = tryparse(T, s).
This should not cause breakage.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions