Re: [Python-Dev] Time for a change of random number generator?

2016-02-12 Thread Robert Kern
in PCG and Random123 too ;-) Quite so! -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco

Re: [Python-Dev] Time for a change of random number generator?

2016-02-11 Thread Robert Kern
(all?) relevant dimensions. http://xorshift.di.unimi.it/ I'm favorable to the PCG family these days, though xorshift* and Random123 are reasonable alternatives. http://www.pcg-random.org/ https://www.deshawresearch.com/resources_random123.html -- Robert Kern "I have come to b

Re: [Python-Dev] pep8 reasoning

2014-04-24 Thread Robert Kern
s or the analysis, and it isn't really germane to Chris' historical question. I mention it only because I had just run across this paper last night, so it was fresh in my mind when you mentioned studies on the subject. -- Robert Kern "I have come to believe that the whole world

Re: [Python-Dev] PEP 465: A dedicated infix operator for matrix multiplication

2014-04-09 Thread Robert Kern
t was written, and I personally witnessed all of the history myself so I don't need it repeated back to me. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an u

Re: [Python-Dev] PEP 465: A dedicated infix operator for matrix multiplication

2014-04-07 Thread Robert Kern
ject o2) not a pointer to PyObject? Typo, I'm fairly certain. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying

Re: [Python-Dev] python 3 niggle: None < 1 raises TypeError

2014-02-18 Thread Robert Kern
l(x, y, Py_EQ) treats identical objects as equal. http://hg.python.org/cpython/file/79e5bb0d9b8e/Objects/object.c#l716 -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though i

Re: [Python-Dev] potential argparse problem: bad mix of parse_known_args and prefix matching

2013-11-26 Thread Robert Kern
-- ./child_script.py --no-verbose --etc This is a common idiom across many argument processors. parse_known_args() is not a good solution for this situation even if you mitigate the prefix issue. Exact matches of --options are still possible. -- Robert Kern "I have come to believe that t

Re: [Python-Dev] Clean way in python to test for None, empty, scalar, and list/ndarray? A prayer to the gods of Python

2013-06-14 Thread Robert Kern
On 2013-06-14 23:31, Robert Kern wrote: On 2013-06-14 21:55, R. David Murray wrote: On Fri, 14 Jun 2013 21:12:00 +0200, Martin Schultz wrote: 2. Testing for empty lists or empty ndarrays: In principle, `len(x) == 0` will do the trick. **BUT** there are several caveats here: - `len

Re: [Python-Dev] Clean way in python to test for None, empty, scalar, and list/ndarray? A prayer to the gods of Python

2013-06-14 Thread Robert Kern
(rarer still is testing for emptiness not knowing if it is an array or some other sequence). What people usually want from bool(some_array) is either some_array.all() or some_array.any(). In the face of this ambiguity, numpy refuses the temptation to guess and raises an exception explaining matt

Re: [Python-Dev] Clean way in python to test for None, empty, scalar, and list/ndarray? A prayer to the gods of Python

2013-06-14 Thread Robert Kern
4, 0), dtype=float64) [~] |5> np.empty([3,4,0])[1] array([], shape=(4, 0), dtype=float64) [~] |6> len(np.empty([3,4,0])) 3 -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret

Re: [Python-Dev] __subclasses__() return order

2013-05-25 Thread Robert Kern
predictable. I have never seen __subclasses__ actually used in production code, so I'm wondering whether someone might be affected by such a change. I do use a package that does use __subclasses__ in production code, but the order is unimportant. -- Robert Kern "I have come to believ

Re: [Python-Dev] Semantics of __int__(), __index__()

2013-04-03 Thread Robert Kern
projects would be making use of this ability already -- just think of uses for numpy's subclasses of "float". We don't. [~] |1> type(float(np.float64(1.0))) float [~] |2> type(int(np.int32(1))) int -- Robert Kern "I have come to believe that the whole world is an

Re: [Python-Dev] VC++ 2008 Express Edition now locked away?

2013-03-06 Thread Robert Kern
mean that they have given you permission to redistribute it. If the agreements that you have with the copyright owner do not mention redistribution, you do not have permission to redistribute it. IANAL, TINLA. -- Robert Kern "I have come to believe that the whole world is an enigma, a har

Re: [Python-Dev] PEP czar for PEP 3144?

2012-02-21 Thread Robert Kern
s revived, mostly by the press, to describe officials in the Nixon and Ford administrations and continues today. """ http://en.wikipedia.org/wiki/List_of_U.S._executive_branch_%27czars%27 -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma th

Re: [Python-Dev] requirements for moving __import__ over to importlib?

2012-02-09 Thread Robert Kern
this is a problem with "stat calls"? All he said is that reading about that problem and its solution gave him an idea about dealing with stat call overhead. The cost of stat calls has demonstrated itself to be a significant problem in other, more typical contexts. -- Robert Kern &qu

Re: [Python-Dev] readd u'' literal support in 3.3?

2011-12-08 Thread Robert Kern
n, yes, they are probably mostly using 90+. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco

Re: [Python-Dev] Not-a-Number

2011-04-29 Thread Robert Kern
On Fri, Apr 29, 2011 at 11:35, Alexander Belopolsky wrote: > On Fri, Apr 29, 2011 at 11:31 AM, Robert Kern wrote: > .. >> And in fact, 0.0/0.0 is covered by the more general rule that x/0.0 raises >> ZeroDivisionError, not a rule that converts IEEE-754 INVALID excepti

Re: [Python-Dev] Not-a-Number

2011-04-29 Thread Robert Kern
On 4/29/11 1:35 AM, Nick Coghlan wrote: On Fri, Apr 29, 2011 at 3:28 PM, Steven D'Aprano wrote: Robert Kern wrote: Actually, Python treats all NaNs as quiet NaNs and never signalling NaNs. Sorry, did I get that backwards? I thought it was signalling NANs that cause a signal (in Python

Re: [Python-Dev] Not-a-Number

2011-04-28 Thread Robert Kern
this helps anyone. Actually, Python treats all NaNs as quiet NaNs and never signalling NaNs. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth.&qu

Re: [Python-Dev] PyObject_RichCompareBool identity shortcut

2011-04-28 Thread Robert Kern
of inputs and "confirm" their guess as to the general rule from that. But your point stands, numpy arrays cannot be members of sets or keys of dicts or orderable/"in-able" elements of lists. -- Robert Kern "I have come to believe that the whole world is an enigma, a

Re: [Python-Dev] PyObject_RichCompareBool identity shortcut

2011-04-28 Thread Robert Kern
On 4/28/11 11:55 AM, Guido van Rossum wrote: On Thu, Apr 28, 2011 at 8:52 AM, Robert Kern wrote: Smaller, certainly. But now it's a trilemma. :-) 1. Have just np.float64 and np.complex128 scalars follow the Python float semantics since they subclass Python float and complex, respective

Re: [Python-Dev] the role of assert in the standard library ?

2011-04-28 Thread Robert Kern
do states. Some bugs only show up under -O, so you ought to be running your test suite under -O, too. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying trut

Re: [Python-Dev] PyObject_RichCompareBool identity shortcut

2011-04-28 Thread Robert Kern
On 4/28/11 12:37 AM, Alexander Belopolsky wrote: On Thu, Apr 28, 2011 at 12:33 AM, Robert Kern wrote: On 2011-04-27 23:24 , Guido van Rossum wrote: .. So do new masks get created when the outcome of an elementwise operation is a NaN? No. Yes. from MA import array print array([0])/array

Re: [Python-Dev] PyObject_RichCompareBool identity shortcut

2011-04-28 Thread Robert Kern
On 4/27/11 11:54 PM, Guido van Rossum wrote: On Wed, Apr 27, 2011 at 9:25 PM, Robert Kern wrote: On 2011-04-27 23:01 , Guido van Rossum wrote: And I wouldn't want to change that. It sounds like NumPy wouldn't be much affected if we were to change this (which I'm not saying we

Re: [Python-Dev] PyObject_RichCompareBool identity shortcut

2011-04-27 Thread Robert Kern
On 2011-04-27 23:24 , Guido van Rossum wrote: On Wed, Apr 27, 2011 at 9:15 PM, Alexander Belopolsky wrote: On Wed, Apr 27, 2011 at 2:48 PM, Robert Kern wrote: .. I suspect most of us would oppose changing it on general backwards-compatibility grounds rather than actually *liking* the

Re: [Python-Dev] PyObject_RichCompareBool identity shortcut

2011-04-27 Thread Robert Kern
On 2011-04-27 23:01 , Guido van Rossum wrote: On Wed, Apr 27, 2011 at 8:42 PM, Robert Kern wrote: But for dtype=float arrays (which contain C doubles, not Python objects) we use C semantics. Literally, we use whatever C's == operator gives us for the two double values. Since there

Re: [Python-Dev] PyObject_RichCompareBool identity shortcut

2011-04-27 Thread Robert Kern
On 2011-04-27 22:16 , Guido van Rossum wrote: On Wed, Apr 27, 2011 at 11:48 AM, Robert Kern wrote: On 4/27/11 12:44 PM, Terry Reedy wrote: On 4/27/2011 10:53 AM, Guido van Rossum wrote: Maybe we should just call off the odd NaN comparison behavior? Eiffel seems to have survived, though

Re: [Python-Dev] PyObject_RichCompareBool identity shortcut

2011-04-27 Thread Robert Kern
s an array, not a bool, so we can't do containment tests for lists of arrays), so NaN is pretty easy to explain afterward. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it

Re: [Python-Dev] public visibility of python-dev decisions "before it's too late" (was: PyCObject_AsVoidPtr removed from python 3.2 - is this documented?)

2011-03-15 Thread Robert Kern
numpy/npy_3kcompat.h#L299 -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco ___ Pyth

Re: [Python-Dev] Using logging in the stdlib and its unit tests

2010-12-12 Thread Robert Kern
On 2010-12-12 21:30 , Nick Coghlan wrote: On Mon, Dec 13, 2010 at 11:22 AM, Robert Kern wrote: level = getattr(logging, opt.logLevel) While this is the approach I would recommend, it does have a couple of downsides: 1. An upper() call is also needed to allow strings like "info"

Re: [Python-Dev] Using logging in the stdlib and its unit tests

2010-12-12 Thread Robert Kern
gging, opt.logLevel) or level = logging._levelNames[opt.logLevel] -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth."

Re: [Python-Dev] Using logging in the stdlib and its unit tests

2010-12-08 Thread Robert Kern
es them further. :-) On 12/8/10 11:43 AM, Vinay Sajip wrote: Robert Kern gmail.com> writes: I don't think the warning helps much, if at all. Perhaps not. I'm not so hung up on the importance of the message now, but it certainly *was* important when logging was first introduced,

Re: [Python-Dev] Using logging in the stdlib and its unit tests

2010-12-08 Thread Robert Kern
On 12/8/10 2:51 AM, Vinay Sajip wrote: Robert Kern gmail.com> writes: I really don't understand how this view can be consistent with the practice of adding NullHandler to loggers. If this message is so important to prevent misconfiguration, then why should a library author decide to

Re: [Python-Dev] Using logging in the stdlib and its unit tests

2010-12-07 Thread Robert Kern
On 2010-12-07 17:58 , Vinay Sajip wrote: Robert Kern gmail.com> writes: If I had my druthers, I would simply remove the "No handlers could be found for logger XXX" message. If we always wrote entire applications from the ground up, it makes a lot of sense. The person that wr

Re: [Python-Dev] Using logging in the stdlib and its unit tests

2010-12-07 Thread Robert Kern
On 12/7/10 4:59 PM, Robert Kern wrote: On 12/7/10 2:26 PM, Vinay Sajip wrote: This issue was brought to my notice today: http://bugs.python.org/issue10626 and reference was made in the comments to possible obstacles facing stdlib maintainers who might wish to use logging in the stdlib and in

Re: [Python-Dev] Using logging in the stdlib and its unit tests

2010-12-07 Thread Robert Kern
or him to add logging to his application. This is only my personal anecdotal experience, but the current behavior has always wasted my time and never saved any of my time. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our

Re: [Python-Dev] __setcall__

2010-10-26 Thread Robert Kern
u are trying to emulate does. It looks like it is building up a list of values, not defining a function. If you take your question over to python-list, I can explain more. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by

Re: [Python-Dev] We should be using a tool for code reviews

2010-09-29 Thread Robert Kern
ial checkout happens to be slower, but I don't know whose fault that is. I'm still using Mercurial 1.5.1 on my OS X box, and while I wasn't doing much that would take up CPU or bandwidth, I wasn't trying especially hard to prevent such interference, either. -- Robert Kern

Re: [Python-Dev] query: docstring formatting in python distutils code

2010-07-07 Thread Robert Kern
thing about Sphinx's docstring extraction features in contrast with other such tools. It doesn't generate a manual from the docstrings; it makes you explicitly reference the docstrings into the manual's text. This would fit in very naturally with Python's library reference. -- Rober

Re: [Python-Dev] what to do if you don't want your module in Debian

2010-04-26 Thread Robert Kern
the appropriate /usr/shared/ subdirectory. Writing portable libraries (with portable setup.py files!) is difficult to do that way, though. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpre

Re: [Python-Dev] Why is nan != nan?

2010-03-29 Thread Robert Kern
On 2010-03-29 01:17 AM, David Cournapeau wrote: On Sun, Mar 28, 2010 at 9:28 AM, Robert Kern wrote: On 2010-03-27 00:32 , David Cournapeau wrote: On Sat, Mar 27, 2010 at 8:16 AM, Raymond Hettinger wrote: On Mar 26, 2010, at 2:16 PM, Xavier Morel wrote: How about raising an exception

Re: [Python-Dev] Why is nan != nan?

2010-03-27 Thread Robert Kern
and other such methods. They do not, and should not, know about isnan(). -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying trut

Re: [Python-Dev] Why is nan != nan?

2010-03-27 Thread Robert Kern
. We can control whether invalid operations raises an exception or not, we had isnan/isfinite for a long time, and the fact that nan != nan has never been a real problem AFAIK. Nonetheless, the closer our float arrays are to Python's float type, the happier I will be. -- Robert Kern &q

Re: [Python-Dev] Decimal <-> float comparisons in py3k.

2010-03-18 Thread Robert Kern
Not at all. This is quite incorrect for most use cases. Fuzzy comparisons are sometimes useful for equality testing, but almost never for ordering. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt t

Re: [Python-Dev] argparse ugliness

2010-03-09 Thread Robert Kern
On Tue, Mar 9, 2010 at 11:31, R. David Murray wrote: > On Mon, 08 Mar 2010 15:35:46 -0600, Robert Kern wrote: >> On 2010-03-08 15:20 PM, Greg Ewing wrote: >> > Mark Russell wrote: >> >> Boolean flags are a common enough case that I'd be inc

Re: [Python-Dev] argparse ugliness

2010-03-08 Thread Robert Kern
d spelling add_flag(): http://code.google.com/p/argparse/issues/detail?id=62 -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying

Re: [Python-Dev] setUpClass and setUpModule in unittest

2010-02-11 Thread Robert Kern
On 2010-02-11 17:57 PM, Holger Krekel wrote: On Fri, Feb 12, 2010 at 12:00 AM, Robert Kern wrote: On 2010-02-11 16:20 PM, Ben Finney wrote: Guido van Rossumwrites: The argument that a unittest framework shouldn't be "abused" for regression tests (or integration tests,

Re: [Python-Dev] setUpClass and setUpModule in unittest

2010-02-11 Thread Robert Kern
the latter kinds of tests also could use setUpClass/setUpModule. It would be a waste (and honestly kind of ridiculous) to force people to use a whole new framework (which would duplicate unittest in almost its entirety) for want of those two methods. -- Robert Kern "I have come to

Re: [Python-Dev] setUpClass and setUpModule in unittest

2010-02-09 Thread Robert Kern
other kinds of tests). nosetests allows you to write such module-level and class-level setup and teardown functions. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had

Re: [Python-Dev] Modules that run other scripts

2009-11-14 Thread Robert Kern
version of coverage: http://bitbucket.org/ned/coveragepy/src/tip/coverage/execfile.py -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying

Re: [Python-Dev] PyPI comments and ratings, *really*?

2009-11-13 Thread Robert Kern
ages, let them use the services that already exist for *just* that purpose like Ohloh. They have the time and energy to implement these mechanisms with the care and attention that they need. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless

Re: [Python-Dev] PyPI comments and ratings, *really*?

2009-11-12 Thread Robert Kern
e time for word of the poll to propagate through Twitter, blogs, etc. You should also make an announcement on python-announce. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though i

Re: [Python-Dev] decimal.py: == and != comparisons involving NaNs

2009-11-08 Thread Robert Kern
It is a common expectation, but a false one. __eq__ and __ne__ are explicitly allowed to return anything, not just bools. http://www.python.org/dev/peps/pep-0207/ -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own m

Re: [Python-Dev] Refactoring installation schemes

2009-11-05 Thread Robert Kern
ns, open source projects don't really "assign" work. If you want to help, help. Don't wait for someone to tell you exactly what to do. No one will. Go to the tracker, find something interesting, and do it. -- Robert Kern "I have come to believe that the whole world is an

Re: [Python-Dev] Backport new float repr to Python 2.7?

2009-10-11 Thread Robert Kern
ines which give different doctest results on different platforms. Using a consistent routine would actually improve the ability to use doctests in that one regard. It certainly would make writing examples much more consistent, particularly for those of us that use infs and nans frequently. -- Robert Ker

Re: [Python-Dev] PEP 389: argparse - new command line parsing module

2009-10-03 Thread Robert Kern
e case, as mentioned earlier, was for debugging your parser on the interactive prompt. A custom subclass may also be able to hold more machine-readable information about the error than the formatted error message, but I don't have any particular use cases about what may be the most useful. --

Re: [Python-Dev] PEP 389: argparse - new command line parsing module

2009-09-30 Thread Robert Kern
capsulated in the _SubparsersAction class. You can register a new class for it: parser.register('action', 'parsers', MySubParsersAction) -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own ma

Re: [Python-Dev] PEP 389: argparse - new command line parsing module

2009-09-30 Thread Robert Kern
://argparse.googlecode.com/svn/tags/r101/doc/other-methods.html#sub-commands -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco

Re: [Python-Dev] PEP 389: argparse - new command line parsing module

2009-09-30 Thread Robert Kern
grams that use wxPython and PyQt on Windows that print to stdout/stderr, and they appear to work fine. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had

Re: [Python-Dev] PEP 389: argparse - new command line parsing module

2009-09-28 Thread Robert Kern
his role for optparse. It might be straightforward to port it to argparse. http://cfgparse.sourceforge.net/ -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an under

Re: [Python-Dev] deleting setdefaultencoding iin site.py is evil

2009-08-25 Thread Robert Kern
On 2009-08-25 13:29 PM, Guido van Rossum wrote: On Tue, Aug 25, 2009 at 11:10 AM, Robert Kern wrote: On 2009-08-25 12:37 PM, Guido van Rossum wrote: In retrospect, it should have been called sys._setdefaultencoding(). That sends an extra signal that it's not meant for genera

Re: [Python-Dev] deleting setdefaultencoding iin site.py is evil

2009-08-25 Thread Robert Kern
f the function than the current situation. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth."

Re: [Python-Dev] Update to Python Documentation Website Request

2009-07-25 Thread Robert Kern
ation is Lib/distutils within the standard library. He said "docutils", not "distutils". -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though

Re: [Python-Dev] syntax warnings don't go through warnings.warn?

2009-06-01 Thread Robert Kern
line number information. You need to stub warnings.warn_explicit(). >>> import warnings >>> def mywarn_explicit(*args): ... print 'xx', args ... >>> warnings.warn_explicit = mywarn_explicit >>> compile("def f():\n a = 1\n global a\n", "",

Re: [Python-Dev] Indentation oddness...

2009-06-01 Thread Robert Kern
On 2009-05-30 21:02, Greg Ewing wrote: Robert Kern wrote: The 'single' mode, which is used for the REPL, is a bit different than 'exec', which is used for modules. This difference lets you insert "blank" lines of whitespace into a function definition without exit

Re: [Python-Dev] Indentation oddness...

2009-05-29 Thread Robert Kern
lets you insert "blank" lines of whitespace into a function definition without exiting the definition. Ending with a truly empty line does not cause the IndentationError, so the REPL can successfully compile the code, signaling that the user has finished typing the function. -- Robert K

Re: [Python-Dev] Easy way to detect filesystem case-sensitivity?

2009-05-07 Thread Robert Kern
ystem-wide boolean somewhere. One would have to query the target directory for this information. I am not aware of the existence of code that does such a query, though. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our

Re: [Python-Dev] Issue5434: datetime.monthdelta

2009-04-17 Thread Robert Kern
dateutil seems like another possibility. That would guarantee an instant user base. From there, if it is found to be useful it could make the leap to be part of the datetime module. dateutil.relativedelta appears to do everything monthdelta does and more in a general way. Adding monthdelta to dateut

Re: [Python-Dev] Issue5434: datetime.monthdelta

2009-04-16 Thread Robert Kern
On 2009-04-16 17:17, Paul Moore wrote: 2009/4/16 Robert Kern: from dateutil.relativedelta import * dt = relativedelta(months=1) dt relativedelta(months=+1) from datetime import datetime datetime(2009, 1, 15) + dt datetime.datetime(2009, 2, 15, 0, 0) datetime(2009, 1, 31) + dt

Re: [Python-Dev] Issue5434: datetime.monthdelta

2009-04-16 Thread Robert Kern
gt;> datetime(2009, 1, 15) + dt datetime.datetime(2009, 2, 15, 0, 0) >>> datetime(2009, 1, 31) + dt datetime.datetime(2009, 2, 28, 0, 0) >>> dt.months 1 >>> datetime(2009, 1, 31) + relativedelta(years=-1) datetime.datetime(2008, 1, 31, 0, 0) -- Robert Kern "I h

Re: [Python-Dev] bdb.py trace C implementation?

2009-04-01 Thread Robert Kern
rough the code manually, the performance is not all that important. However, up until that breakpoint, you are running a lot of code "in bulk". It would be useful to have a performant trace function that interferes with that code the least. -- Robert Kern "I have come to believe

Re: [Python-Dev] pprint(iterator)

2009-02-02 Thread Robert Kern
x=pretty.pretty(sys.modules) 10 loops, best of 3: 39.9 ms per loop In [13]: len(sys.modules) Out[13]: 517 The comparison is somewhat dodgy, though. pretty is not so much a refactoring of pprint as a reimplementation, so the time differences may not be due to the dispatch. -- Robert Kern "I have

Re: [Python-Dev] pprint(iterator)

2009-01-29 Thread Robert Kern
rth looking at Armin Ronacher's pretty.py for a starting point. http://dev.pocoo.org/hg/sandbox/file/tip/pretty I've been using it as my default displayhook under IPython for a few weeks now. It uses a combination of a function registry and a __pretty__ special method to find the right pretty

Re: [Python-Dev] Matrix product

2008-08-01 Thread Robert Kern
ite matrix object. I don't think there are many scientists/engineers/whatnot who want to double the number of operators to learn or who care if the matmult operator works on lists of lists or anything else in the standard library. -- Robert Kern "I have come to believe that the whole w

Re: [Python-Dev] Unittest PEP do's and don'ts (BDFL pronouncement)

2008-07-16 Thread Robert Kern
___ entrypoint: test_nicefail def test_nicefail(): x = 12 E assert x == 10 > assert 12 == 10 [/Users/rkern/test_nicefail.py:3] ______ tests finish

Re: [Python-Dev] configure error: "rm: conftest.dSYM: is a directory"

2008-04-07 Thread Robert Kern
pt on OS X 10.5. It's not specific to Python, and I haven't seen it cause any actual problems. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying

Re: [Python-Dev] Error in PEP3118?

2008-01-23 Thread Robert Kern
> ``readonly`` While the original could be reworded ("product of the elements of the shape array"), the amendment is incorrect. For a shape array like {4*5*6}, the number of bytes is (4*5*6)*bytes_per_item, not 3*bytes_per_item. -- Robert Kern "I have come to believe th

Re: [Python-Dev] C Decimal - is there any interest?

2007-10-16 Thread Robert Kern
because of name '*scientific* tools for python'. > However, if it supports - ignore following text block] You are right. We have no tools in numpy or scipy for decimal arithmetic. The focus of numpy is arrays. This decimal module is complementary to numpy and vice versa. -- Robert Kern

Re: [Python-Dev] Product function patch [issue 1093]

2007-09-04 Thread Robert Kern
Guido van Rossum wrote: > On 9/4/07, Robert Kern <[EMAIL PROTECTED]> wrote: >> The 3.x compatibility break (however alleviated by 2to3) makes a nice clean >> cutoff. The numpy that works on Pythons 3.x would essentially be a port from >> the >> current numpy.

Re: [Python-Dev] Product function patch [issue 1093]

2007-09-04 Thread Robert Kern
n three. I invite Greg and Steven and whoever else is interested to discuss ideas for the PEP on numpy-discussion. I'm skeptical, seeing what currently has been suggested, but some more details could easily allay that. http://projects.scipy.org/mailman/listinfo/numpy-discussion -- Robert

Re: [Python-Dev] The docs, reloaded

2007-05-20 Thread Robert Kern
he numpy project needs to extend that feature set, we'll provide the manpower ourselves. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret

Re: [Python-Dev] Pydoc Improvements / Rewrite

2007-01-06 Thread Robert Kern
specter, which determines the order in which introspecters are tried -- introspecters with lower numbers are tried first. The standard introspecters have priorities ranging from 20 to 30. The default priority (10) will place new introspecters before standard introspecters. &q

Re: [Python-Dev] PEP: Adding data-type objects to Python

2006-10-29 Thread Robert Kern
t;> PEP. It's a unification effort not yet-another-method. > > As I unification mechanism, I think it is insufficient. I doubt it > can express all the concepts that ctypes supports. What do you think is missing that can't be added? -- Robert Kern "I have come to believe th

Re: [Python-Dev] External Package Maintenance (was Re: Please stopchanging wsgiref on the trunk)

2006-06-12 Thread Robert Kern
tribution? We at Enthought are moving towards distributing a smallish bootstrap distribution and provide most of the packages as eggs. Upgrades should then be an easy_install away. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made te

Re: [Python-Dev] a note in random.shuffle.__doc__ ...

2006-06-10 Thread Robert Kern
note along the lines of Josiah wrote about there being no guarantees despite period size would also be useful. OTOH, isn't the exact PRNG algorithm considered an implementation detail? It certainly was when the module migrated from Wichmann-Hill to the Mersenne Twister. OTGH, I don't fo

Re: [Python-Dev] Pre-PEP: Allow Empty Subscript List Without Parentheses

2006-06-09 Thread Robert Kern
er again on numpy-discussion. The upshot is that numpy no longer creates rank-zero arrays unless if the user really asks for one. The remaining use cases are documented here: http://projects.scipy.org/scipy/numpy/wiki/ZeroRankArray -- Robert Kern "I have come to believe that the whole world is

Re: [Python-Dev] I'm not getting email from SF when assigned abug/patch

2006-03-30 Thread Robert Kern
s volunteered to manage them so that > people can band together to help push their favorite tracker. FWIW: Trac has a Sourceforge bug tracker import script: http://projects.edgewall.com/trac/browser/trunk/contrib/sourceforge2trac.py Apologies: for the other blank reply. -- Robert Kern [EMAI

Re: [Python-Dev] I'm not getting email from SF when assigned abug/patch

2006-03-30 Thread Robert Kern
w and as a test data set for the various trackers). > > -Brett > ___ > Python-Dev mailing list > Python-Dev@python.org > http://mail.python.org/mailman/listinfo/python-dev > Unsubscribe: > http://mail.python.org/mailman/o

Re: [Python-Dev] INPLACE_ADD and INPLACE_MULTIPLY oddities in ceval.c

2006-03-27 Thread Robert Kern
ays a numeric operation for arrays, never a sequence operation. When numpy arrays are on the LHS of an inplace operation, everything works consistently. The issue seems to arise from the fact that PyNumber_InPlaceAdd tries to coerce the LHS and the RHS to a common numerical type first before t

Re: [Python-Dev] Problems with the Python Memory Manager

2005-11-24 Thread Robert Kern
scipy.org/scipy/scipy_core/changeset/1490 Here's some code that eats up memory with rev1488, but not with the HEAD: """ import scipy a = scipy.arange(10) for i in xrange(10000000): x = a[5] """ -- Robert Kern [EMAIL PROTECTED] "In the fields of he

Re: [Python-Dev] Problems with the Python Memory Manager

2005-11-16 Thread Robert Kern
cipy_core, but that's not being used in the code that blows up and has nothing to do with the problem Travis is talking about. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter

Re: [Python-Dev] reference counting in Py3K

2005-09-07 Thread Robert Kern
gt; > http://mail.python.org/pipermail/python-dev/2002-January/019178.html > > (I've been using an extremely simple home-brewn version in a couple of > projects, and it's extremely addictive, at least if you're a C/C++ veteran...) weave is alive and kicking and actively use

Re: [Python-Dev] Python 3 design principles

2005-08-31 Thread Robert Kern
my current codebase[1] isn't going to be supported in Python 3000, I'm going to want the Python developers to use that opportunity to the fullest advantage to make a better language. [1] By which I mean the sum total of the code that I use not just code that I've personally written.

[Python-Dev] Re: Ye don't be needin' these!

2005-03-23 Thread Robert Kern
argument ((x**y) % z), which is necessary for really large numbers like the ones you play with in cryptography. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Rich

[Python-Dev] Re: license issues with profiler.py and md5.h/md5c.c

2005-02-12 Thread Robert Kern
;s license, all parties to whom the program is redistributed should have the same rights as those that are granted in conjunction with the original software distribution. """ I'm not entirely sure if this affects the PSF's use of OSI's trademark. IANAL. TINLA. -- Robert Ke

[Python-Dev] Re: license issues with profiler.py and md5.h/md5c.c

2005-02-12 Thread Robert Kern
ntation that is identified in the RFC as being copyrighted. [etc.] -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter ___ Python-Dev mailing list Py

[Python-Dev] Re: [Pythonmac-SIG] Re: Re: [Python-checkins] python/dist/src/Mac/OSX fixapplepython23.py, 1.1, 1.2

2004-12-29 Thread Robert Kern
piler. Extension, and yes it does something similarly stupid. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter ___ Python-Dev mailing list Python-Dev@