Hi folks!
I'd like to split my package tree into several IDE projects and build a
custom
importer to import
'top.child1.child2'
from the directory
/top.child1.child2/__init__.py
so basically replacing the dots with slashes and having the package content
lying directly in the project fol
Hello? Rfd, anyone?
Thus wrote Fabiano Sidler:
> Thus wrote Fabiano Sidler:
> > What's the reason for this? Please find attached my TLSServer.
>
> Oh, sorry...! Apparently, the attachment has been stripped. Here inline:
>
> === tlsserver.py ===
> from socketser
Thus wrote Fabiano Sidler:
> What's the reason for this? Please find attached my TLSServer.
Oh, sorry...! Apparently, the attachment has been stripped. Here inline:
=== tlsserver.py ===
from socketserver import ThreadingTCPServer,StreamRequestHandler
import ssl
class T
Hi folks!
I have written a TLSServer for testing purposes that generates
self-signed certificates upon request. This works pretty well
except that the certificates are always supplied one request too
late:
# gets no cert, but a handshake failure instead
$ openssl s_client -connect localhost:1234
John Henry schrieb:
exec fct
You don't want this. You want to store the function in a list instead:
l = [ f1, f3, others ]
for i in [0,1]: l[i]()
Greetings,
Fabiano
--
http://mail.python.org/mailman/listinfo/python-list
Hello list!
Writing a C extension module, which way is better to implement attribute
retrieval, by a getattr function in the PyTypeObject struct or by an entry
tp_methods? I don't need any black magic being executed on attribute access,
so I would tend towards the tp_methods entry. Any argument ag
On Sunday 29 October 2006 17:48, I wrote:
> Now the following things are not clear to me:
> -Why does the VM crash? Did I use the wrong stack boundaries?
> -Why are no locales printed?
> -Why is the function "stack" not right before or after "foo"
> on the stack? When I disassemble the code of f w
Hi folks!
For getting a plan how a stack-based VM like Python works, I added a
function that prints out the current object stack. Unfortunately, it
crashes the VM. Could someone here take a look at it? What's wrong with
it?:
--- snip ---
static PyObject *
sys_stack(PyObject *self)
{
PyFra
On Tuesday 24 October 2006 17:05, Neil Cerutti wrote:
> Perhaps the inspect module will help? See 3.11.4 The Interpreter
> Stack.
No, sorry if I didn't eplain it well enough. I meant the object stack
of the current frame, not the frame stack. In my function, I wanted to
return the list of objects
On Monday 23 October 2006 02:20, I wrote:
> I'm trying to implement a python function that returns the current stack
> depth of its frame. Unfortunately, I don't see any possibility to get this
> value outside of PyEval_EvalFrameEx. Inside of it, I'd use the STACK_LEVEL
> macro. How do I do it?
No
Hi folks!
I'm trying to implement a python function that returns the current stack
depth of its frame. Unfortunately, I don't see any possibility to get this
value outside of PyEval_EvalFrameEx. Inside of it, I'd use the STACK_LEVEL
macro. How do I do it?
Greetings,
Fips
--
http://mail.python.or
On Thursday 21 September 2006 22:36, Peter Otten wrote:
> >>> def test():
>
> ... func(*args)
> ... func(**kw)
> ... func(*args, **kw)
Oh, I didn't know the possibility of using the *args and **kwargs semantics
at function call. Thank you for revealing them to me! :)
Now it is also obv
Hi folks!
Studying python byte code I encountered an interesting issue: there is no
matter, which one of the following function calls I compile:
1: func('foo','bar',foo='bar')
2: func('foobar')
3: func(foo='bar')
The compiler always uses the simple CALL_FUNCTION for all of the source
examples ab
On Sunday 30 April 2006 21:06, Serge Orlov wrote:
> Fabiano Sidler wrote:
>> Now, when I try to resize mm to 10 byte
>> --- snip ---
>> mm.resize(10)
>> --- snap ---
>> I get an EnvironmentError:[Errno 22] Invalid argument.
>
> Just a guess: try a new size
Hi folks!
I created an mmap object like so:
--- snip ---
from mmap import mmap,MAP_ANONYMOUS,MAP_PRIVATE
fl = file('/dev/zero','rw')
mm = mmap(fl.fileno(), 1, MAP_PRIVATE|MAP_ANONYMOUS)
--- snap ---
Now, when I try to resize mm to 10 byte
--- snip ---
mm.resize(10)
--- snap ---
I get an Environme
Hi folks!
As stated in subject, how do I decide wether to inherit or
? Whenever I want to intantiate my derived type, I taked
here, but inheriting from consequently would
be reasonable in cases of pure static objects (i.e. objects/types using
staticmethods exclusively), for whose I would prefer
Have a look to the following lines of code:
--- snip ---
class Foo: pass
def bar(): pass
Foo.bar = bar
--- snap ---
Why does 'bar.__get__(Foo) is Foo.bar' evaluate to False here? Did I
misunderstand the descriptor protocol?
Thank you for answering,
F. Sidler
--
http://mail.python.org/mailman/lis
I really wanted to learn the reason for this, nothing else! ;)
Greetings,
F. Sidler
--
http://mail.python.org/mailman/listinfo/python-list
25 Mar 2006 13:58:17 -0800, Ziga Seilnacht <[EMAIL PROTECTED]>:
> No, you don't have to:
Okay, but I'd prefer! ;)
> [a lot of python code]
That's what I wanted to avoid. Additionally, the possibility to do it
this way doesn't make it reasonable that is
inheritable. Are there any reasons for tha
Kent Johnson <[EMAIL PROTECTED]> wrote:
> You could do this with a simple decorator:
> http://wiki.python.org/moin/PythonDecoratorLibrary#head-d4ce77c6d6e75aad25baf982f6fec0ff4b3653f4
>
> or I think your class PrintingFunction would work as
> class PrintingFunction(object):
>def __init__(self,
Hello? Or, is there any obvious reason for this behaviour I don't see?
--
http://mail.python.org/mailman/listinfo/python-list
2006/3/14, Fabiano Sidler <[EMAIL PROTECTED]>:
> 2006/3/14, Peter Hansen <[EMAIL PROTECTED]>:
> > (As for me, I have no idea what the question is about, so this is the
> > most help I can give.)
>
> Ok, sorry! I wanted to do this:
>
> --- snip ---
> from m
Hi folks!
For debugging purposes I tried this:
--- snip ---
def foo(): pass
function = type(foo)
class PrintingFunction(function):
def __init__(self, func):
self.func = func
def __call__(self, *args, **kwargs):
print args, kwargs
return function.__call__(self, args, kwargs)
clas
2006/3/14, Peter Hansen <[EMAIL PROTECTED]>:
> (As for me, I have no idea what the question is about, so this is the
> most help I can give.)
Ok, sorry! I wanted to do this:
--- snip ---
from mmap import mmap, MAP_ANONYMOUS
mm = mmap(-1, 1024, MAP_ANONYMOUS)
--- snap ---
But I got an Environment
2006/3/12, Fabiano Sidler <[EMAIL PROTECTED]>:
> Is there any way to use anonymous memory mapping in python, versions
> earlier than 2.5?
No idea or no way to do it?
Greetings,
F. Sidler
--
http://mail.python.org/mailman/listinfo/python-list
Hi folks!
Is there any way to use anonymous memory mapping in python, versions
earlier than 2.5?
Greetings,
F. Sidler
--
http://mail.python.org/mailman/listinfo/python-list
Huh? You definitely must import that module. Then, is your homedir
listed in sys.path?
Greetings,
F. Sidler
--
http://mail.python.org/mailman/listinfo/python-list
2006/1/29, Fabiano Sidler <[EMAIL PROTECTED]>:
> 28 Jan 2006 22:02:45 -0800, Raymond Hettinger <[EMAIL PROTECTED]>:
> > But if you want to make your life unnecessarily hard, you can hack the
> > compiler module just upstream from the creation of the code object --
Hi folks!
I'm looking for a way to compile python source to bytecode instead of
code-objects. Is there a possibility to do that? The reason is: I want
to store pure bytecode with no additional data.
The second question is, therefore: How can I get the correct values
for a given bytecode, such as
29 matches
Mail list logo