Skip to content

Conversation

@Akuli
Copy link
Contributor

@Akuli Akuli commented Nov 3, 2016

Currently pyformat.info says that printf-formatting doesn't do ascii().

new_result = '{0!r} {0!a}'.format(Data())

assert new_result == 'räpr r\\xe4pr' # output
assert new_result == old_result
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make more sense to do this:

assert old_result == 'r....'
assert new_result == old_result

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know, I just did it like other examples do it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assert old_result == new_result == '...' could be nice also.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The way you did it is "correct". The reason is that we produce the page content from the parsed tests. So there has to be a fixed structure to the examples.

However we're currently working on a version 2 of the site that does away with the test based examples and will use Lektor instead.

@ulope ulope merged commit 5acdb3d into ulope:master Dec 27, 2016
@ulope
Copy link
Owner

ulope commented Dec 27, 2016

Thanks!

ulope added a commit that referenced this pull request Dec 28, 2016
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