[issue20855] RFE: change bool(0.0) to evaluate as True

2014-03-06 Thread Mark Dickinson

Mark Dickinson added the comment:

I realise this was opened as a joke, but I actually consider this suggestion to 
be unridiculous.  I've never felt comfortable with code that does  "if x" 
rather than "if x != 0.0"  for x a float.

What really makes this a no-go in Python is the equality between floats and 
ints, and then between ints and bools.  If we want to maintain the invariant 
that  x == y implies  bool(x) == bool(y)  then we end up making bool(0) and 
bool(False) true, the latter of which is clearly ridiculous.

So not in Python, but perhaps in some other Python-like language with a notion 
of 'boolean context'.

--
nosy: +mark.dickinson

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20856] bz2.peek always peeks all the remaining bytes ignoring n argument

2014-03-06 Thread Vajrasky Kok

New submission from Vajrasky Kok:

# Bug demo
TEXT_LINES = [
b'cutecat\n',
b'promiscuousbonobo\n',
]
TEXT = b''.join(TEXT_LINES)
import bz2
filename = '/tmp/demo.bz2'
with open(filename, 'wb') as f:
f.write(bz2.compress(TEXT))

with bz2.BZ2File(filename) as bz2f:
pdata = bz2f.peek(n=7)
print(pdata)

It outputs b'cutecat\npromiscuousbonobo\n', not b'cutecat'.

Here is the patch to fix the bug.

--
components: Library (Lib)
files: use_n_argument_in_peek_bz2.patch
keywords: patch
messages: 212796
nosy: nadeem.vawda, vajrasky
priority: normal
severity: normal
status: open
title: bz2.peek always peeks all the remaining bytes ignoring n argument
type: behavior
versions: Python 3.4
Added file: http://bugs.python.org/file34291/use_n_argument_in_peek_bz2.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20856] bz2.peek always peeks all the remaining bytes ignoring n argument

2014-03-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This is documented behavior.

   .. method:: peek([n])

  Return buffered data without advancing the file position. At least one
  byte of data will be returned (unless at EOF). The exact number of bytes
  returned is unspecified.

--
nosy: +serhiy.storchaka
resolution:  -> invalid
stage:  -> committed/rejected
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13936] RFE: change bool(datetime.time(0, 0, 0)) to evaluate as True

2014-03-06 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I agree that having midnight evaluate to false is completely unexpected and 
unintuitive. I can imagine situations where it bites people in production use 
in the uncommon case that a time is exactly equal to midnight.

--
nosy: +pitrou

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13936] RFE: change bool(datetime.time(0, 0, 0)) to evaluate as True

2014-03-06 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

On 06.03.2014 10:30, Antoine Pitrou wrote:
> 
> Antoine Pitrou added the comment:
> 
> I agree that having midnight evaluate to false is completely unexpected and 
> unintuitive. I can imagine situations where it bites people in production use 
> in the uncommon case that a time is exactly equal to midnight.

datetime values with the time set to midnight are *very* common in practice.
You run into them whenever you convert dates into datetime values.

--
title: RFE: change bool(datetime.time(0,0,0)) to evaluate as True -> RFE: 
change bool(datetime.time(0, 0, 0)) to evaluate as True

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20283] Wrong keyword parameter name in regex pattern methods

2014-03-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 52743dc788e6 by Serhiy Storchaka in branch '3.3':
Issue #20283: RE pattern methods now accept the string keyword parameters
http://hg.python.org/cpython/rev/52743dc788e6

New changeset f4d7abcf8080 by Serhiy Storchaka in branch 'default':
Issue #20283: RE pattern methods now accept the string keyword parameters
http://hg.python.org/cpython/rev/f4d7abcf8080

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13936] RFE: change bool(datetime.time(0, 0, 0)) to evaluate as True

2014-03-06 Thread Nick Coghlan

Nick Coghlan added the comment:

Donald did some additional testing, and it turns out that it is
specifically midnight *UTC* that is false in boolean context. For a TZ
aware time, the false time depends on the offset (e.g. it would be false at
10 am here in Brisbane).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20856] bz2.peek always peeks all the remaining bytes ignoring n argument

2014-03-06 Thread Vajrasky Kok

Vajrasky Kok added the comment:

Just curious, why the exact number of bytes returned is unspecified in bz2 (in 
other words, n argument is ignored)? gzip uses n argument.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20283] Wrong keyword parameter name in regex pattern methods

2014-03-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 52256a5861fa by Serhiy Storchaka in branch '2.7':
Issue #20283: RE pattern methods now accept the string keyword parameters
http://hg.python.org/cpython/rev/52256a5861fa

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20856] bz2.peek always peeks all the remaining bytes ignoring n argument

2014-03-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Because it is unspecified in io.BufferedReader.peek() and in many classes 
implemented the io.BufferedReader interface.

   .. method:: peek([size])

  Return bytes from the stream without advancing the position.  At most one
  single read on the raw stream is done to satisfy the call. The number of
  bytes returned may be less or more than requested.

I agree that this is weird, but this is a much larger issue than just bz2. We 
can't just "fix" this for bz2. This worths a discussion on Python-Dev.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20283] Wrong keyword parameter name in regex pattern methods

2014-03-06 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka
resolution:  -> fixed
stage: patch review -> committed/rejected

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20283] Wrong keyword parameter name in regex pattern methods

2014-03-06 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20825] containment test for "ip_network in ip_network"

2014-03-06 Thread Michel Albert

Michel Albert added the comment:

Here's a new patch implementing both ``subnet_of`` and ``supernet_of``.

It also contains the relevant docs and unit-tests.

--
Added file: http://bugs.python.org/file34292/net-in-net-r2.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13936] RFE: change bool(datetime.time(0, 0, 0)) to evaluate as True

2014-03-06 Thread Donald Stufft

Donald Stufft added the comment:

It's actually a bit worse than that Nick. It's midnight UTC, as long as the UTC 
offset is Positive or Zero. This is because the way the check is implemented is 
naive.

It's implemented as: Take the time portion sans the tzinfo and convert to 
minutes, then take the utc offset and convert that to minutes, then subtract 
the second from the first and if that is zero it is False.

So if you take -5 for instance (my own timezone!) the equation to determine 
when the "False" time is would look like:

x - (-5 * 60) = 0
x - (-300) = 0
x + 300 = 0
x = -300

So we'd need a time that can be represented as -300 minutes. Since times can 
not be negative that means for a timezone aware time it is impossible for 
something with a negative UTC offset to ever be False while for a zero or 
positive UTC offset it'll be False at UTC midnight.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13936] RFE: change bool(datetime.time(0, 0, 0)) to evaluate as True

2014-03-06 Thread Nick Coghlan

Nick Coghlan added the comment:

I wrote up a longer post on python-ideas regarding the problems that the 
current behaviour poses when it comes to inferring a correct mental model for 
datetime.time(): 
https://mail.python.org/pipermail/python-ideas/2014-March/026647.html

As part of that, it's also worth noting the current behaviour in boolean 
context is effectively shorthand for:

import datetime as dt

naivemidnight = dt.time(0, 0)
utcmidnight = dt.time(0, 0, tzinfo=dt.timezone.utc
if x in (naivemidnight, utcmidnight):
...

So if the current boolean behaviour is deprecated and removed, it is easily 
reproduced through equality checks.

It may also make sense to offer an API to easily calculate seconds since 
midnight, but that would be a separate issue.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13936] RFE: change bool(datetime.time(0, 0, 0)) to evaluate as True

2014-03-06 Thread Alex Gaynor

Changes by Alex Gaynor :


--
nosy: +alex

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19235] Add a dedicated subclass for recursion errors

2014-03-06 Thread Elazar Gershuni

Elazar Gershuni added the comment:

Is it going to be committed?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19235] Add a dedicated subclass for recursion errors

2014-03-06 Thread R. David Murray

R. David Murray added the comment:

It's an enhancement, so it can only go in 3.5, and that will happen some time 
after the release of 3.4.

--
nosy: +r.david.murray
versions: +Python 3.5 -Python 3.4

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19274] make zipfile.PyZipFile more usable

2014-03-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 064ee489982e by R David Murray in branch 'default':
whatsnew: improve PyZipFile filterfuc entry, and its docs (#19274).
http://hg.python.org/cpython/rev/064ee489982e

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue809163] Can't add files with spaces

2014-03-06 Thread Matheus Vieira Portela

Matheus Vieira Portela added the comment:

Is this issue still going on?

--
nosy: +matheus.v.portela

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20857] ipaddress "is_private" and "is_global" are insufficiently documented and is_global probably has a bug

2014-03-06 Thread R. David Murray

New submission from R. David Murray:

The 'is_private' and 'is_global' properties refer to the iana registries, but 
the terms 'private network' and 'public network' do no appear in the registry 
documentation.  There is no way to know what these methods are going to return 
other than examining the source code.

In particular, without looking at the source code a best-guess interpretation 
of the documentation would lead one to expect that is_private would return true 
only for RFC1918 addresses, since that is the one place the term 'private' 
appears.  Similarly, the naive interpretation of is_global would be that it 
would return False for all addresses listed in the ipv4 registry *except* 
192.88.99.0/24, which is the only one whose global routing flag is True in the 
table.

I would submit that the fact that the latter is not true is a bug.

It is really not at all clear what 'is_private' means (see also issue 17400, 
which introduced is_global), so I am completely unclear how to rewrite the 
documentation to fully specify it, other than to list out the address ranges 
that it considers private.

--
messages: 212812
nosy: ncoghlan, pmoody, r.david.murray
priority: normal
severity: normal
status: open
title: ipaddress "is_private" and "is_global" are insufficiently documented and 
is_global probably has a bug
type: behavior
versions: Python 3.4, Python 3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20857] ipaddress "is_private" and "is_global" are insufficiently documented and is_global probably has a bug

2014-03-06 Thread R. David Murray

R. David Murray added the comment:

Oh, and just to make things more complicated, there are footnotes that some 
protocols allow global routing for protocol-allocated addresses that are 
otherwise not globally routable.  It would be reasonable to for is_global to 
ignore this, but it should be documented that it does so.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11558] Raise a more helpful exception in email.message.Message.attach after set_payload("some string")

2014-03-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 302c8fdb17e3 by R David Murray in branch 'default':
#11558: Better message if attach called on non-multipart.
http://hg.python.org/cpython/rev/302c8fdb17e3

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11558] Raise a more helpful exception in email.message.Message.attach after set_payload("some string")

2014-03-06 Thread R. David Murray

R. David Murray added the comment:

Committed, thanks Varun.

Note that I made two changes to your patch: added a missing space in the folded 
message (your second PEP8 change), and I renamed the test method to make it 
clearer what was being tested.

--
stage:  -> committed/rejected
status: open -> closed
type:  -> enhancement
versions: +Python 3.4, Python 3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20807] 3.4 cherry pick: 82ec02db7fe6 & ec42ab5e0cb3 Windows installer fixes, pip uninstall failure

2014-03-06 Thread Larry Hastings

Larry Hastings added the comment:

ok.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19021] AttributeError in Popen.__del__

2014-03-06 Thread Larry Hastings

Larry Hastings added the comment:

So you're asking that I cherry pick six revisions here?

6a1711c96fa6
fa160c8145e5
efaf12106d68
7ecee9e0dc58
10ea3125d7b8
488ccbee6ee6

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20807] 3.4 cherry pick: 82ec02db7fe6 & ec42ab5e0cb3 Windows installer fixes, pip uninstall failure

2014-03-06 Thread Larry Hastings

Changes by Larry Hastings :


--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20831] 3.4 cherry-pick: 7b3c40510a08 Windows uninstaller doesn't uninstall completly Python 3.4

2014-03-06 Thread Larry Hastings

Larry Hastings added the comment:

ok.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20829] 3.4 cherry pick: c9861ec8754c Fix signatures for dict.__delitem__ and property.__delete__

2014-03-06 Thread Yury Selivanov

Yury Selivanov added the comment:

Larry, so do you think we can have this one cherry-picked?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20832] 3.4 cherry-pick: 9459f517d854 Update Windows installer to SQLite from 3.8.1 to 3.8.3.1.

2014-03-06 Thread Larry Hastings

Larry Hastings added the comment:

ok.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20829] 3.4 cherry pick: c9861ec8754c Fix signatures for dict.__delitem__ and property.__delete__

2014-03-06 Thread Larry Hastings

Larry Hastings added the comment:

ok.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20834] 3.4 cherry-pick: de81e0fe4905 Pydocs module docs server not working on Windows.

2014-03-06 Thread Larry Hastings

Larry Hastings added the comment:

ok.  I agree it's not critical, but on the other hand it's low-risk.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20834] 3.4 cherry-pick: de81e0fe4905 Pydocs module docs server not working on Windows.

2014-03-06 Thread Larry Hastings

Changes by Larry Hastings :


--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20808] 3.4 cherry pick: 6a1711c96fa6 (Popen.__del__ traceback)

2014-03-06 Thread Larry Hastings

Larry Hastings added the comment:

According to #19021, this actually requires six revisions:

6a1711c96fa6
fa160c8145e5
efaf12106d68
7ecee9e0dc58
10ea3125d7b8
488ccbee6ee6

Is that correct?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20808] 3.4 cherry pick: 6a1711c96fa6 (Popen.__del__ traceback)

2014-03-06 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

On Mar 06, 2014, at 05:31 PM, Larry Hastings wrote:

>Larry Hastings added the comment:
>
>According to #19021, this actually requires six revisions:
>
>6a1711c96fa6
>fa160c8145e5
>efaf12106d68
>7ecee9e0dc58
>10ea3125d7b8
>488ccbee6ee6
>
>Is that correct?

Yes, at least.  I got sidetracked by Work but am now trying to get back to
this.  I think there maybe other changes needed to get the test suite to fully
pass, but OTOH, the failures I've seen may be due to my poor cherry picking
skills or other changes introduced in Debian/Ubuntu.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20848] 3.4 cherry-pick: b637064cc696 Improve enum subclass behavior

2014-03-06 Thread Larry Hastings

Larry Hastings added the comment:

ok.

(I thought the change to not-automatically-getting-sphinx was deferred?)

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20843] 3.4 cherry-pick: a9058b772807 fix tracemalloc doc

2014-03-06 Thread Larry Hastings

Larry Hastings added the comment:

ok.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20850] 3.4 cherry pick: ea827c809765 fix pkgutil.find_loader

2014-03-06 Thread Larry Hastings

Larry Hastings added the comment:

ok.

--
nosy: +larry
resolution:  -> fixed
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20830] 3.4 cherry-pick: 16f91d87ff39: "pip install " didn't work on Windows

2014-03-06 Thread Larry Hastings

Changes by Larry Hastings :


--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20830] 3.4 cherry-pick: 16f91d87ff39: "pip install " didn't work on Windows

2014-03-06 Thread Larry Hastings

Larry Hastings added the comment:

ok.  And, my cherry-picking automation will automatically sort the revisions by 
original checkin order.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20818] 3.4 cherry pick: 5fa3f6d82d61 and a8470f88e7b4 - OS X installer use SQLite 3.8.3.1 (instead of 3.8.3)

2014-03-06 Thread Larry Hastings

Larry Hastings added the comment:

ok.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20789] [3.4] cherrypick 5dec1604322c: old sys.path_hooks importer does not work with Python 3.4.0rc1

2014-03-06 Thread Larry Hastings

Larry Hastings added the comment:

ok.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20808] 3.4 cherry pick: 6a1711c96fa6 (Popen.__del__ traceback)

2014-03-06 Thread Larry Hastings

Larry Hastings added the comment:

What do you want me to do?  Hold off while you determine the correct set of 
changes, or proceed with these six?

(p.s. rebasing = headache, so having the right set of changes up front would be 
super-swell.)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20858] Enhancements/fixes to pure-python datetime module

2014-03-06 Thread Brian Kearns

New submission from Brian Kearns:

This patch brings the pure-python datetime more in-line with the C module. We 
have been running these modifications in PyPy2 stdlib for more than a year with 
no issue.

Includes:
- General PEP8/cleanups
- Better testing of argument types passed to constructors
- Removal of duplicate operations (in some paths values were checked twice for 
validity)
- Optimization of timedelta creation (brings it from 8-9usec to ~6 usec on 
CPython 3.3 on local machine)
- Enhancements/bug fixes in tests

--
files: datetime-py34.patch
keywords: patch
messages: 212832
nosy: bdkearns
priority: normal
severity: normal
status: open
title: Enhancements/fixes to pure-python datetime module
type: behavior
Added file: http://bugs.python.org/file34293/datetime-py34.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20858] Enhancements/fixes to pure-python datetime module

2014-03-06 Thread Brian Kearns

Changes by Brian Kearns :


Added file: http://bugs.python.org/file34294/datetime-py33.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20858] Enhancements/fixes to pure-python datetime module

2014-03-06 Thread Brian Kearns

Brian Kearns added the comment:

Also includes bug fixes/tests for certain rounding cases (doesn't apply to the 
3.4 version).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20808] 3.4 cherry pick: 6a1711c96fa6 (Popen.__del__ traceback)

2014-03-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Yes, that is correct.

I thought that 6a1711c96fa6 is already in RC1, that is why I hadn't opened 
cherrypick issue for this. 6a1711c96fa6 is critical change because it not only 
fixes one annoying warning, but it also fixes wrong order of finalization of 
modules and other bugs.

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20859] Context of documentation for conditional expressions

2014-03-06 Thread Terry J. Reedy

New submission from Terry J. Reedy:

The documentation for conditional expressions (c_exps)
http://docs.python.org/3/reference/expressions.html#conditional-expressions
and the later sections on evaluation order and operator precedence have 3 
inconsistencies with each other. I believe the latter (the 'context' of the 
title) were not properly adjusted with the addition of the former to match the 
exceptional behavior of c_exps.


1. Associativily-grouping: I believe the grammar line
  conditional_expression ::=  or_test ["if" or_test "else" expression]
makes c_exps group right to left, as in C.  Something like
  conditional_expression ::=  expression ["if" or_test "else" or_test]
would have the opposite effect. The following examples posted on python-list by 
'candide' illustrate and verify.

>>> 0 if 1 else 0 if 0 else 1
0
>>> 0 if 1 else (0 if 0 else 1)
0
>>> (0 if 1 else 0) if 0 else 1
1

This sentence in the Operator Precedence section
http://docs.python.org/3/reference/expressions.html#operator-precedence

"Operators in the same box group left to right (except for comparisons, 
including tests, which all have the same precedence and chain from left to 
right — see section Comparisons — and exponentiation, which groups from right 
to left)."

should have the last part revised to

"and exponentiation and conditional expressions, which group from right to 
left".

Perhaps a sentence and example should also be added to the C-E section also.


2. Evaluation Order: Condition expressions evaluate the middle subexpession 
first, making 
"Python evaluates expressions from left to right."
http://docs.python.org/3/reference/expressions.html#evaluation-order
wrong as is, without noting the exception of c_exps.

I think "Except for conditional expressions, python evaluates expressions from 
left to right." gives too much weight to the exception.

"Python evaluates expressions from left to right (except for conditional 
expressions)." is a bit more awkward, but, appropriately, makes the exception 
more like a footnote.


3. Precedence: "Conditional expressions (sometimes called a “ternary operator”) 
have the lowest priority of all Python operations." versus the table, which 
lists lambda as lowest priority.  Should 'except for lambda' be added to the 
end of the sentence?  Should the top two lines of the table be reversed?  I do 
not know which is true, or perhaps neither. I get the impression from the 
grammar and the discussion in PEP308 that there are sort-of at the same level. 
Raymond, I add you as a PEP author particularly for this question.

--
messages: 212835
nosy: rhettinger, terry.reedy
priority: normal
severity: normal
stage: needs patch
status: open
title: Context of documentation for conditional expressions
type: behavior
versions: Python 2.7, Python 3.3, Python 3.4

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20860] ipaddress network subnets() method should return object with __getitem__

2014-03-06 Thread Warren Turkal

New submission from Warren Turkal:

It would be very useful to be able to not only iterate through subnets, but 
also index a subnet. For example, I would really like to be able to do the 
following:

>>> import ipaddress as ipa
>>> net = ipa.ip_network('10.0.0.0/8')
>>> print(net.subnets(prefixlen_diff=2)[2])
"10.128.0.0/10"

As it stands now, I have to write something like the following to get the same 
result:

>>> import ipaddress as ipa
>>> net = ipa.ip_network('10.0.0.0/8')
>>> subnets = net.subnets(prefixlen_diff=2)
>>> for _ in xrange(0, 3):
... subnet = subnets.next()
...
>>> print(subnet)
"10.128.0.0/10"


The simplest way I can come up with to add this feature is by wrapping the 
current body of that method in a nested generator function, creating an 
instance of that generator, adding a appropriate __getitem__ method to that 
object, and returning that object instead of the bare generator. What do you 
all think of that?

Also, it'd be nice to see this added to the ipaddress module on pypi for python 
2.x also. :)

--
components: Library (Lib)
messages: 212836
nosy: Warren.Turkal
priority: normal
severity: normal
status: open
title: ipaddress network subnets() method should return object with __getitem__
type: enhancement
versions: Python 3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20808] 3.4 cherry pick: 6a1711c96fa6 (Popen.__del__ traceback)

2014-03-06 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

On Mar 06, 2014, at 06:41 PM, Serhiy Storchaka wrote:

>
>I thought that 6a1711c96fa6 is already in RC1, that is why I hadn't opened
>cherrypick issue for this. 6a1711c96fa6 is critical change because it not
>only fixes one annoying warning, but it also fixes wrong order of
>finalization of modules and other bugs.

I don't think it is, since it applied cleanly to the rc2 tarball.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20860] ipaddress network subnets() method should return object with __getitem__

2014-03-06 Thread R. David Murray

R. David Murray added the comment:

I think you are looking for list(net.subnets(prefixlen_diff=2))[2].  This is 
the standard Python way of going from an iterator to an indexable collection.

--
nosy: +r.david.murray
resolution:  -> rejected
stage:  -> committed/rejected
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20808] 3.4 cherry pick: 6a1711c96fa6 (Popen.__del__ traceback)

2014-03-06 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

On Mar 06, 2014, at 05:43 PM, Larry Hastings wrote:

>What do you want me to do?  Hold off while you determine the correct set of
>changes, or proceed with these six?

I have just verified that if you take the rc2 tarball and apply these six
changesets, it 1) applies cleanly; 2) completes a "make test" with no errors.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20858] Enhancements/fixes to pure-python datetime module

2014-03-06 Thread Brian Kearns

Changes by Brian Kearns :


Added file: http://bugs.python.org/file34295/datetime-py33-v2.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20858] Enhancements/fixes to pure-python datetime module

2014-03-06 Thread Brian Kearns

Changes by Brian Kearns :


Added file: http://bugs.python.org/file34296/datetime-py34-v2.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20858] Enhancements/fixes to pure-python datetime module

2014-03-06 Thread Brian Kearns

Brian Kearns added the comment:

Updated patch to v2 with another test/fix for type checking of __format__ 
argument to match the C module.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20848] 3.4 cherry-pick: b637064cc696 Improve enum subclass behavior

2014-03-06 Thread Ned Deily

Ned Deily added the comment:

>>(I thought the change to not-automatically-getting-sphinx was deferred?)

(The not-automatically-getting-sphinx change is in the default branch but it 
has not been cherry-picked for 3.4.0 - and should not be, as agreed upon in 
Issue20661.)

--
nosy: +ned.deily

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20858] Enhancements/fixes to pure-python datetime module

2014-03-06 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +belopolsky, lemburg, tim.peters
stage:  -> patch review
versions: +Python 3.3, Python 3.4

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1398781] Example in section 5.3 "Pure Embedding" doesn't work.

2014-03-06 Thread Fabian Kochem

Fabian Kochem added the comment:

I just fell over the PYTHONPATH='' bit aswell. So yes, this is still valid.

--
nosy: +Fabian.Kochem

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20858] Enhancements/fixes to pure-python datetime module

2014-03-06 Thread Alexander Belopolsky

Changes by Alexander Belopolsky :


--
assignee:  -> belopolsky

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20857] ipaddress "is_private" and "is_global" are insufficiently documented and is_global probably has a bug

2014-03-06 Thread Martin v . Löwis

Martin v. Löwis added the comment:

I'm always in favour of using official terminology (and adjust if that changes 
over time). So in this case, I agree with David's analysis, and suggest the 
following specification:

- is_global returns False for all addresses where "Global" is "False" in the 
IPv4 or IPv6 Special-Purpose Address Registry
- a new method is_private_use is introduced, giving True only for the RFC1918 
addresses
- a new method is_unique_local is introduced, giving True only for the RFC 4193 
addresses.
- is_private is deprecated. Alternatively, it could be preserved and documented 
to being the union of is_privte_use and is_unique_local.

I don't think it it necessary to discuss footnote 1 in the IPv6 registry ("not 
global unless a specific allocations says otherwise"). The specific allocations 
that might override this come right below, so if we implement the table, we 
would cover all those more specific case.

I'm puzzled why Teredo is listed as "not global"; my understanding is that the 
Teredo prefixes even get announced in BGP, and are fully global.

--
nosy: +loewis

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20860] ipaddress network subnets() method should return object with __getitem__

2014-03-06 Thread Warren Turkal

Warren Turkal added the comment:

Won't that instantiate an object for each item in the list though? For example:

>>> list(net.subnets(prefixlen_diff=16))[499]

This take a long time. I was trying to think of a way to lazily instantiate.

For example, I don't want to create 65536 network objects (like above) if I am 
looking for the 500th /24 subnet of 10.0.0.0/8. The following executes much 
more quickly:

>>> ipa.ip_network((10 << 24) + (499 << 8))

That essentially what the __getattr__ method should do. Of course, it might 
also be nice to have a __len__ on that object.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20860] ipaddress network subnets() method should return object with __getitem__

2014-03-06 Thread R. David Murray

R. David Murray added the comment:

The interface you are suggesting isn't consistent with other stdlib APIs.  
Perhaps it would be better to discuss this concept on pyhon-ideas...additional 
methods for computing the number of subnets for a given prefix, and a different 
one for constructing one of them, perhaps?  The use cases and appropriate API 
aren't clear, which is why I suggest taking it to python-ideas.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20858] Enhancements/fixes to pure-python datetime module

2014-03-06 Thread Josh Rosenberg

Josh Rosenberg added the comment:

_check_int_field seems needlessly complex. When you want a value that is 
logically an integer (not merely capable of being coerced to an integer), you 
want object.__index__, per PEP 357, or to avoid explicit calls to special 
methods, use operator.index. Any reason to not just use operator.index directly?

--
nosy: +ShadowRanger

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20860] ipaddress network subnets() method should return object with __getitem__

2014-03-06 Thread R. David Murray

R. David Murray added the comment:

Or maybe a subnet_range method that returns a range-like object.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20860] ipaddress network subnets() method should return object with __getitem__

2014-03-06 Thread STINNER Victor

STINNER Victor added the comment:

"It would be very useful to be able to not only iterate through subnets, but 
also index a subnet."

For your information, the IPy module supports that:

>>> tuple(IPy.IP('192.168.1.128/31'))
(IP('192.168.1.128'), IP('192.168.1.129'))
>>> IPy.IP('2000::/3')[2**120]
IP('2100::')

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19251] bitwise ops for bytes of equal length

2014-03-06 Thread Josh Rosenberg

Changes by Josh Rosenberg :


--
nosy: +ShadowRanger

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20860] ipaddress network subnets() method should return object with __getitem__

2014-03-06 Thread STINNER Victor

STINNER Victor added the comment:

I reopen the issue because the list option may create an huge list. Try the 
IPv6 2000::/3 network :-)

--
nosy: +haypo
resolution: rejected -> 
status: closed -> open

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19915] int.bit_at(n) - Accessing a single bit in O(1)

2014-03-06 Thread Josh Rosenberg

Changes by Josh Rosenberg :


--
nosy: +ShadowRanger

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14373] C implementation of functools.lru_cache

2014-03-06 Thread Josh Rosenberg

Changes by Josh Rosenberg :


--
nosy: +ShadowRanger

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11107] Cache constant "slice" instances

2014-03-06 Thread Josh Rosenberg

Changes by Josh Rosenberg :


--
nosy: +ShadowRanger

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17170] string method lookup is too slow

2014-03-06 Thread Josh Rosenberg

Changes by Josh Rosenberg :


--
nosy: +ShadowRanger

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4356] Add "key" argument to "bisect" module functions

2014-03-06 Thread Josh Rosenberg

Changes by Josh Rosenberg :


--
nosy: +ShadowRanger

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11406] There is no os.listdir() equivalent returning generator instead of list

2014-03-06 Thread Josh Rosenberg

Changes by Josh Rosenberg :


--
nosy: +ShadowRanger

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16465] dict creation performance regression

2014-03-06 Thread Josh Rosenberg

Changes by Josh Rosenberg :


--
nosy: +ShadowRanger

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20632] Define a new __key__ protocol

2014-03-06 Thread Josh Rosenberg

Changes by Josh Rosenberg :


--
nosy: +ShadowRanger

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10977] Concrete object C API considered harmful to subclasses of builtin types

2014-03-06 Thread Josh Rosenberg

Changes by Josh Rosenberg :


--
nosy: +ShadowRanger

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17862] itertools.chunks(iterable, size, fill=None)

2014-03-06 Thread Josh Rosenberg

Changes by Josh Rosenberg :


--
nosy: +ShadowRanger

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20858] Enhancements/fixes to pure-python datetime module

2014-03-06 Thread Brian Kearns

Brian Kearns added the comment:

The C datetime module uses the 'i' code for parsing these args, not 'n' (which 
would correspond to operator.index). Using operator.index fails a test case I 
added (cases for classes like decimal.Decimal, implementing __int__ but not 
__index__).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17170] string method lookup is too slow

2014-03-06 Thread Mark Lawrence

Mark Lawrence added the comment:

What's the status of this issue?  Code was committed to the default branch over 
a year ago, see msg182250

--
nosy: +BreamoreBoy

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13936] RFE: change bool(datetime.time(0, 0, 0)) to evaluate as True

2014-03-06 Thread Ethan Furman

Changes by Ethan Furman :


--
nosy: +ethan.furman

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20858] Enhancements/fixes to pure-python datetime module

2014-03-06 Thread Josh Rosenberg

Josh Rosenberg added the comment:

That's actually an argument to fix the C datetime implementation. Right now, 
you get:

>>> from decimal import Decimal as d
>>> from datetime import datetime
>>> datetime(d("2000.5"), 1, 2)
datetime.datetime(2000, 1, 2, 0, 0)

This is wildly inconsistent; if you passed 2000.0, it would raise an exception 
because float (even floats directly equivalent to an int value) are forbidden. 
But the logically equivalent Decimal type will work just fine, silently 
truncating. Basically any user defined type with integer coercion (but not 
integer equivalence) would have the same problem; str doesn't, because str is 
special cased (it doesn't actually have __int__), but any user-defined str-like 
class that defined int coercion would work as a datetime arg in a way str does 
not.

You've just given me an excuse to open my first bug. Thanks! :-)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20861] datetime argument handling inconsistent; should accept logical integers, not coercible values

2014-03-06 Thread Josh Rosenberg

New submission from Josh Rosenberg:

Per my comments on #20858, datetime's argument handling is inconsistent. By 
using the 'i' format code, non-integer types are being coerced to int, even as 
other equivalent non-integer types are accepted (sometimes in a lossy fashion).

Example:

>>> from decimal import Decimal as d
>>> from datetime import datetime
>>> datetime(d("2000.5"), 1, 2)
datetime.datetime(2000, 1, 2, 0, 0)
>>> datetime(2000.0, 1, 2)
Traceback (most recent call last):
   ...
TypeError: integer argument expected, got float

Note that the latter case would not lose data by coercion to int, yet it raises 
an error anyway, while the former is losing data silently.

Similar discrepancies would occur between passing a str argument vs. a 
user-defined string type (the latter would need to implement __int__ to get the 
coercion that str gets through a special case in the int constructor, making 
int(x) and x.__int__() subtly different, since there is no str.__int__).

For consistency, it seems like we should primarily be using typecode 'n', not 
'i', so logical integers are properly converted, while anything else (including 
float/Decimal/str/user-string) must be cast by the caller to avoid the risk of 
silent data loss.

I suspect tons of modules make similar "mistakes" in the interface (until 
today, I didn't realize PyLong_AsLong, and by extension, the 'i' type code 
would coerce non-integral types). I'm looking to start contributing to Python, 
and at least for time being I think I'll keep the bug targeted.

I haven't tested, but I suspect this bug is in all versions of Python. Clearly 
it's not a bug or security issue worth a backport prior to 3.4 though.

I'd happily create and submit a patch if this is a desired fix; I'd appreciate 
any pointers on how to get started (to date, all my Python C extension 
development has been for organization internal modules).

--
components: Extension Modules, Library (Lib)
messages: 212853
nosy: ShadowRanger
priority: normal
severity: normal
status: open
title: datetime argument handling inconsistent; should accept logical integers, 
not coercible values
type: behavior
versions: Python 3.4, Python 3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9815] assertRaises as a context manager keeps tracebacks and frames alive

2014-03-06 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20858] Enhancements/fixes to pure-python datetime module

2014-03-06 Thread Brian Kearns

Brian Kearns added the comment:

Right, that's the behavior as it stands, so I hope this patch can be considered 
independently of that issue (and if such a change is made to the C 
implementation, then a corresponding change could be made in the python 
implementation).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20858] Enhancements/fixes to pure-python datetime module

2014-03-06 Thread Josh Rosenberg

Josh Rosenberg added the comment:

Oh, definitely. No reason to delay this just because I have my knickers in a 
twist on a tangential matter.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20858] Enhancements/fixes to pure-python datetime module

2014-03-06 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

I would like to hear from PyPy developers before we decide what to do with this 
effort.  Pure Python implementation is not used by CPython,
but I am afraid that people who actually use it will not appreciate the code 
churn.

--
nosy: +benjamin.peterson

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20858] Enhancements/fixes to pure-python datetime module

2014-03-06 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

Oh - I did not realize that this originated in PyPy.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20858] Enhancements/fixes to pure-python datetime module

2014-03-06 Thread Brian Kearns

Brian Kearns added the comment:

Yes, I am the PyPy developer who worked on these datetime improvements there -- 
just finally got around to pushing them upstream.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20861] datetime argument handling inconsistent; should accept logical integers, not coercible values

2014-03-06 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +belopolsky, lemburg, tim.peters

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20861] datetime argument handling inconsistent; should accept logical integers, not coercible values

2014-03-06 Thread Brian Kearns

Changes by Brian Kearns :


--
nosy: +bdkearns

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20861] datetime argument handling inconsistent; should accept logical integers, not coercible values

2014-03-06 Thread Alexander Belopolsky

Changes by Alexander Belopolsky :


--
nosy: +mark.dickinson

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20861] datetime argument handling inconsistent; should accept logical integers, not coercible values

2014-03-06 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

>I'd appreciate any pointers on how to get started 

You probably know that the relevant code is in

http://hg.python.org/cpython/file/47f37a688c4c/Modules/_datetimemodule.c#l4059

The devguide should get you started:

http://docs.python.org/devguide/

--
stage:  -> needs patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20861] datetime argument handling inconsistent; should accept logical integers, not coercible values

2014-03-06 Thread Josh Rosenberg

Josh Rosenberg added the comment:

Thank you very much. Very helpful. I'll see about whipping up a preliminary 
patch.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20858] Enhancements/fixes to pure-python datetime module

2014-03-06 Thread Brian Kearns

Changes by Brian Kearns :


Added file: http://bugs.python.org/file34297/datetime-py33-v3.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20858] Enhancements/fixes to pure-python datetime module

2014-03-06 Thread Brian Kearns

Changes by Brian Kearns :


Added file: http://bugs.python.org/file34298/datetime-py34-v3.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18816] "mmap.flush()" is always synchronous, hurting performance

2014-03-06 Thread Josh Rosenberg

Changes by Josh Rosenberg :


--
nosy: +josh.rosenberg

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13936] RFE: change bool(datetime.time(0, 0, 0)) to evaluate as True

2014-03-06 Thread Hanxue Lee

Changes by Hanxue Lee :


--
nosy: +Hanxue.Lee

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20862] Problems running python 3.3

2014-03-06 Thread Romil Agrawal

New submission from Romil Agrawal:

I just installed python 3.3.4 on os mavericks. When I changed the python 
excutable in wing ide and restarted it, a dialog box appeared that said the 
interpreter for python 3.3 might not exist. Can anyone help regarding this?

--
components: Library (Lib)
messages: 212861
nosy: romilagr06
priority: normal
severity: normal
status: open
title: Problems running python 3.3
type: behavior
versions: Python 3.3

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20862] Problems running python 3.3

2014-03-06 Thread Ned Deily

Ned Deily added the comment:

Sorry, the Python bug tracker is not the place to ask about third-party 
products.  One suggestion though: make sure you entered the full (absolute) 
path to the Python 3.3 executable: probably something like 
/usr/local/bin/python3.3 or 
/Library/Frameworks/Python.framework/Versions/3.3/bin/python3.3.  If that 
doesn't work, you could try asking on the Python user mailing list:  
https://mail.python.org/mailman/listinfo/python-list

--
nosy: +ned.deily
resolution:  -> invalid
stage:  -> committed/rejected
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com