[Python-ideas] pep-0484 - Forward references and Didactics - be orthogonal

Andrew Barnert abarnert at yahoo.com
Tue Aug 25 23:24:45 CEST 2015


On Aug 25, 2015, at 09:56, Steven D'Aprano <steve at pearwood.info> wrote:
> 
>> On Tue, Aug 25, 2015 at 01:35:24AM -0700, Andrew Barnert wrote:
>>> On Aug 24, 2015, at 19:52, Steven D'Aprano <steve at pearwood.info> wrote:
>>> 
>>> I agree that is desirable, but surely many languages have some sort of 
>>> forward declaration syntax? I know that both the Pascal and C families 
>>> of languages do.
>> 
>> What would a forward declaration mean in Python?
> 
> I thought it was obvious from context, not to mention from the example 
> given by the OP.

I thought it was obvious, until you brought up C and Pascal, whose forward references are a pretty different thing from what PEP 484 and the OP's example imply, and whose compilation process is radically different from Python's. If you meant the same thing as the PEP, then the shorter answer is: I don't think there's anything useful to learn from C here. I think people have a sense of what it would mean to do what the OP wants, or at least more so than what it would mean to port the vaguely similar idea from C.



More information about the Python-ideas mailing list