Re: [Python-Dev] PEP 362 Third Revision

2012-06-15 Thread Yury Selivanov
On 2012-06-14, at 11:21 PM, Nick Coghlan wrote: > On Fri, Jun 15, 2012 at 11:37 AM, Yury Selivanov > wrote: >> On 2012-06-14, at 7:16 PM, Nick Coghlan wrote: >> >>> POSITIONAL_ONLY >>> POSITIONAL_OR_KEYWORD >>> VAR_POSITIONAL >>> KEYWOR

Re: [Python-Dev] PEP 362 Third Revision

2012-06-14 Thread Yury Selivanov
On 2012-06-14, at 7:16 PM, Nick Coghlan wrote: > POSITIONAL_ONLY > POSITIONAL_OR_KEYWORD > VAR_POSITIONAL > KEYWORD_ONLY > VAR_KEYWORD I like those. A bit too lengthy and verbose, but the names are consistent. - Yury ___ Python-Dev mailing list Python

Re: [Python-Dev] PEP 362 Third Revision

2012-06-14 Thread Yury Selivanov
On 2012-06-14, at 4:53 PM, Antoine Pitrou wrote: > On Wed, 13 Jun 2012 22:52:43 -0400 > Yury Selivanov wrote: > >> * bind(\*args, \*\*kwargs) -> BoundArguments >>Creates a mapping from positional and keyword arguments to >>parameters. Raises a ``BindEr

Re: [Python-Dev] PEP 362 Third Revision

2012-06-14 Thread Yury Selivanov
On 2012-06-14, at 4:24 PM, Benjamin Peterson wrote: > 2012/6/14 Alexandre Zani : >> On Thu, Jun 14, 2012 at 12:57 PM, Antoine Pitrou wrote: >>> On Thu, 14 Jun 2012 12:46:38 -0700 >>> Ethan Furman wrote: This is no different from what we have with strings now: --> 'aA'.islow

Re: [Python-Dev] PEP 362 Third Revision

2012-06-14 Thread Yury Selivanov
On 2012-06-14, at 1:51 PM, Terry Reedy wrote: > On 6/14/2012 6:00 AM, Nick Coghlan wrote: > >> > Just a thought: Do we want to include the docstring? A function's >> > docstring is often intimately tied to its signature. (Or at least, a >> > lot of us try to write docstrings that effectively desc

Re: [Python-Dev] PEP 362 Third Revision

2012-06-14 Thread Yury Selivanov
On 2012-06-14, at 12:03 PM, Ethan Furman wrote: > Yury Selivanov wrote: >> Hello, >> The new revision of PEP 362 has been posted: >> http://www.python.org/dev/peps/pep-0362/ >> It's possible to test Signatures for equality. Two signatures >> are equal when

Re: [Python-Dev] PEP 362 Third Revision

2012-06-14 Thread Yury Selivanov
On 2012-06-14, at 12:32 PM, Benjamin Peterson wrote: > 2012/6/14 Yury Selivanov : >> On 2012-06-14, at 11:24 AM, Brett Cannon wrote: >>> On Thu, Jun 14, 2012 at 9:50 AM, Yury Selivanov >>> wrote: >>> >>> [SNIP] >>> >>> Let&#x

Re: [Python-Dev] PEP 362 Third Revision

2012-06-14 Thread Yury Selivanov
On 2012-06-14, at 11:24 AM, Brett Cannon wrote: > On Thu, Jun 14, 2012 at 9:50 AM, Yury Selivanov > wrote: > > [SNIP] > > Let's consider replacement of 'Parameter.is_*' set of attributes with > a single 'Parameter.kind' attribute, which will hav

Re: [Python-Dev] PEP 362 Third Revision

2012-06-14 Thread Yury Selivanov
On 2012-06-14, at 10:50 AM, Alexandre Zani wrote: > On Thu, Jun 14, 2012 at 6:50 AM, Yury Selivanov > wrote: >> I guess if nobody really wants to keep 'is_args', we can alter the >> PEP. >> >> Let's consider replacement of 'Parameter.is_*&#

Re: [Python-Dev] PEP 362 Third Revision

2012-06-14 Thread Yury Selivanov
On 2012-06-14, at 8:06 AM, Victor Stinner wrote: > Sorry if I'm asking dummy questions, I didn't follow the discussion. > >> * format(...) -> str >>Formats the Signature object to a string. Optional arguments allow >>for custom render functions for parameter names, >>annotations and d

Re: [Python-Dev] PEP 362 Third Revision

2012-06-14 Thread Yury Selivanov
On 2012-06-14, at 12:29 AM, Alexandre Zani wrote: > Why do we look at __wrapped__ only if the object is a FunctionType? > Why not support __wrapped__ on all callables? Good idea ;) I'll add this. Thanks, - Yury ___ Python-Dev mailing list Python-Dev@py

Re: [Python-Dev] PEP 362 Third Revision

2012-06-14 Thread Yury Selivanov
On 2012-06-14, at 12:17 AM, Nick Coghlan wrote: > On Thu, Jun 14, 2012 at 1:06 PM, Yury Selivanov wrote: >> On 2012-06-13, at 10:52 PM, Yury Selivanov wrote: >>> 2. signature() function support all kinds of callables: >>> classes, metaclasses, meth

Re: [Python-Dev] PEP 362 Third Revision

2012-06-13 Thread Yury Selivanov
On 2012-06-13, at 10:52 PM, Yury Selivanov wrote: > 2. signature() function support all kinds of callables: > classes, metaclasses, methods, class- & staticmethods, > 'functools.partials', and callable objects. If a callable > object has a '__signature__'

[Python-Dev] PEP 362 Third Revision

2012-06-13 Thread Yury Selivanov
ersion: $Revision$ Last-Modified: $Date$ Author: Brett Cannon , Jiwon Seo , Yury Selivanov , Larry Hastings Status: Draft Type: Standards Track Content-Type: text/x-rst Created: 21-Aug-2006 Python-Version: 3.3 Post-History: 04-Jun-2012 Abstract Python has always supported power

Re: [Python-Dev] Updated PEP 362 (Function Signature Object)

2012-06-07 Thread Yury Selivanov
Nick, I'm replying to your email (re 'functools.partial') in python-ideas here, in the PEP 362 thread, as my response raises some questions regarding its design. > On 2012-06-07, at 11:40 PM, Nick Coghlan wrote: >> On Fri, Jun 8, 2012 at 12:57 PM, Yury Selivan

Re: [Python-Dev] PEP 362 Second Revision

2012-06-07 Thread Yury Selivanov
On 2012-06-07, at 8:40 PM, R. David Murray wrote: > IMO the __repr__ should make it clear that it is a signature object > somehow. +1. - Yury ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscrib

Re: [Python-Dev] PEP 362 Second Revision

2012-06-07 Thread Yury Selivanov
On 2012-06-07, at 5:39 PM, Terry Reedy wrote: > On 6/7/2012 4:54 PM, Yury Selivanov wrote: > >> I think we'll add a 'format' method to the Signature, that will work >> like 'inspect.formatargspec'. 'Signature.__str__' will use it with >

Re: [Python-Dev] PEP 362 Second Revision

2012-06-07 Thread Yury Selivanov
On 2012-06-07, at 3:54 PM, Terry Reedy wrote: > On 6/7/2012 10:41 AM, Yury Selivanov wrote: >> Hello, >> >> The new revision of PEP 362 has been posted: >> http://www.python.org/dev/peps/pep-0362/ >> >> Thanks to Brett, Larry, Nick, and everybody els

Re: [Python-Dev] Updated PEP 362 (Function Signature Object)

2012-06-07 Thread Yury Selivanov
Eric, On 2012-06-07, at 12:54 PM, Eric Snow wrote: > On Wed, Jun 6, 2012 at 11:10 AM, Yury Selivanov > wrote: >> I like the idea of 'foo(a)' and 'bar(a)' having the identical signatures, >> however, I don't think it's possible. I.e. we can't

Re: [Python-Dev] Updated PEP 362 (Function Signature Object)

2012-06-07 Thread Yury Selivanov
On 2012-06-07, at 10:45 AM, R. David Murray wrote: > On Thu, 07 Jun 2012 07:00:29 -0700, Larry Hastings wrote: >> On 06/06/2012 11:56 PM, Nick Coghlan wrote: >>> I'd say return a copy in the first case to be safe against accidental >>> modification. If someone actually wants in-place modification,

[Python-Dev] PEP 362 Second Revision

2012-06-07 Thread Yury Selivanov
Hello, The new revision of PEP 362 has been posted: http://www.python.org/dev/peps/pep-0362/ Thanks to Brett, Larry, Nick, and everybody else on python-dev for your corrections/suggestions. Summary of changes: 1. We don't cache signatures in __signature__ attribute implicitly 2. signature() f

Re: [Python-Dev] Updated PEP 362 (Function Signature Object)

2012-06-07 Thread Yury Selivanov
Nick, On 2012-06-07, at 2:56 AM, Nick Coghlan wrote: > On Thu, Jun 7, 2012 at 11:16 AM, Yury Selivanov > wrote: >> On 2012-06-06, at 9:00 PM, Nick Coghlan wrote: >> So, the idea for the 'signature(obj)' function is to first check if >> 'obj' has '

Re: [Python-Dev] Updated PEP 362 (Function Signature Object)

2012-06-07 Thread Yury Selivanov
On 2012-06-07, at 9:28 AM, Michael Foord wrote: > On 6 Jun 2012, at 18:28, Yury Selivanov wrote: >> On 2012-06-06, at 1:13 PM, Alexandre Zani wrote: >> Never copy attributes by hand, always use 'functools.wraps'. It copies >> '__name__', '__qua

Re: [Python-Dev] Updated PEP 362 (Function Signature Object)

2012-06-06 Thread Yury Selivanov
On 2012-06-06, at 9:00 PM, Nick Coghlan wrote: > On Thu, Jun 7, 2012 at 10:52 AM, Eric Snow > wrote: >> Furthermore, using __signature__ as a cache may even cause problems. >> If the Signature object is cached then any changes to the function >> will not be reflected in the Signature object. Cer

Re: [Python-Dev] Updated PEP 362 (Function Signature Object)

2012-06-06 Thread Yury Selivanov
On 2012-06-06, at 3:33 PM, Daniel Urban wrote: > On Wed, Jun 6, 2012 at 8:35 PM, Yury Selivanov > wrote: >> On 2012-06-06, at 2:22 PM, Daniel Urban wrote: >>>> I'll try to answer you with the following code: >>>> >>>> >>> def foo

Re: [Python-Dev] Updated PEP 362 (Function Signature Object)

2012-06-06 Thread Yury Selivanov
On 2012-06-06, at 2:22 PM, Daniel Urban wrote: >> I'll try to answer you with the following code: >> >> >>> def foo(*args): >> ...print(args) >> >> >>> bound_args = signature(foo).bind(1, 2, 3) >> >>> bound_args.arguments >> OrderedDict([('args', (1, 2, 3))]) >> >> You can't invoke

Re: [Python-Dev] Updated PEP 362 (Function Signature Object)

2012-06-06 Thread Yury Selivanov
Daniel, On 2012-06-06, at 1:39 PM, Daniel Urban wrote: >> BoundArguments Object >> = >> >> Result of a ``Signature.bind`` call. Holds the mapping of arguments >> to the function's parameters. > > The Signature.bind function has changed since the previous version of > the PE

Re: [Python-Dev] Updated PEP 362 (Function Signature Object)

2012-06-06 Thread Yury Selivanov
On 2012-06-06, at 1:13 PM, Alexandre Zani wrote: > A question regarding the name. I have often seen the following pattern > in decorators: > > def decor(f): >def some_func(a,b): >do_stuff using f >some_func.__name__ = f.__name__ >return some_func > > What are the name and full

Re: [Python-Dev] Updated PEP 362 (Function Signature Object)

2012-06-06 Thread Yury Selivanov
Eric, On 2012-06-06, at 1:02 PM, Eric Snow wrote: > On Wed, Jun 6, 2012 at 10:20 AM, Yury Selivanov > wrote: >> On 2012-06-06, at 11:38 AM, Steven D'Aprano wrote: >>> Functions already record their name (twice!), and it is simple enough to >>> query func

Re: [Python-Dev] Updated PEP 362 (Function Signature Object)

2012-06-06 Thread Yury Selivanov
Steven, On 2012-06-06, at 11:38 AM, Steven D'Aprano wrote: > Brett Cannon wrote: >> Python has always supported powerful introspection capabilities, >> including introspecting functions and methods. (For the rest of >> this PEP, "function" refers to both functions and methods). By >> examining a

Re: [Python-Dev] Updated PEP 362 (Function Signature Object)

2012-06-06 Thread Yury Selivanov
On 2012-06-06, at 2:48 AM, Nick Coghlan wrote: > However, looking at the code, I think the split that makes sense is > for a lower level functools.signature to *only* support real function > objects (i.e. not even method objects). > > At the inspect layer, inspect.signature could then support retr

Re: [Python-Dev] Updated PEP 362 (Function Signature Object)

2012-06-06 Thread Yury Selivanov
On 2012-06-06, at 9:28 AM, Isaac Morland wrote: > On Wed, 6 Jun 2012, Nick Coghlan wrote: > >> 2. Signature.bind introduces the ability to split the "bind arguments >> to parameters" operation from the "call object" operation > > Has anybody considered calling bind __call__? That is, the result

Re: [Python-Dev] Updated PEP 362 (Function Signature Object)

2012-06-05 Thread Yury Selivanov
Nick, On 2012-06-05, at 9:45 PM, Nick Coghlan wrote: > Specific proposals: > > - the goals of the PEP be expanded to include error checking of > parameter binding for delayed calls and improve introspection of > function wrappers that accept arbitrary arguments, rather than the > more nebulous "i

Re: [Python-Dev] Open PEPs and large-scale changes for 3.3

2012-05-02 Thread Yury Selivanov
On 2012-05-02, at 2:46 AM, Larry Hastings wrote: > On 05/01/2012 01:12 PM, Brett Cannon wrote: >> That would be great! First thing is addressing Guido's concerns from >> http://mail.python.org/pipermail/python-dev/2012-March/117515.html and then >> handling any issues you found. Not sure if Larr

Re: [Python-Dev] Open PEPs and large-scale changes for 3.3

2012-05-02 Thread Yury Selivanov
On 2012-05-01, at 4:12 PM, Brett Cannon wrote: > > That would be great! First thing is addressing Guido's concerns from > http://mail.python.org/pipermail/python-dev/2012-March/117515.html and then > handling any issues you found. Not sure if Larry was asking about this out of > curiosity or be

Re: [Python-Dev] Open PEPs and large-scale changes for 3.3

2012-05-01 Thread Yury Selivanov
On 2012-05-01, at 7:57 AM, Georg Brandl wrote: > With 3.3a3 tagged and the beta stage currently 2 months away, I would like > to draw your attention to the following list of possible features for 3.3 > as specified by PEP 398: > > Candidate PEPs: > > * PEP 362: Function Signature Object Regardi

Re: [Python-Dev] PEP 418 is too divisive and confusing and should be postponed

2012-04-04 Thread Yury Selivanov
On 2012-04-03, at 9:28 PM, Victor Stinner wrote: > In the last version of my PEP, time.monotonic() is simply defined as "a > monotonic clock (cannot go backward)". There is no more "... best ..." in its > definition. I like the last version of the PEP ;) - Yury

Re: [Python-Dev] PEP 418 is too divisive and confusing and should be postponed

2012-04-03 Thread Yury Selivanov
On 2012-04-03, at 8:33 PM, Steven D'Aprano wrote: > 1) the os module should expose lightweight wrappers around whatever clocks > the operating system provides; +1. That should make it flexible enough to those who really need it. > 2) the time module should NOT provide any further clocks other

Re: [Python-Dev] PEP 418: Add monotonic clock

2012-03-30 Thread Yury Selivanov
On 2012-03-30, at 3:40 PM, Guido van Rossum wrote: > I still think the name "monotonic" give the wrong impression; I would > be happy calling it steady. Simple google search comparison shows that people ask about 'monotonic' clock in python, not 'steady'. How about following Nick's (if I recall

Re: [Python-Dev] PEP 418: Add monotonic clock

2012-03-28 Thread Yury Selivanov
On 2012-03-28, at 1:55 PM, Yury Selivanov wrote: > nonlocal _time nonlocal _tick obviously. P.S. And we can make it to raise an error after some N calls to time() resulting in lesser time that is stored in the _tick variable. - Yury ___ Python-

Re: [Python-Dev] PEP 418: Add monotonic clock

2012-03-28 Thread Yury Selivanov
On 2012-03-28, at 11:35 AM, Nick Coghlan wrote: > So, the primary use case is that we want to replace many of the > time.time() calls in the standard library with time.monotonic() calls. > To avoid backwards compatibility problems in the cross-platform > support, that means time.monotonic() *must b

Re: [Python-Dev] PEP 418: Add monotonic clock

2012-03-28 Thread Yury Selivanov
On 2012-03-28, at 10:45 AM, Nick Coghlan wrote: > On Thu, Mar 29, 2012 at 12:27 AM, Yury Selivanov > wrote: >> What if system time jumps 1 year back? We'll have the same >> monotonic time returned for this whole year? >> >> I don't think we sh

Re: [Python-Dev] PEP 418: Add monotonic clock

2012-03-28 Thread Yury Selivanov
On 2012-03-28, at 10:36 AM, Nick Coghlan wrote: > Monotonicity is fairly easy to guarantee - you just remember the last > value you returned and ensure you never return a lower value than that > for the lifetime of the process. As I said in my previous mail - I don't think we should ever do that.

Re: [Python-Dev] PEP 418: Add monotonic clock

2012-03-28 Thread Yury Selivanov
On 2012-03-28, at 10:17 AM, Nick Coghlan wrote: > def _make_monotic: > try: > # Use underlying system monotonic clock if we can > return _monotonic > except NameError: > _tick = time() > def monotic(): > _new_tick = time() >

Re: [Python-Dev] PEP 418: Add monotonic clock

2012-03-27 Thread Yury Selivanov
On 2012-03-27, at 9:23 AM, Nick Coghlan wrote: > time.try_monotonic() # Monotonic is preferred, but non-monotonic > presents a tolerable risk This function seems unnecessary. It's easy to implement it when required in your application, hence I don't think it is worth adding to the stdlib. - Yur

Re: [Python-Dev] Rename time.steady(strict=True) to time.monotonic()?

2012-03-23 Thread Yury Selivanov
On 2012-03-23, at 7:25 PM, Victor Stinner wrote: > - time.steady(): monotonic clock or the realtime clock, depending on > what is available on the platform (use monotonic in priority). may be > adjusted by NTP or the system administrator, may go backward. > > time.steady() is something like: > >

Re: [Python-Dev] Rename time.steady(strict=True) to time.monotonic()?

2012-03-23 Thread Yury Selivanov
On 2012-03-23, at 7:28 PM, Brian Curtin wrote: > This seems like it should have been a PEP, or maybe should become a PEP. Why? AFAIK Victor just proposes to add two new functions: monotonic() and steady(). time() and clock() do already exist and won't be changed. - Yury

Re: [Python-Dev] Drop the new time.wallclock() function?

2012-03-23 Thread Yury Selivanov
On 2012-03-23, at 7:07 PM, Victor Stinner wrote: > 2012/3/23 Yury Selivanov : >> Why can't I use select & threads? You mean that if a platform does not >> support monotonic clocks it also does not support threads and select sys >> call? > > Python 3.3 now u

Re: [Python-Dev] Drop the new time.wallclock() function?

2012-03-23 Thread Yury Selivanov
On 2012-03-23, at 1:27 PM, Victor Stinner wrote: >> I want time.steady(strict=True), and I'm glad you're providing it and >> I'm willing to use it this way, although it is slightly annoying >> because "time.steady(strict=True)" really means >> "time.steady(i_really_mean_it=True)". Else, I would ha

Re: [Python-Dev] Drop the new time.wallclock() function?

2012-03-23 Thread Yury Selivanov
On 2012-03-23, at 4:40 PM, Glyph wrote: > (I still object to the "time.steady" naming, because this is what people in > the make-believe land of C++ call it. The people who live in the real world > of C and POSIX all refer to it as "monotonic". And even the C++ purists slip > up sometimes, c.f

Re: [Python-Dev] Playing with a new theme for the docs

2012-03-21 Thread Yury Selivanov
On 2012-03-21, at 11:06 AM, Ɓukasz Rekucki wrote: > FYI, the current paragraph font size on docs.python.org is 16px, while > for http://www.python.org/~gbrandl/build/html/ it's 13px, so > increasing that should help readability :) You can use @media queries > to adjust it to screen resolution, whic

Re: [Python-Dev] pysandbox 1.5 released

2012-03-20 Thread Yury Selivanov
Well, I really hope that the PEP regarding frozendict will be accepted. Especially due to the fact that the required changes are small. With the recent projects like clojure-py, blog posts like http://goo.gl/bFB5x (Python becomes a platform), your pysandbox, it became clear that people start eval

Re: [Python-Dev] Drop the new time.wallclock() function?

2012-03-13 Thread Yury Selivanov
If we need to decide to which function should be kept - I vote for monotonic. It's extremely useful (even essential) to track timeouts in various schedulers implementations, for example. Quick search also shows the demand for it, as there are questions on stackoverflow.com and few packages on PyP

Re: [Python-Dev] Review of PEP 362 (signature object)

2012-03-13 Thread Yury Selivanov
Guido, Brett, I've tried to use the proposed signature object, however, I found that the 'bind' method is incorrect, and came up with my own implementation of the PEP: https://gist.github.com/2029032 (If needed, I can change the licence to PSFL) I used my version to implement typechecking, ar

Re: [Python-Dev] [Python-checkins] cpython: Close #14205: dict lookup raises a RuntimeError if the dict is modified during

2012-03-09 Thread Yury Selivanov
Actually, I too noticed that you've dropped few crasher tests. I think we need to keep them, to make sure that future development will not introduce the same vulnerabilities. That's a common practice with unit-testing. On 2012-03-09, at 5:27 PM, Victor Stinner wrote: > On 09/03/2012 22:32, Jim

Re: [Python-Dev] Add a frozendict builtin type

2012-03-01 Thread Yury Selivanov
On 2012-03-01, at 9:31 PM, Guido van Rossum wrote: > That sounds *very* far-fetched. You're pretty much designing a new > language variant. It's not an argument for burdening the original Yeah, that's what we do ;) > You should be able to prototype what you want using an advisory > subclass (if y

Re: [Python-Dev] Add a frozendict builtin type

2012-03-01 Thread Yury Selivanov
On 2012-03-01, at 7:50 PM, Guido van Rossum wrote: > I think you should provide stronger arguments in each case why the > data needs to be truly immutable or read-only, rather than just using > a convention or an "advisory" API (like __private can be circumvented > but clearly indicates intent to t

Re: [Python-Dev] PEP 414

2012-03-01 Thread Yury Selivanov
On 2012-03-01, at 5:52 PM, Armin Ronacher wrote: > Hi, > > On 3/1/12 10:38 PM, Yury Selivanov wrote: >> Sorry if I sounded like 'attacking' you. I certainly had no such >> intention, as I believe nobody on this list. > Sorry if I sound cranky but I got that im

Re: [Python-Dev] PEP 414

2012-03-01 Thread Yury Selivanov
l review of all porting scenarios with well-thought set of benchmarks, nobody would ever call your PEP "polemic". Thanks, - Yury On 2012-03-01, at 4:12 PM, Armin Ronacher wrote: > Hi, > > On 2/29/12 12:30 PM, Yury Selivanov wrote: >> I see you've (or somebody) changed:

Re: [Python-Dev] PEP 414

2012-03-01 Thread Yury Selivanov
Vinay, Thank you for the comprehensive summary. Big +1. I really do hope that Nick and Armin will rectify the PEP. Otherwise, many of its points are moot, and we need to raise a question of rejecting it somehow. On 2012-03-01, at 2:00 PM, Vinay Sajip wrote: > Guido van Rossum python.org> wri

Re: [Python-Dev] Add a frozendict builtin type

2012-03-01 Thread Yury Selivanov
Actually I find fronzendict concept quite useful. We also have an implementation in our framework, and we use it, for instance, in http request object, for parsed arguments and parsed forms, which values shouldn't be ever modified once parsed. Of course everybody can live without it, but given th

Re: [Python-Dev] PEP 414

2012-02-29 Thread Yury Selivanov
place to put such polemic and biased statements. Nobody asked you to express your *personal* feelings and thoughts about applicability or state of python3 in the PEP. There are blogs for that. Thank you. - Yury On 2012-02-28, at 11:29 AM, Yury Selivanov wrote: > Hi Armin, > > Could you p

Re: [Python-Dev] PEP 414

2012-02-29 Thread Yury Selivanov
place to put such polemic and biased statements. Nobody asked you to express your *personal* feelings and thoughts about applicability or state of python3 in the PEP. There are blogs for that. Thank you. - Yury On 2012-02-28, at 11:29 AM, Yury Selivanov wrote: > Hi Armin, > > Could you p

Re: [Python-Dev] PEP 415: Implementing PEP 409 differently

2012-02-28 Thread Yury Selivanov
Big +1. Indeed, this whole Ellipsis approach is just an awful hack. - Yury On 2012-02-26, at 8:30 PM, Benjamin Peterson wrote: > PEP: 415 > Title: Implementing PEP 409 differently > Version: $Revision$ > Last-Modified: $Date$ > Author: Benjamin Peterson > Status: Draft > Type: Standards Track

Re: [Python-Dev] PEP 414

2012-02-28 Thread Yury Selivanov
Hi Armin, Could you please remove from the PEP the following statement: """As it stands, Python 3 is currently a bad choice for long-term investments, since the ecosystem is not yet properly developed, and libraries are still fighting with their API decisions for Python 3.""" While it may be a

Re: [Python-Dev] A new dictionary implementation

2012-02-15 Thread Yury Selivanov
Hello Mark, First, I've back-ported your patch on python 3.2.2 (which was relatively easy). Almost all tests pass, and those that don't are always failing on my machine if I remember. The patch can be found here: http://goo.gl/nSzzY Then, I compared memory footprint of one of our applications (

Re: [Python-Dev] PEP 409 update [was: PEP 409 - final?]

2012-02-03 Thread Yury Selivanov
On 2012-02-03, at 7:23 PM, Terry Reedy wrote: > On 2/3/2012 9:53 AM, Yury Selivanov wrote: >> Re "raise ValueError from ..." > > The use cases for Ellipsis/... are 99.99% internal. The typical Python > programmer will never see or have cause to worry about such a thi

Re: [Python-Dev] PEP 409 update [was: PEP 409 - final?]

2012-02-03 Thread Yury Selivanov
#x27;raise from' statement. On 2012-02-03, at 2:03 PM, Ethan Furman wrote: > Yury Selivanov wrote: >> On 2012-02-03, at 1:20 PM, Guido van Rossum wrote: >>> Please. Let's stop this. There is no known use case to ever write >>> that. We're just not putti

Re: [Python-Dev] PEP 409 update [was: PEP 409 - final?]

2012-02-03 Thread Yury Selivanov
On 2012-02-03, at 1:20 PM, Guido van Rossum wrote: > Please. Let's stop this. There is no known use case to ever write > that. We're just not putting specific measures to prevent it. Writing > a = ... > > Is likewise cute but not very informative. But it is valid syntax. Well, right now you

Re: [Python-Dev] PEP 409 update [was: PEP 409 - final?]

2012-02-03 Thread Yury Selivanov
related singleton in the exception contexts? Is the policy of "think before adding a new builtin object" really worth it in this concrete case? On 2012-02-03, at 1:01 PM, Ethan Furman wrote: > Yury Selivanov wrote: >> I got it, and I think it's fine to use explicit __ca

Re: [Python-Dev] PEP 409 update [was: PEP 409 - final?]

2012-02-03 Thread Yury Selivanov
Funny thing, it seems like you don't get it in the same way I did not in the first place. His example is more like: try: try: raise IndexError() except: raise CustomError() from __NoContext__ except CustomError as e: # nevermind, let's see the whole thing after all raise e from __

Re: [Python-Dev] PEP 409 update [was: PEP 409 - final?]

2012-02-03 Thread Yury Selivanov
I got it, and I think it's fine to use explicit __cause__ reset, using Ellipsis, or even some __NoException__ special object if we decide to introduce one. I'm against allowing 'from ...' syntax. On 2012-02-03, at 12:29 PM, Ethan Furman wrote: > Yury Selivanov wrote:

Re: [Python-Dev] PEP 409 update [was: PEP 409 - final?]

2012-02-03 Thread Yury Selivanov
many of us eagerly want). I'm -1 on adding 'raise from ...'. On 2012-02-03, at 11:52 AM, Ethan Furman wrote: > Yury Selivanov wrote: >> Re "raise ValueError from ..." >> So what does it mean now? Just resetting __cause__ to make __context__ >> printed?

Re: [Python-Dev] PEP 409 update [was: PEP 409 - final?]

2012-02-03 Thread Yury Selivanov
Re "raise ValueError from ..." So what does it mean now? Just resetting __cause__ to make __context__ printed? Can you show the down-to-earth snippet of code where such syntax would be useful? Speaking of Zen of Python - I think this stuff contradicts with it more than it follows. On 2012-0

Re: [Python-Dev] PEP 409 update [was: PEP 409 - final?]

2012-02-02 Thread Yury Selivanov
In my opinion using Ellipsis is just wrong. It is completely non-obvious not only to a beginner, but even to an experienced python developer. Writing 'raise Something() from None' looks less suspicious, but still strange. Isn't 'raise Exception().no_context()' or 'raise Exception().no_cause(

Re: [Python-Dev] Software Transactional Memory for Python

2011-08-30 Thread Yury Selivanov
Maybe it'd be better to put 'atomic' in the threading module? On 2011-08-30, at 4:02 PM, Armin Rigo wrote: > Re-hi, > > 2011/8/29 Armin Rigo : >>> The problem is that many locks are actually acquired implicitely. >>> For example, `print` to a buffered stream will acquire the fileobject's >>> mu

Re: [Python-Dev] Return from generators in Python 3.2

2010-08-26 Thread Yury Selivanov
On 2010-08-26, at 1:10 PM, Eric Smith wrote: > On 8/26/10 12:48 PM, Yury Selivanov wrote: >> On 2010-08-26, at 12:20 PM, Scott Dial wrote: >>> BTW, attaching patches to >>> emails on this list is generally the best way to have few look at your >>> patch. :-p

Re: [Python-Dev] Return from generators in Python 3.2

2010-08-26 Thread Yury Selivanov
On 2010-08-26, at 8:25 PM, Guido van Rossum wrote: > On Thu, Aug 26, 2010 at 5:05 PM, Yury Selivanov wrote: >> On 2010-08-26, at 8:04 PM, Greg Ewing wrote: >>> Even with your proposal, you'd still have to use a 'creepy >>> abstraction' every time one of

Re: [Python-Dev] Return from generators in Python 3.2

2010-08-26 Thread Yury Selivanov
On 2010-08-26, at 8:04 PM, Greg Ewing wrote: > Even with your proposal, you'd still have to use a 'creepy > abstraction' every time one of your coroutines calls another. > That's why PEP 380 deals with 'more than just return'. Nope. In almost any coroutine framework you have a scheduler or trampo

Re: [Python-Dev] Return from generators in Python 3.2

2010-08-26 Thread Yury Selivanov
On 2010-08-26, at 6:11 PM, Nick Coghlan wrote: > On Fri, Aug 27, 2010 at 1:00 AM, Yury Selivanov wrote: >> In the above, GeneratorReturn error will be propagated stopping the program >> execution. >> Strictly speaking, the proposed change is just alters the current

Re: [Python-Dev] Return from generators in Python 3.2

2010-08-26 Thread Yury Selivanov
On 2010-08-26, at 12:20 PM, Scott Dial wrote: > On 8/26/2010 11:00 AM, Yury Selivanov wrote: >> If we decide to postpone this feature till Python 3.3, than we'll push it >> all back >> The change is tiny, but it means really a lot. > > AFAICT, this change was th

[Python-Dev] Return from generators in Python 3.2

2010-08-26 Thread Yury Selivanov
Hello, I want to bring up a "forbidden" topic, however, I believe I have some strong points. There are many ways of doing asynchronous programming in Python. Multiprocessing, Threads, Greenlets, Deferred Object (Callbacks) and Coroutines. The latter is quite a new approach, but it gets mor

Re: [Python-Dev] 'hasattr' is broken by design

2010-08-23 Thread Yury Selivanov
> On 2010-08-23, at 10:37 PM, Guido van Rossum wrote: > Yuri, I think you are making a good case (though I would like for you > to be a good citizen and use the bug tracker to submit this for > review). Benjamin, what do you think? NP, issue #9666 ;-) - Yury __

Re: [Python-Dev] 'hasattr' is broken by design

2010-08-23 Thread Yury Selivanov
> On 2010-08-23, at 10:56 AM, Guido van Rossum wrote: > On Mon, Aug 23, 2010 at 7:46 AM, Benjamin Peterson > wrote: >> 2010/8/23 Yury Selivanov : >>> 1) I propose to change 'hasattr' behaviour in Python 3, making it to >>> swallow only Attri

Re: [Python-Dev] 'hasattr' is broken by design

2010-08-23 Thread Yury Selivanov
> On 2010-08-23, at 6:17 PM, Benjamin Peterson wrote: > 2010/8/23 Yury Selivanov : >>> On 2010-08-23, at 6:00 PM, Guido van Rossum wrote: >>> On Mon, Aug 23, 2010 at 2:22 PM, Yury Selivanov >>> wrote: >> BTW, is it possible to add new magic method __hasattr

Re: [Python-Dev] 'hasattr' is broken by design

2010-08-23 Thread Yury Selivanov
> On 2010-08-23, at 6:00 PM, Guido van Rossum wrote: > On Mon, Aug 23, 2010 at 2:22 PM, Yury Selivanov wrote: >> As I understand the only possible way to make 'hasattr' work as it name >> indicates (i.e. just check if attribute exists, not run it), is to add >&g

Re: [Python-Dev] 'hasattr' is broken by design

2010-08-23 Thread Yury Selivanov
On 2010-08-23, at 5:22 PM, Yury Selivanov wrote: > On 2010-08-23, at 5:02 PM, Michael Foord wrote: > >> On 23/08/2010 23:55, Benjamin Peterson wrote: >>> 2010/8/23 Raymond Hettinger: >>>> On Aug 23, 2010, at 1:13 PM, Benjamin Peterson wrote: >>>>

Re: [Python-Dev] 'hasattr' is broken by design

2010-08-23 Thread Yury Selivanov
On 2010-08-23, at 5:02 PM, Michael Foord wrote: > On 23/08/2010 23:55, Benjamin Peterson wrote: >> 2010/8/23 Raymond Hettinger: >>> On Aug 23, 2010, at 1:13 PM, Benjamin Peterson wrote: >>> 2010/8/23 Michael Foord: > To me hasattr *looks* like a passive introspection function, and the fa

Re: [Python-Dev] 'hasattr' is broken by design

2010-08-23 Thread Yury Selivanov
On 2010-08-23, at 4:33 PM, Raymond Hettinger wrote: > > On Aug 23, 2010, at 1:03 PM, Guido van Rossum wrote: > >>> But hasattr() has a far different set of use cases, so we should explore >>> an alternate solution to the problem. The usual reason that people use >>> hasattr() instead of getattr(

Re: [Python-Dev] 'hasattr' is broken by design

2010-08-23 Thread Yury Selivanov
On 2010-08-23, at 3:47 PM, Raymond Hettinger wrote: > > On Aug 23, 2010, at 7:22 AM, Yury Selivanov wrote: > >> I know the issue has been discussed several times already, however I >> couldn't find any reasonable explanation of its strange behaviour. The main

Re: [Python-Dev] 'hasattr' is broken by design

2010-08-23 Thread Yury Selivanov
On 2010-08-23, at 10:46 AM, Benjamin Peterson wrote: > 2010/8/23 Yury Selivanov : >> 1) I propose to change 'hasattr' behaviour in Python 3, making it to swallow >> only AttributeError exceptions (exactly like 'getattr'). Probably, Python >> 3.2 relea

[Python-Dev] 'hasattr' is broken by design

2010-08-23 Thread Yury Selivanov
uch python 2 code converted with 2to3, we can introduce another 'hasattr' function defined in 2to3 module itself, and make it imported automatically in all files passed through 2to3 transformation pipeline. This new function will mimic 'hasattr' behaviour from python 2 and conve

<    1   2   3   4   5   6