Changing UNIX tty driver keys -- Suggested changes to "termios" module

2006-08-07 Thread Derek Peschel
Should I add an RFE to SourceForge too? I'd like a wide audience in case someone has enough experience to comment or is solving the same problem. I'm using the urwid library which uses curses. On my system (Mac OS 10.3.7) I specifically have ncurses. The programs I'm running turn off echoing an

Finding the type of indexing supported by an object?

2006-08-23 Thread Derek Peschel
Here are two functions. def invert_dict_to_lists(dict): lists = {} for key in dict: value = dict[key] if not value in lists: lists[value] = [key] else: lists[value].append(key) return lists def invert_list_to_lists(list): lists = {}

Creating a subpackage of a built-in module?

2006-08-23 Thread Derek Peschel
Can I add my own subpackages to modules that are written in C? I've put /Users/dpeschel/lib/python into my PYTHONPATH variable. Inside there, I've created a termios directory, and inside termios I've created __init__.py and signals.py. Now "import termios.signals" works, but "import termios" only

Re: Finding the type of indexing supported by an object?

2006-08-26 Thread Derek Peschel
In article <[EMAIL PROTECTED]>, Alex Martelli wrote: >Derek Peschel <[EMAIL PROTECTED]> wrote: >> They are the same except for the expression in "for key in ...". Can they >> be combined into one function? How can I determine if the argument is > >Th

Re: Finding the type of indexing supported by an object?

2006-08-26 Thread Derek Peschel
In article <[EMAIL PROTECTED]>, Peter Otten wrote: >Instead of the (unreliable) introspection approach you could let the client >code decide: See my reply to Alex Martelli's post, where I explain my original desire for one function that works with a wide variety of present and future object types