Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #5614 > unrolled thread
| Started by | Ian Kelly <ian.g.kelly@gmail.com> |
|---|---|
| First post | 2011-05-17 14:52 -0600 |
| Last post | 2011-05-17 14:52 -0600 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: Python 3.x and bytes Ian Kelly <ian.g.kelly@gmail.com> - 2011-05-17 14:52 -0600
| From | Ian Kelly <ian.g.kelly@gmail.com> |
|---|---|
| Date | 2011-05-17 14:52 -0600 |
| Subject | Re: Python 3.x and bytes |
| Message-ID | <mailman.1715.1305665594.9059.python-list@python.org> |
On Tue, May 17, 2011 at 2:20 PM, Ethan Furman <ethan@stoneleaf.us> wrote: > The big question, though, is would you do it this way: > > some_var = bytes(23).replace(b'\x00', b'a') > > or this way? > > some_var = bytes(b'a' * 23) Actually, I would just do it this way: some_var = b'a' * 23 That's already a bytes object. Passing it into the constructor is redundant.
Back to top | Article view | comp.lang.python
csiph-web