On 12 January 2014 19:30, Emile van Sebille <em...@fenx.com> wrote:
> len(open('chars','wb').write("".join(map (chr,range(256)))).read())

Python 2:

>>> len(open('chars','wb').write("".join(map (chr,range(256)))).read())
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'NoneType' object has no attribute 'read'

I could be facetous and say "None.read", but more seriously, what are
you trying to say here? How do I write a 256-byte file with one byte
for each value? bytes(range(256)) gives you the bytestring you want. I
simply don't see your point here.

>> And yet I still don't follow what you *want*. Unless it's that b'%d' %
>> (12,) must work and give b'12', and nothing else is acceptable.
>
> Nothing else is ideal.  I'll go that route if I have to.  I understand that 
> in the real world you go with what works, but in the development stage you 
> fight for the ideal.  :)

OK, but can you fight by giving arguments as to why it's better than
the plethora of alternatives that have been suggested? Or
counter-arguments to the objections that have been raised to the
proposal?

Paul
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to