Re: [Tutor] Best practice for generalizing and documenting each method's behaviour

2013-08-30 Thread Alan Gauld
On 30/08/13 19:10, Bao Niu wrote: ... However, when there are many of such classes, exactly at what point to invoke check and clean behaviour becomes a little blurred. I'm not too sure what you mean by that. Can you give an example? There is a desperate need for generalizing and documenting

[Tutor] Best practice for generalizing and documenting each method's behaviour

2013-08-30 Thread Bao Niu
I'm starting a small project coding in Python as I learn the ropes. As the project grows bigger, there are more and more overlapping and even redundant methods. For example, several classes have a checkAndClean_obj_state() method. If just one or two such classes, it is easy to analyze the behaviour

Re: [Tutor] myown.getfilesystemencoding()

2013-08-30 Thread eryksun
On Fri, Aug 30, 2013 at 11:04 AM, Albert-Jan Roskam wrote: > In Windows, sys.getfilesystemencoding() returns 'mbcs' (multibyte code > system), which doesn't say very much imho. Why aren't you using Unicode for the filename? The native encoding for NTFS is UTF-16, and CPython 2.x uses _wfopen() if

Re: [Tutor] myown.getfilesystemencoding()

2013-08-30 Thread Chris Down
On 2013-08-30 08:04, Albert-Jan Roskam wrote: > In Windows, sys.getfilesystemencoding() returns 'mbcs' (multibyte code > system), which doesn't say very much imho. Well, what's the problem you have with mbcs being the output here? On NT, mbcs is the encoding that should be used to convert Unicode

[Tutor] myown.getfilesystemencoding()

2013-08-30 Thread Albert-Jan Roskam
In Windows, sys.getfilesystemencoding() returns 'mbcs' (multibyte code system), which doesn't say very much imho. So I wrote the function below, which returns the codepage as reported by the windows chcp command. I noticed that the function returns 850 (codepage 850) when I run it via the comman

Re: [Tutor] Comment on http://www.catb.org/esr/faqs/smart-questions.html

2013-08-30 Thread Steven D'Aprano
On 28/08/13 04:19, Rick Moen wrote: /me waves to esteemed tutors and helpers. /me waves back Did you subscribe to the list just to discuss this? I'm impressed by your dedication! Thank you! [snip explanation for why Smart Questions is the way it is] Thank you for taking the time to explain.