Hi,
maybe a syntax like that can correspond:
class MyObject(metaclass=ObjectSpec):
''' MyObject doc'''
'attr1 contains something'
attr1 = None
'attr2 contains something'
attr2 = str
'method1 do something'
method1 = NotImplementedMethod('self', 'arg1', kwarg1=str)
Meta
On Thu, Dec 5, 2013 at 6:31 PM, Ethan Furman wrote:
>> On Thu, Dec 05, 2013 at 01:33:00PM -0800, Guido van Rossum wrote:
>>> Actually if you want to support multiple inheritance of your ABC, your
>>> abstract methods *must* be no-ops (or have some kind of default
>>> behavior that can always be do
On Thu, Dec 5, 2013 at 6:08 PM, Allen Li wrote:
> On Thu, Dec 05, 2013 at 01:33:00PM -0800, Guido van Rossum wrote:
>> > The only two alternatives are doing nothing/pass/return
>> > None or having actual code in the method.
>> >
>> > The former is only useful to silently ignore blind super() calli
On 12/05/2013 06:08 PM, Allen Li wrote:
On Thu, Dec 05, 2013 at 01:33:00PM -0800, Guido van Rossum wrote:
Actually if you want to support multiple inheritance of your ABC, your
abstract methods *must* be no-ops (or have some kind of default
behavior that can always be done last).
Done last or
Tim Peters writes:
> I'm doing all my own coding in 3 now - I like it. I just wish someone
> had told me in 2008 ;-)
I think it's a testament to the basic strength of the language that
you haven't noticed that *nothing has changed* in Python 2 for several
years. ;-)
__
On Thu, Dec 05, 2013 at 01:33:00PM -0800, Guido van Rossum wrote:
> > The only two alternatives are doing nothing/pass/return
> > None or having actual code in the method.
> >
> > The former is only useful to silently ignore blind super() calling, the
> > latter you would define and decorate the me
[Brett]
> On 2008-12-03, Python 3.0.0 was released by Barry.
Dang - nobody ever tells me anything. Congratulations! It's about
time 3.0.0 was released ;-)
> ...
> Thanks to those in the community who stuck by the dev team and had faith
> we knew what we were doing and have continued to help eve
Hi Antoine,
> I've found that libffi does support this type, but sadly ctypes and cffi
> do
> > not. Adding to ctypes does not seem to be trivial, since the description
> of
> > an integer type is limited to a single character ("q" in the case of long
> > long). "q" is considered to be a length of
On 12/05/2013 10:20 AM, Allen Li wrote:
90% of the time, it ends up looking something like this:
class Foo(metaclass=abc.ABCMeta):
@abc.abstractmethod
def f1(self):
raise NotImplementedError
@staticmethod
@abc.abstractmethod
def f2(arg1):
raise NotIm
On Thu, Dec 5, 2013 at 1:12 PM, Allen Li wrote:
> On Thu, Dec 05, 2013 at 10:24:11AM -0800, Guido van Rossum wrote:
>> How would you get the docstrings in? It seems cramming that much on a
>> single line doesn't help readability (even though I agree there is a
>> fair amount of boilerplace).
>
> I
On Tue, Dec 3, 2013 at 9:44 AM, Guido van Rossum wrote:
> Thanks for reporting this.
With pleasure! I'm just glad to have reported a valid bug for once in my
life :b
> This really belongs in the Python issue tracker (bugs.python.org) -- can
you submit a bug there?
I've opened issue # 19901 [1]
On 12/05/2013 12:39 PM, MRAB wrote:
On 05/12/2013 19:22, Ethan Furman wrote:
On 12/05/2013 10:56 AM, Alexander Belopolsky wrote:
On Thu, Dec 5, 2013 at 1:24 PM, Guido van Rossum wrote:
How would you get the docstrings in? [...]
One way to reduce the amount of boilerplate code is to make abs
On Thu, Dec 5, 2013 at 3:06 PM, Brett Cannon wrote:
> How will abstractmethod know its function has no body?
>>
>
> Technically you could inspect the code object of the method. to figure out
> if the body is empty.
>
One way if to check f.__code__.co_lnotab - it will be empty when f has no
body.
On Thu, Dec 05, 2013 at 10:24:11AM -0800, Guido van Rossum wrote:
> How would you get the docstrings in? It seems cramming that much on a
> single line doesn't help readability (even though I agree there is a
> fair amount of boilerplace).
I was basing my initial suggestion somewhat on collections
On 05/12/2013 19:22, Ethan Furman wrote:
On 12/05/2013 10:56 AM, Alexander Belopolsky wrote:
On Thu, Dec 5, 2013 at 1:24 PM, Guido van Rossum wrote:
How would you get the docstrings in? [...]
One way to reduce the amount of boilerplate code is to make abstractmethod
to supply raise NotImplem
On Thu, Dec 5, 2013 at 2:22 PM, Ethan Furman wrote:
> On 12/05/2013 10:56 AM, Alexander Belopolsky wrote:
>
>> On Thu, Dec 5, 2013 at 1:24 PM, Guido van Rossum wrote:
>>
>>>
>>> How would you get the docstrings in? [...]
>>>
>>
>> One way to reduce the amount of boilerplate code is to make abstra
On 12/05/2013 10:56 AM, Alexander Belopolsky wrote:
On Thu, Dec 5, 2013 at 1:24 PM, Guido van Rossum wrote:
How would you get the docstrings in? [...]
One way to reduce the amount of boilerplate code is to make abstractmethod
to supply raise NotImplementedError body when none is given. Then
On Thu, Dec 5, 2013 at 1:24 PM, Guido van Rossum wrote:
> How would you get the docstrings in? It seems cramming that much on a
> single line doesn't help readability (even though I agree there is a
> fair amount of boilerplace).
>
One way to reduce the amount of boilerplate code is to make abst
How would you get the docstrings in? It seems cramming that much on a
single line doesn't help readability (even though I agree there is a
fair amount of boilerplace).
On Thu, Dec 5, 2013 at 10:20 AM, Allen Li wrote:
> Hello Python devs,
>
> As a regular Python user, I find the abc module useful
Hello Python devs,
As a regular Python user, I find the abc module useful for making
Python's duck typing more explicit. In particular, I ofen use it
like a Java interface or C header, to provide methods to implement for a
given "duck type".
90% of the time, it ends up looking something like thi
Am 05.12.13 16:31, schrieb Chris Angelico:
>> Ah. I don't think we have one. If somebody would want to donate one, I
>> suggest to run it in a VM, to reduce the (valid) security concerns that
>> Guido has voiced. If a snapshot of the VM is made, it would be easy to
>> restore in case a commit perfo
On Thu, Dec 5, 2013 at 11:06 PM, "Martin v. Löwis" wrote:
>
> Can you please phrase your question more explicit? What is it that
> you want to be done before writing unit tests for the spwd module?
I am asking buildbot of Linux/Unix/BSD with root account. Do we have it now?
>
> Anybody could run
On Fri, Dec 6, 2013 at 2:29 AM, "Martin v. Löwis" wrote:
> Am 05.12.13 16:21, schrieb Vajrasky Kok:
>> On Thu, Dec 5, 2013 at 11:06 PM, "Martin v. Löwis"
>> wrote:
>>>
>>> Can you please phrase your question more explicit? What is it that
>>> you want to be done before writing unit tests for the
Am 05.12.13 16:21, schrieb Vajrasky Kok:
> On Thu, Dec 5, 2013 at 11:06 PM, "Martin v. Löwis" wrote:
>>
>> Can you please phrase your question more explicit? What is it that
>> you want to be done before writing unit tests for the spwd module?
>
> I am asking buildbot of Linux/Unix/BSD with root
Am 05.12.13 02:04, schrieb Vajrasky Kok:
> Cool. What about Linux/Unix/BSD with root account? If we have
> something similar, I may plan to write unit test for spwd module.
Can you please phrase your question more explicit? What is it that
you want to be done before writing unit tests for the spwd
On Wed, Dec 4, 2013 at 8:15 AM, Antoine Pitrou wrote:
Aren't you talking about the struct module? In ctypes, it seems it
> would be sufficient to add a "c_int128" type (and/or "c_uint128").
Even in ctypes these codes are used internally for the field descriptors.
For ctypes "c_int128" seems rea
26 matches
Mail list logo