> 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.
> 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
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
> 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
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
> 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
> 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
__
>> 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
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
> >>> 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
>> * 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
> 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
>> 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
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
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
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
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
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
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
> 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
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
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
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
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
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
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
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
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
28 matches
Mail list logo