Hello,
Is the following code supposed to be an UnboundLocalError?
Currently it assigns the value 'bar' to the attribute baz.foo
foo = 'bar'
class baz:
foo = foo
--
http://mail.python.org/mailman/listinfo/python-list
On 15/07/13 09:13 AM, Joshua Landau wrote:
On 15 July 2013 16:50, Jack Bates wrote:
Hello,
Is the following code supposed to be an UnboundLocalError?
Currently it assigns the value 'bar' to the attribute baz.foo
foo = 'bar'
class baz:
foo = foo
If so,
How can you get a descriptor to return an identical value, each time
it's called with the same "instance" - without leaking memory?
#!/usr/bin/env python
class descriptor:
class __metaclass__(type):
def __get__(self, instance, owner):
...
class owner:
descriptor = descriptor
inst
I have two objects, and I want to replace all references to the first
object - everywhere - with references to the second object. What can I
try?
--
http://mail.python.org/mailman/listinfo/python-list
I wrote a content filter for Postfix with Python,
https://github.com/jablko/cookie
It should get started once, and hopefully run for a long time - so I'm
interested in how it uses memory:
1) How does the amount of memory used change as it runs?
2) How does the amount of memory used change as I
In Python, how can you reliably call code - but wait until an object no
longer exists or is "unreachable"?
I want to ensure that some code is called (excluding some exotic
situations like when the program is killed by a signal not handled by
Python) but can't call it immediately. I want to wait un
Hi, anyone know why these two statements aren't equivalent?
raise (type, value, traceback)
raise type, value, traceback
--
http://mail.python.org/mailman/listinfo/python-list
Can anyone suggest a way to get a pair of file descriptor numbers such
that data written to one can be read from the other and vice versa?
Is there anything like os.pipe() where you can read/write both ends?
Thanks!
--
http://mail.python.org/mailman/listinfo/python-list
On Wed, Aug 14, 2013 at 01:17:40AM +0100, Rhodri James wrote:
> On Wed, 14 Aug 2013 00:10:41 +0100, Jack Bates
> wrote:
>
> > Can anyone suggest a way to get a pair of file descriptor numbers such
> > that data written to one can be read from the other and vice ve
On Wed, Aug 14, 2013 at 01:55:38AM +0100, Chris Angelico wrote:
> On Wed, Aug 14, 2013 at 1:17 AM, Rhodri James
> wrote:
> > On Wed, 14 Aug 2013 00:10:41 +0100, Jack Bates
> > wrote:
> >
> >> Can anyone suggest a way to get a pair of file descriptor numbers such
On Wed, Aug 14, 2013 at 08:34:36AM +, Antoine Pitrou wrote:
> Nobody nowhere.com> writes:
> > On Tue, 13 Aug 2013 16:10:41 -0700, Jack Bates wrote:
> > > Is there anything like os.pipe() where you can read/write both ends?
> >
> > There's socket.socketp
How do you pass a Python buffer() value as an argument to a ctypes
function, which expects a c_void_p argument? I keep getting TypeError:
ctypes.ArgumentError: argument 2: : wrong type
--
http://mail.python.org/mailman/listinfo/python-list
Why is the following ImportError raised?
$ ./test
Traceback (most recent call last):
File "./test", line 3, in
from foo import dns
File "/home/jablko/foo/dns.py", line 1, in
from foo import udp
File "/home/jablko/foo/udp.py", line 1, in
from foo import dns
ImportError: cannot
> It is a circular dependency. Dns will try to import udp which will in turn
> import dns (again) in an endless cycle; instead an ImportError is raised.
>
> Circular dependency is a Bad Thing.
According to this documentation:
http://docs.python.org/reference/simple_stmts.html#grammar-token-impor
Am struggling to understand Python method-to-instance binding
Anyone know why this example throws a TypeError?
> #!/usr/bin/env python
>
> import functools
>
> # Take a generator function (i.e. a callable which returns a generator) and
> # return a callable which calls .send()
> class coroutine
15 matches
Mail list logo