Re: What's the best way to minimize the need of run time checks?

2016-08-09 Thread Michael Selik
On Wed, Aug 10, 2016 at 1:22 AM Juan Pablo Romero Méndez < jpablo.rom...@gmail.com> wrote: > 1) catching exceptions at the point where you care, 2) > preemptively check for certain runtime conditions to avoid exceptions 3) > write as many tests as possible 4) learn to live with runtime errors. >

Re: Python slang

2016-08-09 Thread Lawrence D’Oliveiro
On Monday, August 8, 2016 at 9:02:15 PM UTC+12, Anders J. Munch wrote: > It was only later that language designers fell into the notion that it > was crucial for a new language's success to look as much like C++ as > possible. Nevertheless, Python copied the C misfeature of using “=” for

Re: How do I make a video animation with transparent background?

2016-08-09 Thread Dale Marvin via Python-list
On 8/9/16 6:50 PM, Lawrence D’Oliveiro wrote: On Wednesday, August 10, 2016 at 12:44:30 AM UTC+12, Martin Schöön wrote: What I have failed to achieve is a graph with a transparent background. While it is possible to render image frames with alpha transparency channels, as far as I know none

[issue27209] Failing doctests in Library/email.*.rst

2016-08-09 Thread Zachary Ware
Zachary Ware added the comment: Thanks for the patch! -- nosy: +zach.ware type: -> behavior versions: +Python 3.5 ___ Python tracker ___

[issue27209] Failing doctests in Library/email.*.rst

2016-08-09 Thread Roundup Robot
New submission from Roundup Robot: New changeset bb443518141e by Zachary Ware in branch '3.5': Issue #27209: Fix doctests in Doc/library/email*.rst https://hg.python.org/cpython/rev/bb443518141e New changeset 81dc2d250209 by Zachary Ware in branch 'default': Closes #27209: Merge with 3.5

[issue27208] Failing doctests in Library/traceback.rst

2016-08-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset eadf2905f424 by Zachary Ware in branch '3.5': Issue #27208: Fix doctest in Doc/library/traceback.rst https://hg.python.org/cpython/rev/eadf2905f424 New changeset 76c04e780cd5 by Zachary Ware in branch 'default': Closes #27208: Merge with 3.5

[issue27208] Failing doctests in Library/traceback.rst

2016-08-09 Thread Zachary Ware
Zachary Ware added the comment: Thanks for the patch! -- nosy: +zach.ware type: -> behavior versions: +Python 3.5 ___ Python tracker ___

[issue27207] Failing doctests in Doc/whatsnew/3.2.rst

2016-08-09 Thread Zachary Ware
Zachary Ware added the comment: Thanks for the patch! I added a couple more skips to get everything passing (the ones I skipped could not be properly tested). -- nosy: +zach.ware type: -> behavior versions: +Python 3.5 ___ Python tracker

[issue27207] Failing doctests in Doc/whatsnew/3.2.rst

2016-08-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset cee3074233e6 by Zachary Ware in branch '3.5': Issue #27207: Fix doctests in Doc/whatsnew/3.2.rst https://hg.python.org/cpython/rev/cee3074233e6 New changeset ea43895ebfd9 by Zachary Ware in branch 'default': Closes #27207: Merge with 3.5

Individuals and groups (was Specify the database for a Django)

2016-08-09 Thread Rustom Mody
On Wednesday, August 10, 2016 at 6:39:31 AM UTC+5:30, Ben Finney wrote: > -- > \ “I love and treasure individuals as I meet them, I loathe and | > `\ despise the groups they identify with and belong to.” —George | > _o__) Carlin,

free python course materials for high school students available

2016-08-09 Thread Kent Tong
Hi, I've taught a python course with some positive results to high school students with zero experience in programming. Now I am making these course materials (slides in English and lecture videos in Cantonese) freely available as a contribution back to the community

Re: What's the best way to minimize the need of run time checks?

2016-08-09 Thread Juan Pablo Romero Méndez
2016-08-09 18:28 GMT-07:00 Steven D'Aprano : > On Wed, 10 Aug 2016 04:29 am, Juan Pablo Romero Méndez wrote: > > > Hello, > > > > In online forums sometimes people complain that they end up having to > test > > constantly for None, > > Then don't return None to

Re: Make sure you removed all debugging print statements error

2016-08-09 Thread Steven D'Aprano
On Wednesday 10 August 2016 12:53, Lawrence D’Oliveiro wrote: > On Tuesday, August 9, 2016 at 4:20:37 AM UTC+12, Chris Angelico wrote: >> Firstly, the bare "except:" clause should basically never be used; >> instead, catch a very specific exception and figure out what you want to >> do here > >

[issue27687] Linux shutil.move between mountpoints as root does not retain ownership

2016-08-09 Thread Antti Haapala
Antti Haapala added the comment: And as it is documented, it would be a change against documentation. However as a stop-gap it is rather trivial to make your own copy function to fix this. copy2 returns the actual destination, so you could do def copy_with_ownership(src, dest, *,

Re: How do I make a video animation with transparent background?

2016-08-09 Thread Steven D'Aprano
On Wednesday 10 August 2016 12:49, Lawrence D’Oliveiro wrote: > On Wednesday, August 10, 2016 at 2:04:39 PM UTC+12, Chris Angelico wrote: > >> Animated GIFs support transparency. > > But they don’t do full colour. Define "full colour". GIFs don't directly support 16-bit or 32-bit colours in a

[issue27722] Path.touch's keyword argument mode documented incorrectly

2016-08-09 Thread Zachary Ware
Zachary Ware added the comment: Yes, but 3.4 is out of bugfix maintenance and thus its docs are no longer updated. -- status: open -> closed versions: -Python 3.4 ___ Python tracker

[issue23591] Add Flags and IntFlags

2016-08-09 Thread Ethan Furman
Ethan Furman added the comment: The idea behind Flags is that they are easily combined enums. The advantage they have over IntFlags is they do not interact with integers, and they cannot have non-existing values used. By keeping the same API as IntFlags we only have two APIs instead of

Round-Trip Object Correspondence, Weakrefs And __new__

2016-08-09 Thread Lawrence D’Oliveiro
Qahirah is a Pythonic API binding for the Cairo 2D graphics library. When designing it, I tried to imagine how the graphics API would look if had been created for Python in the first place, rather than for C. One of the important decisions I made was to

[issue12345] Add math.tau

2016-08-09 Thread Tim Peters
Tim Peters added the comment: Hmm. I'd test that tau is exactly equal to 2*pi. All Python platforms (past, present, and plausible future ones) have binary C doubles, so the only difference between pi and 2*pi _should_ be in the exponent (multiplication by 2 is exact). Else we screwed up

Re: What's the best way to minimize the need of run time checks?

2016-08-09 Thread Michael Torrie
On 08/09/2016 02:51 PM, Juan Pablo Romero Méndez wrote: > 2016-08-09 13:18 GMT-07:00 Rob Gaddi : >> It's not a style, it's the absence of one. >> >> def add2list(lst, elem): >> lst.extend([elem, elem]) >> return lst >> >> I did all the type checking I

cmd prompt does not recognizes python command on Windows 7

2016-08-09 Thread sh . ajay12
Hi Everyone i have installed python 3.5 , but the python command is not recognized C:\Users\sharmaaj>python 'python' is not recognized as an internal or external command, operable program or batch file. what should i do to run python commands. thanks everyone for reading my post. >From

[issue27722] Path.touch's keyword argument mode documented incorrectly

2016-08-09 Thread Ankur Dedania
Ankur Dedania added the comment: Path.touch is also incorrect in python 3.4 documents -- status: closed -> open versions: +Python 3.4 ___ Python tracker

[issue12345] Add math.tau

2016-08-09 Thread Guido van Rossum
Guido van Rossum added the comment: OK, here's a diff with a test that math.tau ~~ 2*math.pi. -- Added file: http://bugs.python.org/file44065/tau2.diff ___ Python tracker

[issue27708] Rounding/Large Int representation error with multiplication and division

2016-08-09 Thread Eric V. Smith
Changes by Eric V. Smith : -- title: Roudning/Large Int representation error with multiplication and division -> Rounding/Large Int representation error with multiplication and division ___ Python tracker

[issue27708] Roudning/Large Int representation error with multiplication and division

2016-08-09 Thread Eric V. Smith
Eric V. Smith added the comment: Thanks for giving an example. You misunderstand how the "/" operator works in python 3.x: the result is always a float. If you use "//", you'll get an integer: >>>

[issue12345] Add math.tau

2016-08-09 Thread Zachary Ware
Zachary Ware added the comment: Builds fine on Windows. Happily, `math.tau == 2*math.pi` is True. -- nosy: +zach.ware stage: needs patch -> commit review versions: +Python 3.6 ___ Python tracker

[issue27712] Tiny typos in import.rst

2016-08-09 Thread Martin Panter
New submission from Martin Panter: Looks good to me -- nosy: +martin.panter stage: -> commit review versions: +Python 3.5 ___ Python tracker ___

[issue27708] Roudning/Large Int representation error with multiplication and division

2016-08-09 Thread Ethan Glass
Ethan Glass added the comment: As I said in a previous post, the numbers used are not stored. I ran the algorithm again in the shell with the following result. >>>4332802906202498030216332367377544549613239461769577836837704406332963931535527253995277986388432*8

[issue19489] move quick search box above TOC

2016-08-09 Thread Ammar Askar
Ammar Askar added the comment: > 1. It would be better to make "Quick search" a placeholder Do you mean in addition to the "Quick search" text that is already on the page or do you want to remove that? Because placeholder isn't fully compatible with some older browsers

[issue26686] email.parser stops parsing headers too soon when given a defective message.

2016-08-09 Thread Martin Panter
Martin Panter added the comment: . It would be nice to get feedback if my patch is sensible, especially from people familiar with normal usage of the “email” module, as opposed with the usage by the HTTP module. -- stage: -> patch review ___

Re: Make sure you removed all debugging print statements error

2016-08-09 Thread Lawrence D’Oliveiro
On Tuesday, August 9, 2016 at 4:20:37 AM UTC+12, Chris Angelico wrote: > Firstly, the bare "except:" clause should basically never be used; > instead, catch a very specific exception and figure out what you want to > do here Yes. > - but secondly, don't force people's names to be subdivided. I

Re: How do I make a video animation with transparent background?

2016-08-09 Thread Lawrence D’Oliveiro
On Wednesday, August 10, 2016 at 2:04:39 PM UTC+12, Chris Angelico wrote: > Animated GIFs support transparency. But they don’t do full colour. -- https://mail.python.org/mailman/listinfo/python-list

[issue27716] http.client truncates UTF-8 encoded headers

2016-08-09 Thread Martin Panter
Martin Panter added the comment: For the test case given, the main problem is actually that a header field is being incorrectly split on a Latin-1 “next line” control code U+0085. The problem is already described under Issue 22233. It looks like I wrote a patch for that a while ago, so it

Re: ctypes And The WACAH Principle

2016-08-09 Thread Steven D'Aprano
On Wed, 10 Aug 2016 11:45 am, Lawrence D’Oliveiro wrote: > GvR has said “we’re all consenting adults here”. He was referring to the > “public/private/protected” access-control business that most > object-oriented languages require you to go through. But there is another > area where I think this

Re: How do I make a video animation with transparent background?

2016-08-09 Thread Chris Angelico
On Wed, Aug 10, 2016 at 11:50 AM, Lawrence D’Oliveiro wrote: > On Wednesday, August 10, 2016 at 12:44:30 AM UTC+12, Martin Schöön wrote: > >> What I have failed to achieve is a graph with a transparent >> background. > > While it is possible to render image frames with

Re: What's the best way to minimize the need of run time checks?

2016-08-09 Thread Chris Angelico
On Wed, Aug 10, 2016 at 11:47 AM, Steven D'Aprano wrote: > On Wed, 10 Aug 2016 11:02 am, Chris Angelico wrote: > >> On Wed, Aug 10, 2016 at 10:58 AM, Juan Pablo Romero Méndez >> wrote: > >>> This is interesting. You are Ok having runtime

Re: How do I make a video animation with transparent background?

2016-08-09 Thread Lawrence D’Oliveiro
On Wednesday, August 10, 2016 at 12:44:30 AM UTC+12, Martin Schöön wrote: > What I have failed to achieve is a graph with a transparent > background. While it is possible to render image frames with alpha transparency channels, as far as I know none of the motion-video image formats supports

Re: What's the best way to minimize the need of run time checks?

2016-08-09 Thread Steven D'Aprano
On Wed, 10 Aug 2016 11:02 am, Chris Angelico wrote: > On Wed, Aug 10, 2016 at 10:58 AM, Juan Pablo Romero Méndez > wrote: >> This is interesting. You are Ok having runtime errors? > > Absolutely. In real terms, there's no difference between "compile-time > error" and

ctypes And The WACAH Principle

2016-08-09 Thread Lawrence D’Oliveiro
GvR has said “we’re all consenting adults here”. He was referring to the “public/private/protected” access-control business that most object-oriented languages require you to go through. But there is another area where I think this principle applies to Python, at least in part: low-level access

[issue12345] Add math.tau

2016-08-09 Thread Guido van Rossum
Changes by Guido van Rossum : -- keywords: +patch Added file: http://bugs.python.org/file44063/tau.diff ___ Python tracker ___

[issue12345] Add math.tau

2016-08-09 Thread Guido van Rossum
Guido van Rossum added the comment: I'm just going to do this. -- assignee: -> gvanrossum resolution: rejected -> status: closed -> open ___ Python tracker

[issue27723] Document typing.Text and typing.AnyStr

2016-08-09 Thread Michael Lee
New submission from Michael Lee: This patch documents typing.Text and typing.AnyStr. I decided against creating a new top-level section to document Text/AnyStr mainly because it seems like how exactly str/bytes/unicode is handled by mypy and described in PEP 484 might be changing sometime in

Re: What's the best way to minimize the need of run time checks?

2016-08-09 Thread Steven D'Aprano
On Wed, 10 Aug 2016 06:51 am, Juan Pablo Romero Méndez wrote: > 2016-08-09 13:18 GMT-07:00 Rob Gaddi : >> It's not a style, it's the absence of one. >> >> def add2list(lst, elem): >> lst.extend([elem, elem]) >> return lst >> >> I did all the type

Re: What's the best way to minimize the need of run time checks?

2016-08-09 Thread Steven D'Aprano
On Wed, 10 Aug 2016 04:29 am, Juan Pablo Romero Méndez wrote: > Hello, > > In online forums sometimes people complain that they end up having to test > constantly for None, Then don't return None to indicate an error. If you write this: def create_spam(arg): if condition: return

Re: Specify the database for a Django ModelForm instance

2016-08-09 Thread Ben Finney
Phil Boutros writes: > Ben Finney wrote: > > How can I specify which database (by its alias name) a Django > > ModelForm should use > > > What is the equivalent for using='foo' when instantiating a ModelForm > > for the model, or calling its methods

[issue27414] http.server.BaseHTTPRequestHandler inconsistence with Content-Length value

2016-08-09 Thread Martin Panter
Changes by Martin Panter : -- stage: -> needs patch ___ Python tracker ___ ___

Re: Call for Assistance

2016-08-09 Thread Charles Ross
Well, I’ve been convinced. The license for the book is now Creative Commons Attribution-ShareAlike. https://github.com/chivalry/meta-python/blob/master/LICENSE.md Thanks, Chuck > On Aug 9, 2016, at 3:00 PM, Charles Ross wrote: > >> CC-BY-NC-SA is not a license for free (as

Re: What's the best way to minimize the need of run time checks?

2016-08-09 Thread Chris Angelico
On Wed, Aug 10, 2016 at 10:58 AM, Juan Pablo Romero Méndez wrote: >> I don't check for file-likeness in the application code. If somehow a >> non-file-like (file-unlike?) object makes its way into my function, I >> expect (and hope) my program will immediately stop and

Re: Invalid Syntax

2016-08-09 Thread Steven D'Aprano
On Wed, 10 Aug 2016 06:20 am, Ltc Hotspot wrote: > Hi, Everyone: > > What is the source of the following, > 'error message: SyntaxError: invalid syntax (, line 2)' > > v. Python 3.3 > > Code reads: > > x=1 > if x==1 > # indent 4 spaces > print "x = 1" > > Hal The error message tells

Re: What's the best way to minimize the need of run time checks?

2016-08-09 Thread Juan Pablo Romero Méndez
2016-08-09 14:01 GMT-07:00 Michael Selik : > On Tue, Aug 9, 2016 at 3:22 PM Juan Pablo Romero Méndez < > jpablo.rom...@gmail.com> wrote: > >> I'm actually looking for ways to minimize run time errors, so that would >> include TypeError and AttributeError. >> >> In your

[issue26081] Implement asyncio Future in C to improve performance

2016-08-09 Thread Yury Selivanov
Yury Selivanov added the comment: I'd also think about implementing asyncio.Handle in C (with a freelist). -- ___ Python tracker ___

[issue27721] distutils strtobool returns 0 and 1 rather than False and True

2016-08-09 Thread Ned Deily
Ned Deily added the comment: Joseph, thanks for taking an interest in improving Python and submitting this patch. Alas, I don't think we should apply it. There are always tradeoffs that have to be considered when changing existing code. Distutils is one of the oldest and most external

[issue27720] decimal.Context.to_eng_string wrong docstring

2016-08-09 Thread Berker Peksag
Changes by Berker Peksag : -- nosy: +skrah ___ Python tracker ___ ___

[issue27719] Misleading note about "args" attribute in "User-defined Exceptions" section of tutorial

2016-08-09 Thread Berker Peksag
Berker Peksag added the comment: Thank you for your detailed report! Would you like to propose a patch? This behavior is already tested in testAttributes in Lib/test/test_exceptions.py so we just need a documentation patch. -- keywords: +easy nosy: +berker.peksag stage: -> needs

[issue27721] distutils strtobool returns 0 and 1 rather than False and True

2016-08-09 Thread Berker Peksag
Berker Peksag added the comment: Could you also update documentation in Doc/distutils/apiref.rst? Also, test_strtobool in Lib/distutils/tests/test_util.py doesn't test the following case: >>> from distutils.util import strtobool >>> strtobool('x') Traceback (most recent call

[issue21018] [patch] added missing documentation about escaping characters for configparser

2016-08-09 Thread Berker Peksag
Berker Peksag added the comment: Thanks for the patch. Two things: * We want to keep docstrings short so could you please revert the changes in Lib/configparser.py? * It would be better to just add an example of escaping these characters in the "Interpolation of values" section (preferably

[issue27392] Add a server_side keyword parameter to create_connection

2016-08-09 Thread Yury Selivanov
Yury Selivanov added the comment: > WRT boolean for SSL, I think it's very common for clients to verify server > certificates, but relatively uncommon for servers to require client > certificates. The impression I have from reading docs and stack overflow > posts that the most common use

Re: Invalid Syntax

2016-08-09 Thread cs
On 09Aug2016 20:22, Rob Gaddi wrote: Ltc Hotspot wrote: What is the source of the following, 'error message: SyntaxError: invalid syntax (, line 2)' v. Python 3.3 Code reads: x=1 if x==1 # indent 4 spaces print "x = 1" A missing colon, the

[issue19489] move quick search box above TOC

2016-08-09 Thread Berker Peksag
Berker Peksag added the comment: This looks pretty good to me, thanks! I have two minor suggestions: 1. It would be better to make "Quick search" a placeholder: 2. will add an unnecessary border in search page. I'd change it to

[issue26081] Implement asyncio Future in C to improve performance

2016-08-09 Thread Yury Selivanov
Yury Selivanov added the comment: > What parts of Future are performance critical? Maybe it is worth to implement > in C only the most critical code. Basically everything. Contrary to @contextmanager, Futures are the building blocks of asyncio, so instantiation + awaiting on them + setting

Re: Call for Assistance

2016-08-09 Thread Charles Ross
> CC-BY-NC-SA is not a license for free (as in speech) content. Is that > what you want? I really appreciate all the conversation about the license. Perhaps I made a mistake with requiring noncommercial in the license, I don’t know, but I’ll look at the links provided about free documentation

[issue27206] Failing doctests in Doc/tutorial/

2016-08-09 Thread Zachary Ware
Zachary Ware added the comment: Thanks for the patch! -- assignee: docs@python -> zach.ware nosy: +zach.ware type: -> behavior versions: +Python 3.5 ___ Python tracker

[issue27206] Failing doctests in Doc/tutorial/

2016-08-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset 8b7efeeefa50 by Zachary Ware in branch '3.5': Issue #27206: Fix doctests in Doc/tutorial. https://hg.python.org/cpython/rev/8b7efeeefa50 New changeset 61d7aeb6aa1b by Zachary Ware in branch 'default': Closes #27206: Merge with 3.5

[issue27205] Failing doctests in Library/collections.rst

2016-08-09 Thread Zachary Ware
Zachary Ware added the comment: Thanks for the patch! -- assignee: docs@python -> zach.ware nosy: +zach.ware type: -> behavior versions: +Python 2.7, Python 3.5 ___ Python tracker

[issue27205] Failing doctests in Library/collections.rst

2016-08-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset e399930d14f0 by Zachary Ware in branch '2.7': Issue #27205: Fix doctests in Doc/library/collections.rst https://hg.python.org/cpython/rev/e399930d14f0 New changeset 0d95e47cfe3e by Zachary Ware in branch '3.5': Issue #27205: Fix doctests in

[issue27713] Spurious "platform dependent libraries" warnings when running make

2016-08-09 Thread Ned Deily
Changes by Ned Deily : -- components: +Build -Installation nosy: +ned.deily stage: -> needs patch versions: +Python 3.6 ___ Python tracker

[issue27204] Failing doctests in Doc/howto/

2016-08-09 Thread Zachary Ware
Zachary Ware added the comment: Thanks for the patch! -- assignee: -> zach.ware components: +Documentation nosy: +zach.ware type: -> behavior versions: +Python 2.7, Python 3.5, Python 3.6 ___ Python tracker

[issue27722] Path.touch's keyword argument mode documented incorrectly

2016-08-09 Thread Zachary Ware
Zachary Ware added the comment: Thanks for the report! -- nosy: +zach.ware versions: -Python 3.4 ___ Python tracker ___

[issue27722] Path.touch's keyword argument mode documented incorrectly

2016-08-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset 773bc9a3172d by Zachary Ware in branch '3.5': Issue #27722: Fix default for touch method's 'mode' argument https://hg.python.org/cpython/rev/773bc9a3172d New changeset 763d98f0a105 by Zachary Ware in branch 'default': Closes #27722: Merge with 3.5

[issue27204] Failing doctests in Doc/howto/

2016-08-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset 0eaa05a3db02 by Zachary Ware in branch '2.7': Issue #27204: Fix doctests in Doc/howto https://hg.python.org/cpython/rev/0eaa05a3db02 New changeset df92f9856b59 by Zachary Ware in branch '3.5': Issue #27204: Fix doctests in Doc/howto

[issue27722] Path.touch's keyword argument mode documented incorrectly

2016-08-09 Thread Ankur Dedania
New submission from Ankur Dedania: Path.touch's keyword argument mode documented incorrectly. In the documents, it shows keyword argument mode defaulted to 0o777, however within the code it is set to 0o666. -- assignee: docs@python components: Documentation messages: 272269 nosy:

[issue27200] make doctest in CPython has failures

2016-08-09 Thread Zachary Ware
Changes by Zachary Ware : -- nosy: +zach.ware ___ Python tracker ___ ___

[issue27128] Add _PyObject_FastCall()

2016-08-09 Thread STINNER Victor
STINNER Victor added the comment: > Benchmarking results look nice, but despite the fact that this patch is only small part of issue26814, it looks to me larger that it could be. Oh I failed to express my intent. This initial patch is not expected to introduce any speedup. In fact I noticed

Re: What's the best way to minimize the need of run time checks?

2016-08-09 Thread Rob Gaddi
Juan Pablo Romero Méndez wrote: > 2016-08-09 13:18 GMT-07:00 Rob Gaddi : > >> Juan Pablo Romero Méndez wrote: >> >> > 2016-08-09 12:06 GMT-07:00 Paul Rubin : >> > >> >> Juan Pablo Romero Méndez writes: >> >> >

Re: What's the best way to minimize the need of run time checks?

2016-08-09 Thread Michael Selik
On Tue, Aug 9, 2016 at 3:22 PM Juan Pablo Romero Méndez < jpablo.rom...@gmail.com> wrote: > I'm actually looking for ways to minimize run time errors, so that would > include TypeError and AttributeError. > > In your "File-like" example having type information would prevent me from > even passing

Re: What's the best way to minimize the need of run time checks?

2016-08-09 Thread Random832
On Tue, Aug 9, 2016, at 16:51, Juan Pablo Romero Méndez wrote: > So as the writer of the function you expect the user to read the function > body to determine what is safe to pass or not? How about expecting them to read the docstring? -- https://mail.python.org/mailman/listinfo/python-list

Re: What's the best way to minimize the need of run time checks?

2016-08-09 Thread Juan Pablo Romero Méndez
2016-08-09 13:18 GMT-07:00 Rob Gaddi : > Juan Pablo Romero Méndez wrote: > > > 2016-08-09 12:06 GMT-07:00 Paul Rubin : > > > >> Juan Pablo Romero Méndez writes: > >> > In online forums sometimes people complain

Re: What's the best way to minimize the need of run time checks?

2016-08-09 Thread Michael Selik
On Tue, Aug 9, 2016 at 2:59 PM Chris Angelico wrote: > On Wed, Aug 10, 2016 at 4:51 AM, Michael Selik > wrote: > > "File-like" is a good example. Rather than go through the frustration of > a > > formal definition for what is file-like, stay productive

[issue27721] distutils strtobool returns 0 and 1 rather than False and True

2016-08-09 Thread SilentGhost
SilentGhost added the comment: LGTM -- stage: -> commit review ___ Python tracker ___ ___ Python-bugs-list

Re: cropping a random part of an image

2016-08-09 Thread Robin Koch
Am 09.08.2016 um 14:40 schrieb drewes@gmail.com: I'm new to python and I have 30.000 pictures. I need to crop, let's say 100, parts of 256x256, randomly out of every picture. Interessting task. May I ask for the purose of this? I cant find an answer in the net, would be nice if someone

Re: Invalid Syntax

2016-08-09 Thread Rob Gaddi
Ltc Hotspot wrote: > Hi, Everyone: > > What is the source of the following, > 'error message: SyntaxError: invalid syntax (, line 2)' > > v. Python 3.3 > > Code reads: > > x=1 > if x==1 > # indent 4 spaces > print "x = 1" > > Hal A missing colon, the appropriate location of which is

Invalid Syntax

2016-08-09 Thread Ltc Hotspot
Hi, Everyone: What is the source of the following, 'error message: SyntaxError: invalid syntax (, line 2)' v. Python 3.3 Code reads: x=1 if x==1 # indent 4 spaces print "x = 1" Hal -- https://mail.python.org/mailman/listinfo/python-list

Re: What's the best way to minimize the need of run time checks?

2016-08-09 Thread Rob Gaddi
Juan Pablo Romero Méndez wrote: > 2016-08-09 12:06 GMT-07:00 Paul Rubin : > >> Juan Pablo Romero Méndez writes: >> > In online forums sometimes people complain that they end up having to >> > test constantly for None >> >> That's something of a

[issue27721] distutils strtobool returns 0 and 1 rather than False and True

2016-08-09 Thread Joseph Bane
Joseph Bane added the comment: Thank you for the feedback. Please find an updated patch attached. -- Added file: http://bugs.python.org/file44061/patch.diff ___ Python tracker

Subprocess Startup Error

2016-08-09 Thread Sean via Python-list
Does anyone have advice on how to resolve this message when I attempt to open IDLE? "IDLE's subprocess didn't make connection. Either IDLE can't start a subprocess or personal firewall software is blocking the connection." I am running Windows 10 Home on a 64bit machine. I am running

[issue27721] distutils strtobool returns 0 and 1 rather than False and True

2016-08-09 Thread SilentGhost
SilentGhost added the comment: Couple of things: your patch doesn't seem to apply cleanly for whatever reason (most likely because it's a patch against python2); the change from lowercasing to casefolding doesn't seem justified to me; the formatted value needs to be repr-formatted - though

Re: Question regarding stdlib distutils strtobool behavior

2016-08-09 Thread Joseph Bane
On 8/9/16 1:42 PM, Terry Reedy wrote: > On 8/9/2016 9:22 AM, Joseph Bane wrote: >> Hello. >> >> It recently came to my attention that the strtobool function in the >> standard library doesn't return Python native boolean values, but >> rather returns integer 0 or 1: >> >>

[issue26526] In parsermodule.c, replace over 2KLOC of hand-crafted validation code, with a DFA

2016-08-09 Thread Gregory P. Smith
Changes by Gregory P. Smith : -- nosy: +gregory.p.smith ___ Python tracker ___ ___

[issue27128] Add _PyObject_FastCall()

2016-08-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Benchmarking results look nice, but despite the fact that this patch is only small part of issue26814, it looks to me larger that it could be. 1. The patch includes two parts: adding _PyObject_FastCall() and adding PyObject_CallNoArg() and

[issue27721] distutils strtobool returns 0 and 1 rather than False and True

2016-08-09 Thread R. David Murray
Changes by R. David Murray : -- title: strtobool returns 0 and 1 rather than False and True -> distutils strtobool returns 0 and 1 rather than False and True ___ Python tracker

[issue27721] distutils strtobool returns 0 and 1 rather than False and True

2016-08-09 Thread R. David Murray
Changes by R. David Murray : -- versions: +Python 3.6 -Python 2.7, Python 3.5 ___ Python tracker ___

Re: What's the best way to minimize the need of run time checks?

2016-08-09 Thread Juan Pablo Romero Méndez
What static checking can actually guarantee varies depending on the specific type system at hand (C# vs Haskell vs Idris for example). But most of them can guarantee simple stuff like: "I'm I allowed to invoke this function at this point?" If you don't have that, well you can rely on tests to

[issue27721] strtobool returns 0 and 1 rather than False and True

2016-08-09 Thread Joseph Bane
New submission from Joseph Bane: The distutils strtobool function returns 0 or 1 rather than the native boolean type True or False values: https://hg.python.org/cpython/file/3.5/Lib/distutils/util.py#l304 Please see the attached patch for updates to this function. I have included updates to

Re: What's the best way to minimize the need of run time checks?

2016-08-09 Thread Juan Pablo Romero Méndez
2016-08-09 12:06 GMT-07:00 Paul Rubin : > Juan Pablo Romero Méndez writes: > > In online forums sometimes people complain that they end up having to > > test constantly for None > > That's something of a style issue. You can code in a way that

[issue26081] Implement asyncio Future in C to improve performance

2016-08-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See also a discussion on Python-Dev about rewriting contextlib.contextmanager in C: https://mail.python.org/pipermail/python-dev/2016-August/thread.html#145786 . What parts of Future are performance critical? Maybe it is worth to implement in C only the

Re: What's the best way to minimize the need of run time checks?

2016-08-09 Thread MRAB
On 2016-08-09 19:57, Chris Angelico wrote: On Wed, Aug 10, 2016 at 4:51 AM, Michael Selik wrote: "File-like" is a good example. Rather than go through the frustration of a formal definition for what is file-like, stay productive and flexible with duck typing. Objects

[issue27704] bytes(x) is slow when x is bytearray

2016-08-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: LGTM. -- assignee: -> serhiy.storchaka stage: -> commit review ___ Python tracker ___

Re: What's the best way to minimize the need of run time checks?

2016-08-09 Thread Paul Rubin
Juan Pablo Romero Méndez writes: > In online forums sometimes people complain that they end up having to > test constantly for None That's something of a style issue. You can code in a way that avoids a lot of those tests (not all of them). > Do you guys have any

Re: What's the best way to minimize the need of run time checks?

2016-08-09 Thread Chris Angelico
On Wed, Aug 10, 2016 at 4:51 AM, Michael Selik wrote: > "File-like" is a good example. Rather than go through the frustration of a > formal definition for what is file-like, stay productive and flexible with > duck typing. Objects that don't have the appropriate methods

Re: What's the best way to minimize the need of run time checks?

2016-08-09 Thread Michael Selik
On Tue, Aug 9, 2016 at 2:31 PM Juan Pablo Romero Méndez < jpablo.rom...@gmail.com> wrote: > Hello, > > In online forums sometimes people complain that they end up having to test > constantly for None, or that a function's argument has a specific type / > shape (which immediately brings the

  1   2   >