Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

str/repr, join, and setting - for arrays #49

Merged
merged 3 commits into from
Feb 22, 2022

Conversation

benkehoe
Copy link
Contributor

@benkehoe benkehoe commented Feb 20, 2022

I batched these together but can split them out/discard as desired.

__str__ and __repr__ methods

Pretty straightforward, some hoops to jump through for Python 2 support, as __str__ should return a str, not unicode (#48 is relevant).

Join

Add a join() method for combining two pointers. Works with strings and parts as well (can be more restrictive on types if you want). Also supports the / magic method (__truediv__ in Python 3, __div__ in Python 2), like pathlib.

Setting - for arrays

A pointer like /foo/- represents the element past the end of an array. Calling set() with one of these pointers should append to the array.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling d811454 on benkehoe:master into 896102d on stefankoegl:master.

2 similar comments
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling d811454 on benkehoe:master into 896102d on stefankoegl:master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling d811454 on benkehoe:master into 896102d on stefankoegl:master.

@stefankoegl
Copy link
Owner

Great, thanks a lot!

@stefankoegl stefankoegl merged commit f8c80b7 into stefankoegl:master Feb 22, 2022
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.

3 participants