Custom importer and errors

2024-04-15 Thread Fabiano Sidler via Python-list
ild1'; 'top' is not a package whereas with 'from top import child1' the error changes to     ImportError: cannot import name 'child1' from 'top' (unknown location) How can I make this work? Best wishes, Fabiano -- https://mail.python.org/mailman/listinfo/python-list

Re: TLSServer: certificate one request behind...

2018-03-18 Thread Fabiano Sidler
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

Re: TLSServer: certificate one request behind...

2018-03-14 Thread 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 socketserver import ThreadingTCPServer,StreamRequestHandler import ssl class T

TLSServer: certificate one request behind...

2018-03-14 Thread Fabiano Sidler
-servername server1 # gets the cert for server1 $ openssl s_client -connect localhost:1234 -servername server2 # gets the cert for server2 $ openssl s_client -connect localhost:1234 -servername server3 What's the reason for this? Please find attached my TLSServer. Best wishes, Fabiano --

Re: Updates about Tk

2010-02-28 Thread Fabiano
rantingrick ha scritto: > On Feb 27, 11:11 am, Kevin Walzer wrote: > > (...snip...) > >> Kevin Walzer >> Code by Kevinhttp://www.codebykevin.com > > Great post Kevin! The only thing i would like to add are my two > favorite references for learning Tkinter. They are not geared around > the new t

Updates about Tk

2010-02-27 Thread Fabiano
Hi, I'm going to start my little journey into the Python's lands. I have already red the old posts about but I suppose this is an evolving topic. I have understood Tk is the default Python's GUI toolkit, I have also read that version 8.5 has native widgets and visual improvements. My question is:

Re: How do I say "Is this a function"?

2008-05-05 Thread Fabiano Sidler
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

getattrfunc vs. tp_methods

2006-11-03 Thread Fabiano Sidler
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

Re: Printing out the objects stack

2006-10-31 Thread Fabiano Sidler
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

Printing out the objects stack

2006-10-29 Thread Fabiano Sidler
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

Re: Current stackdepth outside PyEval_EvalFrameEx

2006-10-25 Thread Fabiano Sidler
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

Re: Current stackdepth outside PyEval_EvalFrameEx

2006-10-24 Thread Fabiano Sidler
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

Current stackdepth outside PyEval_EvalFrameEx

2006-10-22 Thread Fabiano Sidler
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

Re: Are the CALL_FUNCTION_* opcodes ever used?

2006-09-22 Thread Fabiano Sidler
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

Are the CALL_FUNCTION_* opcodes ever used?

2006-09-21 Thread Fabiano Sidler
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

Re: unable to resize mmap object

2006-05-02 Thread Fabiano Sidler
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

unable to resize mmap object

2006-04-30 Thread Fabiano Sidler
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

inheriting type or object?

2006-04-27 Thread Fabiano Sidler
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

Inexplicable behaviour of

2006-04-23 Thread Fabiano Sidler
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

Re: Why are so many built-in types inheritable?

2006-03-28 Thread Fabiano Sidler
I really wanted to learn the reason for this, nothing else! ;) Greetings, F. Sidler -- http://mail.python.org/mailman/listinfo/python-list

Re: Why are so many built-in types inheritable?

2006-03-25 Thread Fabiano Sidler
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

Re: Why are so many built-in types inheritable?

2006-03-25 Thread Fabiano Sidler
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,

Re: Why are so many built-in types inheritable?

2006-03-24 Thread Fabiano Sidler
Hello? Or, is there any obvious reason for this behaviour I don't see? -- http://mail.python.org/mailman/listinfo/python-list

Re: anonymous memory mapping

2006-03-20 Thread Fabiano Sidler
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

Why are so many built-in types inheritable?

2006-03-18 Thread Fabiano Sidler
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

Re: anonymous memory mapping

2006-03-14 Thread Fabiano Sidler
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

Re: anonymous memory mapping

2006-03-13 Thread Fabiano Sidler
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

anonymous memory mapping

2006-03-11 Thread Fabiano Sidler
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

Re: Python Class use

2006-02-07 Thread Fabiano Sidler
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

Re: Using bytecode, not code objects

2006-02-06 Thread Fabiano Sidler
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 --

Using bytecode, not code objects

2006-01-28 Thread Fabiano Sidler
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