[issue4223] inspect.getsource doesn't work on functions imported from a zipfile

2008-10-28 Thread Alexander Belopolsky
Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: Hmm, apparently inspect was made to work with zipped modules back in r45248 . I cannot reproduce the problem either. Jean-Paul, can you attach your foobar.zip? What else do you have in your /tmp dir

[issue4223] inspect.getsource doesn't work on functions imported from a zipfile

2008-10-28 Thread Alexander Belopolsky
Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: Thanks, Jean-Paul, I can now reproduce your problem and I think I found the culprit. I believe the file name check in linecache.updatecache is unnecessary and is responsible for this problem. With the following patch: -

[issue4216] subprocess.Popen hangs at communicate() when child exits

2008-10-28 Thread Alexander Belopolsky
Changes by Alexander Belopolsky <[EMAIL PROTECTED]>: -- nosy: +belopolsky ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue4216> ___ _

[issue4220] Builtins treated as free variables?

2008-10-28 Thread Alexander Belopolsky
Changes by Alexander Belopolsky <[EMAIL PROTECTED]>: -- nosy: +belopolsky ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue4220> ___ _

[issue3166] Make conversions from long to float correctly rounded.

2008-11-06 Thread Alexander Belopolsky
Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: Mark, I noticed that you replaced a call to _PyLong_AsScaledDouble with your round to nearest algorithm. I wonder if _PyLong_AsScaledDouble itself would benefit from your change. Currently it is used in PyLong_AsDoubl

[issue1429539] pdb: fix for 1326406 (import __main__ pdb failure)

2008-11-07 Thread Alexander Belopolsky
Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: I am not sure whether it is appropriate to comment on a closed issue, but if the tracker will take this comment, hopefully it will find the right audience. I have recently stumbled on this bug running python 2.5. While trackin

[issue1545463] New-style classes fail to cleanup attributes

2008-11-10 Thread Alexander Belopolsky
Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: amaury> What if PyGC_Collect() is called just before? That would work. With the following patch: === --- Python/import.c (revision 67183) +++ Python

[issue1545463] New-style classes fail to cleanup attributes

2008-11-10 Thread Alexander Belopolsky
Changes by Alexander Belopolsky <[EMAIL PROTECTED]>: -- versions: +Python 2.5.3, Python 2.6, Python 2.7 ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.o

[issue1673409] datetime module missing some important methods

2008-11-11 Thread Alexander Belopolsky
Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: Chris> I keep needing to know the number of seconds that a timedelta Chris> represents. I propose an alternative approach that I believe will neatly solve fractional vs. whole seconds and multitude of conceivable toxxx met

[issue4111] Add DTrace probes

2008-11-12 Thread Alexander Belopolsky
Changes by Alexander Belopolsky <[EMAIL PROTECTED]>: -- nosy: +belopolsky ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue4111> ___ _

[issue1699259] replacing char* with const char* in sysmodule.c/.h

2008-11-12 Thread Alexander Belopolsky
Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: The patch no longer applies to trunk, but that would be trivial to fix. Changes like these have been accepted with little resistance in the past (see e.g. issue651362), so I don't see why this patch has been pending f

[issue1699259] replacing char* with const char* in sysmodule.c/.h

2008-11-13 Thread Alexander Belopolsky
Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: The new patch looks fine to me. It applies and compiles without warnings and the changes are now reflected in the docs. I guess someone would need to write a NEWS entry because it is a public API change, but otherwise I would

[issue1699259] replacing char* with const char* in sysmodule.c/.h

2008-11-13 Thread Alexander Belopolsky
Changes by Alexander Belopolsky <[EMAIL PROTECTED]>: -- nosy: +jhylton ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1699259> ___ _

[issue1699259] replacing char* with const char* in sysmodule.c/.h

2008-11-13 Thread Alexander Belopolsky
Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: While technically this is an API change, in reality it is unlikely to break anyone's code because you can always pass char * to a function that expects const char* and the ABI does not change. (Also I cannot think why a

[issue1673409] datetime module missing some important methods

2008-11-14 Thread Alexander Belopolsky
Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: I was going to say the same as Amaury: timedelta / timedelta is dimensionless (time units cancel each other in division) and the advantage of this notation is that you get a way to express timedelta.toxxx for all units accep

[issue2706] datetime: define division timedelta/timedelta

2008-11-14 Thread Alexander Belopolsky
Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: I attaching webograph's patch updated to revision 67223 where I added a few tests. I am +1 on the floor divide changes (allowing timedelta // timedelta), but I am not sure how true division should work if at all. For t

[issue2706] datetime: define division timedelta/timedelta

2008-11-14 Thread Alexander Belopolsky
Changes by Alexander Belopolsky <[EMAIL PROTECTED]>: -- nosy: +amaury.forgeotdarc, jribbens versions: +Python 2.7, Python 3.1 ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.pytho

[issue2706] datetime: define division timedelta/timedelta

2008-11-14 Thread Alexander Belopolsky
Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: On Fri, Nov 14, 2008 at 12:51 PM, STINNER Victor <[EMAIL PROTECTED]> wrote: > > STINNER Victor <[EMAIL PROTECTED]> added the comment: > > Why not also implementing divmod()? It's useful to split a ti

[issue2706] datetime: define division timedelta/timedelta

2008-11-14 Thread Alexander Belopolsky
Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: Also, why not >>> divmod(timedelta(3), 2) (datetime.timedelta(1), datetime.timedelta(1)) ? And where do we stop? :-) On Fri, Nov 14, 2008 at 1:02 PM, Alexander Belopolsky <[EMAIL PROTECTED]> wrote: > On Fri,

[issue2706] datetime: define division timedelta/timedelta

2008-11-14 Thread Alexander Belopolsky
Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: While I agree that divmod may be useful, your particular use case is not convincing. The same can be done easier without divmod: def formatTimedelta(delta): return "{0}h {1}min {2}sec".format(*str(delta).split(&

[issue2706] datetime: define division timedelta/timedelta

2008-11-14 Thread Alexander Belopolsky
Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: On Fri, Nov 14, 2008 at 1:28 PM, STINNER Victor <[EMAIL PROTECTED]> wrote: .. > What do you think about: > timedelta / # only with __future__.divison > timedelta // > timedelta % > divmod(timedelta, )

[issue2706] datetime: define division timedelta/timedelta

2008-11-14 Thread Alexander Belopolsky
Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: Oops, the tracker ate some lines from e-mail. Reposting through the web: On Fri, Nov 14, 2008 at 1:28 PM, STINNER Victor <[EMAIL PROTECTED]> wrote: .. > What do you think about: > timedelta / # only with

[issue2706] datetime: define division timedelta/timedelta

2008-11-14 Thread Alexander Belopolsky
Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: haypo> How? I don't understand your suggestion. Sorry, another case of mail to tracker bug. Here is what I wrote: """ .. you can convert delta to time using an arbitrary anchor date and extract hms that

[issue2736] datetime needs and "epoch" method

2008-11-14 Thread Alexander Belopolsky
Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: I would like to voice my opposition the totimestamp method. Representing time as a float is a really bad idea (originated at Microsoft as I have heard). In addition to the usual numeric problems when dealing with the floating

[issue2736] datetime needs and "epoch" method

2008-11-14 Thread Alexander Belopolsky
Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: On Fri, Nov 14, 2008 at 8:37 PM, STINNER Victor <[EMAIL PROTECTED]> wrote: > .. but we can create new methods like: > datetime.fromepoch(seconds, microseconds=0)# (int/long, int) While 1970 is the most popula

[issue2706] datetime: define division timedelta/timedelta

2008-11-15 Thread Alexander Belopolsky
Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: On Sat, Nov 15, 2008 at 5:08 AM, Mark Dickinson <[EMAIL PROTECTED]> wrote: > > Mark Dickinson <[EMAIL PROTECTED]> added the comment: > >> timedelta / should be disallowed in true division mode. > &g

[issue4291] Allow Division of datetime.timedelta Objects

2008-11-15 Thread Alexander Belopolsky
Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: @Christian Adding a __float__ method to datetime was entertained back in 2003, but was rejected. The same reasons apply to timedelta: """ - A C double doesn't have enough precision for roundtrip guarantees.

[issue2736] datetime needs and "epoch" method

2008-11-24 Thread Alexander Belopolsky
Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: On Mon, Nov 24, 2008 at 9:04 AM, David Fraser <[EMAIL PROTECTED]> wrote: ... > The point for me is that having to interact with Microsoft systems that > require times means that the conversions have to be done.

[issue2736] datetime needs and "epoch" method

2008-11-24 Thread Alexander Belopolsky
Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: That's an impressive summary, but what is your conclusion? I don't see any format that will benefit from a subsecond timedelta.totimestamp(). Your examples have either multisecond or submicrosecond resolution. On Mon,

[issue2736] datetime needs and "epoch" method

2008-11-24 Thread Alexander Belopolsky
Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: On Mon, Nov 24, 2008 at 12:13 PM, STINNER Victor <[EMAIL PROTECTED]> wrote: .. > Hum, it's maybe not possible to choose between integer and float. Why > not supporting both? Example: > - totimestamp()-&

[issue2736] datetime needs and "epoch" method

2008-11-24 Thread Alexander Belopolsky
Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: On Mon, Nov 24, 2008 at 12:34 PM, STINNER Victor <[EMAIL PROTECTED]> wrote: .. >> I would still prefer totimestamp()->(int, int) returning (sec, usec) >> tuple. The important benefit is that such toti

[issue4335] inspect.getsourcelines ignores last line in module

2008-12-02 Thread Alexander Belopolsky
Changes by Alexander Belopolsky <[EMAIL PROTECTED]>: -- nosy: +belopolsky ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue4335> ___ _

[issue4331] Can't use _functools.partial() created function as method

2008-12-02 Thread Alexander Belopolsky
Changes by Alexander Belopolsky <[EMAIL PROTECTED]>: -- nosy: +belopolsky ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue4331> ___ _

[issue4201] Pdb cannot access source code in zipped packages.

2008-12-03 Thread Alexander Belopolsky
Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: No, I only used __main__.py to make it easy to reproduce the problem. Pdb will not be able to access code in any module with a custom __loader__. For example, if you move f() to foo.py inside test.zip and import it from __main_

[issue4201] Pdb cannot access source code in zipped packages.

2008-12-03 Thread Alexander Belopolsky
Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: Off-topic: How to report a bug tracker bug? The e-mail I sent in response to Nick's post started with: """ On Wed, Dec 3, 2008 at 3:51 PM, Nick Coghlan <[EMAIL PROTECTED]> wrote: > Just to confir

[issue4512] Add get_filename method to zipimport

2008-12-03 Thread Alexander Belopolsky
New submission from Alexander Belopolsky <[EMAIL PROTECTED]>: >From issue4197: """ runpy needs a non-standard PEP 302 extension to set __file__ correctly in the modules it runs. The pkgutil stuff it uses to find pure Python modules in the filesystem supports that

[issue4197] Doctest module does not work with zipped packages

2008-12-03 Thread Alexander Belopolsky
Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: I created issue4512 to implement get_filename extension in zipimport. Will post a patch shortly. ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.pytho

[issue4512] Add get_filename method to zipimport

2008-12-03 Thread Alexander Belopolsky
Changes by Alexander Belopolsky <[EMAIL PROTECTED]>: -- nosy: +ncoghlan ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue4512> ___ __

[issue4512] Add get_filename method to zipimport

2008-12-03 Thread Alexander Belopolsky
Changes by Alexander Belopolsky <[EMAIL PROTECTED]>: -- keywords: +patch Added file: http://bugs.python.org/file12214/zipimport.patch ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.pytho

[issue4512] Add get_filename method to zipimport

2008-12-03 Thread Alexander Belopolsky
Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: I have attached a rough patch implementing the get_filename. I deliberately copied code from get_source method that finds the filename inside the zip archive and simply prefixed that with the archive path. I could not fi

[issue4082] __main__.__file__ not set correctly when -m switch gets __main__ from a zipfile

2008-12-03 Thread Alexander Belopolsky
Changes by Alexander Belopolsky <[EMAIL PROTECTED]>: -- nosy: +belopolsky ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue4082> ___ _

[issue4082] __main__.__file__ not set correctly when -m switch gets __main__ from a zipfile

2008-12-03 Thread Alexander Belopolsky
Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: See issue4512 ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue4082> ___ __

[issue4197] Doctest module does not work with zipped packages

2008-12-03 Thread Alexander Belopolsky
Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: While the patch at issue4512 fixes the crash, it does not fix the line number issue. I would prefer to start with doctest-1.patch like solution because changing the PEP 302 loader protocol by adding get_filename needs addi

[issue4335] inspect.getsourcelines ignores last line in module

2008-12-08 Thread Alexander Belopolsky
Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: In order to reproduce the reported problem I had to conjure the attached repro.py which is missing '\n' on the last line. I need to double check the language definition, but I feel this is not a bug because a file t

[issue4335] inspect.getsourcelines ignores last line in module

2008-12-08 Thread Alexander Belopolsky
Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: According to my understanding of http://docs.python.org/reference/lexical_analysis.html#id1 a newline character is required at the end of the python file. ___ Python tracker <[EMAIL

[issue4335] inspect.getsourcelines ignores last line in module

2008-12-08 Thread Alexander Belopolsky
Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: Rafe, Can you confirm that behavior on missing end-of-line is indeed your issue? Note that at first I could not even reproduce the problem based on your report. I am attaching a proof-of-concept patch that would arguably i

[issue4335] inspect.getsourcelines ignores last line in module

2008-12-09 Thread Alexander Belopolsky
Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: Just to add to the list of getsource quirks: with the following in x.py, f = lambda: 0 \ [EOF] >>> import inspect, x; inspect.getsource(x.f) Traceback (most recent call last): .. tokenize.TokenError: ('EOF in multi

[issue3166] Make conversions from long to float correctly rounded.

2008-12-09 Thread Alexander Belopolsky
Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: On Tue, Dec 9, 2008 at 11:02 AM, Mark Dickinson <[EMAIL PROTECTED]> wrote: ... > If your Intel machine is Pentium 4 or newer, you can get > around this by using the SSE2 extensions, which work with 64-bit doubles >

[issue4335] inspect.getsourcelines ignores last line in module

2008-12-09 Thread Alexander Belopolsky
Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: You convinced me. After all, if python interpreter does not complain about missing end-of-line and processes the unterminated line, getsource should report it. Here is a patch that passes existing tests and adds a "NoEOF

[issue3166] Make conversions from long to float correctly rounded.

2008-12-09 Thread Alexander Belopolsky
Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: .. > The idea's attractive. The problem is finding an integer type that's > guaranteed to have enough bits to store the mantissa for the float > (probably plus one or two bits more for comfort); for IEEE

[issue3166] Make conversions from long to float correctly rounded.

2008-12-09 Thread Alexander Belopolsky
Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: On Tue, Dec 9, 2008 at 12:39 PM, Mark Dickinson <[EMAIL PROTECTED]> wrote: .. > What would using Python's integer type solve, that isn't already solved by > the patch? > Speaking for myself, it would a

[issue4580] slicing of memoryviews when itemsize != 1 is wrong

2008-12-10 Thread Alexander Belopolsky
Changes by Alexander Belopolsky <[EMAIL PROTECTED]>: -- nosy: +belopolsky ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue4580> ___ _

[issue887237] Machine integers

2008-12-10 Thread Alexander Belopolsky
Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: > I wonder if a patch for ctypes like this (which is not yet complete) > could be used to implement this, or MUST it be implemented in C? For the intended purpose of giving access to raw machine arithmetics, I wou

[issue887237] Machine integers

2008-12-10 Thread Alexander Belopolsky
Changes by Alexander Belopolsky <[EMAIL PROTECTED]>: Added file: http://bugs.python.org/file12323/ctypes-numbermixins-1.patch ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.

[issue3999] Real segmentation fault handler

2008-12-10 Thread Alexander Belopolsky
Changes by Alexander Belopolsky <[EMAIL PROTECTED]>: -- nosy: +belopolsky ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3999> ___ _

[issue4197] Doctest module does not work with zipped packages

2008-12-14 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Nick, Your commit does not fix the line number reporting from doctest failures: $ ./python.exe testmodule.zip ** File "testmodule.zip/__main__.py", line ?, in __main__.c ...

[issue4657] Doctest gets line numbers wrongs with <> in name

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

[issue1706039] Added clearerr() to clear EOF state

2008-12-23 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I've combined Scott's patch with John's (?) test case in issue1706039.diff. Confirmed that the patch fixes the issue on Mac OS X 10.5.6 (Intel). Added file: http://bugs.python.org/file12434/is

[issue1706039] Added clearerr() to clear EOF state

2008-12-23 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Maybe not a problem, but an inconsistency: in Py_UniversalNewlineFgets clearerr is added inside univ_newline conditional and then again before the loop over characters, but in Py_UniversalNewlineFread it is added only once before "i

[issue4805] Make python code compilable with a C++ compiler

2009-01-01 Thread Alexander Belopolsky
New submission from Alexander Belopolsky : I am posting this patch mainly to support python-dev discussion on this topic. In the past (see r45330) it was possible to compile python core and standard library modules using a C++ compiler. According to Martin v. Löwis (issue4665), "It&#x

[issue4805] Make python code compilable with a C++ compiler

2009-01-01 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: A related question discussed on python-dev is whether extern "C" {} wrappers should ever be used in .c files. I argue that the answer is "no" even if C++ compilability is desired. The new patch eliminates several uses of exter

[issue4805] Make python code compilable with a C++ compiler

2009-01-02 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Fri, Jan 2, 2009 at 10:54 AM, Marc-Andre Lemburg wrote: > > Marc-Andre Lemburg added the comment: > > Also note that by removing the extern "C" declarations, you not only > change the exported symbol names of functions, but

[issue4805] Make python code compilable with a C++ compiler

2009-01-02 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : Added file: http://bugs.python.org/file12560/c++-patch-2.diff ___ Python tracker <http://bugs.python.org/issue4805> ___ ___ Python-bug

[issue4805] Make python code compilable with a C++ compiler

2009-01-02 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : Removed file: http://bugs.python.org/file12530/c++-patch-1.diff ___ Python tracker <http://bugs.python.org/issue4805> ___ ___ Python-bug

[issue4846] Py_UNICODE_ISSPACE causes linker error

2009-01-05 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I believe attached issue4846.diff should fix the problem, but I don't have access to the affected platform (Windows?), so I did not test it. I also wonder whether it would be more appropriate to redefine PyAPI_* macros to declare API symbols

[issue4805] Make python code compilable with a C++ compiler

2009-01-05 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Mon, Jan 5, 2009 at 11:43 AM, Marc-Andre Lemburg wrote: .. >> GCC doesn't appear to do so, but there's no guarantee that other >> C++ compilers won't touch these symbols: >> >> http://en.wikipedia.org/wiki/

[issue4846] Py_UNICODE_ISSPACE causes linker error

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

[issue4846] Py_UNICODE_ISSPACE causes linker error

2009-01-05 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Not that it would matter on a two-line patch, but I find it useful to add myself to the "nosy" list without any comments as so as I find the issue interesting even if I have nothing to contribute at the moment. This way I am more likely to n

[issue4850] Change type and add _Py_ prefix to COUNT_ALLOCS variables

2009-01-05 Thread Alexander Belopolsky
New submission from Alexander Belopolsky : quick_int_allocs, quick_neg_int_allocs, tuple_zero_allocs, and fast_tuple_allocs are exported in -DCOUNT_ALLOCS builds. They should get a conventional _Py_ prefix. Also since tp_allocs is now Py_ssize_t, these should be redefined as Py_ssize_t as

[issue4805] Make python code compilable with a C++ compiler

2009-01-05 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Mon, Jan 5, 2009 at 2:58 PM, Marc-Andre Lemburg wrote: .. > For completeness, all exported symbols in Python should have a _Py_ > prefix, even if they only get exported in certain debug builds. > I actually agree, but I felt that doing this

[issue4850] Change type and add _Py_ prefix to COUNT_ALLOCS variables

2009-01-05 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Attached patch is fairly straightforward with only one caveat: instead of prefixing unlist_types_without_objects flag with _Py_, I made it static. This may not be the right thing if it is intended to be accessible from third party modules (it is not

[issue4819] Misc/cheatsheet needs updating

2009-01-05 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Some more for both 2. and 3.0: - 'as' is now a keyword - 'with' is now a keyword - @ is now a valid token - 0o for octal and 0b for binary numbers - sets - str.format - BaseException I am sure I missed a lot, but the core languag

[issue4850] Change type and add _Py_ prefix to COUNT_ALLOCS variables

2009-01-05 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Martin, Can you comment on whether unlist_types_without_objects should be global? Svn blame point to you for introducing it. Thanks. $ svn blame Objects/object.c | grep unlist_types_without_objects 45527 martin.v.loewis int

[issue4855] Popen(..., shell=True, ...) should allow simple access to the command's PID

2009-01-06 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: This really belongs to python-list rather than the tracker. It is not correct that with shell=False Popen reuses the thread of control of the calling process. You seem to be confusing blocking and reusing the thread of control. Popen always creates

[issue4850] Change type and add _Py_ prefix to COUNT_ALLOCS variables

2009-01-06 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Tue, Jan 6, 2009 at 7:28 AM, Martin v. Löwis wrote: .. > It is not easier, but more difficult. It now requires a change, > whereas leaving things as-is requires no change. I actually agree with Martin on this one. I would not touch this if n

[issue4850] Change type and add _Py_ prefix to COUNT_ALLOCS variables

2009-01-06 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Tue, Jan 6, 2009 at 10:53 AM, Marc-Andre Lemburg wrote: .. > I don't follow you: those symbols are not meant for public use anyway, > so we can easily change them without any "costs". The same goes for any > of the private, bu

[issue3976] pprint._safe_repr is not general enough in one instance

2009-01-06 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: The proposed patch appears to give up sorting by key,value altogether if there are a few incomparable items. It would be better to group items by type and sort within each group. For example, pprint({1:1,2:2,A():3,A():4}) should print int:int items

[issue4850] Change type and add _Py_ prefix to COUNT_ALLOCS variables

2009-01-07 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Wed, Jan 7, 2009 at 4:33 AM, Martin v. Löwis wrote: > > Martin v. Löwis added the comment: > .. Furthermore, they all have names that are > unlikely to collide. Even if they get a _Py_ prefix, there could > still be a conflict. > M

[issue4753] Faster opcode dispatch on gcc

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

[issue4938] Pdb cannot access doctest source in postmortem

2009-01-13 Thread Alexander Belopolsky
New submission from Alexander Belopolsky : With attached x.py: $ cat x.py """ >>> foo() """ def foo(): 1/0 if __name__ == '__main__': import doctest, pdb try: doctest.testmod(raise_on_error=True) except doctest.Unexpecte

[issue4899] doctest should support fixtures

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

[issue4899] doctest should support fixtures

2009-01-13 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: The OP's problem, i.e. the need to reimport modules in every docstring can easily be addressed by injecting the necessary names using extraglobs argument to doctest.testmod(). I like the following trick: def getextraglobs(): import Str

[issue4933] Patch to add preliminary support for Haiku

2009-01-13 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > we decided some time ago to not accept patches for such minority > platforms anymore. I don't have any particular interest in BeOS variants, but this comes as a surprise given that http://python.org/about/ proclaims that "Python

[issue4972] let's equip ftplib.FTP with __enter__ and __exit__

2009-01-19 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: What is the rationale for swallowing all socket exceptions except "Connection reset by peer" in __exit__? In any case, it is better to use errno.ECONNRESET instead of literal 54. Note that SMTP.quit() calls SMTP.close(), so in the normal t

[issue4972] let's equip ftplib.FTP with __enter__ and __exit__

2009-01-19 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Mon, Jan 19, 2009 at 2:01 PM, Tarek Ziadé wrote: > > Tarek Ziadé added the comment: > >> What is the rationale for swallowing all socket exceptions except >> "Connection reset by peer" in __exit__? > > I am catch

[issue4972] let's equip ftplib.FTP with __enter__ and __exit__

2009-01-20 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Please remove the old smtplib.patch: it is confusing to have two attachments with the same name. It will still be available in the history, so nothing will be lost. A nit-pick: 221 is a success code (in smtp 2xx codes are successes and 5xx are errors

[issue15443] datetime module has no support for nanoseconds

2021-04-07 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: @pganssle - let's keep the substantive discussions in the tracker so that they are not lost on github. You wrote: """ what is still blocking / needs to be done on this? Beta freeze for Python 3.10 is coming up at the beginning o

[issue15443] datetime module has no support for nanoseconds

2021-04-07 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Is there high enough demand for nanoseconds in datetime and time instances? How often nanosecond timestamps contain anything other than 0s or garbage in the last three digits? In my experience, all people want to do with such timestamps is to convert

[issue15443] datetime module has no support for nanoseconds

2021-04-07 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > In telemetry, a nanosecond often translates to about a foot and 5 hours gets you to Pluto. Telemetry is exactly an application where absolute timestamps rarely make any sense. -- ___ Python trac

[issue15787] [meta issue] PEP 3121, 384 Refactoring

2021-07-28 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > The work is now tracked at bpo-1635741. Which work? bpo-1635741 does not appear to be a meta-issue and in msg381432 it loops back here. -- versions: +Python 3.11 -Python 3.4 ___ Python tracker <

[issue15870] PyType_FromSpec should take metaclass as an argument

2021-07-28 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I'll reopen this issue to resume the discussion. The motivating case - PEP 3121 refactoring of the ctypes module - is still open. See bpo-15884. -- resolution: rejected -> stage: resolved -> patch review status: closed ->

[issue44831] Inconsistency between datetime.now() and datetime.fromtimestamp(time.time(), None)

2021-08-06 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Can someone try to replicate this while disabling the C acceleration: import sys sys.modules[‘_datetime’] = None (Before any other imports.) If anything, this is likely to be a problem with the C implementation

[issue30155] Add ability to get/set tzinfo on datetime instances in C API

2019-12-09 Thread Alexander Belopolsky
Change by Alexander Belopolsky : -- dependencies: +Add timezone support to datetime C API ___ Python tracker <https://bugs.python.org/issue30155> ___ ___ Pytho

[issue39680] datetime.astimezone() method does not handle invalid local times as required by PEP 495

2020-02-18 Thread Alexander Belopolsky
New submission from Alexander Belopolsky : Let g be a an invalid time in New York spring-forward gap: >>> g = datetime(2020, 3, 8, 2, 30) According to PEP 495, conversion of such instance to UTC should return a value that corresponds to a valid local time greater than g, but

[issue26460] datetime.strptime without a year fails on Feb 29

2020-03-02 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > On Mar 2, 2020, at 6:33 PM, Gregory P. Smith wrote: > > Change that default to any old year with a leap year (1904?) In the 21st century, the year 2000 default makes much more sense than 1900. Luckily 2000 is also a

[issue39970] Combined behavior of datetime.datetime.timestamp() and datetime.datetime.utcnow() on non-UTC timezoned machines

2020-03-15 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I am sure this has been reported before – I will try to find the relevant issue. This behavior is correct and documented. The only improvement that we can consider is to make it more explicit that utcnow is deprecated and the correct way to obtain

[issue39970] Combined behavior of datetime.datetime.timestamp() and datetime.datetime.utcnow() on non-UTC timezoned machines

2020-03-15 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: This is a duplicate of issue 33293. -- superseder: -> Using datetime.datetime.utcnow().timestamp() in Python3.6.0 can't get correct UTC timestamp. ___ Python tracker <https://bugs.python.org

[issue39970] Combined behavior of datetime.datetime.timestamp() and datetime.datetime.utcnow() on non-UTC timezoned machines

2020-03-15 Thread Alexander Belopolsky
Change by Alexander Belopolsky : -- resolution: wont fix -> duplicate ___ Python tracker <https://bugs.python.org/issue39970> ___ ___ Python-bugs-list mai

[issue41904] datetime.datetime.today makes no sense and should be removed

2020-10-14 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I agree that having some of datetime.now([tz]) functionality replicated in datetime.today() makes little sense. However, the presence of this method in datetime class is a consequence of datetime being a subclass of the date class. The latter was a

[issue41904] datetime.datetime.today makes no sense and should be removed

2020-10-14 Thread Alexander Belopolsky
Change by Alexander Belopolsky : -- resolution: -> wont fix stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

<    11   12   13   14   15   16   17   18   19   20   >