Re: [Python-Dev] Code highlighting in tracker

2011-04-07 Thread Alexander Belopolsky
On Thu, Apr 7, 2011 at 12:57 PM, Raymond Hettinger wrote: .. > * provide a clean way to post code snippets >  (we've had past issues with whitespace being gobbled-up) > What would really help is if someone would figure out how to stop the tracker from removing the lines that start with the python

Re: [Python-Dev] Bug? Can't rebind local variables after calling pdb.set_trace()

2011-04-12 Thread Alexander Belopolsky
On Tue, Apr 12, 2011 at 11:15 AM, Djoume Salvetti wrote: .. > When calling pdb.set_trace() from within a function, it seems to be > impossible to rebind any local variables: > Works for me (using latest HG clone): $ cat test.py gv = 1 def f(): lv = 1 import pdb; pdb.set_trace() if __n

[Python-Dev] Hg question

2011-04-12 Thread Alexander Belopolsky
:Alexander Belopolsky date:Tue Apr 12 14:00:43 2011 -0400 summary: m.txt changeset: 69273:516ed700ce22 tag: tip parent: 69270:c26d015cbde8 parent: 69272:0bf1354fab6b user:Alexander Belopolsky date:Tue Apr 12 14:02:22 2011 -0400 summary: m.txt

Re: [Python-Dev] Syntax quirk

2011-04-25 Thread Alexander Belopolsky
On Mon, Apr 25, 2011 at 1:21 PM, Rob Cliffe wrote: .. 3.__class__ >  File "", line 1 >    3.__class__ >              ^ > SyntaxError: invalid syntax > > Superficially the last example ought to be legal syntax (and return 'int'>). If it was valid, then >>> 3.e+7 would have to raise an attr

Re: [Python-Dev] PyObject_RichCompareBool identity shortcut

2011-04-27 Thread Alexander Belopolsky
On Wed, Apr 27, 2011 at 10:53 AM, Guido van Rossum wrote: .. > Maybe we should just call off the odd NaN comparison behavior? +1 There was a long thread on this topic last year: http://mail.python.org/pipermail/python-dev/2010-March/098832.html I was trying to find a rationale for non-reflexiv

Re: [Python-Dev] PyObject_RichCompareBool identity shortcut

2011-04-27 Thread Alexander Belopolsky
On Wed, Apr 27, 2011 at 11:31 AM, Nick Coghlan wrote: .. > Backing away from having float and decimal.Decimal respect the IEEE754 > notion of NaN inequality at this late stage of the game seems like one > for the "too hard" basket. Why? float('nan') has always been in the use-at-your-own-risk te

Re: [Python-Dev] PyObject_RichCompareBool identity shortcut

2011-04-27 Thread Alexander Belopolsky
On Wed, Apr 27, 2011 at 12:05 PM, Isaac Morland wrote: .. > Of course, the definition of math.isnan cannot then be by checking its > argument by comparison with itself - it would have to check the appropriate > bits of the float representation. math.isnan() is implemented in C and does not rely o

Re: [Python-Dev] PyObject_RichCompareBool identity shortcut

2011-04-27 Thread Alexander Belopolsky
On Wed, Apr 27, 2011 at 12:28 PM, Raymond Hettinger wrote: > > On Apr 27, 2011, at 7:53 AM, Guido van Rossum wrote: > >> Maybe we should just call off the odd NaN comparison behavior? > > I'm reluctant to suggest changing such enshrined behavior. > > ISTM, the current state of affairs is reasonabl

Re: [Python-Dev] PyObject_RichCompareBool identity shortcut

2011-04-27 Thread Alexander Belopolsky
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 current > behavior. If the behavior changed with Python floats, we'd have to mull over > whether we try to match tha

Re: [Python-Dev] PyObject_RichCompareBool identity shortcut

2011-04-27 Thread Alexander Belopolsky
On Wed, Apr 27, 2011 at 11:14 PM, Guido van Rossum wrote: .. >> ISTM, the current state of affairs is reasonable. > > Hardly; when I picked the NaN behavior I knew the IEEE std prescribed > it but had never seen any code that used this. > Same here. The only code I've seen that depended on this

Re: [Python-Dev] PyObject_RichCompareBool identity shortcut

2011-04-27 Thread Alexander Belopolsky
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([0]) [-- ] (I don't have numpy on thi

Re: [Python-Dev] PyObject_RichCompareBool identity shortcut

2011-04-27 Thread Alexander Belopolsky
On Thu, Apr 28, 2011 at 12:24 AM, Guido van Rossum wrote: > So do new masks get created when the outcome of an elementwise > operation is a NaN? Because that's the only reason why one should have > NaNs in one's data in the first place. If this is the case, why Python almost never produces NaNs

Re: [Python-Dev] PyObject_RichCompareBool identity shortcut

2011-04-27 Thread Alexander Belopolsky
On Thu, Apr 28, 2011 at 1:40 AM, Greg Ewing wrote: .. > The Pythonic thing to do (in the Python 3 world at least) would > be to regard NaNs as non-comparable and raise an exception. As I mentioned in a previous post, I agree in case of <, <=, >, or >= comparisons, but == and != are a harder cas

Re: [Python-Dev] PyObject_RichCompareBool identity shortcut

2011-04-27 Thread Alexander Belopolsky
On Thu, Apr 28, 2011 at 2:20 AM, Glenn Linderman wrote: .. > In that bug, Nick, you mention that reflexive equality is something that > container classes rely on in their implementation.  Such reliance seems to > me to be a bug, or an inappropriate optimization, .. An alternative interpretation w

Re: [Python-Dev] PyObject_RichCompareBool identity shortcut

2011-04-28 Thread Alexander Belopolsky
On Thu, Apr 28, 2011 at 2:54 AM, Nick Coghlan wrote: .. > No, as Raymond has articulated a number of times over the years, it's > a property of the equivalence relation that is needed in order to > present sane invariants to users of the container. I included in the > bug report the critical invar

Re: [Python-Dev] PyObject_RichCompareBool identity shortcut

2011-04-28 Thread Alexander Belopolsky
On Thu, Apr 28, 2011 at 3:57 AM, Nick Coghlan wrote: .. >> It is an interesting question of what "sane invariants" are.  Why you >> consider the invariants that you listed essential while say >> >> if c1 == c2: >>   assert all(x == y for x,y in zip(c1, c2)) >> >> optional? > > Because this asserti

Re: [Python-Dev] PyObject_RichCompareBool identity shortcut

2011-04-28 Thread Alexander Belopolsky
Ys; as soon as one were encountered, computation would be best stopped rather than continued for an indefinite time to an Indefinite conclusion. """ http://www.cs.berkeley.edu/~wkahan/ieee754status/ieee754.ps More often than not, you would want to sum non-NaN values instead. .. >

Re: [Python-Dev] PyObject_RichCompareBool identity shortcut

2011-04-28 Thread Alexander Belopolsky
On Thu, Apr 28, 2011 at 7:47 PM, Guido van Rossum wrote: > On Thu, Apr 28, 2011 at 4:40 PM, Nick Coghlan wrote: >> Pondering the NaN problem further, I think we can relatively easily >> argue that reflexive behaviour at the object level fits within the >> scope of IEEE754. > > Now we're talking.

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

2011-04-29 Thread Alexander Belopolsky
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 exceptions into > Python exceptions. It is unfortunate that official text of IEEE-754 is not freely a

Re: [Python-Dev] Not-a-Number (was PyObject_RichCompareBool identity shortcut)

2011-04-29 Thread Alexander Belopolsky
On Fri, Apr 29, 2011 at 1:11 PM, Guido van Rossum wrote: > … Would it make sense to add > a float context that also lets one specify what should happen? That > could include returning Inf for 1.0/0.0 (for experts), or raising > exceptions when NaNs are produced (for the numerically naive like > my

Re: [Python-Dev] cpython (merge 3.2 -> default): Avoid codec spelling issues by just using the utf-8 default.

2011-05-05 Thread Alexander Belopolsky
On Thu, May 5, 2011 at 2:44 PM, Antoine Pitrou wrote: .. > (also, I don't understand the spelling issue: "utf-8" just works) This is probably referring to the fact that while encode() accepts many spelling variants, some are short-circuited in C code while others require codec lookup implemented

Re: [Python-Dev] [Python-checkins] cpython (3.2): Avoid codec spelling issues by just using the utf-8 default.

2011-05-05 Thread Alexander Belopolsky
On Thu, May 5, 2011 at 6:32 PM, M.-A. Lemburg wrote: .. >> Either way, the code is simpler by just using the default. > > ... as long as the casual reader knows what the default it :-) > .. or cares. I this particular case, it hardly matters how random bits are encoded. _

Re: [Python-Dev] [Python-checkins] cpython: Avoid useless "++" at the end of functions

2011-05-26 Thread Alexander Belopolsky
On Thu, May 26, 2011 at 11:26 AM, Eric Smith wrote: .. >> Have to looked at the patch? The patch and resulting code look sane to me, >> and >> if anything at most of the updated segments look cleaner after the patch. > > I have looked at it. I think the code was better before the patch. If I > we

Re: [Python-Dev] os.stat and nanosecond precision

2011-06-03 Thread Alexander Belopolsky
On Fri, Jun 3, 2011 at 12:34 PM, Ross Lagerwall wrote: > .. > What should the name of the (seconds, nanoseconds) tuple be? > st_atim, st_ctim and st_mtim has bee suggested and is what the POSIX > specification uses. This is confusingly similar to the existing > st_atime, st_ctime and st_mtime. > S

Re: [Python-Dev] cpython: Remove some extraneous parentheses and swap the comparison order to

2011-06-07 Thread Alexander Belopolsky
.. >>> I agree with Georg: "if ('u' == typecode)" is not well readable, >>> since you usually put the variable part on the left and the constant >>> part on the right of an equal comparison. I appear to be in the minority here, but this particular example does not strike me as egregiously unreadab

Re: [Python-Dev] cpython: Remove some extraneous parentheses and swap the comparison order to

2011-06-08 Thread Alexander Belopolsky
On Wed, Jun 8, 2011 at 7:04 AM, Steven D'Aprano wrote: .. >> Whereas I read it as 'has the value' (or just 'is' ;=). > > Am I the only one who reads == as "equals"? If you are, you are the only one who reads it correctly. Consider >>> a = 2 >>> a == 2.0 True

[Python-Dev] [PATCH] fixing 2.5.1 build with unicode and dynamic loading disabled

2007-07-11 Thread Alexander Neundorf
Hi, this is my first email to this list, I'm currently porting python to some platforms with limited capabilities and so I thought it would be a good idea to subscribe here. While doing the porting, I found two small problems in Python 2.5.1: If Py_USING_UNICODE is disabled, in Python/ast.c dec

Re: [Python-Dev] [PATCH] fixing 2.5.1 build with unicode and dynamic loading disabled

2007-07-11 Thread Alexander Neundorf
On Wednesday 11 July 2007 15:01, Aahz wrote: > On Wed, Jul 11, 2007, Alexander Neundorf wrote: > > A patch against 2.5.1 is attached. > > Patches to the list tend to get lost. Please post to SourceForge and > then send the ID to python-dev. Done, i

[Python-Dev] Building Python with CMake

2007-07-13 Thread Alexander Neundorf
Hi, as I wrote in my previous email, I'm currently porting Python to some more unusual platforms, namely to a super computer (http://www.research.ibm.com/bluegene/) and a tiny embedded operating system (http://ecos.sourceware.org), which have more or less surprisingly quite similar properties.

Re: [Python-Dev] Building Python with CMake

2007-07-13 Thread Alexander Neundorf
On Friday 13 July 2007 14:53, you wrote: > 2007/7/13, Alexander Neundorf <[EMAIL PROTECTED]>: > > as I wrote in my previous email, I'm currently porting Python to some > > more unusual platforms, namely to a super computer > > (http://www.research.ibm.com/bluegene

Re: [Python-Dev] Building Python with CMake

2007-08-03 Thread Alexander Neundorf
On Friday 13 July 2007 16:11, Giovanni Bajo wrote: ... > Because it would be a single unified build system instead of having two > build systems like we have one (UNIX and Windows). > > Also, it would be much easier to maintain because Visual Studio projects > are generated from a simple descriptio

[Python-Dev] sys.last_traceback - annoying pdb.pm behaviour

2007-08-18 Thread Alexander Schremmer
quot; ./traceback.py:print_exception(sys.last_type, sys.last_value, sys.last_traceback, ./pdb.py:post_mortem(sys.last_traceback) ./code.py:type, value, sys.last_traceback = sys.exc_info() ./code.py:sys.last_traceback = tb ./dis.py:tb = sys.last_traceback Kin

[Python-Dev] sys.last_traceback - annoying pdb behaviour

2007-08-18 Thread Alexander Schremmer
quot; ./traceback.py:    print_exception(sys.last_type, sys.last_value, sys.last_traceback, ./pdb.py:    post_mortem(sys.last_traceback) ./code.py:        type, value, sys.last_traceback = sys.exc_info() ./code.py:            sys.last_traceback = tb ./dis.py:            tb = sys.last_traceback Kin

Re: [Python-Dev] sys.last_traceback - annoying pdb behaviour

2007-08-18 Thread Alexander Schremmer
Guido van Rossum wrote: > On 8/18/07, Alexander Schremmer <[EMAIL PROTECTED]> wrote: >> when I tried to use pdb, I spotted some kind of annoying behaviour of >> pdb: for pdb.pm, it still uses sys.last_traceback which is set by code.py >> >> This renders the fun

[Python-Dev] HAVE_DECL_TZNAME in pyconfig.h.in, but no test for it ?

2007-08-30 Thread Alexander Neundorf
Hi, in current python svn there is a #undef HAVE_DECL_TZNAME but I can't find a configure test for it. Did I miss something ? Bye Alex ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: ht

Re: [Python-Dev] Building Python with CMake

2007-08-30 Thread Alexander Neundorf
On Friday 13 July 2007 16:11, Giovanni Bajo wrote: > On 13/07/2007 20.53, Facundo Batista wrote: > >> as I wrote in my previous email, I'm currently porting Python to some > >> more unusual platforms, namely to a super computer > >> (http://www.research.ibm.com/bluegene/) and a tiny embedded operat

Re: [Python-Dev] Building Python with CMake

2007-09-20 Thread Alexander Neundorf
Hi, On Thursday 30 August 2007 16:28, Alexander Neundorf wrote: ... > The cmake files for building python are now in a cvs repository: > http://www.cmake.org/cgi-bin/viewcvs.cgi/Utilities/CMakeBuildForPython/?roo >t=ParaView3 > > This is inside the ParaView3 repository: > http:

Re: [Python-Dev] Building Python with CMake

2007-09-20 Thread Alexander Neundorf
On Thursday 20 September 2007 16:58, Steven Bethard wrote: > On 9/20/07, Alexander Neundorf <[EMAIL PROTECTED]> wrote: > > On Thursday 30 August 2007 16:28, Alexander Neundorf wrote: > > ... > > > > > The cmake files for building python are now in a cvs reposi

[Python-Dev] New/Old class exception pitfall

2008-03-17 Thread Alexander Belopolsky
While discussing issue2291, I presented the following argument: """ Consider the following code: class x: pass class y(x): pass try: raise y except y: print "a" except: print "b" It prints 'b'. Now, suppose in preparation for 3.0 transition someone adds "__metaclass__ = type" to the module

Re: [Python-Dev] New/Old class exception pitfall

2008-03-17 Thread Alexander Belopolsky
On Mon, Mar 17, 2008 at 6:49 PM, Guido van Rossum <[EMAIL PROTECTED]> wrote: .. > Really? Under which version exactly? On which platform? I cannot > reproduce this with either 2.4, 2.5 or 2.6 on OS X. Just retested in Python 2.6a1+ (trunk:61449M, Mar 17 2008, 17:29:21) [GCC 3.4.6 20060404 (Red

Re: [Python-Dev] New/Old class exception pitfall

2008-03-17 Thread Alexander Belopolsky
Oleg Broytmann phd.pp.ru> writes: > > On Mon, Mar 17, 2008 at 06:35:46PM -0400, Alexander Belopolsky wrote: > > class x: > > pass > > class y(x): > > pass > > try: > > raise y > > except y: > > print "a" > > except: &g

Re: [Python-Dev] [Distutils] Capsule Summary of Some Packaging/Deployment Technology Concerns

2008-03-20 Thread Alexander Michael
On Wed, Mar 19, 2008 at 6:15 PM, Jeff Rush <[EMAIL PROTECTED]> wrote: > Frankly I'd like to see setuptools exploded, with those parts of general use > folded back into the standard library, the creation of a set of > non-implementation-specific documents of the distribution formats and > behavi

Re: [Python-Dev] [Distutils] How we can get rid of eggs for 2.6 and beyond

2008-03-24 Thread Alexander Michael
On Fri, Mar 21, 2008 at 9:31 PM, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > The objections to the PEP remain the same as they were then, > though: In the requirements, it says "we need", without saying > why we need. It then goes on saying "we want" (rephrased) > "to duplicate APT and RPM",

Re: [Python-Dev] [Distutils] How we can get rid of eggs for 2.6 and beyond

2008-03-24 Thread Alexander Michael
On Sat, Mar 22, 2008 at 10:02 AM, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > It seems to me that this discussion is being undermined by not > > acknowledging the many use cases up front. There is no rationale > > because there are too many tacit rationales. > > I honestly, really, cannot i

Re: [Python-Dev] Python on ThreadX

2008-04-02 Thread Alexander Neundorf
On Wed, Apr 2, 2008 at 10:12 PM, Pree Raj <[EMAIL PROTECTED]> wrote: > Hi, > I have an application that used python on linux. > I want to port it to run on ThreadX. > Can you tell me if this can be possible. > If yes, how can I get started. I managed to get Python to work under eCos, which is also

Re: [Python-Dev] [Distutils] how to easily consume just the parts of eggs that are good for you

2008-04-09 Thread Alexander Michael
On Wed, Apr 9, 2008 at 3:40 PM, Phillip J. Eby <[EMAIL PROTECTED]> wrote: > That is indeed a problem -- but it's a social one, not a technical > one. It's trivial for the publisher of an egg to change their > command line from "setup.py bdist_egg upload" to "setup.py sdist > bdist_egg upload",

Re: [Python-Dev] unscriptable?

2008-04-21 Thread Alexander Belopolsky
> ruby: undefined method `[]=' for 1:Fixnum (NoMethodError) I think it will be natural to unify [] error message with the other binary ops: Now: >>> 1+"" Traceback (most recent call last): File "", line 1, in TypeError: unsupported operand type(s) for +: 'int' and 'str' Proposal: >>> 1[2] Tra

Re: [Python-Dev] Invitation to try out open source code review tool

2008-05-06 Thread Alexander Michael
On Tue, May 6, 2008 at 1:26 PM, Guido van Rossum <[EMAIL PROTECTED]> wrote: > On Tue, May 6, 2008 at 12:51 AM, Jeroen Ruigrok van der Werven > <[EMAIL PROTECTED]> wrote: > > -On [20080505 05:38], Guido van Rossum ([EMAIL PROTECTED]) wrote: > > > http://code.google.com/p/rietveld/source/browse

Re: [Python-Dev] rename of ConfigParser module?

2008-05-15 Thread Alexander Michael
On Thu, May 15, 2008 at 7:37 AM, Mark Hammond <[EMAIL PROTECTED]> wrote: > Trying to build pywin32 from the trunk, I see: > > from distutils.config import PyPIRCCommand > File "C:\src\python-svn\lib\distutils\config.py", line 8, in > from ConfigParser import ConfigParser > ImportError: No module

Re: [Python-Dev] Symbolic errno values in error messages

2008-05-16 Thread Alexander Belopolsky
Yannick Gingras ygingras.net> writes: .. > > 1) Should OSError.__str__() print the symbolic name of errno? > +1 for the change > 2) Where can I find the symbolic name in C? Use standard C library char* strerror(int errnum) function. You can see an example usage in Modules/posixmodule.c (pos

Re: [Python-Dev] Symbolic errno values in error messages

2008-05-16 Thread Alexander Belopolsky
On Fri, May 16, 2008 at 10:15 AM, Nick Coghlan <[EMAIL PROTECTED]> wrote: > Alexander Belopolsky wrote: .. >> Use standard C library char* strerror(int errnum) function. You can see >> an example usage in Modules/posixmodule.c (posix_strerror). > > I don't bel

Re: [Python-Dev] Symbolic errno values in error messages

2008-05-16 Thread Alexander Belopolsky
On Fri, May 16, 2008 at 10:52 AM, Yannick Gingras <[EMAIL PROTECTED]> wrote: > print e >> [Errno 21] Is a directory >> >> So now I am not sure what OP is proposing. Do you want to replace 21 >> with EISDIR in the above? > > Yes, that's what I had in mind. > In this case, I have a more drasti

Re: [Python-Dev] Proposal: add odict to collections

2008-06-15 Thread Alexander Schremmer
mpared to your O(n), see here: http://codespeak.net/svn/user/arigo/hack/pyfuse/OrderedDict.py So many people are implementing this kind of data type but do not really care about making as fast as it could be ... IMHO yet another reason to ship a usable implementation w

[Python-Dev] Issue2944: need a review

2008-07-17 Thread Alexander Shigin
Can anyone look at the patch for Issue2944? I hope the issue can be fixed before the release of python 2.6. ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman

Re: [Python-Dev] What this code should do?

2008-09-19 Thread Alexander Shigin
В Птн, 19/09/2008 в 17:43 +0200, Maciej Fijalkowski пишет: > Hello, > > I'm a little clueless about exact semantics of following snippets: > > http://paste.pocoo.org/show/85698/ > > is this fine? > or shall I fill the bug? > (the reason to ask is because a) django is relying on this b) pypy > im

[Python-Dev] Accessing source code in zipped packages

2008-12-02 Thread Alexander Belopolsky
About a month ago, I submitted two patches that address Pdb and doctest inability to load source code from modules with custom loaders such as modules loaded from zip files: http://bugs.python.org/issue4201 http://bugs.python.org/issue4197 The patches are very simple, basically calls to linecache

Re: [Python-Dev] Allocation of shape and strides fields in Py_buffer

2008-12-08 Thread Alexander Belopolsky
I don't have much to add to Nick's reply other than to point you to numpy, , as a reference implementation. You may also get better responses on the numpy list, < [EMAIL PROTECTED]>. On Mon, Dec 8, 2008 at 3:46 PM, Nick Coghlan <[EMAIL PROTECTED]> wrote: > A

Re: [Python-Dev] Allocation of shape and strides fields in Py_buffer

2008-12-08 Thread Alexander Belopolsky
On Mon, Dec 8, 2008 at 6:25 PM, Antoine Pitrou <[EMAIL PROTECTED]> wrote: .. >> Alexander's suggestion of going and looking at what the numpy folks have >> done in this area is probably a good idea too. > > Well, I'm open to others doing this, but I won't do it myself. My interest is > in > fixing

Re: [Python-Dev] Forking and pipes

2008-12-09 Thread Alexander Shigin
В Втр, 09/12/2008 в 19:26 +, Lars Kotthoff пишет: > Dear list, > > I recently noticed a python program which uses forks and pipes for > communication between the processes not behaving as expected. The minimal > example program: If you write r, w = os.pipe() os.write(w, 'foo') pid = os

Re: [Python-Dev] Trap SIGSEGV and SIGFPE

2008-12-10 Thread Alexander Belopolsky
On Wed, Dec 10, 2008 at 6:12 PM, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: >> I would appreciate a review, especially for the patch in Python/ceval.c. > > In this specific case, it is not clear for what objective you want such > review. For inclusion into Python? > Even if it does not result in

Re: [Python-Dev] Trap SIGSEGV and SIGFPE

2008-12-10 Thread Alexander Belopolsky
On Wed, Dec 10, 2008 at 8:01 PM, Adam Olsen <[EMAIL PROTECTED]> wrote: .. > It is impossible to do in general, and I am -1 on any misguided > attempts to do so. > I agree, recovering from segfaults caused by buggy third party C modules is a losing proposition, but for a limited number of condition

Re: [Python-Dev] Problem with svn on community buildbot

2008-12-14 Thread Alexander Belopolsky
I don't know is this is related, but from my end, access to svn.python.org has been extremely slow recently: $ time curl -o /dev/null http://svn.python.org % Total% Received % Xferd Average Speed TimeTime Time Current Dload Upload Total Spent

Re: [Python-Dev] Problem with svn on community buildbot

2008-12-14 Thread Alexander Belopolsky
Please see below for more svn debugging, but now I also traced down the delays I observe when I go to bugs.python.com to the same issue. The offending download is the style sheet and that explains why curl does not show it when pointed to the main page: $ curl -v -o /dev/null http://python.org/sty

Re: [Python-Dev] Problem with svn on community buildbot

2008-12-14 Thread Alexander Belopolsky
I've found a work-around in Firefox: go to about:config page an change network.dns.disableIPv6 to true. Does anyone know a similar setting in Safari? On Sun, Dec 14, 2008 at 4:52 PM, Alexander Belopolsky wrote: > Please see below for more svn debugging, but now I also traced down > t

Re: [Python-Dev] Problem with svn on community buildbot

2008-12-14 Thread Alexander Belopolsky
On Sun, Dec 14, 2008 at 5:18 PM, "Martin v. Löwis" wrote: >> I've found a work-around in Firefox: go to about:config page an change >> network.dns.disableIPv6 to true. > > I'd advise against using such a work-around. The infrastructure is > designed to cope with that case transparently; if it is n

[Python-Dev] sys.stdout.write encoding failure

2008-12-14 Thread Alexander Belopolsky
There is currently a unit test in the trunk that fails in verbose mode: $ ./python.exe Lib/test/test_doctest.py -v ... UnicodeEncodeError: 'ascii' codec can't encode characters in position 338-339: ordinal not in range(128) Apparently, the problem is that stdout cannot encode non-ascii characters

Re: [Python-Dev] Please test OSX installer

2008-12-17 Thread Alexander Belopolsky
I've installed it on a MacBook Air running Leopard (10.5.6). Installer ran like a charm, but when I ran the following in IDLE: >>> from test.regrtest import main >>> main() I got a "Problem Report for Python" pop-up. Skip to "///" for "Problem Details". Interestingly, the test completed with th

Re: [Python-Dev] #ifdef __cplusplus?

2009-01-01 Thread Alexander Belopolsky
The relevant revision is r45330: . """ Author: anthony.baxter Date: Thu Apr 13 02:06:09 2006 UTC (2 years, 8 months ago) Log Message: spread the extern "C" { } magic pixie dust around. Python itself builds now using a C++ compiler. Still lots and lo

Re: [Python-Dev] #ifdef __cplusplus?

2009-01-01 Thread Alexander Belopolsky
On Thu, Jan 1, 2009 at 11:05 PM, Christian Heimes wrote: .. > You might be interested in the bug report > http://bugs.python.org/issue4665. Skip pointed out that Python 2.6 no > longer compiles with a C++ compiler due to missing casts. C++ is more > restrict when it comes to implicit casts from (a

Re: [Python-Dev] #ifdef __cplusplus?

2009-01-01 Thread Alexander Belopolsky
On Fri, Jan 2, 2009 at 12:58 AM, Adam Olsen wrote: .. > > As C++ has more specific ways of allocating memory, they impose this > restriction to annoy you into using them. And so does Python API: see PyMem_NEW and PyMem_RESIZE macros. > We won't be using them, and the extra casts and nothing but

Re: [Python-Dev] #ifdef __cplusplus?

2009-01-01 Thread Alexander Belopolsky
On Fri, Jan 2, 2009 at 2:26 AM, Adam Olsen wrote: .. > Compiling as C++ is too obscure of a feature to warrant uglifying the > code. Malloc casts may be hard to defend, but most of python code base already has them, there is little to be gained from having these casts in some places and not other

Re: [Python-Dev] A wart which should have been repaired in 3.0?

2009-01-02 Thread Alexander Belopolsky
On Fri, Jan 2, 2009 at 12:29 PM, "Martin v. Löwis" wrote: > I propose a different solution to this commonprefix mess: eliminate > the function altogether. It is apparently too confusing to get right. +1 ___ Python-Dev mailing list Python-Dev@python.org

Re: [Python-Dev] #ifdef __cplusplus?

2009-01-02 Thread Alexander Belopolsky
First, by copying c++-sig, let me invite C++ experts to comment on this thread and the tracker issue: http://mail.python.org/pipermail/python-dev/2009-January/084685.html http://bugs.python.org/issue4805 My patch highlights several issues: 1. (OP's issue.) Do we need #ifdef __cplusplus wrapper

Re: [Python-Dev] Hmmm... __PyObject_NextNotImplemented when tracing lines

2009-01-19 Thread Alexander Belopolsky
On Mon, Jan 19, 2009 at 11:51 AM, wrote: > I see output like this in several tests on my Mac: > >test_array skipped -- > dlopen(/Users/skip/src/python/trunk/build/lib.macosx-10.3-i386-2.7/cPickle.so, > 2): Symbol not found: __PyObject_NextNotImplemented > Referenced from: > /Users/ski

Re: [Python-Dev] PEP 3142: Add a "while" clause to generator expressions

2009-01-19 Thread Alexander Belopolsky
On Mon, Jan 19, 2009 at 1:41 PM, Scott Dial wrote: > Vitor Bosshard wrote: >> Are you even sure the list comprehension doesn't already shortcut evaluation? > > It does not. The body of the comprehension is evaluated all the way to > completion, .. In addition, the test is evaluated on all items a

Re: [Python-Dev] Include C++ code in the ctypes test suite?

2009-01-29 Thread Alexander Belopolsky
On Thu, Jan 29, 2009 at 11:50 AM, Antoine Pitrou wrote: .. > (I also suppose configure can detect the presence of a C++ compiler...) > This test is already there: $ ./configure ... checking for g++... g++ configure: WARNING: By default, distutils will build C++ extension modules with "g++".

Re: [Python-Dev] Partial function application 'from the right'

2009-01-29 Thread Alexander Belopolsky
This discussion probably belongs to python-ideas, but since we already have this thread, I'll reply here instead of opening a new thread there. Ellipsis was introduced into python to serve needs of the numeric python community. If you think of numpy multiarrays as functions taking ndim number of

Re: [Python-Dev] Partial function application 'from the right'

2009-01-30 Thread Alexander Belopolsky
On Fri, Jan 30, 2009 at 7:42 PM, Antoine Pitrou wrote: .. > If one writes X = partial.skip, it looks quite nice: > > split_one = partial(str.split, X, 1) Or even _ = partial.skip split_one = partial(str.split, _, 1) ___ Python-Dev mailing list Python-D

Re: [Python-Dev] cpython: Add Py_RETURN_NOTIMPLEMENTED macro. Fixes #12724.

2011-08-15 Thread Alexander Belopolsky
On Thu, Aug 11, 2011 at 3:02 AM, Antoine Pitrou wrote: .. >>   Add Py_RETURN_NOTIMPLEMENTED macro. Fixes #12724. > > > It would sound more useful to have a generic Py_RETURN() macro rather than > some specific forms for each and every common object. Just my $0.02: I occasionally wish we had Py_RE

Re: [Python-Dev] range objects in 3.x

2011-09-27 Thread Alexander Belopolsky
On Mon, Sep 26, 2011 at 9:25 PM, Steven D'Aprano wrote: .. > The audience for numpy is a small minority of Python users, and they tend to > be more sophisticated. I'm sure they can cope with two functions with > different APIs > > While continuity of API might be a good thing, we shouldn't accept

Re: [Python-Dev] range objects in 3.x

2011-09-27 Thread Alexander Belopolsky
On Tue, Sep 27, 2011 at 2:23 AM, Greg Ewing wrote: .. > And I don't like "linspace" either. Something more self > explanatory such as "subdivide" or "interpolate" might > be better. "Grid" would be nice and short, but may suggest 2-dimentional result. Whatever word we choose, I think it should b

Re: [Python-Dev] range objects in 3.x

2011-09-27 Thread Alexander Belopolsky
On Tue, Sep 27, 2011 at 11:44 AM, Raymond Hettinger wrote: .. > In the math module, we used an f prefix to differentiate math.fsum() from the > built-in sum() function.  That suggests frange() as a possible name for a > variant of range() that creates floats. > > That works reasonably well if th

Re: [Python-Dev] range objects in 3.x

2011-09-27 Thread Alexander Belopolsky
On Tue, Sep 27, 2011 at 12:20 PM, Steven D'Aprano wrote: > If it happened > to support dates, that would be great, but I think that a daterange() > function in the datetime module would be more appropriate. Or even more appropriately in the calendar module. The problem is that we may already hav

Re: [Python-Dev] range objects in 3.x

2011-09-27 Thread Alexander Belopolsky
On Tue, Sep 27, 2011 at 1:03 PM, Guido van Rossum wrote: .. > Um, I think you better read the thread. :-) I successfully argued that > mimicking the behavior of range() for floats is a bad idea, and that > we need to come up with a name for an API that takes start/stop/count > arguments instead of

Re: [Python-Dev] range objects in 3.x

2011-09-27 Thread Alexander Belopolsky
On Tue, Sep 27, 2011 at 2:20 PM, Ethan Furman wrote: .. > Good points.  So how about: > > some_name_here(start, stop, *, step=None, count=None) > +1 The unusual optional first arguments is one of the things I dislike about range(). Shouldn't step default to 1.0? Also, when count is given, stop

Re: [Python-Dev] range objects in 3.x

2011-09-27 Thread Alexander Belopolsky
On Tue, Sep 27, 2011 at 2:36 PM, Guido van Rossum wrote: .. > But that's exactly what we don't *want* you to do! Because (unless you > are a numerical wizard) you probably aren't doing the error analysis > needed to avoid the "unexpected extra point" problem due to floating > point inaccuracies. F

Re: [Python-Dev] range objects in 3.x

2011-09-27 Thread Alexander Belopolsky
On Tue, Sep 27, 2011 at 2:53 PM, Guido van Rossum wrote: > On Tue, Sep 27, 2011 at 11:48 AM, Alexander Belopolsky > wrote: >> On Tue, Sep 27, 2011 at 2:36 PM, Guido van Rossum wrote: >> .. >>> But that's exactly what we don't *want* you to do! Because (unles

Re: [Python-Dev] Store timestamps as decimal.Decimal objects

2012-01-31 Thread Alexander Belopolsky
On Mon, Jan 30, 2012 at 6:31 PM, Victor Stinner wrote: > Alexander Belopolsky proposed to use > time.time(format=datetime.datetime) instead. Just to make sure my view is fully expressed: I am against adding flag arguments to time.time(). My preferred solution to exposing high resolution

Re: [Python-Dev] Store timestamps as decimal.Decimal objects

2012-01-31 Thread Alexander Belopolsky
On Tue, Jan 31, 2012 at 7:13 AM, Antoine Pitrou wrote: > On Tue, 31 Jan 2012 21:11:37 +1000 > Nick Coghlan wrote: >> >> Having a low-level module like os needing to know about higher-level >> types like decimal.Decimal and datetime.datetime (or even timedelta) >> should be setting off all kinds o

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-16 Thread Alexander Belopolsky
On Wed, Feb 15, 2012 at 11:39 AM, Guido van Rossum wrote: > Maybe it's okay to wait a few years on this, until either 128-bit > floats are more common or cDecimal becomes the default floating point > type? +1 ___ Python-Dev mailing list Python-Dev@pytho

Re: [Python-Dev] Drop the new time.wallclock() function?

2012-03-15 Thread Alexander Belopolsky
On Thu, Mar 15, 2012 at 3:55 PM, Matt Joiner wrote: > +1. I now prefer time.monotonic(), no flags. Am I alone thinking that an adjective is an odd choice for a function name? I think monotonic_clock or monotonic_time would be a better option. ___ Pytho

Re: [Python-Dev] Issue 2736: datetimes and Unix timestamps

2012-06-04 Thread Alexander Belopolsky
On Mon, Jun 4, 2012 at 1:12 PM, Guido van Rossum wrote: > A big +1 on making conversions between POSIX timestamps and datetime > (with or without timezone) easier. I am all for achieving this goal, but I think the root of the problem is not the lack of mxDT's ticks() method. Note that someone wh

Re: [Python-Dev] Issue 2736: datetimes and Unix timestamps

2012-06-04 Thread Alexander Belopolsky
On Mon, Jun 4, 2012 at 1:12 PM, Guido van Rossum wrote: > ... I heard > a colleague complain that he'd lost several hours trying to figure out > how to determine whether two datetimes were within 24h of each other, > getting confused by what was happening when the two were on different > sides of

Re: [Python-Dev] Issue 2736: datetimes and Unix timestamps

2012-06-04 Thread Alexander Belopolsky
On Mon, Jun 4, 2012 at 3:05 PM, Guido van Rossum wrote: > You seem to have misread -- I don't want to check if they are exactly > 24 hours apart. I want to check if they are at most 24 hours apart. > The timezone can be assumed to be the same on dt1 and dt2. > > A variant of (1) was what was neede

Re: [Python-Dev] Issue 2736: datetimes and Unix timestamps

2012-06-04 Thread Alexander Belopolsky
On Mon, Jun 4, 2012 at 5:25 PM, Guido van Rossum wrote: .. > But I don't know what ticks() is supposed to do. """ .ticks(offset=0.0,dst=-1) Returns a float representing the instances value in ticks (see above). The conversion routine assumes that the stored date/time value is given in local tim

Re: [Python-Dev] Issue 2736: datetimes and Unix timestamps

2012-06-05 Thread Alexander Belopolsky
On Tue, Jun 5, 2012 at 9:45 AM, Guido van Rossum wrote: > TZ-less datetimes aren't going away and have > plenty of use in contexts where the tz is either universally known or > irrelevant. I agree, but in these contexts naive datetime objects almost always represent local time in some "universall

Re: [Python-Dev] Issue 2736: datetimes and Unix timestamps

2012-06-05 Thread Alexander Belopolsky
On Tue, Jun 5, 2012 at 1:41 PM, Guido van Rossum wrote: > What do they want to set the dst flag for? To shift the responsibility to deal with the DST ambiguity to the user. This is what POSIX mktime with varying degree of success. > I think I am advocating for the former but without the dst fl

Re: [Python-Dev] Issue 2736: datetimes and Unix timestamps

2012-06-05 Thread Alexander Belopolsky
On Tue, Jun 5, 2012 at 1:41 PM, Guido van Rossum wrote: > Maybe you need to get out more. :-) This is how datetime is > represented in App Engine's datastore: > https://developers.google.com/appengine/docs/python/datastore/typesandpropertyclasses#DateTimeProperty > (Note: These docs are unclear ab

[Python-Dev] TZ-aware local time

2012-06-05 Thread Alexander Belopolsky
Changing subject to reflect a change of topic. On Tue, Jun 5, 2012 at 2:19 PM, Guido van Rossum wrote: > .. Although if we ever get that "local time" tzinfo > object, we may regret it. So I propose to launch without it and see if > people object. There simply isn't a way to roundtrip for times th

Re: [Python-Dev] Issue 2736: datetimes and Unix timestamps

2012-06-05 Thread Alexander Belopolsky
On Tue, Jun 5, 2012 at 3:01 PM, Antoine Pitrou wrote: > You could say the same about equally "confusing" results, yet equality never > raises TypeError (except between datetime instances): > () == [] > False And even closer to home, >>> date(2012,6,1) == datetime(2012,6,1) False I agree, e

<    2   3   4   5   6   7   8   >