On Thu, May 9, 2013 at 9:31 AM, Barry Warsaw wrote:
> On May 09, 2013, at 09:24 AM, Guido van Rossum wrote:
>
> >+1. This is a good one. While adding module=__name__ is actually more
> >typing than passing __name__ + '.Color' as the class name, the current
> >proposal (parsing for dots) makes it
On May 09, 2013, at 09:24 AM, Guido van Rossum wrote:
>+1. This is a good one. While adding module=__name__ is actually more
>typing than passing __name__ + '.Color' as the class name, the current
>proposal (parsing for dots) makes it very attractive to do the wrong thing
>and hardcode the module
On Thu, May 9, 2013 at 7:17 AM, Nick Coghlan wrote:
> As Eric noted on the tracker issue, a keyword only "module" argument may
> be a better choice for both than allowing dotted names. A separate
> parameter is easier to use with __name__ to avoid hardcoding the module
> name.
+1. This is a goo
On 9 May 2013 13:48, "Eli Bendersky" wrote:
>
>
>
>
> On Tue, May 7, 2013 at 8:03 AM, Nick Coghlan wrote:
>>
>> On Tue, May 7, 2013 at 11:34 PM, Eli Bendersky wrote:
>> > One of the contended issues with PEP 435 on which Guido pronounced was
the
>> > functional API, that allows created enumerati
On Tue, May 7, 2013 at 8:03 AM, Nick Coghlan wrote:
> On Tue, May 7, 2013 at 11:34 PM, Eli Bendersky wrote:
> > One of the contended issues with PEP 435 on which Guido pronounced was
> the
> > functional API, that allows created enumerations dynamically in a manner
> > similar to namedtuple:
> >
On 8 May 2013 01:26, "Antoine Pitrou" wrote:
>
> Le Wed, 8 May 2013 01:03:38 +1000,
> Nick Coghlan a écrit :
> >
> > What if there was a variant of the class statement that bound the
> > result of a function call rather than using the normal syntax:
> >
> > class Animal from enum.Enum(members
On Tue, May 7, 2013 at 6:00 PM, Steven D'Aprano wrote:
> On 07/05/13 23:34, Eli Bendersky wrote:
>
>> One of the contended issues with PEP 435 on which Guido pronounced was the
>> functional API, that allows created enumerations dynamically in a manner
>> similar to namedtuple:
>>
>>Color = E
On 07/05/13 23:34, Eli Bendersky wrote:
One of the contended issues with PEP 435 on which Guido pronounced was the
functional API, that allows created enumerations dynamically in a manner
similar to namedtuple:
Color = Enum('Color', 'red blue green')
The biggest complaint reported against th
On 05/07/2013 08:47 AM, Eli Bendersky wrote:
def Color = Enum('red green blue')
It's an interesting idea, but as NIck suggested we should probably
discuss it on the python-ideas list. [...]
A special syntax raises more questions though, because it has to be
defined very precisely. Feel
On Tue, May 7, 2013 at 8:34 AM, Eli Bendersky wrote:
> According to an earlier discussion, this is works on CPython, PyPy and
> Jython, but not on IronPython. The alternative that works everywhere is to
> define the Enum like this:
>
> Color = Enum('the_module.Color', 'red blue green')
>
> The
On Tue, May 7, 2013 at 9:14 AM, Antoine Pitrou wrote:
> Le Tue, 7 May 2013 08:44:46 -0700,
> Eli Bendersky a écrit :
> > > > 4) Using _getframe(N) here seems like an overkill to me.
> > >
> > > It's not just overkill, it's fragile - it only works if you call the
> > > constructor directly. If y
Le Tue, 7 May 2013 08:44:46 -0700,
Eli Bendersky a écrit :
> > > 4) Using _getframe(N) here seems like an overkill to me.
> >
> > It's not just overkill, it's fragile - it only works if you call the
> > constructor directly. If you use a convenience function in a utility
> > module, it will try t
On 05/07/2013 08:03 AM, Nick Coghlan wrote:
On Tue, May 7, 2013 at 11:34 PM, Eli Bendersky wrote:
4) Using _getframe(N) here seems like an overkill to me.
It's not just overkill, it's fragile - it only works if you call the
constructor directly. If you use a convenience function in a utility
On Tue, May 7, 2013 at 8:35 AM, Piotr Duda wrote:
> 2013/5/7 Ethan Furman :
> > On 05/07/2013 08:01 AM, Piotr Duda wrote:
> >>
> >> 2013/5/7 Ethan Furman :
> >>>
> >>> On 05/07/2013 07:48 AM, Piotr Duda wrote:
>
>
>
> What about adding simple syntax (I proposed this earlier, b
On 2013-05-07, at 17:03 , Nick Coghlan wrote:
>
> Specifically, what I'm talking about is some kind of implicit context
> similar to the approach the decimal module uses to control operations
> on Decimal instances.
Wouldn't it be a good occasion to add actual, full-fledged and correctly
implemen
On Tue, May 7, 2013 at 8:03 AM, Nick Coghlan wrote:
> On Tue, May 7, 2013 at 11:34 PM, Eli Bendersky wrote:
> > One of the contended issues with PEP 435 on which Guido pronounced was
> the
> > functional API, that allows created enumerations dynamically in a manner
> > similar to namedtuple:
> >
2013/5/7 Ethan Furman :
> On 05/07/2013 08:01 AM, Piotr Duda wrote:
>>
>> 2013/5/7 Ethan Furman :
>>>
>>> On 05/07/2013 07:48 AM, Piotr Duda wrote:
What about adding simple syntax (I proposed this earlier, but no one
commented) that take care of assigning name and module, s
On 05/07/2013 08:01 AM, Piotr Duda wrote:
2013/5/7 Ethan Furman :
On 05/07/2013 07:48 AM, Piotr Duda wrote:
What about adding simple syntax (I proposed this earlier, but no one
commented) that take care of assigning name and module, something
like:
def name = expression
which would be rough
Le Wed, 8 May 2013 01:03:38 +1000,
Nick Coghlan a écrit :
>
> What if there was a variant of the class statement that bound the
> result of a function call rather than using the normal syntax:
>
> class Animal from enum.Enum(members="dog cat bear")
Apparently you're trying hard to invent sy
On Wed, May 8, 2013 at 12:53 AM, Ethan Furman wrote:
> On 05/07/2013 07:48 AM, Piotr Duda wrote:
>>
>>
>> What about adding simple syntax (I proposed this earlier, but no one
>> commented) that take care of assigning name and module, something
>> like:
>>
>> def name = expression
>>
>> which would
On Tue, May 7, 2013 at 11:34 PM, Eli Bendersky wrote:
> One of the contended issues with PEP 435 on which Guido pronounced was the
> functional API, that allows created enumerations dynamically in a manner
> similar to namedtuple:
>
> Color = Enum('Color', 'red blue green')
>
> The biggest compl
2013/5/7 Ethan Furman :
> On 05/07/2013 07:48 AM, Piotr Duda wrote:
>>
>>
>> What about adding simple syntax (I proposed this earlier, but no one
>> commented) that take care of assigning name and module, something
>> like:
>>
>> def name = expression
>>
>> which would be rough equivalent for:
>>
>
On 05/07/2013 07:48 AM, Piotr Duda wrote:
What about adding simple syntax (I proposed this earlier, but no one
commented) that take care of assigning name and module, something
like:
def name = expression
which would be rough equivalent for:
name = expression
name.__name__ = 'name'
name.__mod
2013/5/7 Eli Bendersky :
>
> 4) Using _getframe(N) here seems like an overkill to me. What we really need
> is just the module in which the current execution currently is (i.e. the
> metaclass's __new__ in our case). Would it make sense to add a new function
> somewhere in the stdlib of 3.4 (in sys
One of the contended issues with PEP 435 on which Guido pronounced was the
functional API, that allows created enumerations dynamically in a manner
similar to namedtuple:
Color = Enum('Color', 'red blue green')
The biggest complaint reported against this API is interaction with pickle.
As promi
25 matches
Mail list logo