Re: __pycache__, one more good reason to stck with Python 2?

2011-01-17 Thread Flávio Lisbôa
That's why i disagree (and hate) the automatic compilation of code, my project directory becomes full of object files, and then i need to either delete everything manually or create a script to do the work (not in python, because it'll dirt things even more :). Sometimes i notice python doesn't rec

Re: type(d) != type(d.copy()) when type(d).issubclass(dict)

2010-12-24 Thread Flávio Lisbôa
> > copy, here, is a dict method. It will create a dict. > If you really need it, you could try this: > > import copy > class neodict(dict): >def copy(self): >return copy.copy(self) > > d = neodict() > print type(d) > dd = d.copy() > print type(dd) One more gotcha to python... OO in

Re: Map Linux locale codes to Windows locale codes?

2010-12-14 Thread Flávio Lisbôa
You could look into the windows registry, the key "HKLM\SYSTEM\CurrentControlSet\Control\Nls" has all the supported LCID's listed. If not, you could simply get the codepage provided by locale.setlocale(), e.g.: import locale print(locale.setlocale(locale.LC_ALL, "")) prints "Portuguese_Brazil.125