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

Ensure that config uses native str internally #8

Merged
merged 1 commit into from Aug 15, 2016
Merged

Conversation

timj
Copy link
Member

@timj timj commented Aug 12, 2016

cast future "newstr" objects to native "str" for consistency.

@@ -64,6 +64,8 @@ def _autocast(x, dtype):
return float(x)
if dtype == int and isinstance(x, long):
return int(x)
if isinstance(x, str):

Choose a reason for hiding this comment

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

Why can't we just use from builtins import str everywhere?

Copy link
Member Author

Choose a reason for hiding this comment

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

As I say in lsst/afw#83 the problem is that I can't promise that people outside are giving me str. The reason this exists is because tests started failing in afw and I can imagine code further up the stack also not doing it consistently. That and the fact that string literals are not future str leads me to believe this is the only option. Casting to a proper str is probably the best thing anyhow.

@timj timj merged commit 7b75c79 into master Aug 15, 2016
@ktlim ktlim deleted the tickets/DM-7152 branch August 25, 2018 05:50
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.

None yet

2 participants