[issue15849] PEP 3121, 384 Refactoring applied to xx module

2012-09-02 Thread Alexander Belopolsky
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

[issue15814] memoryview: equality-hash invariant

2012-09-03 Thread Alexander Belopolsky
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().

[issue15855] memoryview methods are missing docstrings

2012-09-03 Thread Alexander Belopolsky
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() ->

[issue15855] memoryview methods and data members are missing docstrings

2012-09-03 Thread Alexander Belopolsky
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

[issue15855] memoryview methods and data members are missing docstrings

2012-09-03 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : Removed file: http://bugs.python.org/file27109/memoryobject-docstrings.diff ___ Python tracker <http://bugs.python.org/issue15

[issue15857] memoryview of a ctypes struct has incompatible invalid format

2012-09-03 Thread Alexander Belopolsky
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

[issue15855] memoryview methods and data members are missing docstrings

2012-09-03 Thread Alexander Belopolsky
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

[issue15857] memoryview: complete support for struct packing/unpacking

2012-09-03 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: What about >>> struct.unpack_from('>ll',a) (0, 100) shouldn't that return (100, 200)? -- ___ Python tracker <htt

[issue15855] memoryview methods and data members are missing docstrings

2012-09-03 Thread Alexander Belopolsky
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 >

[issue15814] memoryview: equality-hash invariant

2012-09-03 Thread Alexander Belopolsky
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

[issue15855] memoryview methods and data members are missing docstrings

2012-09-03 Thread Alexander Belopolsky
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

[issue15863] Fine-grained info about Python versions which support changes introduced in micro releases

2012-09-04 Thread Alexander Konovalenko
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

[issue15863] Fine-grained info about Python versions which support changes introduced in micro releases

2012-09-06 Thread Alexander Konovalenko
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

[issue15870] PyType_FromSpec should take metaclass as an argument

2012-09-06 Thread Alexander Belopolsky
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

[issue15870] PyType_FromSpec should take metaclass as an argument

2012-09-06 Thread Alexander Belopolsky
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

[issue15870] PyType_FromSpec should take metaclass as an argument

2012-09-06 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- nosy: +Robin.Schreiber ___ Python tracker <http://bugs.python.org/issue15870> ___ ___ Python-bugs-list mailing list Unsub

[issue15870] PyType_FromSpec should take metaclass as an argument

2012-09-06 Thread Alexander Belopolsky
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

[issue15870] PyType_FromSpec should take metaclass as an argument

2012-09-06 Thread Alexander Belopolsky
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

[issue15870] PyType_FromSpec should take metaclass as an argument

2012-09-06 Thread Alexander Belopolsky
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

[issue15873] "datetime" cannot parse ISO 8601 dates and times

2012-09-06 Thread Alexander Belopolsky
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

[issue15873] "datetime" cannot parse ISO 8601 dates and times

2012-09-06 Thread Alexander Belopolsky
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

[issue15873] "datetime" cannot parse ISO 8601 dates and times

2012-09-06 Thread Alexander Belopolsky
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

[issue12014] str.format parses replacement field incorrectly

2012-09-06 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- nosy: +belopolsky ___ Python tracker <http://bugs.python.org/issue12014> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue15520] Document datetime.timestamp() in 3.3 What's New

2012-09-06 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Added in 7ca6b3a16e15 -- nosy: +belopolsky resolution: -> out of date status: open -> closed ___ Python tracker <http://bugs.python.org/i

[issue5023] Segfault in datetime.time.strftime("%z")

2012-09-06 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- status: pending -> closed ___ Python tracker <http://bugs.python.org/issue5023> ___ ___ Python-bugs-list mailing list Un

[issue15881] multiprocessing 'NoneType' object is not callable

2012-09-07 Thread Alexander Belopolsky
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

[issue15884] PEP 3121, 384 Refactoring applied to ctypes module

2012-09-08 Thread Alexander Belopolsky
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

[issue15787] PEP 3121 Refactoring

2012-09-08 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- dependencies: +PEP 3121, 384 Refactoring applied to ctypes module ___ Python tracker <http://bugs.python.org/issue15

[issue15848] PEP 3121, 384 Refactoring applied to xxsubtype module

2012-09-08 Thread Alexander Belopolsky
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

[issue15873] "datetime" cannot parse ISO 8601 dates and times

2012-09-09 Thread Alexander Belopolsky
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

[issue15873] "datetime" cannot parse ISO 8601 dates and times

2012-09-09 Thread Alexander Belopolsky
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

[issue15873] "datetime" cannot parse ISO 8601 dates and times

2012-09-09 Thread Alexander Belopolsky
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

[issue15881] multiprocessing 'NoneType' object is not callable

2012-09-09 Thread Alexander Belopolsky
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

[issue15390] PEP 3121, 384 refactoring applied to datetime module

2012-09-09 Thread Alexander Belopolsky
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

[issue15695] Correct __sizeof__ support for StgDict

2012-09-09 Thread Alexander Belopolsky
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

[issue15725] PyType_FromSpecWithBases bugfix

2012-09-09 Thread Alexander Belopolsky
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

[issue15727] PyType_FromSpecWithBases tp_new bugfix

2012-09-09 Thread Alexander 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

[issue15873] "datetime" cannot parse ISO 8601 dates and times

2012-09-09 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- assignee: -> belopolsky ___ Python tracker <http://bugs.python.org/issue15873> ___ ___ Python-bugs-list mailing list Un

[issue15390] PEP 3121, 384 refactoring applied to datetime module

2012-09-10 Thread Alexander Belopolsky
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

[issue15941] Time module: effect of time.timezone change

2012-09-13 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Isn't this a duplicate of issue 8810? -- ___ Python tracker <http://bugs.python.org/issue15941> ___ ___ Python-bugs-l

[issue15941] Time module: effect of time.timezone change

2012-09-13 Thread Alexander Belopolsky
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

[issue15941] Time module: effect of time.timezone change

2012-09-13 Thread Alexander Belopolsky
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

[issue15973] Segmentation fault on timezone comparison

2012-09-19 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- assignee: ronaldoussoren -> belopolsky ___ Python tracker <http://bugs.python.org/issue15973> ___ ___ Python-bugs-list mai

[issue15973] Segmentation fault on timezone comparison

2012-09-19 Thread Alexander Belopolsky
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

[issue15975] Allow multiplying timedelta by Decimal

2012-09-19 Thread Alexander Belopolsky
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.

[issue15975] Allow multiplying timedelta by Decimal

2012-09-19 Thread Alexander Belopolsky
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

[issue14262] Allow using decimals as arguments to `timedelta`

2012-09-19 Thread Alexander Belopolsky
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.

[issue14262] Allow using decimals as arguments to `timedelta`

2012-09-19 Thread Alexander Belopolsky
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

[issue14262] Allow using decimals as arguments to `timedelta`

2012-09-19 Thread Alexander Belopolsky
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

[issue14262] Allow using decimals as arguments to `timedelta`

2012-09-19 Thread Alexander Belopolsky
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

[issue14262] Allow using decimals as arguments to `timedelta`

2012-09-19 Thread Alexander Belopolsky
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

[issue15973] Segmentation fault on timezone comparison

2012-09-19 Thread Alexander Belopolsky
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

[issue15973] Segmentation fault on timezone comparison

2012-09-19 Thread Alexander Belopolsky
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

[issue15973] Segmentation fault on timezone comparison

2012-09-20 Thread Alexander Belopolsky
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

[issue15973] Segmentation fault on timezone comparison

2012-09-20 Thread Alexander Belopolsky
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

[issue16066] Truncated POST data in CGI script on Windows 7

2012-09-27 Thread Alexander Martin
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

[issue16066] Truncated POST data in CGI script on Windows 7

2012-09-28 Thread Alexander Martin
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

[issue9650] format codes in time.strptime docstrings

2012-10-02 Thread Alexander Belopolsky
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

[issue9650] format codes in time.strptime docstrings

2012-10-02 Thread Alexander Belopolsky
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.

[issue16164] there is no easy way to force unittest.main to use stdout rather than stderr

2012-10-08 Thread Alexander Belchenko
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.

[issue16243] Regression in inspect module

2012-10-15 Thread Alexander Belopolsky
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

[issue16243] Regression in inspect module

2012-10-15 Thread Alexander Belopolsky
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

[issue6478] time.tzset does not reset _strptime's locale time cache

2012-10-26 Thread Alexander Belopolsky
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

[issue20849] add exist_ok to shutil.copytree

2014-03-15 Thread Alexander Mohr
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

[issue20849] add exist_ok to shutil.copytree

2014-03-18 Thread Alexander Mohr
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

[issue1100942] Add datetime.time.strptime and datetime.date.strptime

2014-04-03 Thread Alexander Belopolsky
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

[issue1100942] Add datetime.time.strptime and datetime.date.strptime

2014-04-04 Thread Alexander Belopolsky
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.

[issue21176] Implement matrix multiplication operator (PEP 465)

2014-04-07 Thread Alexander Belopolsky
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

[issue21176] Implement matrix multiplication operator (PEP 465)

2014-04-07 Thread Alexander Belopolsky
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

[issue21176] Implement matrix multiplication operator (PEP 465)

2014-04-07 Thread Alexander Belopolsky
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

[issue21176] Implement matrix multiplication operator (PEP 465)

2014-04-07 Thread Alexander Belopolsky
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

[issue21176] Implement matrix multiplication operator (PEP 465)

2014-04-07 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: + .. versionadded:: 3.4 Are you planning to use the time machine? :-) -- ___ Python tracker <http://bugs.python.org/issue21

[issue19414] iter(ordered_dict) yields keys not in dict in some circumstances

2014-04-12 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- nosy: +belopolsky ___ Python tracker <http://bugs.python.org/issue19414> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue21414] Add an intersperse function to itertools

2014-05-02 Thread Alexander Boyd
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

[issue21221] Minor struct_time documentation bug

2014-05-10 Thread Alexander Belopolsky
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

[issue11313] Speed up default encode()/decode()

2012-11-03 Thread Alexander Belopolsky
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

[issue5288] tzinfo objects with sub-minute offsets are not supported (e.g. UTC+05:53:28)

2012-11-03 Thread Alexander Belopolsky
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

[issue1100942] Add datetime.time.strptime and datetime.date.strptime

2012-11-03 Thread Alexander Belopolsky
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

[issue6478] time.tzset does not reset _strptime's locale time cache

2012-11-04 Thread Alexander Belopolsky
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

[issue16137] Using time.asctime() with an array with negative tm_hour causes Python Crash.

2012-11-18 Thread Alexander Belopolsky
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

[issue16564] email.generator.BytesGenerator fails with bytes payload

2012-11-27 Thread Alexander Kruppa
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

[issue16818] Couple of mistakes in PEP 431

2013-01-01 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- nosy: +belopolsky ___ Python tracker <http://bugs.python.org/issue16818> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue16837] Number ABC can be instantiated

2013-01-01 Thread Alexander Belopolsky
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

[issue16837] Number ABC can be instantiated

2013-01-02 Thread Alexander Belopolsky
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

[issue10572] Move test sub-packages to Lib/test

2013-01-10 Thread Alexander Belopolsky
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

[issue2267] datetime.datetime operator methods are not subclass-friendly

2013-01-12 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- resolution: -> wont fix status: open -> closed ___ Python tracker <http://bugs.python.org/issue2267> ___ ___ Pyth

[issue16137] Using time.asctime() with an array with negative tm_hour causes Python Crash.

2013-02-04 Thread Alexander Belopolsky
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

[issue19065] sqlite3 timestamp adapter chokes on timezones

2013-09-22 Thread Alexander Belopolsky
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

[issue1820] Enhance Object/structseq.c to match namedtuple and tuple api

2013-09-22 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: See also #5907. -- ___ Python tracker <http://bugs.python.org/issue1820> ___ ___ Python-bugs-list mailing list Unsub

[issue1507011] Use a set to keep interned strings

2013-10-09 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- superseder: -> Use a set for interned strings ___ Python tracker <http://bugs.python.org/issue1507011> ___ ___ Python-

[issue19187] Use a set for interned strings

2013-10-09 Thread Alexander Belopolsky
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

[issue19187] Use a set for interned strings

2013-10-09 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: The first reference above should have been to #1507011. -- ___ Python tracker <http://bugs.python.org/issue19187> ___ ___

[issue19187] Use a set for interned strings

2013-10-09 Thread Alexander Belopolsky
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

[issue19213] platform.linux_distribution detects Oracle Linux as Red Hat Enterprise Linux

2013-10-09 Thread Alexander Boyd
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', 

[issue19213] platform.linux_distribution detects Oracle Linux as Red Hat Enterprise Linux

2013-10-16 Thread Alexander Boyd
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

[issue19266] Rename contextlib.ignore to contextlib.suppress

2013-10-16 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- dependencies: +Add context manager for the "try: ... except: pass" pattern ___ Python tracker <http://bugs.python.o

[issue15806] Add context manager for the "try: ... except: pass" pattern

2013-10-16 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- superseder: -> Rename contextlib.ignore to contextlib.suppress ___ Python tracker <http://bugs.python.org/issu

[issue19266] Rename contextlib.ignore to contextlib.suppress

2013-10-16 Thread Alexander Belopolsky
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

[issue19266] Rename contextlib.ignore to contextlib.suppress

2013-10-16 Thread Alexander Belopolsky
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

[issue19266] Rename contextlib.ignore to contextlib.suppress

2013-10-16 Thread Alexander Belopolsky
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

<    19   20   21   22   23   24   25   26   27   28   >