Skip to content

Implement str.split()#562

Open
JeffersGlass wants to merge 7 commits into
spylang:mainfrom
JeffersGlass:str-split-impl
Open

Implement str.split()#562
JeffersGlass wants to merge 7 commits into
spylang:mainfrom
JeffersGlass:str-split-impl

Conversation

@JeffersGlass

Copy link
Copy Markdown
Contributor

Adds str.split(sep) to the stdlib. Note that the separator has to be explicitly specified; this does not implement split() which splits on whitespace, which should probably wait until we have default arguments.

Also implements WasmFuncWrapper._to_pylist_str() to get lists back out of wasm tests.

@antocuni

Copy link
Copy Markdown
Member

I haven't reviewed it yet but please note that we DO have support for default args.

However, we don't have str|None yet, so str.split is still not easily typeable (but we could do it with a metafunc)

@JeffersGlass

Copy link
Copy Markdown
Contributor Author

we DO have support for default args

Oh! I honestly don't think I knew that... exciting!

Don't sweat renewing this - I'm not sure if I've broken something by changing things in WasmFuncWrapper or if this is exposing a bug in str.__getitem__(slice) that I didn't know about... will do some legwork there

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.

2 participants