Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #80721

Re: How to recover bytes function?

From Ben Finney <ben+python@benfinney.id.au>
Subject Re: How to recover bytes function?
Date 2014-11-14 10:37 +1100
References <44f58abf-35a8-4741-8b7c-7eabe99a326d@googlegroups.com>
Newsgroups comp.lang.python
Message-ID <mailman.15796.1415921891.18130.python-list@python.org> (permalink)

Show all headers | View raw


satishmlmlml@gmail.com writes:

> file = open('data.bin', 'rb')
> bytes = file.read()

These are both terrible names, not least because they clobber the
built-in objects ‘file’ and ‘bytes’.

Don't name an object for *or not only for) its data type. Instead,
choose names that convey the *purpose* for the object.

-- 
 \         “Alternative explanations are always welcome in science, if |
  `\   they are better and explain more. Alternative explanations that |
_o__) explain nothing are not welcome.” —Victor J. Stenger, 2001-11-05 |
Ben Finney

Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

How to recover bytes function? satishmlmlml@gmail.com - 2014-11-13 14:32 -0800
  Re: How to recover bytes function? MRAB <python@mrabarnett.plus.com> - 2014-11-13 23:12 +0000
  Re: How to recover bytes function? Chris Angelico <rosuav@gmail.com> - 2014-11-14 10:14 +1100
  Re: How to recover bytes function? sohcahtoa82@gmail.com - 2014-11-13 15:16 -0800
  Re: How to recover bytes function? Ben Finney <ben+python@benfinney.id.au> - 2014-11-14 10:37 +1100
  Re: How to recover bytes function? Cameron Simpson <cs@zip.com.au> - 2014-11-14 18:46 +1100

csiph-web