Hi,
Currrently, is it allowed for process worker to submit new task to its parent
executor?
Considering the following Python script:
```python3
import concurrent.futures
with concurrent.futures.ProcessPoolExecutor(max_workers=12) as ppe:
def hello(n: int) -> int:
if n == 0:
I too have used plain strings in Annotated[...] to document fields in
dataclasses.
On Thu, 2021-11-18 at 13:51 -0500, Ricky Teachey wrote:
> On Thu, Nov 18, 2021 at 1:39 PM Thomas Grainger
> wrote:
> > Ricky Teachey wrote:
> > > Could this be a use case for typing.Annotated?
> > > In [6]: from
On Thu, Nov 18, 2021 at 1:39 PM Thomas Grainger wrote:
> Ricky Teachey wrote:
> > Could this be a use case for typing.Annotated?
> > In [6]: from dataclasses import dataclass
> > In [7]: from typing import Annotated
> > In [8]: class A:
> >...: """Docstring for class A."""
> >...:
Ricky Teachey wrote:
> Could this be a use case for typing.Annotated?
> In [6]: from dataclasses import dataclass
> In [7]: from typing import Annotated
> In [8]: class A:
>...: """Docstring for class A."""
>...: x: Annotated[int, "Docstring for x"]
>...: y: Annotated[bool,
On 17.11.2021 15:26, tmkehrenb...@gmail.com wrote:
> Hi all,
>
> I have seen discussion of docstrings for class attributes before on this
> list, but not with this exact proposal.
>
> My motivation is that I have a dataclass for which I want to write
> docstrings that can be accessed at runtime.
+1
On Thu, Nov 18, 2021 at 09:31 Michael Foord wrote:
>
>
> On Thu, 18 Nov 2021 at 04:38, Steven D'Aprano wrote:
>
>> On Wed, Nov 17, 2021 at 02:26:16PM -, tmkehrenb...@gmail.com wrote:
>>
>> > @dataclass
>> > class A:
>> > """Docstring for class A."""
>> > x: int
>> >
On Thu, 18 Nov 2021 at 04:38, Steven D'Aprano wrote:
> On Wed, Nov 17, 2021 at 02:26:16PM -, tmkehrenb...@gmail.com wrote:
>
> > @dataclass
> > class A:
> > """Docstring for class A."""
> > x: int
> > """Docstring for x"""
> > y: bool = True
> > "Docstring for y"
> >
> >
I've seen this proposed before, but it is, as you said, a bit
arduous.
For dataclasses specifically, there is also another possibility:
add a `doc` argument to dataclasses.field. Like this:
from dataclasses import dataclass, field
@dataclass
class A:
x: int = field(doc="Docstring for x.")
On Thu, Nov 18, 2021 at 10:28 AM Ricky Teachey wrote:
> Could this be a use case for typing.Annotated?
>
> ...
>
> The syntax is a bit arduous; I'd be in favor of thinking through ways to
> make it easier to write. But the basic functionality already exists;
> there's no reason to duplicate it
Could this be a use case for typing.Annotated?
In [6]: from dataclasses import dataclass
In [7]: from typing import Annotated
In [8]: class A:
...: """Docstring for class A."""
...: x: Annotated[int, "Docstring for x"]
...: y: Annotated[bool, "Docstring for y"] = True
In
hi all,
I want to know does Python Developer’s Guide have chinese version, If not, i
want to do some translation, may i tell to PSF(or other people) to grant
authorization?
May you also want to do this translation, please contact me.
Best,
bobozi
___
Neil Girdhar wrote:
> The proposal to change list and str is way too ambitious.
Maybe the uppercase versions of dict, list and tuple in the typing
module could be turned into direct aliases of the built-in types?
With Python 3.9, there is no real distinction anyway between
builtins.list and
Stephen J. Turnbull wrote:
> @standard_class_docstring_parser
> class A:
> """
> Class docstring.
> x: Docstring for x
> y: Docstring for y
> """
> x: int
> y: bool = True
Oh, this is actually a nice idea. You could have a
decorator
On Thu, Nov 18, 2021 at 7:44 PM Stephen J. Turnbull
wrote:
>
> Steven D'Aprano writes:
> > On Wed, Nov 17, 2021 at 02:26:16PM -, tmkehrenb...@gmail.com wrote:
> >
> > > @dataclass
> > > class A:
> > > """Docstring for class A."""
> > > x: int
> > > """Docstring for x"""
>
Steven D'Aprano writes:
> On Wed, Nov 17, 2021 at 02:26:16PM -, tmkehrenb...@gmail.com wrote:
>
> > @dataclass
> > class A:
> > """Docstring for class A."""
> > x: int
> > """Docstring for x"""
> > y: bool = True
> > "Docstring for y"
> However a real problem is
15 matches
Mail list logo