[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

RE: svn commit: r1742826 - in /subversion/trunk: subversion/tests/cmdline/ subversion/tests/cmdline/svntest/ tools/client-side/ tools/server-side/svnpubsub/

From: Markus Schaber <m.schaber_at_codesys.com>
Date: Tue, 10 May 2016 06:36:29 +0000

Hi,

From: Stefan Fuhrmann [mailto:stefan2_at_apache.org]
> On 10.05.2016 00:15, Daniel Shahaf wrote:
> > stefan2_at_apache.org wrote on Sun, May 08, 2016 at 14:15:43 -0000:
> >>
> >> #####################################################################
> >> #
> >> +# Permission constants used with e.g. chmod() and open().
> >> +# Define them here at a central location, so people aren't tempted
> >> +to # use octal literals which are not portable between Python 2 and 3.
> > For future reference, octal constants with leading "0o" work in both
> > py2 and py3:
> >
> >>>> 0o777 # works in py2 and py3
> >>>> 0777 # works in py2; syntax error in py3
> Interesting. The online source that I found made it seem like there was no
> compatible way and suggested decimals.

According to the "official" source, the syntax was to be backported to Python 2.6:
https://www.python.org/dev/peps/pep-3127/

The changelist of Python 2.6 seems to agree:
https://docs.python.org/2/whatsnew/2.6.html#pep-3127-integer-literal-support-and-syntax

> Anyway, using symbolic constants is certainly even better.

Throughout the code, yes, but even those could be defined in terms of octal literals. :-)

Best regards

Markus Schaber

CODESYS® a trademark of 3S-Smart Software Solutions GmbH

Inspiring Automation Solutions

3S-Smart Software Solutions GmbH
Dipl.-Inf. Markus Schaber | Product Development Core Technology
Memminger Str. 151 | 87439 Kempten | Germany
Tel. +49-831-54031-979 | Fax +49-831-54031-50

E-Mail: m.schaber@codesys.com | Web: http://www.codesys.com | CODESYS store: http://store.codesys.com
CODESYS forum: http://forum.codesys.com

Managing Directors: Dipl.Inf. Dieter Hess, Dipl.Inf. Manfred Werner | Trade register: Kempten HRB 6186 | Tax ID No.: DE 167014915

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received
this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorised copying, disclosure
or distribution of the material in this e-mail is strictly forbidden.
Received on 2016-05-10 08:36:46 CEST

This is an archived mail posted to the Subversion Dev mailing list.