Re: From logging to files to a better solution: syslog, Sentry, Logstash, ....

2015-09-16 Thread dieter
Thomas Güttler writes: > Am Freitag, 11. September 2015 11:03:52 UTC+2 schrieb jmp: > ... >> Something like (python 2.7) >> >> import logging >> >> logCfg = { >> 'remote':( >> logging.StreamHandler(), >> logging.Formatter('Remote - %(levelname)s -

[issue25137] Behavioral change / regression? with nested functools.partial

2015-09-16 Thread STINNER Victor
STINNER Victor added the comment: > In my opinion this is a regression since there's no way to turn off the new > behavior. Well, it depends on your point of view :-) On the performance point of view, it's much faster to flatten heavily nested partials like: >>> import functools >>> f =

Jython 2.7.1 beta1 released!

2015-09-16 Thread fwierzbi...@gmail.com
On behalf of the Jython development team, I'm pleased to announce that Jython 2.7.1 beta1 is released! Thanks to Amobee for sponsoring my work on Jython, and thanks to the many contributors to Jython! Details are here:

[issue25130] Make tests more PyPy compatible

2015-09-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Just for reference here is a full difference between 2.7 tests in PyPy and CPython. It makes tests fail in CPython and skips some tests or makes them too lenient. -- Added file: http://bugs.python.org/file40481/pypy_tests-2.7_full.patch

[issue25130] Make tests more PyPy compatible

2015-09-16 Thread Maciej Fijalkowski
Maciej Fijalkowski added the comment: Hi I can answer precise questions, which tests are you asking about? Note that if the point is to unify the test suite, would be cool to make changes to both pypy and cpython and not just change cpython one. --

Re: python how to load multiple C libraries

2015-09-16 Thread Chris Angelico
On Wed, Sep 16, 2015 at 7:35 PM, chenc...@inhand.com.cn wrote: > I encountered a problem. I use ctypes load multiple C libraries, but the > libraries have dependence each other.So, how can i load these libraries. For > example, I have two libraries:A、B, but A depends on

[issue24965] Implement PEP 498: Literal String Formatting

2015-09-16 Thread Eric V. Smith
Eric V. Smith added the comment: I rewrote the format_spec parser to recursively call the f-string parser, so any oddness in what's allowed in a format_spec is gone. It took way longer than I thought, but the code is better for it. -- Added file:

broken install?

2015-09-16 Thread Serj
Hi there! I just downloaded 3.5.0 install package for Win32 (python-3.5.0-webinstall.exe) and I see some strange behaviour under Win XP: there is no "Next" or "Run" button in wizard ))) Clicked into space near "Cancel" I opened "options" screen, while clicked in another place (closer to center

Re: broken install?

2015-09-16 Thread Chris Angelico
On Tue, Sep 15, 2015 at 8:43 PM, Serj wrote: > I just downloaded 3.5.0 install package for Win32 > (python-3.5.0-webinstall.exe) and I see some strange behaviour under Win > XP: there is no "Next" or "Run" button in wizard ))) Python 3.5 no longer supports Windows XP, sorry.

[issue25129] suboptimal floating-point floor division

2015-09-16 Thread STINNER Victor
STINNER Victor added the comment: """ The root of the issue is that >>> Fraction(78*6e-8) != Fraction(78*6, 10**8) True >>> Fraction(6e-8) != Fraction(6, 10**8) True """ It's not an issue, it's just a fact: floating point rounding is annoying and very few people understand it :-) --

[issue25122] test_eintr randomly fails on FreeBSD

2015-09-16 Thread STINNER Victor
STINNER Victor added the comment: More debug traces: test_open (__main__.SocketEINTRTest) ... try to open '@test_57236_tmp' fifo for writing, pid 57236 try to open '@test_57236_tmp' fifo for reading, pid 57305, ppid 57236 '@test_57236_tmp' fifo opened for reading and closed, pid 57305, ppid

python how to load multiple C libraries

2015-09-16 Thread chenc...@inhand.com.cn
hi: I encountered a problem. I use ctypes load multiple C libraries, but the libraries have dependence each other.So, how can i load these libraries. For example, I have two libraries:A、B, but A depends on B, B depends on A. So how do I load them? Is there anybody know how to do it? --

[issue25122] test_eintr randomly fails on FreeBSD

2015-09-16 Thread Roundup Robot
Roundup Robot added the comment: New changeset 30bc256f2346 by Victor Stinner in branch 'default': Issue #25122: add debug traces to test_eintr.test_open() https://hg.python.org/cpython/rev/30bc256f2346 -- ___ Python tracker

Nikola version 7.7.1 available!

2015-09-16 Thread Roberto Alsina
On behalf of the Nikola team, I am pleased to announce the immediate availability of Nikola v7.7.1. It fixes some bugs and adds new features. What is Nikola? === Nikola is a static site and blog generator, written in Python. It can use Mako and Jinja2 templates, and input in many

[issue24493] subprocess with env=os.environ doesn't preserve environment variables when calling a 32bit process on Windows 8.1

2015-09-16 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker ___ ___

Re: Terminology: "reference" versus "pointer"

2015-09-16 Thread Chris Angelico
On Wed, Sep 16, 2015 at 6:24 PM, Ben Finney wrote: > Chris Angelico writes: > >> On Wed, Sep 16, 2015 at 6:14 PM, Gregory Ewing >> wrote: >> > This suggests an alternative model for Python computation. All data >> > is

[issue25129] suboptimal floating-point floor division

2015-09-16 Thread Mark Dickinson
Mark Dickinson added the comment: > What is the rounding mode used by true division, by the way? Probably not what you were asking, but with respect to true division of integers (int / int -> float), we always use round-half-to-even. Any deviation from that (non-IEEE 754 platforms excepted)

[issue25122] test_eintr randomly fails on FreeBSD

2015-09-16 Thread STINNER Victor
STINNER Victor added the comment: Syscalls traced by truss. Parent process: 1436: unlink("fifo_5950861521") ERR#2 'No such file or directory' 1436: open("fifo_5950861521",O_WRONLY|O_CLOEXEC,00) ERR#4 'Interrupted system call' 1436:

Re: Reading in large logfiles, and processing lines in batches - maximising throughput?

2015-09-16 Thread Chris Angelico
On Wed, Sep 16, 2015 at 7:27 PM, Victor Hooi wrote: > Also, I originally used grouper because I thought it better to process lines > in batches, rather than individually. However, is there actually any > throughput advantage from doing it this way in Python? Or is there a

[issue25122] test_eintr randomly fails on FreeBSD

2015-09-16 Thread STINNER Victor
STINNER Victor added the comment: Ok, I got the first interesting result thanks to my enhancements of test_eintr: [383/398/1] test_eintr test_read (__main__.OSEINTRTest) ... ok test_wait (__main__.OSEINTRTest) ... ok test_wait3 (__main__.OSEINTRTest) ... ok test_wait4 (__main__.OSEINTRTest) ...

Re: Terminology: "reference" versus "pointer"

2015-09-16 Thread Chris Angelico
On Wed, Sep 16, 2015 at 6:14 PM, Gregory Ewing wrote: > Emile van Sebille wrote: > >> Shroedingers-cat-was-just-a-cat-in-a-box-too-ly y'rs, > > > The real question is, if you kill Schroedinger's cat, does > Heisenberg's cat die too? If so, then either they're the >

Re: Python handles globals badly.

2015-09-16 Thread Antoon Pardon
Op 16-09-15 om 03:13 schreef Steven D'Aprano: > On Mon, 14 Sep 2015 06:30 pm, Antoon Pardon wrote: > >> Op 12-09-15 om 05:48 schreef Steven D'Aprano: >>> I believe I already acknowledged that assignment-as-expression was fine >>> if it avoided the = versus == error, from the perspective of

[issue25137] Behavioral change / regression? with nested functools.partial

2015-09-16 Thread Antoine Pitrou
Antoine Pitrou added the comment: The specific attributes of a partial are not documented, so it is you are relying on them. Using partial as a container is also a bit unexpected... -- ___ Python tracker

[issue25129] suboptimal floating-point floor division

2015-09-16 Thread Antoine Pitrou
Antoine Pitrou added the comment: I have no problem with closing. Admittedly, I opened this issue mostly to get a witty and enlightening response :-) -- ___ Python tracker

Re: Terminology: "reference" versus "pointer"

2015-09-16 Thread Ben Finney
Chris Angelico writes: > On Wed, Sep 16, 2015 at 6:14 PM, Gregory Ewing > wrote: > > This suggests an alternative model for Python computation. All data > > is represented by cats. A variable is a box containing a cat. > > Assignment replaces one

Re: From logging to files to a better solution: syslog, Sentry, Logstash, ....

2015-09-16 Thread Thomas Güttler
Am Mittwoch, 16. September 2015 07:58:11 UTC+2 schrieb dieter: > Thomas Güttler writes: > > Am Freitag, 11. September 2015 11:03:52 UTC+2 schrieb jmp: > > ... > >> Something like (python 2.7) > >> > >> import logging > >> > >> logCfg = { > >> 'remote':( > >>

[issue25138] test_socket: socket.EAI_NODATA doesn't exist on FreeBSD

2015-09-16 Thread STINNER Victor
New submission from STINNER Victor: test_socket.test_idna() uses socket.EAI_NODATA constant which doesn't exists on FreeBSD. http://buildbot.python.org/all/builders/AMD64%20FreeBSD%2010.0%203.x/builds/3697/steps/test/logs/stdio

[issue25129] suboptimal floating-point floor division

2015-09-16 Thread Mark Dickinson
Mark Dickinson added the comment: I agree with Tim that this is the correct behaviour. Antoine: okay to close? Or should we leave it open for the doc fix that Tim noticed? -- ___ Python tracker

[issue25129] suboptimal floating-point floor division

2015-09-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: >>> from fractions import Fraction >>> Fraction(78*6e-8) / Fraction(6e-8) Fraction(353610802237278976, 4533471823554859) >>> Fraction(78*6e-8) // Fraction(6e-8) 77 >>> float(Fraction(78*6e-8) / Fraction(6e-8)) 78.0 >>> Fraction(78*6e-8) / Fraction(6e-8) - 78

ANN: PyDDF Python Sprint 2015

2015-09-16 Thread eGenix Team: M.-A. Lemburg
[This announcement is in German since it targets a Python sprint in Düsseldorf, Germany] ANKÜNDIGUNG PyDDF Python Sprint 2015 in Düsseldorf Samstag,

ANN: PyDDF Python Sprint 2015

2015-09-16 Thread eGenix Team: M.-A. Lemburg
[This announcement is in German since it targets a Python sprint in Düsseldorf, Germany] ANKÜNDIGUNG PyDDF Python Sprint 2015 in Düsseldorf Samstag,

Adding PEP 495 support to dateutil

2015-09-16 Thread Alexander Belopolsky
On Sat, Sep 12, 2015 at 9:58 PM, Tim Peters wrote: > I think acceptance of 495 should be contingent upon > someone first completing a fully functional (if not releasable) > fold-aware zoneinfo wrapping. > After studying both pytz and dateutil offerings, I decided that it

Re: broken install?

2015-09-16 Thread Tim Golden
On 15/09/2015 11:43, Serj wrote: > Hi there! > > I just downloaded 3.5.0 install package for Win32 > (python-3.5.0-webinstall.exe) and I see some strange behaviour under Win > XP: there is no "Next" or "Run" button in wizard ))) > > Clicked into space near "Cancel" I opened "options" screen,

[issue24493] subprocess with env=os.environ doesn't preserve environment variables when calling a 32bit process on Windows 8.1

2015-09-16 Thread Florian Bruhin
Florian Bruhin added the comment: I just ran into this again - when trying to run `git` via subprocess with "env" set, I got: # Start the process try: hp, ht, pid, tid = _winapi.CreateProcess(executable, args, # no special

Re: Terminology: "reference" versus "pointer"

2015-09-16 Thread Gregory Ewing
Emile van Sebille wrote: Shroedingers-cat-was-just-a-cat-in-a-box-too-ly y'rs, The real question is, if you kill Schroedinger's cat, does Heisenberg's cat die too? If so, then either they're the same cat, or they're two entangled cats. This suggests an alternative model for Python

[issue25139] Just a little refactoring

2015-09-16 Thread Алексей Смирнов
New submission from Алексей Смирнов: https://github.com/python/cpython/blob/3.5/Lib/socketserver.py#L627 Must be: try: self.finish_request(request, client_address) except: self.handle_error(request, client_address) finally: self.shutdown_request(request) -- components:

Reading in large logfiles, and processing lines in batches - maximising throughput?

2015-09-16 Thread Victor Hooi
I'm using Python to parse metrics out of logfiles. The logfiles are fairly large (multiple GBs), so I'm keen to do this in a reasonably performant way. The metrics are being sent to a InfluxDB database - so it's better if I can batch multiple metrics into a batch ,rather than sending them

[issue25106] Hash computation speedup for {buffer, string, unicode}object

2015-09-16 Thread Maciej Fijalkowski
Maciej Fijalkowski added the comment: I find numbers really hard to believe. It would mean that over 40% of django templates is string hashing (assuming 2x speedup) which really sounds unbelievable. In fact in PyPy I never found string hashing to be significant while I would expect PyPy to

[issue25140] platform.platform() incorrectly identifies Windows 10 as 'Windows-8-6.2.9200'

2015-09-16 Thread Andrey Fedyashov
New submission from Andrey Fedyashov: Here's actual OS version: OS Name: Microsoft Windows 10 Enterprise Insider Preview OS Version:10.0.10534 N/A Build 10534 OS Manufacturer: Microsoft Corporation OS Configuration: Standalone Workstation OS

[issue25115] SSL_set_verify_depth not exposed by the ssl module

2015-09-16 Thread Grant Bremer
Changes by Grant Bremer : -- hgrepos: -316 ___ Python tracker ___ ___ Python-bugs-list

[issue25115] SSL_set_verify_depth not exposed by the ssl module

2015-09-16 Thread Grant Bremer
Grant Bremer added the comment: Attached is a patch for the 3.5 branch. The test is minimal -- we are relying on the underlying OpenSSL library and its context to manage the data. I have removed the data validation from the set function -- OpenSSL seems happy to accept negative numbers for

ANN lauda 1.1.0

2015-09-16 Thread Andrea Stagi
I've created lauda, a little python module to measure time. Thanks a lot to Jesús Espino (@jespinog) for the new context manager feature You can install it with pip install lauda you can find the source code on Github: https://github.com/astagi/lauda You can use lauda StopWatch to measure

[issue25140] platform.platform() incorrectly identifies Windows 10 as 'Windows-8-6.2.9200'

2015-09-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: A duplicate of issue19143? -- nosy: +lemburg, serhiy.storchaka ___ Python tracker ___

[issue25141] Spam

2015-09-16 Thread Petri Lehtinen
Changes by Petri Lehtinen : -- status: open -> closed title: Returned mail: see transcript for details -> Spam ___ Python tracker ___

Re: python how to load multiple C libraries

2015-09-16 Thread chenc...@inhand.com.cn
hi: Most current compilers and linkers will search all object files, regard-less of order, but since not all compilers do this it is best to follow the convention of ordering object files from left to right . Python do that. So, is there anybody know how to solve the follow problem? On

[issue25130] Make tests more PyPy compatible

2015-09-16 Thread Maciej Fijalkowski
Maciej Fijalkowski added the comment: Hi Looking through your comments, yes, maybe those tests or those things require fixing. We at pypy don't have enough will to fight python-dev most of the time, so the usual approach is to do "minimal hack that works" without trying to dwelve into why

ANN: python-blosc 1.2.8 released

2015-09-16 Thread Francesc Alted
= Announcing python-blosc 1.2.8 = What is new? This is a maintenance release. Internal C-Blosc has been upgraded to 1.7.0 (although new bitshuffle support has not been made public, as it seems not ready for production yet).

[issue25141] Spam

2015-09-16 Thread Petri Lehtinen
Changes by Petri Lehtinen : Removed file: http://bugs.python.org/file40482/mail.zip ___ Python tracker ___

True == 1 weirdness

2015-09-16 Thread Blake T. Garretson
I am maintaining some old code where the programmer used 1 for True because booleans hadn't been added to Python yet. I'm getting some weird behaviour, so I created some simple tests to illustrate my issue. >>> 1 in {1:1}#test1 True >>> 1 in {1:1} == 1 #test2 False >>> (1 in {1:1})

[issue24493] subprocess with env=os.environ doesn't preserve environment variables when calling a 32bit process on Windows 8.1

2015-09-16 Thread Florian Bruhin
Florian Bruhin added the comment: > Sounds like there's something in the cwd that is making the difference (this > being Windows which looks for things in the cwd always). The cwd is an empty temporary directory. And that still wouldn't explain why passing env=os.environ breaks it as well,

[issue25095] test_httpservers hangs on 3.5.0, win 7

2015-09-16 Thread Martin Panter
Martin Panter added the comment: According to those back traces, the server has apparently already handled one request and is waiting for a second request. However the client is still waiting for a response from its original request. Some things I might try would be to disable the server, and

[issue19143] Finding the Windows version getting messier (detect windows 8.1?)

2015-09-16 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Steve: Could you please merge your changes into platform.py ? I think it should go into Python 2.7. -- ___ Python tracker

[issue24493] subprocess with env=os.environ doesn't preserve environment variables when calling a 32bit process on Windows 8.1

2015-09-16 Thread R. David Murray
R. David Murray added the comment: Sounds like there's something in the cwd that is making the difference (this being Windows which looks for things in the cwd always). -- nosy: +r.david.murray ___ Python tracker

[issue25130] Make tests more PyPy compatible

2015-09-16 Thread Martin Panter
Martin Panter added the comment: Maciej: I put a few questions and comments in the code review. See the (also linked next to Serhiy’s first patch). -- ___ Python tracker

[issue25140] platform.platform() incorrectly identifies Windows 10 as 'Windows-8-6.2.9200'

2015-09-16 Thread Marc-Andre Lemburg
Changes by Marc-Andre Lemburg : -- resolution: -> duplicate status: open -> closed ___ Python tracker ___

[issue25140] platform.platform() incorrectly identifies Windows 10 as 'Windows-8-6.2.9200'

2015-09-16 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 16.09.2015 13:22, Serhiy Storchaka wrote: > > A duplicate of issue19143? I guess so. -- ___ Python tracker ___

[issue24927] multiprocessing.Pool hangs forever on segfault

2015-09-16 Thread Jonas Obrist
Changes by Jonas Obrist : -- resolution: -> duplicate status: open -> closed ___ Python tracker ___

[issue22393] multiprocessing.Pool shouldn't hang forever if a worker process dies unexpectedly

2015-09-16 Thread Brian Boonstra
Changes by Brian Boonstra : -- nosy: +brianboonstra ___ Python tracker ___ ___

Re: True == 1 weirdness

2015-09-16 Thread Jussi Piitulainen
Blake T. Garretson writes: > I am maintaining some old code where the programmer used 1 for True > because booleans hadn't been added to Python yet. I'm getting some > weird behaviour, so I created some simple tests to illustrate my > issue. > > >>> 1 in {1:1}#test1 > True > >>> 1

Re: python how to load multiple C libraries

2015-09-16 Thread Laura Creighton
In a message of Wed, 16 Sep 2015 17:35:18 +0800, "chenc...@inhand.com.cn" write s: >hi: >I encountered a problem. I use ctypes load multiple C libraries, but >the libraries have dependence each other.So, how can i load these >libraries. For example, I have two libraries:A、B, but A depends on B,

[issue24493] subprocess with env=os.environ doesn't preserve environment variables when calling a 32bit process on Windows 8.1

2015-09-16 Thread eryksun
eryksun added the comment: The issue as I understand it is that, on this particular Windows 8.1 system, passing a non-NULL lpEnvironment to CreateProcess works when starting a native 64-bit executable, but fails when starting a 32-bit executable via the WOW64 system. The child process instead

[issue25095] test_httpservers hangs on 3.5.0, win 7

2015-09-16 Thread STINNER Victor
STINNER Victor added the comment: You may try "hg bisect" to find which revision broke test_httpservers. It can be slow if you have to recompile manually Python :-( -- ___ Python tracker

Re: True == 1 weirdness

2015-09-16 Thread Blake T. Garretson
On Wednesday, September 16, 2015 at 9:08:54 AM UTC-4, jmp wrote: > x = 5 > 3 < x < 10 That's a great example. I use this case all the time and didn't think to apply the same principal to the in/== case. I assumed that "in" was evaluated first, and then the == comparison was made. Thanks! --

datetime.datetime.today()

2015-09-16 Thread Skip Montanaro
This surprised me today: >>> import datetime >>> datetime.datetime.today(), datetime.datetime.now() (datetime.datetime(2015, 9, 16, 8, 44, 7, 723560), datetime.datetime(2015, 9, 16, 8, 44, 7, 723577)) I naively expected today() to always return a datetime.date object. Oh well, bug in my code has

Re: True == 1 weirdness

2015-09-16 Thread Random832
On Wed, Sep 16, 2015, at 09:05, Chris Angelico wrote: > My view is that they should remain in the language, but that > dissimilar comparisons should raise linter warnings. I can't imagine a > sane reason for chaining 'in' and equality like that (since the RHS of > 'in' will be a container, and if

Re: True == 1 weirdness

2015-09-16 Thread Chris Angelico
On Wed, Sep 16, 2015 at 10:53 PM, Jussi Piitulainen wrote: > Ouch. I love chained comparisons more than most people, but this took a > while to decipher. I blame you! Your parentheses mis-primed me for the > wrong reading :) But now I expect to see a long thread

Re: True == 1 weirdness

2015-09-16 Thread jmp
On 09/16/2015 02:16 PM, Blake T. Garretson wrote: 1 in {1:1} == 1 #test2 The second test yield False, because True does not equal 1, apparently. Fair enough. No, it yields False because {1:1} == 1 is false. Test 2 looks actually like (1 in {1:1}) and ({1:1} == 1). Which in your

Re: datetime.datetime.today()

2015-09-16 Thread Nick Sarbicki
> This surprised me today: > > >>> import datetime > >>> datetime.datetime.today(), datetime.datetime.now() > (datetime.datetime(2015, 9, 16, 8, 44, 7, 723560), datetime.datetime(2015, > 9, 16, 8, 44, 7, 723577)) > > I naively expected today() to always return a datetime.date object. Oh > well,

Re: True == 1 weirdness

2015-09-16 Thread Blake T. Garretson
On Wednesday, September 16, 2015 at 8:54:07 AM UTC-4, Jussi Piitulainen wrote: > The second test, test2, is interpreted (almost) as > > (1 in {1:1}) and ({1:1} == 1) > > which is obviously False. Ah, that makes sense. It didn't occur to me that Python would interpret it that way, and

Re: [Tutor] Is context manager the answer to synchronous function calls?

2015-09-16 Thread John Wong
On Wed, Sep 16, 2015 at 7:54 AM, Mark Lawrence wrote: > > Assuming your (Alan's) guess is correct, and I certainly agree it's > plausible, I suspect this might be better asked on the main Python mailing > list, I don't see this as tutor material. > > Sorry first time

RE: True == 1 weirdness

2015-09-16 Thread Watson, Paul
In terms of operator precedence, is "==" evaluated before "in"? *-*-*- PRESBYTERIAN_HEALTHCARE_SERVICES_DISCLAIMER -*-*-* This message originates from Presbyterian Healthcare Services or one of its affiliated organizations. It contains information,

[issue24965] Implement PEP 498: Literal String Formatting

2015-09-16 Thread Eric V. Smith
Eric V. Smith added the comment: Simplified error handling, fixed 2 memory leaks. All tests now pass with no leaks. This should be the final version. -- Added file: http://bugs.python.org/file40484/pep-498-7.diff ___ Python tracker

Re: [Tutor] Is context manager the answer to synchronous function calls?

2015-09-16 Thread Chris Angelico
On Thu, Sep 17, 2015 at 12:34 AM, John Wong wrote: > Sorry first time posting to tutor / general list. Usually on TIP list. As > per Mark's recommendation, now posting to python-list@python.org. But, sadly, without a lot of context. When you change lists, it's helpful to

Re: True == 1 weirdness

2015-09-16 Thread Chris Angelico
On Thu, Sep 17, 2015 at 12:03 AM, Random832 wrote: > On Wed, Sep 16, 2015, at 09:05, Chris Angelico wrote: >> My view is that they should remain in the language, but that >> dissimilar comparisons should raise linter warnings. I can't imagine a >> sane reason for chaining

[issue25142] Misleading error when initing ImportError

2015-09-16 Thread Sebastian Kreft
New submission from Sebastian Kreft: ImportError now supports the keyword arguments name and path. However, when passing invalid keyword arguments, the reported error is misleading, as shown below. In [1]: ImportError('lib', name='lib') Out[1]: ImportError('lib') In [2]: ImportError('lib',

Re: datetime.datetime.today()

2015-09-16 Thread Michiel Overtoom
This bit me once. I was comparing a date to a datetime, both representing the same day, so I expected them to be the same, but I was wrong. What I should have done was extracting the date of the datetime with the .date() function, and only then compare it to the other date: >>> import

Re: datetime.datetime.today()

2015-09-16 Thread Skip Montanaro
On Wed, Sep 16, 2015 at 8:55 AM, Nick Sarbicki wrote: > Just in the case you didn't figure it out: > > >>> datetime.datetime.today() > datetime.datetime(2015, 9, 16, 14, 50, 47, 700828) > >>> datetime.date.today() > datetime.date(2015, 9, 16) > Yeah, I was aware of

Re: True == 1 weirdness

2015-09-16 Thread Tim Chase
On 2015-09-16 10:03, Random832 wrote: > Do chained "in" comparisons ever really make sense, even when > they're all the same type? > > I mean, I suppose 1 in (1, 2) in ((1, 2), (3, 4)) is technically > true, but how useful is it really? I could concoct a "useful" example where "in" is involved

Re: True == 1 weirdness

2015-09-16 Thread Chris Angelico
On Wed, Sep 16, 2015 at 11:45 PM, Watson, Paul wrote: > In terms of operator precedence, is "==" evaluated before "in"? No, they're at the same precedence level. Within that, all comparison operators are evaluated left-to-right, with the chaining that was described earlier.

[issue25140] platform.platform() incorrectly identifies Windows 10 as 'Windows-8-6.2.9200'

2015-09-16 Thread Zachary Ware
Changes by Zachary Ware : -- superseder: -> Finding the Windows version getting messier (detect windows 8.1?) ___ Python tracker

Re: broken install?

2015-09-16 Thread paul.hermeneutic
The installer should detect that it is being run on an unsupported system and do something helpful. -- https://mail.python.org/mailman/listinfo/python-list

Re: True == 1 weirdness

2015-09-16 Thread Random832
On Wed, Sep 16, 2015, at 10:26, Chris Angelico wrote: > Quite probably never. But are there _any_ comparison operators which > are unchainable? If not, there's no reason to disallow 'in' "in" suggests a relationship between objects of different types (X and "something that can contain X") - all

Re: broken install?

2015-09-16 Thread Chris Angelico
On Thu, Sep 17, 2015 at 1:26 AM, wrote: > The installer should detect that it is being run on an unsupported system > and do something helpful. Fair point. Want to raise a tracker issue on bugs.python.org about it? ChrisA --

Re: True == 1 weirdness

2015-09-16 Thread Marko Rauhamaa
"Sven R. Kunze" : > On 16.09.2015 18:16, Marko Rauhamaa wrote: >> Frankly, I don't think chaining was all that great of an idea. > > I like it for x < y < z. > > But I agree more than this often helps confusion more than it helps > clarity. I see what you did there. Marko --

Re: True == 1 weirdness

2015-09-16 Thread Random832
On Wed, Sep 16, 2015, at 12:37, Sven R. Kunze wrote: > I like it for x < y < z. > > But I agree more than this often helps confusion more than it helps > clarity. I think that chaining should be limited to: A) all operators are "=" B) all operators are "is" C) all operators are either >= or >

[issue25106] Hash computation speedup for {buffer, string, unicode}object

2015-09-16 Thread Skip Montanaro
Changes by Skip Montanaro : -- nosy: +skip.montanaro ___ Python tracker ___ ___

[issue25143] 3.5 install fails poorly on Windows XP

2015-09-16 Thread Paul
New submission from Paul: Running the installer on an unsupported system (such as Windows XP)should fail gracefully and not just leave the user hanging. https://mail.python.org/pipermail/python-list/2015-September/696789.html -- components: Installation messages: 250852 nosy:

Re: True == 1 weirdness

2015-09-16 Thread Marko Rauhamaa
Chris Angelico : > Far as I can see, the only operator that you might want to disallow > chaining on is 'in' (and its mate 'not in', of course). It isn't > common, but "x is y is z is None" is a perfectly reasonable way to > ascertain whether or not they're all None, just as "x

Re: True == 1 weirdness

2015-09-16 Thread Sven R. Kunze
On 16.09.2015 18:16, Marko Rauhamaa wrote: Chris Angelico : Far as I can see, the only operator that you might want to disallow chaining on is 'in' (and its mate 'not in', of course). It isn't common, but "x is y is z is None" is a perfectly reasonable way to ascertain

[issue25113] documentation version switcher is broken

2015-09-16 Thread Yury Selivanov
Yury Selivanov added the comment: The switcher isn't visible on all pages, I suspect we need to bust caches on cdns/varnish -- ___ Python tracker ___

[issue25143] 3.5 install fails poorly on Windows XP

2015-09-16 Thread Brett Cannon
Changes by Brett Cannon : -- components: +Windows -Installation nosy: +paul.moore, steve.dower, tim.golden, zach.ware ___ Python tracker

Re: True == 1 weirdness

2015-09-16 Thread Ian Kelly
On Wed, Sep 16, 2015 at 11:24 AM, Steven D'Aprano wrote: > > if word in line in text: > print("word in line and line in text") It find it hard to imagine how one would arrive at the situation of needing to check this. --

Re: True == 1 weirdness

2015-09-16 Thread Marko Rauhamaa
Steven D'Aprano : > The main reason for supporting arbitrary chained operators is that > they could be overloaded and have some meaning that makes sense: Operator overloading is yet another unfortunate language feature. Marko --

Re: True == 1 weirdness

2015-09-16 Thread Steven D'Aprano
On Thu, 17 Sep 2015 03:27 am, Grant Edwards wrote: > On 2015-09-16, Sven R. Kunze wrote: >> On 16.09.2015 18:57, Random832 wrote: >>> I think that chaining should be limited to: >>> >>> A) all operators are "=" >>> B) all operators are "is" [...] > I'm not all that sure A and

[issue25139] Just a little refactoring

2015-09-16 Thread Berker Peksag
Changes by Berker Peksag : -- stage: -> patch review versions: +Python 3.6 -Python 3.5 ___ Python tracker ___

Re: True == 1 weirdness

2015-09-16 Thread Grant Edwards
On 2015-09-16, Steven D'Aprano wrote: > On Thu, 17 Sep 2015 02:57 am, Random832 wrote: > > >> I think that chaining should be limited to: >> >> A) all operators are "=" >> B) all operators are "is" >> C) all operators are either >= or > >> D) all operators are either <= or <

Re: True == 1 weirdness

2015-09-16 Thread Grant Edwards
On 2015-09-16, Sven R. Kunze wrote: > On 16.09.2015 19:46, Grant Edwards wrote: >> On 2015-09-16, Steven D'Aprano wrote: >> >>> node = left <= ptr => right >> >> Exactly. I've no clue what that means. ;) > > Modern art. ;) Ah, well I know that _that_

[issue25143] 3.5 install fails poorly on Windows XP

2015-09-16 Thread Djoudi Benarfa
Djoudi Benarfa added the comment: The Python installer could check what operating system the user is trying to install python on and if it's not supported then, information him, and maybe redirect him to the correct python version. -- nosy: +djoudi

Re: True == 1 weirdness

2015-09-16 Thread Random832
On Wed, Sep 16, 2015, at 13:33, Steven D'Aprano wrote: > On Thu, 17 Sep 2015 01:40 am, Random832 wrote: > > > "in" suggests a relationship between objects of different types (X and > > "something that can contain X") - all the other comparison operators are > > meant to work on objects of the

Re: True == 1 weirdness

2015-09-16 Thread Random832
On Wed, Sep 16, 2015, at 13:44, Grant Edwards wrote: > Well, that case hadn't been mentioned yet. But, I agree that should be > added as case E and be allowed. That's actually what I meant by A, I just spelled it wrong. Multiple assignment isn't really the same construct as chained comparisons,

  1   2   >