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. For
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 that
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 use
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
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
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 to
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
On Fri, Jun 7, 2013 at 10:50 AM, Mark Janssen dreamingforw...@gmail.com 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 using is
I should add that when you're
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 able to
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 ;-) Another
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
This is a
* 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 something
On Sun, May 19, 2013 at 1:13 PM, Tres Seaver tsea...@palladion.com 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
On Fri, Mar 22, 2013 at 2:48 AM, Antoine Pitrou solip...@pitrou.net wrote:
Le Thu, 21 Mar 2013 21:38:41 +0100,
Georg Brandl g.bra...@gmx.net a écrit :
Am 21.03.2013 19:13, schrieb Antoine Pitrou:
On Wed, 20 Mar 2013 19:57:54 -0700
Raymond Hettinger raymond.hettin...@gmail.com wrote:
On Wed, Mar 20, 2013 at 8:32 PM, Terry Reedy tjre...@udel.edu 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?
On Thu, Mar 21, 2013 at 2:31 PM, Oleg Broytman p...@phdru.name 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. Look at any hacker console and you
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 ba...@python.org wrote:
Right. Ultimately, I think IDLE should be a separate project entirely,
but I
guess there's push back against that too.
The most
On Sat, Feb 23, 2013 at 7:02 AM, Stefan Krah ste...@bytereef.org wrote:
eli.bendersky python-check...@python.org 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
On Sun, Jan 13, 2013 at 1:15 AM, Bruce Sherwood bruce_sherw...@ncsu.edu 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
On Sun, Jan 13, 2013 at 12:14 PM, Bruce Sherwood
bruce_sherw...@ncsu.edu 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
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
they
On Thu, Feb 9, 2012 at 5:18 PM, Guido van Rossum gu...@python.org 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
On Thu, Mar 1, 2012 at 10:00 AM, Guido van Rossum gu...@python.org 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
On Mon, Feb 6, 2012 at 6:12 PM, Steven D'Aprano st...@pearwood.info 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
On Thu, Apr 14, 2011 at 7:09 AM, Ricardo Kirkner
ricardokirk...@gmail.com 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
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:
On Sat, Mar 19, 2011 at 12:59 PM, Raymond Hettinger
raymond.hettin...@gmail.com 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
27 matches
Mail list logo