Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 07:14
    RatanShreshtha opened #190
  • Dec 12 08:04

    oremanj on master

    Bump version to 0.4.0 for relea… Bump version to 0.4.0+dev post … Merge pull request #23 from ore… (compare)

  • Dec 12 08:04
    oremanj closed #23
  • Dec 12 08:00
    oremanj synchronize #23
  • Dec 12 07:56
    oremanj opened #23
  • Dec 12 06:54

    pquentin on master

    Use GitHub Actions for macOS CI… (compare)

  • Dec 12 06:54
    pquentin closed #189
  • Dec 12 06:13
    RatanShreshtha synchronize #189
  • Dec 12 06:08
    RatanShreshtha synchronize #189
  • Dec 12 06:07

    njsmith on master

    Update mypy to 0.750 Rearrange for better inference blacken and 2 more (compare)

  • Dec 12 06:07
    njsmith closed #22
  • Dec 12 03:34
    njsmith synchronize #22
  • Dec 12 03:08

    njsmith on master

    Fix some false negatives Update tests Merge pull request #19 from ore… (compare)

  • Dec 12 03:08
    njsmith closed #19
  • Dec 12 03:08
    njsmith closed #16
  • Dec 12 03:08
    njsmith closed #17
  • Dec 12 02:39

    njsmith on master

    Mark context managers that can'… Merge pull request #20 from ore… (compare)

  • Dec 12 02:39
    njsmith closed #20
  • Dec 12 02:37

    njsmith on master

    Update black to 19.10b0 Merge pull request #21 from ore… (compare)

Nathaniel J. Smith
@njsmith
@tjstum_gitlab ValueError does seem like the wrong thing there, especially because it's probably inconsistent between different platforms...
I guess the other option for an exception would be OSError(EBADFD) or however you spell that. But ClosedResourceError probably makes more sense, because there isn't actually any syscall returning EBADFD
Nathaniel J. Smith
@njsmith
@dj-foxxy I did a quick read of the code and didn't really see anything to comment on, it seemed pretty reasonable :-)
(I didn't try to validate the Condition usage)
Tim Stumbaugh
@tjstum_gitlab
hrm? os.read(-1, 4096) certainly seems to fail with BADFD. or do you mean "it's never something that isn't just a programming error"
Nathaniel J. Smith
@njsmith
@tjstum_gitlab I mean that when you call is_readable and it fails, the failure doesn't involve a syscall returning EBADFD
Peter Sutton
@dj-foxxy
@njsmith I didn't get the NoneType issues solve. I changed what I was doing and it didn't crop up again. I'll open an issue for the proc kill thing. As for my use of conditions: I'm really unsure how to use condition in async code. In threaded coded, I'd lock over shared data, but in async if you don't have to await while touching shared data, do you need to hold the condition (or the underlying lock?).
Nathaniel J. Smith
@njsmith
@dj-foxxy ah, gotcha. Well, if the NoneType thing happens again please let us know with more details, because that's definitely not supposed to happen :-)
And thanks for opening an issue for the process kill thing
Re: Conditions: they're pretty tricky to use! You're right that you don't necessarily need to lock your data to prevent race conditions, because so many operations in async code are automatically atomic. (Though you still might want to use locking just to be explicit and avoid having to think too hard about which operations are atomic and which ones aren't.)
Nathaniel J. Smith
@njsmith
But there's an additional wrinkle for Conditions, which is that you have to be careful not to miss notifications – if you're not in cond.wait when someone calls notify, then you'll never know that it happened. And the lock can sometimes help with this, because taking the lock also blocks anyone else from calling notify.
jtrakk
@jtrakk
What is BlockingIOError: [Errno 11] write could not complete without blocking?
from print(x)
Nathaniel J. Smith
@njsmith
@jtrakk from print that means you put your stdout in non-blocking mode, and print isn't prepared for that
Are you using FdStream to talk to stdout?
jtrakk
@jtrakk
@njsmith I don't think so
maybe one of my deps touched stdout
Nathaniel J. Smith
@njsmith
@jtrakk huh, interesting. It's also possible that some other process that's sharing your stdout file is putting it into non-blocking mode... unfortunately non-blocking mode is a global property of a file
because of the scrollbar
I've seen on some project's docs (can't remember which) a thing that shows the full box when you mouse over it
for some wide code-block
jtrakk
@jtrakk
"In regular English, "stream" and "channel" mean basically the same thing." In the context of waterways, a channel is the container that the water flows through. A stream is the moving water.
those animations are so frickin dope
Nathaniel J. Smith
@njsmith
@jtrakk yeah, I kinda hate that scrollbar, but not sure how to fix it :-/
Nathaniel J. Smith
@njsmith
it's too bad that "port" is already taken by TCP/IP. It would be a great word for streams – one syllable, and emphasizes that the object represents an endpoint, rather than the whole connection
jtrakk
@jtrakk
it might be worth looking through a list of plumbing products/terms. For the "renaming Nursery" thread, I looked into arboreal terms for "branch point", but decided against suggesting the term they use
Nathaniel J. Smith
@njsmith
I just made a loud snorting noise and confused my spouse
jtrakk
@jtrakk
:-)
Nathaniel J. Smith
@njsmith
I spent a fair amount of time staring at thesaurus entries the last few weeks, but there might well be things I've missed!
jtrakk
@jtrakk
Pump, Valve, etc have the "endpoint" feel
Nathaniel J. Smith
@njsmith
those are specific elements though: a pump is an active thing that moves material from one point to another, and a valve is a control you can use to block or allow flow. I think that would be misleading here.
jtrakk
@jtrakk
Bus is short
Nathaniel J. Smith
@njsmith
@jtrakk that was actually on an earlier draft of that list, but I took it out because of the computer usage of "bus" as a term for interchange/routing systems: https://en.wikipedia.org/wiki/Bus_(computing)
jtrakk
@jtrakk
yep
Nathaniel J. Smith
@njsmith
it's very annoying that people have spent 60+ years inventing terminology for communicating stuff involving computers. just imagine if we were back in the 50s, all the lovely jargon available for the taking.
jtrakk
@jtrakk
A few of these are interesting.
Flume, Canal, Chute, Conduit, Intake, Siphon, Orifice.
https://www.ussdams.org/resource-center/glossary/
Nathaniel J. Smith
@njsmith
feel free to post ideas in the thread :-)
jtrakk
@jtrakk
Sure.
John Belmonte
@belm0
embedded visualization framework for Python programs, based on Trio
https://github.com/groove-x/pura
(shared as proof of concept, not in pypi)
Nathaniel J. Smith
@njsmith
Whoa, that's cool
Nathaniel J. Smith
@njsmith
Is it using hypercorn underneath or something else?
jtrakk
@jtrakk
@belm0 Very cool! Thanks for sharing this
John Belmonte
@belm0
no, it's using the trio example server from h11 :-p
(best I could do 1 year ago when I wrote it)
unlikely this code could be used unmodified in another project, which is why it's labeled proof-of-concept
Nathaniel J. Smith
@njsmith
@belm0 ahh heh :-) makes sense
John Belmonte
@belm0
one nice thing about this approach is that the draw() method you implement is sync, so with respect to concurrency it's working with an atomic snapshot of your program's state
Kyle Lawlor
@wgwz
just discovered this project today and thought it might be interesting to try to create some trio documentation with: https://mybinder.readthedocs.io/en/latest/using.html#generating-interactive-open-source-package-documentation
Nathaniel J. Smith
@njsmith
@wgwz oh yeah, binder is pretty cool! (I used to work with the folks working on it.) maybe it would be useful for our hypothetical future "cookbook" documentation? it does require using jupyter notebooks, and I'm not sure if our users are familiar with those or how much work it would take to integrate them into our sphinx docs. And it they take like ~30 seconds to start. So not something you can use to easily fiddle with examples directly while reading the docs.
Peter Sutton
@dj-foxxy

What's the easiest way to run a bunch of tasks in a given order with at most n in parallel.

async def main():
    async with trio.open_nursery() as nursery:
        for i in range(1000):
            nursery.start_soon(slow_lookup, i)

In the example, other parts of the code are awaiting for a specific value j to be mapped to an i. Lower values of i are much more likely to map to any j, so I'd like to start them in order. Does that make sense?

Matthias Urlichs
@smurfix
It does. You probably want a CapacityLimiter.