Re: [Python-Dev] PEP 8 modernisation

2013-08-01 Thread Alexander Shorin
...and, if so, why lambda's?(: Without backward compatibility point I see that they are getting "unofficially" deprecated and their usage is dishonoured. -- ,,,^..^,,, On Thu, Aug 1, 2013 at 6:53 PM, Ronald Oussoren wrote: > > On 1 Aug, 2013, at 16:48, Alexander Shorin

Re: [Python-Dev] PEP 8 modernisation

2013-08-01 Thread Alexander Belopolsky
On Thu, Aug 1, 2013 at 10:21 AM, R. David Murray wrote: > > I'm guessing it's short enough you can say you tried, but long > > enough to annoy traditionalists anyway. > > > > I'm annoyed already. :-) > > +1 :) +1 :) I recently gave up and reset default auto-wrap margin to 120 locally. This ch

Re: [Python-Dev] PEP 8 modernisation

2013-08-01 Thread Alexander Belopolsky
On Thu, Aug 1, 2013 at 11:03 AM, Alexander Shorin wrote: > ...and, if so, why lambda's?(: Without backward compatibility point I > see that they are getting "unofficially" deprecated and their usage is > dishonored. > > Here is one use-case where .. = lambda

Re: [Python-Dev] Lambda [was Re: PEP 8 modernisation]

2013-08-01 Thread Alexander Shorin
Hi Steven, On Thu, Aug 1, 2013 at 7:06 PM, Steven D'Aprano wrote: > Hi Alexander, > > On 02/08/13 00:48, Alexander Shorin wrote: >> >> Hi Ronald, >> >> I understand this, but I'm a bit confused about fate of lambdas with >> such guideline

Re: [Python-Dev] PEP 8 modernisation

2013-08-01 Thread Alexander Belopolsky
On Thu, Aug 1, 2013 at 4:29 PM, Terry Reedy wrote: > def f(x): return 2*x > f = lambda x: 2*x > Am I the only one who finds the second line above much more readable than the first? The def statement is not intended to be written in one line. The readability suffers because the argument is sepa

Re: [Python-Dev] PEP 8 modernisation

2013-08-02 Thread Alexander Shorin
rules. You know mail client with allows to have per-address reply setting? I don't, but would like to see your suggestions in private answer. Thanks. -- ,,,^..^,,, On Fri, Aug 2, 2013 at 12:56 AM, Terry Reedy wrote: > On 8/1/2013 11:35 AM, Alexander Belopolsky wrote: > >> Her

Re: [Python-Dev] PEP 8 modernisation

2013-08-02 Thread Alexander Shorin
On Fri, Aug 2, 2013 at 1:10 PM, Nick Coghlan wrote: > Lambda was almost removed in Python 3. > >> >> Using `dict` to store lambdas: >> >> > op = { 'add': lambda x,y: x*y, 'mul': lambda x, y: x+y} >> >> Shows the hack to bypass PEP8 guides. Do you like to see code above >> instead of: >> >> add =

Re: [Python-Dev] objections to renaming enumobject.h/c in 3.4?

2013-08-03 Thread Alexander Belopolsky
On Sat, Aug 3, 2013 at 9:17 AM, Nick Coghlan wrote: > Yep, this is an area where laziness is definitely a virtue - if work > is only needed to handle a hypothetical future change, then it can be > deferred and handled as part of that change. :) > I would say that even renaming the files can wait

Re: [Python-Dev] PEP 8 modernisation

2013-08-03 Thread Alexander Belopolsky
On Thu, Aug 1, 2013 at 8:44 AM, Nick Coghlan wrote: > > 9. Explicit guideline not to assign lambdas to names (use def, that's > what it's for) Would you consider changing the formatting in the recommended example from def f(x): return 2*x to def f(x): return 2*x ? What is the modern vie

Re: [Python-Dev] Our failure at handling GSoC students

2013-08-07 Thread Alexander Belopolsky
On Wed, Aug 7, 2013 at 4:09 AM, wrote: > .. >> What didn't produce an alarm during Robin's work is that GSoC work is >> done in private. >> > > It wasn't really done in private. Robin posted to python-dev, anybody > who would have been interested could have joined discussions. True. In additio

Re: [Python-Dev] Our failure at handling GSoC students

2013-08-07 Thread Alexander Belopolsky
On Wed, Aug 7, 2013 at 4:34 AM, wrote: > > Robin did exactly that: submit a few patches first, receive feedback, > submit more patches. At the end of the project,he submitted his > entire work. That's not how the history looks on the tracker. Robin submitted ~50 patches before I suggested that

Re: [Python-Dev] Our failure at handling GSoC students

2013-08-07 Thread Alexander Belopolsky
On Wed, Aug 7, 2013 at 1:12 PM, Ethan Furman wrote: > > Dumb question, but does he know how to publish his responses? ... (I'm speaking of the reitvald tool.) The patches that I reviewed: #15390 (datetime), #15848 (xxsubtype), and #15849 (xxmodule) did not have Reitvald "review" links. I revi

Re: [Python-Dev] RFC: PEP 454: Add a new tracemalloc module

2013-09-04 Thread Alexander Belopolsky
On Tue, Sep 3, 2013 at 7:27 PM, Victor Stinner wrote: > API > === > > To trace the most Python memory allocations, the module should be > enabled as early as possible in your application by calling > ``tracemalloc.enable()`` function, by setting the ``PYTHONTRACEMALLOC`` > environment variable to

Re: [Python-Dev] PEP 450 adding statistics module

2013-09-08 Thread Alexander Belopolsky
On Sun, Sep 8, 2013 at 9:32 PM, Guido van Rossum wrote: > - Parallel arrays or arrays of tuples? I think the API should require > an array of tuples. It is trivial to zip up parallel arrays to the > required format, while if you have an array of tuples, extracting the > parallel arrays is slightl

Re: [Python-Dev] Use an empty def as a lambda

2013-09-19 Thread Alexander Belopolsky
On Thu, Sep 19, 2013 at 4:54 PM, Ben Gift wrote: > It would be more pythonic to use an empty def call instead. No, it won't. Python draws a very strong distinction between expressions and statements. This line has been blurred somewhat with the advent of comprehensions and the if-else expres

Re: [Python-Dev] Best practice for documentation for std lib

2013-09-23 Thread Alexander Belopolsky
On Mon, Sep 23, 2013 at 3:01 PM, Terry Reedy wrote: > > IIRC in the Java world you *have* to > >> use 'Returns', but I don't buy the argument from nit-picky grammarians >> that leads to this rule. (It's something about the documentation not >> being a command. But English is more flexible than th

Re: [Python-Dev] Best practice for documentation for std lib

2013-09-23 Thread Alexander Belopolsky
Given near-consensus on the "Return ..." form, the following discussion is of academic interest only. On Mon, Sep 23, 2013 at 9:31 PM, Steven D'Aprano wrote: > > I would not mind > > > > def foo(): > > """returns bar""" > > > > which I would read as "Function foo() returns bar," but in this

Re: [Python-Dev] cpython: Rename contextlib.ignored() to contextlib.ignore().

2013-10-13 Thread Alexander Belopolsky
On Sun, Oct 13, 2013 at 1:01 PM, R. David Murray wrote: > But the name hurts my brain I did not think I would weigh in on this because Ramond's and Nick's position seemed quite rational and the issue minor, but surprisingly this thread does not seem to end. The feature (*and* its name) is a fine

Re: [Python-Dev] cpython: Rename contextlib.ignored() to contextlib.ignore().

2013-10-13 Thread Alexander Belopolsky
On Sun, Oct 13, 2013 at 2:09 PM, R. David Murray wrote: > with replaces try/finally, not try/except. with ignore(..) is different. This is one of the things that I like about it - a demonstration of a context manager that replaces try/except. ___ Pytho

Re: [Python-Dev] non-US zip archives support in zipfile.py

2013-10-14 Thread Alexander Belopolsky
On Mon, Oct 14, 2013 at 6:13 PM, Victor Stinner wrote: > I opened an issue proposing exactly the same change, but I didn't provide a > patch. I found this: http://bugs.python.org/issue10614 but it has (seemingly incorrect) patch. Also related: http://bugs.python.org/issue10972 Victor - is an

Re: [Python-Dev] cpython: Rename contextlib.ignored() to contextlib.ignore().

2013-10-14 Thread Alexander Belopolsky
On Mon, Oct 14, 2013 at 8:18 PM, Nick Coghlan wrote: > .. especially by people that expect it to work like VB's "on error resume > next" > rather than by suppressing the exception and resuming execution after the > with statement. "It is practically impossible to teach good programming to studen

Re: [Python-Dev] cpython: Rename contextlib.ignored() to contextlib.ignore().

2013-10-15 Thread Alexander Belopolsky
On Tue, Oct 15, 2013 at 8:27 AM, Antoine Pitrou wrote: >> I've come to the conclusion it makes sense to rename it from ignore to >> suppress, since that's the term already used for this operation in the >> rest of the context management docs: http://bugs.python.org/issue19266 > > "suppress" and/or

Re: [Python-Dev] cpython: Rename contextlib.ignored() to contextlib.ignore().

2013-10-15 Thread Alexander Belopolsky
On Tue, Oct 15, 2013 at 12:45 PM, Ethan Furman wrote: > with trap(OSError) as cm: > os.unlink('missing.txt') > if cm.exc: > do_something() .. and why is this better than try: os.unlink('missing.txt') except OSError as exc: do_something() ? _

Re: [Python-Dev] PEP 495 implementation

2016-06-28 Thread Alexander Belopolsky
n for now. I will try to get the documentation patch ready before the beta, but I don't want to delay checking in the code. On Mon, Mar 21, 2016 at 10:34 PM, Alexander Belopolsky < alexander.belopol...@gmail.com> wrote: > > Dear All, > > I am getting close to completing P

Re: [Python-Dev] Status of Python 3.6 PEPs?

2016-07-16 Thread Alexander Belopolsky
On Tue, Jul 12, 2016 at 4:26 AM, Victor Stinner wrote: > > "PEP 495 -- Local Time Disambiguation" > https://www.python.org/dev/peps/pep-0495/ > => accepted > > Alexander Belopolsky asked for a review of the implementation: > https://mail.python.org/pipermai

Re: [Python-Dev] PEP 467: next round

2016-07-18 Thread Alexander Belopolsky
On Mon, Jul 18, 2016 at 4:17 PM, Ethan Furman wrote: > - 'bytes.zeros' renamed to 'bytes.size', with option byte filler > (defaults to b'\x00') > Seriously? You went from a numpy-friendly feature to something rather numpy-hostile. In numpy, ndarray.size is an attribute that returns the number

Re: [Python-Dev] PEP 467: next round

2016-07-18 Thread Alexander Belopolsky
On Mon, Jul 18, 2016 at 5:01 PM, Jonathan Goble wrote: > full(), despite its use in numpy, is also unintuitive to me (my first > thought is that it would indicate whether an object has room for more > entries). > > Perhaps bytes.fillsize? > I wouldn't want to see bytes.full() either. Maybe byte

Re: [Python-Dev] PEP 467: next round

2016-07-18 Thread Alexander Belopolsky
On Mon, Jul 18, 2016 at 6:00 PM, Ethan Furman wrote: > bytes.fromsize() sounds good to me, thanks for brainstorming that one for > me. > +1 ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscrib

[Python-Dev] Method signatures in the datetime module documentation

2016-07-29 Thread Alexander Belopolsky
I have started [1] writing documentation for the new PEP 495 (Local Time Disambiguation) features and ran into the following problem. The current documentation is rather inconsistent in presenting the method signatures. For example: date.replace(year, month, day) [2], but datetime.replace([year[

Re: [Python-Dev] Method signatures in the datetime module documentation

2016-08-03 Thread Alexander Belopolsky
On Fri, Jul 29, 2016 at 12:55 PM, Alexander Belopolsky wrote: > > How should I present the signature of the new replace method in the > documentation? Having not seeing any replies, let me make a proposal: datetime.replace(hour=self.hour, minute=self.minute, second=self.second, mi

[Python-Dev] Status of the Argument Clinic DSL

2016-08-04 Thread Alexander Belopolsky
What is the current status of the Argument Clinic DSL? The clinic preprocessor was released [1] with Python 3.4 with a promise [2] "that signature metadata for programmatic introspection will be added to additional callables implemented in C as part of Python 3.4 maintenance releases." We are now

Re: [Python-Dev] Method signatures in the datetime module documentation

2016-08-04 Thread Alexander Belopolsky
On Wed, Aug 3, 2016 at 10:41 PM, Martin Panter wrote: > If replace() actually supported these keywords all along, then I am happy > with this proposal. > With the obvious exception of "fold", it did at least since Python 3.0 (and likely since 2.x where x is 5 ± 1.) > There are a few bug reports

Re: [Python-Dev] Status of the Argument Clinic DSL

2016-08-04 Thread Alexander Belopolsky
On Thu, Aug 4, 2016 at 2:19 PM, Larry Hastings wrote: > AFAIK the Clinic DSL can handle all of Python's C extensions. I have no > plans to "revise the whole approach"; if someone else does I haven't heard > about it. I was just wondering that with so much effort to bring typing to the mainstre

Re: [Python-Dev] Status of the Argument Clinic DSL

2016-08-04 Thread Alexander Belopolsky
On Thu, Aug 4, 2016 at 7:00 PM, Brett Cannon wrote: >> >>> os.rename.__text_signature__ >> '($module, /, src, dst, *, src_dir_fd=None, dst_dir_fd=None)' >> >> ? >> >> What does the "$module, /," part mean? > > > Don't remember what the $module means but the / means positional-only > arguments. No

Re: [Python-Dev] Status of the Argument Clinic DSL

2016-08-04 Thread Alexander Belopolsky
On Thu, Aug 4, 2016 at 7:12 PM, Larry Hastings wrote: > C extension functions get the module passed in automatically, but this is > done internally and from the Python level you can't see it. Always something new to learn! This was not so in Python 2.x - self was passed as NULL to the C module

Re: [Python-Dev] C99

2016-08-06 Thread Alexander Belopolsky
On Sat, Aug 6, 2016 at 5:55 PM, Sturla Molden wrote: > Either they install Xcode or they > don't get to build anything. I always thought "Command Line Tools" would be enough. https://developer.apple.com/library/ios/technotes/tn2339/_index.html#//apple_ref/doc/uid/DTS40014588-CH1-WHAT_IS_THE_COMM

Re: [Python-Dev] Missing PY_ prefixes in structmember.h

2016-10-03 Thread Alexander Belopolsky
On Mon, Oct 3, 2016 at 1:11 PM, Skip Montanaro wrote: > Why didn't these flags > (and the T_* flags in structmember.h) get swept up in all the hubbub > around the grand renaming. > Note that structmember.h is semi-private - it is not included in Python.h. See discussion at

Re: [Python-Dev] Adding bytes.frombuffer() constructor to PEP 467

2017-01-05 Thread Alexander Belopolsky
On Wed, Oct 12, 2016 at 12:08 AM, INADA Naoki wrote: > > Now I'm sure about bytes.frombuffer() is worth enough. I would like to revive this thread (taking a liberty to shorten the subject line.) The issue of how the bytes(x) constructor should behave when given objects of various types have come

Re: [Python-Dev] Adding bytes.frombuffer() constructor to PEP 467

2017-01-06 Thread Alexander Belopolsky
On Thu, Jan 5, 2017 at 5:54 PM, Serhiy Storchaka wrote: > On 05.01.17 22:37, Alexander Belopolsky wrote: > >> I propose the following: >> >> 1. For 3.6, restore and document 3.5 behavior. Recommend that 3rd party >> types that are both integer-like and b

Re: [Python-Dev] Adding bytes.frombuffer() constructor to PEP 467

2017-01-06 Thread Alexander Belopolsky
On Fri, Jan 6, 2017 at 4:43 PM, Serhiy Storchaka wrote: > Compare these two calls: >> >> from array import array > bytes(array('h', [1, 2, 3])) > b'\x01\x00\x02\x00\x03\x00' >> >> and >> >> bytes(array('f', [1, 2, 3])) > b'\x00\x00\x80?\x00\x00\x00@\x00\x00@@' >> > > I don't

Re: [Python-Dev] Why is PyDateTimeAPI not initialized by datetime module import?

2017-01-26 Thread Alexander Belopolsky
On Thu, Jan 26, 2017 at 11:00 AM, Skip Montanaro wrote: > I just got burned (wasted a good day or so) by the fact that PyDateTimeAPI > wasn't initialized. The datetime.rst doc states (emphasis mine): > > Before using any of these functions, the header file :file:`datetime.h` > must be included in

Re: [Python-Dev] "format" builtin function, docstring improvement

2017-02-09 Thread Alexander Belopolsky
On Thu, Feb 9, 2017 at 1:18 PM, Hugo PROD HOMME wrote: > > I have made a template of the docstring to begin with, that I send as an attached file, but I am not familiar with docstring format. Please open an issue at bugs.python.org. We did something similar in issue #9650, [1] so I think this wi

[Python-Dev] GDB macros in Misc/gdbinit are broken

2017-02-27 Thread Alexander Belopolsky
I have opened an issue on b.p.o., [1] but I wonder whether Misc/gdbinit is still supported in 3.6. [1]: http://bugs.python.org/issue29673 ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe:

Re: [Python-Dev] GDB macros in Misc/gdbinit are broken

2017-02-27 Thread Alexander Belopolsky
On Mon, Feb 27, 2017 at 7:34 PM, Victor Stinner wrote: > Does someone still need gdbinit macros for gdb without python binding? > I find them useful. I've never had success with python-gdb.py. ___ Python-Dev mailing list Python-Dev@python.org https://

Re: [Python-Dev] GDB macros in Misc/gdbinit are broken

2017-02-28 Thread Alexander Belopolsky
On Tue, Feb 28, 2017 at 3:33 AM, Victor Stinner wrote: > > Alexander, Skip: Oh, which kind of issues do you have with > python-gdb.py? It doesn't work? You are unable to dump some data? First, I had to rename python-gdb.py to python3.6-gdb.py to make it load. Then running backt

Re: [Python-Dev] Fwd: Re: Enum conversions in the stdlib

2017-03-02 Thread Alexander Belopolsky
> I strongly prefer numeric order for signals. > > --Guido (mobile) +1 Numerical values of UNIX signals are often more widely known than their names. For example, every UNIX user knows what signal 9 does. ___ Python-Dev mailing list Python-Dev@pyth

Re: [Python-Dev] Impact of Namedtuple on startup time

2017-07-17 Thread Alexander Belopolsky
On Mon, Jul 17, 2017 at 6:27 PM, Greg Ewing wrote: > > > Maybe a metaclass could be used to make something > like this possible: > > >class Foo(NamedTuple, fields = 'x,y,z'): > ... > > If you think of it, collection.namedtuple *is* a metaclass. A simple wrapper will make it usable as su

Re: [Python-Dev] Impact of Namedtuple on startup time

2017-07-17 Thread Alexander Belopolsky
On Mon, Jul 17, 2017 at 8:16 PM, Barry Warsaw wrote: > .. > > class Foo(NamedTuple, fields = 'x,y,z'): > > ... > > > > Then the name is explicit and you get to add methods > > etc. if you want. > > Yes, I like how that reads. > > I would prefer class Foo(metaclass=namedtuple, fields = 'x

Re: [Python-Dev] for...else

2017-07-24 Thread Alexander Belopolsky
On Mon, Jul 24, 2017 at 12:23 PM, Ben Hoyt wrote: > .. I found a kind of mnemonic to help me remember when the > "else" part happens: I think of it not as "for ... else" but as "break ... > else" -- saying it this way makes it clear to me that the break goes with > the else. "If this condition ins

Re: [Python-Dev] Review of Issue http://bugs.python.org/issue2706, timedelta operators

2009-03-10 Thread Alexander Belopolsky
On Tue, Mar 10, 2009 at 12:34 AM, Tennessee Leeuwenburg wrote: > .. I'm not sure what's best: >   * Post the review as a comment on the associated issue. Only nosies will > be updated. You should always do that. If you feel that the nosy list is too small and you want to raise awareness for the

Re: [Python-Dev] Evaluated cmake as an autoconf replacement

2009-03-30 Thread Alexander Neundorf
Hi, On Mon, Mar 30, 2009 at 1:22 AM, Christian Heimes wrote: > Jeffrey Yasskin wrote: > >> 1. It can autogenerate the Visual Studio project files instead of >> needing them to be maintained separately > > I'm familiar with the Unix and the Windows build system. More than a > year ago I went to

Re: [Python-Dev] Evaluated cmake as an autoconf replacement

2009-03-30 Thread Alexander Neundorf
On Mon, Mar 30, 2009 at 12:09 AM, Neil Hodgson wrote: ... > while so I can't remember the details. The current Python project > files are hierarchical, building several DLLs and an EXE and I think > this was outside the scope of the tools I looked at. Not sure I understand. Having a project which

Re: [Python-Dev] Evaluated cmake as an autoconf replacement

2009-03-30 Thread Alexander Neundorf
On Mon, Mar 30, 2009 at 8:04 PM, David Cournapeau wrote: > On Tue, Mar 31, 2009 at 2:37 AM, Alexander Neundorf > wrote: ... >> Not sure I understand. >> Having a project which builds (shared) libraries and executables which >> use them (and which maybe have to be exec

Re: [Python-Dev] Evaluated cmake as an autoconf replacement

2009-03-30 Thread Alexander Neundorf
On Mon, Mar 30, 2009 at 8:49 PM, Christian Heimes wrote: > David Cournapeau wrote: >> On Tue, Mar 31, 2009 at 3:16 AM, Alexander Neundorf >> wrote: >>> Can you please explain ? What is "those" ? >> >> Everything in Lib. On windows, I believe this is

Re: [Python-Dev] Getting values stored inside sets

2009-04-03 Thread Alexander Belopolsky
I just want to add a link to a 2.5 year old discussion on this issue: . In that discussion I disagreed with Martin and argued that "interning is a set operation and it is unfortunate that set API does not support it directly." On Fri, Apr 3, 2009 at 12:43 PM

Re: [Python-Dev] Evaluated cmake as an autoconf replacement

2009-04-07 Thread Alexander Neundorf
On Tue, Apr 7, 2009 at 2:14 PM, wrote: > >Ondrej> ... while scons and other Python solutions imho encourage to >Ondrej> write full Python programs, which imho is a disadvantage for the >Ondrej> build system, as then every build system is nonstandard. I fully agree here. > Hmmm... L

Re: [Python-Dev] Evaluated cmake as an autoconf replacement

2009-04-07 Thread Alexander Neundorf
On Tue, Apr 7, 2009 at 3:23 PM, David Cournapeau wrote: > On Tue, Apr 7, 2009 at 10:08 PM, Alexander Neundorf > wrote: > >> >> What is involved in building python extensions ? Can you please explain ? > > Not much: at the core, a python extension is nothing more

Re: [Python-Dev] Evaluated cmake as an autoconf replacement

2009-04-07 Thread Alexander Neundorf
On Wed, Apr 8, 2009 at 12:43 AM, Greg Ewing wrote: > David Cournapeau wrote: >> >> Having a full >> fledged language for complex builds is nice, I think most familiar >> with complex makefiles would agree with this. > > Yes, people will still need general computation in their > build process from

Re: [Python-Dev] Evaluated cmake as an autoconf replacement

2009-04-08 Thread Alexander Neundorf
On Wed, Apr 8, 2009 at 4:18 AM, David Cournapeau wrote: ... >> I guess something similar could be useful for Python, maybe this is >> what distutils actually do ? > > distutils does roughly everything that autotools does, and more: > - configuration: not often used in extensions, we (numpy) are t

Re: [Python-Dev] Oddity PEP 0 key

2009-05-01 Thread Alexander Belopolsky
.. > leaving just 'Rejected' and 'Replaced' to be disambiguated. 'X' or 'Z' for "Rejected"? Looks like a perfect start for a bikeshed discussion. :-) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Un

Re: [Python-Dev] PEP 376 : Changing the .egg-info structure

2009-05-16 Thread Alexander Shigin
В Сбт, 16/05/2009 в 14:58 -0400, P.J. Eby пишет: > ";" *is* valid in Windows filenames, actually. Tabs aresn't. I was sure ';' is separator for PATH in Windows. Do I miss something? If I remember right os.path.pathsep is ';' under Windows. ___ Python-D

Re: [Python-Dev] PEP 376 : Changing the .egg-info structure

2009-05-16 Thread Alexander Shigin
В Сбт, 16/05/2009 в 13:26 -0700, Glenn Linderman пишет: > On approximately 5/16/2009 1:08 PM, came the following characters from > the keyboard of Martin v. Löwis: > > Yes, this: > > > > http://msdn.microsoft.com/en-us/library/aa365247.aspx > > Well, maybe he was missing that, or maybe he was mis

Re: [Python-Dev] PEP 376 : Changing the .egg-info structure

2009-05-16 Thread Alexander Shigin
В Сбт, 16/05/2009 в 23:15 +0100, MRAB пишет: > FYI, on RISC OS '/' is a valid filename character and '.' is used as > the directory separator. > > I'd probably say that TAB is s reasonable character to use, even > though it's OK in POSIX; after all, should anyone really be using a > control charac

Re: [Python-Dev] Issues with process and discussions (Re: Issues with Py3.1's new ipaddr)

2009-06-04 Thread Alexander Belopolsky
On Thu, Jun 4, 2009 at 6:20 AM, Paul Moore wrote: ... > I could still argue that there are downsides (need to take action to > set myself as nosy on an issue, possibly setting up a new mail filter, > housekeeping cruft, the fact that people don't quote in the same way > on tracker items) that make

Re: [Python-Dev] Issues with process and discussions (Re: Issues with Py3.1's new ipaddr)

2009-06-04 Thread Alexander Belopolsky
osies." No new code is required to set this up as far as I can tell. On Thu, Jun 4, 2009 at 11:08 AM, C. Titus Brown wrote: > On Thu, Jun 04, 2009 at 11:03:22AM -0400, Alexander Belopolsky wrote: > -> On Thu, Jun 4, 2009 at 6:20 AM, Paul Moore wrote: > -> ... > -> >

Re: [Python-Dev] (try-except) conditional expression similar to (if-else) conditional (PEP 308)

2009-08-14 Thread Alexander Kozlovsky
da: 10), (ZeroDivisionError, lambda: b/2)) May be not very concise, but it works... -- Best regards, Alexander mailto:alexander.kozlov...@gmail.com ___ Python-Dev m

Re: [Python-Dev] runpy.py

2009-08-25 Thread Alexander Belopolsky
Take a look at two PEPs referenced in runpy doc, http://docs.python.org/3.1/library/runpy.html : PEP 338 - Executing modules as scripts PEP written and implemented by Nick Coghlan. PEP 366 - Main module explicit relative imports PEP written and implemented by Nick Coghlan. (Nick is too modest to

Re: [Python-Dev] readonly __doc__

2009-10-22 Thread Alexander Belopolsky
On Thu, Oct 22, 2009 at 1:25 PM, Antoine Pitrou wrote: .. > I might add why I was asking this question. I was trying to demonstrate the > use > of class decorators and the simplest example I found was to add a docstring to > the class. I always thought that read-only __doc__ was an artifact of n

Re: [Python-Dev] Retrieve an arbitrary element from a set without removing it

2009-10-24 Thread Alexander Belopolsky
On Fri, Oct 23, 2009 at 6:46 PM, Steven D'Aprano wrote: > On Sat, 24 Oct 2009 06:04:12 am Terry Reedy wrote: .. >> fwiw, I think the use case for this is sufficiently rare that it does >> not need a separate method just for this purpose. > > > And yet it keeps coming up, again and again... obvious

Re: [Python-Dev] Retrieve an arbitrary element from a set without removing it

2009-10-26 Thread Alexander Belopolsky
On Sun, Oct 25, 2009 at 1:48 AM, Nick Coghlan wrote: > Terry Reedy wrote: >>> In this model, a >>> get() method, or even a __getitem__ with s[k] is k, is only natural. >> >> No, if key and value were the same thing, the get method would be >> nonesense, as Guido said. But since they are not, sinc

[Python-Dev] One obvious way to do interning [Was: Retrieve an arbitrary element from a set without removing it]

2009-10-26 Thread Alexander Belopolsky
Changing the subject to reflect branched discussion and forwarding to python-ideas where it probably belongs. On Mon, Oct 26, 2009 at 12:02 PM, Terry Reedy wrote: > Alexander Belopolsky wrote: > >> Here is an alternative idea on how storing interned objects in a set >>

Re: [Python-Dev] Retrieve an arbitrary element from a set without removing it

2009-10-27 Thread Alexander Belopolsky
On Tue, Oct 27, 2009 at 1:33 PM, Chris Bergstresser wrote: > On Tue, Oct 27, 2009 at 11:06 AM, Georg Brandl wrote: >> Sorry to nitpick, but there is no list.get(). > >   No?  How ... odd. Odd indeed. My first reaction was: it is not needed because lists support slicing, but when I tried to cons

Re: [Python-Dev] Retrieve an arbitrary element from a setwithoutremoving it

2009-11-05 Thread Alexander Belopolsky
On Thu, Nov 5, 2009 at 3:43 PM, Chris Bergstresser wrote: > .. and "x = iter(s).next()" raises a StopIteration > exception. And that's why the documented recipe should probably recommend next(iter(s), default) instead. Especially because iter(s).next() is not even valid code in 3.0.

Re: [Python-Dev] Retrieve an arbitrary element from asetwithoutremoving it

2009-11-09 Thread Alexander Belopolsky
On Mon, Nov 9, 2009 at 10:09 AM, Daniel Stutzbach wrote: > On Mon, Nov 9, 2009 at 2:42 AM, "Martin v. Löwis" > wrote: >> >> Interesting. Something goes wrong, it seems: if items get removed over >> and over again, I think the set should shrink (not sure whether it >> actually does). Then, I think

Re: [Python-Dev] Drop support for ones' complement machines?

2009-12-01 Thread Alexander Belopolsky
On Tue, Dec 1, 2009 at 11:24 AM, Mark Dickinson wrote: > On Tue, Dec 1, 2009 at 4:17 PM, James Y Knight wrote: >> I think all that needs to be defined is that conversion from unsigned to >> signed, and (negative) signed to >> unsigned integers have 2's complement wrapping semantics, and does no

Re: [Python-Dev] Proposed downstream change to site.py in Fedora (sys.defaultencoding)

2010-01-24 Thread Alexander Belopolsky
On Sun, Jan 24, 2010 at 1:54 PM, Oleg Broytman wrote: .. >   Depends on the kind of cat and especially on the ways of using it. If > you ask cat to number lines (see manual for GNU cat) - what do "lines" mean > for binary IO? Maybe this is yet another reason why some kinds of cat are a bad idea:

Re: [Python-Dev] Tracker reviews workflow and flags

2010-03-19 Thread Alexander Belopolsky
I am generally happy with the tracker workflow and in my experience, issues that are lingering are lingering for a good reason. I've decided to add my two cents to this thread because I've just had a negative experience with how issue 8154 and my input to it were handled. I will not go into detai

Re: [Python-Dev] Mixing float and Decimal -- thread reboot

2010-03-22 Thread Alexander Belopolsky
On Mon, Mar 22, 2010 at 1:56 PM, Raymond Hettinger wrote: > > On Mar 22, 2010, at 10:00 AM, Guido van Rossum wrote: > >   Decimal + float --> Decimal > > If everybody associated with the Decimal implementation wants this I > won't stop you; as I repeatedly said my intuition about this one (as > op

Re: [Python-Dev] Mixing float and Decimal -- thread reboot

2010-03-24 Thread Alexander Belopolsky
On Wed, Mar 24, 2010 at 1:39 PM, Raymond Hettinger wrote: .. > IMO, their least useful feature is the property of being not equal > to themselves -- that causes more problems than it solves > because it impairs a programmer's ability to reason about > their programs. I agree. An often cited rat

Re: [Python-Dev] Mixing float and Decimal -- thread reboot

2010-03-24 Thread Alexander Belopolsky
On Wed, Mar 24, 2010 at 2:36 PM, Guido van Rossum wrote: .. > Probably because we were blindly following the IEEE standard without > understanding it in every detail. Are you talking about "accidental" support for NaNs in older versions of Python or about recent efforts to support them properly i

Re: [Python-Dev] Mixing float and Decimal -- thread reboot

2010-03-24 Thread Alexander Belopolsky
On Wed, Mar 24, 2010 at 2:50 PM, Mark Dickinson wrote: .. >  If Python were to do something different then a naively translated > algorithm from another language would fail.  It's the behaviour that > numerically-aware people expect, and I'd expect to get complaints from > those people if it chang

Re: [Python-Dev] Mixing float and Decimal -- thread reboot

2010-03-24 Thread Alexander Belopolsky
On Wed, Mar 24, 2010 at 2:50 PM, Mark Dickinson wrote: > On Wed, Mar 24, 2010 at 6:26 PM, Alexander Belopolsky > wrote: >> Mark, I wonder if you could describe an algorithm off the top of your >> head that relies on NaN == NaN being false. >> > > No, I certainly co

Re: [Python-Dev] Mixing float and Decimal -- thread reboot

2010-03-24 Thread Alexander Belopolsky
Thanks. Same link reported concurrently by Mark in the "Why is nan != nan?" thread. On Wed, Mar 24, 2010 at 4:26 PM, Raymond Hettinger wrote: > > On Mar 24, 2010, at 12:51 PM, Alexander Belopolsky wrote: > > - "Reflexivity, and other pillars of civilizatio

Re: [Python-Dev] Why is nan != nan?

2010-03-24 Thread Alexander Belopolsky
On Wed, Mar 24, 2010 at 3:26 PM, Mark Dickinson wrote: .. > Here's an interesting recent blog post on this subject, from the > creator of Eiffel: > > http://bertrandmeyer.com/2010/02/06/reflexivity-and-other-pillars-of-civilization/ It appears that Meyer's view has evolved over the years: """ In

Re: [Python-Dev] Why is nan != nan?

2010-03-24 Thread Alexander Belopolsky
On Wed, Mar 24, 2010 at 6:21 PM, Raymond Hettinger wrote: .. > If we want to be able to reason about our programs, > then we need to rely on equality relations being > reflexsive, symmetric, and transitive.  Otherwise, > containers and functions can't even make minimal > guarantees about what they

Re: [Python-Dev] Why is nan != nan?

2010-03-24 Thread Alexander Belopolsky
On Wed, Mar 24, 2010 at 6:31 PM, Mark Dickinson wrote: .. > Neither is necessary, because Python doesn't actually use == as the > equivalence relation for containment testing:  the actual equivalence > relation is:  x equivalent to y iff id(x) == id(y) or x == y.  This > restores the missing refle

Re: [Python-Dev] Why is nan != nan?

2010-03-24 Thread Alexander Belopolsky
gt; {float('nan')} & {float('nan')} set() On Wed, Mar 24, 2010 at 6:36 PM, Alexander Belopolsky wrote: > On Wed, Mar 24, 2010 at 6:31 PM, Mark Dickinson wrote: > .. >> Neither is necessary, because Python doesn't actually use == as the >> equiv

Re: [Python-Dev] Why is nan != nan?

2010-03-24 Thread Alexander Belopolsky
On Wed, Mar 24, 2010 at 6:47 PM, Mark Dickinson wrote: .. > There's no ideal solution here;  IMO, the compromise that currently > exists is an acceptable one. I don't see a compromise. So far I failed to find a use case that benefits from NaN violating reflexivity. _

Re: [Python-Dev] Why is nan != nan?

2010-03-24 Thread Alexander Belopolsky
On Wed, Mar 24, 2010 at 7:02 PM, Mark Dickinson wrote: .. > > So if I understand correctly, you propose that float('nan') == > float('nan') return True.  Would you also suggest extending this > behaviour to Decimal nans? > yes ___ Python-Dev mailing lis

[Python-Dev] Replacing threads with swapcontext()

2010-03-31 Thread Alexander Sabourenkov
Hello. I have went and replaced Python threads with explicitly-scheduled coroutines using swapcontext() family of functions (basically out of frustration with the greenlet). I have two questions. 1. Is it as dangerous to switch C stacks and not switch PyThreadState as I suspect? In particul

Re: [Python-Dev] Replacing threads with swapcontext()

2010-04-01 Thread Alexander Sabourenkov
Nick Coghlan wrote: Off the top of my head, recursion limit checks will definitely go haywire, and I would expect threading.local() and exception handling to explode at some point (although the latter depends on what you mean by "switching C stacks" - if you really are just fiddling the stack poi

Re: [Python-Dev] Enhanced tracker privileges for "dangerjim" to do triage.

2010-04-26 Thread Alexander Belopolsky
On Mon, Apr 26, 2010 at 5:31 AM, Jeroen Ruigrok van der Werven wrote: .. > Be careful. Trackers are often hit by spam bots which change random form > field values. I cannot from memory recall whether or not we had this issue > on either the tracker tracker or Python's tracker. > I would think a c

Re: [Python-Dev] Possible patch for functools partial - Interested?

2010-05-07 Thread Alexander Belopolsky
On Fri, May 7, 2010 at 11:02 AM, Antoine Pitrou wrote: > VanL gmail.com> writes: .. >> While I was at it, I also added a nice repr. Would this group be >> interested in a patch, or is this not interesting? > > It would be more useful to provide equality, hashing and repr to partial > itself, > r

[Python-Dev] Sharing functions between C extension modules in stdlib

2010-06-14 Thread Alexander Belopolsky
I have learned a long time ago that it is not enough to simply declare a function in some header file if you want to define it in one module and use in another. You have to use what now is known as PyCapsule - an array of pointers to C functions wrapped in a Python object. However, while navigatin

Re: [Python-Dev] Sharing functions between C extension modules in stdlib

2010-06-14 Thread Alexander Belopolsky
On Mon, Jun 14, 2010 at 6:45 PM, Alexander Belopolsky wrote: .. > I did not expect this to work, but apparently the build machinery > somehow knows how to place _PyTime_DoubleToTimet code in both time.so > and datetime.so: .. > I have two questions: 1) how does this happen; an

Re: [Python-Dev] Static linking with libpython.a

2010-06-14 Thread Alexander Belopolsky
On Mon, Jun 14, 2010 at 6:29 AM, F van der Meeren wrote: .. > I am trying to figure out, what files to copy with my app so I am able to > initialize the python runtime. > Where can I find information about this? On comp.lang.python forum. This forum is for developing python itself, not applicat

Re: [Python-Dev] Sharing functions between C extension modules in stdlib

2010-06-16 Thread Alexander Belopolsky
On Mon, Jun 14, 2010 at 7:09 PM, "Martin v. Löwis" wrote: .. > So it's clearly intentional. I doubt its desirable, though. If only > __PyTime_DoubleToTimet needs to be duplicated, I'd rather put that > function into a separate C file that gets included twice, instead of > including the full timemo

[Python-Dev] Year 0 and year 10,000 in timetuple

2010-06-19 Thread Alexander Belopolsky
While datetime range is limited to years from 1 through , it is possible to produce time tuple with year 0 or year 10,000: >>> t1 = datetime.min.replace(tzinfo=timezone.max) >>> t2 = datetime.max.replace(tzinfo=timezone.min) >>> t1.utctimetuple().tm_year 0 >>> t2.utctimetuple().tm_year 1

Re: [Python-Dev] Year 0 and year 10,000 in timetuple

2010-06-19 Thread Alexander Belopolsky
On Jun 19, 2010, at 6:12 PM, Guido van Rossum wrote: But what if they are used intentionally as "impossible" or sentinel values? That would be another reason not to produce them accidently. Note that I am proposing disallowing production of out of range years from valid datetime o

Re: [Python-Dev] red buildbots on 2.7

2010-06-21 Thread Alexander Belopolsky
On Mon, Jun 21, 2010 at 6:39 PM, Paul Moore wrote: .. > Yes, looks like it's a bug in the test. http://bugs.python.org/issue9055 > raised. I concur. I've updated the issue with a proposed fix. (The problem is that proxy host names should have a '.' in them on OSX.) I am trying to decide wheth

<    1   2   3   4   5   6   7   8   >