Re: Tabs As Syntax

Liste des GroupesRevenir à ol advocacy 
Sujet : Re: Tabs As Syntax
De : nospam (at) *nospam* dfs.com (DFS)
Groupes : comp.os.linux.advocacy
Date : 05. Apr 2024, 06:13:14
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <uuntos$15o0k$1@dont-email.me>
References : 1 2 3 4 5 6 7
User-Agent : Betterbird (Windows)
On 4/4/2024 8:54 PM, Lawrence D'Oliveiro wrote:
On Wed, 3 Apr 2024 12:16:50 -0400, DFS wrote:
 
I cannot.
 Here’s another example. First, without #end comments:
      class xattr(ct.Structure) :
         _fields_ = \
             [
                 ("fsx_xflags", ct.c_uint32),
                 ("fsx_extsize", ct.c_uint32),
                 ("fsx_nextents", ct.c_uint32),
                 ("fsx_projid", ct.c_uint32),
                 ("fsx_cowextsize", ct.c_uint32),
                 ("fsx_pad", 8 * ct.c_ubyte),
             ]
          def copy(self) :
             celf = type(self)
             res = celf()
             for f in celf._fields_ :
                 setattr(res, f[0], getattr(self, f[0]))
             return \
                 res
          def __repr__(self) :
             return \
                 (
                     "(%s)"
                 %
                     ", ".join
                       (
                             "%%s = %s" % ("%d", "%#0.8x")[f == "fsx_xflags"]
                         %
                             (f, getattr(self, f))
                         for f in
                             ("fsx_xflags", "fsx_extsize", "fsx_nextents", "fsx_projid", "fsx_cowextsize")
                       )
                 )
      XFLAG_REALTIME = 0x00000001
     XFLAG_PREALLOC = 0x00000002
 Where does the “xattr” class end?
At the XFLAG REALTIME line.

Does it include those symbolic parameters at the bottom?
No.

Can you see that clearly?
I can.

Compare this way:
      class xattr(ct.Structure) :
         _fields_ = \
             [
                 ("fsx_xflags", ct.c_uint32),
                 ("fsx_extsize", ct.c_uint32),
                 ("fsx_nextents", ct.c_uint32),
                 ("fsx_projid", ct.c_uint32),
                 ("fsx_cowextsize", ct.c_uint32),
                 ("fsx_pad", 8 * ct.c_ubyte),
             ]
          def copy(self) :
             celf = type(self)
             res = celf()
             for f in celf._fields_ :
                 setattr(res, f[0], getattr(self, f[0]))
             #end for
             return \
                 res
         #end copy
          def __repr__(self) :
             return \
                 (
                     "(%s)"
                 %
                     ", ".join
                       (
                             "%%s = %s" % ("%d", "%#0.8x")[f == "fsx_xflags"]
                         %
                             (f, getattr(self, f))
                         for f in
                             ("fsx_xflags", "fsx_extsize", "fsx_nextents", "fsx_projid", "fsx_cowextsize")
                       )
                 )
         #end __repr__
      #end xattr
      XFLAG_REALTIME = 0x00000001
     XFLAG_PREALLOC = 0x00000002
I just don't have a problem following Python blocks.  Of course if they go more than one page it's tougher.
But go with what works for you.
My usual editor on Windows and WSL is Notepad++, and it has faint vertical lines called indent guides, corresponding with the tab widths, which makes the Python code (or any indented code, with or without brackets) a touch easier to follow.  They're on by default.
https://imgur.com/a/IqfufKA

Date Sujet#  Auteur
20 Mar 24 * Tabs As Syntax51Nuxxie
20 Mar 24 +* Re: Tabs As Syntax48Chris Ahlstrom
20 Mar 24 i+* Re: Tabs As Syntax32DFS
20 Mar 24 ii+* Re: The more spastic the code, the greater the whitespace & comments.2DFS
20 Mar 24 iii`- Best Practice.1Relf
21 Mar 24 ii+- Re: Tabs As Syntax1Lawrence D'Oliveiro
21 Mar 24 ii`* Re: Tabs As Syntax28rbowman
21 Mar 24 ii +* Re: Tabs As Syntax3Lawrence D'Oliveiro
22 Mar 24 ii i`* Re: Tabs As Syntax2rbowman
22 Mar 24 ii i `- Re: Tabs As Syntax1Lawrence D'Oliveiro
21 Mar 24 ii +* Re: Tabs As Syntax7DFS
22 Mar 24 ii i`* Re: Tabs As Syntax6rbowman
22 Mar 24 ii i +- Re: Tabs As Syntax1Lawrence D'Oliveiro
22 Mar 24 ii i +* Re: Tabs As Syntax3candycanearter07
22 Mar 24 ii i i`* Re: Tabs As Syntax2Chris Ahlstrom
23 Mar 24 ii i i `- Re: Tabs As Syntax1rbowman
22 Mar 24 ii i `- Re: Tabs As Syntax1DFS
21 Mar 24 ii `* Re: Tabs As Syntax17Chris Ahlstrom
22 Mar 24 ii  +* Re: Tabs As Syntax14rbowman
22 Mar 24 ii  i+* Re: Tabs As Syntax11Chris Ahlstrom
22 Mar 24 ii  ii+* Re: Tabs As Syntax2candycanearter07
22 Mar 24 ii  iii`- Re: Tabs As Syntax1Chris Ahlstrom
23 Mar 24 ii  ii`* Re: Tabs As Syntax8Lawrence D'Oliveiro
23 Mar 24 ii  ii `* Re: Tabs As Syntax7Chris Ahlstrom
23 Mar 24 ii  ii  +* Re: Tabs As Syntax5DFS
23 Mar 24 ii  ii  i+- Re: Tabs As Syntax1rbowman
24 Mar 24 ii  ii  i+- Re: Tabs As Syntax1Lawrence D'Oliveiro
24 Mar 24 ii  ii  i`* Re: Tabs As Syntax2Chris Ahlstrom
24 Mar 24 ii  ii  i `- Re: Tabs As Syntax1Physfitfreak
23 Mar 24 ii  ii  `- Re: Tabs As Syntax1rbowman
27 Mar 24 ii  i`* Re: Tabs As Syntax2DFS
28 Mar 24 ii  i `- Re: Tabs As Syntax1rbowman
22 Mar 24 ii  `* Re: Tabs As Syntax2Lawrence D'Oliveiro
22 Mar 24 ii   `- Re: Tabs As Syntax1Chris Ahlstrom
21 Mar 24 i`* Re: Tabs As Syntax15Lawrence D'Oliveiro
26 Mar 24 i `* Re: Tabs As Syntax14DFS
3 Apr 24 i  `* Re: Tabs As Syntax13Lawrence D'Oliveiro
3 Apr 24 i   `* Re: Tabs As Syntax12DFS
5 Apr 24 i    `* Re: Tabs As Syntax11Lawrence D'Oliveiro
5 Apr 24 i     +* Re: Tabs As Syntax6DFS
5 Apr 24 i     i`* Re: Tabs As Syntax5Lawrence D'Oliveiro
5 Apr 24 i     i `* Re: Tabs As Syntax4DFS
6 Apr 24 i     i  `* Re: Tabs As Syntax3Lawrence D'Oliveiro
6 Apr 24 i     i   `* Re: Tabs As Syntax2DFS
6 Apr 24 i     i    `- Re: Tabs As Syntax1Lawrence D'Oliveiro
5 Apr 24 i     `* Re: Tabs As Syntax4Chris Ahlstrom
5 Apr 24 i      `* Re: Tabs As Syntax3candycanearter07
5 Apr 24 i       `* Re: Tabs As Syntax2Chris Ahlstrom
6 Apr 24 i        `- Re: Tabs As Syntax1candycanearter07
20 Mar 24 +- Re: Tabs As Syntax1DFS
21 Mar 24 `- Re: Tabs As Syntax1Lawrence D'Oliveiro

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal