Re: [Python-Dev] (#19562) Asserts in Python stdlib code (datetime.py)

2013-11-15 Thread Mark Janssen
> Should stdlib code use assert at all? > > If user input can trigger an assert, then the code should raise a normal > exception that will not disappear with -OO. > > If the assert is testing program logic, then it seems that the test belongs > in the test file, in this case, test/test_datetime.py.

Re: [Python-Dev] VAX NaN evaluations

2013-11-04 Thread Mark Janssen
> We'd have to have one uncommor and two extremely unlikely events all happen > simultaneously for your example to be of concern: Understood. But when things run millions of times a second, "extremely unlikely" things can happen more often that you wanted. > Two, someone would have to decide to

Re: [Python-Dev] VAX NaN evaluations

2013-11-04 Thread Mark Janssen
I think I spoke to soon on my earlier reply. If you have control over the whole system, you could *set* policy on behalf of a whole platform (like VAX) so you can "safely" use an otherwise non-normal set of bits to designate divide by zero (a negative sign bit with the rest all zeros, for example

Re: [Python-Dev] VAX NaN evaluations

2013-11-04 Thread Mark Janssen
> The nice Python folks who were at SCALE in Los Angeles last year gave me a > Python t-shirt for showing Python working on m68k and for suggesting that > I'd get it working on VAX. With libffi support for VAX from Miod Vallat, > this is now possible. > > However, when compiling Python, it seems th

Re: [Python-Dev] PEP 455: TransformDict

2013-10-07 Thread Mark Janssen
Sorry I missed the original discussion, but isn't this a simple case of putting a decorator around the getitem method (to transform the input key) and a single line in the body of the setitem method, making this very easy adaptation of the existing dict class? Mark

Re: [Python-Dev] End of the mystery "@README.txt Mercurial bug"

2013-06-25 Thread Mark Janssen
> One month ago, unit tests were added to IDLE (cool!) with a file > called @README.txt. The @ was used to see the name on top in a listing > of the directory. It's like this. Whenever you use special characters in a file name, you're asking for trouble. The shell and the OS have negotiate how t

Re: [Python-Dev] End of the mystery "@README.txt Mercurial bug"

2013-06-25 Thread Mark Janssen
> It's like this. Whenever you use special characters in a file name, > you're asking for trouble. The shell and the OS have negotiate how to > interpret it. It bigger than git, and not a bug. Sorry, I meant mercurial, not git. -- MarkJ Tacoma, Washington __

Re: [Python-Dev] doctest and pickle

2013-06-07 Thread Mark Janssen
>> Why are you using is here instead of ==? > > > I'm using `is` because I'm verifying that the instance returned by > `pickle.loads` is the exact same object as the instance fed into > `pickle.dumps`. Enum members should be singletons. I see now. That makes sense, but I don't think you'll be ab

Re: [Python-Dev] doctest and pickle

2013-06-07 Thread Mark Janssen
On Fri, Jun 7, 2013 at 10:50 AM, Mark Janssen wrote: >> >>> from pickle import dumps, loads >> >>> Fruit.tomato is loads(dumps(Fruit.tomato)) >> True > > Why are you using is here instead of ==? You're making a circular > loop usi

Re: [Python-Dev] doctest and pickle

2013-06-07 Thread Mark Janssen
> >>> from pickle import dumps, loads > >>> Fruit.tomato is loads(dumps(Fruit.tomato)) > True Why are you using is here instead of ==? You're making a circular loop using "is" -- MarkJ Tacoma, Washington ___ Python-Dev mailing list Python-D

Re: [Python-Dev] Purpose of Doctests [Was: Best practices for Enum]

2013-05-20 Thread Mark Janssen
>> * Doctests practically beg you to write your code first and then copy and >> paste terminal sessions - they're the enemy of TDD > > Of course , not , all the opposite . If the approach is understood > correctly then the first thing test author will do is to write the > code «expected» to get som

Re: [Python-Dev] What if we didn't have repr?

2013-05-20 Thread Mark Janssen
> I have pondered it many times, although usually in the form "Why do we > need both str and repr?" Here's an idea: considering python objects are "stateful". Make a general, state-query operator: "?". Then the distinction is clear. >>> ?"This is a string" #Returns the contents of the string

Re: [Python-Dev] Purpose of Doctests [Was: Best practices for Enum]

2013-05-20 Thread Mark Janssen
>> I'm hoping that core developers don't get caught-up in the "doctests are bad >> meme". >> >> Instead, we should be clear about their primary purpose which is to test >> the examples given in docstrings. >> In other words, doctests have a perfectly legitimate use case. > > But more than just one

Re: [Python-Dev] Purpose of Doctests [Was: Best practices for Enum]

2013-05-19 Thread Mark Janssen
On Sun, May 19, 2013 at 1:13 PM, Tres Seaver wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 05/19/2013 10:48 AM, Guido van Rossum wrote: >> Anyway, if you're doing arithmetic on enums you're doing it wrong. > > Hmm, bitwise operations, even? I think it's rather pointless to do bi

Re: [Python-Dev] IDLE in the stdlib

2013-03-22 Thread Mark Janssen
On Fri, Mar 22, 2013 at 2:48 AM, Antoine Pitrou wrote: > Le Thu, 21 Mar 2013 21:38:41 +0100, > Georg Brandl a écrit : > > > Am 21.03.2013 19:13, schrieb Antoine Pitrou: > > > On Wed, 20 Mar 2013 19:57:54 -0700 > > > Raymond Hettinger wrote: > > >> > > >> On Mar 20, 2013, at 12:38 PM, Barry Wars

Re: [Python-Dev] IDLE in the stdlib

2013-03-21 Thread Mark Janssen
On Thu, Mar 21, 2013 at 2:31 PM, Oleg Broytman wrote: > On Thu, Mar 21, 2013 at 02:19:33PM -0700, Mark Janssen < > dreamingforw...@gmail.com> wrote: > > The *only* thing I find "ugly" about it is that it doesn't have a > > white-on-black color scheme. L

Re: [Python-Dev] IDLE in the stdlib

2013-03-21 Thread Mark Janssen
On Wed, Mar 20, 2013 at 8:32 PM, Terry Reedy wrote: > On 3/20/2013 12:41 PM, Eli Bendersky wrote: > > Personally, I think that IDLE reflects badly on Python in more ways than >> one. It's badly maintained, quirky and ugly. >> > > Ugly is subjective: by what standard and compared to what? > I mi

Re: [Python-Dev] IDLE in the stdlib

2013-03-20 Thread Mark Janssen
On Wed, Mar 20, 2013 at 7:57 PM, Raymond Hettinger < raymond.hettin...@gmail.com> wrote: > > On Mar 20, 2013, at 12:38 PM, Barry Warsaw wrote: > > Right. Ultimately, I think IDLE should be a separate project entirely, > but I > guess there's push back against that too. > > > The most important f

Re: [Python-Dev] [Python-checkins] peps: Pre-alpha draft for PEP 435 (enum). The name is not important at the moment, as

2013-02-23 Thread Mark Janssen
On Sat, Feb 23, 2013 at 7:02 AM, Stefan Krah wrote: > eli.bendersky wrote: >> +Ordered comparisons between enumeration values are *not* supported. Enums >> are >> +not integers! I agree with your idea, but note you probably shouldn't call them e-num-erations, then. > Hmm. I think this limits

[Python-Dev] [Visualpython-users] How VPython 6 differs from VPython 5

2013-01-13 Thread Mark Janssen
> Since this was copied to the Python-Dev list, I want to go on record as > stating firmly that there is no evidence whatsoever to substantiate claims > that there has ever been some kind of conflict between VPython and Python. My apologies, Bruce, I didn't mean for that second message to go to th

Re: [Python-Dev] [Visualpython-users] How VPython 6 differs from VPython 5

2013-01-13 Thread Mark Janssen
On Sun, Jan 13, 2013 at 12:14 PM, Bruce Sherwood wrote: > For the record, I do not know of any evidence whatsoever for a supposed > "split" between the tiny VPython community and the huge Python community > concerning floating point variables. Nor do I see anything in Python that > needs to be "fi

Re: [Python-Dev] [Visualpython-users] How VPython 6 differs from VPython 5

2013-01-13 Thread Mark Janssen
On Sun, Jan 13, 2013 at 1:15 AM, Bruce Sherwood wrote: > Here is detailed information on how VPython 6 differs from VPython 5, which > will be incorporated in the Help for upcoming releases of VPython 6. Note > that the fact that in a main program __name__ isn't '__main__' is an > unavoidable "fea

[Python-Dev] PEP

2012-03-08 Thread Mark Janssen
On Thu, Feb 9, 2012 at 5:18 PM, Guido van Rossum wrote: > A dictionary would (then) be a SET of these. (Voila! things have already >> gotten simplified.) >> > > Really? So {a:1, a:2} would be a dict of length 2? > Eventually, I also think this will seque and integrate nicely into Mark >> Shan

Re: [Python-Dev] Add a frozendict builtin type

2012-03-01 Thread Mark Janssen
On Thu, Mar 1, 2012 at 10:00 AM, Guido van Rossum wrote: > > I do know that I don't feel comfortable having a sandbox in the Python > standard library or even recommending a 3rd party sandboxing solution > -- if someone uses the sandbox to protect a critical resource, and a > hacker breaks out of

[Python-Dev] [Python-ideas] matrix operations on dict :)

2012-02-07 Thread Mark Janssen
On Mon, Feb 6, 2012 at 6:12 PM, Steven D'Aprano wrote: > On Mon, Feb 06, 2012 at 09:01:29PM +0100, julien tayon wrote: > > Hello, > > > > Proposing vector operations on dict, and acknowledging there was an > > homeomorphism from rooted n-ary trees to dict, was inducing the > > possibility of maki

Re: [Python-Dev] python and super

2011-04-16 Thread Mark Janssen
Argh! Sorry list. I meant to discard the post that was just sent. Please accept my humblest apologies... Mark ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mai

Re: [Python-Dev] python and super

2011-04-16 Thread Mark Janssen
On Thu, Apr 14, 2011 at 7:09 AM, Ricardo Kirkner wrote: > I recently stumbled upon an issue with a class in the mro chain not > calling super, therefore breaking the chain (ie, further base classes > along the chain didn't get called). > I understand it is currently a requirement that all classes

Re: [Python-Dev] I am now lost - committed, pulled, merged, what is "collapse"?

2011-03-19 Thread Mark Janssen
On Sat, Mar 19, 2011 at 12:59 PM, Raymond Hettinger wrote: > On Mar 19, 2011, at 11:21 AM, Antoine Pitrou wrote: >> On Sat, 19 Mar 2011 09:25:07 -0500 >> s...@pobox.com wrote: >> >>> The dev guide says something about collapsing changesets.  Is that >>> collapsing commits within a changeset or col