Re: Cross-language comparison: function map and similar

2017-08-16 Thread Pavol Lisy
On 8/16/17, Steve D'Aprano wrote: > Over in another thread, we've been talking about comprehensions and their > similarities and differences from the functional map() operation. > > Reminder: > > map(chr, [65, 66, 67, 68]) > > will return ['A', 'B', 'C']. > > My

Re: Default .py program and Edit with IDLE problem

2017-08-16 Thread dieter
"Kevi Aday (Katch22)" writes: > I installed python 3.6.2 for making running and editing programs. Later on I > installed python 2.7 > because a program that I downloaded only works with that. Later I deleted the > program. I then wanted to run a > program from cmd but it

Re: A small quiz question

2017-08-16 Thread Marko Rauhamaa
Dennis Lee Bieber : > I suppose, the two in combination imply that the calls to "f()" > occur first in left to right, but then the "**" are applied to the > returned values right to left -- rather than having the calls > performed in the exponentiation order. Yes,

Re: Cross-language comparison: function map and similar

2017-08-16 Thread Paul Rubin
Steve D'Aprano writes: > Are there language implementations which evaluate the result of map() > (or its equivalent) in some order other than the obvious left-to-right > first-to-last sequential order? Is that order guaranteed by the > language, or is it an

[issue29593] Improve UnboundLocalError message for deleted names

2017-08-16 Thread Vedran Čačić
Vedran Čačić added the comment: Re: http://bugs.python.org/msg288032 I don't know what example Raymond had, but your example In [5]: def foo(): ...: n = 1 ...: def g(): # imagine a more complex g ...: del n ...: g() ...: print(n) #UnboundLocalError is

[issue31148] Can we get an MSI installer for something past 3.4.4?

2017-08-16 Thread D Gentry
D Gentry added the comment: So basically what your saying is that the MSI that I compile will only work for my specific situation as I'm not building it with a bundle? Hmm, that kind of sucks. Disregarding the difficulty of manually converting from source to MSI, if I was to choose to produce

Re: A question on modification of a list via a function invocation

2017-08-16 Thread Steve D'Aprano
On Thu, 17 Aug 2017 12:24 pm, Stefan Ram wrote: > Steve D'Aprano writes: >>On Thu, 17 Aug 2017 11:07 am, Stefan Ram wrote: >>>So, when an argument is actually passed, then the parameter >>>can be modified? It seems Mok-Kong Shen was writing about >>>this case. >>I

Need some help managing project and making it a little simple (pretty messed up code)

2017-08-16 Thread Kryptxy via Python-list
Hello, I am new to python. While learning python, I began a side project. Its a command-line search program. Here: https://github.com/kryptxy/torrench The project is becoming a little difficult to manage, and before it becomes more complex, I'd like to sort it out a little and make it more

Re: A question on modification of a list via a function invocation

2017-08-16 Thread Steve D'Aprano
On Thu, 17 Aug 2017 11:07 am, Stefan Ram wrote: > Steve D'Aprano writes: >>On Thu, 17 Aug 2017 08:29 am, Mok-Kong Shen wrote: >>>In the first case, any modification of the formal parameter >>Technically, you cannot modify the formal parameter, because the formal

Re: A question on modification of a list via a function invocation

2017-08-16 Thread Steve D'Aprano
On Thu, 17 Aug 2017 10:14 am, Ned Batchelder wrote: > the name/value data model of > Python is not some trivial detail that we could change to match some > other language: it's a fundamental part of what makes Python what it is. It is also an evaluation model which matches nearly all of the

Re: A question on modification of a list via a function invocation

2017-08-16 Thread Mok-Kong Shen
Am 17.08.2017 um 02:14 schrieb Ned Batchelder: On Thu, Aug 17, 2017 at 8:29 AM, Mok-Kong Shen wrote: Anyway, while any new user of a programming language certainly can be expected to take good efforts to learn a lot of new stuffs, I suppose it's good for any practical programming language to

Re: A question on modification of a list via a function invocation

2017-08-16 Thread Cameron Simpson
On 17Aug2017 02:49, Mok-Kong Shen wrote: I don't yet understand. Why (by which rule of the language reference) should "alist=[30,60,90]" mean discarding the name's reference to the [1,2,3] list? Section 7.2: Simple statements: Assignment Statements. It says: An

Re: A question on modification of a list via a function invocation

2017-08-16 Thread Mok-Kong Shen
Am 17.08.2017 um 02:41 schrieb Steve D'Aprano: On Thu, 17 Aug 2017 08:29 am, Mok-Kong Shen wrote: I have earlier learned some other (older) programming languages. For these the formal parameters are either "by reference" or "by value". By reference and by value are not the only two

Re: A question on modification of a list via a function invocation

2017-08-16 Thread Ben Finney
Mok-Kong Shen writes: > I don't yet understand. Why (by which rule of the language reference) > should "alist=[30,60,90]" mean discarding the name's reference to the > [1,2,3] list? I think I understand that question, but I find it surprising. What is your

Re: A small quiz question

2017-08-16 Thread Steve D'Aprano
On Thu, 17 Aug 2017 09:12 am, Dennis Lee Bieber wrote: > I suppose, the two in combination imply that the calls to "f()" occur > first in left to right, but then the "**" are applied to the returned > values right to left -- rather than having the calls performed in the > exponentiation order.

Re: Why is my class undefined?

2017-08-16 Thread Sayth Renshaw
On Thursday, 17 August 2017 09:03:59 UTC+10, Ian wrote: wrote: > > Morning > > > > I haven't ventured into classes much before. When trying to follow some > > examples and create my own classes in a jupyter notebook I receive an error > > that the class is undefined. > > > > So I created for

Re: A question on modification of a list via a function invocation

2017-08-16 Thread Ben Finney
Steve D'Aprano writes: > On Thu, 17 Aug 2017 08:29 am, Mok-Kong Shen wrote: > > > I have earlier learned some other (older) programming languages. For > > these the formal parameters are either "by reference" or "by value". > > By reference and by value are not the

Re: A question on modification of a list via a function invocation

2017-08-16 Thread Mok-Kong Shen
Am 17.08.2017 um 01:58 schrieb Cameron Simpson: On 17Aug2017 01:03, Mok-Kong Shen wrote: Am 17.08.2017 um 00:39 schrieb Chris Angelico: On Thu, Aug 17, 2017 at 8:29 AM, Mok-Kong Shen wrote: Chris wrote: objects exist independently of

Re: A question on modification of a list via a function invocation

2017-08-16 Thread Steve D'Aprano
On Thu, 17 Aug 2017 08:29 am, Mok-Kong Shen wrote: > I have earlier learned some other (older) programming languages. For > these the formal parameters are either "by reference" or "by value". By reference and by value are not the only two conventions. Perhaps if you go back to the 1950s you

Re: A question on modification of a list via a function invocation

2017-08-16 Thread Chris Angelico
On Thu, Aug 17, 2017 at 9:03 AM, Mok-Kong Shen wrote: > Am 17.08.2017 um 00:39 schrieb Chris Angelico: >> >> On Thu, Aug 17, 2017 at 8:29 AM, Mok-Kong Shen >> wrote: >>> >>> I have earlier learned some other (older) programming languages. For

[issue5001] Remove assertion-based checking in multiprocessing

2017-08-16 Thread drallensmith
drallensmith added the comment: Pull request submitted (4 days ago) for managers.py, queue.py; just added pool.py changes to those. -- versions: +Python 3.7 -Python 3.6 ___ Python tracker

Re: A question on modification of a list via a function invocation

2017-08-16 Thread Ned Batchelder
On Thu, Aug 17, 2017 at 8:29 AM, Mok-Kong Shen wrote: > Anyway, while > any new user of a programming language certainly can be expected to > take good efforts to learn a lot of new stuffs, I suppose it's good > for any practical programming language to minimize the cases of > surprises for those

Re: A question on modification of a list via a function invocation

2017-08-16 Thread Cameron Simpson
On 17Aug2017 01:03, Mok-Kong Shen wrote: Am 17.08.2017 um 00:39 schrieb Chris Angelico: On Thu, Aug 17, 2017 at 8:29 AM, Mok-Kong Shen wrote: Chris wrote: objects exist independently of names, and names refer to objects. If you do "x = y",

Re: Proposed new syntax

2017-08-16 Thread Ben Finney
Steve D'Aprano writes: > On Thu, 17 Aug 2017 12:28 am, Ben Finney wrote: > > > Steve D'Aprano writes: > > > >> If he wanted declarative semantics, why didn't he argue for > >> declarative syntax like "select...where", instead of choosing

Re: A question on modification of a list via a function invocation

2017-08-16 Thread Ian Kelly
On Wed, Aug 16, 2017 at 5:03 PM, Stefan Ram wrote: > Chris Angelico writes: >>objects exist independently of names > > When the object »Example()« loses its name below, > it loses its existence. > > class Example(object): > ... def

Re: Why is my class undefined?

2017-08-16 Thread Jan Erik Moström
On 17 Aug 2017, at 0:48, Sayth Renshaw wrote: > what exactly am I doing wrong? Outdent the if-statement = jem -- https://mail.python.org/mailman/listinfo/python-list

Re: A question on modification of a list via a function invocation

2017-08-16 Thread Mok-Kong Shen
Am 17.08.2017 um 00:39 schrieb Chris Angelico: On Thu, Aug 17, 2017 at 8:29 AM, Mok-Kong Shen wrote: I have earlier learned some other (older) programming languages. For these the formal parameters are either "by reference" or "by value". In the first case, any

Re: Why is my class undefined?

2017-08-16 Thread Ian Kelly
On Wed, Aug 16, 2017 at 4:48 PM, Sayth Renshaw wrote: > Morning > > I haven't ventured into classes much before. When trying to follow some > examples and create my own classes in a jupyter notebook I receive an error > that the class is undefined. > > So I created for

[issue31212] datetime: min date (0001-01-01 00:00:00) can't be converted to local timestamp

2017-08-16 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > It still seems like this shouldn't give an error (especially when the > timezone of the local machine is UTC) This is the part where I agree with you. I suspect the error in the UTC case is an artifact of PEP 495 fold calculations that require

Re: A question on modification of a list via a function invocation

2017-08-16 Thread Cameron Simpson
On 16Aug2017 23:06, Mok-Kong Shen wrote: Am 15.08.2017 um 20:47 schrieb Larry Hudson: [snip] === test2() code == def test2(alist): ss ─┬─> [1, 2, 3] alist ─┘ -

Why is my class undefined?

2017-08-16 Thread Sayth Renshaw
Morning I haven't ventured into classes much before. When trying to follow some examples and create my own classes in a jupyter notebook I receive an error that the class is undefined. So I created for practise a frog class class frog(object): def __init__(self, ftype, word):

[issue31212] datetime: min date (0001-01-01 00:00:00) can't be converted to local timestamp

2017-08-16 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: BTW, I was originally against introducing .timestamp() method and this issue illustrates why it is problematic: people use it without understanding what it does. If you want the distance between datetime.min and datetime(1970,1,1) in seconds - compute

Re: A question on modification of a list via a function invocation

2017-08-16 Thread Chris Angelico
On Thu, Aug 17, 2017 at 8:29 AM, Mok-Kong Shen wrote: > I have earlier learned some other (older) programming languages. For > these the formal parameters are either "by reference" or "by value". > In the first case, any modification of the formal parameter inside > a

[issue31212] datetime: min date (0001-01-01 00:00:00) can't be converted to local timestamp

2017-08-16 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: It your use case, the input "0001-01-01T00:00:00" was in what timezone? I suspect what you want is >>> datetime.min.replace(tzinfo=timezone.utc).timestamp() -62135596800.0 And not -62135658000.0. If you work with naive datetimes and just want to

Re: A question on modification of a list via a function invocation

2017-08-16 Thread Mok-Kong Shen
Am 16.08.2017 um 23:20 schrieb Ned Batchelder: On 8/16/17 5:06 PM, Mok-Kong Shen wrote: Am 15.08.2017 um 20:47 schrieb Larry Hudson: [snip] === test2() code == def test2(alist): ss ─┬─> [1, 2, 3] alist ─┘

[issue31212] datetime: min date (0001-01-01 00:00:00) can't be converted to local timestamp

2017-08-16 Thread Dave Johansen
Dave Johansen added the comment: Ok, so I understand the issue now. `timestamp()` for naive datetime instances applies the local timezone offset ( https://docs.python.org/3.6/library/datetime.html#datetime.datetime.timestamp ). This is surprising because naive datetime instances usually are

[issue29593] Improve UnboundLocalError message for deleted names

2017-08-16 Thread Barry A. Warsaw
Changes by Barry A. Warsaw : -- nosy: +barry ___ Python tracker ___ ___ Python-bugs-list

Re: Request Help With Gdk.Display

2017-08-16 Thread Wildman via Python-list
On Wed, 16 Aug 2017 14:33:27 -0500, Wildman wrote: > On Wed, 16 Aug 2017 19:11:16 +0100, MRAB wrote: > >> On 2017-08-16 18:57, Wildman via Python-list wrote: >>> I am working on a program for the Linux platform that >>> reports system information. The program reports screen >>> information,

[issue31212] datetime: min date (0001-01-01 00:00:00) can't be converted to local timestamp

2017-08-16 Thread Dave Johansen
Dave Johansen added the comment: The use case was parsing user input of ISO 8601 date strings and converting them to UNIX epochs. The input "0001-01-01T00:00:00" is valid, parses to a valid `datetime` and it seems like a reasonable expectation that all of the functions should work on a valid

[issue31212] datetime: min date (0001-01-01 00:00:00) can't be converted to local timestamp

2017-08-16 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On the second thought, a reasonable design can use datetime.min/max as placeholders for unknown times far in the past/future compensating for the lack datetime ±inf. In this use case, it may be annoying to see errors from timestamp() instead of some

Default .py program and Edit with IDLE problem

2017-08-16 Thread Kevi Aday (Katch22)
Hello, I installed python 3.6.2 for making running and editing programs. Later on I installed python 2.7 because a program that I downloaded only works with that. Later I deleted the program. I then wanted to run a program from cmd but it was giving me all kinds of errors I didn’t used to get.

[issue31212] datetime: min date (0001-01-01 00:00:00) can't be converted to local timestamp

2017-08-16 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: The question is whether -62135658000.0 is the "correct" or even meaningful value: >>> datetime.utcfromtimestamp(-62135658000.0) Traceback (most recent call last): File "", line 1, in ValueError: year is out of range (I ran the above in Python 2.7 to

Re: A small quiz question

2017-08-16 Thread Ben Bacarisse
Steve D'Aprano writes: > On Wed, 16 Aug 2017 11:38 pm, Ben Bacarisse wrote: > >> r...@zedat.fu-berlin.de (Stefan Ram) writes: >> >>> I wrote my first Python quiz question! >>> >>> It goes like this: >>> >>> Can you predict (without trying it out) what the

Re: A question on modification of a list via a function invocation

2017-08-16 Thread Ned Batchelder
On 8/16/17 5:06 PM, Mok-Kong Shen wrote: > Am 15.08.2017 um 20:47 schrieb Larry Hudson: > [snip] >>> === test2() code == >>> def test2(alist): ss ─┬─> [1, 2, 3] >>> alist ─┘ >>> - >>>

[issue31212] datetime: min date (0001-01-01 00:00:00) can't be converted to local timestamp

2017-08-16 Thread Dave Johansen
Dave Johansen added the comment: That's a valid `datetime` (i.e. within the min and max values) and `tzinfo` is `None` so I think it's completely reasonable to assume that `timestamp()` will return the correct value. -- ___ Python tracker

Re: A question on modification of a list via a function invocation

2017-08-16 Thread Mok-Kong Shen
Am 15.08.2017 um 20:47 schrieb Larry Hudson: [snip] === test2() code == def test2(alist): ss ─┬─> [1, 2, 3] alist ─┘ - ss ─┬─> [3, 6, 9] alist ─┘

[issue31210] Can not import modules if sys.prefix contains DELIM

2017-08-16 Thread Cédric Krier
Cédric Krier added the comment: I'm wondering if it could have security implications and be used to fool user by changing the PYTHONPATH. -- ___ Python tracker

[issue31211] distutils/util.py get_platform() does not identify linux-i686 platforms

2017-08-16 Thread Siming Yuan
Changes by Siming Yuan : -- nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list

[issue31211] distutils/util.py get_platform() does not identify linux-i686 platforms

2017-08-16 Thread Siming Yuan
Siming Yuan added the comment: Hi Eric I understand where you are coming from, but I disagree with having to raise this to 3rd party tools. both wheel/pip makes calls to distutils.util.get_platform(). Fixing it in one location would fix it across the board. In addition, taking setuptools &

Re: Request Help With Gdk.Display

2017-08-16 Thread Wildman via Python-list
On Wed, 16 Aug 2017 19:11:16 +0100, MRAB wrote: > On 2017-08-16 18:57, Wildman via Python-list wrote: >> I am working on a program for the Linux platform that >> reports system information. The program reports screen >> information, number of monitors, resolution of each one >> and the total

[issue30102] improve performance of libSSL usage on hashing

2017-08-16 Thread Christian Heimes
Changes by Christian Heimes : -- pull_requests: +3151 ___ Python tracker ___ ___

[issue18966] Threads within multiprocessing Process terminate early

2017-08-16 Thread Antoine Pitrou
Antoine Pitrou added the comment: This is now fixed in git master. Thank you for the report! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue18966] Threads within multiprocessing Process terminate early

2017-08-16 Thread Antoine Pitrou
Antoine Pitrou added the comment: New changeset ee84a608587b930176d37303afae8a4358e15990 by Antoine Pitrou in branch 'master': bpo-18966: non-daemonic threads created by a multiprocessing.Process should be joined on exit (#3111)

[issue18966] Threads within multiprocessing Process terminate early

2017-08-16 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- stage: needs patch -> patch review versions: +Python 3.7 -Python 3.6 ___ Python tracker ___

[issue18966] Threads within multiprocessing Process terminate early

2017-08-16 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- pull_requests: +3150 ___ Python tracker ___ ___

Re: A small quiz question

2017-08-16 Thread Marko Rauhamaa
Ian Kelly : > On Wed, Aug 16, 2017 at 6:51 AM, Dennis Lee Bieber > wrote: >>>def f(i): print(i); return i; >>> >>>f(4)**f(1)**f(2) >>> >> >> As a first guess >> >> 2 >> 1 >> 4 >> >> 4 >> >> since in many languages, exponentiation associates

[issue31219] Spam

2017-08-16 Thread Zachary Ware
Changes by Zachary Ware : -- components: -Argument Clinic nosy: -Basiruddin Syarifan Radifan, larry, matrixise resolution: rejected -> not a bug title: test -> Spam type: behavior -> versions: -Python 3.6 ___ Python

[issue31220] test

2017-08-16 Thread Zachary Ware
Changes by Zachary Ware : Removed file: http://bugs.python.org/file47087/_.txt ___ Python tracker ___

[issue31220] Spam

2017-08-16 Thread Zachary Ware
Changes by Zachary Ware : -- components: -Argument Clinic nosy: -Basiruddin Syarifan Radifan, larry, matrixise resolution: rejected -> not a bug title: test -> Spam type: crash -> versions: -Python 3.4 ___ Python tracker

[issue31223] Spam

2017-08-16 Thread Zachary Ware
Changes by Zachary Ware : Removed file: http://bugs.python.org/file47089/kingskrupellos.txt ___ Python tracker ___

[issue31223] Spam

2017-08-16 Thread Zachary Ware
Changes by Zachary Ware : -- components: -Unicode nosy: -adminos, doko, ezio.melotti, haypo, larry resolution: works for me -> not a bug stage: -> resolved status: open -> closed title: Hacked By KingSkrupellos Cyberizm.Org Digital Security Technological

Re: Request Help With Gdk.Display

2017-08-16 Thread MRAB
On 2017-08-16 18:57, Wildman via Python-list wrote: I am working on a program for the Linux platform that reports system information. The program reports screen information, number of monitors, resolution of each one and the total resolution. It does it using a couple of external utils, Xrandr

Re: Cross-language comparison: function map and similar

2017-08-16 Thread Terry Reedy
On 8/16/2017 10:53 AM, Steve D'Aprano wrote: Over in another thread, we've been talking about comprehensions and their similarities and differences from the functional map() operation. Reminder: map(chr, [65, 66, 67, 68]) will return ['A', 'B', 'C']. The comprehension 'while' proposal is for

[issue31223] Hacked By KingSkrupellos Cyberizm.Org Digital Security Technological Turkish Moslem Army

2017-08-16 Thread Zachary Ware
Changes by Zachary Ware : -- Removed message: http://bugs.python.org/msg300384 ___ Python tracker ___

[issue31223] Hacked By KingSkrupellos Cyberizm.Org Digital Security Technological Turkish Moslem Army

2017-08-16 Thread Zachary Ware
Changes by Zachary Ware : -- Removed message: http://bugs.python.org/msg300383 ___ Python tracker ___

[issue31223] Hacked By KingSkrupellos Cyberizm.Org Digital Security Technological Turkish Moslem Army

2017-08-16 Thread adminos
adminos added the comment: Hacked By KingSkrupellos Cyberizm.Org Digital Security Technological Turkish Moslem Army -- components: +Unicode -Argument Clinic nosy: +ezio.melotti, haypo resolution: -> works for me Added file: http://bugs.python.org/file47089/kingskrupellos.txt

[issue31223] Hacked By KingSkrupellos Cyberizm.Org Digital Security Technological Turkish Moslem Army

2017-08-16 Thread adminos
New submission from adminos: Hacked By KingSkrupellos Cyberizm.Org Digital Security Technological Turkish Moslem Army -- components: Argument Clinic messages: 300383 nosy: adminos, doko, larry priority: normal severity: normal status: open title: Hacked By KingSkrupellos Cyberizm.Org

Request Help With Gdk.Display

2017-08-16 Thread Wildman via Python-list
I am working on a program for the Linux platform that reports system information. The program reports screen information, number of monitors, resolution of each one and the total resolution. It does it using a couple of external utils, Xrandr and Xdpyinfo. It is my goal to replace the existing

[issue31222] datetime.py implementation of .replace inconsistent with C implementation

2017-08-16 Thread Paul G
Paul G added the comment: @r.david.murray In the other thread, you mention that the full test suite is run against the C and Python implementations, so that answers the question of how to write the tests. I think treating it as an enhancement in Python 3.7 makes a reasonable amount of sense

Re: A small quiz question

2017-08-16 Thread Ian Kelly
On Wed, Aug 16, 2017 at 6:51 AM, Dennis Lee Bieber wrote: > On 16 Aug 2017 11:06:26 GMT, r...@zedat.fu-berlin.de (Stefan Ram) declaimed > the following: > >> I wrote my first Python quiz question! >> >> It goes like this: >> >> Can you predict (without trying it out)

[issue30910] Add -fexception to ppc64le build

2017-08-16 Thread Antoine Pitrou
Antoine Pitrou added the comment: Several comments: - we don't want to risk bugfix branches for this, so this should only go into the master branch (future 3.7) - I'm not sure it's a reasonable policy to fix shortcomings of all compilers in our configure script; though of course we already

[issue31221] Tools/scripts/patchcheck.py must ignore changes in Modules/expat/ and Modules/zlib/ subdirectories

2017-08-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Is it worth to add other imported libs (libmpdec, libffi)? Or may be just remove trailing spaces when import sources from upstream? -- nosy: +serhiy.storchaka ___ Python tracker

Re: Cross-language comparison: function map and similar

2017-08-16 Thread Rustom Mody
On Wednesday, August 16, 2017 at 8:24:46 PM UTC+5:30, Steve D'Aprano wrote: > Over in another thread, we've been talking about comprehensions and their > similarities and differences from the functional map() operation. > > Reminder: > > map(chr, [65, 66, 67, 68]) > > will return ['A', 'B',

Re: Proposed new syntax

2017-08-16 Thread Steve D'Aprano
On Wed, 16 Aug 2017 11:53 pm, jmp wrote: > On 08/10/2017 04:28 PM, Steve D'Aprano wrote: >> Every few years, the following syntax comes up for discussion, with some >> people saying it isn't obvious what it would do, and others disagreeing and >> saying that it is obvious. So I thought I'd do an

[issue31222] datetime.py implementation of .replace inconsistent with C implementation

2017-08-16 Thread R. David Murray
R. David Murray added the comment: See also issue 20371. -- nosy: +r.david.murray ___ Python tracker ___ ___

[issue31222] datetime.py implementation of .replace inconsistent with C implementation

2017-08-16 Thread Steven D'Aprano
Steven D'Aprano added the comment: I agree that returning type(self) or self.__class__ (not sure which is better) is the right thing to do. It might be possible to argue that the Python version is buggy, if the C version is treated as the reference implementation and the Python version has

[issue31222] datetime.py implementation of .replace inconsistent with C implementation

2017-08-16 Thread Paul G
New submission from Paul G: In the .py implementation of datetime.replace (and date.replace and time.replace), the new datetime is created using the datetime type: https://github.com/python/cpython/blob/master/Lib/datetime.py#L1578 But in the C source, it is created from type(self):

[issue30910] Add -fexception to ppc64le build

2017-08-16 Thread Gustavo Serra Scalet
Gustavo Serra Scalet added the comment: well, now I'm confused: what should we do with this change? Do we need to ask any other expert? -- ___ Python tracker

[issue31210] Can not import modules if sys.prefix contains DELIM

2017-08-16 Thread Eryk Sun
Eryk Sun added the comment: It's simple to work around using a junction or symbolic link, so is this worth pursuing? -- ___ Python tracker ___

[issue31210] Can not import modules if sys.prefix contains DELIM

2017-08-16 Thread R. David Murray
Changes by R. David Murray : -- title: Can not import site from sys.prefix containing DELIM -> Can not import modules if sys.prefix contains DELIM ___ Python tracker

[issue31210] Can not import site from sys.prefix containing DELIM

2017-08-16 Thread R. David Murray
R. David Murray added the comment: All right. So the challenge here for windows is: if python is installed on a path that has a semicolon in one of the directory names, is it even possible to populate sys.path such that modules can be imported from the lib directory that is under that path?

[issue29169] update zlib to 1.2.11

2017-08-16 Thread Larry Hastings
Larry Hastings added the comment: New changeset d0e61bded5256e775e470e2c0da22367a1a81970 by larryhastings (Victor Stinner) in branch '3.4': bpo-29169: Update zlib to 1.2.11 (#3107) https://github.com/python/cpython/commit/d0e61bded5256e775e470e2c0da22367a1a81970 --

[issue31221] Tools/scripts/patchcheck.py must ignore changes in Modules/expat/ and Modules/zlib/ subdirectories

2017-08-16 Thread STINNER Victor
Changes by STINNER Victor : -- pull_requests: +3149 ___ Python tracker ___ ___

[issue31221] Tools/scripts/patchcheck.py must ignore changes in Modules/expat/ and Modules/zlib/ subdirectories

2017-08-16 Thread STINNER Victor
New submission from STINNER Victor: My PR https://github.com/python/cpython/pull/3106 failed because patchcheck wants me to normalize spaces of Modules/expat/siphash.h, whereas this file is copied from libexpat: see bpo-30947. Attached PR changes Tools/scripts/patchcheck.py to ignore changes

[issue25166] Windows AllUsers installation places uninstaller in user profile

2017-08-16 Thread Steve Dower
Steve Dower added the comment: There are no more binary installers for 3.5, so updating the target versions. I have some ideas about how to do this and will hopefully get time at the dev sprints to try them out. -- stage: -> needs patch type: -> behavior versions: +Python 3.6,

Re: Cross-language comparison: function map and similar

2017-08-16 Thread Steve D'Aprano
On Thu, 17 Aug 2017 12:53 am, Steve D'Aprano wrote: > map(chr, [65, 66, 67, 68]) > > will return ['A', 'B', 'C']. Of course I meant ['A', 'B', 'C', 'D']. -- Steve “Cheer up,” they said, “things could be worse.” So I cheered up, and sure enough, things got worse. --

[issue18527] Upgrade Modules/zlib to 1.2.8

2017-08-16 Thread STINNER Victor
Changes by STINNER Victor : -- pull_requests: +3148 ___ Python tracker ___ ___

Re: Proposed new syntax

2017-08-16 Thread Steve D'Aprano
On Thu, 17 Aug 2017 12:28 am, Ben Finney wrote: > Steve D'Aprano writes: > >> If he wanted declarative semantics, why didn't he argue for >> declarative syntax like "select...where", instead of choosing >> procedural syntax which matches the actual procedural

[issue29169] update zlib to 1.2.11

2017-08-16 Thread STINNER Victor
Changes by STINNER Victor : -- pull_requests: +3147 ___ Python tracker ___ ___

[issue29169] update zlib to 1.2.11

2017-08-16 Thread STINNER Victor
Changes by STINNER Victor : -- pull_requests: +3146 ___ Python tracker ___ ___

[issue31210] Can not import site from sys.prefix containing DELIM

2017-08-16 Thread Eryk Sun
Eryk Sun added the comment: > Is this post wrong then? No, it's not wrong that semicolon is a valid character in Windows NTFS and FAT32 filesystems. However, the answer by Kevin Edwards that recommends using double quotes needs qualification. It only works in CMD. It doesn't work in

Re: A small quiz question

2017-08-16 Thread breamoreboy
On Wednesday, August 16, 2017 at 2:52:09 PM UTC+1, Steve D'Aprano wrote: > On Wed, 16 Aug 2017 10:29 pm, breamoreboy wrote: > > > How do you expect to get four lines of output from the three function calls? > > In the REPL (the interactive interpreter) the result of evaluating the line is >

Re: Proposed new syntax

2017-08-16 Thread Marco Buttu
On 10/08/2017 16:28, Steve D'Aprano wrote: What would you expect this syntax to return? [x + 1 for x in (0, 1, 2, 999, 3, 4) while x < 5] [1, 2, 3] For comparison, what would you expect this to return? (Without actually trying it, thank you.) [x + 1 for x in (0, 1, 2, 999, 3, 4) if x <

Re: A small quiz question

2017-08-16 Thread breamoreboy
On Wednesday, August 16, 2017 at 12:45:13 PM UTC+1, Steve D'Aprano wrote: > On Wed, 16 Aug 2017 09:06 pm, Stefan Ram wrote: > > > I wrote my first Python quiz question! > > > > It goes like this: > > > > Can you predict (without trying it out) what the Python > > console will output

Cross-language comparison: function map and similar

2017-08-16 Thread Steve D'Aprano
Over in another thread, we've been talking about comprehensions and their similarities and differences from the functional map() operation. Reminder: map(chr, [65, 66, 67, 68]) will return ['A', 'B', 'C']. My questions for those who know languages apart from Python: Are there language

[issue30947] Update embeded copy of libexpat from 2.2.1 to 2.2.3

2017-08-16 Thread STINNER Victor
STINNER Victor added the comment: > #82 CVE-2017-11742 -- Windows: Fix DLL hijacking vulnerability using Steve > Holme's LoadLibrary wrapper for/of cURL https://github.com/libexpat/libexpat/issues/82 I don't think that this bug affects Python since Python sets a hash secret. --

[issue30947] Update embeded copy of libexpat from 2.2.1 to 2.2.3

2017-08-16 Thread STINNER Victor
STINNER Victor added the comment: cpython_rebuild_expat_dir.sh: Script used to update Modules/expat/ to 2.2.3. The script now uses the libexpat Git repository. Previously, I used tarballs. -- Added file: http://bugs.python.org/file47088/cpython_rebuild_expat_dir.sh

[issue30947] Update embeded copy of libexpat from 2.2.1 to 2.2.3

2017-08-16 Thread STINNER Victor
Changes by STINNER Victor : -- pull_requests: +3145 ___ Python tracker ___ ___

Re: Proposed new syntax

2017-08-16 Thread Ben Finney
Steve D'Aprano writes: > If he wanted declarative semantics, why didn't he argue for > declarative syntax like "select...where", instead of choosing > procedural syntax which matches the actual procedural semantics given? The syntax “f(foo) for foo in bar if

[issue30947] Update embeded copy of libexpat from 2.2.1 to 2.2.3

2017-08-16 Thread STINNER Victor
STINNER Victor added the comment: Previous update: bpo-30694. -- ___ Python tracker ___ ___ Python-bugs-list

  1   2   >