Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    David Beazley
    @dabeaz
    Interesting. Thanks for posting that.
    Stephen Harding
    @stharding
    @dabeaz Loved the EuroPython talk. Thanks for posting it!
    David Beazley
    @dabeaz
    Glad you liked it! I had a lot of fun putting that together. No-one ever expects the Howard-Curry-Lambek correspondence! Bwahahahaha!
    Stephen Harding
    @stharding
    lol, awesome
    Szabolcs Sipos
    @labuwx

    @dabeaz Thanks for the EuroPython talk. I really enjoyed it.
    A comment for 24:31: I think the function f has a type equivalent to NoneType -> Int not Void -> Int. However in general there is no function with type NoneType -> A.

    Nonetheless AFAIK the statement "you can create from a Void" is true but the usual argument goes like this:
    P1: I can create anything from a Void.
    P2: No, you cannot.
    P1: Then give me a Void and prove me wrong.
    P2: ....

    David Beazley
    @dabeaz
    f() and f(None) are definitely different things in Python. So, I was thinking more about that.
    Joshua Bronson
    @jab
    https://youtu.be/3A0y-ksmGgI for anyone who needs a link. Great talk!
    czheo
    @czheo_twitter
    Great talk as always! Though I've heard Curry Howard isomorphism before, your talk just gave as much inspiration as the first time I learned this idea.
    Kenneth Nielsen
    @KennethNielsen
    As someone that have not encountered that before, thanks for the talk, it was awesome.
    The whole idea about recursive type definitions immediately made my mind jump to the problems JSON is causing the mypy people :D Although, I think the problem there is a different kind of recursion. Not as much, can you solve it with recursion, but more, how should it be implemented.
    David Beazley
    @dabeaz
    I haven't followed the JSON/mypy problem. What's the gist of that?
    Kenneth Nielsen
    @KennethNielsen
    Well, as I understand it, the definition of the type of a JSON object is inherently recursive, something like JSON_TYPE = Union[int, float, str, bytes, List[JSON_TYPE], Dict[str, JSON_TYPE]], or something like that, (and of course depending on the JSON spec, I can never remember I think one of them allows for a single object at the top level and the other one does not). Anyway, the problem is that mypy doesn't support that kind of recursive definitions, leaving you with no way to create the true type definition for a JSON object. So what people usually end up doing in the meantime is to either give up on the fact that it is JSON and write out the actual type it has, or make a good-enough JSON type, which just repeats the definition 10 times or something like that, effectively giving you a 10 layers deep type definition (or course something goes wrong it is impossible to actually decipher where it goes wrong, because the string representation of that type in the error message is like a kilometer long :D )
    There is a long discussion here: https://github.com/python/typing/issues/182#issuecomment-186306678 with this particular comment being the example for the good-enough def
    David Beazley
    @dabeaz
    Wow. Okay. Remind me to stay away from all of that.
    Vinay Kumar
    @imflash217
    Hi @dabeaz , Just a thankful note. 🙂I came across your books & talks via "Fluent Python" book 2 months ago and since then I am a totally changed Python programmer ..... Your teaching method is just so easily digestible. Many thanks to you for making amazing contents available. ..... I learnt more in past 2 months than what I learnt in past many years of python programming. Your lectures really helped me break the fear of diving deeply into the dirty details of python implementation.....Thank you so much. 🙏🏽🙂 Take Care.
    ltc0060
    @ltc0060
    Hi @dabeaz , I really like the explanations you give in all of your talks. That is why I'm here and would like to ask few questions because I don't know where else to look (maybe you can give me directions). I'm curious as to why when I create a pandas dataframe object and populate it with data in run-time, the python process occupies less memory (300 MB) after populating the dataframe is completed compared to when I first save the dataframe to disk via pickle then load it in another process (windows task manager informs me that it initially uses 17700 MB, then it goes down to 7200 MB after 30 min. in the mean time the process is just waiting for my input in jupyter notebook)? Does this behaviour have to do with windows or does it have to do with python? (The data I generate is about 10 GB when it is saved to disk as a file. The same thing happens with huge dictionaries, lists and numpy arrays as well). Is there a way that I can force the process to use as little memory as possible ( like 300 MB) at will when I load data in another python process?
    David Beazley
    @dabeaz
    The short answer is "yes"--meaning that it has to do with pickle, and pandas, and Windows--all at once. I don't exactly know how Pandas interacts with pickle, but it could be quite inefficient--involving a lot of data copying and larger data structures than what Pandas ordinarily uses internally.
    If you want to save memory on I/O, I'd investigate different file formats (other than pickle). No specific recommendations, but it's a common problem (so there are likely multiple solutions to this).
    ltc0060
    @ltc0060
    @dabeaz Thanks.
    Marcin Konowalczyk
    @MarcinKonowalczyk
    @dabeaz recently i found myself wanting to set class properties by writing them as decorators. not something python normally does ( why isn't there a decor !? maybe because of people like me... ;P ). I've gotten inspired by your talk on sly, specifically by 'everything is possible with metaclasses' and after a lot of coffee i've made it work: https://github.com/MarcinKonowalczyk/decsetter
    ^ i thought you might find it interesting / sacrilegious
    Marcin Konowalczyk
    @MarcinKonowalczyk
    ( markdown syntax mangled my message a bit. i meant to write __decor__ (a dunder method) not decor )
    Andy Papadopoulos
    @AndrewABaxter_gitlab
    @dabeaz Working through your 2019 PyconIndia Stack Machine/Webassembly compiler and want to run it over a blockchain. Suggestions on how I may approach the problem? The conceptual steps would help me focus my study in the right areas. Thank you David.
    David Beazley
    @dabeaz
    I have no idea what this question even means.'
    1 reply
    SandeepSuryaprasad
    @SSuryaprasad_twitter
    Dave, i am eagerly waiting for your book "Python Distilled", any idea about release date?
    David Beazley
    @dabeaz
    The book is currently available in electronic format (e.g., on Safari or directly from InformIT). Not sure on print. Amazon says Sept. 28, but I really have no idea (I haven't seen a hard-copy myself).
    SandeepSuryaprasad
    @SSuryaprasad_twitter
    Alright. Thanks Dave.
    yehnan
    @yehnan
    I bought the electronic format on InformIT. Start to read!
    yehnan
    @yehnan
    I finished read the book Python Distilled. Good book. Thanks Dave.
    yehnan
    @yehnan
    The descriptions of object identity at sec. 4.1 an sec. 4.2 are a bit inconsistent. Sec. 4.1 says "The identity of the object is a number representing its location in memory". Sec. 4.2 says "The identity is an integer that usually corresponds to the object’s location in memory."
    yehnan
    @yehnan
    Sec. 1.5 of Python Distilled says "The parentheses used to surround an assignment expression are always required." But there is a counterexample in sec. 5.11:
    if result := parse_value(text):
    name, value = result
    1 reply
    In sec. 6.6 of Python Distilled, there is a text "Another application of extended generators is using functions to encapsulate a “worker” task." It's better to change "extended" to "enhanced".
    yehnan
    @yehnan
    Hello David, in Python language and in your book Python Distilled, are the following statement true?
    1. execution model and evaluation refer to the same concept.
    2. object model and data model refer to the same concept.
    Joshua Bronson
    @jab
    Just watched your PyData keynote… what a fantastic talk! 👏👏👏
    1 reply
    2 replies
    Joshua Bronson
    @jab
    loneshark99
    @loneshark99
    @dabeaz how to get better at Python? if you are not using it for your daily job?
    FredInChina
    @ReblochonMasque
    @dabeaz , hello, what is the cost of your courses just announced via twitter?
    FredInChina
    @ReblochonMasque
    ok, I found it, needed to click on the description for each course.
    Kenneth Nielsen
    @KennethNielsen
    @loneshark99 personally I would advice you to find an open source project that you enjoy and contribute something there. WTG learning programming there really is no substitute to doing it, and if not at work it will have to be spare time. Even the task of reading someone elses project (if it is not too complicated) is a really fruitful experience and then again makes it easier to contribute. Personally e.g. I've read minimalmodbus (which I needed for work) and td-watson and contributed to the latter.
    loneshark99
    @loneshark99
    got it, Thanks @KennethNielsen , that makes sense.
    Ricardo Corrieri
    @rcorrieri
    Hello everyone.! I am sure this question has been asked already. Trying to find some decent websocket library which I may use with Curio. Or should I code one myself.?
    tried several ones, and found a comment from David on the anyio project, asking them to drop any support for Curio (from Jan this year)
    • tried several ones and started hitting issues with missing libraries
    David Beazley
    @dabeaz
    I think it'd be great if there was a websocket library for Curio. Regarding anyio, Curio's approach to async environments has long been problematic to projects like that in some subtle ways (e.g., for example, having Event.set() be an async method). It was never a goal for Curio to be a "drop-in" replacement layer for asyncio nor am I inclined to compromise its whole fundamental design to make it work in that way. I asked for Curio support to removed from anyio mainly because I don't want it held up as a constant thorn in the side of whatever it is they're trying to do with that.
    Ricardo Corrieri
    @rcorrieri
    thank you David. !
    Scythal
    @Scythal
    Not easy to buy Python Distilled in Europe! And almost impossible to know how many pages or the ISBN. Has this information changed recently? Many Amazon sites have conflicting information (in France, they show a 750-page book, in UK, 350, in US it used to be 250 but apparently now it's 350...). In any case, it's been removed from all European Amazon shops and their product page remains with the old title "Python Essential Reference 5th Edition". It's a complete mess :D
    2 replies
    David Beazley
    @dabeaz
    image.png
    Scythal
    @Scythal
    Impossible to get anything out of Amazon's declining support, so I finally bought it from Book Depository, a good alternative if the delivery delay is not an issue (5-10 days). It was actually cheaper, though that was not my concern here - at least they had it in stock and with the correct reference. Looking forward to another great book!