Re: Meta decorator with parameters, defined in explicit functions

2016-07-01 Thread Ian Kelly
On Fri, Jul 1, 2016 at 11:32 PM, Ben Finney wrote: > Ian Kelly writes: > >> You should use functools.wraps instead of clobbering the decorated >> function's name and docstring: >> >> @functools.wraps(decorator) >> def

Re: Meta decorator with parameters, defined in explicit functions

2016-07-01 Thread Ben Finney
Ian Kelly writes: > You should use functools.wraps instead of clobbering the decorated > function's name and docstring: > > @functools.wraps(decorator) > def decorate(*args, **kwargs): > ... Thanks. Can you write the full implementation with

Re: Meta decorator with parameters, defined in explicit functions

2016-07-01 Thread Ian Kelly
On Fri, Jul 1, 2016 at 4:08 PM, Lawrence D’Oliveiro wrote: > On Tuesday, June 28, 2016 at 5:03:08 PM UTC+12, Ben Finney wrote: >> There is a clever one-line decorator that has been copy-pasted without >> explanation in many code bases for many years:: >> >>

View committed code via gitpython

2016-07-01 Thread Jason Bailey
Hi all, I'm trying to essentially replicate "gift grep" functionality with gitpython and am not quite sure how to pull the committed code from the repo using gitpython. I am successfully listing all the commits, so now all I need to do is view the code in each commit to do some regex matching

View committed code via gitpython

2016-07-01 Thread Jason Bailey
Hi all, I'm trying to essentially replicate "gift grep" functionality with gitpython and am not quite sure how to pull the committed code from the repo using gitpython. I am successfully listing all the commits, so now all I need to do is view the code in each commit to do some regex matching

Re: Namespaces are one honking great idea

2016-07-01 Thread Random832
On Fri, Jul 1, 2016, at 21:50, Kevin Conway wrote: > I believe the namespace object you are referring to is exactly a > class. IIRC, classes came about as a "module in a module". No, because classes have instances. And conceptually they seem like they *should* have instances. Just using the term

Re: Descriptor: class name precedence over instance name

2016-07-01 Thread Ben Finney
"Veek. M" writes: > Trying to make sense of this para: At the risk of being ruse, I am trying to make sense of some paragraphs in the messages you write here. Could you take a little more time to write clearly, as a way of communicating in this forum? > Is he say that

Re: Descriptor: class name precedence over instance name

2016-07-01 Thread Ian Kelly
On Fri, Jul 1, 2016 at 10:27 PM, Veek. M wrote: > Trying to make sense of this para: > > -- > Also, the attribute name used by the class to hold a descriptor takes > prece- dence over attributes stored on instances. > > In the

Descriptor: class name precedence over instance name

2016-07-01 Thread Veek. M
Trying to make sense of this para: -- Also, the attribute name used by the class to hold a descriptor takes prece- dence over attributes stored on instances. In the previous example, this is why the descriptor object takes a name parameter and why

Re: problem using pickle

2016-07-01 Thread Ben Finney
"Veek. M" writes: > class Foo(object): > pass > > object is a keyword and you're using it as an identifier Python does not have ‘object’ as a keyword. ‘and’ is a keyword. Here's the difference:: >>> object >>> object = "Lorem ipsum" >>> object

JAR files into python

2016-07-01 Thread Joaquin Alzola
Hi Guys I have the following script which will be used in Spark. #!/usr/bin/env python3 from pyspark_cassandra import CassandraSparkContext, Row from pyspark import SparkContext, SparkConf from pyspark.sql import SQLContext import os os.environ['CLASSPATH']="/mnt/spark/lib" conf =

Re: problem using pickle

2016-07-01 Thread Rustom Mody
On Saturday, July 2, 2016 at 9:17:01 AM UTC+5:30, Veek. M wrote: > object is a keyword and you're using it as an identifier keyword and builtin are different In this case though the advice remains the same In general maybe not... Just sayin' --

Re: problem using pickle

2016-07-01 Thread Veek. M
Nicky Mac wrote: > Dear Python team, > I have studied the excellent documentation, and attempted to make use > of pickle thus: > > filename = 'my_saved_adventure' > import pickle > class object: > def __init__(self,i,.t) : > self.id = i > . > > class

Re: subprocess startup error

2016-07-01 Thread Veek. M
Shweta Dinnimani wrote: > hi > > hello, I'm begineer to python programming.. I had installed python > 3.5.1 version on my windows 7 system. I was fine earlier and now when > i was trying the programs on string i'm facing the subprocess startup > error. IDLE is not connecting. And python shell is

Re: why x is changed in the following program?

2016-07-01 Thread Veek. M
maurice.char...@telecom-paristech.fr wrote: > from numpy import random > x=random.randn(6) > y=x > y[0]=12 > print x[0] > > > random.rand returns a list. x is a label to this list (container). y=x creates another label to the same container/list. y[0[ = 12 alters the 0th position of the

Re: Controlling the Mac OSX GUI via Python?

2016-07-01 Thread Lawrence D’Oliveiro
On Friday, July 1, 2016 at 4:59:11 PM UTC+12, Christian Gollwitzer wrote: > Yes, simulating mouse clicks with > fixed coordinates etc. is prone to such failure, but there are better > methods. These mouse clicks and keyboard events usually trigger a method > call inside the GUI program. If

Re: Namespaces are one honking great idea

2016-07-01 Thread Lawrence D’Oliveiro
On Saturday, July 2, 2016 at 1:50:56 PM UTC+12, Kevin Conway wrote: > Regardless, all use cases you've listed are already satisfied by use of the > static and class method decorators. Except for the need to decorate every such function inside the class. How about: import types def

Re: Namespaces are one honking great idea

2016-07-01 Thread Rustom Mody
On Friday, July 1, 2016 at 8:19:36 PM UTC+5:30, BartC wrote: > On 01/07/2016 15:13, Steven D'Aprano wrote: > > > Sometimes we have a group of related functions and variables that belong > > together, but are not sufficiently unrelated to the rest of the module that > > we want to split them out

Re: Fear and suspicion of lambdas, was Re: Meta decorator with parameters, defined in explicit functions

2016-07-01 Thread Ben Finney
Ben Bacarisse writes: > By replying I'm not accepting the premise -- I have no idea if there > is widespread fear and suspicion of lambdas among Python users but it > seems unlikely. I can testify, as the person who started this thread, that there is no fear or suspicion

Re: Namespaces are one honking great idea

2016-07-01 Thread Kevin Conway
I believe the namespace object you are referring to is exactly a class. IIRC, classes came about as a "module in a module". Regardless, all use cases you've listed are already satisfied by use of the static and class method decorators. Methods decorated with these do not require an instance

Re: Namespaces are one honking great idea

2016-07-01 Thread Steven D'Aprano
On Sat, 2 Jul 2016 05:29 am, Ethan Furman wrote: > On 07/01/2016 10:10 AM, Steven D'Aprano wrote: >> On Sat, 2 Jul 2016 02:00 am, Ethan Furman wrote: > >>> Did you mean for this to go to -Ideas? >> >> Not yet. I wanted some initial feedback to see if anyone else liked the >> idea before taking

[issue27405] Ability to trace Tcl commands executed by Tkinter

2016-07-01 Thread Terry J. Reedy
Terry J. Reedy added the comment: I just noticed that the patch includes a patch to _tkinter.c, which however, does not show up on the Rietveld dashboad, where I first reviewed it. Sorry for the mistaken comment. -- ___ Python tracker

Re: Meta decorator with parameters, defined in explicit functions

2016-07-01 Thread Lawrence D’Oliveiro
On Tuesday, June 28, 2016 at 5:03:08 PM UTC+12, Ben Finney wrote: > There is a clever one-line decorator that has been copy-pasted without > explanation in many code bases for many years:: > > decorator_with_args = lambda decorator: lambda *args, **kwargs: lambda > func: decorator(func,

[issue17128] OS X system openssl deprecated - installer should build local libssl

2016-07-01 Thread Kevin Ollivier
Kevin Ollivier added the comment: The OpenSSL included with OS X, still at 0.9.8, has become very dated and a growing number of servers (including openssl.org) now fail the handshake because they no longer support any of the protocols and ciphers included with that build. It is reaching the

[issue26885] Add parsing support for more types in xmlrpc

2016-07-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you for your review Terry. You can pass an integer in range from -2147483648 to 2147483647, and it is marshalled using the tag. But when you receive tags , , etc, they are unmarshalled to integer values, and these values can be out of range from

[issue27427] Add new math module tests

2016-07-01 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- nosy: +mark.dickinson, rhettinger, stutzbach title: Math tests -> Add new math module tests ___ Python tracker

[issue27405] Ability to trace Tcl commands executed by Tkinter

2016-07-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: You need to recompile the _tkinter module. -- ___ Python tracker ___ ___

[issue27173] Modern Unix key bindings for IDLE

2016-07-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: After committing the patch for this issue I'm going to refactor the code related to getting/setting theme/keys settings. For now it is too complicated, the logic is scattered between two files, some code is duplicated. --

[issue27405] Ability to trace Tcl commands executed by Tkinter

2016-07-01 Thread Terry J. Reedy
Terry J. Reedy added the comment: In "debug = False+1', I presume the '+1' is just temporary. The debug property and the clinic file refer to _tkinter.tkapp.get/settrace, which do not exist. Did you just forget to include that part? Or does 'preliminary' mean 'do not test yet'? >>> import

[issue27213] Rework CALL_FUNCTION* opcodes

2016-07-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The ABI of BUILD_MAP_UNPACK_WITH_CALL is changed. oparg=514 meant merging 2 dicts, but with the patch it will mean merging 514 dicts. The INCREF/DECREF calls on function objects surrounding calls are not needed, because the refcount was increased when the

[issue23908] Check path arguments of os functions for null character

2016-07-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you Zachary. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue23908] Check path arguments of os functions for null character

2016-07-01 Thread Roundup Robot
Roundup Robot added the comment: New changeset 30099abdb3a4 by Serhiy Storchaka in branch '2.7': Issue #23908: os functions, open() and the io.FileIO constructor now reject https://hg.python.org/cpython/rev/30099abdb3a4 -- ___ Python tracker

Re: Fear and suspicion of lambdas, was Re: Meta decorator with parameters, defined in explicit functions

2016-07-01 Thread Ben Bacarisse
dieter writes: >> Lawrence D’Oliveiro wrote: >>> I don’t know why this fear and suspicion of lambdas is so widespread among >>> Python users ... former Java/C# programmers, perhaps? By replying I'm not accepting the premise -- I have no idea if there is widespread fear and

[issue27436] Strange code in selectors.KqueueSelector

2016-07-01 Thread Xiang Zhang
Xiang Zhang added the comment: Oh, sorry. My focus seem to be on the wrong place. I thought David is arguing something about the constants are bitmasks or not. It's my fault. But actually the current code looks very clearly and I can tell from it that EVENT_* are bitmasks and KQ_FILTER_* are

[issue27173] Modern Unix key bindings for IDLE

2016-07-01 Thread Terry J. Reedy
Terry J. Reedy added the comment: Seems to be working correctly now, so I will review the code in detail. I will look into extracting a common get_theme_keys function and editing the long docstring currently attached to CurrentTheme. I want to look at paired functions in configdialog, such

[issue27436] Strange code in selectors.KqueueSelector

2016-07-01 Thread Demur Rumed
Demur Rumed added the comment: Xiang: pause a moment to read the code being discussed. event before the |= is 0. You're saying flag must READ xor WRITE xor neither. Then only one if can be taken. Therefore events |= EVENT_* will always happen with events == 0, therefore it can be events =

[issue27436] Strange code in selectors.KqueueSelector

2016-07-01 Thread David Beazley
David Beazley added the comment: I don't see any possible way that you would ever get events = EVENT_READ | EVENT_WRITE if the flag is a single value (e.g., KQ_FILTER_READ) and the flag itself is not a bitmask. Only one of those == tests will ever be True. There is no need to use |=.

[issue27436] Strange code in selectors.KqueueSelector

2016-07-01 Thread Berker Peksag
Changes by Berker Peksag : -- nosy: +neologix ___ Python tracker ___ ___

Re: Namespaces are one honking great idea

2016-07-01 Thread Ethan Furman
On 07/01/2016 10:10 AM, Steven D'Aprano wrote: On Sat, 2 Jul 2016 02:00 am, Ethan Furman wrote: Did you mean for this to go to -Ideas? Not yet. I wanted some initial feedback to see if anyone else liked the idea before taking it to Bikeshedding Central :-) Besides, I expect Python-Ideas

[issue27436] Strange code in selectors.KqueueSelector

2016-07-01 Thread Xiang Zhang
Xiang Zhang added the comment: But EVENT_* are. If you use =, events can only be either EVENT_READ or EVENT_WRITE, not EVENT_READ & EVENT_WRITE. EVENT_* != KQ_FILTER_*. -- ___ Python tracker

[issue27437] IDLE tests must be able to set user configuration values.

2016-07-01 Thread Terry J. Reedy
Terry J. Reedy added the comment: I don't believe that buildbots have an accessible $HOME that can be written to. In any case, tests of writing user config files should use StringIOs. -- ___ Python tracker

Re: Need help in python program

2016-07-01 Thread Christian Gollwitzer
Am 01.07.16 um 12:26 schrieb Archana Sonavane: Hello Everyone, I am doing python code by using API. My first API giving fields - Itemid, clock and value second API giving fields - Itemid, key, units and delay using for loops for both API. Could you please tell me how to compare both id by

[issue27437] IDLE tests must be able to set user configuration values.

2016-07-01 Thread Terry J. Reedy
Terry J. Reedy added the comment: Being able to force a rereading of user files from the menu could also be useful for manual testing or after a user fixes a problem. -- ___ Python tracker

[issue27436] Strange code in selectors.KqueueSelector

2016-07-01 Thread David Beazley
David Beazley added the comment: If the KQ_FILTER constants aren't bitmasks, it seems that the code could be simplified to the last version then. At the least, it would remove a few unnecessary calculations.Again, a very minor thing (I only stumbled onto it by accident really).

[issue27437] IDLE tests must be able to set user configuration values.

2016-07-01 Thread Terry J. Reedy
New submission from Terry J. Reedy: An important feature of IDLE is that it has default configuration values in idlelib/config-xyz.def files that can be overriden by user values in $HOME/.idlerc/config-xyz.cfg files. IDLE should run and tests should pass both without and with user overrides.

[issue20104] expose posix_spawn(p)

2016-07-01 Thread Danek Duvall
Danek Duvall added the comment: Oh, for what it's worth, Solaris added setsid support to posix_spawn a few years ago, as a result of this conversation. I still think it would be worthwhile supporting this in the stdlib, since we keep running into processes which have a lot of memory reserved

Re: Need help in python program

2016-07-01 Thread Bob Gailer
On Jul 1, 2016 6:30 AM, "Archana Sonavane" wrote: > > Hello Everyone, > > I am doing python code by using API. > > My first API giving fields - Itemid, clock and value > second API giving fields - Itemid, key, units and delay > > using for loops for both API. > > Could

[issue27436] Strange code in selectors.KqueueSelector

2016-07-01 Thread Xiang Zhang
Xiang Zhang added the comment: EVENT_* and KQ_FILTER_* are two different sets of constants. EVENT_* represent event types of the abstract event and KQ_FILTER_* represent the kevent filter type. EVENT_* can be combined while kevent.filter can only get one type. -- nosy: +xiang.zhang

Re: what the heck this code is doing?

2016-07-01 Thread Basant Dagar
Awesome. Thank you John for the prompt response. -- https://mail.python.org/mailman/listinfo/python-list

Re: what the heck this code is doing?

2016-07-01 Thread Basant Dagar
On Friday, July 1, 2016 at 2:06:28 PM UTC-4, John Gordon wrote: > In <3bbddafc-dcd6-4d5c-84f4-94077b5bc...@googlegroups.com> Basant Dagar > writes: > > > def lookup(d, keyval): > > found = False > > for child in d: > > if found : return child.text > >

[issue27434] cross-building python 3.6 with an older interpreter fails

2016-07-01 Thread Xavier de Gaye
Xavier de Gaye added the comment: With this patch, cross-building the 3.6 source with only python 3.5.1 on the PATH, produces the following configure error: checking for python interpreter for cross build... configure: error: python3.6 interpreter not found -- keywords: +patch

Re: what the heck this code is doing?

2016-07-01 Thread John Gordon
In <3bbddafc-dcd6-4d5c-84f4-94077b5bc...@googlegroups.com> Basant Dagar writes: > def lookup(d, keyval): > found = False > for child in d: > if found : return child.text > if child.tag == 'key' and child.text == keyval : > found =

what the heck this code is doing?

2016-07-01 Thread Basant Dagar
#See below code: def lookup(d, keyval): found = False for child in d: if found : return child.text if child.tag == 'key' and child.text == keyval : found = True return None trackID = lookup(entry, 'Track ID') Below is the main part of input xml file

Re: Namespaces are one honking great idea

2016-07-01 Thread Steven D'Aprano
On Sat, 2 Jul 2016 12:49 am, BartC wrote: > On 01/07/2016 15:13, Steven D'Aprano wrote: > >> Sometimes we have a group of related functions and variables that belong >> together, but are not sufficiently unrelated to the rest of the module >> that we want to split them out into another file. >

Re: Creating a calculator

2016-07-01 Thread Jussi Piitulainen
Steven D'Aprano writes: > On Fri, 1 Jul 2016 10:25 pm, Christopher Reimer wrote: > >> For my BASIC interpreter, each line of BASIC is broken this way into >> tokens. > [...] >> By using * to unpack the split line, my program no longer crashes and no >> try/except block is needed to work around

Re: Namespaces are one honking great idea

2016-07-01 Thread Steven D'Aprano
On Sat, 2 Jul 2016 02:00 am, Ethan Furman wrote: > On 07/01/2016 07:13 AM, Steven D'Aprano wrote: > > I like the idea, but I have a couple questions about the design choices. Thanks! > Comments below. [...] >> Despite the "class" statement (a limitation of Python's lack of dedicated >>

Re: Namespaces are one honking great idea

2016-07-01 Thread Chris Angelico
On Sat, Jul 2, 2016 at 12:49 AM, BartC wrote: > Why not just extend the capabilities of a class? I actually thought this > would work until I tried it and it didn't: > > class C(): > def fn(): > print ("Hi!") > > C.fn() > > The error message suggests Python knows

[issue27337] 3.6.0a2 tarball has weird paths

2016-07-01 Thread Nick Timkovich
Nick Timkovich added the comment: In pyenv this was "fixed" by pointing to the .tar.xz archive instead of the .tgz https://github.com/yyuu/pyenv/pull/652, maybe you could implement that for Pythonz? -- nosy: +nicktimko -ned.deily, petere ___ Python

[issue27079] Bugs in curses.ascii predicates

2016-07-01 Thread Akira Li
Akira Li added the comment: I'm not sure anything should be done (e.g., it is "undefined behavior" to pass a negative value such as CHAR_MIN (if *char* type is signed) to a character classification function in C. Though EOF value (-1 traditionally) should be handled). If you want to explore

[ANN] pygcgen (github changelog generator)

2016-07-01 Thread topic2k--- via Python-list
Hello, maybe you know "GitHub Changelog Generator" (https://github.com/skywinder/github-changelog-generator). As i came across it, i liked to try it, but wasn't able to get it running. The script is written in Ruby. As i don't know Ruby, i had the idea to convert it to Python. After a few

[issue27285] Document the deprecation of pyvenv in favor of `python3 -m venv`

2016-07-01 Thread Brett Cannon
Brett Cannon added the comment: Thanks for the patch, Steve! Since this is a bug fix I may take until after 3.6b1 goes out to get reviewed and committed since I need to get any semantic changes in before then (b1 is due out in Sep). So if this patch lingers for a couple months, that will be

[issue23908] Check path arguments of os functions for null character

2016-07-01 Thread Zachary Ware
Zachary Ware added the comment: I get one test failure: ERROR: test_u (__main__.Unicode_TestCase) -- Traceback (most recent call last): File "P:\ath\to\cpython\lib\test\test_getargs2.py", line 782, in test_u

Re: Namespaces are one honking great idea

2016-07-01 Thread Ethan Furman
On 07/01/2016 07:13 AM, Steven D'Aprano wrote: I like the idea, but I have a couple questions about the design choices. Comments below. The Zen of Python says: Namespaces are one honking great idea -- let's do more of those! Proposal = Add a new "namespace" object to

[issue27436] Strange code in selectors.KqueueSelector

2016-07-01 Thread David Beazley
New submission from David Beazley: Not so much a bug, but an observation based on reviewing the implementation of the selectors.KqueueSelector class. In that class there is the select() method: def select(self, timeout=None): timeout = None if timeout is None else

Re: Can math.atan2 return INF?

2016-07-01 Thread Marko Rauhamaa
Rustom Mody : > There are other more reasonable non-religious non-dualistic notions of > soul possible: Software engineers should have an easy time understanding what a soul is: a sufficiently sophisticated software system in execution. I'd say the minimum requirement for

Re: Creating a calculator

2016-07-01 Thread Christopher Reimer
> On Jul 1, 2016, at 6:52 AM, Steven D'Aprano wrote: > >> On Fri, 1 Jul 2016 10:25 pm, Christopher Reimer wrote: >> >> For my BASIC interpreter, each line of BASIC is broken this way into >> tokens. > [...] >> By using * to unpack the split line, my program no longer

[issue22724] byte-compile fails for cross-builds

2016-07-01 Thread Xavier de Gaye
Xavier de Gaye added the comment: Adding -E to PYTHON_FOR_BUILD fixes the x86_64 install because in my Android cross-build setup, the native interpreter is built from the same source tree as the cross-build. However, currently the interpreter used for the cross-build may be any interpreter

[issue26765] Factor out common bytes and bytearray implementation

2016-07-01 Thread Roundup Robot
Roundup Robot added the comment: New changeset b0087e17cd5e by Serhiy Storchaka in branch 'default': Issue #26765: Moved wrappers for bytes and bytearray methods to common header https://hg.python.org/cpython/rev/b0087e17cd5e -- ___ Python tracker

Re: Namespaces are one honking great idea

2016-07-01 Thread BartC
On 01/07/2016 15:13, Steven D'Aprano wrote: Sometimes we have a group of related functions and variables that belong together, but are not sufficiently unrelated to the rest of the module that we want to split them out into another file. Here's a proof of concept. I use a class with a custom

Re: Namespaces are one honking great idea

2016-07-01 Thread Random832
On Fri, Jul 1, 2016, at 10:13, Steven D'Aprano wrote: > The biggest limitation is that I have to abuse the class statement to do > this. In an ideal world, there would be syntactic support and a keyword: > > namespace Example: > x = 0 > y = [] > def test(n): ... > >

[issue27435] ctypes and AIX - also for 2.7.X (and later)

2016-07-01 Thread aixtools
New submission from aixtools: I am opening a new issue # - about the same problem described in 26439, but now calling it a bug rather than a behavior change. Then I did not know better - all was new, and as the "new" kid I felt uncomfortable calling it a bug - when maybe it was just behavior I

[issue27007] Alternate constructors bytes.fromhex() and bytearray.fromhex() return an instance of base type

2016-07-01 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue27007] Alternate constructors bytes.fromhex() and bytearray.fromhex() return an instance of base type

2016-07-01 Thread Roundup Robot
Roundup Robot added the comment: New changeset 62375fd21de8 by Serhiy Storchaka in branch 'default': Issue #27007: The fromhex() class methods of bytes and bytearray subclasses https://hg.python.org/cpython/rev/62375fd21de8 -- nosy: +python-dev ___

Re: Creating a calculator

2016-07-01 Thread alister
On Fri, 01 Jul 2016 23:52:45 +1000, Steven D'Aprano wrote: > On Fri, 1 Jul 2016 10:25 pm, Christopher Reimer wrote: > >> For my BASIC interpreter, each line of BASIC is broken this way into >> tokens. > [...] >> By using * to unpack the split line, my program no longer crashes and >> no

super and mix-in class: how exactly is the search order altered?

2016-07-01 Thread Veek. M
I had posted this on StackOverflow - it's an excellent example of why SO sucks (don't want that happening here so please read carefully): http://stackoverflow.com/questions/38145818/super-and-mix-in-class-how-exactly-is-the-search-order-altered?noredirect=1#comment63722336_38145818 I'm reading

[issue27434] cross-building python 3.6 with an older interpreter fails

2016-07-01 Thread Matthias Klose
Matthias Klose added the comment: yes, I think we have to limit the choice of the interpreter for the build to the same major version. -- ___ Python tracker

Re: Can math.atan2 return INF?

2016-07-01 Thread Rustom Mody
On Thursday, June 30, 2016 at 11:33:58 PM UTC+5:30, Steven D'Aprano wrote: > On Fri, 1 Jul 2016 01:28 am, Rustom Mody wrote: > > > On Thursday, June 30, 2016 at 1:55:18 PM UTC+5:30, Steven D'Aprano wrote: > > > >> you state that Turing "believes in souls" and that he "wishes to > >> put the soul

Namespaces are one honking great idea

2016-07-01 Thread Steven D'Aprano
The Zen of Python says: Namespaces are one honking great idea -- let's do more of those! Proposal = Add a new "namespace" object to Python. Rationale == Sometimes we have a group of related functions and variables that belong together, but are not sufficiently unrelated

[issue27007] Alternate constructors bytes.fromhex() and bytearray.fromhex() return an instance of base type

2016-07-01 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- assignee: -> serhiy.storchaka ___ Python tracker ___

[issue20770] Inform caller of smtplib STARTTLS failures

2016-07-01 Thread R. David Murray
Changes by R. David Murray : -- stage: -> resolved ___ Python tracker ___ ___

[issue27424] Failures in test.test_logging

2016-07-01 Thread R. David Murray
R. David Murray added the comment: Domain names should never have non-ascii in them. They should be IDNA encoded. There is a known problem where Windows will return non-ascii domain names if the local hostname is configured naively (see issue 9377). SMTPUTF8 might be a workaround in

[issue27213] Rework CALL_FUNCTION* opcodes

2016-07-01 Thread Demur Rumed
Demur Rumed added the comment: callfunc3 addresses most feedback. Doesn't address _PyEval_EvalCodeWithName2 code bloat, & I disagree with mentioning BUILD_MAP_UNPACK_WITH_CALL change in magic number update as the ABI of BUILD_MAP_UNPACK_WITH_CALL is unchanged. ie if we were to implement

[issue27432] Unittest truncating of error message not works

2016-07-01 Thread R. David Murray
R. David Murray added the comment: This is by design. The short option was introduced to use in specific asserts (assertDictEqual and assertMultilineEqual; see 8b8701551253). These were later enhanced to do an even better job of abbreviating the output usefully, but the short option on

Re: Creating a calculator

2016-07-01 Thread Steven D'Aprano
On Fri, 1 Jul 2016 10:25 pm, Christopher Reimer wrote: > For my BASIC interpreter, each line of BASIC is broken this way into > tokens. [...] > By using * to unpack the split line, my program no longer crashes and no > try/except block is needed to work around the crash. A later line of code >

[issue27413] Add an option to json.tool to bypass non-ASCII characters.

2016-07-01 Thread Wei-Cheng Pan
Wei-Cheng Pan added the comment: > The patch needs tests and documentation. Ok, I'll update it later. >> +parser.add_argument('--no-ensure-ascii', action='store_true', >> default=False, >I'd go with ``action='store_false', default=True``. If I'm not misreading your comment, this will

Re: Creating a calculator

2016-07-01 Thread Jussi Piitulainen
Christopher Reimer writes: >> On Jul 1, 2016, at 5:46 AM, Jussi Piitulainen wrote: >> >> Christopher Reimer writes: >> >>> For my BASIC interpreter, each line of BASIC is broken this way into >>> tokens. >>> >>> line_number, keyword, *expression = line.split(' ', 2) >>> >>> For a line like 10

Re: Creating a calculator

2016-07-01 Thread Christopher Reimer
> On Jul 1, 2016, at 5:46 AM, Jussi Piitulainen > wrote: > > Christopher Reimer writes: > >> For my BASIC interpreter, each line of BASIC is broken this way into >> tokens. >> >> line_number, keyword, *expression = line.split(' ', 2) >> >> For a line like 10

Re: Creating a calculator

2016-07-01 Thread Pierre-Alain Dorange
Chris Warrick wrote: > > More reduced : > > -- > > u=raw_input('Enter calculation:") > > print eval(u) > > -- > > works and compute : > > 1+2+3+4-1+4*2 > > 2+3.0/2-0.5 > > > > Perform better and shorter, but less

[issue27434] cross-building python 3.6 with an older interpreter fails

2016-07-01 Thread Xavier de Gaye
New submission from Xavier de Gaye: Cross-building the 3.6 source with PYTHON_FOR_BUILD using archlinux python 3.5.1 as found in PATH, fails with: _PYTHON_PROJECT_BASE=/home/xavier/src/android/pyona/build/python3.6-android-21-x86 _PYTHON_HOST_PLATFORM=linux-x86

[issue26137] [idea] use the Microsoft Antimalware Scan Interface

2016-07-01 Thread Thomas Heller
Changes by Thomas Heller : -- nosy: +theller ___ Python tracker ___ ___ Python-bugs-list

[issue27417] Call CoInitializeEx on startup

2016-07-01 Thread Thomas Heller
Changes by Thomas Heller : -- nosy: +theller ___ Python tracker ___ ___ Python-bugs-list

Re: Creating a calculator

2016-07-01 Thread Jussi Piitulainen
Christopher Reimer writes: > For my BASIC interpreter, each line of BASIC is broken this way into > tokens. > > line_number, keyword, *expression = line.split(' ', 2) > > For a line like 10 PRINT "HELLO, WORLD!", this works as expected. > > For a line like 20 END, which doesn't have a third

[issue26110] Speedup method calls 1.2x

2016-07-01 Thread INADA Naoki
INADA Naoki added the comment: Oops, previous patch doesn't update magic number in PC/launcher.c Should I update it? Or don't touch it to avoid additional conflicts? -- Added file: http://bugs.python.org/file43601/call_method_3.patch ___ Python

[issue27425] Tests fail because of git's newline preferences on Windows

2016-07-01 Thread R. David Murray
R. David Murray added the comment: Yes .gitattributes looks like the correct solution. The problem is that most of the text files we *want* git to transform per platform, it's just a few that we don't. Mercurial actually added support for this for us when we switched to it. --

Re: Creating a calculator

2016-07-01 Thread Christopher Reimer
> On Jun 30, 2016, at 11:42 PM, Jussi Piitulainen > wrote: > > DFS writes: > >> Here's a related program that doesn't require you to tell it what type >> of operation to perform. Just enter 'num1 operator num2' and hit >> Enter, and it will parse the entry and

[issue26984] int() can return not exact int instance

2016-07-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Proposed patch makes int() always returning exact int. -- keywords: +patch stage: -> patch review Added file: http://bugs.python.org/file43600/int_exact.patch ___ Python tracker

[issue26110] Speedup method calls 1.2x

2016-07-01 Thread INADA Naoki
INADA Naoki added the comment: Updated, based on 102241:908b801f8a62 -- nosy: +naoki Added file: http://bugs.python.org/file43599/call_method_2.patch ___ Python tracker

[issue26664] Misuse of $ in activate.fish of venv

2016-07-01 Thread László Károlyi
László Károlyi added the comment: +1 here, broken on homebrew cpython > 3.5.1 (a.k.a. 3.5.2) -- nosy: +karolyi ___ Python tracker ___

[issue22928] HTTP header injection in urrlib2/urllib/httplib/http.client (CVE-2016-5699)

2016-07-01 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- assignee: serhiy.storchaka -> georg.brandl ___ Python tracker ___

[issue22928] HTTP header injection in urrlib2/urllib/httplib/http.client (CVE-2016-5699)

2016-07-01 Thread koobs
Changes by koobs : -- versions: +Python 3.3 ___ Python tracker ___ ___

  1   2   >