[issue8498] Cannot use backlog = 0 for sockets

2011-05-09 Thread Daniel Evers
Changes by Daniel Evers derm...@googlemail.com: Removed file: http://bugs.python.org/file17065/backlog0.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8498

[issue8498] Cannot use backlog = 0 for sockets

2011-05-09 Thread Daniel Evers
Changes by Daniel Evers derm...@googlemail.com: Removed file: http://bugs.python.org/file17066/backlog0_incl_doc.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8498

[issue8498] Cannot use backlog = 0 for sockets

2011-05-09 Thread Daniel Evers
Changes by Daniel Evers derm...@googlemail.com: Removed file: http://bugs.python.org/file17067/socket_listen.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8498

[issue8498] Cannot use backlog = 0 for sockets

2011-05-09 Thread Daniel Evers
Changes by Daniel Evers derm...@googlemail.com: Removed file: http://bugs.python.org/file21851/server.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8498

[issue8498] Cannot use backlog = 0 for sockets

2011-05-09 Thread Daniel Evers
Changes by Daniel Evers derm...@googlemail.com: Removed file: http://bugs.python.org/file21852/client.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8498

[issue8498] Cannot use backlog = 0 for sockets

2011-05-09 Thread Daniel Evers
Changes by Daniel Evers derm...@googlemail.com: Removed file: http://bugs.python.org/file21879/backlog0_complete.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8498

[issue8498] Cannot use backlog = 0 for sockets

2011-05-09 Thread Daniel Evers
Daniel Evers derm...@googlemail.com added the comment: Thanks, I removed the old patches and changed the unit test according to your suggestion. I kept the usually 5 remark, because I'm not sure how reality really looks like. But feel free to suggest a patch ;) -- Added file: http

[issue8498] Cannot use backlog = 0 for sockets

2011-05-04 Thread Daniel Evers
Daniel Evers derm...@googlemail.com added the comment: Thanks for the tip. I added the unit test and uploaded my final patch (which includes all changes). Is it ok to remove the files I uploaded previously? -- Added file: http://bugs.python.org/file21879/backlog0_complete.patch

[issue8498] Cannot use backlog = 0 for sockets

2011-05-02 Thread Daniel Evers
Daniel Evers derm...@googlemail.com added the comment: To revive this issue, I tried to write a unit test to verify the behaviour. Onfurtunately, the test doesn't work and I don't understand why. I hope, someone here is more enlightend than me... (files: server.py, client.py) -- Added

[issue8498] Cannot use backlog = 0 for sockets

2011-05-02 Thread Daniel Evers
Daniel Evers derm...@googlemail.com added the comment: (client.py) -- Added file: http://bugs.python.org/file21852/client.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8498

[issue8498] Cannot use backlog = 0 for sockets

2010-04-24 Thread Daniel Evers
Daniel Evers derm...@googlemail.com added the comment: I attached a patch: The backlog is set to at least 0 instead of 1. I also added a comment that a backlog 0 can lead to problems and doesn't make sense anyway (so if there are systems that may crash with backlog 0 this will be avoided

[issue8498] Cannot use backlog = 0 for sockets

2010-04-24 Thread Daniel Evers
Daniel Evers derm...@googlemail.com added the comment: Ah right ;) Sorry, attached the path incl. the doc string. -- Added file: http://bugs.python.org/file17066/backlog0_incl_doc.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue8498] Cannot use backlog = 0 for sockets

2010-04-24 Thread Daniel Evers
Daniel Evers derm...@googlemail.com added the comment: A second patch for the documentation of socket.listen(). -- Added file: http://bugs.python.org/file17067/socket_listen.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue8498] Cannot use backlog = 0 for sockets

2010-04-22 Thread Daniel Evers
New submission from Daniel Evers derm...@googlemail.com: I'm trying to rewrite a server application in python that accepts exactly 1 connection. I have a previous version written in C that can call listen() on a socket with a backlog of 0 connections, but this is not possible in python

[issue8498] Cannot use backlog = 0 for sockets

2010-04-22 Thread Daniel Evers
Daniel Evers derm...@googlemail.com added the comment: Thanks for your help. I'll close the listen socket. Nevertheless I'd like to understand the check in sock_listen. The commit message is not very helpful, I agree, that's why I wrote this issue. 0 is a valid value, and I'd suggest two ways

Re: How to determine an object is scriptable

2006-03-30 Thread Daniel Evers
Richard Brodie wrote: subscriptable: supports an indexing operator, like a list does. Right. You can check this e.g. with hasattr(x, __getitem__) because the __getitem__ method is used for indexing. Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: What do you use as symbols for Python ?

2005-11-12 Thread Daniel Evers
Peter Otten wrote: You should ditch what follows and instead add just def __iter__(self): return iter(self.__keys) Mhh. I should start learning the builtins ... :) To see the problem with your original code (an object serving as its own iterator) try the

Re: What do you use as symbols for Python ?

2005-11-11 Thread Daniel Evers
Hi! Never would have thought of this... I mixed this with the class-version and created a new class derived from str for easier printing and added an iterator: --- class Enum: class Type(str): def __init__(self, name): self.__name = name

Re: Internal Variables

2005-11-11 Thread Daniel Evers
Hi! The sys module provides some useful information, e.g.: builtin_module_names -- tuple of module names built into this interpreter version -- the version of this interpreter as a string version_info -- version information as a tuple hexversion -- version information encoded as a single integer

Re: iterate over class variables

2005-11-10 Thread Daniel Evers
Hi! You can iterate over the internal dictionary: class Test: ... def __init__(self): ... self.x = 5 ... self.y = 6 ... self.z = Hallo ... x = Test() print x.__dict__ {'y': 6, 'x': 5, 'z': 'Hallo'} for key, value in x.__dict__.items(): ... print

Re: How to convert a number to hex number?

2005-11-08 Thread Daniel Evers
Hi! Try hex: hex(120) '0x78' Consider converting string - int using the int()-function: print int.__doc__ int(x[, base]) - integer Convert a string or number to an integer, if possible. A floating point argument will be truncated towards zero (this does not include a string representation of