[issue20402] List comprehensions should be noted in for loop documentation

2014-08-02 Thread Alexander Grigorievskiy
Alexander Grigorievskiy added the comment: I have added some clarification following Westley Martínez recommendation. I provided references to the list comprehensions and generator expressions. I tried to make the description short. -- keywords: +patch nosy: +AlexGrig Added file: http

[issue22183] datetime.timezone methods require datetime object

2014-08-11 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: As David explained, utcoffset() method signature is dictated by the base class. This is not a bug. -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python track

[issue22203] inspect.getargspec() returns wrong spec for builtins

2014-08-14 Thread Alexander Schepanovski
New submission from Alexander Schepanovski: inspect.getargspec() returns empty ArgSpec for map() and filter(): >>> import inspect >>> inspect.getargspec(map) ArgSpec(args=[], varargs=None, keywords=None, defaults=None) >>> inspect.getargspec(filter)

[issue22224] docs.python.org is prone to political blocking in Russia

2014-08-18 Thread Alexander Patrakov
New submission from Alexander Patrakov: I could not access http://docs.python.org/ from work today. Upon investigation, it appears that the ISP has blocked all sites on the IP address 185.31.17.175, because of the court order unrelated to docs.python.org. Many other ISPs in Russia also don&#

[issue22224] docs.python.org is prone to political blocking in Russia

2014-08-20 Thread Alexander Patrakov
Alexander Patrakov added the comment: The site is now accessible. But this case is going to repeat itself. -- ___ Python tracker <http://bugs.python.org/issue22

[issue22241] strftime/strptime round trip fails even for UTC datetime object

2014-08-21 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: This is a duplicate of #15873. -- components: +Extension Modules resolution: -> duplicate status: open -> closed superseder: -> datetime: add ability to parse RFC 3339 dates and times type: behavior -> enhancement versions:

[issue22241] strftime/strptime round trip fails even for UTC datetime object

2014-08-21 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I see. I thought you were complaining about "%z" format not supporting "00:00" as in >>> from datetime import * >>> datetime.strptime("00:00","%z") Traceback (most recent call last): .. Val

[issue22241] strftime/strptime round trip fails even for UTC datetime object

2014-08-21 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: See also <http://bugs.python.org/issue5094#msg106476>. It looks like providing 'UTC' as the name of utc singleton was part of my original proposal. I have no recollection on why it was not implemented that way. -- nos

[issue22241] strftime/strptime round trip fails even for UTC datetime object

2014-08-21 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Akira, I see that you participated in the original discussion (msg107608). We settled on str(timezone.utc) == 'UTC+00:00' and this was clearly a deliberate choice. I don't think we can revisit this now, but we can probably make strptim

[issue22249] Possibly incorrect example is given for socket.getaddrinfo()

2014-08-22 Thread Alexander Patrakov
New submission from Alexander Patrakov: See the example at https://docs.python.org/2/library/socket.html#socket.getaddrinfo >>> socket.getaddrinfo("www.python.org", 80, 0, 0, socket.SOL_TCP) As I am primarily a C programmer, it is quite surprising for me to see a SOL_* be

[issue16095] urllib2 failing with squid proxy and digest authentication

2014-09-15 Thread Alexander Weidinger
Alexander Weidinger added the comment: So, I analyzed the error and I think I found the problem. (urllib.request - Python 3.5.0) It all starts with l. 1079, as the 407 error gets handled, everything ok here, in l. 1081 http_error_auth_reqed(...) gets executed. So next, we are in l. 939, also

[issue22426] strptime accepts the wrong '2010-06-01 MSK' string but rejects the right '2010-06-01 MSD'

2014-09-16 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: There is no daylight savings time in Moscow and python detects this correctly: $ TZ=Europe/Moscow python3 >>> import time >>> time.daylight 0 Note that historically, there was DST, but time module cannot handle historical TZ

[issue22426] strptime accepts the wrong '2010-06-01 MSK' string but rejects the right '2010-06-01 MSD'

2014-09-16 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I don't think there is anything we can do here. Without a TZ database, Python has to rely on time.tzname which in case of TZ=Europe/Moscow returns >>> time.tzname ('MSK', 'MSK') Hardcoding a timezones dictionary as d

[issue22426] strptime accepts the wrong '2010-06-01 MSK' string but rejects the right '2010-06-01 MSD'

2014-09-16 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On the second thought, we can probably make the same guesswork as in PyInit_timezone (see Modules/timemodule.c) in time.strptime, but not for the current time, but for the time parsed. -- ___ Python tracker

[issue22426] strptime accepts the wrong '2010-06-01 MSK' string but rejects the right '2010-06-01 MSD'

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

[issue22426] strptime accepts the wrong '2010-06-01 MSK' string but rejects the right '2010-06-01 MSD'

2014-09-16 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- stage: -> needs patch type: behavior -> enhancement versions: -Python 2.7, Python 3.4 ___ Python tracker <http://bugs.python.org/i

[issue22444] Floor divide should return int

2014-09-19 Thread Alexander Belopolsky
New submission from Alexander Belopolsky: PEP 3141 defines floor division as floor(x/y) and specifies that floor() should return int type. Builtin float type has been made part of the PEP 3141 numerical tower, but floor division of two floats still results in a float. See also: * #1656

[issue22445] Memoryviews require more strict contiguous checks then necessary

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

[issue22385] Define a binary output formatting mini-language for *.hex()

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

[issue22444] Floor divide should return int

2014-09-20 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > Is this change compelling enough to break compatibility, > or is it just a matter of purity? According to the PEP 3141, Integer is a subtype of Real, so one should be able to substitute an Integer whenever Real is expected. The reverse is no

[issue22444] Floor divide should return int

2014-09-20 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > However, Scheme returns floats Does Scheme's default integer type support arbitrarily large values? -- ___ Python tracker <http://bugs.python.org

[issue22444] Floor divide should return int

2014-09-20 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > Perhaps it's worth mentioning that several people on Python-ideas > took the opposite view: math.floor() should return a float. I sympathize with the idea that math module functions should return floats. I find it unfortunate that

[issue22444] Floor divide should return int

2014-09-20 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > What should Decimal('1e123456')//1 return? I think Decimal case should be considered separately. Note that unlike float, they are not part of the numerical tower, so PEP 3141 arguments don't apply: >>> isinsta

[issue12006] strptime should implement %V or %u directive from libc

2014-09-22 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I find this footnote somewhat confusing: """ (8) Similar to %U and %W, %V is only used in calculations when the day of the week and the ISO year (%G) are specified when used with the strptime method. """ The existin

[issue12006] strptime should implement %V or %u directive from libc

2014-09-22 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: How was "%Y %V" issue resolved? I don't see any tests for this case. -- ___ Python tracker <http://bugs.pyt

[issue22444] Floor divide should return int

2014-09-22 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: [Raymond] > The current behavior has been around for a long time and is implemented in > several modules including decimal and fractions. No, in the fractions module floor division returns an int: >>> type(Fraction(2) // Fraction(1

[issue22444] Floor divide should return int

2014-09-22 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: [Raymond] > The PEP should be revised to say that floor division is defined to > return a value that is *equal* to an Integral but not place any > restriction on the return type. If we take this route, what float('inf') // 1 and float

[issue22444] Floor divide should return int

2014-09-22 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Mark, Raymond suggested that "The PEP 3141 should be revised to say that floor division is defined to return a value that is *equal* to an Integral". Since nan or inf are not *equal* to any Integral, the current implementation does not compl

[issue22444] Floor divide should return int

2014-09-22 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: skrah> I think both should return inf. What about this case: >>> Decimal('1') // Decimal('-inf') Decimal('-0') >>> 1. // float('-inf') -1.0 -- _

[issue22198] Odd floor-division corner case

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

[issue22198] Odd floor-division corner case

2014-09-22 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I wonder if it would make sense to rewrite float_divmod using the newer POSIX/C99 remquo function. I believe it is designed to compute the exact value of round(x/y), but getting floor instead should not be hard. Its behavior on special values is fully

[issue9104] test.support method for dual-testing accelerated code (fixes test_exceptions and other's pickle testing)

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

[issue12006] strptime should implement %V or %u directive from libc

2014-09-29 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: For future reference, here is the example showing %Y %V ambiguity: >>> date(2013,12,31).strftime('%Y %V %u') '2013 01 2' >>> date(2013,1,1).strftime('%Y %V %u') '2013 01 2' which is resolved by us

[issue12006] strptime should implement %G, %V and %u directives

2014-09-29 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I think we need more tests showing that new directives don't violate strftime - strptime round-trip invariants. -- title: strptime should implement %V or %u directive from libc -> strptime should implement %G, %V and %u di

[issue5979] strptime() gives inconsistent exceptions

2014-09-29 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- resolution: -> wont fix status: open -> closed ___ Python tracker <http://bugs.python.org/issue5979> ___ ___ Pyth

[issue12006] strptime should implement %G, %V and %u directives

2014-09-29 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Documentation should say "new in 3.5". -- ___ Python tracker <http://bugs.python.org/issue12006> ___ ___ Python-b

[issue22486] Add math.gcd()

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

[issue22194] access to cdecimal / libmpdec API

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

[issue17873] _ctypes/libffi missing bits for aarch64 support

2014-09-30 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I don't think fficonfig.py.in is from upstream. -- ___ Python tracker <http://bugs.python.org/issue17873> ___ ___

[issue10384] SyntaxError should contain exact location of the invalid character in identifier

2014-09-30 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: The issue was not fixed. With multiple invisible space characters I can get Python 3.5.0a0 (default:5313b4c0bb6c, Sep 30 2014, 18:55:45) [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.51)] on darwin >>> invalid = None File "",

[issue2382] [Py3k] SyntaxError cursor shifted if multibyte character is in line.

2014-09-30 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: The original problem is still present Python 3.5.0a0 (default:5313b4c0bb6c, Sep 30 2014, 18:55:45) >>> A_I_U_E_O$ = None File "", line 1 A_I_U_E_O$ = None ^ SyntaxError: invalid syntax Replace A_I_U_E_O above with the

[issue17848] can't compile with clang and build a shared lib due to libffi

2014-10-03 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Leon, Are you trying to run compiled python binary before it was installed? If so, this is expected and not specific to clang or libffi. If your issue is something else - please explain how to reproduce it and post the error messages that you see

[issue7830] Flatten nested functools.partial

2014-10-06 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Josh, Would issue7830.diff solve your use-case as is? See msg108980 for the limitations. If so, I don't mind reopening this issue. -- ___ Python tracker <http://bugs.python.org/i

[issue7830] Flatten nested functools.partial

2014-10-06 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I would say that getting "maximum recursion depth exceeded" error from evaluating a deeply nested partial is a bug, but I am not sure we should fix it by flattening partial objects in the constructor or by being smarter at evalu

[issue7830] Flatten nested functools.partial

2014-10-08 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I've updated the patch. -- keywords: +patch Added file: http://bugs.python.org/file36837/issue7830-2.diff ___ Python tracker <http://bugs.python.org/i

[issue19562] Added description for assert statement

2013-12-13 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I am going to reject this. Assert failures should never be seen by users and for a developer "assert 1 <= month <= 12" is as clear as "month must be in 1..12." -- nosy: +belopolsky resolution: -> wont fix stage:

[issue19562] Added description for assert statement

2013-12-13 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: @terry - datetime.py was originally written as a prototype for the C code and many seemingly unpythonic constructs therein are motivated by the desire to ease the translation to C. I would not mind simplifying _DI4Y calculation as you suggest, but

[issue20012] Allow Path.relative_to() to accept non-ancestor paths

2013-12-17 Thread Alexander Boyd
New submission from Alexander Boyd: pathlib.Path.relative_to() blows up when given a path that's not an ancestor of the path on which relative_to is being called: >>> pathlib.Path("/usr/bin").relative_to("/etc") Traceback (most recent call last): File

[issue20048] zipfile's readline() drops data in universal newline mode

2013-12-21 Thread Alexander Belopolsky
New submission from Alexander Belopolsky: This problem happens when I unpack a file from a 200+ MB zip archive as follows: with zipfile.ZipFile(archive) as z: data = b'' with z.open(filename, 'rU') as f: for line in f: data += line I cannot redu

[issue20048] zipfile's readline() drops data in universal newline mode

2013-12-21 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- dependencies: +Add support for bzip2 compression to the zipfile module keywords: +gsoc nosy: +serhiy.storchaka ___ Python tracker <http://bugs.python.org/issue20

[issue20048] zipfile's readline() drops data in universal newline mode

2013-12-21 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- keywords: +3.2regression -gsoc nosy: +alanmcintyre ___ Python tracker <http://bugs.python.org/issue20048> ___ ___ Python-bug

[issue20048] zipfile's readline() drops data in universal newline mode

2013-12-21 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- keywords: -3.2regression ___ Python tracker <http://bugs.python.org/issue20048> ___ ___ Python-bugs-list mailing list Unsub

[issue20048] zipfile's readline() drops data in universal newline mode

2013-12-21 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- components: +Library (Lib) type: -> behavior ___ Python tracker <http://bugs.python.org/issue20048> ___ ___ Python-

[issue20048] zipfile's readline() drops data in universal newline mode

2013-12-21 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: It does! -- ___ Python tracker <http://bugs.python.org/issue20048> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue20049] string.lowercase and string.uppercase can contain garbage

2013-12-21 Thread Alexander Pyhalov
New submission from Alexander Pyhalov: When Python 2.6 (or 2.7) compiled with _XOPEN_SOURCE=600 on illumos string.lowercase and string.uppercase contain garbage when UTF-8 locale is used. (OpenIndiana bug report - https://www.illumos.org/issues/4411 ). The reason is that with UTF-8 locale

[issue20049] string.lowercase and string.uppercase can contain garbage

2013-12-21 Thread Alexander Pyhalov
Alexander Pyhalov added the comment: Honestly, I don't understand locale-related things good enough. But I received this explanation when discussed similar issue in illumos developers mailing list. http://comments.gmane.org/gmane.os.illumos.devel/14193 2013/12/22 Antoine Pitrou > &

[issue20049] string.lowercase and string.uppercase can contain garbage

2013-12-21 Thread Alexander Pyhalov
Alexander Pyhalov added the comment: I've discussed this once more. >From islower man page: RETURN VALUES If the argument to any of the character handling macros is not in the domain of the function, the result is undefined. And (char)128-255 are not legal UTF-8 (at leas

[issue20012] Re: Allow Path.relative_to() to accept non-ancestor paths

2014-01-09 Thread Alexander Boyd
Alexander Boyd added the comment: Then perhaps the docstring of relative_to could note this (like relpath does), or a separate method that's explicitly not symlink safe created. Or better yet, what about a function that does (or at least tries to) give the correct answer in the fa

[issue19145] Inconsistent behaviour in itertools.repeat when using negative times

2014-01-26 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: If "equivalent to" code is not considered to be part of documentation, then the meaning of negative times should be documented. -- nosy: +belopolsky ___ Python tracker <http://bugs.python.o

[issue14222] Use time.steady() to implement timeout

2014-02-25 Thread Alexander Ljungberg
Alexander Ljungberg added the comment: This still appears to be an issue in Python 2.7. Queue.get routinely hangs for a very long time on the Raspberry Pi as it doesn't have a clock battery and often ends up significantly adjusting its system time soon after startup. --

[issue20849] add exist_ok to shutil.copytree

2014-03-03 Thread Alexander Mohr
New submission from Alexander Mohr: it would be REALLY nice (and REALLY easy) to add a parameter: exist_ok and pass this to os.makedirs with the same parameter name so you can use copytree to append a src dir to an existing dst dir. -- components: Library (Lib) messages: 212691 nosy

[issue13936] datetime.time(0, 0, 0) evaluates to False despite being a valid time

2014-03-04 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > Please reopen. Please bring your case to python-ideas. All developers who commented on this issue agree that it is invalid. -- ___ Python tracker <http://bugs.python.org/issu

[issue20849] add exist_ok to shutil.copytree

2014-03-04 Thread Alexander Mohr
Alexander Mohr added the comment: awesome, thanks so much!! -- ___ Python tracker <http://bugs.python.org/issue20849> ___ ___ Python-bugs-list mailing list Unsub

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

2014-03-05 Thread Alexander Belopolsky
New submission from Alexander Belopolsky: The rationale for making this change is that the current behaviour converts a stylistic problem in checking values against a sentinel via "bool(value)" instead of "value is not None" into a subtle data driven behavioural bug that

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

2014-03-05 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- nosy: -belopolsky ___ Python tracker <http://bugs.python.org/issue20855> ___ ___ Python-bugs-list mailing list Unsubscribe:

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

2014-03-05 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- nosy: -belopolsky ___ Python tracker <http://bugs.python.org/issue13936> ___ ___ Python-bugs-list mailing list Unsubscribe:

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

2014-03-05 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I thought literal copying was enough of a hint to humor without a smiley in the title. -- ___ Python tracker <http://bugs.python.org/issue20

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

2014-03-05 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: #20855 was meant as a joke, so I'll keep serious responses here. Nick wrote: """ Alexander, my goal is to flip the default assumption in the time discussion. It is clear from the documentation that the current behaviour is intention

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

2014-03-05 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Nick wrote: > any deprecation warning should explain how to convert > a time object to "seconds since midnight". I would like to see such an explanation regardless of the outcome here. The best I can think of is timedelta(hours=t.hour,

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

2014-03-05 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > You're trying to count midnight as the previous day instead of the actual day? yes > That seems extremely contrived Why? Midnight can be considered to be the last moment of the day or the first moment of the day. In ISO standard there a

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

2014-03-05 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > If Midnight is considered the last moment of the day then it > evaluating to false makes even less sense since the rationale > given is "time is seconds since midnight". You are erecting a straw-man. Python clearly considers time

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

2014-03-05 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > So in that case your example using midnight as false is even more > confusing and even more wrong than not using ``is None`` on the > conditional check. I should have added that dt is a datetime instance and therefore dt.time() is None is alw

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

2014-03-06 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- assignee: -> belopolsky ___ Python tracker <http://bugs.python.org/issue20858> ___ ___ Python-bugs-list mailing list Un

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

2014-03-06 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I would like to hear from PyPy developers before we decide what to do with this effort. Pure Python implementation is not used by CPython, but I am afraid that people who actually use it will not appreciate the code churn. -- nosy

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

2014-03-06 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Oh - I did not realize that this originated in PyPy. -- ___ Python tracker <http://bugs.python.org/issue20858> ___ ___

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

2014-03-06 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- nosy: +mark.dickinson ___ Python tracker <http://bugs.python.org/issue20861> ___ ___ Python-bugs-list mailing list Unsub

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

2014-03-06 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: >I'd appreciate any pointers on how to get started You probably know that the relevant code is in http://hg.python.org/cpython/file/47f37a688c4c/Modules/_datetimemodule.c#l4059 The devguide should get you started: http://docs.python.org/

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

2014-03-07 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > On Mar 7, 2014, at 10:12 AM, "R. David Murray" wrote: > > I asked about it on IRC and someone said it was because arithmetic on times > was ambiguous because of timezones, and I just accepted that rather than > wonder why i

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

2014-03-07 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > On Mar 7, 2014, at 10:15 AM, Antoine Pitrou wrote: > > Adding times of the day sounds as well-defined to me as adding > centigrade temperatures. What is wrong with adding temperatures? Climate people do it all the time when computing

[issue17267] datetime.time support for '+' and '-'

2014-03-07 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I think the timezone related problems are a red herring. Aware datetime +/- timedelta arithmetics is naive - tzinfo is ignored in calculations and copied to the result: http://hg.python.org/cpython/file/c83ce2a1841c/Lib/datetime.py#l1711 The utcoffset

[issue20849] add exist_ok to shutil.copytree

2014-03-08 Thread Alexander Mohr
Alexander Mohr added the comment: how about instead we rename the new parameter to dirs_exists_ok or something like that since the method already allows for existing files. -- ___ Python tracker <http://bugs.python.org/issue20

[issue20849] add exist_ok to shutil.copytree

2014-03-08 Thread Alexander Mohr
Alexander Mohr added the comment: I personally dont think this is worth investing the time for a discussion. If the maintainers dont want to accept this or a minor variation without a discussion ill just keep my local monkeypatch :) thanks again for the quick patch Elias! On Mar 8, 2014 4:03 PM

[issue6601] Fractions do not support other Fractions as numerators or denominators

2009-07-30 Thread Alexander Myodov
New submission from Alexander Myodov : Occurs in 2.6, doesn't occur in 3.1. Example: Python 2.6.2+ (release26-maint, Jun 23 2009, 07:08:39) [GCC 4.3.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> fr

[issue6696] Profile objects should be documented

2009-08-13 Thread Alexander Myodov
New submission from Alexander Myodov : Seems like a minor documentation issue in 2.x became more significant one in 3.x. In Python 2.6 (and lower), the documentation on Profile objects discussed them as a part of hotshot module, while omitting the fact that any profiler module, either of

[issue2057] difflib: add patch capability

2009-08-29 Thread Alexander Stanley
Changes by Alexander Stanley : -- nosy: +swixel ___ Python tracker <http://bugs.python.org/issue2057> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue812369] module shutdown procedure based on GC

2009-10-14 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Does this patch fix issue1545463 by any chance? I am away from a development box ATM and cannot test the patch myself. -- nosy: +belopolsky ___ Python tracker <http://bugs.python.org/issue812

[issue7208] Getpass echo's password to screen on 2.6, but not on 2.5 or 3.1

2009-10-27 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Just to give credit where credit is due: see #4 here http://mail.python.org/pipermail/python-dev/2003-December/040579.html -- nosy: +belopolsky ___ Python tracker <http://bugs.python.org/issue7

[issue7224] One obvious way to do interning

2009-10-27 Thread Alexander Belopolsky
New submission from Alexander Belopolsky : Attached patch implements python-ideas proposal to return added or existing element from set.add(). See http://mail.python.org/pipermail/python-ideas/2009-October/006491.html . In addition this patch contains a reimplementation of issue1507011 using

[issue7212] Retrieve an arbitrary element from a set without removing it

2009-10-27 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Any reason you don't want to call set_next from set_get? I would say static PyObject * set_get(PySetObject *so) { register Py_ssize_t pos = 0; register setentry *entry; if (set_next(so, &pos, &entry)) {

[issue5872] New C API for declaring Python types

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

[issue7224] One obvious way to do interning

2009-10-28 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I agree, _PySet_Add name can be improved upon, but I don't want to paint this particular bikeshed until it is clearer what if anything will be done with this idea. If we add PySet_Intern API, then it would be natural to expose it as set.intern r

[issue7224] One obvious way to do interning

2009-11-04 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Wed, Nov 4, 2009 at 9:46 AM, Nick Coghlan wrote: > > Nick Coghlan added the comment: > > If the idea is to create the "one obvious way" for interning, calling > the method and corresponding C function "intern"

[issue7263] Fix set.intersection docstring

2009-11-04 Thread Alexander Belopolsky
New submission from Alexander Belopolsky : """ intersection(...) Return the intersection of two sets as a new set. (i.e. all elements that are in both sets.) """ Is incorrect because set.intersection takes two or more sets. Attached patch cha

[issue7212] Retrieve an arbitrary element from a set without removing it

2009-11-05 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I don't want to pollute python-dev with more hopeless ideas, but I wonder if itertools could grow an efficient C-implemented def first(collection): return next(iter(collection)) On the other hand, it probably belongs to recipes more than s

[issue7224] One obvious way to do interning

2009-11-05 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Thu, Nov 5, 2009 at 2:16 PM, Raymond Hettinger wrote: > > Raymond Hettinger added the comment: > > The basic problem here is that the "one obvious way" to some people > (including me and Martin v. Löwis) is to use a diction

[issue7224] One obvious way to do interning

2009-11-05 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Thu, Nov 5, 2009 at 3:23 PM, Raymond Hettinger wrote: .. > Martin has already rejected a similar proposal for similar reasons. > Please drop this one. Sure. In fact I've never proposed to apply this patch. As I said in my original subm

[issue1616979] cp720 encoding map

2009-11-16 Thread Alexander Belchenko
Alexander Belchenko added the comment: As the author of original patch I want to note that it seems your merged patch does not update the documentation (list of standard encodings). Please, update the docs as well. -- ___ Python tracker <h

[issue1616979] cp720 encoding map

2009-11-16 Thread Alexander Belchenko
Alexander Belchenko added the comment: OK, thanks. -- ___ Python tracker <http://bugs.python.org/issue1616979> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue5862] multiprocessing 'using a remote manager' example errors and possible 'from_address' code leftover

2009-11-19 Thread Alexander Dutton
Changes by Alexander Dutton : -- nosy: +alexdutton ___ Python tracker <http://bugs.python.org/issue5862> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue7372] Regression in pstats

2009-11-20 Thread Alexander Belopolsky
New submission from Alexander Belopolsky : Attached zip archive can be run directly to reproduce the bug: $ ./python.exe bug.zip Traceback (most recent call last): File "/Users/sasha/Work/python-svn/trunk/Lib/runpy.py", line 162, in _run_module_as_main "__main__&

<    21   22   23   24   25   26   27   28   29   30   >