Skip to content

Conversation

@jstasiak
Copy link
Contributor

@jstasiak jstasiak commented Aug 4, 2016

No description provided.

@matthiaskramm matthiaskramm merged commit a14b189 into python:master Aug 4, 2016
@jstasiak
Copy link
Contributor Author

jstasiak commented Aug 4, 2016

Ugh, I just realised I used typing.AnyStr in objectify.pyi while etree.pyi doesn't use it on purpose and defines its own AnyStr as a union of bytes and str. The difference between them in this context is not clear to me so I'm not sure how bad is it, if at all - let me know if this requires amending.

@gvanrossum
Copy link
Member

Please amend it. AnyStr is a type variable so in your version of objectify.fromstring() the types if text and base_url have to correspond -- but with unions they can each be either str or bytes, and that's how the rest of the API is defined.

jstasiak pushed a commit to smarkets/typeshed that referenced this pull request Aug 5, 2016
typing.AnyStr usage here was a mistake that I noticed too late,
from a GitHub comment[1]:

    AnyStr is a type variable so in your version of
    objectify.fromstring() the types if text and base_url have to
    correspond -- but with unions they can each be either str or bytes,
    and that's how the rest of the API is defined.

[1] python#436 (comment)
matthiaskramm pushed a commit that referenced this pull request Aug 5, 2016
typing.AnyStr usage here was a mistake that I noticed too late,
from a GitHub comment[1]:

    AnyStr is a type variable so in your version of
    objectify.fromstring() the types if text and base_url have to
    correspond -- but with unions they can each be either str or bytes,
    and that's how the rest of the API is defined.

[1] #436 (comment)
JelleZijlstra pushed a commit to JelleZijlstra/lxml-stubs that referenced this pull request Nov 7, 2017
typing.AnyStr usage here was a mistake that I noticed too late,
from a GitHub comment[1]:

    AnyStr is a type variable so in your version of
    objectify.fromstring() the types if text and base_url have to
    correspond -- but with unions they can each be either str or bytes,
    and that's how the rest of the API is defined.

[1] python/typeshed#436 (comment)
hswong3i pushed a commit to alvistack/python-typeshed that referenced this pull request May 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants