Re: Python Worst Practices
On Sat, Feb 28, 2015 at 6:50 PM, Dan Sommers d...@tombstonezero.net wrote: Now if only emacs were clever enough *not* to colorize id when it's one of my names and not the builtin... ;-) I think (part of) the point of the colorization is to make it obvious that you've shadowed a builtin. If you use str = 'spam' in your code, the str should be highlighted. ChrisA -- https://mail.python.org/mailman/listinfo/python-list
[issue23546] windows, IDLE and pep 397
Changes by SilentGhost ghost@gmail.com: -- components: +Installation versions: -Python 2.7, Python 3.2, Python 3.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23546 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23458] [2.7] random: make the file descriptor non-inheritable (on POSIX)
Changes by Serhiy Storchaka storch...@gmail.com: -- assignee: - haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23458 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20204] pydocs fails for some C implemented classes
Serhiy Storchaka added the comment: What type of warning is more preferable here? It will be emitted at import. E.g.: $ ./python -Wall Python 3.5.0a1+ (default:28ba862036cc+, Feb 28 2015, 11:01:23) [GCC 4.8.2] on linux Type help, copyright, credits or license for more information. import tkinter _frozen_importlib:321: SyntaxWarning: builtin type tkapp has no the __module__ attribute _frozen_importlib:321: SyntaxWarning: builtin type tktimertoken has no the __module__ attribute DeprecationWarning? RuntimeWarning? -- nosy: +ezio.melotti priority: high - normal ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20204 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23528] Limit decompressed data when reading from GzipFile
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23528 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23529] Limit decompressed data when reading from LZMAFile and BZ2File
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23529 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23546] windows, IDLE and pep 397
New submission from Liam Marsh: hello, pep 397 describes a Python launcher for the Windows platform. A Python launcher is a single executable which uses a number of heuristics to locate a Python executable and launch it with a specified command line. Problem: that affects only the open file action behavior, and not the EDIT with idle file action behavior, and then it is the last installed IDLE who wins. the problem is not the IDLE changes themselves, but that one version's IDLE can only run the edited script in its version, and ignoring the shebang. Could the windows installer install a third executable (for ex: pyi.exe) which launch the correct IDLE according to the shebang line of the edited file? Or maybe it should be done using pyw.exe /edit filepath... Than you for reading this and have a nice day/evening! -- components: IDLE, Windows messages: 236870 nosy: Liam.Marsh, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: windows, IDLE and pep 397 type: enhancement versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23546 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: Python Worst Practices
On Sat, Feb 28, 2015 at 7:48 PM, Ian Kelly ian.g.ke...@gmail.com wrote: On Fri, Feb 27, 2015 at 9:42 PM, Dan Sommers d...@tombstonezero.net wrote: I don't think I've ever used the builtin function id in a program. Ever. Not even once. Honestly, what is a valid use case? If you have a dict that you want to key on object identity rather than equality, then you can use object ids as the keys. And not forget to hang onto references to all those objects, else their ids will be meaningless. ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: Python Worst Practices
Ethan Furman et...@stoneleaf.us: Sure, for the ones I use as built-ins. But I went through the color file for vim and took out the built-ins I use regularly as variables -- and 'id' was the first one to go. Ah, yes. The id is with us from the beginning. The self seeks to gratify the whims of the id while at least placating the demands of super. But I think stamping out the id altogether is bound to fail and risk the long-term soundness of the implementation. Marko -- https://mail.python.org/mailman/listinfo/python-list
[issue23304] Unused Superclass in calendar.py
Changes by Serhiy Storchaka storch...@gmail.com: -- resolution: - not a bug status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23304 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: Python Worst Practices
On Fri, Feb 27, 2015 at 9:42 PM, Dan Sommers d...@tombstonezero.net wrote: I don't think I've ever used the builtin function id in a program. Ever. Not even once. Honestly, what is a valid use case? If you have a dict that you want to key on object identity rather than equality, then you can use object ids as the keys. -- https://mail.python.org/mailman/listinfo/python-list
[issue21619] Cleaning up a subprocess with a broken pipe
Roundup Robot added the comment: New changeset b5e9ddbdd4a7 by Serhiy Storchaka in branch '3.4': Issue #21619: Popen objects no longer leave a zombie after exit in the with https://hg.python.org/cpython/rev/b5e9ddbdd4a7 New changeset cdac249808a8 by Serhiy Storchaka in branch 'default': Issue #21619: Popen objects no longer leave a zombie after exit in the with https://hg.python.org/cpython/rev/cdac249808a8 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21619 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21619] Cleaning up a subprocess with a broken pipe
Serhiy Storchaka added the comment: Thank you for your contribution Martin. -- resolution: - fixed stage: patch review - resolved type: - resource usage versions: +Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21619 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: Python Worst Practices
On 28/02/2015 01:09, Steven D'Aprano wrote: Likewise: int = 23 n = int(42) Isn't it obvious that the second use of int has to be the built-in function? I wish that the computer would understand from context which one I mean. (People here would like PL/I then which apparently has *no* reserved words, so you can write: if if=then then ...) Other newbie stylistic mistakes which can increase the chance of shadowing errors include: * Too many overly generic variable names like int and str. One thing I find annoying when looking at tutorial examples of an unfamiliar language is when they use identifier names such as function, array, integer, var and so on, names which could conceivably be reserved words. Because it's not clear if these *are* keywords that form part of the syntax, or built-ins, or actual made-up user identifiers. -- Bartc -- https://mail.python.org/mailman/listinfo/python-list
[issue21619] Cleaning up a subprocess with a broken pipe
STINNER Victor added the comment: Why not ignoring BrokenPipeError like communicate()? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21619 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21619] Cleaning up a subprocess with a broken pipe
Changes by Serhiy Storchaka storch...@gmail.com: -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21619 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23088] Document that PyUnicode_AsUTF8() returns a null-terminated string
Serhiy Storchaka added the comment: May be mention that the result of PyUnicode_AsUTF8() can contain null bytes? And the same for PyBytes_AS_STRING()/PyBytes_AsString()? -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23088 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22341] Python 3 crc32 documentation clarifications
Serhiy Storchaka added the comment: crc 0x is still used in gzip, zipfile and tarfile. And some comments say about signess of 32-bit checksums. -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22341 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23411] Update urllib.parse.__all__
Changes by Serhiy Storchaka storch...@gmail.com: -- versions: +Python 3.4, Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23411 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17140] Document multiprocessing.pool.ThreadPool
Changes by Davin Potts pyt...@discontinuity.net: -- nosy: +davin ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17140 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23496] Steps for Android Native Build of Python 3.4.2
Stefan Krah added the comment: Fine, I'm also optimizing and the fix isn't going into libmpdec. Android can use the Python version of decimal. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23496 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23446] Use PyMem_New instead of PyMem_Malloc
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever versions: +Python 2.7, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23446 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23490] allocation (and overwrite) of a 0 byte buffer
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23490 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: Python Worst Practices
From : Tim Chase A quick google-and-tally for languages and their corresponding number of keywords: re-sorted 21 : Lua 31 : Python2.x 33 : Python3.x 33 : C 37 : Pike 40 : Perl 40 : Ruby 50 : Java 54 : Pascal 67 : PHP 77 : C# 86 : C++ -- Stanley C. Kitching Human Being Phoenix, Arizona -- https://mail.python.org/mailman/listinfo/python-list
[issue23247] Multibyte codec StreamWriter.reset() crashes
Changes by Serhiy Storchaka storch...@gmail.com: -- assignee: - serhiy.storchaka nosy: +serhiy.storchaka priority: normal - high ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23247 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23521] OverflowError from timedelta * float in datetime.py
Roundup Robot added the comment: New changeset 8fe15bf68522 by Alexander Belopolsky in branch '3.4': Fixes #23521: Corrected pure python implementation of timedelta division. https://hg.python.org/cpython/rev/8fe15bf68522 New changeset d783132d72bc by Alexander Belopolsky in branch 'default': Fixes #23521: Corrected pure python implementation of timedelta division. https://hg.python.org/cpython/rev/d783132d72bc -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23521 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17576] PyNumber_Index() is not int-subclass friendly (or operator.index() docos lie)
Nick Coghlan added the comment: OK, something appears to have gotten confused along the way here. Barry's original problem report was that operator.index() was returning a different answer than operator.__index__() for int subclasses. Absolutely nothing to do with the int builtin at all. While the fact int() *may* return int subclasses isn't especially good, it's also a longstanding behaviour. The problem Barry reports, where a subclassing based proxy type isn't reverting to a normal integer when accessed via operator.index() despite defining __index__() to do exactly that should be possible to fix just by applying the stricter check specifically in PyNumber_Index. Expanding the scope to cover __int__() and __trunc__() as well would be much, much hairier, as those are much older interfaces, and used in a wider variety of situations. We specifically invented __index__() to stay away from that mess while making it possible to explicitly indicate that a type supports a lossless conversion to int rather than a potentially lossy one. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17576 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: Python Worst Practices
On Sat, Feb 28, 2015 at 9:39 PM, BartC b...@freeuk.com wrote: (People here would like PL/I then which apparently has *no* reserved words, so you can write: if if=then then ...) Likewise REXX has no reserved words; also, SQL went part-way there, with the notion of non-reserved keywords. For example, ORDER and BY are reserved keywords, so they are unavailable as table/column names, but NULLS is non-reserved. You could use it, if you wanted to, but it's a syntactic element in some contexts. You can say ORDER BY some_column NULLS FIRST or NULLS LAST to affect the ordering; you can even say ORDER BY NULLS NULLS FIRST, which will sort by a column named NULLS, in ascending order, but counting NULL as lower than everything (instead of higher than everything). Given the style of SQL, it'd be insanely restrictive if it had to have everything be either a keyword or nothing, so this is a good half-way-house. ChrisA -- https://mail.python.org/mailman/listinfo/python-list
[issue13966] Add disable_interspersed_args() to argparse.ArgumentParser
László Attila Tóth added the comment: It seems I found the solution in the attached file argparse.disable_interspersed_args.python35.diff, and it's much-much easier than I thought. I assume that this patch can cleanly applied to earlier versions (python 3.2-3.4), but I didn't check it. -- versions: +Python 3.2, Python 3.4, Python 3.5 Added file: http://bugs.python.org/file38275/argparse.disable_interspersed_args.python35.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13966 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23521] OverflowError from timedelta * float in datetime.py
Changes by Alexander Belopolsky alexander.belopol...@gmail.com: -- resolution: - fixed stage: commit review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23521 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23521] OverflowError from timedelta * float in datetime.py
Serhiy Storchaka added the comment: LGTM. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23521 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20204] pydocs fails for some C implemented classes
Nick Coghlan added the comment: The case for RuntimeWarning: the object isn't necessarily *broken* as such (most things will still work), but pickling and some introspection features may not work properly. The case for DeprecationWarning: breaking picking and introspection is bad when the fix (setting __module__) is straightforward, so this should eventually become an AttributeError: AttributeError: __module__ not set on builtin type tkapp My own preference is for the latter - eventually making it a hard requirement to specify the module name properly. Even true builtins officially live in the builtins module: str.__module__ 'builtins' -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20204 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23411] Update urllib.parse.__all__
Serhiy Storchaka added the comment: Exposed classes are the types of results returned by urllib.parse functions. It is very unlikely that they will be directly used by the user. I see the only benefit of adding these class to __all__ that they will become visible for pydoc. Is it worth to apply the patch to maintained releases or to 3.5 only? -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23411 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23545] Turn on extra warnings on GCC
Stefan Krah added the comment: +1. I think the flags should go into CFLAGS_NODIST. -- nosy: +skrah ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23545 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23496] Steps for Android Native Build of Python 3.4.2
Cyd Haselton added the comment: Well, why don't you try? :) Resource optimization. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23496 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20305] Android's incomplete locale.h implementation prevents cross-compilation
Stefan Krah added the comment: Consider the libmpdec part rejected. It is too much work given that external libmpdecs need to be compatible and Android can use the Python version of decimal. -- nosy: +skrah ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20305 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23547] Engineering at Google in 2015
New submission from Michael Bevilacqua-Linn: Hey thanks so much for reaching out! I'm not really interested in leaving Philly or my current job at the moment though... Thanks! MBL On Fri, Feb 27, 2015 at 4:48 AM, Margaret O'Reilly margare...@google.com wrote: Hi Michael, I hope you are well. My name is Margaret and I am part of the Google Technical Recruiting team. I tried reaching you about a month ago and just wanted to check back in to see if you might be interested in exploring a potential engineering role at Google? With your experience and our current open roles, we may have a role that’s a good fit for you. If you are interested in hearing more, please let me know :-) If however this isn’t something you’re interested in, just let me know and we’ll be sure not to spam. Thanks and looking forward to your response. Regards, Margaret. On Thu, Jan 29, 2015 at 10:58 AM, Margaret O'Reilly margare...@google.com wrote: Hi Michael, I hope all is well. My name is Margaret and I am currently working with Google's Recruitment team. I found your profile online and you interest and experience in building scalable distributed systems caught my eye as we have a team in Google which I think would be a great match for you! I know my colleague Derrick got in touch with you in 2014 and relocation wasn't an option. I wanted to get back in touch again to see if now might be a more convenient time perhaps? If so, I would be delighted to hear from you and I'll happily arrange a call at your convenience! Thanks and looking forward to hearing from you! Kind Regards, Margaret Paxos Made Live - An Engineering Perspective http://research.google.com/archive/paxos_made_live.html Bigtable: A Distributed Storage System for Structured Data http://research.google.com/archive/bigtable.html -- Best Regards, Margaret Margaret O' Reilly | Technical Sourcer | margare...@google.com | +353 1 519 3003 -- messages: 236889 nosy: Michael.Bevilacqua-Linn priority: normal severity: normal status: open title: Engineering at Google in 2015 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23547 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23547] Engineering at Google in 2015
Changes by Benjamin Peterson benja...@python.org: -- resolution: - not a bug status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23547 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: Python Worst Practices
BartC b...@freeuk.com: (Over here it's spelled colour...) The language of science and technology is American English. Learn it like everybody else has to. Marko -- https://mail.python.org/mailman/listinfo/python-list
[issue23062] test_argparse --version test cases
Serhiy Storchaka added the comment: Why the test class is moved? -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23062 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: requesting you all to please guide me , which tutorials is best to learn redis database
On Thu, 26 Feb 2015 11:14:50 -0800, Jai wrote: i want to learn redis database and its use via python , please guide me which tutorials i should be study, so that i can learn it in good way Using databases via python often involves working with dictionaries or lists, lists of dictionaries, lists of lists etc. Before you start trying to work with a database and python together, you should have a good grasp of the core python data structures, built in functions, statements, io, statements, flow control etc. You should also have a good grasp of the language (presumably an sql variant) used by the database, and a very good understanding of how string formatting works in python, as you'll be using python to build command strings to send to the database. Then you may be ready to start gluing the two together. -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list
[issue22350] nntplib file write failure causes exception from QUIT command
Changes by Serhiy Storchaka storch...@gmail.com: -- assignee: - serhiy.storchaka nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22350 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23496] Steps for Android Native Build of Python 3.4.2
Cyd Haselton added the comment: Fine, I'm also optimizing and the fix isn't going into libmpdec. Android can use the Python version of decimal. Er, ok. Not entirely sure what this means, mostly because the handful of spare cycles not allocated to a) getting a fork up, running and patched b) learning git on the fly for a) c) porting spidermonkey (why I ported Python) and d) learning Python, are already dedicated to other projects. And work. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23496 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: Python Worst Practices
On 27/02/2015 21:40, Chris Angelico wrote: On Sat, Feb 28, 2015 at 8:37 AM, Dave Angel da...@davea.name wrote: Right. In C and C++, instead of being the first slide, it'd be the first 3 or 4. Between header file conflicts (especially good because the stdlib itself has many multiply-defined symbols, duplicate header files, and contradictory include path patterns) Yeah, Python has some issues with sys.path and how your local module can unexpectedly shadow a stdlib one, but at least the stdlib itself doesn't have any conflicts. I should not ever have to do this dance: #include somefile.h #undef SOME_SYMBOL #include otherfile.h But sadly, I do. ChrisA As you typed the above up I wonder how many developers around the world were battling with the fun and games caused, particularly when writing cross platform code? It also makes me wonder what idiot decided to use C as the language for the first Python implementation? Or was it written in something else and then ported? -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list
[issue23231] Fix codecs.iterencode/decode() by allowing data parameter to be omitted
Changes by Serhiy Storchaka storch...@gmail.com: -- assignee: - serhiy.storchaka nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23231 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23496] Steps for Android Native Build of Python 3.4.2
Stefan Krah added the comment: I wouldn't know if they're reported to the same bug tracker...it's possible they aren't. Well, why don't you try? :) Additionally it's possible that the lack of locale support in libc isn't considered a bug. Their struct lconv violates both the C standard and POSIX. It is 100% a bug. Lack of locale support would be defensible, shipping a broken localeconv() isn't. I'm just furious that 20+ OSS projects go out of their way to work around this trivial bug. It's a waste of resources. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23496 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: Python Worst Practices
On Sun, Mar 1, 2015 at 2:33 AM, Mark Lawrence breamore...@yahoo.co.uk wrote: It also makes me wonder what idiot decided to use C as the language for the first Python implementation? Or was it written in something else and then ported? Guido, probably. And what other language would you suggest? What other language has comparably extensive multi-platform support? Writing a Python implementation in C instantly makes Python available on all sorts of platforms, with direct access to native libraries on all of them. For example, CPython on Windows can make use of a whole bunch of Microsoft's win32 APIs, via the pywin32 extensions; meanwhile, CPython on Linux can use the inotify functions, again via an extension module (pyinotify or python-inotify). Jython doesn't offer that, as far as I know; or rather, Jython offers access to Java classes rather than to C libraries, and there are a lot more of the latter than the former. Of all the languages that offer convenient access to the same sorts of libraries that C code can (generally, those that compile to machine code and use the same kinds of linker information), which would you suggest as being better than C? C may not be perfect, but it's pretty decent at what it does. ChrisA -- https://mail.python.org/mailman/listinfo/python-list
[issue23550] Add to unicodedata a function to query the Quick_Check property for a character
Marc-Andre Lemburg added the comment: Can you provide a patch for this ? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23550 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23549] heapq docs should be more precise about how to access the smallest element
Martin Panter added the comment: “Smalest” is spelt with a double L. -- nosy: +vadmium ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23549 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23411] Update urllib.parse.__all__
Martin Panter added the comment: For what it’s worth, I have used the the SplitResult class directly to build URLs from components, and to get at the hostname:port parsing functionality, as described in Issue 23416. As well as pydoc, I notice when things are missing from __all__ when I try to do “from module import *” to experiment in the interactive interpreter. Though I’m not fussed if this only goes into 3.5. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23411 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20204] pydocs fails for some C implemented classes
Serhiy Storchaka added the comment: It also can be ImportWarning (warnings triggered during the process of importing a module (ignored by default)). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20204 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23547] Engineering at Google in 2015
Changes by Ned Deily n...@acm.org: -- Removed message: http://bugs.python.org/msg236889 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23547 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19980] Improve help('non-topic') response
Roundup Robot added the comment: New changeset 4a1fe339dcf6 by Serhiy Storchaka in branch 'default': Issue #19980: Improved help() for non-recognized strings. help('') now https://hg.python.org/cpython/rev/4a1fe339dcf6 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19980 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23547] Misdirected
Changes by Ned Deily n...@acm.org: -- stage: - resolved title: Engineering at Google in 2015 - Misdirected ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23547 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21619] Cleaning up a subprocess with a broken pipe
Changes by Serhiy Storchaka storch...@gmail.com: -- assignee: - serhiy.storchaka nosy: +serhiy.storchaka stage: - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21619 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: Python Worst Practices
On 25/02/2015 20:58, Michiel Overtoom wrote: On Feb 25, 2015, at 21:45, Mark Lawrence wrote: http://www.slideshare.net/pydanny/python-worst-practices I like the way it advises against preserving pixels by removing vowels from identifiers. Then it gives the best practice example of using color instead of clr or c! (Over here it's spelled colour...) -- Bartc -- https://mail.python.org/mailman/listinfo/python-list
[issue21619] Cleaning up a subprocess with a broken pipe
Roundup Robot added the comment: New changeset 1b4d916329e7 by Serhiy Storchaka in branch '3.4': Fixed a test for issue #21619 on Windows. https://hg.python.org/cpython/rev/1b4d916329e7 New changeset eae459e35cb9 by Serhiy Storchaka in branch 'default': Fixed a test for issue #21619 on Windows. https://hg.python.org/cpython/rev/eae459e35cb9 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21619 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23200] Clarify max_length and flush() for zlib decompression
Changes by Serhiy Storchaka storch...@gmail.com: -- nosy: +nadeem.vawda stage: - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23200 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23391] Documentation of EnvironmentError (OSError) arguments disappeared
Changes by Serhiy Storchaka storch...@gmail.com: -- keywords: +needs review nosy: +pitrou stage: - patch review versions: +Python 3.5 -Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23391 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23521] OverflowError from timedelta * float in datetime.py
Changes by Alexander Belopolsky alexander.belopol...@gmail.com: -- stage: needs patch - commit review versions: +Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23521 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: Python Worst Practices
On 28/02/2015 10:56, Marko Rauhamaa wrote: BartC b...@freeuk.com: (Over here it's spelled colour...) The language of science and technology is American English. Learn it like everybody else has to. Marko People from Angleland use any English apart from our own, never. Next thing you'll be telling us to use that new fangled UTC nonsense instead of the clearly correct GMT. -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list
[issue18986] Add a case-insensitive case-preserving dict
Jason R. Coombs added the comment: I'm also eager to hear what limitations prevented the acceptance. Please do link back here when you've posted. I have to say, I'm not entirely surprised. In my implementation, I struggled with some cases, and it certainly doesn't feel like a fully safe implementation. That said, since I mentioned the implementation in jaraco.util earlier, I wanted to announce that those implementations (FoldedCase and FoldedCaseKeyedDict) have been moved to two libraries (jaraco.text and jaraco.collections). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18986 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
PIL installation fails; registration problem
I am reinstalling everything on my new Windows 7 laptop. I run into a problem when installing PIL 1.1.7, in combination with my Activestate Python 2.7.8. The PIL installer complains that no Python is registered. I did run Joakim Löw's script to register Python. This results in the message *** You probably have another Python installation!. Adding some code to this script reveals that my Python is registered with the following values (deviating from the values in the script): installkey: C:\Python27\ pythonkey C:\Python27\Lib;C:\Python27\DLLs;C:\Python27\Lib\lib-tk The script proposes for pythonkey: C:\Python27;C:\Python27\Lib\;C:\Python27\DLLs\ Can I change the pythonkey to the value proposed by Joakim Löw's script? -- https://mail.python.org/mailman/listinfo/python-list
[issue23496] Steps for Android Native Build of Python 3.4.2
Ryan Gonzalez added the comment: Ok...so the joys of autoconf configuring bite again. ALL Android devices have /dev/ptmx (adb even assumes it)...should the configure script be modified to skip that check if cross-compiling for Android? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23496 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20128] Re-enable test_modules_search_builtin() in test_pydoc
Mark Lawrence added the comment: Whilst testing #19980 I noticed that three tests are still skipped. -- nosy: +BreamoreBoy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20128 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23548] TypeError in event loop finalizer, new in Python 3.4.3
Guido van Rossum added the comment: So this is still strange. When you do this, does it give the same exception? import signal signal.signal(signal.SIGCHLD, signal.SIG_DFL) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23548 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
suggestions for functional style (singleton pattern?)
Hi, For some scripts, I write in a a more functional way, using a lot of small functions outside of any class. Although it makes the code clearer for specific cases, I have found that it makes debugging and using the repl in general difficult, as as I have to re-initialise every single objects every time. I have now started to use some kind of state pattern to alleviate this, here's a simplistic example: https://github.com/dorfsmay/state_pattern_for_debugging_python/blob/master/dirstats.py Are there better ways to address this? Any suggestion on this style? Thanks. -- http://yves.zioup.com gpg: 4096R/32B0F416 -- https://mail.python.org/mailman/listinfo/python-list
[issue20128] Re-enable test_modules_search_builtin() in test_pydoc
Changes by Serhiy Storchaka storch...@gmail.com: -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20128 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23496] Steps for Android Native Build of Python 3.4.2
Cyd Haselton added the comment: *ALL Android devices have /dev/ptmx (adb even assumes it)...should the *configure script be modified to skip that check if cross-compiling for *Android? Yes, definitely. See the mods to pyconfig.h here https://code.google.com/p/python-for-android/wiki/CrossCompilingPython Ignore the #define ANDROID 1. GCC 4.8.x and later add -mandroid and/or -mbionic which defines __ANDROID__; I've been putting android-related changes under that macro. *Cyd (and anyone else who can), do you think you could test the binaries, *too? I'll get them to you somehow. You have a real device; I have an old *real device and an emulator. Sure...especially since the KBOX env is needed. *Side note for Cyd: I'd advise you just use the fork of CPython you have *and just push them to GitHub: $ git remote add origin url of your GitHub repo with .git at the end $ git push --all origin -u *That will push your changes (and every branch of CPython, I have no clue *what your branch name is, so this just does everything) to the GitHub *mirror. I forked the Cpython repo on Github, set 3.4 as the default branch and $git clone https://github.com/cydhaselton/cpython.git After modifying files and/or adding dirs, copying files $git add modified file Hopefully the above was ok. Off to read up on commits -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23496 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18382] multiprocessing's overlapped PipeConnection issues on Windows 8
Changes by Steve Dower steve.do...@microsoft.com: -- assignee: - steve.dower components: +Library (Lib), Windows -Extension Modules nosy: +tim.golden, zach.ware stage: needs patch - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18382 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23549] heapq docs should be more precise about how to access the smallest element
Eli Bendersky added the comment: Proposed patch (generated vs. the 3.4 docs) is attached -- keywords: +patch Added file: http://bugs.python.org/file38277/issue23549.1.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23549 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23430] socketserver.BaseServer.handle_error() should not catch exiting exceptions
Changes by Serhiy Storchaka storch...@gmail.com: -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23430 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19980] Improve help('non-topic') response
Serhiy Storchaka added the comment: There is a problem with the patch. When you are in interactive help utility, then the request 'help' runs nested interactive help utility. The difference between unpatched behavior is that now you need press Ctrl-D or 'q' twice to exit to normal Python interpreter. When you type 'help' repeatedly, your could run third, fourth, etc nested help utility. Here is modified patch. Now help('help') produces the same output as help(help), but the 'help' request in interactive help utility prints help intro message. help('help') Help on _Helper in module _sitebuiltins object: help = class _Helper(builtins.object) | Define the builtin 'help'. | | This is a wrapper around pydoc.help that provides a helpful message | when 'help' is typed at the Python interactive prompt. | | Calling help() at the Python prompt starts an interactive help session. | Calling help(thing) prints help for the python object 'thing'. | | Methods defined here: | | __call__(self, *args, **kwds) | | __repr__(self) | | -- | Data descriptors defined here: | | __dict__ | dictionary for instance variables (if defined) | | __weakref__ | list of weak references to the object (if defined) help() Welcome to Python 3.5's help utility! If this is your first time using Python, you should definitely check out the tutorial on the Internet at http://docs.python.org/3.5/tutorial/. Enter the name of any module, keyword, or topic to get help on writing Python programs and using Python modules. To quit this help utility and return to the interpreter, just type quit. To get a list of available modules, keywords, symbols, or topics, type modules, keywords, symbols, or topics. Each module also comes with a one-line summary of what it does; to list the modules whose name or summary contain a given string such as spam, type modules spam. help help Welcome to Python 3.5's help utility! If this is your first time using Python, you should definitely check out the tutorial on the Internet at http://docs.python.org/3.5/tutorial/. Enter the name of any module, keyword, or topic to get help on writing Python programs and using Python modules. To quit this help utility and return to the interpreter, just type quit. To get a list of available modules, keywords, symbols, or topics, type modules, keywords, symbols, or topics. Each module also comes with a one-line summary of what it does; to list the modules whose name or summary contain a given string such as spam, type modules spam. help -- assignee: docs@python - serhiy.storchaka nosy: +serhiy.storchaka Added file: http://bugs.python.org/file38278/issue19880v4.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19980 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23539] Content-length not set for HTTP methods expecting body when body is None
Martin Panter added the comment: Yes I agree with the behaviour that None means no body (for requests such as GET), and an empty string means an empty but present body. Correct me if I’m wrong, but I think the fix for Issue 14721 already does that. Perhaps the new behaviour needs a “Changed in version X” tag? I’m not sure, but I tend to think of this as a new feature, rather than a bug fix. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23539 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23550] Add to unicodedata a function to query the Quick_Check property for a character
Hammerite added the comment: No, I haven't done any work on it. Is that the done thing when suggesting something? I'm sorry, I wasn't aware. I could look into it. I am unfamiliar with the CPython codebase, but I can have a go. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23550 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19980] Improve help('non-topic') response
Mark Lawrence added the comment: LGTM. I noticed this running the tests. test_modules (test.test_pydoc.PydocImportTest) ... skipped 'causes undesireable side-effects (#20128)' test_modules_search (test.test_pydoc.PydocImportTest) ... skipped 'causes undesireable side-effects (#20128)' test_modules_search_builtin (test.test_pydoc.PydocImportTest) ... skipped 'some buildbots are not cooperating (#20128)' -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19980 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23551] IDLE to provide menu options for using PIP
Terry J. Reedy added the comment: Raymond, I have had a very vague idea of doing something like this. Thanks for posting something more concrete. I share the sentiments of your last sentence. Reading Stackoverflow, it is apparent that some people with two+ Python versions do not know that a package must be installed for each version of Python, and have less idea how to install for the non-default version. (All I know is to cd to pythonxy, or maybe pythonxy/scripts and run pip from there, or something like that.) Running from Idle (x.y) would take of this. Donald: at Raymond's behest, Idle now has a menu entry to run turtledemo, a separate application that is useful to beginners, in part to make turtledemo more visible. pip_gui could easily follow the same model. No direct interaction with the Idle shell or edit windows is needed. If you are less familiar with tkinter than I am, I would help with the gui part. As hinted above, I am not the one to decide on menu options and write the implementation functions. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23551 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: Python Worst Practices
Chris Angelico wrote: Likewise REXX has no reserved words; also, SQL went part-way there, with the notion of non-reserved keywords. Python sometimes has those, too. For example, the as in import as was non-reserved when it was first introduced, to avoid abruptly breaking code that used it as a name. -- Greg -- https://mail.python.org/mailman/listinfo/python-list
[issue23549] heapq docs should be more precise about how to access the smallest element
Eli Bendersky added the comment: Good catch. Attaching a new version of the patch with the typo fixed. -- Added file: http://bugs.python.org/file38280/issue23549.2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23549 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19980] Improve help('non-topic') response
Serhiy Storchaka added the comment: Thank you for your contribution Mark. I noticed this running the tests. This is temporary OK. -- resolution: - fixed stage: patch review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19980 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23551] IDLE to provide menu options for using PIP
Terry J. Reedy added the comment: Thinking a bit more, the Idle entry point could be one entry, 'Install Packages' or 'Manage Packages' on the Options menu (or maybe Help menu). I am not sure that the new window would need a submenu, as I think everything listed in the opening post could fit in a large window. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23551 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23539] Content-length not set for HTTP methods expecting body when body is None
James Rutherford added the comment: I actually consider this a fix for the fix in 14721, rather than a new feature. The only new behaviour here is setting content length to be zero if body is None on PATCH, POST, or PUT. Happy to change the labeling if that's the consensus but IMO it's a bugfix. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23539 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23551] IDLE to provide menu options for using PIP
Donald Stufft added the comment: I'm unlikely to have the time or motivation to do this anytime soon (just to be clear). I would be able to advise anyone who does feel like doing it the best ways to interact with pip itself though. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23551 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23553] Reduce the number of comparison for range checking.
New submission from Raymond Hettinger: Python's core is full of bound checks like this one in Objects/listobject.c: static PyObject * list_item(PyListObject *a, Py_ssize_t i) { if (i 0 || i = Py_SIZE(a)) { ... Abner Fog's high-level language optimization guide, http://www.agner.org/optimize/optimizing_cpp.pdf in section 14.2 Bounds Checking, shows a way to fold this into a single check: -if (i 0 || i = Py_SIZE(a)) { +if ((unsigned)i = (unsigned)(Py_SIZE(a))) { if (indexerr == NULL) { indexerr = PyUnicode_FromString( list index out of range); The old generated assembly code looks like this: _list_item: subq$8, %rsp testq %rsi, %rsi js L227 cmpq16(%rdi), %rsi jl L228 L227: ... error reporting and exit ... L228: movq24(%rdi), %rax movq(%rax,%rsi,8), %rax addq$1, (%rax) addq$8, %rsp ret The new disassembly looks like this: _list_item: cmpl%esi, 16(%rdi) ja L227 ... error reporting and exit ... L227: movq24(%rdi), %rax movq(%rax,%rsi,8), %rax addq$1, (%rax) ret Note, the new code not only saves a comparison/conditional-jump pair, it also avoids the need to adjust %rsp on the way in and the way out for a net savings of four instructions along the critical path. When we have good branch prediction, the current approach is very low cost; however, Abner Fog's recommendation is never more expensive, is sometimes cheaper, saves a possible misprediction, and reduces the total code generated. All in all, it is a net win. I recommend we put in a macro of some sort so that this optimization gets expressed exactly once in the code and so that it has a good clear name with an explanation of what it does. -- components: Interpreter Core messages: 236928 nosy: rhettinger priority: normal severity: normal status: open title: Reduce the number of comparison for range checking. type: performance versions: Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23553 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: Python Worst Practices
On Sun, Mar 1, 2015 at 3:28 AM, Mark Lawrence breamore...@yahoo.co.uk wrote: I love fishing, just dangle the bait and wait to see what bites :) Yeah, you usually catch someone. Sometimes they need to be majorly sleep-deprived at half past three in the morning so they're looking at message bodies and skipping the headers that say who actually said stuff... but you'll catch someone. ChrisA -- https://mail.python.org/mailman/listinfo/python-list
[issue23549] heapq docs should be more precise about how to access the smallest element
New submission from Eli Bendersky: The heapq documentation has this paragraph after the doc of nsmallest: The latter two functions perform best for smaller values of n. For larger values, it is more efficient to use the sorted() function. Also, when n==1, it is more efficient to use the built-in min() and max() functions. This is confusing as it suggests to use min() on a heap to find the minimal element. heap[0] is the minimal element, but this is only mentioned at the very top - so you need to read the doc of the entire module to find it. Nothing in the docs of methods suggests it. -- assignee: docs@python components: Documentation messages: 236895 nosy: docs@python, eli.bendersky priority: normal severity: normal status: open title: heapq docs should be more precise about how to access the smallest element type: behavior versions: Python 2.7, Python 3.4, Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23549 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23062] test_argparse --version test cases
Berker Peksag added the comment: Why the test class is moved? Just wanted to group all TestHelp* tests together. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23062 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23062] test_argparse --version test cases
Serhiy Storchaka added the comment: But it already was between two help tests: TestHelpNoHelpOptional and TestHelpNone. I think that original test tested that the help attribute is optional for the --version argument and default description is printed in help output. This test shouldn't be removed. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23062 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: Python Worst Practices
On 28/02/2015 15:33, Mark Lawrence wrote: It also makes me wonder what idiot decided to use C as the language for the first Python implementation? Or was it written in something else and then ported? Python was already slow enough even written in C. With any other implementation language, it would have ground to a halt. -- Bartc -- https://mail.python.org/mailman/listinfo/python-list
Re: Python Worst Practices
On 2015-02-28 17:56, MRAB wrote: On 2015-02-28 16:03, Cousin Stanley wrote: From : Tim Chase A quick google-and-tally for languages and their corresponding number of keywords: re-sorted 21 : Lua 31 : Python2.x 33 : Python3.x 33 : C 37 : Pike 40 : Perl 40 : Ruby 50 : Java 54 : Pascal 67 : PHP 77 : C# 86 : C++ Does any language have more than COBOL? That has hundreds! A quick check using [1] suggests that COBOL has 366, while according to [2], MySQL's flavor of SQL has 825. -tkc [1] http://cobol.404i.com/res.php [2] https://www.drupal.org/node/141051 -- https://mail.python.org/mailman/listinfo/python-list
[issue23550] Add to unicodedata a function to query the Quick_Check property for a character
Changes by SilentGhost ghost@gmail.com: -- nosy: +benjamin.peterson, lemburg, loewis, pitrou versions: +Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23550 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23548] TypeError in event loop finalizer, new in Python 3.4.3
Jack O'Connor added the comment: `close()` fixes it; thanks for the workaround! When I throw a print statement inside `remove_signal_handler`, it says that sig is 17 and handler is 0. 17 looks to be SIGCHLD, presumably from the little echo subprocess exiting in this example. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23548 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23549] heapq docs should be more precise about how to access the smallest element
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- assignee: docs@python - rhettinger nosy: +rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23549 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23548] TypeError in event loop finalizer, new in Python 3.4.3
New submission from Jack O'Connor: This toy program: import asyncio @asyncio.coroutine def main(): p = yield from asyncio.create_subprocess_shell('echo hi') yield from p.wait() asyncio.get_event_loop().run_until_complete(main()) Produces this output on Arch Linux under Python 3.4.3 (but not 3.4.2): hi Exception ignored in: bound method _UnixSelectorEventLoop.__del__ of _UnixSelectorEventLoop running=False closed=True debug=False Traceback (most recent call last): File /home/jacko/Downloads/Python-3.4.3/Lib/asyncio/base_events.py, line 361, in __del__ File /home/jacko/Downloads/Python-3.4.3/Lib/asyncio/unix_events.py, line 57, in close File /home/jacko/Downloads/Python-3.4.3/Lib/asyncio/unix_events.py, line 138, in remove_signal_handler TypeError: signal handler must be signal.SIG_IGN, signal.SIG_DFL, or a callable object -- components: asyncio messages: 236892 nosy: gvanrossum, haypo, oconnor663, yselivanov priority: normal severity: normal status: open title: TypeError in event loop finalizer, new in Python 3.4.3 type: crash versions: Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23548 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23539] Content-length not set for HTTP methods expecting body when body is None
James Rutherford added the comment: Happy to remove OPTIONS from the list of methods that gets a content-length where body is None, but do we also want to consider behaviour if it's the empty string? My feeling is that '' implies present but empty (so should have a content-length set to zero), whereas None implies missing (so should only have a content-length header set to zero if the method is expecting a body. I've updated the patch with this logic, including ensuring proper explicit test coverage for the cases described. Docs updated too. -- Added file: http://bugs.python.org/file38276/issue23539-py27.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23539 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: Python Worst Practices
On 28/02/2015 15:46, Chris Angelico wrote: On Sun, Mar 1, 2015 at 2:33 AM, Mark Lawrence breamore...@yahoo.co.uk wrote: It also makes me wonder what idiot decided to use C as the language for the first Python implementation? Or was it written in something else and then ported? Guido, probably. And what other language would you suggest? What other language has comparably extensive multi-platform support? Writing a Python implementation in C instantly makes Python available on all sorts of platforms, with direct access to native libraries on all of them. For example, CPython on Windows can make use of a whole bunch of Microsoft's win32 APIs, via the pywin32 extensions; meanwhile, CPython on Linux can use the inotify functions, again via an extension module (pyinotify or python-inotify). Jython doesn't offer that, as far as I know; or rather, Jython offers access to Java classes rather than to C libraries, and there are a lot more of the latter than the former. Of all the languages that offer convenient access to the same sorts of libraries that C code can (generally, those that compile to machine code and use the same kinds of linker information), which would you suggest as being better than C? C may not be perfect, but it's pretty decent at what it does. ChrisA I love fishing, just dangle the bait and wait to see what bites :) -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list
Re: Python Worst Practices
On 28/02/2015 16:36, Chris Angelico wrote: On Sun, Mar 1, 2015 at 3:28 AM, Mark Lawrence breamore...@yahoo.co.uk wrote: I love fishing, just dangle the bait and wait to see what bites :) Yeah, you usually catch someone. Sometimes they need to be majorly sleep-deprived at half past three in the morning so they're looking at message bodies and skipping the headers that say who actually said stuff... but you'll catch someone. ChrisA If I had a quid for every time I'd posted when sleep deprived at half past three in the morning, and this on top of Chronic Fatigue Syndrome, then I'd have retired years ago. -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list
[issue19980] Improve help('non-topic') response
Changes by Serhiy Storchaka storch...@gmail.com: Added file: http://bugs.python.org/file38279/issue19880v4.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19980 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19980] Improve help('non-topic') response
Changes by Serhiy Storchaka storch...@gmail.com: Removed file: http://bugs.python.org/file38278/issue19880v4.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19980 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23552] Have timeit warn about runs that are not independent of each other
New submission from Raymond Hettinger: IPython 3.0 added a useful feature that we ought to consider for inclusion either in timeit.repeat() or in the command-line interface: Using %timeit prints warnings if there is at least a 4x difference in timings between the slowest and fastest runs, since this might meant that the multiple runs are not independent of one another. -- components: Library (Lib) messages: 236908 nosy: rhettinger priority: normal severity: normal status: open title: Have timeit warn about runs that are not independent of each other type: enhancement versions: Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23552 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com