A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2000-November/010500.html below:

[Python-Dev] Integer division transition

[Python-Dev] Integer division transition [Python-Dev] Integer division transitionGuido van Rossum guido@python.org
Tue, 07 Nov 2000 08:33:46 -0500
> > > It's a new keyword though, which has a much
> > > higher threshold for acceptance than a new two-character operator
> > > symbol.
> 
> > It could be non-reserved, since a div b is currently
> > a syntax error.
> 
> Except for the fact our current parser can't handle the 'a div b' syntax
> without making 'div' a reserved word, which also makes 'x.div', 'class div:'
> and 'def div():' invalid syntax. It might be work around-able, but .... :P

No, we *could* use the 'import as' trick: define the syntax as

term: factor (('*'|'/'|'%'|NAME) factor)*

and add a check that NAME is "div" in the compiler.

But I don't know how comfy I am with a proliferation of hacks like
this -- and it's likely to cause more confusing error messages.

--Guido van Rossum (home page: http://www.python.org/~guido/)



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4