Re: Unicode literals and byte string interpretation.

2011-10-31 Thread Fletcher Johnson
On Oct 28, 3:06 am, Steven D'Aprano wrote: > On Thu, 27 Oct 2011 20:05:13 -0700, Fletcher Johnson wrote: > > If I create a newUnicodeobject u'\x82\xb1\x82\xea\x82\xcd' how does > > this creation process interpret the bytes in the byte string? > > It doesn

Unicode literals and byte string interpretation.

2011-10-27 Thread Fletcher Johnson
If I create a new Unicode object u'\x82\xb1\x82\xea\x82\xcd' how does this creation process interpret the bytes in the byte string? Does it assume the string represents a utf-16 encoding, at utf-8 encoding, etc...? For reference the string is これは in the 'shift-jis' encoding. -- http://mail.python

overloading operators for a function object

2011-09-30 Thread Fletcher Johnson
Is it possible to overload operators for a function? For instance I would like to do something roughly like... def func_maker(): def func(): pass def __eq__(other): if other == "check": return True return False func.__eq__ = __eq__ return func newfunc = func_maker() newfunc ==

Re: Why is the shutil module called shutil?

2011-09-23 Thread Fletcher Johnson
On Sep 23, 11:58 pm, Chris Rebert wrote: > On Fri, Sep 23, 2011 at 8:36 PM, Fletcher Johnson > wrote: > > The topic says it all: > > Why is shutil named shutil? What does it stand for? This is just a > > mild curiosity of mine. > > "sh" is short for &quo

Why is the shutil module called shutil?

2011-09-23 Thread Fletcher Johnson
The topic says it all: Why is shutil named shutil? What does it stand for? This is just a mild curiosity of mine. The shutil module for reference: http://docs.python.org/library/shutil.html#module-shutil -- http://mail.python.org/mailman/listinfo/python-list