udim commented on a change in pull request #11449: Updates and clarifications on type safety. URL: https://github.com/apache/beam/pull/11449#discussion_r410454232
########## File path: website/src/documentation/sdks/python-type-safety.md ########## @@ -91,8 +92,8 @@ The following code declares an `int` input and a `str` output type hint on the ` ``` The following code declares `int` input and output type hints on `filter_evens`, using annotations on `FilterEvensDoFn.process`. -Since `process` returns a generator, the output type is annotated as `Iterable[int]` (`Generator[int, None, None]` would also work here). -Beam will remove the outer iterable of the return type on the `DoFn.process` method and functions passed to `ParDo` and `FlatMap`. +Since `process` returns a generator, the output type for a DoFn producing a `PCollection[int]` is annotated as `Iterable[int]` (`Generator[int, None, None]` would also work here). +Beam will remove the outer iterable of the return type on the `DoFn.process` method and functions passed `FlatMap` to deduce the element type of resulting PCollection . Review comment: ```suggestion Beam will remove the outer iterable of the return type on the `DoFn.process` method and functions passed to `FlatMap` to deduce the element type of resulting PCollection . ``` ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
