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

Unicode support for param.String #114

Merged
merged 1 commit into from
Apr 7, 2015
Merged

Unicode support for param.String #114

merged 1 commit into from
Apr 7, 2015

Conversation

philippjfr
Copy link
Member

This commit adds unicode support for param.String, which has been requested on multiple occasions, see #73 and holoviz/holoviews#29. This is the simplest possible fix that will get param to support Unicode strings in Python 2.

To handle unicode correctly consistently we should consider importing: from future import unicode_literals everywhere, but I'm not sure what the implications of that change would be.

The fully verbose version providing compatibility for all string, bytes and unicode types is the following but that's probably overkill:

try:
    unicode = unicode
except NameError:
    # 'unicode' is undefined, must be Python 3
    str = str
    unicode = str
    bytes = bytes
    basestring = (str,bytes)
else:
    # 'unicode' exists, must be Python 2
    str = str
    unicode = unicode
    bytes = str
    basestring = basestring

@coveralls
Copy link

Coverage Status

Coverage increased (+0.04%) to 69.77% when pulling 6f04d3f on philippjfr:master into 74e06f2 on ioam:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.04%) to 69.77% when pulling cff232b on philippjfr:master into 74e06f2 on ioam:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage increased (+0.04%) to 69.77% when pulling cff232b on philippjfr:master into 74e06f2 on ioam:master.

@jbednar
Copy link
Member

jbednar commented Apr 7, 2015

Seems ok to me.

jlstevens added a commit that referenced this pull request Apr 7, 2015
Unicode support for param.String
@jlstevens jlstevens merged commit e4d0509 into holoviz:master Apr 7, 2015
@jlstevens
Copy link
Contributor

I think this is an important thing to support and there is very little code so I will merge it now. Obviously, we can continue to improve it (if necessary) on master.

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.

4 participants