[issue1820] Enhance Object/structseq.c to match namedtuple and tuple api

2008-01-13 Thread Leif Walsh
Leif Walsh added the comment: Here is a patch for #1. I ran make test, and nothing was broken that seemed to be my fault, so I assume it's okay. Yes, it's small, it's my first one here. I'll get to the other two tomorrow. -- nosy: +adlaiff6 Added file: http://bugs.python.org/file9159/

[issue779460] plistlib should be moved out of plat-mac

2008-01-13 Thread surekap
surekap added the comment: Request we reopen this issue since it was marked duplicate of #1565129 and both were closed but the problem was not resolved. plistlib.py did not make it into Python 2.5. -- nosy: +surekap Tracker <[EMAIL PROTECTED]>

[issue1799] Per user site-packages and setup.py install --user patch

2008-01-13 Thread Christian Heimes
Changes by Christian Heimes: Removed file: http://bugs.python.org/file9153/trunk_usersite3.patch __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs-list

[issue1799] Per user site-packages and setup.py install --user patch

2008-01-13 Thread Christian Heimes
Changes by Christian Heimes: Removed file: http://bugs.python.org/file9131/trunk_usersite.patch __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs-list m

[issue1799] Per user site-packages and setup.py install --user patch

2008-01-13 Thread Christian Heimes
Changes by Christian Heimes: Added file: http://bugs.python.org/file9158/trunk_usersite4.patch __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs-list ma

[issue1816] sys.cmd_flags patch

2008-01-13 Thread Christian Heimes
Christian Heimes added the comment: Committed in r59947, r59948 and r59949 -- resolution: -> fixed status: open -> closed __ Tracker <[EMAIL PROTECTED]> __ ___

[issue1820] Enhance Object/structseq.c to match namedtuple and tuple api

2008-01-13 Thread Christian Heimes
New submission from Christian Heimes: Raymond Hettinger wrote: Here's a couple more if you want to proceed down that path: 1. Have structseq subclass from PyTupleObject so that isinstance(s, tuple) returns True. This makes the object usable whenever tuples are needed. 2. Add _fields, _asdict

[issue1816] sys.cmd_flags patch

2008-01-13 Thread Guido van Rossum
Guido van Rossum added the comment: Nice -- perhaps you can make it look like a function call, posix.stat_result(st_mode=..., ...)? (Then someone else might finally create a constructor with such a signature. :-) __ Tracker <[EMAIL PROTECTED]>

[issue1682] Move Demo/classes/Rat.py to Lib/rational.py and fix it up.

2008-01-13 Thread Mark Dickinson
Mark Dickinson added the comment: Just had a quick look at numbers.py. Only two comments: 1. I think there's a typo in the docstring for Inexact: one of those == should be a != 2. Not that it really matters now, but note that at least for Decimal, x-y is not the same as x+(-y) (I'm looki

[issue1771] Remove cmp parameter to list.sort() and builtin.sorted()

2008-01-13 Thread Guido van Rossum
Guido van Rossum added the comment: Cool! Doesn't it feel good to rip out stuff? :-) I do hope that you'll make sure all tests pass (-uall) before submitting this. __ Tracker <[EMAIL PROTECTED]>

[issue1682] Move Demo/classes/Rat.py to Lib/rational.py and fix it up.

2008-01-13 Thread Mark Dickinson
Mark Dickinson added the comment: The latest version of rational.py looks good to me---nice work! (I haven't looked properly at numbers.py or test_rational.py, yet. I do plan to, eventually.) I do think it's important to be able to create Rational instances from strings: e.g., for easy re

[issue1799] Per user site-packages and setup.py install --user patch

2008-01-13 Thread Gregory P. Smith
Gregory P. Smith added the comment: nice. ping a mac developer for what to do with the darwin stuff that you commented out. It'd also be nice to have unit tests for the new behavior. Though i don't think we have many (any?) of that type of regression test right now. Such a test would need to

[issue1819] Speed hack for function calls with named parameters

2008-01-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: Another quick test: # With patch $ ./python -m timeit -s "d=dict(a=1,b=2,c=3,d=4,e=5);f = lambda a,b,c,d,e:0" "f(**d)" 100 loops, best of 3: 0.727 usec per loop $ ./python -m timeit -s "d=dict(b=2,c=3,d=4,e=5);f = lambda a,b,c,d,e:0" "f(a=1,**d)" 100 loo

[issue1700288] Armin's method cache optimization updated for Python 2.6

2008-01-13 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: For the record: It is very wrong to call self->ob_type->tp_base's slot: slots are often copied from their base class, and you get infinite recursion. Calling StructType.tp_base->tp_setattro is much better. _ Tracker <[EM

[issue1819] Speed hack for function calls with named parameters

2008-01-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: Sorry, my editor indents with spaces by default. Attaching a fixed patch with tabs. No, it is independent from #1479611 (and much simpler). Added file: http://bugs.python.org/file9157/namedparam.patch __ Tracker <[EMAIL PROTECTE

[issue1819] Speed hack for function calls with named parameters

2008-01-13 Thread Christian Heimes
Christian Heimes added the comment: Nice! Is this somehow related to #1479611? The formatting of the code looks kinda strange. Have you mixed tabs and spaces? -- assignee: -> gvanrossum keywords: +patch nosy: +gvanrossum, tiran priority: -> high __ Tra

[issue1819] Speed hack for function calls with named parameters

2008-01-13 Thread Antoine Pitrou
Changes by Antoine Pitrou: -- type: -> rfe __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pytho

[issue1819] Speed hack for function calls with named parameters

2008-01-13 Thread Antoine Pitrou
New submission from Antoine Pitrou: This is a patch for SVN trunk which substantially speeds up function calls with named parameters. It does so by taking into account that parameter names should be interned, so before doing full compares we do a first quick loop to compare pointers. On a microb

[issue1252] IDLE - patch Delegator to support callables

2008-01-13 Thread Kurt B. Kaiser
Changes by Kurt B. Kaiser: -- resolution: -> rejected status: open -> closed __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs-list mailing lis

[issue1794] Hot keys must work in any keyboard layout

2008-01-13 Thread Kurt B. Kaiser
Changes by Kurt B. Kaiser: -- nosy: +kbk __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.o

[issue1771] Remove cmp parameter to list.sort() and builtin.sorted()

2008-01-13 Thread Raymond Hettinger
Raymond Hettinger added the comment: Patch attached for the C files making them much cleaner and a bit faster. Still needs the related tests to be deleted and the docs updated. Added file: http://bugs.python.org/file9155/nocmp.diff __ Tracker <[EMAIL PROTECTED]

[issue1700288] Armin's method cache optimization updated for Python 2.6

2008-01-13 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: OK, I apply first my 2 lines, then the original patch. _ Tracker <[EMAIL PROTECTED]> _ ___ Python-bugs

[issue1700288] Armin's method cache optimization updated for Python 2.6

2008-01-13 Thread Raymond Hettinger
Raymond Hettinger added the comment: Nice analysis. Please apply. _ Tracker <[EMAIL PROTECTED]> _ ___ Python-bugs-list mailing list Unsubscr

[issue1700288] Armin's method cache optimization updated for Python 2.6

2008-01-13 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: After some debug work, I found an explanation: - The attribute "name" is the name of a type slot. So it becomes cached during the type construction. - in function ctypes/_ctypes.c::StructUnionType_new(), the type's __dict__ is replaced by a "stgdict". - thi

[issue1019] Cleanup pass on _curses and _curses_panel

2008-01-13 Thread A.M. Kuchling
Changes by A.M. Kuchling: -- assignee: akuchling -> __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs-list mailing list Unsubscribe: http://m

[issue1743] IDLE fails to launch

2008-01-13 Thread Kurt B. Kaiser
Kurt B. Kaiser added the comment: 1. Could you look at the properties of the .idlerc\recent-files.lst that you saved and compare them to the new file which worked? In particular, what about access permissions? 2. I agree that IDLE should have a better error response if opening a user config

[issue1479611] speed up function calls

2008-01-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: Here is a patch applicable for SVN trunk. However, as Bob I have mixed results on this. For example, functions with variable parameter count have become slower: # With patch $ ./python -m timeit -s "def f(*x): pass" 'for x in xrange(1): f(1)' 100 loops, best

[issue1799] Per user site-packages and setup.py install --user patch

2008-01-13 Thread Christian Heimes
Christian Heimes added the comment: The new patch adds the -s option, checks for getuid() == geteuid() and adds sys.flags (see #1816). Added file: http://bugs.python.org/file9153/trunk_usersite3.patch __ Tracker <[EMAIL PROTECTED]>

[issue1682] Move Demo/classes/Rat.py to Lib/rational.py and fix it up.

2008-01-13 Thread Jeffrey Yasskin
Jeffrey Yasskin added the comment: _binary_float_to_ratio: Oops, fixed. Rational() now equals 0, but I'd like to postpone Rational('3/2') until there's a demonstrated need. I don't think it's as common a use as int('3'), and there's more than one possible format, so some real world experience wi

[issue1816] sys.cmd_flags patch

2008-01-13 Thread Christian Heimes
Christian Heimes added the comment: Does anybody see a problem with this repr slot implementation for structseq? It gives this output: >>> os.stat(".") static PyObject * structseq_repr(PyStructSequence *obj) { PyObject *tup, *val, *repr; PyTypeObject *typ = Py_TYPE(obj);

[issue923643] long <-> byte-string conversion

2008-01-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: Unless I'm mistaken, the patch provides only half of the solution: the stringToLong part, but not longToString. I agree this feature is interesting, not for optimization but becomes it avoids using clunky ways (long -> hex -> bin) to implement something simple. H

[issue1771] Remove cmp parameter to list.sort() and builtin.sorted()

2008-01-13 Thread Raymond Hettinger
Raymond Hettinger added the comment: Let's do this. It is a nice simplification and makes the sort tools easier to learn and use. -- assignee: -> rhettinger resolution: -> accepted __ Tracker <[EMAIL PROTECTED]> _

[issue1818] Add named tuple reader to CSV module

2008-01-13 Thread Raymond Hettinger
New submission from Raymond Hettinger: Here's a proof-of-concept patch. If approved, will change from generator form to match the other readers and will add a test suite. The idea corresponds to what is currently done by the dict reader but returns a space and time efficient named tuple instead

[issue1778] SyntaxError.offset sometimes wrong

2008-01-13 Thread Achim Gaedke
Achim Gaedke added the comment: sometimes offset is None... Example: def blub(bla, blub=None, blabla): bla causes: non-default argument follows default argument Added file: http://bugs.python.org/file9150/compile_test.py __ Tracker <[EMAIL PROTECTED]>

[issue1816] sys.cmd_flags patch

2008-01-13 Thread Christian Heimes
Christian Heimes added the comment: I've coded sys.flags for my per-user site-packages PEP. I could make it a function but the function would be called by site.py on every startup. __ Tracker <[EMAIL PROTECTED]> _

Re: [issue1816] sys.cmd_flags patch

2008-01-13 Thread Brett Cannon
On Jan 13, 2008 9:45 AM, Christian Heimes <[EMAIL PROTECTED]> wrote: > > Christian Heimes added the comment: > > Guido van Rossum wrote: > > Can't you use a namedtuple? Then printing it would show the names of > > the flags... > > ... and increase the startup costs of Python by loading several > a

[issue1816] sys.cmd_flags patch

2008-01-13 Thread Guido van Rossum
Guido van Rossum added the comment: > I'd rather see a better repr function for the > sequence types. Agreed. It's kind of unfortunate that we have two implementations for the same concept, one in C and one in Python. __ Tracker <[EMAIL PROTECTED]>

[issue1816] sys.cmd_flags patch

2008-01-13 Thread Christian Heimes
Christian Heimes added the comment: Guido van Rossum wrote: > Can't you use a namedtuple? Then printing it would show the names of > the flags... ... and increase the startup costs of Python by loading several additional modules. The collections module imports _collections, operator and keyword

[issue1814] Victor Stinner's GMP patch for longs

2008-01-13 Thread Guido van Rossum
Guido van Rossum added the comment: I don't recall, but I suppose it had stopped working and nobody could be found who wanted to maintain it. Possibly the Python-unfriendly license was also a reason. __ Tracker <[EMAIL PROTECTED]>

[issue1816] sys.cmd_flags patch

2008-01-13 Thread Guido van Rossum
Guido van Rossum added the comment: Can't you use a namedtuple? Then printing it would show the names of the flags... __ Tracker <[EMAIL PROTECTED]> __

[issue1814] Victor Stinner's GMP patch for longs

2008-01-13 Thread Christian Heimes
Christian Heimes added the comment: Why was the mpz module removed from Python 2.4 in the first place? 2.3 has it. I see three way to implement the option: * Let somebody implement a mpz type as a 3rd party extension. * Let somebody implement a mpt type and ship it with the Python core * Le

[issue1700288] Armin's method cache optimization updated for Python 2.6

2008-01-13 Thread Kevin Jacobs
Kevin Jacobs added the comment: Couldn't resist looking into this more and I must admit that I am a bit stumped. If instead of returning a value from the cache fast path in _PyType_Lookup, I modified the code to store the value and assert that it matches with the non-cached result from traversin

[issue1472] Small bat files to build docs on Windows

2008-01-13 Thread Georg Brandl
Georg Brandl added the comment: FTR, I'm currently removing all 2.5isms from Sphinx. __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs-list mailing list

[issue1700288] Armin's method cache optimization updated for Python 2.6

2008-01-13 Thread Kevin Jacobs
Kevin Jacobs added the comment: All tests passed when I first ported Armin's patch to 2.6. I'll have a chance to look into this later in the week. If anyone gets to it first, please summarize your findings here to avoid duplication of effort. _ Tracker <[EMA

[issue1700288] Armin's method cache optimization updated for Python 2.6

2008-01-13 Thread Georg Brandl
Georg Brandl added the comment: Backed out again in r59940 -- test_ctypes fails in test_incomplete.py. Armin reports that with his original patch on 2.4, this test passes. _ Tracker <[EMAIL PROTECTED]> ___

[issue1367711] Remove usage of UserDict from os.py

2008-01-13 Thread Andrew Dalke
Andrew Dalke added the comment: Ahh, so the bug here that the environ dict should use neither UserDict nor dict, it should implement the core {get,set,del}item and keys and use DictMixin. Martin mentioned that the patch doesn't support setdefault. He didn't note though that the current code

[issue1550] help('modules') broken by several 3rd party libraries (svn patch attached)

2008-01-13 Thread Ka-Ping Yee
Ka-Ping Yee added the comment: Committed the patch in revision 59939. I'm not clear how it was determined that importing every module was necessary in order to list the modules or scan their synopsis lines (this seems to have happened in revision 45510). This can probably be made more efficient

[issue1816] sys.cmd_flags patch

2008-01-13 Thread Christian Heimes
Christian Heimes added the comment: The new patch is using a struct sequence (like the result of os.stat): >>> import sys >>> sys.flags >>> dir(sys.flags) ['__add__', '__class__', '__contains__', '__delattr__', '__doc__', '__eq__', '__ge__', '__getattribute__', '__getitem__', '__getslice__', '_