[x3d-public] X3D.py > Spot, Point, DirectionalLight > .global_ vs global field name
Brutzman, Donald (Don) (CIV)
brutzman at nps.edu
Sat Jul 1 13:56:16 PDT 2023
Correct, and adding a single underscore is recommended Python style for
deconflicing such names from Python language keywords.
* PEP 8 - Style Guide for Python Code
* Descriptive: Naming Styles
* https://peps.python.org/pep-0008/#descriptive-naming-styles
* single_trailing_underscore_: used by convention to avoid conflicts
with Python keyword, e.g.
tkinter.Toplevel(master, class_='ClassName')
I've added some explanation about this to the x3d.py documentation, also
listing affected field names.
* class to class_ (all nodes)
* global to global_ (DirectionalLight
<https://www.web3d.org/x3d/content/X3dTooltips.html#DirectionalLight.global>
, Inline <https://www.web3d.org/x3d/content/X3dTooltips.html#Inline.global>
, PointLight
<https://www.web3d.org/x3d/content/X3dTooltips.html#PointLight.global> ,
SpotLight
<https://www.web3d.org/x3d/content/X3dTooltips.html#SpotLight.global> ,
TextureProjector
<https://www.web3d.org/x3d/content/X3dTooltips.html#TextureProjector.global>
, TextureProjectorParallel
<https://www.web3d.org/x3d/content/X3dTooltips.html#TextureProjectorParallel
.global> )
* type to type_ (BiquadFilter
<https://www.web3d.org/x3d/content/X3dTooltips.html# BiquadFilter.global> ,
field <https://www.web3d.org/x3d/content/X3dTooltips.html#field.global> ,
NavigationInfo
<https://www.web3d.org/x3d/content/X3dTooltips.html#NavigationInfo.global> ,
PeriodicWave
<https://www.web3d.org/x3d/content/X3dTooltips.html#PeriodicWave.global> ,
ProjectionVolumeStyle
<https://www.web3d.org/x3d/content/X3dTooltips.html#ProjectionVolumeStyle.gl
obal> , ShaderPart
<https://www.web3d.org/x3d/content/X3dTooltips.html#ShaderPart.global> ,
ShaderProgram
<https://www.web3d.org/x3d/content/X3dTooltips.html#ShaderProgram.global> )
now online at
* Python X3D Package x3d.py, X3D Python Scene Access Interface Library
(X3DPSAIL) - naming
* https://www.web3d.org/x3d/stylesheets/python/python.html#naming
Have fun with X3D Python! 8)
all the best, Don
--
Don Brutzman Naval Postgraduate School, Code USW/Br brutzman at nps.edu
Watkins 270, MOVES Institute, Monterey CA 93943-5000 USA +1.831.656.2149
X3D graphics, virtual worlds, navy robotics https://faculty.nps.edu/brutzman
From: x3d-public <x3d-public-bounces at web3d.org> On Behalf Of
vmarchetti at kshell.com
Sent: Saturday, July 1, 2023 10:16 AM
To: GPU Group <gpugroup at gmail.com>; X3D-Public <x3d-public at web3d.org>
Subject: Re: [x3d-public] X3D.py > Spot, Point, DirectionalLight > .global_
vs global field name
"global" is a Python keyword (
https://docs.python.org/3/reference/simple_stmts.html
<https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdocs.pyth
on.org%2F3%2Freference%2Fsimple_stmts.html&data=05%7C01%7Cbrutzman%40nps.edu
%7C1441479a10f74eee6bda08db7a56ee2f%7C6d936231a51740ea9199f7578963378e%7C0%7
C0%7C638238286170751706%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoi
V2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000%7C%7C%7C&sdata=JgzOgvJTmG2KCQh
rVSa7zipT0CfP90tSced1MwycWqs%3D&reserved=0> ), albeit one that should never
be used ( IMHO ). Therefore, can't use it for another purpose.
Vince Marchetti
On Jul 1, 2023, at 12:04 PM, GPU Group <gpugroup at gmail.com
<mailto:gpugroup at gmail.com> > wrote:
X3D.py has global_ field name, specs show global
_______________________________________________
x3d-public mailing list
x3d-public at web3d.org <mailto:x3d-public at web3d.org>
http://web3d.org/mailman/listinfo/x3d-public_web3d.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20230701/27412cda/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5464 bytes
Desc: not available
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20230701/27412cda/attachment-0001.p7s>
More information about the x3d-public
mailing list