python> link> Mid-line comment in Python?> I was told that it's better to use named arguments.

Operating environment


Ubuntu 14.04 LTS desktop amd64
GeForce GTX 750 Ti
ASRock Z170M Pro4S [Intel Z170chipset]
TensorFlow v0.11
cuDNN v5.1 for Linux
CUDA v7.5
Python 2.7.6
IPython 5.1.0 -- An enhanced Interactive Python.

A deep learning framework called TensorFlow? Learning the code.

      summary, acc = sess.run([merged, accuracy], feed_dict=feed_dict(False))

What I was concerned about above is the difficulty of source reading "What is False?" Of feed_dict (False). I want to reduce the code that depends on my memory.

I wondered if python could make a comment format like fd_dct = feed_dict (/ * train = * / False); in C.

http://stackoverflow.com/questions/5617159/mid-line-comment-in-python

You are correct, the answer is a big fat NO. ... Actually if you break your statement into multiple lines you can.

It is also a good idea to give up the Mid-line comment and make it a comment at the end of the line.


@shiracamus suggested using named arguments. It's certainly easy to understand.

Thank you for the information.

Recommended Posts

python> link> Mid-line comment in Python?> I was told that it's better to use named arguments.
When I tried to use pip with python, I was told that XML_SetHashSalt could not be found.
I was able to recurse in Python: lambda
I was addicted to scraping with Selenium (+ Python) in 2020
I tried to summarize how to use pandas in python
I was able to repeat it in Python: lambda
I want to use the R dataset in python
I want to use a wildcard that I want to shell with Python remove
What I was addicted to with json.dumps in Python base64 encoding
Python> Comprehension> cells> I was taught how to use double comprehension / itertools
I wrote a script to extract a web page link in Python
I was addicted to confusing class variables and instance variables in Python
How to use SQLite in Python
How to use Mysql in python
How to use ChemSpider in Python
How to use PubChem in Python
[Python] I made a decorator that doesn't seem to have any use.
I made a web application in Python that converts Markdown to HTML
Use Python from Java with Jython. I was also addicted to it.
I tried to develop a Formatter that outputs Python logs in JSON
The file name was bad in Python and I was addicted to import
If you want to count words in Python, it's convenient to use Counter.
Features of regular expression modules that I often use personally in Python
[Python] I was hooked for an hour trying to use list comprehensions
A memorandum because I stumbled on trying to use MeCab in Python
After all, what should I use to do type comparisons in Python?
I tried to implement PLSA in Python
[Introduction to Python] How to use class in Python?
[Python] Use pandas to extract △△ that maximizes ○○
I tried to implement permutation in Python
I tried to implement PLSA in Python 2
I want to use jar from python
Easy way to use Wikipedia in Python
I tried to implement ADALINE in Python
I wanted to solve ABC159 in Python
I tried to implement PPO in Python
How to use __slots__ in Python class
How to use regular expressions in Python
What I was addicted to Python autorun
How to use is and == in Python
python I don't know how to get the printer name that I usually use.
I tried to create a class that can easily serialize Json in Python
I want to use Python in the environment of pyenv + pipenv on Windows 10
I want to create a priority queue that can be updated in Python (2.7)
A story that I was addicted to when I made SFTP communication with python
linux / c> link> Get the execution result of the shell command in the C program> I was taught how to use popen ()
How to use the C library in Python
I want to do Dunnett's test in Python
How to receive command line arguments in Python
Automatically register function arguments to argparse in Python
I want to use MATLAB feval with python
A memo that I wrote a quicksort in Python
I want to memoize including Python keyword arguments
I want to create a window in Python
How to use Python Image Library in python3 series
I wrote "Introduction to Effect Verification" in Python
Summary of how to use MNIST in Python
I want to merge nested dicts in Python
Use cryptography module to handle OpenSSL in Python
I tried to implement TOPIC MODEL in Python
I want to use Temporary Directory with Python2