Skip to content

Add join function in shlex module (new in 3.8) #3430

Closed

Description

@sarahmonod

A new function was added to the stdlib shlex in python 3.8, as stated here: https://docs.python.org/3/library/shlex.html#shlex.join and in the changelog here https://docs.python.org/3/whatsnew/changelog.html and here https://bugs.python.org/issue22454

At the moment, only split has a stub:

def split(s: str, comments: bool = ..., posix: bool = ...) -> List[str]: ...

Adding join would be quite simple, and would probably look a bit like this:

def join(s: List[str]) -> str: ... 

I have not opened a PR yet because I wonder if this is something that you would want to add or not, because saying that join does not exist is true for python3.7 and lower. Surely there must be precedent, but I could not find an example of this in the issues yet.

Activity

  1. utkarsh2102 commented on Oct 31, 2019

    @utkarsh2102
    Contributor

    Hi,
    With #3319 already in progress, I think you could open a PR with:
    if sys.version_info >= (3, 8): :)
    Also, @srittau would know better :)

  2. srittau commented on Oct 31, 2019

    @srittau
    Collaborator

    Thanks for the report. shlex.join() was added in #3358.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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