Alexander Belopolsky added the comment:
+#define xx_state_global
+ ((xxstate *)PyModule_GetState(PyState_FindModule(&xxmodule)))
This is unsafe: PyState_FindModule(&xxmodule) can return NULL. I think code
should account for this possibility and not use this macro. For
Alexander Belopolsky added the comment:
On Mon, Sep 3, 2012 at 8:38 AM, Stefan Krah wrote:
> I don't see what could possibly be ill-defined about using the
> tobytes() definition for ND-arrays. In all places memoryview now
> uses the logical array, which is displayed by tolist().
New submission from Alexander Belopolsky:
With attached patch python -mpydoc memoryview display looks as follows:
...
| cast(...)
| M.cast(format[, shape]) -> memoryview
|
| Cast a memoryview to a new format or shape.
|
| release(...)
| M.release() ->
Alexander Belopolsky added the comment:
In the new patch, I added docstrings for the data members and now the list of
memoryview data descriptors looks as follows in pydoc:
| --
| Data descriptors defined here
Changes by Alexander Belopolsky :
Removed file: http://bugs.python.org/file27109/memoryobject-docstrings.diff
___
Python tracker
<http://bugs.python.org/issue15
New submission from Alexander Belopolsky:
Starting with the example in memoryview documentation:
>>> from ctypes import BigEndianStructure, c_long
>>> class BEPoint(BigEndianStructure):
... _fields_ = [("x", c_long), ("y", c_long)]
...
>>> poi
Alexander Belopolsky added the comment:
I am going to commit this tonight. Stefan, please let me know if you have any
comments. I copied most of the descriptions from ReST manual with a few minor
changes. See shape/strides/suboffsets.
--
stage: -> commit rev
Alexander Belopolsky added the comment:
What about
>>> struct.unpack_from('>ll',a)
(0, 100)
shouldn't that return (100, 200)?
--
___
Python tracker
<htt
Alexander Belopolsky added the comment:
On Sep 3, 2012, at 1:22 PM, Stefan Krah wrote:
> Personally I'd also prefer if all
> docstrings go into a separate section. I always perceive docstrings
> as noise that takes up precious vertical space, so for _decimal I even
>
Alexander Belopolsky added the comment:
On Mon, Sep 3, 2012 at 3:59 PM, Martin v. Löwis wrote:
> if hashing was restricted
> to contiguous bytes, then the implementation would certainly be
> simplified quite a bit: currently, if it's not contiguous, it needs
> to make a separ
Alexander Belopolsky added the comment:
A few remaining comments:
1) shape being None for 0-d views in 3.2 is probably a bug. I did not mention
that behavior in docstring.
2) "a N-dimensional array" typo was copied from ReST. Fixing it does not
deserve a separate tracker entry, b
New submission from Alexander Konovalenko:
Some security fixes and bug fixes that are simultaneously issued for multiple
Python versions require changes to the documentation. I'm now looking at the
hash randomization vulnerability that was fixed in 2.6.8 and 2.7.3.
The docs always mentio
Alexander Konovalenko added the comment:
Andrew, I don't get it. :( Why not?
The docs for Python 2.7 generally inform the reader in which Python version
every feature appeared. That's really helpful if your code should run on
earlier version of Python. You don't have to dig t
New submission from Alexander Belopolsky:
PyType_FromSpec() is a convenient function to create types dynamically in C
extension modules, but its usefulness is limited by the fact that it creates
new types using the default metaclass.
I suggest adding a new C API function
PyObject
Alexander Belopolsky added the comment:
On Thu, Sep 6, 2012 at 12:44 PM, Amaury Forgeot d'Arc
wrote:
> The patch is a bit light: see how type_new also computes the metaclass from
> the base classes.
This was intentional. I was looking for a lightweight facility to
create heap typ
Changes by Alexander Belopolsky :
--
nosy: +Robin.Schreiber
___
Python tracker
<http://bugs.python.org/issue15870>
___
___
Python-bugs-list mailing list
Unsub
Alexander Belopolsky added the comment:
> see how type_new also computes the metaclass from the base classes.
As you can see from my first message, I originally considered
PyType_FromSpecEx(PyObject *meta, PyType_Spec *spec) without bases. (In fact I
was unaware of the recent addition
Alexander Belopolsky added the comment:
On Sep 6, 2012, at 5:10 PM, Martin v. Löwis wrote:
>
> What is your use case for this API?
>
I can describe my use case, but it is somewhat similar to ctypes. I searched
the tracker for a PEP 3121 refactoring applied to ctypes and could
Alexander Belopolsky added the comment:
On Sep 6, 2012, at 6:25 PM, Martin v. Löwis wrote:
> I'm -1 on calling it PyType_FromSpecEx.
I find it encouraging that you commented on the choice of name. :-) I can live
with PyType_FromMetatypeAndSpec and leave out bases. PyType_FromTypeAn
Alexander Belopolsky added the comment:
%z format is supported, but it cannot accept colon in TZ offset. It can parse
offsets like -0600 just fine. What OP is looking for is the GNU date %:z
format which datetime does not support.
For ISO 8601 compliance, however I think we need a way to
Alexander Belopolsky added the comment:
On Thu, Sep 6, 2012 at 9:51 PM, John Nagle wrote:
> It's not in Python 2.7 / Win32.
Python 2.x series is closed and cannot accept new features. Both %z
and fixed offset tzinfo subclass are implemente
Alexander Belopolsky added the comment:
I am attaching a quick python only prototype for the proposed feature. My goal
is to make date/time objects behave like numeric types for which constructors
accept strings produced by str(). Since str() format is ISO 8601, it is
natural to accept ISO
Changes by Alexander Belopolsky :
--
nosy: +belopolsky
___
Python tracker
<http://bugs.python.org/issue12014>
___
___
Python-bugs-list mailing list
Unsubscribe:
Alexander Belopolsky added the comment:
Added in 7ca6b3a16e15
--
nosy: +belopolsky
resolution: -> out of date
status: open -> closed
___
Python tracker
<http://bugs.python.org/i
Changes by Alexander Belopolsky :
--
status: pending -> closed
___
Python tracker
<http://bugs.python.org/issue5023>
___
___
Python-bugs-list mailing list
Un
Alexander Belopolsky added the comment:
The patch makes sense. I'll take another look over the weekend, but it seems
to be ready to be applied.
--
assignee: -> belopolsky
nosy: +belopolsky
stage: patch review -> commit review
___
Pyt
Changes by Alexander Belopolsky :
--
assignee: belopolsky
nosy: belopolsky
priority: normal
severity: normal
status: open
title: PEP 3121, 384 Refactoring applied to ctypes module
type: resource usage
versions: Python 3.4
___
Python tracker
<h
Changes by Alexander Belopolsky :
--
dependencies: +PEP 3121, 384 Refactoring applied to ctypes module
___
Python tracker
<http://bugs.python.org/issue15
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
New submission from Alexander Martin:
POST data is truncated randomly when sent to a python script running on a
simple python CGI server on Windows 7 with Python 3.2.3.
The same server and script files run successfully on MAC OSX 10.8 with Python
3.2.3. A similar server (adapted for lower
Alexander Martin added the comment:
The successful script execution was run under Python 2.7.3 (as of today one of
the two as "production version" labeled releases). The initial report's
reference to Python 2.7.2 was made by mistake.
May anyone confirm this error beha
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 Belchenko:
Why by default unittest.main (which uses unittest.TextTestRunner) prints
everything to stderr. What the reason behind this behavior?
It makes very inconvenient to run big test suite with less, i.e.
python test.py | less
or
python test.py > test.
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 Mohr added the comment:
Ya. The original request I think is ok because by allowing that flag it
will replace files and dirs.
On Mar 14, 2014 7:15 PM, "R. David Murray" wrote:
>
> R. David Murray added the comment:
>
> I don't know what "the method a
Alexander Mohr added the comment:
btw, I believe the solution is as simple as stated as that's what I'm doing
locally and its behaving exactly as intended.
--
___
Python tracker
<http://bugs.python.o
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:
New submission from Alexander Boyd:
Itertools would benefit greatly from a function (which I've named intersperse,
after Haskell's equivalent) for yielding the items of an iterator with a given
value placed between each. Sort of a str.join-like function, but for arbitrary
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
New submission from Alexander Kruppa:
I'm trying to use the email.* functions to craft HTTP POST data for file
upload. Trying something like
filedata = open("data", "rb").read()
postdata = MIMEMultipart()
fileattachment = MIMEApplication(filedata, _encoder=e
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
New submission from Alexander Boyd:
Tested on 3.3.2 and 2.6.6.
On Oracle Linux, platform.linux_distribution detects the current distribution
as Red Hat Enterprise Linux:
>>> import platform
>>> platform.linux_distribution()
('Red Hat Enterprise Linux Server',
Alexander Boyd added the comment:
They're providing both /etc/oracle-release and /etc/redhat-release (as Oracle
Linux is based on RHEL).
I've attached /etc/oracle-release for reference.
--
Added file: http://bugs.python.org/file32147/orac
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
2301 - 2400 of 4097 matches
Mail list logo