strings vs. bytes, what's the diff?
Strings and bytes are both fundamental types in Python. At a surface level they also appear do be very similar objects. From the similar notation, to the functions they offer, to their use cases like writing to a file, bytes and strings appear to do nearly the same thing. And yet, Python enforces a strict separation between them, making them unable to mix and requiring explicit conversions using str.encode() or bytes.decode() in order to translate between them. So what makes them different at all? In this video we'll find out how str and bytes differ and talk about encodings, like utf-8, which are the missing link between them.
― mCoding with James Murphy ([ Ссылка ])
Source code: [ Ссылка ]
bytes docs: [ Ссылка ]
Official unicode site: [ Ссылка ]
UTF-8 wiki: [ Ссылка ]
PEP 686: [ Ссылка ]
SUPPORT ME ⭐
---------------------------------------------------
Sign up on Patreon to get your donor role and early access to videos!
[ Ссылка ]
Feeling generous but don't have a Patreon? Donate via PayPal! (No sign up needed.)
[ Ссылка ]
Want to donate crypto? Check out the rest of my supported donations on my website!
[ Ссылка ]
Top patrons and donors: Jameson, Laura M, Dragos C, Vahnekie, Neel R, Matt R, Johan A, Casey G, Mark M, Mutual Information
BE ACTIVE IN MY COMMUNITY 😄
---------------------------------------------------
Discord: [ Ссылка ]
Github: [ Ссылка ]
Reddit: [ Ссылка ]
Facebook: [ Ссылка ]
CHAPTERS
---------------------------------------------------
0:00 Intro
0:20 str and bytes syntax
0:50 str and bytes functions
1:29 they don't mix
2:17 amazing sponsor
2:40 smiley
3:33 the meaning of bytes
4:53 encodings
6:07 dangers of not specifying encoding
7:21 warn default encoding
7:35 utf-8 mode
8:06 Outro and thanks
![](https://s2.save4k.ru/pic/EimoZHDcQMA/mqdefault.jpg)