Alexander Belopolsky added the comment:
It looks like your patch will result in reference leaks if type creation fails.
I think you should add Py_DECREF(m) before error returns.
--
___
Python tracker
<http://bugs.python.org/issue15
Alexander Belopolsky added the comment:
On Sep 9, 2012, at 8:15 AM, Roy Smith wrote:
> We need to define the scope of what input strings will be accepted.
Since it is easier to widen the domain of acceptable arguments than to narrow
it in the future, I would say let's start by accep
Alexander Belopolsky added the comment:
> I realize that while that is certainly an absolute lower bound,
> it's almost certainly not sufficient. The most common use case
> I see on a daily basis is parsing strings that look like
> "2012-09-07T23:59:59+00:00".
Thi
Alexander Belopolsky added the comment:
> For what parts of ISO 8601 to accept, there's a standard: RFC3339
This is almost indistinguishable from the idea of accepting .isoformat() and
str() results. From what I see the only difference is that 't' is accepted for
date/tim
Alexander Belopolsky added the comment:
Applied to 3.2 and 3.3. Thanks for the patch!
Leaving it open pending 2.7 commit.
--
resolution: -> fixed
stage: commit review -> committed/rejected
___
Python tracker
<http://bugs.python.org/i
Alexander Belopolsky added the comment:
For some reason there are no review links, so I'll review in this message.
Include/datetime.h
+typedef struct {
..
+} _datetimemodulestate;
Names exposed in public headers (datetime.h is a public header) should start
with Py or _Py. Other offe
Alexander Belopolsky added the comment:
What is the point of providing a __sizeof__ method to a purely internal type?
I don't think it is possible to expose StgDict at the python level. It is
always hidden behind a mapping proxy. Furthemore, StgDict is only used inside
type objects an
Alexander Belopolsky added the comment:
Why is this a problem? ISTM all that is happening is that null tp_base is set
to null if Py_tp_base slot is specified as null. If this is somehow a problem
- the user should not specify Py_tp_base slot.
--
nosy: +belopolsky
Alexander Belopolsky added the comment:
Can you give an example of the situation that you described? Perhaps you
encountered it while refactoring some particular extension module. Which?
In your patch new code is commented out.
PySpec_New() is not a good name. It should be something like
Changes by Alexander Belopolsky :
--
assignee: -> belopolsky
___
Python tracker
<http://bugs.python.org/issue15873>
___
___
Python-bugs-list mailing list
Un
Alexander Belopolsky added the comment:
I would like to split this issue to separate PEP 3121 changes from PEP 384.
PEP 3121 state cleanup implementation is clearly an improvement "from a
resource management point of view." On the other hand, I don't see much
benefit for the
Alexander Belopolsky added the comment:
Isn't this a duplicate of issue 8810?
--
___
Python tracker
<http://bugs.python.org/issue15941>
___
___
Python-bugs-l
Alexander Belopolsky added the comment:
I've read this more carefully and I now understand the issue. Indeed, setting
time.timezone or time.altzone has no effect on say time.strftime('%z'). I
think this should be documented and the doc should refer to time.tzset() for a
prope
Alexander Belopolsky added the comment:
> Setting this attribute has no effect.
Strictly speaking, setting this attribute has the effect of changing the value
of this attribute. I cannot come up with a better wording at this hour, but I
would say something about it being "information
Changes by Alexander Belopolsky :
--
assignee: ronaldoussoren -> belopolsky
___
Python tracker
<http://bugs.python.org/issue15973>
___
___
Python-bugs-list mai
Alexander Belopolsky added the comment:
I cannot reproduce on a Mac with py3k tip.
Python 3.3.0rc2+ (default:19c74cadea95, Sep 19 2012, 14:39:07)
[GCC 4.2.1 Compatible Apple Clang 3.1 (tags/Apple/clang-318.0.61)] on darwin
Type "help", "copyright", "credits" or
Alexander Belopolsky added the comment:
This is similar to issue 14262. If we decide that timedelta should play nice
with Decimal, I would like to consider all related features.
--
versions: -Python 3.3
___
Python tracker
<http://bugs.python.
Alexander Belopolsky added the comment:
In fact, this is a near-duplicate of #14262 becaus instead of
>>> decimal.Decimal('0.1')*datetime.timedelta(seconds=3)
one can always write
>>> datetime.timedelta(seco
Alexander Belopolsky added the comment:
Mark wrote in his comment on issue 15975:
> we're looking at significant extra code to implement
> Decimal * timedelta
Not necessarily. I will only support adding this feature if it can be done
without making datetime know about Decimal.
Alexander Belopolsky added the comment:
On Wed, Sep 19, 2012 at 3:09 PM, Ram Rachum wrote:
> One example is decimal fields on Django, used for dollar amounts.
.. and since time is money and money is time we should support easy
conversion between the two. :-)
--
n
Alexander Belopolsky added the comment:
On Wed, Sep 19, 2012 at 3:24 PM, Ram Rachum wrote:
> I hope this was intended as a joke. If this was an actual criticism, let me
> know so
> I could explain why it makes sense.
It was both. Yes, any use cases will be helpful. Timedelta is
Alexander Belopolsky added the comment:
On Wed, Sep 19, 2012 at 4:32 PM, Ram Rachum wrote:
> But that number, 1.15, is stored in a Django decimal field.
My criticism was towards the idea that one may need to multiply
timedelta by a dollar amount or convert a dollar amount to a
timede
Alexander Belopolsky added the comment:
On Sep 19, 2012, at 5:36 PM, Ram Rachum wrote:
> Why would we use float to represent the ratio of the bonus to the client?
Because float is the builtin type that Python provides to represent such
quantities.
> Why would we risk imprecision ther
Alexander Belopolsky added the comment:
I think the following simple patch should do the trick. I'll add some tests
and commit. Should this get in 3.3.0?
diff -r 19c74cadea95 Modules/_datetimemodule.c
--- a/Modules/_datetimemodule.c Wed Sep 19 08:25:01 2012 +0300
+++ b/Mo
Alexander Belopolsky added the comment:
> What about datetime subclasses?
Do you mean timezone subclasses? Timezone type is not subclassable, but we
should probably support comparison with any tzinfo subclass. I'll add this
logic, but arguably that would be a new
Alexander Belopolsky added the comment:
> Alexander, did you send a contributor agreement?
At least twice. :-)
--
keywords: +patch
priority: normal -> high
stage: needs patch -> commit review
Added file: http://bugs.python.org/file27234/issue1
Alexander Belopolsky added the comment:
Leeaving the issue open in case it will go to 3.3.0. Reassigning to the RM.
--
assignee: belopolsky -> georg.brandl
resolution: -> fixed
stage: commit review -> committed/rejected
___
Python track
Changes by Alexander Belopolsky :
--
resolution: -> fixed
stage: needs patch -> committed/rejected
status: open -> closed
versions: +Python 3.4 -Python 3.3
___
Python tracker
<http://bugs.python.o
Alexander Belopolsky added the comment:
Christian's or rather Skip's idea is covered by Issue 3173. This was discussed
several times on python-dev.
--
___
Python tracker
<http://bugs.python.
New submission from Alexander Belopolsky:
In Python 3.3.0 and 3.2.3:
>>> from inspect import *
>>> def f(a,b):pass
...
>>> formatargspec(getargspec(f))
Traceback (most recent call last):
File "", line 1, in
File
"/Library/Frameworks/Python.frame
Alexander Belopolsky added the comment:
My bad, but I think documentation can be improved by adding an example.
--
assignee: -> docs@python
components: +Documentation -Library (Lib)
nosy: +docs@python
type: behavior -> enhancement
versions: -Python 3.2, Pyth
Alexander Belopolsky added the comment:
The patch looks good, but I have a few comments on the test:
1. Does it work on Windows? It seems to rely on Olson's TZ names.
2. Please use @run_with_tz decorator.
--
___
Python tracker
Alexander Belopolsky added the comment:
Is this documentation still valid?
+.. staticmethod:: date.strptime(date_string, format)
+
+ Return a :class:`date` corresponding to *date_string*, parsed according to
+ *format*. This is equivalent to ``date(*(time.strptime(date_string,
+ format
Alexander Belopolsky added the comment:
If datetime.date.strptime(date_string, format) validates format, then it is
*not* equivalent to date(*(time.strptime(date_string, format)[0:3])), is it?
--
___
Python tracker
<http://bugs.python.
New submission from Alexander Belopolsky:
[Nathaniel Smith at numpy-discussion]
Guido just formally accepted PEP 465:
https://mail.python.org/pipermail/python-dev/2014-April/133819.html
http://legacy.python.org/dev/peps/pep-0465/#implementation-details
Yay.
The next step is to implement
Alexander Belopolsky added the comment:
I've got to the point where I can do
>>> import ast
>>> ast.dump(ast.parse('a @ b'))
"Module(body=[Expr(value=BinOp(left=Name(id='a', ctx=Load()), op=MatMult(),
right=Name(id='b', ctx=Loa
Alexander Belopolsky added the comment:
Wow! That was quick. And I am still fighting with bitbucket. Maybe I should
stop duplicating the effort at this point.
--
___
Python tracker
<http://bugs.python.org/issue21
Alexander Belopolsky added the comment:
Thanks for stepping in. From a quick look at your patch I don't see anything
that I would do much differently.
I noticed some whitespace issues in Include/token.h:
-#define AT 49
-#define RARROW 50
-#define ELLIPSIS
Alexander Belopolsky added the comment:
+ .. versionadded:: 3.4
Are you planning to use the time machine? :-)
--
___
Python tracker
<http://bugs.python.org/issue21
Changes by Alexander Belopolsky :
--
nosy: +belopolsky
___
Python tracker
<http://bugs.python.org/issue19414>
___
___
Python-bugs-list mailing list
Unsubscribe:
Alexander Belopolsky added the comment:
> .. 0 when it is not. -1 indicates that ..
It does not read well when the sentence starts with a number. Consider
rephrasing as "The value of -1 .." or something like that.
--
___
Python t
Alexander Belopolsky added the comment:
I don't think a comment explaining that default encoding is utf-8 in python 3.x
will improve readability of this code.
if (encoding == NULL)
return PyUnicode_DecodeUTF8(s, size, errors);
seems quite self-explan
Alexander Belopolsky added the comment:
Is it practical to implement GPS time as datetime given that we don't have
support for leap seconds?
--
___
Python tracker
<http://bugs.python.org/i
Alexander Belopolsky added the comment:
Juarez,
Are you planning to implement format validation as you described in msg165882?
Without that, date.strptime() is not very useful because it is almost
equivalent to datetime.strptime().date
Alexander Belopolsky added the comment:
issue6478_v2.patch looks good to me. There is a long line in _strptime.py
which I will fix before committing.
--
stage: test needed -> commit review
versions: -Python 3.2
___
Python tracker
&l
Alexander Belopolsky added the comment:
I recall a discussion in which it was argued that "look before you leap"-style
argument checking that we implemented in py3k was a feature and backporting it
to 2.x could potentially break code running on platforms with promiscuous (and
poss
Changes by Alexander Belopolsky :
--
nosy: +belopolsky
___
Python tracker
<http://bugs.python.org/issue16818>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Alexander Belopolsky:
According to the reference manual, "None of the types defined in [numbers]
module can be instantiated." However,
>>> from numbers import *
>>> Number()
This can probably be fixed by making Number.__hash__ an abstract
Alexander Belopolsky added the comment:
Attached patch fixes the issue and passes regression tests, so most likely the
ability to instantiate Number is not an intentional feature.
"pass" should probably be replaced with a meaningful docstring, but I would
like to hear from others
Alexander Belopolsky added the comment:
ctypes/tests is within my area of interests and may prove to be one of the
harder pieces. I'll try to move it and report the results. I have not worked
with the rest, so unless it is truly trivial this will have to wait for another
volu
Changes by Alexander Belopolsky :
--
resolution: -> wont fix
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue2267>
___
___
Pyth
Alexander Belopolsky added the comment:
Benjamin,
I am assigning this to you because 2.7.4 release is probably the last chance to
do something about this behavior in 2.7 series.
I am tentatively resolving this as "won't fix." In 3.x, we decided that well
defined behavior is
Alexander Belopolsky added the comment:
Sounds like a reasonable request, but the proposed code does not seem to work
for the Eastern hemisphere (negative tz offsets.)
I am not very familiar with sqlite module. What timestamp format does it use?
Isn't it some varian of ISO 3339? See
Alexander Belopolsky added the comment:
See also #5907.
--
___
Python tracker
<http://bugs.python.org/issue1820>
___
___
Python-bugs-list mailing list
Unsub
Changes by Alexander Belopolsky :
--
superseder: -> Use a set for interned strings
___
Python tracker
<http://bugs.python.org/issue1507011>
___
___
Python-
Alexander Belopolsky added the comment:
This exact issue was discussed in #19187 and #7224 many years ago.
--
nosy: +belopolsky
___
Python tracker
<http://bugs.python.org/issue19
Alexander Belopolsky added the comment:
The first reference above should have been to #1507011.
--
___
Python tracker
<http://bugs.python.org/issue19187>
___
___
Alexander Belopolsky added the comment:
> In embedded systems, every byte of memory counts
It is not just embedded systems. The range 192 KB to 1.5 MB is where typical
L2 cache sizes are these days. I would expect that the intern dictionary is
accessed very often and much more often t
Changes by Alexander Belopolsky :
--
dependencies: +Add context manager for the "try: ... except: pass" pattern
___
Python tracker
<http://bugs.python.o
Changes by Alexander Belopolsky :
--
superseder: -> Rename contextlib.ignore to contextlib.suppress
___
Python tracker
<http://bugs.python.org/issu
Alexander Belopolsky added the comment:
> Please give some weight to the fact the ignore() was
> checked in for seven months, ...
+1
--
nosy: +belopolsky
___
Python tracker
<http://bugs.python.org/i
Alexander Belopolsky added the comment:
> Catch would be fine with me :)
Both "catch" and "trap" have the same problem in my view: you don't get to eat
what you have caught (or trapped). :-)
> Please note that someone *reading the thread* on python-dev
> m
Alexander Belopolsky added the comment:
Feel free to ignore() me if it helps to close this debate. English is not my
native language and my understanding may not match that of the majority of
users.
Note, however, that this debate might not even have started if not for a change
s/ignored
Alexander Belopolsky added the comment:
I guess the extra coverage is in "if getstate" branch of
class tzinfo:
...
def __reduce__(self):
getinitargs = getattr(self, "__getinitargs__", None)
if getinitargs:
args = getinitargs()
el
Alexander Belopolsky added the comment:
> what's the reason for accepting the time.strptime()
> version as a bug, but not datetime.datetime.strptime()?
In case of time.strptime(), we have an option of returning (1900, 2, 29, ..)
which while not being a valid date, is a valid
Alexander Belopolsky added the comment:
I cannot reproduce this and I suspect that the problem shows up only in certain
times.
I believe this is related to the long-standing issue that was fixed in 3.3.
See issue 1667546. In Python prior to 3.3, time_struct did not store timezone
Alexander Belopolsky added the comment:
> The documentation for time.strftime(format[, t]) reads:
> "If t is not provided, the current time as returned by localtime() is used"
> but apparently there must be something extra going on under the hood.
Yes, the C implementati
Changes by Alexander Belopolsky :
--
nosy: +belopolsky
___
Python tracker
<http://bugs.python.org/issue19475>
___
___
Python-bugs-list mailing list
Unsubscribe:
Alexander Belopolsky added the comment:
+1 on adding an option to isoformat(). We already have an optional
argument, so the symmetry with __str__ is not complete. To make this option
more useful, rather than implementing always_emit_microseconds=False flag, I
would add a keyword argument
Alexander Belopolsky added the comment:
+1 on all Victor's points.
I like 'resolution' because this is the term that datetime module uses already:
>>> from datetime import *
>>> datetime.resolution
datetime.timedelta(0, 0, 1)
There is a slight chance of conf
Alexander Belopolsky added the comment:
MAL: Have you thought about the rounding/truncation issues
associated with not showing microseconds ?
I believe it has to be the truncation. Rounding is better left to the user
code where it can be done either using timedelta arithmetics or at the time
Alexander Belopolsky added the comment:
I am afraid that the rounding issues may kill this proposal. Can we start with
something simple? For example, we can start with show=None keyword argument
and allow a single value 'microseconds' (or 'us'). This will solve the i
Alexander Belopolsky added the comment:
I would like to hear from others on this feature. One concern that I have is
whether it is wise to truncate the fractional seconds part in '%s'. Also, if
we support '%s' in strftime we should probably support it in strptime as we
Alexander Belopolsky added the comment:
> It is not clear what the returned value for %s strptime should be:
I would start conservatively and require %z to be used with %s. In this case,
we can easily produce aware datetime objects.
I suspect that in the absence of %z, the most useful opt
Alexander Belopolsky added the comment:
On the second thought, I don't think accepting this should be contingent on any
decision with respect to strptime.
--
assignee: -> belopolsky
stage: needs patch -> commit review
___
Python tra
Alexander Belopolsky added the comment:
> rounding problem fixed with math.floor
Can you explain why math.floor rather than builtin round is the correct
function to use?
--
___
Python tracker
<http://bugs.python.org/issu
Alexander Belopolsky added the comment:
I would say this is a doc issue. There are some tzinfo algorithms that depend
on utcoffset(dt)-dst(dt) being invariant, but this is the part of datetime
library that I have never fully understood.
What I do understand is that conversion from local time
Alexander Belopolsky added the comment:
Here is the simpler demonstration of the "floor" behavior on Linux:
>>> from datetime import datetime
>>> datetime.fromtimestamp(-0.1).strftime('%s')
'-1'
>>> datetime.fromtimestamp(-1.1).strftim
Alexander Belopolsky added the comment:
Could you, please add tests for non-fixed offset timezones? There are several
defined in datetimetester.py already.
--
versions: +Python 3.5 -Python 3.3
___
Python tracker
<http://bugs.python.org/issue12
Alexander Belopolsky added the comment:
The patch should update documentation.
See
https://docs.python.org/3.5/library/datetime.html#strftime-and-strptime-behavior
--
___
Python tracker
<http://bugs.python.org/issue12
Alexander Belopolsky added the comment:
+t = datetime(1969, 1, 1, 0,0,0, 60, tzinfo=timezone.utc)
Please add spaces after commas.
--
___
Python tracker
<http://bugs.python.org/issue12
Alexander Belopolsky added the comment:
I think this is out-of-date. On Mac OS X, I get
```
$ python3 -V
Python 3.4.1
$ TZ=Europe/Moscow python3 -c "import time; print(time.daylight)"
0
```
I'll check on Linux now ...
--
___
Python
Alexander Belopolsky added the comment:
Same result on a freshly compiled
Python 3.4.1 (default, Jun 29 2014, 15:26:46)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux
$ TZ=Europe/Moscow ~/Apps/bin/python3 -c "import time; print(time.daylight)"
0
I suspect that the problem was
Alexander Belopolsky added the comment:
> But python detect daylight flag as differences between January and July
> localtime.
This is the best we can do because time.daylight is a constant and this does
not work in locations like Moscow where daylight rules were adopted ~ 30 years
a
Alexander Belopolsky added the comment:
I suspect there will be another period soon when time.daylight logic will break
after Europe/Moscow goes back to winter time (hopefully for good).
There is no solution of this issue within constraints of the time module. See
issue9527 for how it was
Changes by Alexander Belopolsky :
--
nosy: +alexandre.vassalotti, haypo, pitrou
___
Python tracker
<http://bugs.python.org/issue9051>
___
___
Python-bugs-list m
Changes by Alexander Belopolsky :
--
nosy: +lemburg
___
Python tracker
<http://bugs.python.org/issue9004>
___
___
Python-bugs-list mailing list
Unsubscribe:
Alexander Belopolsky added the comment:
Reclassifying this as a doc issue.
--
components: +Documentation -Extension Modules
stage: test needed -> needs patch
versions: +Python 3.5 -Python 3.3
___
Python tracker
<http://bugs.python.org/iss
Changes by Alexander Belopolsky :
--
keywords: +easy
___
Python tracker
<http://bugs.python.org/issue9004>
___
___
Python-bugs-list mailing list
Unsubscribe:
Alexander Belopolsky added the comment:
David,
Is there anything left to do here that is not covered by issue 11024?
--
___
Python tracker
<http://bugs.python.org/issue10
Alexander Belopolsky added the comment:
Problem "B" has been resolved, but problem "A" is still there.
Python 3.4.1 (default, Jun 29 2014, 15:26:46)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux
Type "help", "copyright", "credits" or "
Changes by Alexander Belopolsky :
--
resolution: -> fixed
stage: needs patch -> resolved
status: open -> closed
___
Python tracker
<http://bugs.python.o
Changes by Alexander Belopolsky :
--
versions: +Python 3.5 -Python 3.2
___
Python tracker
<http://bugs.python.org/issue10541>
___
___
Python-bugs-list mailin
Changes by Alexander Belopolsky :
--
stage: patch review -> commit review
___
Python tracker
<http://bugs.python.org/issue10541>
___
___
Python-bugs-list mai
Changes by Alexander Belopolsky :
--
resolution: -> fixed
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue10541>
___
___
Python-bugs-
Alexander Belopolsky added the comment:
Brian,
I would like to apply your changes for 3.5. Do you have any updates?
--
stage: patch review -> commit review
versions: +Python 3.5 -Python 3.3, Python 3.4
___
Python tracker
<http://bugs.pyth
Alexander Belopolsky added the comment:
I would like to bring this issue to some conclusion. Here is the summary:
Pro:
datetime.time.now() is shorter than datetime.datetime.now().time()
Cons:
1. date, time = datetime.date.today(), datetime.time.now() is attractive, but
wrong.
2
Changes by Alexander Belopolsky :
--
assignee: belopolsky ->
___
Python tracker
<http://bugs.python.org/issue1812>
___
___
Python-bugs-list mailing list
Un
Changes by Alexander Belopolsky :
--
assignee: belopolsky ->
___
Python tracker
<http://bugs.python.org/issue3173>
___
___
Python-bugs-list mailing list
Un
Alexander Belopolsky added the comment:
MODULE DOCS section is no longer present in pydoc generated pages.
--
resolution: accepted -> out of date
status: open -> closed
___
Python tracker
<http://bugs.python.org/i
2001 - 2100 of 3596 matches
Mail list logo