Re: wxPython Licence vs GPL

2005-11-22 Thread John Perks and Sarah Mount
> IIRC, wxPython license has nothing to do with GPL. Its license is far more > "free" than GPL is. If you want to create commercial apps with wxPython, you > can do it without messing with licenses. This isn't a commercial app though, it's for a research project and apparently it's a requirement t

wxPython Licence vs GPL

2005-11-22 Thread John Perks and Sarah Mount
we have some Python code we're planning to GPL. However, bits of it were cut&pasted from some wxPython-licenced code to use as a starting point for implementation. It is possible that some fragments of this code remains unchanged at the end. How should we refer to this in terms of copyright statem

[regex] case-splitting strings in unicode

2005-10-08 Thread John Perks and Sarah Mount
I have to split some identifiers that are casedLikeThis into their component words. In this instance I can safely use [A-Z] to represent uppercase, but what pattern should I use if I wanted it to work more generally? I can envisage walking the string testing the unicodedata.category of each char, b

Re: Will python never intend to support private, protected and public?

2005-10-02 Thread John Perks and Sarah Mount
> 1) Something that fixes the broken name mangling in the current > system, but still doesn't try to defeat intentional unmangling. > Currently, if you have a class with the same name as one of its > superclasses, the name mangling can fail even its existing purpose of > preventing accidental colli

Re: Block-structured resource handling via decorators

2005-07-30 Thread John Perks and Sarah Mount
> The only cases I see the first school of thought is when the resource > in question is "scarce" in some way. By "resource" I meant anything with some sort of acquire/release semantics. There may be plenty of threading.Locks available, but it's still important that a given Lock is released when n

Block-structured resource handling via decorators

2005-07-29 Thread John Perks and Sarah Mount
When handling resources in Python, where the scope of the resource is known, there seem to be two schools of thought: (1) Explicit: f = open(fname) try: # ... finally: f.close() (2) Implicit: let the GC handle it. I've come up with a third method that uses decorators to achieve a useful

"static" data descriptors and possibly spurious calls to __set__?

2005-06-19 Thread John Perks and Sarah Mount
I have a peculiar problem that, naturally, I cannot reproduce outside the fairly long-winded code that spawned it. Thus the code snippets here should be taken as shorthand for what I think are the relevant bits, without actually leading to the erroneous (or at least undesired) behaviour described.

UTF16 codec doesn't round-trip?

2005-05-28 Thread John Perks and Sarah Mount
(My Python uses UTF16 natively; can someone with UTF32 Python let me know if that behaves differently?) >>> import codecs >>> u'\ud800' # part of surrogate pair u'\ud800' codecs.utf_16_be_encode(_)[0] '\xd8\x00' codecs.utf_16_be_decode(_)[0] Traceback (most recent call last): File "", line 1, in

Re: MRO problems with diamond inheritance?

2005-05-02 Thread John Perks and Sarah Mount
"Michele Simionato" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > BTW, what it your use case? I have yet to see a single compelling use > case for multiple inheritance, so I am > curious of what your design is. Before I start, I should mention that my workaround I listed previousl

MRO problems with diamond inheritance?

2005-05-01 Thread John Perks and Sarah Mount
Trying to create the "lopsided diamond" inheritance below: >>> class B(object):pass >>> class D1(B):pass >>> class D2(D1):pass >>> class D(D1, D2):pass Traceback (most recent call last): File "", line 1, in ? TypeError: Error when calling the metaclass bases Cannot create a consistent method

Re: Multiple threads in a GUI app (wxPython), communication between worker thread and app?

2005-05-01 Thread John Perks and Sarah Mount
"fo" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > This is a network app, written in wxPython and the socket module. This > is what I want to happen: I'm not sure if this will help you, but it solved what was, for me, a more general problem: not (normally) being able to issue w

wxPython OGL: How make LineShape text b/g transparent?

2005-04-14 Thread John Perks and Sarah Mount
(Having problems receiving wxPython mailing list entries, so I'll ask here.) I'm using wxPython 2.5.4, windows ansi version, on Python 2.4, the OS in Win98SE. My application manipulates a graph, with CircleShapes for nodes and LineShapes for arcs. The user needs to be able to get and set text on a

dynamic loading of code, and avoiding package/module name collisions.

2005-04-07 Thread John Perks and Sarah Mount
Long story short: what I'm looking for is information on how have a Python app that: * embeds an editor (or wxNoteBook full of editors) * loads code from the editors' text pane into the app * executes bits of it * then later unloads to make way for an edited version of the code. The new version nee

Use of descriptor __get__: what defines an object as being a class?

2005-03-23 Thread John Perks and Sarah Mount
I'm talk from the point of view of descriptors. Consider a.x = lambda self:None # simple function When a.x is later got, what criterion is used to see if a class (and so the func would have __get__(None, a) called on it)? Pre-metaclasses, one might assume it was isinstance(a, (types.TypeType, ty