Why python iterates bytes as integers?

Multi tool use
Multi tool use





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







-1















Taken from official Python documentation:




Since bytes objects are sequences of integers (akin to a tuple), for a bytes object b, b[0] will be an integer, while b[0:1] will be a bytes object of length 1.




I am quite confused as to why the designer choose to do so, since byte is just 8-bit and int is usually 32-bit.



Can somebody explain the reason behind why b[0] is an int? Thank you!



Edit:
I tried the following experiment:



>>> import sys
>>> b = bytes(100)
>>> sys.getsizeof(b)
133
>>> sys.getsizeof(list(b))
1008


It seems that bytes is represented by bytes in memory; but the question remains why iterate bytes as int?










share|improve this question




















  • 2





    Python's integers are arbitrary-precision objects anyway, not primitives. Many small values are interned so there isn't a lot of overhead.

    – jonrsharpe
    Jan 3 at 21:50








  • 2





    Python has no byte type, and Python's int is not 32-bit.

    – user2357112
    Jan 3 at 21:55






  • 2





    Also, a bytes object does not physically contain ints.

    – user2357112
    Jan 3 at 21:56











  • @user2357112 thank you, the fact that there is no byte type explains the iteration as integers for me.

    – chunjiw
    Jan 3 at 22:01


















-1















Taken from official Python documentation:




Since bytes objects are sequences of integers (akin to a tuple), for a bytes object b, b[0] will be an integer, while b[0:1] will be a bytes object of length 1.




I am quite confused as to why the designer choose to do so, since byte is just 8-bit and int is usually 32-bit.



Can somebody explain the reason behind why b[0] is an int? Thank you!



Edit:
I tried the following experiment:



>>> import sys
>>> b = bytes(100)
>>> sys.getsizeof(b)
133
>>> sys.getsizeof(list(b))
1008


It seems that bytes is represented by bytes in memory; but the question remains why iterate bytes as int?










share|improve this question




















  • 2





    Python's integers are arbitrary-precision objects anyway, not primitives. Many small values are interned so there isn't a lot of overhead.

    – jonrsharpe
    Jan 3 at 21:50








  • 2





    Python has no byte type, and Python's int is not 32-bit.

    – user2357112
    Jan 3 at 21:55






  • 2





    Also, a bytes object does not physically contain ints.

    – user2357112
    Jan 3 at 21:56











  • @user2357112 thank you, the fact that there is no byte type explains the iteration as integers for me.

    – chunjiw
    Jan 3 at 22:01














-1












-1








-1








Taken from official Python documentation:




Since bytes objects are sequences of integers (akin to a tuple), for a bytes object b, b[0] will be an integer, while b[0:1] will be a bytes object of length 1.




I am quite confused as to why the designer choose to do so, since byte is just 8-bit and int is usually 32-bit.



Can somebody explain the reason behind why b[0] is an int? Thank you!



Edit:
I tried the following experiment:



>>> import sys
>>> b = bytes(100)
>>> sys.getsizeof(b)
133
>>> sys.getsizeof(list(b))
1008


It seems that bytes is represented by bytes in memory; but the question remains why iterate bytes as int?










share|improve this question
















Taken from official Python documentation:




Since bytes objects are sequences of integers (akin to a tuple), for a bytes object b, b[0] will be an integer, while b[0:1] will be a bytes object of length 1.




I am quite confused as to why the designer choose to do so, since byte is just 8-bit and int is usually 32-bit.



Can somebody explain the reason behind why b[0] is an int? Thank you!



Edit:
I tried the following experiment:



>>> import sys
>>> b = bytes(100)
>>> sys.getsizeof(b)
133
>>> sys.getsizeof(list(b))
1008


It seems that bytes is represented by bytes in memory; but the question remains why iterate bytes as int?







python int byte






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 3 at 22:03







chunjiw

















asked Jan 3 at 21:49









chunjiwchunjiw

375212




375212








  • 2





    Python's integers are arbitrary-precision objects anyway, not primitives. Many small values are interned so there isn't a lot of overhead.

    – jonrsharpe
    Jan 3 at 21:50








  • 2





    Python has no byte type, and Python's int is not 32-bit.

    – user2357112
    Jan 3 at 21:55






  • 2





    Also, a bytes object does not physically contain ints.

    – user2357112
    Jan 3 at 21:56











  • @user2357112 thank you, the fact that there is no byte type explains the iteration as integers for me.

    – chunjiw
    Jan 3 at 22:01














  • 2





    Python's integers are arbitrary-precision objects anyway, not primitives. Many small values are interned so there isn't a lot of overhead.

    – jonrsharpe
    Jan 3 at 21:50








  • 2





    Python has no byte type, and Python's int is not 32-bit.

    – user2357112
    Jan 3 at 21:55






  • 2





    Also, a bytes object does not physically contain ints.

    – user2357112
    Jan 3 at 21:56











  • @user2357112 thank you, the fact that there is no byte type explains the iteration as integers for me.

    – chunjiw
    Jan 3 at 22:01








2




2





Python's integers are arbitrary-precision objects anyway, not primitives. Many small values are interned so there isn't a lot of overhead.

– jonrsharpe
Jan 3 at 21:50







Python's integers are arbitrary-precision objects anyway, not primitives. Many small values are interned so there isn't a lot of overhead.

– jonrsharpe
Jan 3 at 21:50






2




2





Python has no byte type, and Python's int is not 32-bit.

– user2357112
Jan 3 at 21:55





Python has no byte type, and Python's int is not 32-bit.

– user2357112
Jan 3 at 21:55




2




2





Also, a bytes object does not physically contain ints.

– user2357112
Jan 3 at 21:56





Also, a bytes object does not physically contain ints.

– user2357112
Jan 3 at 21:56













@user2357112 thank you, the fact that there is no byte type explains the iteration as integers for me.

– chunjiw
Jan 3 at 22:01





@user2357112 thank you, the fact that there is no byte type explains the iteration as integers for me.

– chunjiw
Jan 3 at 22:01












2 Answers
2






active

oldest

votes


















2














A bytes object does not store ints. Indexing or iterating over a bytes object produces ints, but a bytes object stores bytes as bytes. Object overhead is only incurred once for the whole bytes object.



Individual bytes extracted from a bytes object are represented with the same integer type as any other integer because there is no point in doing otherwise. Since CPython stores canonical copies of small integers, the only cost of storing a byte as an ordinary int is the cost of the pointer.



Creating a dedicated byte type just for this would still cost 16 bytes of object overhead per byte object on a standard 64-bit CPython build, plus 1 byte for the data, plus 8 bytes for the pointer, for a net loss of 17 bytes compared to just storing the pointer for an int. Sure, you could store canonical byte objects, but that still gives you no benefit over the existing canonical ints. Also, a byte type would add extra complexity to code that needs to interact with byte.



The only way to store bytes in less bytes per byte in CPython's data model than just using ints is to use a packed representation, and the packed representation for that is bytes itself.






share|improve this answer
























  • And anyway, often when I am iterating or indexing into a bytes object, I care about the actual integer value. I recall there was a PEP to add an iterbytes method to iterate like a str object, and I believe an equivalent indexing method as well. Don't recall what came of it

    – juanpa.arrivillaga
    Jan 3 at 22:18



















-1














A byte can be represented as an int below 2**8, or under 256. This is for easier redability of the bytes object's bytes.



Note: When you make a bytes object, it displays:



bytes(iterable_of_ints) -> bytes


This means a bytes object is just many ints but turned into encoded bytes.



Think of a bytes object as a list of ints. Check this out:



>>> l = [1, 36, 233]
>>> b = bytes(l)
>>> l[0]
1
>>> b[0]
1
>>> l[0:1]
[1]
>>> b[0:1]
b'x01'




Now about the question of why?



What other way can one represent a byte?

A string sure would represent many bytes with an encoding, but not if it has a different encoding or no encoding specified.

A tuple wouldn't make sense as it can have anything inside it. That includes other strings, floats, and other stuff a byte wouldn't represent.

An integer would only represent one byte, and a tuple of ints specifically for this purpose would work.



Therefore, a tuple of ints would make up a bytes object, and a bytes object would be able to be decoded and encoded into strings for use. An int would be the only 'pure' way of representing a single byte inside the bytes object.






share|improve this answer





















  • 2





    That's not what the question is asking.

    – jonrsharpe
    Jan 3 at 21:52











  • I've changed it a little bit. Does this count towards answering it?

    – GeeTransit
    Jan 3 at 21:56











  • No, the OP knows it's basically a list of ints but is wondering why.

    – jonrsharpe
    Jan 3 at 21:57











  • Well, what other way can one represent a byte? A string would represent many bytes with an encoding, but not if it has a different encoding. A tuple wouldn't make sense as it can have anything inside it. An integer would only represent one, and a tuple of ints would work. I think this should answer it fairly well.

    – GeeTransit
    Jan 3 at 22:01











  • @GeeTransit yes, your last comment actually answers the question for me. I now understand. Thank you!

    – chunjiw
    Jan 3 at 22:05












Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54030276%2fwhy-python-iterates-bytes-as-integers%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









2














A bytes object does not store ints. Indexing or iterating over a bytes object produces ints, but a bytes object stores bytes as bytes. Object overhead is only incurred once for the whole bytes object.



Individual bytes extracted from a bytes object are represented with the same integer type as any other integer because there is no point in doing otherwise. Since CPython stores canonical copies of small integers, the only cost of storing a byte as an ordinary int is the cost of the pointer.



Creating a dedicated byte type just for this would still cost 16 bytes of object overhead per byte object on a standard 64-bit CPython build, plus 1 byte for the data, plus 8 bytes for the pointer, for a net loss of 17 bytes compared to just storing the pointer for an int. Sure, you could store canonical byte objects, but that still gives you no benefit over the existing canonical ints. Also, a byte type would add extra complexity to code that needs to interact with byte.



The only way to store bytes in less bytes per byte in CPython's data model than just using ints is to use a packed representation, and the packed representation for that is bytes itself.






share|improve this answer
























  • And anyway, often when I am iterating or indexing into a bytes object, I care about the actual integer value. I recall there was a PEP to add an iterbytes method to iterate like a str object, and I believe an equivalent indexing method as well. Don't recall what came of it

    – juanpa.arrivillaga
    Jan 3 at 22:18
















2














A bytes object does not store ints. Indexing or iterating over a bytes object produces ints, but a bytes object stores bytes as bytes. Object overhead is only incurred once for the whole bytes object.



Individual bytes extracted from a bytes object are represented with the same integer type as any other integer because there is no point in doing otherwise. Since CPython stores canonical copies of small integers, the only cost of storing a byte as an ordinary int is the cost of the pointer.



Creating a dedicated byte type just for this would still cost 16 bytes of object overhead per byte object on a standard 64-bit CPython build, plus 1 byte for the data, plus 8 bytes for the pointer, for a net loss of 17 bytes compared to just storing the pointer for an int. Sure, you could store canonical byte objects, but that still gives you no benefit over the existing canonical ints. Also, a byte type would add extra complexity to code that needs to interact with byte.



The only way to store bytes in less bytes per byte in CPython's data model than just using ints is to use a packed representation, and the packed representation for that is bytes itself.






share|improve this answer
























  • And anyway, often when I am iterating or indexing into a bytes object, I care about the actual integer value. I recall there was a PEP to add an iterbytes method to iterate like a str object, and I believe an equivalent indexing method as well. Don't recall what came of it

    – juanpa.arrivillaga
    Jan 3 at 22:18














2












2








2







A bytes object does not store ints. Indexing or iterating over a bytes object produces ints, but a bytes object stores bytes as bytes. Object overhead is only incurred once for the whole bytes object.



Individual bytes extracted from a bytes object are represented with the same integer type as any other integer because there is no point in doing otherwise. Since CPython stores canonical copies of small integers, the only cost of storing a byte as an ordinary int is the cost of the pointer.



Creating a dedicated byte type just for this would still cost 16 bytes of object overhead per byte object on a standard 64-bit CPython build, plus 1 byte for the data, plus 8 bytes for the pointer, for a net loss of 17 bytes compared to just storing the pointer for an int. Sure, you could store canonical byte objects, but that still gives you no benefit over the existing canonical ints. Also, a byte type would add extra complexity to code that needs to interact with byte.



The only way to store bytes in less bytes per byte in CPython's data model than just using ints is to use a packed representation, and the packed representation for that is bytes itself.






share|improve this answer













A bytes object does not store ints. Indexing or iterating over a bytes object produces ints, but a bytes object stores bytes as bytes. Object overhead is only incurred once for the whole bytes object.



Individual bytes extracted from a bytes object are represented with the same integer type as any other integer because there is no point in doing otherwise. Since CPython stores canonical copies of small integers, the only cost of storing a byte as an ordinary int is the cost of the pointer.



Creating a dedicated byte type just for this would still cost 16 bytes of object overhead per byte object on a standard 64-bit CPython build, plus 1 byte for the data, plus 8 bytes for the pointer, for a net loss of 17 bytes compared to just storing the pointer for an int. Sure, you could store canonical byte objects, but that still gives you no benefit over the existing canonical ints. Also, a byte type would add extra complexity to code that needs to interact with byte.



The only way to store bytes in less bytes per byte in CPython's data model than just using ints is to use a packed representation, and the packed representation for that is bytes itself.







share|improve this answer












share|improve this answer



share|improve this answer










answered Jan 3 at 22:04









user2357112user2357112

158k13176268




158k13176268













  • And anyway, often when I am iterating or indexing into a bytes object, I care about the actual integer value. I recall there was a PEP to add an iterbytes method to iterate like a str object, and I believe an equivalent indexing method as well. Don't recall what came of it

    – juanpa.arrivillaga
    Jan 3 at 22:18



















  • And anyway, often when I am iterating or indexing into a bytes object, I care about the actual integer value. I recall there was a PEP to add an iterbytes method to iterate like a str object, and I believe an equivalent indexing method as well. Don't recall what came of it

    – juanpa.arrivillaga
    Jan 3 at 22:18

















And anyway, often when I am iterating or indexing into a bytes object, I care about the actual integer value. I recall there was a PEP to add an iterbytes method to iterate like a str object, and I believe an equivalent indexing method as well. Don't recall what came of it

– juanpa.arrivillaga
Jan 3 at 22:18





And anyway, often when I am iterating or indexing into a bytes object, I care about the actual integer value. I recall there was a PEP to add an iterbytes method to iterate like a str object, and I believe an equivalent indexing method as well. Don't recall what came of it

– juanpa.arrivillaga
Jan 3 at 22:18













-1














A byte can be represented as an int below 2**8, or under 256. This is for easier redability of the bytes object's bytes.



Note: When you make a bytes object, it displays:



bytes(iterable_of_ints) -> bytes


This means a bytes object is just many ints but turned into encoded bytes.



Think of a bytes object as a list of ints. Check this out:



>>> l = [1, 36, 233]
>>> b = bytes(l)
>>> l[0]
1
>>> b[0]
1
>>> l[0:1]
[1]
>>> b[0:1]
b'x01'




Now about the question of why?



What other way can one represent a byte?

A string sure would represent many bytes with an encoding, but not if it has a different encoding or no encoding specified.

A tuple wouldn't make sense as it can have anything inside it. That includes other strings, floats, and other stuff a byte wouldn't represent.

An integer would only represent one byte, and a tuple of ints specifically for this purpose would work.



Therefore, a tuple of ints would make up a bytes object, and a bytes object would be able to be decoded and encoded into strings for use. An int would be the only 'pure' way of representing a single byte inside the bytes object.






share|improve this answer





















  • 2





    That's not what the question is asking.

    – jonrsharpe
    Jan 3 at 21:52











  • I've changed it a little bit. Does this count towards answering it?

    – GeeTransit
    Jan 3 at 21:56











  • No, the OP knows it's basically a list of ints but is wondering why.

    – jonrsharpe
    Jan 3 at 21:57











  • Well, what other way can one represent a byte? A string would represent many bytes with an encoding, but not if it has a different encoding. A tuple wouldn't make sense as it can have anything inside it. An integer would only represent one, and a tuple of ints would work. I think this should answer it fairly well.

    – GeeTransit
    Jan 3 at 22:01











  • @GeeTransit yes, your last comment actually answers the question for me. I now understand. Thank you!

    – chunjiw
    Jan 3 at 22:05
















-1














A byte can be represented as an int below 2**8, or under 256. This is for easier redability of the bytes object's bytes.



Note: When you make a bytes object, it displays:



bytes(iterable_of_ints) -> bytes


This means a bytes object is just many ints but turned into encoded bytes.



Think of a bytes object as a list of ints. Check this out:



>>> l = [1, 36, 233]
>>> b = bytes(l)
>>> l[0]
1
>>> b[0]
1
>>> l[0:1]
[1]
>>> b[0:1]
b'x01'




Now about the question of why?



What other way can one represent a byte?

A string sure would represent many bytes with an encoding, but not if it has a different encoding or no encoding specified.

A tuple wouldn't make sense as it can have anything inside it. That includes other strings, floats, and other stuff a byte wouldn't represent.

An integer would only represent one byte, and a tuple of ints specifically for this purpose would work.



Therefore, a tuple of ints would make up a bytes object, and a bytes object would be able to be decoded and encoded into strings for use. An int would be the only 'pure' way of representing a single byte inside the bytes object.






share|improve this answer





















  • 2





    That's not what the question is asking.

    – jonrsharpe
    Jan 3 at 21:52











  • I've changed it a little bit. Does this count towards answering it?

    – GeeTransit
    Jan 3 at 21:56











  • No, the OP knows it's basically a list of ints but is wondering why.

    – jonrsharpe
    Jan 3 at 21:57











  • Well, what other way can one represent a byte? A string would represent many bytes with an encoding, but not if it has a different encoding. A tuple wouldn't make sense as it can have anything inside it. An integer would only represent one, and a tuple of ints would work. I think this should answer it fairly well.

    – GeeTransit
    Jan 3 at 22:01











  • @GeeTransit yes, your last comment actually answers the question for me. I now understand. Thank you!

    – chunjiw
    Jan 3 at 22:05














-1












-1








-1







A byte can be represented as an int below 2**8, or under 256. This is for easier redability of the bytes object's bytes.



Note: When you make a bytes object, it displays:



bytes(iterable_of_ints) -> bytes


This means a bytes object is just many ints but turned into encoded bytes.



Think of a bytes object as a list of ints. Check this out:



>>> l = [1, 36, 233]
>>> b = bytes(l)
>>> l[0]
1
>>> b[0]
1
>>> l[0:1]
[1]
>>> b[0:1]
b'x01'




Now about the question of why?



What other way can one represent a byte?

A string sure would represent many bytes with an encoding, but not if it has a different encoding or no encoding specified.

A tuple wouldn't make sense as it can have anything inside it. That includes other strings, floats, and other stuff a byte wouldn't represent.

An integer would only represent one byte, and a tuple of ints specifically for this purpose would work.



Therefore, a tuple of ints would make up a bytes object, and a bytes object would be able to be decoded and encoded into strings for use. An int would be the only 'pure' way of representing a single byte inside the bytes object.






share|improve this answer















A byte can be represented as an int below 2**8, or under 256. This is for easier redability of the bytes object's bytes.



Note: When you make a bytes object, it displays:



bytes(iterable_of_ints) -> bytes


This means a bytes object is just many ints but turned into encoded bytes.



Think of a bytes object as a list of ints. Check this out:



>>> l = [1, 36, 233]
>>> b = bytes(l)
>>> l[0]
1
>>> b[0]
1
>>> l[0:1]
[1]
>>> b[0:1]
b'x01'




Now about the question of why?



What other way can one represent a byte?

A string sure would represent many bytes with an encoding, but not if it has a different encoding or no encoding specified.

A tuple wouldn't make sense as it can have anything inside it. That includes other strings, floats, and other stuff a byte wouldn't represent.

An integer would only represent one byte, and a tuple of ints specifically for this purpose would work.



Therefore, a tuple of ints would make up a bytes object, and a bytes object would be able to be decoded and encoded into strings for use. An int would be the only 'pure' way of representing a single byte inside the bytes object.







share|improve this answer














share|improve this answer



share|improve this answer








edited Jan 3 at 22:12

























answered Jan 3 at 21:51









GeeTransitGeeTransit

694316




694316








  • 2





    That's not what the question is asking.

    – jonrsharpe
    Jan 3 at 21:52











  • I've changed it a little bit. Does this count towards answering it?

    – GeeTransit
    Jan 3 at 21:56











  • No, the OP knows it's basically a list of ints but is wondering why.

    – jonrsharpe
    Jan 3 at 21:57











  • Well, what other way can one represent a byte? A string would represent many bytes with an encoding, but not if it has a different encoding. A tuple wouldn't make sense as it can have anything inside it. An integer would only represent one, and a tuple of ints would work. I think this should answer it fairly well.

    – GeeTransit
    Jan 3 at 22:01











  • @GeeTransit yes, your last comment actually answers the question for me. I now understand. Thank you!

    – chunjiw
    Jan 3 at 22:05














  • 2





    That's not what the question is asking.

    – jonrsharpe
    Jan 3 at 21:52











  • I've changed it a little bit. Does this count towards answering it?

    – GeeTransit
    Jan 3 at 21:56











  • No, the OP knows it's basically a list of ints but is wondering why.

    – jonrsharpe
    Jan 3 at 21:57











  • Well, what other way can one represent a byte? A string would represent many bytes with an encoding, but not if it has a different encoding. A tuple wouldn't make sense as it can have anything inside it. An integer would only represent one, and a tuple of ints would work. I think this should answer it fairly well.

    – GeeTransit
    Jan 3 at 22:01











  • @GeeTransit yes, your last comment actually answers the question for me. I now understand. Thank you!

    – chunjiw
    Jan 3 at 22:05








2




2





That's not what the question is asking.

– jonrsharpe
Jan 3 at 21:52





That's not what the question is asking.

– jonrsharpe
Jan 3 at 21:52













I've changed it a little bit. Does this count towards answering it?

– GeeTransit
Jan 3 at 21:56





I've changed it a little bit. Does this count towards answering it?

– GeeTransit
Jan 3 at 21:56













No, the OP knows it's basically a list of ints but is wondering why.

– jonrsharpe
Jan 3 at 21:57





No, the OP knows it's basically a list of ints but is wondering why.

– jonrsharpe
Jan 3 at 21:57













Well, what other way can one represent a byte? A string would represent many bytes with an encoding, but not if it has a different encoding. A tuple wouldn't make sense as it can have anything inside it. An integer would only represent one, and a tuple of ints would work. I think this should answer it fairly well.

– GeeTransit
Jan 3 at 22:01





Well, what other way can one represent a byte? A string would represent many bytes with an encoding, but not if it has a different encoding. A tuple wouldn't make sense as it can have anything inside it. An integer would only represent one, and a tuple of ints would work. I think this should answer it fairly well.

– GeeTransit
Jan 3 at 22:01













@GeeTransit yes, your last comment actually answers the question for me. I now understand. Thank you!

– chunjiw
Jan 3 at 22:05





@GeeTransit yes, your last comment actually answers the question for me. I now understand. Thank you!

– chunjiw
Jan 3 at 22:05


















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54030276%2fwhy-python-iterates-bytes-as-integers%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Qgi1C0o,zywxF6x,ZEgrFgY5,I UUWqv0
LvppxTimP48Z5DEr8 XaoFhw8yT,kLmy Y7fZNcQIEhZV4FkOLCJTQmC,z77tFBZpShoZ JditSNXca

Popular posts from this blog

Monofisismo

Angular Downloading a file using contenturl with Basic Authentication

Olmecas