« first day (3798 days earlier)      last day (1375 days later) » 
06:00 - 20:0020:00 - 23:00

06:52
do we have a canonical for this? my search fu is failing me stackoverflow.com/questions/66559378/…
 
2 hours later…
08:30
@Code-Apprentice Yeah I ended up using that
@ParitoshSingh good one, thanks!
imagine a world without search engines.. shudder
I added a draft to sopython.com but it's very spare sopython.com/canon/145/…
I also added a tag
08:48
btw am I right that the consensus is to not put units in var names? It's just feels like noise
@Hakaishin Depends. If you are dealing with different units, it might be worth pointing that out in the variable name.
But in general, units are similar to types. They don't belong in the name.
@MisterMiyagi xy problem, you shouldn't be dealing with different units. SI everywhere and then display in some other unit if you want
@MisterMiyagi ok sounds sensible
@Hakaishin I agree in principle. But many datasources are not as principled. It can be useful to have loaders/parsers/writers aware of units.
ok, that makes sense, but then you only have unit names in input/converters and output/display. But inside the app not
we currently have it inside the app, but only sometimes xD
in the ancient tongue of my people, we call that "Yargl".
08:56
wow?
I wish bitbucket issues had not a priority field but a effort required and potential benefit fields, like we do in our spreadsheet, because I have all issues as low prio, and most are low benefit, but some are high effort others low, would be nice to be able to sort for that
tag as "low hanging fruit"?
yeah that would be a solution
09:25
Hey I'm going mad, I have a protobuf message I recompiled it with setup.py proto I deleted the old module in site-packages, I reinstalled it with setup.py install. I invalidated caches and restart pycharm but still after a reindex it doesn't show me the newly added fields? The weird things is when I ctrl+click the PbMessage it opens the right compiled file and I see that the new fields are there, it just wont show them to me on autocomplete, any ideas?
Just one more reason to not use type annotations. I just thought ok let's try this out, the IDE will have it easier to show me what fields there are, bollocks, it doesn't work
09:47
@MisterMiyagi I just saw your comment on a typing problem where I thought typed containers are covariant, and you say they're invariant. I must admit that my theoretical foundation on types isn't the best, so maybe I have things mixed up. To give an example:
class Foo:
    ...

class Bar(Foo):
    ...

from typing import List

x: List[Foo] = [Bar()]  # mypy: this is fine
y: List[Bar] = [Foo()]  # mypy: incompatible type; expected Bar
Isn't that ^ covariance?
hey, I'm trying to make an auto incremented column with a starting point of 1000 as an example.

It's quite hard to look for, I'm not sure if i understand it correctly but do you think I need to create a Sequence?

i'm not sure how to do that either.

` _no = db.Column(db.Integer,db.Sequence('sequence', start=1000, increment=1) , primary_key=True, nullable=True ,autoincrement=True)`

it says : `sqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedTable) relation "sequence" does not exist`
@Arne Yes it is. But there is a subtlety at play here that the literal lists can be re-interpreted. Let me try if I can come up with a MCVE that forbids that.
#Compare
y: List[Bar] = [Bar()]
x: List[Foo] = y  # error: Incompatible types in assignment (expression has type "List[Bar]", variable has type "List[Foo]")
As long as the literal [Bar()] is not assigned anywhere, mypy knows it is "read-only" and thus can be treated as covariant.
Once you assign it, it can then be read and written to, making it invariant.
Otherwise, you could do something like this:
y: List[Bar] = [Bar()]
x: List[Foo] = y
x.append(Foo())
10:03
ohh
ok, I understand now.
thanks =)
FWIW, I wish the docs just had such an example instead of all the in-/co-/contra-variant gibberish.
Do you guys have good recommendations for a statemachine/lifecylce package ala: design.ros2.org/articles/node_lifecycle.html but for python?
We have some state machines that are basically just objects representing the current state, with a dict of the valid next states and their actions.
10:36
Something like github.com/pytransitions/transitions but with code completion for methods and states. This looks super nice, but code completion is a very nice feature
What exactly do you want covered by completion? Modelling the state identifiers as an Enum is a straightforward way to get completion for possible if not valid states at least.
11:14
the transitions functions. The proceeed in the enum example
11:28
but it still looks so good compared to other statemachine libs
and wow this is valid syntax: 1j * 1j didn't know python had built in support for complex numbers
@Hakaishin if 1j is valid then so is 1j * 1j
11:46
Does someone know a dupe roughly for "my async code works fine as top-level in Jupyter but breaks otherwise"?
12:15
Why does async code work fine in jupyter but not otherwise? O.o
AFAIK Jupyter runs an asyncio loop. Every cell/input that uses async code is automatically dispatched to it.
Ooh, handy. Totally not confusing for people who don't know what they're doing, though
my hunch is that async in jupyter code is a mistake
"my hunch is that async is a mistake" fixed it for you
works for me
12:40
@MisterMiyagi +1 :)
12:53
async repl (-m asyncio) is equally bad?
there's an async repl? oO
interesting
I saw in a tutorial site when I started out, easy to to do aiohttp stuff, havent used it much
I never know where to look in the docs to determine what python -m modulename does for any particular module
@python_user I'd say that is less bad because people explicitly opt-in to the different behaviour.
Seen a lot of questions where people confused Jupyter magic with something a proper Python program can/should do
Extremely opt-in because I can't find it officially documented anywhere
13:08
it's our little secret
probably a dirty one
You have to check the locked filling cabinet in the basement of the headquarters behind the door labeled "beware of leopard"
@Kevin That applies to most of asyncio
github.com/python/cpython/pull/13472#issuecomment-495848844 suggests documenting the feature... Eventually
someone should add async in the "how to" page in the official sites, could be a lot useful, I still dont know a go to place for async stuff
@Kevin the task is running in the background. Promise.
13:12
Please hold. [smooth jazz]
github.com/python/cpython/blob/master/Lib/asyncio/__main__.py might be the only cpython .py file I've ever seen that has zero comments and docstrings. It's uncanny.
there is one actually :p
@Kevin I bet it's self-documenting
# NoQA... Ah, suddenly I understand everything
lol, your point stands
It does seem fairly straightforward by async standards
13:16
the more likely explanation is that it is indeed fully undocumented
"People who don't know what they're doing will be confused by this" and "people who don't know what they're doing won't know this exists" cancel each other out
Perfectly balanced, as all things should be
onboarding through obfuscation
user13727121
How do I get my function to call a user input from another function once for validation first? An example of this issue: dpaste.com/7NHUT563R, in that example, it asks the user for their input twice instead of once, I want it to ask for input once, validate the result, if not equal to the desired result, it will ask again
have you tried moving line 5 to line 9 and deleting the parameter in your function?
Keep in mind that doing user_input = whatever inside guess_favourite_number, won't change the value of user_input inside check_guessed_number
if user_input == 10 will never succeed because user_input is the function object you passed to guess_favorite_number as an argument, and functions are never equal to integers
Or, hmm
No, I misread the code
13:30
in your defence the names aren't exactly helpful
Yeah it's rather un-idiomatic to use a verb-like name for anything other than a function
I think what they meant to do was using user_input as global
verb-like is one thing, get_thing is another
If I wanted to make the code work while changing as little as possible, I'd probably do pastebin.com/6eNrWcTj
The big changes being, 1) after calling guess_favourite_number inside check_guessed_number, assign the result to a variable; 2) move the second guess_favourite_number call to the end of the loop so it doesn't ask for input twice in a row; 3) terminate the loop by returning, if the guess is correct
break instead of return would be fine too
If we're free to refactor out variables and such, I'd shave things down to pastebin.com/dXVSK6gE
13:50
Is using a dict as the control flow some design pattern? eg : {'tasks': [{'name': 'fun_1', 'task': 'fun_1'}, {'name': 'fun_2', 'task': 'fun_2'}]} so the code will use getattr and run fun_1 and then iterate to next fun_2 and so on
If "Antipatterns" is a valid part of that group, then yes.
fun part is this json is retrieved from a db :D
code-by-config is in my experience always risky, especially if no one with lots of experience supervises the whole thing
Closest thing that comes to mind is a state machine
Check the current state, perform an action associated with the state, then change the state to something else
Repeat until bored
so the actual way would be to make sure to call fun_1 then fun_1 calls fun_2 at its end and so on?
13:56
Typically the callables that the state machine invokes would not directly call anything else on its own
The easiest way to execute fun_1 and then fun_2 is to skip all of this entirely and just write fun_1(); fun_2()
I see, so how this works now is that the "tasks" list (the value for the key) can have any functions (based on how it is retrieved from the db) so if it only has fun_3 only that will be called, so getattr can not be avoided here?
there is at most 6 possible values, so I could just use an if...else and do the call like you specified ?
I would more like to lean towards Arne's reply, and consider this Antipattern
If the object you're retrieving from the db contains only dicts/lists/strings, then you basically have to choose between getattr and an if...else*
(*or one of the other techniques people use to simulate the switch case feature that Python doesn't have)
I could sneak in match in the new version :p
but overall this is not a pattern that is followed commonly right? I dont want to pick up bad practice
Yeah it's not common
melon Arne and Kevin
14:06
I avoid using getattr unless I'm quite confident that it's the best possible approach
If I'm not sure whether it is, it probably isn't.
I use that if I want to one line stuff at code sites, getattr(deque, 'appendleft' if condition() else 'append')(num)
a switch-casey dispatchy if-else approach is safer, but... You're still kind of, reifying, part of the program flow in a way that may not be necessary
Hi guys if you were to choose a sample for a conversion metric for a group of users how would you define the sample size? would it be on the basis of a date column or would it be on the basis of an unique identifier column?
Consider also (deque.appendleft if condition() else deque.append)(num)
there really isn't a need to use getattr with a string literal and no default.
14:13
ahh that is neat, more reason for me to not use getattr, at work and pretty much everything
14:55
I would like to know if python accepts inputs from bash shell?
If bash can send input to stdin, sure
suppose I have a script written in bash called 'scriptname' which possess one input which is a text file 'filename'. If I want to run this script from terminal I would type: './scriptname filename'
ok, so far so good
What if I want to write another script using Python
*sigh*
14:59
to alter 'filename' first
then passing it to 'scriptname'?
Is that possible?
Sure. Use subprocess.run to execute scriptname from inside python.
IMO, rather than mixing python with another scripting language, it's better to just write the whole thing with one language
But perhaps I'm biased
So, the steps are: opening python and filename inside python using 'with open' then writing some values to that filename, after that how to use the updated filename to use subprocess.run in order to call scriptname for that filename?
Do you know how to use subprocess.run with the initial filename?
not yet
@Kevin I don't know if I really can do that, because scriptname is written by another person in bash
which calls a program for computation purposes
import subprocess
with open("the_file.txt", "w") as file:
    file.write("stuff")
subprocess.run(["./scriptname", "the_file.txt"])
(disclaimer: not tested)
@EnthusiastiC Never mind, then. Rewriting someone else's code is a pain
Rule 1 of Kevin's "Anything goes, as long as it works" programming dojo: anything goes, as long as it works
15:12
@Kevin I hope I could rewrite everything in python. :)
Just there is one point here to mention.
that python script needs to open each time I need to execute ./scriptname filename, right?
I suppose, yeah
mmm, that's not worth it.
because the filename
is good as it is.
I want to write a lazy script.
I'm not exactly sure what the goal here is but there's a good chance that the powers of bash and Python combined can solve it in a seamless way
15:31
@Kevin Does python accept command-line arguments as bash language does?
@EnthusiastiC might want to google that
you can cancle the bash and part ;)
I mean in bash shell command line
not in python command line.
What is the "python command line"?
15:34
cbg
Hi! anyone has experience with Scipy ? the correlate2D function inside the Signal package of Scipy is returning correlation coefficients higher than 1 .... and I don't have any clue why ....
interactive window.
or IDLE.
@Raquel hello. Not with that function specifically, but you should go ahead and ask your question.
@AndrasDeak Eventually, I want something like this,

./pythonscript filename value1 value2 value3
Dang, my first google hit for "Does python accept command-line arguments" talks for like five paragraphs before it mentions sys.argv
15:37
values are arguments in pythonscript
@EnthusiastiC Check this out: python.org/doc
I see. sys.argv has to be included in pythonscript file.
It would certainly help
@Raquel or if that was all of your question: the function's docs isn't very verbose about what it does so perhaps a larger-than-one result is normal. Have you checked the cross-correlation of an array with itself?
@Kevin unless argparse and friends
did I miss the memo? Is there a pythonscript that I don't know about or is that just a way of saying my_script.py?
15:40
@inspectorG4dget latter
@inspectorG4dget my_script.py.
in that case, I completely agree. sys.argv and argparse are your best friends here.
feel free to ask a much more detailed question. I'm quite familiar with both and use them quite regularly
@inspectorG4dget don't get your hopes up
although, I do have a preference for argparse for its flexibility. I just wish I had the time to probe into subparsers. Those seem like a lot of fun, and very powerful in their ability to extend the aforementioned flexibility
@AndrasDeak that was all my question ... I found that someone had the same issue here one month ago stackoverflow.com/questions/65856102/…. button answers yet ...
15:42
@AndrasDeak :(
@inspectorG4dget reading surrounding discussion around chat.stackexchange.com/transcript/message/57294452#57294452 might be helpful
@Raquel hehe, spellchecker strikes again
@EnthusiastiC please take a look at argparse before fiddling with sys.argv
That reminds me, I still need to figure out why my default file association for .py files seemingly eats all command line args
C:\Users\kevin\Contacts\Desktop>type test.py
import sys; print(sys.argv)

C:\Users\kevin\Contacts\Desktop>python test.py foo bar baz
['test.py', 'foo', 'bar', 'baz']

C:\Users\kevin\Contacts\Desktop>test.py foo bar baz
['C:\\Users\\kevin\\Contacts\\Desktop\\test.py']
@Raquel how large values above 1 are we talking? 0.1 or 1e-12?
@AndrasDeak uh oh. I think I rushed in where angels fear to tread
15:45
@Kevin I think that's what I am searching for.
@AndrasDeak numbers are like maximum 2.7 , but it is a correlation so not should be higher than 1
@Raquel that's clearly not the case
In [60]: arr = np.random.rand(2, 3)

In [61]: sgn.correlate2d(arr, arr)
Out[61]:
array([[0.12691559, 0.1958835 , 0.33475512, 0.23987517, 0.11215362],
       [0.43393125, 0.43283463, 1.08754086, 0.43283463, 0.43393125],
       [0.11215362, 0.23987517, 0.33475512, 0.1958835 , 0.12691559]])

In [62]: arr = np.random.rand(2, 3)*10

In [63]: sgn.correlate2d(arr, arr)
Out[63]:
array([[ 81.823015  , 123.50914544, 129.32478971,  48.87466962,
         12.91304959],
       [ 92.51425875, 215.27963074, 351.45463668, 215.27963074,
As I said, since the documentation doesn't define what it calls correlation it's a bit muddy.
@Raquel I think it does what correlate does, which doesn't include a division in the result
I suspect one reason for this is that this way it works for integral values, returning an integer
The correlation z of two d-dimensional arrays x and y is defined as:

z[...,k,...] = sum[..., i_l, ...] x[..., i_l,...] * conj(y[..., i_l - k,...])
if you need normalization you'll have to normalize the result
How is this valid? os.nice(20)
I checked man nice and it says it goes from -20 to 19, the python doc doesn't really say what happens if values are outside
@Hakaishin there's your answer?
$ renice 20 3619469
3619469 (process ID) old priority 0, new priority 19
neither does the man page?
15:55
I bet python just passes it on, and the OS does what it wants with it
@AndrasDeak ok so then all the results from this correlation are without normalisation ... the thing was that with one data set I got coefficients lower than 1 and there is other with the same characteristics which returns this "not normal coefficients " but maybe the results of the one I though they were normal maybe they need normalisation too XD
@Raquel yeah, probably the one with low values either had low values in the signal to begin with, or the correlation is just bad :)
@AndrasDeak thanks :)
@AndrasDeak thanks !
Can you explain why this error has reported?

f.write(f"{str(n)}\n".encode("utf8"))
TypeError: write() argument must be str, not bytes
15:56
no problem
@Kevin Didn't have until PEP 634 was accepted ...
I pretend I do not see it ( ͡- ͜ʖ ͡-)
@EnthusiastiC If you want to write a bytes object to a file, you must open it in "b" mode
ah that 's why he included b in 'with open(filename, "wb") as f:'
Yes
I omitted b.
16:00
beware the fury of The Great Cargo
One time my program broke for an entire week because I didn't open my output file in b mode. True story.
lol
it happens.
'Course this was in my C++ days, where opening without b mode doesn't change the argument types, it just silently combines \r and \n on your behalf
to b or not to b...you know the rest
I was trying to formulate a joke around "don't trust the b in apartment 23" but yours is more culturally relevant
16:50
what's the easy way to say "a variable which holds just one value"? scalar? but that's a bit technical. like x = 3 vs y = [5, 6] - y is a list of values, what is 'x'? "single integer"?
@Code-Apprentice no, that means something else :P
@aneroid In Java, I'd call it a "primitive" type.
@Aran-Fey did our salad language change?
@aneroid every variable holds just one value. That value might hold other values.
or you are just poking fun at the happy juxtaposition with the previous quesiton?
16:52
Oh, I am lying. A variable may hold zero or one value. Blimey.
@Code-Apprentice juxtaposition
@MisterMiyagi fair point
@MisterMiyagi None is a value
so I think your first claim is accurate
@Code-Apprentice Yet a: int is a variable that holds no value.
@Code-Apprentice even if that applied, what do we call it in Python?
16:53
you can do that? And it's value isn't None?
@aneroid /shrug
@Code-Apprentice Good ole UnboundLocalError.
huh
TIL
hmm...so NameError is "name is not defined", so does the variable even exist?
ninja strike
depends on if it's global or local:
>>> a: int
>>> a
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'a' is not defined
>>> def foo():
...     a: int
...     print(a)
...
>>> foo()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 3, in foo
UnboundLocalError: local variable 'a' referenced before assignment
which error you get, I mean
so in a local context a: int appears to allocate the variable on the call stack. But you run into problems if you don't assign it before access.
in a global context, a: int doesn't appear to allocate the variable at all.
In order to ponder whether an unbound global name actually exists, it takes a research team and five years on a lonely mountain top. BYOB.
17:06
I have a long text in a file called 'filename' and I want to use python ( with sys.argv) to find the following lines and add values in the fourth column such that,
before:
1 407 2001
1 407 1203
1 407 511
1 407 1205
after:
1 407 2001 0.1
1 407 1203 0.2
1 407 511 0.3
1 407 1205 0.4
"Find the following lines" based on what criteria? What's special about those lines? How are they different from the other lines?
Eventually, the values 0.1 0.2 0.3 0.4 become command line input arguments for a python script.
@MisterMiyagi and a metaphysicist
@MisterMiyagi preferably yes
@EnthusiastiC but how do you know which lines are important?
17:10
That tells me exactly nothing. How can I tell apart important lines and unimportant lines?
inb4
or I should say Kevin'd!
@EnthusiastiC You do not intend to eventually pass such "long text" via "sys.argv", do you?
@MisterMiyagi preferably yes.
"sys.argv" is important to store those values only
So which part do you need help with? Do you know how to read a file in Python? Do you know how to iterate over the lines of a file? Do you know how to write out to a file? Break the problem down into smaller parts and solve each of those.
and if you need help with a specific part, we are more than happy to give some pointers
@EnthusiastiC And you are aware that there is a limit to the size that can be passed via argv, yes?
17:14
@MisterMiyagi size as in the number of elements in the list? or the total number of characters?
I heard that, but not exactly aware of it.
I don't need many
probably about ten arguments.
what is the limit of sys.argv?
@Code-Apprentice Indeed I know the basics though.
@Code-Apprentice this is part where I have to think of it "how to iterate over the lines of a file"
@EnthusiastiC My suggestion is to first learn how to iterate over each line and print it out. Then figure out what to do next from there.
tell me, I don't have to match by keywords?
tell you what?
such that I tell python to find those lines first then add values at the end.
17:21
You have to define clearly what lines are "important". Python doesn't magically know.
On my system (MacOS) the argv limit is 256KiB.
How do you differentiate important lines from those that aren't important?
what is the logic behind this task?
That's exactly the question you have to answer.
Important lines I meant are
1 407 2001
1 407 1203
1 407 511
1 407 1205
17:23
Why are those important?
What are examples of non-important lines?
@Code-Apprentice you made me laugh enough.
Now I'm suspecting a troll
those lines I need to add values I mentioned before.
@Code-Apprentice no, genuine cluelessness. Still, the result is the same: stop
and if you genuinely need help, answer my questions...conversation is over
17:24
@EnthusiastiC I'm not surprised to see we're in the same situation, so please stop now.
@AndrasDeak yah, I guess it takes me longer than some folks around here to give up.
Feb 20 at 12:29, by Andras Deak
@EnthusiastiC I tried helping you multiple times. Each time I saw the same thing: you either not reading properly what you're told, or just not being able to understand what people try to tell you. Then you keep asking the same thing over and over again, hoping to get the answer you expect (but then why ask in the first place?).
Please try to ask for help elsewhere now, @EnthusiastiC. We're not getting anywhere.
it might be my speaking in English is not clear enough to answer your question.
but I am doing my best to explain my question.
@EnthusiastiC My final suggestion: write some code to read each line in a file then print it out. Then we can talk about more specific details.
@EnthusiastiC I know you are, but unfortunately that doesn't change the situation that we're not getting anywhere
17:28
@Code-Apprentice you said why those specific lines, I answered because those lines which I need in my question.
@AndrasDeak "Code-Apprentice" who should answer like that not you.
I have a responsibility to protect the sanity of the kind experts who frequent this room.
@EnthusiastiC What we are asking about are the rules by which you decide which lines you need or not.
17:53
to anyone who cares to respond:

What things have *you* learned that make *your* Python better than average?
And in what way is it better?
18:12
ternary operator, enumerate(...), for my_dict[key] in my_list, class inheritance MRO, collections.namedtuple, subprocess.call and piping back stdout,stderr; tqdm, pandas pivot, type contract checking decorators, list/dict/set comprehensions, generator functions, multiprocessing, async
for my_dict[key] in my_list? O.o
The best code is no code.
I use that sort of thing in dictionary updates all the time
it's really too bad I can't do for k = my_dict['k'] in my_list
Could you post an example of how you'd use this? I really can't wrap my head around this
for mydict['name'], mydict['value'] in otherdict.items():
    # mess around with mydict['value'] here
    cur.execute(update_table_query, mydict)
18:24
Oh, I see. Interesting idea
18:35
Is there anyway to train a model on words?
@chess_lover_6 Yes, read any good tutorial on NLP. Start with n-grams and xgboost, then go straight to PyTorch with word-vector.
you did not have to make me hungry again :P
anyone use flake8? I'm trying to grok this and my human hardware is failing me
i used to use it. what do you want to know?
18:47
@smci thx a lot
@chess_lover_6 xgboost with 2-grams with a list of stopwords, and punctuation and whitespace-cleaning, is a good startpoint for a first model (at least for 2-class and multiclass classification). Look at your confusion classes and fails, and iterate...
@MisterMiyagi Technically, variables don't exist until they "have a value". (Names aren't bound until they are the object of an assignment). Discuss.
@EnthusiastiC Someone sought clarification: having read a line, how do you know whether it needs to be processed or not? I haven't seen an answer to that question yet.
I know flake8 enforces PEP8 and has a bunch of errors pertaining to specific violations. However, I wonder if it allows me to implement my own rules. For (as a really dumb) example: if I wanted two spaces around arithmetic operators, I would need to first disable the "one space around arithmetic operators" rule. But then how do I add this new rule?
did you run into this page already? flake8.pycqa.org/en/latest/user/using-plugins.html
I just disabled flake8 after it got in an unseemly fight with black about the formatting of slices.
It's in disgrace until I can figure out how to get pre-commit to configure it properly.
19:03
@Arne I'm sorry, I was unable to see a solution to my problem on that page. Perhaps I misunderstand how flake8 works at all?
or is flake8 a barebones engine that'll run any other set of configurations offered by (say) black, which then becomes the thing I need to fiddle with?
no, flake8 should be a linter, giving it's own suggestions based on your code. afaik. what is your problem?
ah i see it, you want to add rules
so, flake8 just runs a number of very basic rules. usually, you'll have a bunch of plugins that suite your taste along with it, I think I had pep8-naming flake8-docstrings flake8-import-order as well.
0
Q: How to add custom Flake8 rules?

techebTestIs there any way to add custom rules to flake8? There are bunch of rules here https://lintlyci.github.io/Flake8Rules/ but I can't find the rules' source code in flake8's git repo. I want to write a custom rule.

google fu
many thanks Paritosh!
that first paragraph in the answer was exactly what I needed. Thank you
19:39
@holdenweb It all comes down to how you define "exist", of course, but some traces of the variable are present in the process before it gets bound. By the time the program's bytecode is compiled, Python knows whether the variable is global, local, or nonlocal; and it knows the position the variable will have in the frame object's table(s). When execution reaches the variable's scope, the frame is created, and the table allocates space for the variable, although that space still holds only null
At this point one might argue the null pointer in the frame's table is "a variable holding no value". Then a fight will break out among the crowd about whether Thing* x = null; can really be said to be a Thing, and the ritual combat will begin, as is traditional.
06:00 - 20:0020:00 - 23:00

« first day (3798 days earlier)      last day (1375 days later) »