It seems as though python is changing my key_s string into unicode, and I don't know why. I don't remember this being the normal behavior. If I type the lines manually in the interpreter, I don't have to convert them to strings first. I am not used to "
or '
indicating unicode but rather strings. Did something change I'm unaware of? Or does it have something to do with pycharm?
key_s = "time_delta"
print("key_s type:", type(key_s))
key_s = str(key_s)
print("key_s type:", type(key_s))
stdout when running python program.py
key_s type: <type 'unicode'>
key_s type: <type 'str'>
stdout from interpreter when typing key_s = "time_delta"; print("key_s type:", type(key_s))
key_s type: <type 'str'>
It defaults to str here, the behavior I would expect when I run the program. What gives?
I made a quick test.py:
#!/usr/bin/env python -u
# encoding: utf-8
print (type('123'))
outputs: <type 'str'>
Any ideas?