You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2022/06/04 12:57:40 UTC

[GitHub] [beam] damccorm opened a new issue, #19738: Finish migration to standard Python typing

damccorm opened a new issue, #19738:
URL: https://github.com/apache/beam/issues/19738

   We should migrate all Python uses of types to the standard typing module, and make the typehints.* ones aliases of the Python ones. 
   
    
   
   There are three places where we use custom typehints behavior: 
   
   (1) is_compatible_with
   
   (2) bind_type_variables/match_type_variables
   
   (3) trivial type inference. 
   
    
   
   I would propose that each of these be adapted to a (internal) public interface that accepts and returns standard typing types, and internally converts to our (nowhere else exposed) typehints types, performs the logic, and converts back. Each of these in turn can then be updated, as needed and orthogonally, to operate on the typing types natively (possibly via deference to a third-party library). 
   
    
   
   I think coder inference could be easily adopted to use typing types directly, but it may be a fourth place where we do internal conversion first. Another gotcha is special care may need to be taken if we ever need to pickle these types (which IIRC may have issues). 
   
   Imported from Jira [BEAM-8156](https://issues.apache.org/jira/browse/BEAM-8156). Original Jira may contain additional context.
   Reported by: robertwb.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org