All Questions
Tagged with global namespaces
81
questions
0
votes
1
answer
91
views
Accessing a boolean field outside of a namespace
I am reading the book of the art of assembly language to learn assembly language. In the topic of namespaces, it is mentioned that to access the names outside of a namespace, we can use e @global: ...
0
votes
2
answers
102
views
No naming conflict from two functions in global namespace (C++)?
I created two files, Linkage.cpp and External.cpp.
Linkage.cpp:
#include <iostream>
void Log(int x = 5)
{
std::cout << x << "\n";
}
int main()
{
Log();
return ...
1
vote
1
answer
271
views
what is difference between scope and namespace in javascript
hi everyone . actually I'm newly learning Javascript . I read about scopes in javascript . then I read somewhere about namespace in Js and i was wondered if namespace is exactly the same as scope , so ...
1
vote
0
answers
507
views
Using global function with imported namespace
So recently my colleague suggested prefixing global PHP functions with \ or importing them via use function. He suggested some performance improvements as prefixing the function will tell PHP to ...
0
votes
0
answers
455
views
How to create and update a global variable in Jinja?
I'd like to create a global (boolean) variable with Jinja and update it in an if-statement. I try to do this as follows:
{% set variable = true %}
{% if True %}
{% set variable = false %}
{% ...
0
votes
1
answer
987
views
Sitcone in c# could not be found in etc
i get sitcon cant be foundt
Warning MSB3245 Could not resolve this reference. Could not locate the assembly "Siticone.UI". Check to make sure the assembly exists on disk. If this reference ...
0
votes
0
answers
25
views
Namespace vs global in PHP Functions? [duplicate]
I've got a $db variable (and others) in my global config and I've seen some sample code recently like:
function getInfo(\My\Namespace\DB $db) {...}
and then calling getInfo($db);
but I'm used to just ...
-1
votes
1
answer
56
views
Is the global name 'a' in the same namespace as the module?
import math
a = 1
def my_func():
print('don\'t downvote')
my_func()
I believe that the function invocation my_func( ) lies in the local namespace created for the function my_func( ) - ready ...
1
vote
0
answers
19
views
python: manipulating the global name space vs explicit assignment of object reference
I've been reading plenty of posts here stating that one should never manipulate the global namespace. I understand the concerns WRT good coding practice (I.e., keep things localized where you can, ...
0
votes
1
answer
64
views
Keyword to specify ambiguous/global namespace?
In this code snippet, found here.
void f() {
d1++; // error: ambiguous ::d1 or D::d1?
::d1++; // OK <----**This one**
D::d1++; // OK
d2++; // OK, d2 is D::d2
e++; // OK: e is E:...
1
vote
0
answers
357
views
Changing a global variable value inside a php namespace
I need to change a global variable inside a namespace in PHP.
I'm currently refactoring some legacy code and a section of the code relies on the use of a global variable, which used to be configured ...
2
votes
1
answer
2k
views
Refer to global declared namespace type in custom definition
There is a past question on this topic, but no answer was posted:
How do you import a Typescript type definition file whose top level element is a non-exported namespace?
I want to make a type for ...
1
vote
1
answer
86
views
python global namespace not accessible
I can run API.py, but not the APP.py in the same directory. The error is "NameError: name 'a' is not defined". Is global() really global?
API.py:
class Entity():
def __init__(self,name,value):
...
0
votes
1
answer
582
views
Accessing Python namespace from other Python process
Let's that I have the following Python script script.py:
a = 1
b = 10
for i in range(b):
a += 1
print(a)
I know that I can use globals() inside this script.py in order to show the namespace:
{...
1
vote
0
answers
46
views
Confusion about global namespaces in modules
I wanted to explore what the global namespace looks like in different modules.
I came up with the following simple test:
in a file called test_module.py:
def test1():
return globals()
in a ...