Skip to content

Conversation

@cdonati
Copy link
Contributor

@cdonati cdonati commented Mar 31, 2019

Python 2 resolves escape characters when printing byte strings, which doesn't seem useful in this context.

I replaced __str__ since it defaults to __repr__ and the change should be suitable for both cases.

Old behavior:

>>> fdb.KeySelector(b'hi\n', False, 0.0)
<fdb.impl.KeySelector object at 0x7fec2963bed0>
>>> print(fdb.KeySelector(b'hi\n', False, 0.0))
KeySelector(hi
, False, 0)

New behavior:

>>> fdb.KeySelector(b'hi\n', False, 0.0)
KeySelector('hi\n', False, 0.0)
>>> print(fdb.KeySelector(b'hi\n', False, 0.0))
KeySelector('hi\n', False, 0.0)

Python 2 resolves escape characters when printing byte strings,
which doesn't seem useful in this context.

I replaced __str__ since it defaults to __repr__ and the change
should be suitable for both cases.
@ajbeamon
Copy link
Contributor

ajbeamon commented Apr 1, 2019

@fdbbuild test this please

@ajbeamon ajbeamon merged commit 324438c into apple:master Apr 1, 2019
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