Skip to content

Switch to six#22

Merged
lynneatan merged 7 commits intomasterfrom
switch-to-six
May 21, 2018
Merged

Switch to six#22
lynneatan merged 7 commits intomasterfrom
switch-to-six

Conversation

@lynneatan
Copy link
Contributor

Add six module, update version and imports

@lynneatan lynneatan self-assigned this May 16, 2018
@lynneatan lynneatan requested a review from emosesPatreon May 16, 2018 19:28
@@ -1,5 +1,6 @@
# 0.5.0
Copy link
Contributor

Choose a reason for hiding this comment

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

Leave 0.5.0 in place, and add 0.5.1 above it.

Here's an example: https://github.com/Patreon/patreon-js/blob/master/changelog.md


def api_url(*segments, **query):
path = '/'.join(map(str, segments))
path = six.text_type('/').join(map(six.text_type, segments))
Copy link
Contributor

Choose a reason for hiding this comment

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

What exactly does this do? I was looking at the docs for six, and it just shows text_type as a constant, not a function.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It converts the text into unicode string for python two and str for python3
Eg:
In python two :

x = six.text_type('hello')
x
u'hello'

In python three:

x = six.text_type('hello')
x
'hello'

@emosesPatreon
Copy link
Contributor

emosesPatreon commented May 16, 2018 via email

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