Re: UnicodeEncodeError during repr()

2010-04-19 Thread Martin v. Loewis
> Do I need to do something especial to get repr to work strictly > with unicode? Yes, you need to switch to Python 3 :-) > Or should __repr__ *always* return bytes rather than unicode? In Python 2.x: yes. > What about __str__ ? Likewise. > If both of these are supposed to return bytes, > the

Re: About the grammar

2010-04-19 Thread Martin v. Loewis
> Does any one knows why the grammar is so coded? Any intuition? The 2.7 Grammar clarifies that: # The reason that keywords are test nodes instead of NAME is that using # NAME results in an ambiguity. ast.c makes sure it's a NAME. argument: test [comp_for] | test '=' test The ambiguity is this:

Re: pyconfig.h

2010-04-19 Thread Martin v. Loewis
omnia neo wrote: > Hi All, > > I am working on porting python on vxworks and hence was updating the PC > \pyconfig.h file for configurng python. As I am reading the file and > updating manually I come across lot many preprocessor directives which > I dont understand e.g. HAVE_NICE etc. May be this

Re: Download Proprietary Microsoft Products Now

2010-04-21 Thread Martin v. Loewis
>> ... or because Mingw32 doesn't provide the header files (in particular >> wrt. C++), or because linking with a library is necessary that uses the >> MSVC mangling, not the g++ one (again, for C++). > > Again, that would be code that’s not portable off Windows. Probably (although it *is* possib

Re: Download Proprietary Microsoft Products Now

2010-04-21 Thread Martin v. Loewis
>> ... or because Mingw32 doesn't provide the header files (in particular >> wrt. C++), or because linking with a library is necessary that uses the >> MSVC mangling, not the g++ one (again, for C++). > > Again, that would be code that’s not portable off Windows. Probably (although it *is* possib

Re: Download Visual Studio Express 2008 now

2010-04-27 Thread Martin v. Loewis
> I'm curious to know exactly the differences between the c/c++ compilers > you get with various versions of VS and those you get with the (command > line only) Windows SDK (formerly called the platform SDK). > > The windows sdk is a free download. Is the compiler you get the same as > the one yo

Re: http://pypi.python.org/pypi

2010-05-01 Thread Martin v. Loewis
> I have only access to the webpage form too upload my one file. > pkginfo is ok, just want to at a single .py file instead of a complete > site-package tar directory, because it is not a site-package, its more > like a single exe file. Uploading individual .py files is not supported. If it's not

Re: Parser

2010-05-02 Thread Martin v. Loewis
Andreas Löscher wrote: > Hi, > I am looking for an easy to use parser. I am want to get an overview > over parsing and want to try to get some information out of a C-Header > file. To get information from a header file, try Tools/scripts/h2py.py Regards, Martin -- http://mail.python.org/mailman/

Re: Sphinx hosting

2010-05-03 Thread Martin v. Loewis
Michele Simionato wrote: > Say you have a project with a lot of documentation in the form of > Sphinx pages (for instance a book project). What is the the easiest > way to publish it on the Web? I see that GitHub Pages allows you to > publish static pages, but I would need to check in both the .rst

Re: Sphinx hosting

2010-05-03 Thread Martin v. Loewis
> Do you know of recent improvements on the PyPI side about docs > hosting? Yes; go to your package's pkg_edit page, i.e. http://pypi.python.org/pypi?%3Aaction=pkg_edit&name=decorator and provide a zip file at Upload Documentation. Regards, Martin -- http://mail.python.org/mailman/listinfo/pyt

Re: py3 tkinter acceps bytes. why?

2010-05-04 Thread Martin v. Loewis
> In a recent thread named "py3 tkinter Text accepts what bytes?" > (google groups link: > http://groups.google.com/group/comp.lang.python/browse_thread/thread/b75ed69f4e81b202/e2aff9ddd62d210c?lnk=raot) > I asked what kinds of bytes are accepted as tkinter parameters. > I still wonder why they are

Re: py3 tkinter acceps bytes. why?

2010-05-06 Thread Martin v. Loewis
> If I don't want bytes to get passed to tkinter > I just have to raise an exception in AsObj, no? > Or is it even sufficient to just remove the bytes case? But why would you want that? There are commands which legitimately return bytes, e.g. the file and network io libraries of Tcl (not that you

Re: 2to3 issues with execfile on python 3.0 on files with encoding

2010-05-06 Thread Martin v. Loewis
> The default replacement should be really providing a new execfile that > gets the encoding in the first 2 lines and opens it with the proper > encoding set (and properly closes the stream). No. The default replacement should really open the file in binary mode. Regards, Martin -- http://mail.p

Re: py3 tkinter acceps bytes. why?

2010-05-08 Thread Martin v. Loewis
Matthias Kievernagel wrote: > Me: >>> If I don't want bytes to get passed to tkinter >>> I just have to raise an exception in AsObj, no? >>> Or is it even sufficient to just remove the bytes case? > Martin v. Loewis wrote: >> But why would you want

Re: Upgrade Python 2.6.4 to 2.6.5

2010-05-10 Thread Martin v. Loewis
Werner F. Bruhin wrote: > Just upgraded on my Windows 7 machine my copy of 2.6.4 to 2.6.5. > > However doing sys.version still shows 2.6.4 even so python.exe is dated > 19. March 2010 with a size of 26.624 bytes. > > Is this a known issue? Or did I do something wrong? Look at the copy of python

Re: How to measure speed improvements across revisions over time?

2010-05-10 Thread Martin v. Loewis
Matthew Wilson wrote: > I know how to use timeit and/or profile to measure the current run-time > cost of some code. > > I want to record the time used by some original implementation, then > after I rewrite it, I want to find out if I made stuff faster or slower, > and by how much. > > Other tha

Re: Upgrade Python 2.6.4 to 2.6.5

2010-05-11 Thread Martin v. Loewis
> When will it install into system32? When you install "for all users". >> Did the upgrade inform you that it was an upgrade, or did it warn you >> that you would overwrite the previous installation? >> > It warned me that there is a previous installation. Hmm. You don't remember the exact m

Re: Upgrade Python 2.6.4 to 2.6.5

2010-05-11 Thread Martin v. Löwis
> If we install over an existing version of Python 2.6.5, will our PTH > files and site-packages be preserved? > > Or do we need to back out our 3rd party packages, install Python 2.6.5 > and then manually restore our 3rd party packages? An upgrade installation will only replace the Python files,

Re: open(False) in python3

2010-05-12 Thread Martin v. Loewis
geremy condra wrote: > On Wed, May 12, 2010 at 1:36 AM, Stefan Behnel wrote: >> Johan Förberg, 12.05.2010 10:05: >>> On Tue, 11 May 2010 19:27:37 -0300, Gabriel Genellina wrote: >>> so open(False) is the same as open(0), and 0 is the file descriptor associated to standard input. The prog

Re: write a 20GB file

2010-05-14 Thread Martin v. Loewis
> The code works fine. I just don't know how f.write works. It says that > file.write won't write the file until file.close or file.flush. You are misinterpreting the documentation. It certainly won't keep the entire file in memory. Instead, it has a fixed-size buffer (something like 8kiB or 32kiB

Re: parsing XML

2010-05-14 Thread Martin v. Loewis
kak...@gmail.com wrote: > Hi to all, let's say we have the following Xml > > > 17.1 > 6.4 > > > 15.5 > 7.8 > > > > How can i get the players name, age and height? > DOM or SAX and how Homework? Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Loading C extension from memory

2010-05-14 Thread Martin v. Loewis
> I wonder if there is a way to load C extension from in-memory object, > not from the file on the disk? > > I'm asking bc I would like to download C extensions over network and > load them into Python interpreter (without storing the C extension in > file on the disk). > > I googled for this bu

Re: parsing XML

2010-05-14 Thread Martin v. Loewis
>>> Hi to all, let's say we have the following Xml >>> >>> >>> 17.1 >>> 6.4 >>> >>> >>> 15.5 >>> 7.8 >>> >>> >>> >>> How can i get the players name, age and height? >>> DOM or SAX and how >> >> Homework? > > I would hope that every school teacher who teaches P

Re: Reading XML namespaces

2010-05-15 Thread Martin v. Loewis
> BTW, I'm still not sure I understand your problem. Could you provide > some more details? > Wouldn't it be easier if you told the OP how to access the prefix mappings in lxml etree, or, if this was actually not possible, admitted that it is actually not possible? FWIW, in the DOM, you look at a

Re: Puzzled by code pages

2010-05-15 Thread Martin v. Loewis
> Conclusions: > > It's worth closely scrutinising "accented characters - equivalent to > ISO-8859-2 > (I believe)". Which variety of "OpenStep plist files" are you looking at: > NeXTSTEP, GNUstep, or MAC OS X? If the latter, it's evidently an XML document, > and you should be letting the XML pa

Re: Reading XML namespaces

2010-05-15 Thread Martin v. Loewis
> ??? The namespaces are embedded in the document. Personally I find it > odd I have to tell xpath about the namespace of the document it is a > $*&@(*& method of. How so? Why do you say it's a "method", and why do you say "of"? Usually, xpath expressions are *not* part of the document they ope

Re: Reading XML namespaces

2010-05-16 Thread Martin v. Loewis
> Well, there's an "nsmap" property on each Element that provides the > mapping of prefixes to namespace URIs that form the scope of the > Element. However, while this is what the OP asked for, it is not what > the OP wants, simply because it doesn't solve the problem. Well, it solves the problem

Re: Reading XML namespaces

2010-05-16 Thread Martin v. Loewis
> Maybe true technically, but false in practice. If I receive XML data > from source XYZ or service XYZ the use of namespaces and their prefixes > is extremely consistent [in practice] and very customary (for example: > I've never seen the DSML namespace abbreviated as anything other than > "dsml"

Re: xrange issue 7721

2010-05-30 Thread Martin v. Loewis
Assuming that I am correct, can I create myself a login on the bugs tracker and re-open the issue to get this sorted? Definitely not. The issue you are looking at has been fixed; whatever your issue is (you didn't state it clearly), it must be a different one. So if you are going to report any

Re: xrange issue 7721

2010-05-31 Thread Martin v. Loewis
For the record, the issue you were looking at was a complaint that the documentation is incorrect. This had been fixed by correcting the documentation. I think Mark's point is that the code snippet given isn't a full replacement for xrange, since it doesn't support negative step sizes, nor does

Re: Missing DLL in win98

2010-06-06 Thread Martin v. Loewis
Am 04.06.2010 14:38, schrieb Spyder42: I hope this is the right place to ask this, and appologise if it's not. I'm trying to install 2.6.5 in Win98 se final. It says "a required dll could not be run". Do I have to upgrade my whole OS just to install this, or is there a fix I can apply to 98 to ma

Re: GUIs - A Modest Proposal

2010-06-08 Thread Martin v. Loewis
TkInter -> Tcl -> Tk -> Xlib Is the Tcl intepreter really need to use this GUI? Why not: (Pyton ->) Tkinter-API -> Xlib ? Even if this was possible (which it is not), then you still would need the Tcl interpreter: significant parts of Tk are written in Tcl, so Tk won't work without the Tcl int

Re: GUIs - A Modest Proposal

2010-06-08 Thread Martin v. Loewis
Am 08.06.2010 20:15, schrieb Grant Edwards: On 2010-06-08, Martin v. Loewis wrote: TkInter -> Tcl -> Tk -> Xlib Is the Tcl intepreter really need to use this GUI? Why not: (Pyton ->) Tkinter-API -> Xlib ? Even if this was possible (which it is not) Why is it not poss

Re: GUIs - A Modest Proposal

2010-06-09 Thread Martin v. Loewis
Am 09.06.2010 01:54, schrieb Grant Edwards: On 2010-06-08, Martin v. Loewis wrote: Am 08.06.2010 20:15, schrieb Grant Edwards: On 2010-06-08, Martin v. Loewis wrote: TkInter -> Tcl -> Tk -> Xlib Is the Tcl intepreter really need to use this GUI? Why not: (Pyton ->)

Re: GUIs - A Modest Proposal

2010-06-09 Thread Martin v. Loewis
But whenever I write a program that someone else is going to use, it has to have a GUI. Is that not true for most people? Most definitely not. Of the programs I recently wrote for other people, they either: - were command line scripts, meant to use for sysadmin jobs (and I wrote them for th

Re: GUIs - A Modest Proposal

2010-06-09 Thread Martin v. Loewis
Am 09.06.2010 19:16, schrieb Ethan Furman: Gregory Ewing wrote: Kevin Walzer wrote: PyGUI ... certainly is *not* a lightweight GUI toolkit that could easily be incorporated into the Python core library--it instead has rather complex dependencies on both other GUI toolkits and Python wrappers of

Re: GUIs - A Modest Proposal

2010-06-09 Thread Martin v. Loewis
As an aside, I couldn't care one hoot about the standard Python GUI, let alone two, but it strikes me that you have conveniently ignored Mark Roseman's comments earlier in this thread regarding Tk. I've no idea how much work would be involved for the Python core volunteers in introducing newer ver

Re: GUIs - A Modest Proposal

2010-06-09 Thread Martin v. Loewis
Martin, just to reinforce the point... developers using Tkinter need to make some fairly minor changes to their application code to truly take advantage of the improvements in recent versions of Tk. Without those app changes, they're not going to see any difference. To quote from the first secti

Re: GUIs - A Modest Proposal

2010-06-10 Thread Martin v. Loewis
Is the Tkinter GUI also the basic way that Python handles a graphics display? (I've never tried it.) No. Python, in itself, does not "handle" graphics displays at all. For any output to the graphics display, it uses some kind of library, whether it's console output, or a GUI application. One spe

Re: GUIs - A Modest Proposal

2010-06-10 Thread Martin v. Loewis
That said, PerlTk didn't use Tcl did it? If you are referring to http://search.cpan.org/~srezic/Tk-804.028/ - this also has a full Tcl interpreter, in pTk/mTk, and uses Tcl_Interp and Tcl_Obj throughout. From the Perl/Tk FAQ (*): "However, from a Perl perspective, Perl/Tk does not require any

Re: GUIs - A Modest Proposal

2010-06-10 Thread Martin v. Loewis
or PyGui would need to be implemented in terms of ctypes (which then would prevent its inclusion, because there is a policy that ctypes must not be used in the standard library). Is there? I wasn't aware of that. What's the reason? ctypes is inherently unsafe. It must be possible to remove it

Re: GUIs - A Modest Proposal

2010-06-10 Thread Martin v. Loewis
It seems that removing Tkinter from the stdlib will not only benefit Python, but also Tkinter; due to the fact that Tkinter will not be confined to Python's release schedules. As we've witnessed so far almost nothing has changed since Tkinter's addition many years ago. That's not true. Python 2.

Re: GUIs - A Modest Proposal

2010-06-10 Thread Martin v. Loewis
Am 10.06.2010 23:20, schrieb rantingrick: Free up pydev and send Tkinter to the bitbucket! But if you *do* decide to include a GUI, should it not at *least* be based on the native widgets like PyGUI? So Tkinter is a good choice, then, as it *does* have native widgets. Regards, Martin -- http:/

Re: GUIs - A Modest Proposal

2010-06-12 Thread Martin v. Loewis
Yeah. I get the policy in general, a proliferation of ctypes stuff could be very bad -- but if code is very careful with type-checking and stuff, it should be possible to get an exception, I'd hope. Only if you can live with the respective module not being available all the time. The issue is n

Re: safer ctype? (was GUIs - A modest Proposal)

2010-06-12 Thread Martin v. Loewis
Got me thinking, is it perhaps doable to have a 'safe' ctype that is guaranteed to be in the stdlib? Perhaps crippling it in a sense that it only allows a known set of functions to be called? In some sense, a C module wrapping a selected number of functions (like the win32 extensions) is exactly

Re: safer ctype? (was GUIs - A modest Proposal)

2010-06-12 Thread Martin v. Loewis
Perhaps instead of restricting what functions ctypes can use, we could restrict what modules can use ctypes. For example, maybe only modules in certain directories should be allowed to import ctypes. And that's indeed the case. The test suite may use ctypes. Regards, Martin -- http://mail.pytho

Re: safer ctype? (was GUIs - A modest Proposal)

2010-06-12 Thread Martin v. Loewis
Notice that it's not (only) the functions itself, but also the parameters. It's absolutely easy to crash Python by calling a function through ctypes that expects a pointer, and you pass an integer. The machine code will dereference the pointer (trusting that it actually is one), and crash. wha

Re: safer ctype? (was GUIs - A modest Proposal)

2010-06-12 Thread Martin v. Loewis
ok... analogy: when using g++ to compile c++ code, would you place use of "asm" statements into the same sort of foot-shooting category? In a slightly different way, yes. There is no way of disabling inline assembly in g++, so the analogy is not fully appropriate. However, IIUC, using inlin

Re: GUIs - A Modest Proposal

2010-06-12 Thread Martin v. Loewis
Am 12.06.2010 17:33, schrieb Stephen Hansen: On 6/12/10 12:21 AM, Martin v. Loewis wrote: Otherwise it makes certain windows-workarounds very problematic. You basically /have/ to write a C extension :| That's not problematic at all, for the standard library. Just write that C exte

Re: GUIs - A Modest Proposal

2010-06-12 Thread Martin v. Loewis
Would it be possible to write a program that converts a module that uses ctypes to interface to a dll to a corresponding C extension program that would compile to a drop in replacement extension module? If implemented at all, I think the ctypes implementation itself could do that. I.e. create al

Re: Python ctypes / pywin32 [was: GUIs - A Modest Proposal]

2010-06-12 Thread Martin v. Loewis
Am 12.06.2010 19:59, schrieb Stephen Hansen: On 6/12/10 8:57 AM, lkcl wrote: On Jun 10, 6:26 pm, "Martin v. Loewis" wrote: It must be possible to remove it from a Python installation, as long as that's not an official policy statement that ctypes will, at some point in

Re: Python Library Win7 -64 Bit

2010-06-15 Thread Martin v. Loewis
Has anyone had any prior experience with this sort of problem or can anyone point me in the right direction? My recommendation is to install the 32-bit version of Python, and use precompiled binaries of libxml. Failing that, install Visual Studio Express (or Visual Studio proper), and compile l

Re: exceptions and unicode

2010-06-16 Thread Martin v. Loewis
So how do I get what I want? Submit a patch. You would have to explain why this is a bug fix and not a new feature, as new features are not allowed anymore for 2.x. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: I strongly dislike Python 3

2010-06-26 Thread Martin v. Loewis
>> No, "I'm" not trying to kill Python 2 at all. My current estimation is >> that I'll be using it for at least the next three years -- library >> conversion momentum is there, but its happening faster in the pure >> Python libraries then a few critical C extensions I rely upon. > > Based on my ex

Re: I strongly dislike Python 3

2010-06-27 Thread Martin v. Loewis
> I didn't notice this level of angst when Python made equally significant > changes going from 1.5 to 2.0... I think the *level* was about the same (IIRC). People would say that they ignore 2.x for years, and that it is important to continue supporting 1.5.2 for a long time (about until 2.4 was

Re: os.system: string encoding

2010-06-27 Thread Martin v. Loewis
Am 25.06.2010 17:13, schrieb Peter Kleiweg: > How do I set the string encoding for os.system to anything other then UTF-8? You shouldn't have to set it, as it should use your locale's encoding. In 3.1.2, it will. For the moment, you can encode the string explicitly, and pass a byte string. Regar

Re: I strongly dislike Python 3

2010-06-27 Thread Martin v. Loewis
> I agree that there may be not much reason to port custom proprietary > apps that are working fine and which would hardly benefit from, let > alone need, and new Py3 features. In the long run, there will be a benefit: at some point in the future (surely years from now), /usr/bin/python will be Py

Re: os.system: string encoding

2010-06-27 Thread Martin v. Loewis
>> For the moment, you can encode the string explicitly, and pass a byte >> string. > > That doesn't work I only have 3.1.2 to test at the moment. I suggest trying to use the subprocess module instead. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: I strongly dislike Python 3

2010-06-28 Thread Martin v. Loewis
> Until such time as 100% of the systems I might ever want to run my progams > on have python 3 installed, I cannot port my programs over from python 2. You don't have to port them from python 2, but still could it make easy to use them with Python 3: just arrange it so that 2to3 will correctly co

Re: Why Python3

2010-06-29 Thread Martin v. Loewis
> I should point out that this wasn't a mere whimsy on Guido's part. > Mathematically, supporting larger-than and less-than comparisons on > complex numbers *is* a bug -- they're simply meaningless mathematically. > (Which is greater, 2-1i or -1+2i?) However, that's true for many other values t

Re: Why Python3

2010-06-29 Thread Martin v. Loewis
Am 29.06.2010 20:30, schrieb Paul Rubin: > "Martin v. Loewis" writes: >> And indeed, that's available, by means of the key= argument to list.sort. > > Unfortunately what's needed for more generality is the ability to supply > a comparison function, which Py

Re: The real problem with Python 3 - no business case for conversion (was "I strongly dislike Python 3")

2010-07-05 Thread Martin v. Loewis
Am 05.07.2010 22:30, schrieb D'Arcy J.M. Cain: > On Mon, 05 Jul 2010 14:42:13 -0400 > Terry Reedy wrote: >> Good start. Now what is blocking those four? >> Lack of developer interest/time/ability? >> or something else that they need? > > How about a basic how-to document? I maintain PyGreSQL and

Re: Python 2.7 released

2010-07-05 Thread Martin v. Loewis
> Benjamin (or anyone else), do you know where I can get the Compiled > Windows Help file -- python27.chm -- for this release? I have now put that file separately on the release page. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Download Microsoft C/C++ compiler for use with Python 2.6/2.7 ASAP

2010-07-06 Thread Martin v. Loewis
>> - many things which are runtime independent on unix are not on >> windows (file descriptor: AFAIK, a file descriptor as returned from >> open can be dealt with in any C runtime on unix) > > Are you telling me that file descriptors (it's a flippin int!) can't be > passed around universally on W

Re: Download Microsoft C/C++ compiler for use with Python 2.6/2.7 ASAP

2010-07-07 Thread Martin v. Loewis
> Python 3.1.1, file [pymem.h]: > > PyAPI_FUNC(void *) PyMem_Malloc(size_t); > > #define PyMem_MALLOC(n)(((n) < 0 || (n) > PY_SSIZE_T_MAX) ? NULL \ > : malloc((n) ? (n) : 1)) > > The problem with the latter that it seems that it's intended for safety > but does the opposi

Re: Download Microsoft C/C++ compiler for use with Python 2.6/2.7 ASAP

2010-07-07 Thread Martin v. Loewis
> I presume this problem would go away if future versions of Python > itself were compiled on Windows with something like MinGW gcc. Also, > this would solve the pain of Python developers attempting to > redistribute py2exe versions of their programs (i.e. they have to own > a Visual Studio license

Re: Download Microsoft C/C++ compiler for use with Python 2.6/2.7 ASAP

2010-07-07 Thread Martin v. Loewis
> Also observe that this macro is very badly written (even illegal) C. > Consider what this would do: > > PyMem_MALLOC(n++) > > According to Linus Thorvalds using macros like this is not even legal > C: > > http://www.linuxfocus.org/common/src/January2004_linus.html [Please don't use "lega

Re: Download Microsoft C/C++ compiler for use with Python 2.6/2.7 ASAP

2010-07-07 Thread Martin v. Loewis
>>> Perhaps (if it isn't intentional) this is a bug of the oversight type, >>> that nobody remembered to update the macro? >> >> Update in what way? > > I was guessing that at one time there was no PyMem_Malloc. And that it > was introduced to fix Windows-specific problems, but inadvertently > wit

Re: Download Microsoft C/C++ compiler for use with Python 2.6/2.7 ASAP

2010-07-07 Thread Martin v. Loewis
Am 07.07.2010 22:35, schrieb sturlamolden: > On 7 Jul, 22:26, Christian Heimes wrote: > >> Don't forget errno! Every CRT might have its own errno thread local. I >> don't know how its handled on Windows but I suspect it suffers from the >> same problem. > > The Windows API "errno" is GetLastErro

Re: Download Microsoft C/C++ compiler for use with Python 2.6/2.7 ASAP

2010-07-07 Thread Martin v. Loewis
Am 07.07.2010 23:49, schrieb sturlamolden: > On 7 Jul, 23:33, "Martin v. Loewis" wrote: > >>> The Windows API "errno" is GetLastError. But a delinquent CRT might >>> map GetLastError() to other integers. >> >> Please check the source befor

Re: Download Microsoft C/C++ compiler for use with Python 2.6/2.7 ASAP

2010-07-07 Thread Martin v. Löwis
> I saw you already mentioned work toward this a few months (years ?) > ago. Is there some kind of roadmap, or could you use some help ? I > would really like to solve this issue as much as we possibly can, Well, Python 3 has already dropped stdio for its own io library, and I do want to get rid o

Re: The real problem with Python 3 - no business case for conversion (was "I strongly dislike Python 3")

2010-07-07 Thread Martin v. Loewis
Am 07.07.2010 23:10, schrieb Brendan Abel: One thing that would be very useful is how to maintain something that works on 2.x and 3.x, but not limiting yourself to 2.6. Giving up versions below 2.6 is out of the question for most projects with a significant userbase IMHO. As suc

Re: The real problem with Python 3 - no business case for conversion (was "I strongly dislike Python 3")

2010-07-07 Thread Martin v. Loewis
> Python 3.x will continue to change. The incompatibilities between 3.x > and 2.x will only become more numerous. If your goal is to support > 2.x, and 3.x, you'd be best supporting them separately. I don't think that's a particularly good approach. Having a single code base for both likely redu

Re: The real problem with Python 3 - no business case for conversion

2010-07-07 Thread Martin v. Loewis
> The point, one more time with feeling, is that the incompatibilities > between 2.x and 3.x will *increase* over time. I think this is unfounded, and actually false. Instead, the incompatibilities will *decrease* over the next few years. Suppose you support 2.x and 3.x from a single code base. T

Re: Python 2.7 released

2010-07-07 Thread Martin v. Loewis
Am 08.07.2010 04:17, schrieb imageguy: > >> I, too, have multiple versions installed -- newer ones for running code >> I haven't upgraded; older ones for compatibility testing where needed. >> I just install to the default c:\pythonxy directories (although I like >> the idea of a common root) and

Re: How do I add method dynamically to module using C API?

2010-07-07 Thread Martin v. Loewis
> And since things work for a single method when I declare 'def' as > 'static', I suspect that means that the function object created by > PyCFunction_NewEx holds on to a pointer to the PyMethodDef structure? Correct; it doesn't make a copy of the struct. So when you want the function object to ou

Re: The real problem with Python 3 - no business case for conversion (was "I strongly dislike Python 3")

2010-07-07 Thread Martin v. Loewis
> I just > couldn't get through on the python-dev list that I couldn't just > upgrade my code to 2.6 and then use 2to3 to keep in step across the > 2-3 chasm, as this would leave behind my faithful pre-2.6 users. Not sure whom you had been talking to. But I would have tried to explain that you don

Re: How do I add method dynamically to module using C API?

2010-07-08 Thread Martin v. Loewis
> I tried (1) adding a __del__, but no dice, I guess > because it wasn't really an object method but just a free function in a > module; and (2) the m_free callback in the module definition structure, > but it was not called. m_free will be called if the module object gets deallocated. So if m_fre

Re: Any reason www.python.org is slow?

2010-07-10 Thread Martin v. Loewis
> For the last year?? > It's been mostly zippy here. > Is IPv6 enabled on your computer? If so, I'd try to disable it. > python.org domains resolve to both IPv4 and IPv6 addresses and, if your > computer has IPv6 enabled but you don't have any IPv6 connectivity, > this can result in slowdowns. Tha

Re: Any reason www.python.org is slow?

2010-07-10 Thread Martin v. Loewis
> I did disable IPv6 on my computer at home and it did speed it up. I'll > check the other computers where I experienced the same slowness. Of course, it would be interesting to find out what precisely went wrong. If you are curious to find out, let me know, and I'll help investigating. Regards,

Re: Any reason www.python.org is slow?

2010-07-10 Thread Martin v. Loewis
>> If your computer does have IPv6 connectivity, but it's broken >> (i.e. you have a gateway, but eventually packets are discarded), >> you see the IPv4 fallback after the IPv6 timeout. The IPv4 connection in >> itself then would be fast. > > I think it's what most users experience when they are t

Python track at German Zope conference

2010-07-13 Thread Martin v. Loewis
[Das ist im Wesentlichen eine Kopie einer Nachricht, die Dinu an die Python-DE-Liste geschickt hat.] >From September 15 to September 17, 2010, the German Zope conference (organized by DZUG) takes place in Dresden. It has tracks for Python, Zope, and Plone. Dinu Gherman and me are organizing the P

Re: Why is python not written in C++ ?

2010-08-03 Thread Martin v. Loewis
> Has it ever been planned to rewrite in C++ the historical implementation > (of course in an object oriented design) ? Around the time Guido coined the term "Python 3000" (i.e. in 2000), he also said at a few occasions that it would be written in C++. He subsequently dropped the idea, for the rea

Re: Python Portability--Not very portable?

2010-08-07 Thread Martin v. Loewis
> As an example, my inexperienced Python partner 30 miles away has gotten > out of step somehow. I think by installing a different version of numpy > than I use. I gave him a program we both use months ago, and he had no > trouble. (We both use IDLE on 2.5). I made a one character change to it > an

Re: Python Portability

2010-08-07 Thread Martin v. Loewis
Am 07.08.2010 23:01, schrieb Michael Torrie: > On 08/07/2010 01:17 PM, W. eWatson wrote: >> Presumably I have him somehow delete the numpy site-package, the numpy >> 1.2.0 package? Just drill his way dow from the .../lib/site_packages? >> Then install 1.2.0. He's missed the boat on that before by

Re: Python Portability

2010-08-07 Thread Martin v. Loewis
> To add to the msg I just sent to M. Torrie. We are given the msi > programs for Python, PIL,matplotlib, and numpy. The question of how to > uninstall and re-install a different version remains. I'd claim that this is not the real question. The real question is, instead: "What specific error did

Re: Python Portability

2010-08-08 Thread Martin v. Loewis
e. Perhaps it was installed by a different user, and will only show up when that user goes into CP? Do you recall what procedure you have used for installation? > Well, this is interesting. I just > noticed Martin v. Loewis on the Python 2.5 entry. That's you, right? Correct. I keep buil

Re: Win7. Why Don't Matplotlib, ... Show up in Control Panel Add-Remove?

2010-08-08 Thread Martin v. Loewis
> There's a discrepancy because package management on Python is > completely broken. Distutils and Setuptools (and it's new fork, > Distribute) are inadequate- they act as installers, but don't provide > a way to uninstall the program. That's not true. If you use the bdist_wininst, bdist_msi, or b

Re: Win7. Why Don't Matplotlib, ... Show up in Control Panel Add-Remove?

2010-08-08 Thread Martin v. Loewis
>The basic answer is that nobody is in charge. There's nobody > even trying to herd the third-party modules. Unlike CPAN, which > has standards for Perl packages and some level of quality > control, PyPi is just a link farm. Do the standards of CPAN also include uninstallation? To my knowle

Re: Why is python not written in C++ ?

2010-08-10 Thread Martin v. Loewis
Am 10.08.2010 09:06, schrieb Ulrich Eckhardt: > Carl Banks wrote: >> I highly doubt the Python source would build with a C++ compiler. > > As Christian showed, it doesn't. However, look around the sources a bit. > There are lots of places where e.g. the returnvalue of malloc() (or, > rather, the m

Re: Why can't I set sys.ps1 to a unicode string?

2010-08-12 Thread Martin v. Loewis
> So... why does having a non-ascii character in sys.ps1 make the prompt > vanish? I can't pinpoint it to a specific line of code. Most likely, it tries to encode the prompt as ASCII before writing it to stdout. That fails, and it silently ignores the error. FWIW, this is fixed in Python 3. Reg

Re: writing \feff at the begining of a file

2010-08-14 Thread Martin v. Loewis
> Is there a standard way to autodetect the encoding of a text file? Use the chardet module: http://chardet.feedparser.org/ Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: shelf-like list?

2010-08-15 Thread Martin v. Loewis
> Does anyone know of such a module? ZODB supports persistent lists. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Looking for an appropriate encoding standard that supports all languages

2010-08-19 Thread Martin v. Loewis
> I write a line of strings in the source code and I want my program to > show that as an output on GUI. And this line of strings includes a > character like "ü". Make sure you use Unicode literals in your source code, i.e. u"ü". HTH, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Creating a PYD file

2010-08-19 Thread Martin v. Loewis
> (Pseudo code) > > result = arg1 + arg2 > return result For this code, the manually-written version will most likely be faster than the Pyrex-generated one. This is, most likely, because the manually-written version will assume a specific data type for the arguments (e.g. int), which Pyrex will

Re: make install DESTDIR

2010-08-21 Thread Martin v. Loewis
> The whole point of DESTDIR is that it should be prepended to all > installed paths, but the binaries should not contain any references to > it.DESTDIR is commonly used by packagers, for example, to allow > installation without superuser privileges. So what is the point of your messages? Do you w

Re: make install DESTDIR

2010-08-23 Thread Martin v. Loewis
> Martin- Asking for help :) Ok. Please try the patch below. If this works, please make a bug report. Regards, Martin Index: Lib/distutils/util.py === --- Lib/distutils/util.py (Revision 84197) +++ Lib/distutils/util.py

Re: Proper set-up for a co-existant python 2.6 & 3.1 installation

2010-08-23 Thread Martin v. Loewis
> I tried to change file associations, first manually, in a CMD window. > But the system was responding "access denied" even when I used an > Administrator account (I was using FTYPE python.file="C: > \Python26\python.exe" "%1" %*). That works, in principle. Put that command into py26.bat, then, i

Re: Proper set-up for a co-existant python 2.6 & 3.1 installation

2010-08-23 Thread Martin v. Loewis
> When I am logged-in in a session as an administrator, the BAT file on > the Desktop, and I double-click on it, it does not work. This is not what I meant. Instead, right-click on the BAT file, and select "run as administrator". > When you say to double-escape the percent signs, do you mean that

Re: make install DESTDIR

2010-08-23 Thread Martin v. Loewis
> Thanks Martin. That seems to work. I will file a bug report. Also, can > you describe what the problem was? If you have / as the prefix, you get two leading slashes, e.g. for //lib/python2.x. Any other prefix would have given you only a single slash: e.g. if it had been /usr, then you end up wit

<    19   20   21   22   23   24   25   >