Besides the obvious (one is a type, the other a class)? What should be preferred? Any notable difference in use cases, perhaps?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
http://docs.python.org/library/io.html#io.StringIO
http://docs.python.org/library/stringio.html
I see this.
io.StringIOis a class. It handles Unicode. It reflects the preferred Python 3 library structure.StringIO.StringIOis a class. It handles strings. It reflects the legacy Python 2 library structure.Always move forward toward the new library organization. The
io.openshould be used to replace the built-in Unicode-unawareopen.Forward. Move forward.