Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Ethan Smith
    @ethanhs
    Hello!
    Marti Raudsepp
    @intgr
    Greetings, humans!
    Saul Shanabrook
    @saulshanabrook
    Hi!
    Marti Raudsepp
    @intgr
    Has anyone considered adding support for UnitTest.assertIsInstance, assertTrue in mypy?
    Ethan Smith
    @ethanhs
    not that I know of, but that seems reasonable
    Sebastian Rittau
    @srittau
    Typescript has the concept of assertion functions. Something like this might be interesting to have in Python as well eventually, although I think there are more pressing concerns.
    Sebastian Rittau
    @srittau
    I opened python/typing#703 to remember this.
    Marti Raudsepp
    @intgr
    btw I commented that issues python/mypy#6411 and python/mypy#8416 look like duplicates.
    Jukka Lehtosalo
    @JukkaL
    @intgr thanks, i closed the issues
    PoodleSkirt
    @PoodleSkirt2_twitter
    image.png
    image.png

    Hi all, long ago this conversation happened in the other gitter that referenced adding new (highly useful) plugin hooks: https://i.imgur.com/wXty0uG.png

    I'm curious if there's a ticket / roadmap for adding these. If implementation is simple I'd be happy to work on it.

    Marti Raudsepp
    @intgr
    Is there a written down justification for implementing Union[] and "joining" of types in e.g. ternary conditions, differently?
    I'm new to type system theory so there's probably a reason for it, but I keep running into cases where joining implementation in mypy is inadequate.
    Ethan Smith
    @ethanhs
    I think there is or at least was a hope that ternaries would be a join, but I think it broke a lot of existing code?
    Marti Raudsepp
    @intgr
    Ternaries are a join
    Ethan Smith
    @ethanhs
    Sorry I meant union not join
    but I think I was thinking of python/mypy#5041
    which was (partially) reverted in python/mypy#5095
    Marti Raudsepp
    @intgr
    Ah. Yeah I looked at those but they don't contain much discussion on the topic.
    Sebastian Rittau
    @srittau
    @mypy team: I just noticed that http://mypy-lang.org/ has no news entry for mypy 0.780.
    Nikita Sobolev
    @sobolevn
    @ilevkivskyi I am also very interested in the same question as @PoodleSkirt2_twitter https://gitter.im/python/typing-dev?at=5e629f61afdc1e2033d49683 Is there any roadmap for this feature? Is there anything I can help with?
    I was recently asking for pretty much the same thing: python/mypy#8848
    Guido van Rossum
    @gvanrossum
    @srittau Thanks for noticing -- updated.
    Marti Raudsepp
    @intgr
    I'd like to implement a mode for mypy (perhaps as a switch) so that str is not compatible with Sequence[str] or Iterable[str]. But it would be allowed in for loops/comprehensions.
    Because I find the behavior of unpacking str to chars to be a frequent source of bugs in Python. Passing an iterable of chars to another function is rarely desired.
    Any thoughts or pointers where to start?
    Marti Raudsepp
    @intgr
    Another similar case is passing Dict[T, ...] where Collection[T] is expected. I find very much prefer a call to dict.keys() to make the intention clear.
    Jukka Lehtosalo
    @JukkaL
    @intgr those are all reasonable ideas, and at least the str version has been discussed before. to get started, it's best to create a mypy issue (or find an existing one) and discuss the details there. i or other mypy core contributors can give implementation hints if you mention that you are thinking about implementing it. discussions on github will be easier to discover than on gitter later on.
    Marti Raudsepp
    @intgr
    OK thanks
    Marti Raudsepp
    @intgr
    Hi, I think this change should be reverted from mypy for now: python/mypy#9614 "find_sources: find build sources recursively"
    There are so many reports of users having issues with it already, and in many cases no good work-arounds (see this and following comments https://github.com/python/mypy/issues/4675#issuecomment-765586163 )
    Especially bad when mypy fails with "Found 1 error in 1 file (errors prevented further checking)" and refuses to run in a configuration where it worked fine before 0.800
    Marti Raudsepp
    @intgr
    I guess I should open a separate issue for this. Sorry for spamming this concern in multiple places.
    Adrian Freund
    @freundTech
    Hello,
    I quickly wanted to introduce myself here. My name is Adrian Freund and I'm studying computer science.
    Starting in April I will be writing my bachelors thesis on the topic of "Exhaustiveness check for Structural Pattern Matching in Python 3.10". I will be basing this work of of mypy and hope to be able to also contribute my code back to upstream.
    I already have been active on python/typing for a few weeks and created some smaller PRs in order to get to know the codebase.